Update chat_template.jinja
Browse files- chat_template.jinja +3 -3
chat_template.jinja
CHANGED
@@ -36,12 +36,12 @@
|
|
36 |
{%- set reasoning_content = message.reasoning_content %}
|
37 |
{%- else %}
|
38 |
{%- if '</think>' in content %}
|
39 |
-
{%- set reasoning_content = content.split('</think>')
|
40 |
-
{%- set content = content.split('</think>')
|
41 |
{%- endif %}
|
42 |
{%- endif %}
|
43 |
{%- if loop.index0 > ns.last_query_index %}
|
44 |
-
{%- if reasoning_content %}
|
45 |
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
46 |
{%- else %}
|
47 |
{{- '<|im_start|>' + message.role + '\n' + content }}
|
|
|
36 |
{%- set reasoning_content = message.reasoning_content %}
|
37 |
{%- else %}
|
38 |
{%- if '</think>' in content %}
|
39 |
+
{%- set reasoning_content = ((content.split('</think>')|first).rstrip('\n').split('<think>')|last).lstrip('\n') %}
|
40 |
+
{%- set content = (content.split('</think>')|last).lstrip('\n') %}
|
41 |
{%- endif %}
|
42 |
{%- endif %}
|
43 |
{%- if loop.index0 > ns.last_query_index %}
|
44 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
45 |
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
46 |
{%- else %}
|
47 |
{{- '<|im_start|>' + message.role + '\n' + content }}
|