]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
vocab : fix double-eos check (#11273)
authorGeorgi Gerganov <redacted>
Fri, 17 Jan 2025 07:28:00 +0000 (09:28 +0200)
committerGitHub <redacted>
Fri, 17 Jan 2025 07:28:00 +0000 (09:28 +0200)
ggml-ci

src/llama-vocab.cpp

index 4969d2628c131e1187d4cb85e934936381c88974..9a680aed4dcfdbee3203b473aa07e43424588720 100644 (file)
@@ -439,7 +439,7 @@ struct llm_tokenizer_bpe_session {
                 "also starts with a BOS token. So now the final prompt starts with 2 BOS tokens. "
                 "Are you sure this is what you want?\n", __FUNCTION__);
         }
-        if (vocab.get_add_bos() && output.size() >= 2 && *(output.end()-2) == vocab.token_eos()) {
+        if (vocab.get_add_eos() && output.size() >= 2 && *(output.end()-2) == vocab.token_eos()) {
             LLAMA_LOG_WARN(
                 "%s: Added a EOS token to the prompt as specified by the model but the prompt "
                 "also ends with a EOS token. So now the final prompt ends with 2 EOS tokens. "