Skip to content

Commit 765dca6

Browse files
committed
improve gguf-function-calling parser
1 parent 9dc010e commit 765dca6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4294,11 +4294,11 @@ def gguf_function_calling(
42944294
)
42954295
# Decide initial grammar: message only, functions only, or message+functions
42964296
initial_gbnf_tool_grammar = """
4297-
root ::= message | function_calls | message_then_functions
4298-
message ::= "message:"
4299-
function_calls ::= "<function_calls>\n"
4300-
message_then_functions ::= "message:" "<function_calls>\n"
4301-
"""
4297+
root ::= message | function_calls | message_then_functions
4298+
message ::= "message:"
4299+
function_calls ::= "<function_calls>\\n"
4300+
message_then_functions ::= "message:" "<function_calls>\\n"
4301+
"""
43024302
completion = cast(
43034303
llama_types.CreateCompletionResponse,
43044304
llama.create_completion(

0 commit comments

Comments
 (0)