tool-calls: r1: add missing <|tool▁calls▁end|> to grammar!

This commit is contained in:
Olivier Chafik 2025-02-03 17:33:14 +00:00
parent 08271b5505
commit df3474e2c2

View file

@ -552,9 +552,15 @@ static common_chat_params common_chat_params_init_deepseek_r1(const common_chat_
"<think>",
"</think>",
"<tool▁sep>",
"<tool▁calls▁end",
"<tool▁call▁begin>",
"<tool▁call▁end>",
};
builder.add_rule("root", "\"<tool▁calls▁begin>\" (" + string_join(tool_rules, " | ") + ")" + (inputs.parallel_tool_calls ? "*" : "") + " space");
builder.add_rule("root",
"\"<tool▁calls▁begin>\""
" (" +string_join(tool_rules, " | ") + ")" + (inputs.parallel_tool_calls ? "*" : "") +
"\"<tool▁calls▁end>\""
" space");
}, grammar_options);
/*
Note: we do not feed the thoughts back to the template for a few reasons: