fix: minor formatting bugs for chatml-function-calling
This commit is contained in:
parent
6fe8b427e1
commit
4b0e3320bd
1 changed files with 3 additions and 1 deletions
|
@ -2072,12 +2072,14 @@ def chatml_function_calling(
|
||||||
"{% if message.role == 'assistant' %}"
|
"{% if message.role == 'assistant' %}"
|
||||||
## Reglar message
|
## Reglar message
|
||||||
"{% if message.content and message.content | length > 0 %}"
|
"{% if message.content and message.content | length > 0 %}"
|
||||||
|
"{% if tool_calls %}"
|
||||||
"message:\n"
|
"message:\n"
|
||||||
|
"{% endif %}"
|
||||||
"{{ message.content }}"
|
"{{ message.content }}"
|
||||||
"\n<|im_end|>\n"
|
"\n<|im_end|>\n"
|
||||||
"{% endif %}"
|
"{% endif %}"
|
||||||
## Function calls
|
## Function calls
|
||||||
"{% if message.tool_calls %}"
|
"{% if 'tool_calls' in message %}"
|
||||||
"{% for tool_call in message.tool_calls %}"
|
"{% for tool_call in message.tool_calls %}"
|
||||||
"functions.{{ tool_call.function.name }}:\n"
|
"functions.{{ tool_call.function.name }}:\n"
|
||||||
"{{ tool_call.function.arguments }}"
|
"{{ tool_call.function.arguments }}"
|
||||||
|
|
Loading…
Reference in a new issue