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
training: restore YAML fallback for trust_remote_code (no UI toggle)
Roland Tannousc719f1ba54b0
diff --git a/studio/backend/core/training/worker.py b/studio/backend/core/training/worker.pyindex 1496c8255ba..04751524826 100644--- a/studio/backend/core/training/worker.py+++ b/studio/backend/core/training/worker.py@@ -199,19 +199,6 @@ def run_training_process(event_queue.put({"type": "complete", "output_dir": None, "ts": time.time()})else:error_msg = trainer.training_progress.error or "Failed to load model"- # Hint about trust_remote_code if YAML says this model needs it- if not config.get("trust_remote_code", False):- try:- from utils.models.model_config import load_model_defaults- model_defaults = load_model_defaults(model_name)- yaml_trust = model_defaults.get("training", {}).get("trust_remote_code", False)- if yaml_trust:- error_msg = (- f"Model '{model_name}' requires trust_remote_code to be enabled. "- f"Please enable 'Trust remote code' in Chat Settings and try again."- )- except Exception:- passevent_queue.put({"type": "error","error": error_msg,diff --git a/studio/backend/routes/training.py b/studio/backend/routes/training.pyindex b6e6d7e111e..c0e78d2b246 100644--- a/studio/backend/routes/training.py+++ b/studio/backend/routes/training.py@@ -19,12 +19,14 @@ if str(backend_path) not in sys.path:# Import backend functionstry:from core.training import get_training_backend+ from utils.models.model_config import load_model_defaultsexcept ImportError:# Fallback: try to import from parent directoryparent_backend = backend_path.parent / "backend"if str(parent_backend) not in sys.path:sys.path.insert(0, str(parent_backend))from core.training import get_training_backend+ from utils.models.model_config import load_model_defaults# Authfrom auth.authentication import get_current_subject@@ -194,6 +196,16 @@ async def start_training("trust_remote_code": request.trust_remote_code,}+ # Training page has no trust_remote_code toggle — the value comes from+ # YAML model defaults applied when the user selects a model. As a safety+ # net, consult the YAML directly so models that need it always get it.+ if not training_kwargs["trust_remote_code"]:+ model_defaults = load_model_defaults(request.model_name)+ yaml_trust = model_defaults.get("training", {}).get("trust_remote_code", False)+ if yaml_trust:+ logger.info(f"YAML config sets trust_remote_code=True for {request.model_name}")+ training_kwargs["trust_remote_code"] = True+# Free GPU memory: shut down any running inference/export subprocesses# before training starts (they'd compete for VRAM otherwise)try: