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.

Missing inspect

Daniel Han33b67f1ebe49
diff --git a/unsloth/device_type.py b/unsloth/device_type.py
index e04a3c55b8e..ac70d267956 100644
--- a/unsloth/device_type.py
+++ b/unsloth/device_type.py
@@ -25,6 +25,7 @@ __all__ = [
import torch
import functools
from unsloth_zoo.utils import Version
+import inspect
@functools.cache
def is_hip():
diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py
index d8548ded244..2b8ad86b25a 100644
--- a/unsloth/models/loader.py
+++ b/unsloth/models/loader.py
@@ -639,15 +639,14 @@ class FastModel(FastBaseModel):
"compatible with `full_finetuning=True`. If you wish to use QAT with LoRA, "
"please pass in `qat_scheme` in `FastLanguageModel.get_peft_model(...)` instead."
)
-
- old_model_name = model_name
- if not use_exact_model_name:
- model_name = get_model_name(model_name, load_in_4bit)
-
# Check if 4bit is allowed specifically for AMD
if not ALLOW_BITSANDBYTES:
print("Unsloth: AMD currently is not stable with 4bit bitsandbytes. Disabling for now.")
load_in_4bit = False
+
+ old_model_name = model_name
+ if not use_exact_model_name:
+ model_name = get_model_name(model_name, load_in_4bit)
# Check if pre-quantized models are allowed
# For eg AMD GPUs need blocksize = 128, but our pre-quants are blocksize = 64
if not ALLOW_PREQUANTIZED_MODELS and model_name.endswith(("-unsloth-bnb-4bit", "-bnb-4bit")):