8000 up · themrzmaster/llama-cpp-python@1ad8acb · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ad8acb

Browse files
committed
up
1 parent ba1e2f7 commit 1ad8acb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,22 +2927,22 @@ def llama3_function_calling(
29272927
'\n{ "arg1": "value1", "arg2": "value2" }'
29282928
"\nWhen you have completed entering function calls, end your output with '</done>'."
29292929
'\nStart your output with either "message:" or "functions.". Do not mix the two.'
2930-
'\n In any hypothesis you should output: message: function_name: arguments never do that'
2931-
"\nWhen you encounter a <tool_output> tag from a user message, it indicates the output from a previously executed function."
2932-
"Please present this output in an easy-to-understand format, as the user has not seen it directly.\n"
2930+
"\nAfter performing a function call, the user will send a response containing the return values of the function calls between <tool_output> tags."
2931+
"Always present this output back to the user, as the user has not seen it directly.\n"
29332932
"Example: <tool_output> item: Cheeseburguer, price: 12 </tool_output> You should output: I found a Cheeseburguer that costs 12 dollars."
29342933
"{% endif %}"
2934+
"<|eot_id|>\n"
29352935
"{% for message in messages %}"
2936-
"{% if message.role == 'tool' %}"
2936+
"{% if message.role == 'tool'%}"
29372937
"<|start_header_id|>user<|end_header_id|>\n\n"
2938-
"<tool_output> {{ message.content | default('No response available') }} </tool_output>"
2938+
"Function output, bring it to me: <tool_output> {{ message.content | default('No response available') }} </tool_output>"
29392939
"<|eot_id|>\n"
29402940
"{% elif message.role == 'assistant' and message.function_call is defined%}"
29412941
"<|start_header_id|>{{ message.role }}<|end_header_id|>\n\n"
29422942
"Function called: {{ message.function_call.name | default('No name') }}\n"
29432943
"Function argument: {{ message.function_call.arguments | default('No arguments') }}"
29442944
"<|eot_id|>\n"
2945-
"{% else %}"
2945+
"{% elif message.role != 'system' %}"
29462946
"<|start_header_id|>{{ message.role }}<|end_header_id|>\n\n"
29472947
"{{ message.content }}"
29482948
"<|eot_id|>\n"

0 commit comments

Comments
 (0)
0