Skip to content

Commit 1ebbadd

Browse files
authored
perplexity : update comments/error msg to use decode [no ci] (#15227)
This commit updates comments and error messages to use "decode" instead of "eval" in perplexity.cpp. The motivation for this is that `llama_eval` was renamed to `llama_decode` a while ago, but the comments and error messages still referred to "eval". This change ensures consistency and clarity.
1 parent a3a7874 commit 1ebbadd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/perplexity/perplexity.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static results_perplexity perplexity(llama_context * ctx, const common_params &
525525
}
526526

527527
// We get the logits for all the tokens in the context window (params.n_ctx)
528-
// from llama_eval above. Now, based on https://huggingface.co/docs/transformers/perplexity,
528+
// from llama_decode below. Now, based on https://huggingface.co/docs/transformers/perplexity,
529529
// calculate the perplexity over the last half of the window (so the model always has
530530
// some context to predict the token).
531531
//
@@ -559,7 +559,7 @@ static results_perplexity perplexity(llama_context * ctx, const common_params &
559559
for (int seq = 0; seq < n_seq_batch; seq++) {
560560
int seq_start = batch_start + seq*n_ctx;
561561

562-
// save original token and restore it after eval
562+
// save original token and restore it after decode
563563
const auto token_org = tokens[seq_start];
564564

565565
// add BOS token for the first batch of each chunk
@@ -584,7 +584,7 @@ static results_perplexity perplexity(llama_context * ctx, const common_params &
584584
}
585585

586586
if (llama_decode(ctx, batch)) {
587-
LOG_INF("%s : failed to eval\n", __func__);
587+
LOG_INF("%s : failed to decode\n", __func__);
588588
return {tokens, -1, logit_history, prob_history};
589589
}
590590

0 commit comments

Comments
 (0)