Update examples/perplexity/perplexity.cpp

Co-authored-by: compilade <git@compilade.net>
This commit is contained in:
Justine Tunney 2024-05-21 16:20:25 -07:00 committed by GitHub
parent cc363da1b6
commit 6b178988f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -639,7 +639,7 @@ static results_perplexity perplexity(llama_context * ctx, const gpt_params & par
for (int seq = 0; seq < n_seq_batch; seq++) {
const float * all_logits = num_batches > 1 ? logits.data() : llama_get_logits_ith(ctx, seq*n_ctx + first);
if (!all_logits) {
return 1;
return {std::move(tokens), -1, {}, {}};
}
llama_token * tokens_data = tokens.data() + start + seq*n_ctx + first;