diff --git a/src/llama.cpp b/src/llama.cpp index 80b81fda0..c0d18fd26 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -19614,8 +19614,8 @@ static int32_t llama_chat_apply_template_internal( ss << trim(message->content); } } - } else if (tmpl == "deepseek-lite" || tmpl_contains("'Assistant: ' + message['content'] + eos_token")) { - // DeepSeek-Coder-V2-Lite-Instruct-GGUF + } else if (tmpl == "deepseek2" || tmpl_contains("'Assistant: ' + message['content'] + eos_token")) { + // DeepSeek-V2 std::string eos_token = u8"<|end▁of▁sentence|>"; for (auto message : chat) { std::string role(message->role); @@ -19628,7 +19628,7 @@ static int32_t llama_chat_apply_template_internal( } } if (add_ass) { - ss << "Assistant: "; + ss << "Assistant:"; } } else { // template not supported diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index f14f77981..a2d1b4f86 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -100,8 +100,8 @@ int main(void) { "<|system|>\nYou are a helpful assistant<|end|>\n<|user|>\nHello<|end|>\n<|assistant|>\nHi there<|end|>\n<|user|>\nWho are you<|end|>\n<|assistant|>\n I am an assistant <|end|>\n<|user|>\nAnother question<|end|>\n<|assistant|>\n", // MiniCPM-3B-OpenHermes-2.5-v2-GGUF u8"You are a helpful assistant<用户>HelloHi there<用户>Who are youI am an assistant<用户>Another question", - // DeepSeek-Coder-V2-Lite-Instruct-GGUF - u8"You are a helpful assistant\n\nUser: Hello\n\nAssistant: Hi there<|end▁of▁sentence|>User: Who are you\n\nAssistant: I am an assistant <|end▁of▁sentence|>User: Another question\n\nAssistant: ", + // DeepSeek-V2 + u8"You are a helpful assistant\n\nUser: Hello\n\nAssistant: Hi there<|end▁of▁sentence|>User: Who are you\n\nAssistant: I am an assistant <|end▁of▁sentence|>User: Another question\n\nAssistant:", }; std::vector formatted_chat(1024); int32_t res;