From c4dc0e94b68a3a446d2417696c9253d835dcdf84 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 16:03:11 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unsloth/models/llama.py | 6 +++++- unsloth/models/vision.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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: