chat template: tool call fix?
Browse files# TL;DR
The role displayed for a tool call is `user` - I assume that is a mistake and the chat template should use the provided role instead (`tool`)
This PR is untested, feel free to disregard if not relevant
- chat_template.jinja +3 -3
chat_template.jinja
CHANGED
|
@@ -75,13 +75,13 @@
|
|
| 75 |
{%- elif message.role == "assistant" -%}
|
| 76 |
{% generation %}
|
| 77 |
{%- if reasoning_mode == "/think" -%}
|
| 78 |
-
{{ "<|im_start|>
|
| 79 |
{%- else -%}
|
| 80 |
-
{{ "<|im_start|>
|
| 81 |
{%- endif -%}
|
| 82 |
{% endgeneration %}
|
| 83 |
{%- elif message.role == "tool" -%}
|
| 84 |
-
{{ "<|im_start|>" + "
|
| 85 |
{%- endif -%}
|
| 86 |
{%- endfor -%}
|
| 87 |
{# ───── generation prompt ───── #}
|
|
|
|
| 75 |
{%- elif message.role == "assistant" -%}
|
| 76 |
{% generation %}
|
| 77 |
{%- if reasoning_mode == "/think" -%}
|
| 78 |
+
{{ "<|im_start|>" + message.role + "\n" + content.lstrip("\n") + "<|im_end|>\n" }}
|
| 79 |
{%- else -%}
|
| 80 |
+
{{ "<|im_start|>" + message.role + "\n" + "<think>\n\n</think>\n" + content.lstrip("\n") + "<|im_end|>\n" }}
|
| 81 |
{%- endif -%}
|
| 82 |
{% endgeneration %}
|
| 83 |
{%- elif message.role == "tool" -%}
|
| 84 |
+
{{ "<|im_start|>" + message.role + "\n" + content + "<|im_end|>\n" }}
|
| 85 |
{%- endif -%}
|
| 86 |
{%- endfor -%}
|
| 87 |
{# ───── generation prompt ───── #}
|