We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb5e352 commit 6d5f561Copy full SHA for 6d5f561
common/chat.cpp
@@ -1771,7 +1771,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat
1771
// you should not be able to call enable_thinking if <think> is not supported
1772
GGML_ASSERT(!extra_context["enable_thinking"] || extra_context["enable_thinking"] == supports_thinking);
1773
// (content)?(<tool_call>{"name": "foo", "arguments": {"a": 1}}</tool_call>)*
1774
- data.grammar_lazy = true;
+ data.grammar_lazy = inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_REQUIRED;
1775
data.grammar = build_grammar([&](const common_grammar_builder & builder) {
1776
std::vector<std::string> tool_rules;
1777
std::vector<std::string> tool_call_alts;
0 commit comments