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.

Show both `peft_error` and `autoconfig_error`, not just `autoconfig_error` (#2080)

Isaac Breen7eba1b9708e4
diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py
index a417982faae..cd59e0365d4 100644
--- a/unsloth/models/loader.py
+++ b/unsloth/models/loader.py
@@ -218,7 +218,13 @@ class FastLanguageModel(FastLlamaModel):
f'Try `pip install --upgrade "transformers>=4.43.2"`\n'\
f"to obtain the latest transformers build, then restart this session."\
)
- raise RuntimeError(autoconfig_error or peft_error)
+ # Create a combined error message showing both failures
+ combined_error = (
+ "Unsloth: Failed to load model. Both AutoConfig and PeftConfig loading failed.\n\n"
+ f"AutoConfig error: {autoconfig_error}\n\n"
+ f"PeftConfig error: {peft_error}\n\n"
+ )
+ raise RuntimeError(combined_error)
pass
# Get base model for PEFT:
@@ -597,7 +603,13 @@ class FastModel(FastBaseModel):
f'Try `pip install --upgrade "transformers>=4.43.2"`\n'\
f"to obtain the latest transformers build, then restart this session."\
)
- raise RuntimeError(autoconfig_error or peft_error)
+ # Create a combined error message showing both failures
+ combined_error = (
+ "Unsloth: Failed to load model. Both AutoConfig and PeftConfig loading failed.\n\n"
+ f"AutoConfig error: {autoconfig_error}\n\n"
+ f"PeftConfig error: {peft_error}\n\n"
+ )
+ raise RuntimeError(combined_error)
pass
# Get base model for PEFT: