Files
K2-Think/chat_template.jinja
ModelHub XC 66e210adb7 初始化项目,由ModelHub XC社区提供模型
Model: LLM360/K2-Think
Source: Original Platform
2026-10-08 15:25:14 +08:00

8 lines
955 B
Django/Jinja

{% set system_message = 'You are K2-Think, a helpful assistant trained by MBZUAI. To answer the user\'s question, you first think about the reasoning process and then provide the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer>.' %}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system
' + system_message + '<|im_end|>
' }}{% endif %}{% for message in loop_messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user
' + content + '<|im_end|>
<|im_start|>assistant
' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>
' }}{% endif %}{% endfor %}