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 Han07f39e0b05b4
diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py
index 54f0e66c717..78494f8efa7 100644
--- a/unsloth/tokenizer_utils.py
+++ b/unsloth/tokenizer_utils.py
@@ -914,6 +914,7 @@ def patch_sft_trainer_tokenizer():
try:
sft_trainer = eval(f"trl.trainer.sft_trainer.SFTTrainer")
except:
+ return
all_imports = dir(trl.trainer.sft_trainer)
for function_name, replacer in (