Skip to content

Commit 6d5f561

Browse files
author
Pierre F
committed
reverted changes done to grammar_lazy for hermes 2
1 parent bb5e352 commit 6d5f561

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
@@ -1771,7 +1771,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat
17711771
// you should not be able to call enable_thinking if <think> is not supported
17721772
GGML_ASSERT(!extra_context["enable_thinking"] || extra_context["enable_thinking"] == supports_thinking);
17731773
// (content)?(<tool_call>{"name": "foo", "arguments": {"a": 1}}</tool_call>)*
1774-
data.grammar_lazy = true;
1774+
data.grammar_lazy = inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_REQUIRED;
17751775
data.grammar = build_grammar([&](const common_grammar_builder & builder) {
17761776
std::vector<std::string> tool_rules;
17771777
std::vector<std::string> tool_call_alts;

0 commit comments

Comments
 (0)