Skip to content

Commit dbae921

Browse files
author
Pierre F
committed
qwen hermes tool calling : fixed grammar rules names
1 parent 79e4a7b commit dbae921

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

common/chat.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,20 +1824,20 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat
18241824
"( \"```\\n\" | \"```json\\n\" | \"```xml\\n\" ) space " + wrappable_tool_call + " space \"```\" space ");
18251825
auto tool_call = builder.add_rule("tool_call", string_join(tool_call_alts, " | "));
18261826

1827-
builder.add_rule("thinking_start", "\"<think>\"");
1828-
builder.add_rule("thinking_content", "[^\\x00]*");
1829-
builder.add_rule("thinking_end", "\"</think>\" space");
1827+
builder.add_rule("thinking-start", "\"<think>\"");
1828+
builder.add_rule("thinking-content", "[^\\x00]*");
1829+
builder.add_rule("thinking-end", "\"</think>\" space");
18301830

18311831
//thinking grammar logic depending on if thinking_forced_open was to true (so already opened (and maybe closed)) and if thinking is even allowed
18321832
std::string thinking_grammar_logic = ""; // thinking tag was closed or not supported/wanted
18331833
if (extra_context["enable_thinking"]) {
18341834
if (data.thinking_forced_open) {
18351835
//thinking tag was already opened by used so we don't need to add it again
1836-
thinking_grammar_logic = "thinking_content thinking_end ";
1836+
thinking_grammar_logic = "thinking-content thinking-end ";
18371837
}
18381838
else
18391839
{
1840-
thinking_grammar_logic = "thinking_start thinking_content thinking_end ";
1840+
thinking_grammar_logic = "thinking-start thinking-content thinking-end ";
18411841
}
18421842
}
18431843

0 commit comments

Comments
 (0)