diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 5e552dc8d5..89c25e7316 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -3073,8 +3073,12 @@ class FastLlamaModel: clean_gpu_cache() import warnings as _w + with _w.catch_warnings(): - _w.filterwarnings("ignore", message=".*target_parameters.*were set but no parameter was matched.*") + _w.filterwarnings( + "ignore", + message = ".*target_parameters.*were set but no parameter was matched.*", + ) model = _get_peft_model(model, lora_config) # Fix LoraConfig.auto_mapping is None fix_lora_auto_mapping(model) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 1466a59ab0..735c28d917 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -1210,8 +1210,12 @@ class FastBaseModel: use_gradient_checkpointing = use_gradient_checkpointing, ) import warnings as _w + with _w.catch_warnings(): - _w.filterwarnings("ignore", message=".*target_parameters.*were set but no parameter was matched.*") + _w.filterwarnings( + "ignore", + message = ".*target_parameters.*were set but no parameter was matched.*", + ) model = _get_peft_model(model, lora_config) # Apply QAT + LoRA if specified if qat_scheme is not None: