Skip to content

Commit 27ccb7a

Browse files
committed
update
1 parent 8a60766 commit 27ccb7a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ def base_function_calling(
24622462
f"""root ::= functions | "</done>"\n"""
24632463
f"""functions ::= {function_names}\n"""
24642464
)
2465-
2465+
24662466

24672467
prompt = template_renderer.render(
24682468
messages=messages,
@@ -2517,8 +2517,7 @@ def base_function_calling(
25172517
mirostat_eta=mirostat_eta,
25182518
model=model,
25192519
logits_processor=logits_processor,
2520-
),
2521-
stream=stream,
2520+
),stream=stream
25222521
)
25232522

25242523
# One or more function calls
@@ -2804,16 +2803,16 @@ def vicuna_function_calling(
28042803
"\nfunctions.{{ tool.function.name }}:\n"
28052804
"{{ tool.function.parameters | tojson }}"
28062805
"\n{% endfor %}"
2807-
"\n\nYou can respond to users messages with either a single message or multiple function calls."
2808-
"\n\nTo respond with a message begin the message with 'message:', use the following format:"
2809-
"\n\nmessage:"
2810-
"\n<message>"
2806+
"\n\nYou can respond to users messages with either a single message or multiple function calls, never both. If function calls are used, they must be the first part of the response."
28112807
"\n\nTo respond with one or more function calls begin the message with 'functions.<function_name>:', use the following format:"
28122808
"\n\nfunctions.<function_name>:"
28132809
'\n{ "arg1": "value1", "arg2": "value2" };'
28142810
"\nfunctions.<another_function_name>:"
28152811
'\n{ "arg1": "value3", "arg2": "value4" }'
28162812
"\n\nWhen you are done with the function calls, end the message with </done>."
2813+
"\n\nTo respond with a message begin the message with 'message:', use the following format:"
2814+
"\n\nmessage:"
2815+
"\n<message> </s>"
28172816
"{% endif %}"
28182817
"</s>\n"
28192818
"{% endif %}"
@@ -2853,4 +2852,3 @@ def vicuna_function_calling(
28532852
)
28542853
return base_function_calling(end_token="</s>",
28552854
**locals())
2856-

0 commit comments

Comments
 (0)