Update chat_template.jinja
Browse files- chat_template.jinja +7 -8
chat_template.jinja
CHANGED
|
@@ -35,14 +35,14 @@
|
|
| 35 |
{%- if message.reasoning_content is string %}
|
| 36 |
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
{%- else %}
|
| 38 |
-
{%- if '</
|
| 39 |
-
{%- set reasoning_content = content.split('</
|
| 40 |
-
{%- set content = content.split('</
|
| 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<
|
| 46 |
{%- else %}
|
| 47 |
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
{%- endif %}
|
|
@@ -82,8 +82,7 @@
|
|
| 82 |
{%- endif %}
|
| 83 |
{%- endfor %}
|
| 84 |
{%- if add_generation_prompt %}
|
| 85 |
-
{{- '<|im_start|>assistant\n'
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
{%- endif %}
|
| 89 |
{%- endif %}
|
|
|
|
| 35 |
{%- if message.reasoning_content is string %}
|
| 36 |
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
{%- else %}
|
| 38 |
+
{%- if '</reasoning>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</reasoning>')[0].rstrip('\n').split('<reasoning>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</reasoning>')[-1].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<reasoning>\n' + reasoning_content.strip('\n') + '\n</reasoning>\n\n' + content.lstrip('\n') }}
|
| 46 |
{%- else %}
|
| 47 |
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
{%- endif %}
|
|
|
|
| 82 |
{%- endif %}
|
| 83 |
{%- endfor %}
|
| 84 |
{%- if add_generation_prompt %}
|
| 85 |
+
{{- '<|im_start|>assistant\n<think>\n\n</think>\n\n<reasoning>\n'}}
|
| 86 |
+
{%- else %}
|
| 87 |
+
{{- '<|im_start|>assistant\n<think>\n\n</think>\n\n'}}
|
|
|
|
| 88 |
{%- endif %}
|