moving im_end token in system message
Browse filesCurrently the system message only has `<|im_end|>` appended to the end if the tools argument is passed to the `apply_chat_template` method, because the token is placed within the `if xml_tools or python_tools or tools` logic. This should be moved after the `{%- endif -%}` statement so that it will always be appended to the end of the system message.
- chat_template.jinja +1 -1
chat_template.jinja
CHANGED
|
@@ -64,8 +64,8 @@
|
|
| 64 |
{{- python_tool_string -}}
|
| 65 |
{%- endif -%}
|
| 66 |
{{- "\n\n" -}}
|
| 67 |
-
{{- "<|im_end|>\n" -}}
|
| 68 |
{%- endif -%}
|
|
|
|
| 69 |
{%- endif -%}
|
| 70 |
{# ───── main loop ───── #}
|
| 71 |
{%- for message in messages -%}
|
|
|
|
| 64 |
{{- python_tool_string -}}
|
| 65 |
{%- endif -%}
|
| 66 |
{{- "\n\n" -}}
|
|
|
|
| 67 |
{%- endif -%}
|
| 68 |
+
{{- "<|im_end|>\n" -}}
|
| 69 |
{%- endif -%}
|
| 70 |
{# ───── main loop ───── #}
|
| 71 |
{%- for message in messages -%}
|