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: add a log instead of silent exception

oKatanaaae368a0bd2ac5
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index e0d8cbcf25c..6e479071666 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -3022,8 +3022,11 @@ class FastLlamaModel:
if hasattr(target_module, "weight"):
try:
delattr(target_module, "weight")
- except Exception:
- pass
+ except Exception as exc:
+ logger.warning_once(
+ f"Unsloth: Could not delete existing weight attr during retie on "
+ f"{type(target_module).__name__}: {exc}"
+ )
target_module.register_parameter("weight", weight)
# Tie trainable copies created by ModulesToSaveWrapper first (these are used in forward)