Skip to content

Commit

Permalink
fix: minor formatting bugs for chatml-function-calling
Browse files Browse the repository at this point in the history
  • Loading branch information
abetlen committed Feb 13, 2024
1 parent 6fe8b42 commit 4b0e332
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,12 +2072,14 @@ def chatml_function_calling(
"{% if message.role == 'assistant' %}"
## Reglar message
"{% if message.content and message.content | length > 0 %}"
"{% if tool_calls %}"
"message:\n"
"{% endif %}"
"{{ message.content }}"
"\n<|im_end|>\n"
"{% endif %}"
## Function calls
"{% if message.tool_calls %}"
"{% if 'tool_calls' in message %}"
"{% for tool_call in message.tool_calls %}"
"functions.{{ tool_call.function.name }}:\n"
"{{ tool_call.function.arguments }}"
Expand Down

0 comments on commit 4b0e332

Please sign in to comment.