From 0db98812858a38d8121638ad39552e2778301212 Mon Sep 17 00:00:00 2001 From: ochafik Date: Tue, 4 Feb 2025 10:30:10 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20r1=20grammar=20since=20we=20made=20=20optional?= =?UTF-8?q?=20(triggering=20on=20just=20<=EF=BD=9Ctool=E2=96=81call?= =?UTF-8?q?=E2=96=81begin=EF=BD=9C>=20for=207B's=20sake)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/chat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/chat.cpp b/common/chat.cpp index daeb8e0d0..e0cd144b0 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -580,7 +580,7 @@ static common_chat_params common_chat_params_init_deepseek_r1(const common_chat_ // Distill Qwen 7B & 32B models seem confused re/ syntax of their tool call opening tag, // so we accept common variants (then it's all constrained) builder.add_rule("root", - "( \"<|tool▁calls▁begin|>\" | \"<|tool_calls_begin|>\" | \"<|tool calls begin|>\" | \"<|tool\\\\_calls\\\\_begin|>\" ) " + "( \"<|tool▁calls▁begin|>\" | \"<|tool_calls_begin|>\" | \"<|tool calls begin|>\" | \"<|tool\\\\_calls\\\\_begin|>\" )? " "(" +string_join(tool_rules, " | ") + ")" + (inputs.parallel_tool_calls ? "*" : "") + " " "\"<|tool▁calls▁end|>\"" " space");