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.

Update llama.py

Daniel Han2441039ce158
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index 4a7f4f06246..7000739850e 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -2462,6 +2462,12 @@ class FastLlamaModel:
model,
use_gradient_checkpointing = True,
):
+ if os.environ.get("UNSLOTH_USE_NEW_MODEL", "0") == "1":
+ return FastBaseModel.patch_peft_model(
+ model = model,
+ use_gradient_checkpointing = use_gradient_checkpointing,
+ )
+ pass
if not isinstance(model, PeftModelForCausalLM):
raise TypeError(
"Unsloth: Your model needs to call `.get_peft_model` first!"