Update Fixed JINJA Templates/ChatML-Qwen3.5.jinja
Browse files
Fixed JINJA Templates/ChatML-Qwen3.5.jinja
CHANGED
|
@@ -43,7 +43,7 @@
|
|
| 43 |
{{- raise_exception('No messages provided.') }}
|
| 44 |
{%- endif %}
|
| 45 |
|
| 46 |
-
{%- set
|
| 47 |
|
| 48 |
{%- if tools and tools is iterable and tools is not mapping %}
|
| 49 |
{{- '<|im_start|>system\n' }}
|
|
@@ -61,12 +61,12 @@
|
|
| 61 |
{%- endif %}
|
| 62 |
{%- endif %}
|
| 63 |
{{- '<|im_end|>\n' }}
|
| 64 |
-
{%- set
|
| 65 |
{%- else %}
|
| 66 |
{%- if messages[0].role == 'system' %}
|
| 67 |
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 68 |
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 69 |
-
{%- set
|
| 70 |
{%- endif %}
|
| 71 |
{%- endif %}
|
| 72 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
|
@@ -81,7 +81,7 @@
|
|
| 81 |
{%- endif %}
|
| 82 |
{%- endfor %}
|
| 83 |
{%- for message in messages %}
|
| 84 |
-
{%- if message.role == "system" and
|
| 85 |
{%- continue %}
|
| 86 |
{%- endif %}
|
| 87 |
{%- set content = render_content(message.content, true)|trim %}
|
|
|
|
| 43 |
{{- raise_exception('No messages provided.') }}
|
| 44 |
{%- endif %}
|
| 45 |
|
| 46 |
+
{%- set system_rendered = namespace(value=false) %}
|
| 47 |
|
| 48 |
{%- if tools and tools is iterable and tools is not mapping %}
|
| 49 |
{{- '<|im_start|>system\n' }}
|
|
|
|
| 61 |
{%- endif %}
|
| 62 |
{%- endif %}
|
| 63 |
{{- '<|im_end|>\n' }}
|
| 64 |
+
{%- set system_rendered.value = true %}
|
| 65 |
{%- else %}
|
| 66 |
{%- if messages[0].role == 'system' %}
|
| 67 |
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 68 |
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 69 |
+
{%- set system_rendered.value = true %}
|
| 70 |
{%- endif %}
|
| 71 |
{%- endif %}
|
| 72 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
|
|
|
| 81 |
{%- endif %}
|
| 82 |
{%- endfor %}
|
| 83 |
{%- for message in messages %}
|
| 84 |
+
{%- if message.role == "system" and system_rendered.value and loop.first %}
|
| 85 |
{%- continue %}
|
| 86 |
{%- endif %}
|
| 87 |
{%- set content = render_content(message.content, true)|trim %}
|