From: Georgi Gerganov Date: Tue, 13 Jan 2026 15:40:13 +0000 (+0200) Subject: vocab : fix attribute overrides for harmony (#18806) X-Git-Tag: upstream/0.0.8067~341 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=e4832e3ae4d58ac0ecbdbf4ae055424d6e628c9f;p=pkg%2Fggml%2Fsources%2Fllama.cpp vocab : fix attribute overrides for harmony (#18806) * vocab : fix attribute overrides for harmony * cont : add warning log --- diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp index a20c6525e..7cde0355e 100644 --- a/src/llama-vocab.cpp +++ b/src/llama-vocab.cpp @@ -2436,7 +2436,10 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) { auto & attr = id_to_token[t.second].attr; if (t.first == "<|channel|>" || t.first == "<|message|>" || t.first == "<|start|>" || t.first == "<|constrain|>") { - attr = (llama_token_attr) (attr | LLAMA_TOKEN_ATTR_USER_DEFINED); + LLAMA_LOG_WARN("%s: setting token '%s' (%d) attribute to USER_DEFINED (%u), old attributes: %u\n", + __func__, t.first.c_str(), t.second, LLAMA_TOKEN_ATTR_USER_DEFINED, attr); + + attr = LLAMA_TOKEN_ATTR_USER_DEFINED; } } @@ -2489,7 +2492,7 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) { special_eog_ids.erase(end_id); auto & attr = id_to_token[end_id].attr; - attr = (llama_token_attr) (attr | LLAMA_TOKEN_ATTR_USER_DEFINED); + attr = LLAMA_TOKEN_ATTR_USER_DEFINED; LLAMA_LOG_WARN("%s: special_eog_ids contains both '<|return|>' and '<|call|>', or '<|calls|>' and '<|flush|>' tokens, removing '<|end|>' token from EOG list\n", __func__); }