File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4295,15 +4295,17 @@ def gguf_function_calling(
42954295 )
42964296 initial_gbnf_tool_grammar = (
42974297 (
4298- 'root ::= message_only | message_with_functions | functions_only\n '
4299- 'message_only ::= "message:" text\n '
4300- 'message_with_functions ::= "message:" text "<function_calls>\\ n" functions\n '
4301- 'functions_only ::= "<function_calls>\\ n" functions\n '
4298+ 'root ::= message_only | message_with_functions | functions_only\n '
4299+ 'message_only ::= "message:" ws text\n '
4300+ 'message_with_functions ::= "message:" ws text ws "<function_calls>" nl functions\n '
4301+ 'functions_only ::= "<function_calls>" nl functions\n '
43024302 'text ::= [^<]+\n '
4303+ 'ws ::= [ \t \n ]*\n '
4304+ 'nl ::= "\\ n"\n '
43034305 f"functions ::= { function_names } \n "
43044306 )
43054307 if tool_choice == "auto"
4306- else f'root ::= "<function_calls>" " \\ n" functions\n functions ::= { function_names } \n '
4308+ else f'root ::= "<function_calls>" nl functions\n functions ::= { function_names } \n '
43074309 )
43084310 completion = cast (
43094311 llama_types .CreateCompletionResponse ,
You can’t perform that action at this time.
0 commit comments