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
added logging
Roland Tannousd0b94eae7550
diff --git a/studio/backend/core/inference/inference.py b/studio/backend/core/inference/inference.pyindex ed7c786913c..20484f7bb45 100644--- a/studio/backend/core/inference/inference.py+++ b/studio/backend/core/inference/inference.py@@ -177,6 +177,9 @@ class InferenceBackend:return Falsemodel = self.models[base_model_name].get("model")+ logger.info(f"[DEBUG] revert_to_base_model called. Model type BEFORE: {model.__class__.__name__}")+ logger.info(f"[DEBUG] Is PeftModel? {isinstance(model, (PeftModel, PeftModelForCausalLM))}")+ logger.info(f"[DEBUG] Has peft_config? {hasattr(model, 'peft_config')}, keys={list(getattr(model, 'peft_config', {}).keys())}")try:# Step 1: Unload the adapter weights. This returns the base model object.@@ -186,10 +189,14 @@ class InferenceBackend:unwrapped_base_model = model.unload()self.models[base_model_name]["model"] = unwrapped_base_modelmodel = unwrapped_base_model # Continue with the unwrapped model+ logger.info(f"[DEBUG] Model type AFTER unload: {model.__class__.__name__}")+ else:+ logger.info(f"[DEBUG] Model is NOT a PeftModel, skipping unload.")# Step 2: Delete any lingering adapter configurations from the object.# This is the crucial step you identified.if hasattr(model, 'peft_config') and model.peft_config:+ logger.info(f"[DEBUG] Lingering peft_config keys: {list(model.peft_config.keys())}")logger.info("Found lingering adapter configurations. Deleting them now...")# Create a static list of keys before iterating and deletingfor name in list(model.peft_config.keys()):@@ -198,7 +205,7 @@ class InferenceBackend:logger.info(f"Deleting adapter config: '{name}'")model.delete_adapter(name)- logger.info("Model has been successfully reverted to a clean base state.")+ logger.info(f"[DEBUG] Model type FINAL: {model.__class__.__name__}. Reverted to clean base state.")return Trueexcept Exception as e: