Skip to content

Commit

Permalink
change deepseek-lite to deepseek2
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Jun 27, 2024
1 parent 7d9117a commit 736c494
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -19628,7 +19628,7 @@ static int32_t llama_chat_apply_template_internal(
}
}
if (add_ass) {
ss << "Assistant: ";
ss << "Assistant:";
}
} else {
// template not supported
Expand Down
4 changes: 2 additions & 2 deletions tests/test-chat-template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<用户>Hello<AI>Hi there<用户>Who are you<AI>I am an assistant<用户>Another question<AI>",
// 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<char> formatted_chat(1024);
int32_t res;
Expand Down

0 comments on commit 736c494

Please sign in to comment.