Fixed a crash caused by erasing from empty last_n_tokens
This commit is contained in:
parent
5f6e16da36
commit
f7882e2d69
1 changed files with 4 additions and 1 deletions
|
@ -251,7 +251,10 @@ struct llama_server_context
|
|||
id = llama_sample_token(ctx, &candidates_p);
|
||||
}
|
||||
}
|
||||
last_n_tokens.erase(last_n_tokens.begin());
|
||||
if (!last_n_tokens.empty())
|
||||
{
|
||||
last_n_tokens.erase(last_n_tokens.begin());
|
||||
}
|
||||
last_n_tokens.push_back(id);
|
||||
num_tokens_predicted++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue