From 661194623e3eb631f4e7946f5b21afebc321df3a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 15:44:08 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unsloth/tokenizer_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py index f65bac61f5..97fcd1365c 100644 --- a/unsloth/tokenizer_utils.py +++ b/unsloth/tokenizer_utils.py @@ -665,9 +665,13 @@ def _fix_chat_template(chat_template): and "<|im_start|>" in chat_template ): after_endfor = ( - "{%" + dash + " if add_generation_prompt %}" + "{%" + + dash + + " if add_generation_prompt %}" + "{{ '<|im_start|>assistant\n' }}" - + "{%" + dash + " endif %}" + + "{%" + + dash + + " endif %}" ) chat_template = chat_template[: where + len(chosen_end)] + after_endfor return chat_template