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 tokenizer_utils.py

Daniel Hanf554e663ec16
diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py
index ed95e076321..302017d5665 100644
--- a/unsloth/tokenizer_utils.py
+++ b/unsloth/tokenizer_utils.py
@@ -586,10 +586,10 @@ pass
def _fix_chat_template(chat_template):
- endfor = "{% endfor %}"
+ endfor = "{% endif %}"
where = chat_template.find(endfor)
if where == -1:
- endfor = "{%- endfor %}"
+ endfor = "{%- endif %}"
where = chat_template.find(endfor)
if where == -1:
return chat_template