Skip to content

Commit 5dfa2f7

Browse files
author
ochafik
committed
r1: avoid partial call triggers from spaces
1 parent 56156b7 commit 5dfa2f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ static common_chat_params common_chat_params_init_deepseek_r1(const common_chat_
12161216
static void common_chat_parse_deepseek_r1(common_chat_msg_parser & builder) {
12171217
builder.try_parse_reasoning("<think>", "</think>");
12181218

1219-
static const common_regex tool_calls_begin("[\\s\\r\\n]*(?:<|tool▁calls▁begin|>|<|tool_calls_begin|>|<|tool calls begin|>|<|tool\\\\_calls\\\\_begin|>|<|tool▁calls|>)");
1219+
static const common_regex tool_calls_begin("(?:<|tool▁calls▁begin|>|<|tool_calls_begin|>|<|tool calls begin|>|<|tool\\\\_calls\\\\_begin|>|<|tool▁calls|>)");
12201220
static const common_regex tool_calls_end("<|tool▁calls▁end|>");
12211221
static const common_regex function_regex("(?:<|tool▁call▁begin|>)?function<|tool▁sep|>([^\n]+)\n```json\n");
12221222
static const common_regex close_regex("```[\\s\\r\\n]*<|tool▁call▁end|>");

0 commit comments

Comments
 (0)