From e84ee88f50aef33f4c7ec56534eadb912be8ee8e Mon Sep 17 00:00:00 2001 From: ochafik Date: Tue, 4 Feb 2025 00:36:38 +0000 Subject: [PATCH] =?UTF-8?q?r1:=20fix=20inadvertent=20newline=20in=20gramma?= =?UTF-8?q?r=20before=20<=EF=BD=9Ctool=E2=96=81call=E2=96=81end=EF=BD=9C>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/chat.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/chat.cpp b/common/chat.cpp index cb6a922bd..655cb9900 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -567,8 +567,7 @@ static common_chat_params common_chat_params_init_deepseek_r1(const common_chat_ auto args_rule = builder.add_schema(name + "-args", parameters); tool_rules.push_back(builder.add_rule(name + "-call", "\"<|tool▁call▁begin|>function<|tool▁sep|>" + name + "\\n" - "```json\\n\" " + args_rule + " \"```" - "<|tool▁call▁end|>\"")); + "```json\\n\" " + args_rule + " \"```<|tool▁call▁end|>\"")); }); // 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)