"vscode:/vscode.git/clone" did not exist on "fa0c114fad4e2b807503e78d5110558cfee92ba4"
Unverified Commit a324d3a1 authored by Maximilien de Bayser's avatar Maximilien de Bayser Committed by GitHub
Browse files

Change granite chat template to keep json list formatting for tool calls (#10452)


Signed-off-by: default avatarMax de Bayser <maxdebayser@gmail.com>
parent b00b33d7
......@@ -21,11 +21,7 @@
{{- '<|start_of_role|>user<|end_of_role|>' + message['content'] + '<|end_of_text|>
' }}
{%- elif message['role'] == 'assistant_tool_call' or (message['role'] == 'assistant' and message.tool_calls is defined) %}
{{- '<|start_of_role|>assistant<|end_of_role|>' }}
{% for tc in message.tool_calls %}
{{- '<|tool_call|> ' + {'name': tc.function.name, 'arguments': tc.function.arguments}|tojson }}
{% endfor %}
{{- '<|end_of_text|>
{{- '<|start_of_role|>assistant<|end_of_role|><|tool_call|>' + message.tool_calls|map(attribute='function')|list|tojson(indent=4) + '<|end_of_text|>
' }}
{%- elif message['role'] == 'assistant' %}
{{- '<|start_of_role|>assistant<|end_of_role|>' + message['content'] + '<|end_of_text|>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment