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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Fixing base model export issue for vlms
Manan17aeb198f52d2b
diff --git a/studio/backend/core/inference/inference.py b/studio/backend/core/inference/inference.pyindex e90e6c0c2ae..1147c281b75 100644--- a/studio/backend/core/inference/inference.py+++ b/studio/backend/core/inference/inference.py@@ -6,8 +6,10 @@ from unsloth.chat_templates import get_chat_templatefrom transformers import TextStreamerfrom peft import PeftModel, PeftModelForCausalLM+import jsonimport sysimport torch+from pathlib import Pathfrom typing import Optional, Union, Generator, Tuplefrom utils.models import ModelConfig, get_base_model_from_lorafrom utils.paths import is_model_cached@@ -112,7 +114,18 @@ class InferenceBackend:# In that case, load the real processor from the base model.from transformers import ProcessorMixinif not (isinstance(processor, ProcessorMixin) or hasattr(processor, "image_processor")):+ # For LoRA adapters, use the base model. For local merged exports,+ # read export_metadata.json to find the original base model.processor_source = config.base_model if config.is_lora else config.identifier+ if not config.is_lora and config.is_local:+ _meta_path = Path(config.path) / "export_metadata.json"+ try:+ if _meta_path.exists():+ _meta = json.loads(_meta_path.read_text())+ if _meta.get("base_model"):+ processor_source = _meta["base_model"]+ except Exception:+ passlogger.warning(f"FastVisionModel returned {type(processor).__name__} (no image_processor) "f"for '{model_name}' — loading proper processor from '{processor_source}'"