From b23ef893b9c9298a1cf58bc077c7ba92f4301b81 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 12 Mar 2025 21:42:27 -0700 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 4a7f4f0624..7000739850 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!"