server : send partial stop string when <EOG> is reached (#15007)

This commit is contained in:
matteo 2025-10-23 11:32:24 +02:00 committed by GitHub
parent 9de9672adb
commit 8cf6b42d46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -2839,7 +2839,7 @@ struct server_context {
slot.generated_text.begin() + pos + stop_pos,
slot.generated_text.end());
pos = std::min(slot.n_sent_text, slot.generated_text.size());
} else if (slot.has_next_token) {
} else if (slot.has_next_token && !llama_vocab_is_eog(vocab, result.tok) ) {
stop_pos = slot.find_stopping_strings(str_test, token_str.size(), false);
send_text = stop_pos == std::string::npos;
}