Skip to content

Commit bb08c4e

Browse files
committed
improve gguf-function-calling parser
1 parent 7e32386 commit bb08c4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,10 +4272,10 @@ def gguf_function_calling(
42724272
initial_gbnf_tool_grammar = (
42734273
f"""
42744274
root ::= message_only | message_with_functions | functions_only
4275-
message_only ::= "message:" content
4276-
message_with_functions ::= "message:" content "<function_calls>\\n" functions
4275+
message_only ::= "message:" anytext
4276+
message_with_functions ::= "message:" anytext "<function_calls>\\n" functions
42774277
functions_only ::= "<function_calls>\\n" functions
4278-
content ::= ([^<] | "<" [^f] )+
4278+
anytext ::= ANYCHAR+
42794279
functions ::= {function_names}
42804280
"""
42814281
if tool_choice == "auto"

0 commit comments

Comments
 (0)