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

Daniel Hancc810e17cb52
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py
index ae76c573d01..fbe3c832c2b 100644
--- a/unsloth/models/vision.py
+++ b/unsloth/models/vision.py
@@ -709,6 +709,9 @@ class FastBaseModel:
model.config.update({"unsloth_version" : __version__})
pass
patch_saving_functions(model, vision = True)
+ if tokenizer is None:
+ del model
+ raise RuntimeError("Unsloth: The tokenizer is weirdly not loaded? Please check if there is one.")
patch_saving_functions(tokenizer, vision = True)
# Fix gradient accumulation