From 0427e6563b8934ccbdfddd076cf03f0db03ad8e4 Mon Sep 17 00:00:00 2001 From: juk Date: Fri, 29 Nov 2024 14:30:01 +0000 Subject: [PATCH] Removed `'mistral-v2'` option as no (open) models ever used it --- src/llama.cpp | 2 +- tests/test-chat-template.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index d52336fd3..158c50e8d 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -21878,7 +21878,7 @@ static int32_t llama_chat_apply_template_internal( ss << " " << content << ""; } } - } else if (tmpl == "mistral-v1" || tmpl == "mistral-v2" || tmpl == "mistral-v3" || tmpl == "mistral-v3-tekken" + } else if (tmpl == "mistral-v1" || tmpl == "mistral-v3" || tmpl == "mistral-v3-tekken" || tmpl_contains("' [INST] ' + system_message") // catches official v1 template || tmpl_contains("[AVAILABLE_TOOLS]")) { // catches official 2/v3/v3-tekken templates // Official mistral v1/v2/v3/v3-tekken templates diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index f0a98aeb0..2a3ab4f05 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -171,7 +171,6 @@ int main(void) { }; assert(fmt_sys("chatml") == "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n"); assert(fmt_sys("mistral-v1") == " [INST] You are a helpful assistant\n\n"); - assert(fmt_sys("mistral-v2") == "[INST] You are a helpful assistant\n\n"); assert(fmt_sys("mistral-v3") == "[INST] You are a helpful assistant\n\n"); assert(fmt_sys("mistral-v3-tekken") == "[INST]You are a helpful assistant\n\n"); assert(fmt_sys("mistral-v7") == "[SYSTEM_PROMPT] You are a helpful assistant[/SYSTEM_PROMPT]"); @@ -196,7 +195,6 @@ int main(void) { }; assert(fmt_single("chatml") == "\n<|im_start|>user\nHow are you<|im_end|>\n<|im_start|>assistant\n"); assert(fmt_single("mistral-v1") == " [INST] How are you [/INST]"); - assert(fmt_single("mistral-v2") == "[INST] How are you[/INST]"); assert(fmt_single("mistral-v3") == "[INST] How are you[/INST]"); assert(fmt_single("mistral-v3-tekken") == "[INST]How are you[/INST]"); assert(fmt_single("mistral-v7") == "[INST] How are you[/INST]");