From 57fee166d2b5714ceae8266fc61c371737d55dea Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 22 Mar 2023 12:58:20 +0100 Subject: [PATCH] don't create a new std::string (especially here, where it's usually large) --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index c164c102d..fbb43a8cc 100644 --- a/main.cpp +++ b/main.cpp @@ -85,7 +85,7 @@ void perplexity(llama_context * ctx, const gpt_params & params) { // Download: https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-2-raw-v1.zip?ref=salesforce-research // Run `./main --perplexity -m models/7B/ggml-model-q4_0.bin -f wiki.test.raw` // Output: `perplexity: 13.5106 [114/114]` - auto tokens = ::llama_tokenize(ctx, params.prompt.c_str(), true); + auto tokens = ::llama_tokenize(ctx, params.prompt, true); int count = 0; double nll = 0.0;