llama : add llama_token_is_eog()

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-04-20 16:46:46 +03:00
parent f3105b9eec
commit 3750706962
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
18 changed files with 76 additions and 46 deletions

View file

@ -359,7 +359,7 @@ int main(int argc, char ** argv) {
// client.id, client.seq_id, id, client.n_decoded, client.i_batch, token_str.c_str());
if (client.n_decoded > 2 &&
(id == llama_token_eos(model) ||
(llama_token_is_eog(model, id) ||
(params.n_predict > 0 && client.n_decoded + client.n_prompt >= params.n_predict) ||
client.response.find("User:") != std::string::npos ||
client.response.find('\n') != std::string::npos)) {