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 Han1767be3692ef
diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py
index 67a4c663b5f..f2b0da8600c 100644
--- a/unsloth/tokenizer_utils.py
+++ b/unsloth/tokenizer_utils.py
@@ -523,6 +523,9 @@ def _load_correct_tokenizer(
# Ignore Mistral ones - they're a bit weird to handle!
elif "mistral" in tokenizer_name.lower():
return fast_tokenizer
+ # Ignore Phi-4 ones as well
+ elif "phi-4" in tokenizer_name.lower():
+ return fast_tokenizer
elif slow_tokenizer is not None:
if hasattr(fast_tokenizer, "add_bos_token") and hasattr(slow_tokenizer, "add_bos_token"):
fast_tokenizer.add_bos_token = slow_tokenizer.add_bos_token