diff --git a/common/chat.cpp b/common/chat.cpp index 94fb5a8a0b..bad53e8b5a 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -1979,7 +1979,7 @@ static common_chat_params common_chat_params_init_deepseek_v3_2(const common_cha return data; } -// Cohere2-MoE (a.k.a. "North Code") parser. +// Cohere2 MoE (a.k.a. "North Code") parser. // // The assistant turn is fully marker-wrapped: // <|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> @@ -1995,7 +1995,7 @@ static common_chat_params common_chat_params_init_deepseek_v3_2(const common_cha // parser literal therefore only covers the stable <|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> prefix // and the reasoning rule consumes the <|START_THINKING|> ... <|END_THINKING|> markers itself, // regardless of whether they came from the generation prompt or the generated text. -static common_chat_params common_chat_params_init_cohere2_moe(const common_chat_template & tmpl, +static common_chat_params common_chat_params_init_cohere2moe(const common_chat_template & tmpl, const autoparser::generation_params & inputs) { common_chat_params data; @@ -2367,13 +2367,13 @@ std::optional common_chat_try_specialized_template( return common_chat_params_init_kimi_k2(tmpl, params); } - // Cohere2-MoE / North Code - marker-wrapped format with <|START_TEXT|> content and + // Cohere2 MoE / North Code - marker-wrapped format with <|START_TEXT|> content and // <|START_ACTION|> JSON tool calls. <|START_TEXT|> is unique to this template (the older // Command-R templates use <|START_RESPONSE|>). if (src.find("<|START_TEXT|>") != std::string::npos && src.find("<|START_ACTION|>") != std::string::npos) { - LOG_DBG("Using specialized template: Cohere2-MoE\n"); - return common_chat_params_init_cohere2_moe(tmpl, params); + LOG_DBG("Using specialized template: Cohere2 MoE\n"); + return common_chat_params_init_cohere2moe(tmpl, params); } if (is_lfm2_template(src)) { diff --git a/models/templates/Cohere2-MoE.jinja b/models/templates/Cohere2MoE.jinja similarity index 100% rename from models/templates/Cohere2-MoE.jinja rename to models/templates/Cohere2MoE.jinja diff --git a/tests/test-chat.cpp b/tests/test-chat.cpp index b2bcebe72d..29fd3db823 100644 --- a/tests/test-chat.cpp +++ b/tests/test-chat.cpp @@ -2645,12 +2645,12 @@ static void test_template_output_peg_parsers(bool detailed_debug) { } { - // Cohere2-MoE (North Code) - dedicated parser. + // Cohere2 MoE (North Code) - dedicated parser. // Marker-wrapped format: <|START_THINKING|>...<|END_THINKING|> then either // <|START_TEXT|>...<|END_TEXT|> (content) or <|START_ACTION|>[json]<|END_ACTION|> (tools). // The generation prompt forces a leading <|START_THINKING|>, so model output begins inside // the thinking block: test inputs start with the reasoning body, not the <|START_THINKING|> tag. - auto tst = peg_tester("models/templates/Cohere2-MoE.jinja", detailed_debug); + auto tst = peg_tester("models/templates/Cohere2MoE.jinja", detailed_debug); // Content with reasoning, extracted. tst.test("I'm\nthinking<|END_THINKING|><|START_TEXT|>Hello, world!\nWhat's up?<|END_TEXT|>")