We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbd45bf commit bff549dCopy full SHA for bff549d
common/chat.cpp
@@ -604,13 +604,10 @@ static common_chat_params common_chat_params_init_deepseek_r1(const common_chat_
604
}
605
606
// Fix up tool call delta example added by Minja
607
- std::string marker = "<|tool▁call▁end|>\n";
608
- auto pos = prompt.rfind(marker);
609
- if (pos != std::string::npos) {
610
- prompt.insert(pos + marker.size() - 1, "<|tool▁calls▁end|>");
611
- } else {
612
- LOG_WRN("Failed to find expected broken tool call example marker in prompt\n");
613
- }
+ prompt = std::regex_replace(
+ prompt,
+ std::regex("<|tool▁call▁end|>[\\s\\r\\n]*<|User|>"),
+ "<|tool▁call▁end|><|tool▁calls▁end|><|User|>");
614
615
data.prompt = prompt;
616
data.format = COMMON_CHAT_FORMAT_DEEPSEEK_R1;
0 commit comments