diff --git a/common/chat.cpp b/common/chat.cpp index 23a446da91..5f75192814 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -1771,7 +1771,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat // you should not be able to call enable_thinking if is not supported GGML_ASSERT(!extra_context["enable_thinking"] || extra_context["enable_thinking"] == supports_thinking); // (content)?({"name": "foo", "arguments": {"a": 1}})* - data.grammar_lazy = true; + data.grammar_lazy = inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_REQUIRED; data.grammar = build_grammar([&](const common_grammar_builder & builder) { std::vector tool_rules; std::vector tool_call_alts;