From e877fddd3c4e98ec65c4b7773bf8bae0049ff929 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 1 Oct 2025 04:15:14 -0700 Subject: [PATCH] Update vision.py --- unsloth/models/vision.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index ae76c573d0..fbe3c832c2 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