perplexity : add clarifying comments
This commit is contained in:
parent
cdf40a9bea
commit
0e94ea65c6
1 changed files with 2 additions and 0 deletions
|
@ -54,6 +54,7 @@ void perplexity(llama_context * ctx, const gpt_params & params) {
|
||||||
// save original token and restore it after eval
|
// save original token and restore it after eval
|
||||||
const auto token_org = tokens[batch_start];
|
const auto token_org = tokens[batch_start];
|
||||||
|
|
||||||
|
// add BOS token for the first batch of each chunk
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
tokens[batch_start] = llama_token_bos();
|
tokens[batch_start] = llama_token_bos();
|
||||||
}
|
}
|
||||||
|
@ -63,6 +64,7 @@ void perplexity(llama_context * ctx, const gpt_params & params) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restore the original token in case it was set to BOS
|
||||||
tokens[batch_start] = token_org;
|
tokens[batch_start] = token_org;
|
||||||
|
|
||||||
const auto batch_logits = llama_get_logits(ctx);
|
const auto batch_logits = llama_get_logits(ctx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue