don't create a new std::string (especially here, where it's usually large)

This commit is contained in:
Green Sky 2023-03-22 12:58:20 +01:00
parent 7b1b575fe8
commit 57fee166d2
No known key found for this signature in database

View file

@ -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 // 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` // Run `./main --perplexity -m models/7B/ggml-model-q4_0.bin -f wiki.test.raw`
// Output: `perplexity: 13.5106 [114/114]` // 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; int count = 0;
double nll = 0.0; double nll = 0.0;