From 3275552160a954d8b0503559a804eef9a1ee45ff Mon Sep 17 00:00:00 2001 From: Etherll <61019402+Etherll@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:53:38 +0300 Subject: [PATCH 1/4] Update loader.py --- unsloth/models/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 8b8ec1b1a0..e4d33e70f6 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -858,7 +858,7 @@ class FastModel(FastBaseModel): trust_remote_code = trust_remote_code, ) # Patch it as well! - model = FastBaseModel.post_patch_model(model, use_gradient_checkpointing) + model = FastBaseModel.post_patch_model(model, use_gradient_checkpointing,trust_remote_code = trust_remote_code) pass return model, tokenizer pass From 3e9d68bb805cb9ef4980d2382d36e66c59a1f02b Mon Sep 17 00:00:00 2001 From: Etherll <61019402+Etherll@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:55:07 +0300 Subject: [PATCH 2/4] Update vision.py --- unsloth/models/vision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 2436db4ff4..246e5d5671 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -608,7 +608,7 @@ class FastBaseModel: finetune_mlp_modules = finetune_mlp_modules, ) else: - assert(type(target_modules) in (list, tuple,)) + assert(type(target_modules) in (list, tuple, str,)) pass # Clear deleted GPU items From e88ea0ad7fbb3160728d55988b6c0baa779c8cbc Mon Sep 17 00:00:00 2001 From: Etherll <61019402+Etherll@users.noreply.github.com> Date: Mon, 28 Jul 2025 21:48:36 +0300 Subject: [PATCH 3/4] Update _utils.py --- unsloth/models/_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 4f004ff93a..0e4df9e2c8 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -221,12 +221,13 @@ class _RaiseUninitialized(logging.Handler): def __init__(self): super().__init__() def emit(self, record): - if "some weights of" in str(record).lower(): + record_lower = str(record).lower() + if "some weights of" in record_lower and "score.weight" not in record_lower: raise Exception( f"Unsloth: Critical error since some weights are not initialized.\n"\ f"Please try updating Unsloth, transformers and timm via:\n"\ f"`pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth unsloth_zoo transformers timm`\n"\ - f"".str(record)) + f"{str(record)}") pass class RaiseUninitialized: def __init__(self): From 94be60007acaecbca83c6a730dc70009738bbab3 Mon Sep 17 00:00:00 2001 From: Etherll <61019402+Etherll@users.noreply.github.com> Date: Mon, 28 Jul 2025 22:15:23 +0300 Subject: [PATCH 4/4] Update loader.py --- unsloth/models/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index e4d33e70f6..a5b7d18164 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -858,7 +858,7 @@ class FastModel(FastBaseModel): trust_remote_code = trust_remote_code, ) # Patch it as well! - model = FastBaseModel.post_patch_model(model, use_gradient_checkpointing,trust_remote_code = trust_remote_code) + model = FastBaseModel.post_patch_model(model, use_gradient_checkpointing, trust_remote_code = trust_remote_code) pass return model, tokenizer pass