DeepSeek-V4-Flash-5bit / chat_template.jinja
prince-canuma's picture
Add chat template
8e857e0 verified
raw
history blame contribute delete
883 Bytes
{%- set mode = thinking_mode|default('chat') -%}
<|begin▁of▁sentence|>
{%- for message in messages -%}
{%- if message['role'] == 'system' -%}
{{- message['content'] -}}
{%- elif message['role'] == 'user' -%}
<|User|>{{- message['content'] -}}<|Assistant|>
{%- if loop.last and mode == 'thinking' -%}
<think>
{%- else -%}
</think>
{%- endif -%}
{%- elif message['role'] == 'assistant' -%}
{%- if mode == 'thinking' and message.get('reasoning_content') -%}
{{- message['reasoning_content'] -}}</think>
{%- else -%}
</think>
{%- endif -%}
{{- message['content'] -}}<|end▁of▁sentence|>
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt and messages[-1]['role'] != 'user' -%}
<|Assistant|></think>
{%- endif -%}