Remove unneeded <think> token at the start of Assistant turn in chat_template
#1
by
gmoutier
- opened
The initial version of DeepSeek-R1 had the chat template ending with ...<|Assistant|><think>\\n'}}{% endif %}".
This made the model output the thinking text and end it with the closing </think> tag without the opening one, confusing clients that could not display the thinking part differently (plus having the closing tag in clear).
This was fixed later on for DeepSeek-R1 with https://huggingface.co/deepseek-ai/DeepSeek-R1/commit/8a58a132790c9935686eb97f042afa8013451c9f but not propagated here.
This commit fixes the issue by removing the unwanted tag, modifying the end of the chat template for <|Assistant|>'}}{% endif %}" only, same as on the corrected original R1 model.
gmoutier
changed pull request status to
closed