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.

fix: use raw github URL for vision.py patch + add VLM processor diagnostic logging

Roland Tannous6f0b7bc38aef
diff --git a/setup.sh b/setup.sh
index 0d8821d50a2..a911d9ed7ae 100755
--- a/setup.sh
+++ b/setup.sh
@@ -169,6 +169,10 @@ if [ "$IS_COLAB" = true ]; then
LLAMA_CPP_DST="$(pip show unsloth-zoo | grep -i '^Location:' | awk '{print $2}')/unsloth_zoo/llama_cpp.py"
curl -sSL "https://raw.githubusercontent.com/unslothai/unsloth-zoo/refs/heads/main/unsloth_zoo/llama_cpp.py" \
-o "$LLAMA_CPP_DST"
+ # Patch: override vision.py with fix from unsloth PR: https://github.com/unslothai/unsloth/pull/4091 until next pypi release
+ VISION_DST="$(pip show unsloth | grep -i '^Location:' | awk '{print $2}')/unsloth/vision.py"
+ curl -sSL "https://raw.githubusercontent.com/unslothai/unsloth/80e0108a684c882965a02a8ed851e3473c1145ab/unsloth/models/vision.py" \
+ -o "$VISION_DST"
echo " Installing studio dependencies..."
run_quiet "pip install studio" pip install -r "$SCRIPT_DIR/studio/backend/requirements/studio.txt"
echo "✅ Python dependencies installed"
diff --git a/studio/backend/core/training/trainer.py b/studio/backend/core/training/trainer.py
index 804baa33c00..c56b4a8a894 100644
--- a/studio/backend/core/training/trainer.py
+++ b/studio/backend/core/training/trainer.py
@@ -173,6 +173,15 @@ class UnslothTrainer:
token=hf_token,
)
logger.info("Loaded vision model")
+
+ # Diagnostic: check if FastVisionModel returned a real Processor or a raw tokenizer
+ from transformers import ProcessorMixin
+ tok = self.tokenizer
+ has_image_proc = isinstance(tok, ProcessorMixin) or hasattr(tok, "image_processor")
+ print(f"\n[VLM Diagnostic] FastVisionModel returned: {type(tok).__name__}")
+ print(f"[VLM Diagnostic] Is ProcessorMixin: {isinstance(tok, ProcessorMixin)}")
+ print(f"[VLM Diagnostic] Has image_processor: {hasattr(tok, 'image_processor')}")
+ print(f"[VLM Diagnostic] Usable as vision processor: {has_image_proc}\n")
else:
# Load text model - returns (model, tokenizer)
self.model, self.tokenizer = FastLanguageModel.from_pretrained(