Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update chat_templates.py

Daniel Hand0517a527df6
diff --git a/unsloth/chat_templates.py b/unsloth/chat_templates.py
index 87ff6f51532..2c2e36182df 100644
--- a/unsloth/chat_templates.py
+++ b/unsloth/chat_templates.py
@@ -1940,6 +1940,11 @@ extra_eos_tokens = None,
tokenizer._ollama_modelfile = modelfile
tokenizer._unsloth_input_part = input_part
tokenizer._unsloth_output_part = output_part
+ if hasattr(tokenizer, "tokenizer"):
+ tokenizer.tokenizer.chat_template = jinja_template
+ tokenizer.tokenizer._ollama_modelfile = modelfile
+ tokenizer.tokenizer._unsloth_input_part = input_part
+ tokenizer.tokenizer._unsloth_output_part = output_part
return dataset.map(formatting_prompts_func, batched = True,)
pass