yiqichen01 commited on
Commit
3917583
·
verified ·
1 Parent(s): 9feb605

Upload chat_template.jinja with huggingface_hub

Browse files
Files changed (1) hide show
  1. chat_template.jinja +21 -3
chat_template.jinja CHANGED
@@ -132,13 +132,31 @@
132
  {%- if message['role'] == 'assistant' %}
133
  {%- if is_training %}
134
  {%- if 'reasoning_content' in message and message['reasoning_content'] is string %}
135
- {%- set content = think_begin_token + message['reasoning_content'] + think_end_token + visible_text(message['content']) %}
 
 
 
 
 
 
 
136
  {%- else %}
137
  {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
138
  {%- endif %}
139
  {%- else %}
140
- {%- if ((preserved_thinking is defined and preserved_thinking) or loop.index0 > ns.last_user_index) and 'reasoning_content' in message and message['reasoning_content'] is string %}
141
- {%- set content = think_begin_token + message['reasoning_content'] + think_end_token + visible_text(message['content']) %}
 
 
 
 
 
 
 
 
 
 
 
142
  {%- else %}
143
  {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
144
  {%- endif %}
 
132
  {%- if message['role'] == 'assistant' %}
133
  {%- if is_training %}
134
  {%- if 'reasoning_content' in message and message['reasoning_content'] is string %}
135
+ {%- set rc = message['reasoning_content'] %}
136
+ {%- elif 'reasoning' in message and message['reasoning'] is string %}
137
+ {%- set rc = message['reasoning'] %}
138
+ {%- else %}
139
+ {%- set rc = none %}
140
+ {%- endif %}
141
+ {%- if rc is not none %}
142
+ {%- set content = think_begin_token + rc + think_end_token + visible_text(message['content']) %}
143
  {%- else %}
144
  {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
145
  {%- endif %}
146
  {%- else %}
147
+ {%- if ((preserved_thinking is defined and preserved_thinking) or loop.index0 > ns.last_user_index) %}
148
+ {%- if 'reasoning_content' in message and message['reasoning_content'] is string %}
149
+ {%- set rc = message['reasoning_content'] %}
150
+ {%- elif 'reasoning' in message and message['reasoning'] is string %}
151
+ {%- set rc = message['reasoning'] %}
152
+ {%- else %}
153
+ {%- set rc = none %}
154
+ {%- endif %}
155
+ {%- if rc is not none %}
156
+ {%- set content = think_begin_token + rc + think_end_token + visible_text(message['content']) %}
157
+ {%- else %}
158
+ {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
159
+ {%- endif %}
160
  {%- else %}
161
  {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
162
  {%- endif %}