From ccf00d22b818324749f6b587319e70e24ba7c2d8 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 26 Jun 2025 11:31:08 -0700 Subject: [PATCH 1/3] Update loader.py --- unsloth/models/loader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 184be83539..178c0d82ee 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -545,6 +545,7 @@ class FastModel(FastBaseModel): elif "olmo-2" in lowered_model_name and transformers_version < Version("4.50.0.dev0"): raise RuntimeError("Unsloth: OLMo-2 only works on transformers >= 4.50.0." + NIGHTLY) elif "gemma-3n" in lowered_model_name and transformers_version < Version("4.53.0"): + os.environ["UNSLOTH_DISABLE_STATIC_GENERATION"] = "1" raise RuntimeError("Unsloth: Gemma 3N only works on transformers >= 4.53.0" + LATEST) else: for check_model_name in DISABLE_COMPILE_MODEL_NAMES: From b91a5cea203c47ba76f375d35c2190199fc7dacf Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 26 Jun 2025 11:31:17 -0700 Subject: [PATCH 2/3] Update _utils.py --- unsloth/models/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 9bd0fc17ad..7f2c2db105 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.6.7" +__version__ = "2025.6.8" __all__ = [ "SUPPORTS_BFLOAT16", From e53aa34fb77a46f2740003b1f59144889d54e687 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 26 Jun 2025 12:03:29 -0700 Subject: [PATCH 3/3] Update loader.py --- unsloth/models/loader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 178c0d82ee..34bf05cd8d 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -544,9 +544,10 @@ class FastModel(FastBaseModel): os.environ["UNSLOTH_FORCE_CUSTOM_DTYPE"] = "torch.float16;if name.endswith(('_proj', 'fc1', 'fc2', 'codebook', 'head')): module.to(torch.float16)" elif "olmo-2" in lowered_model_name and transformers_version < Version("4.50.0.dev0"): raise RuntimeError("Unsloth: OLMo-2 only works on transformers >= 4.50.0." + NIGHTLY) - elif "gemma-3n" in lowered_model_name and transformers_version < Version("4.53.0"): + elif "gemma-3n" in lowered_model_name: os.environ["UNSLOTH_DISABLE_STATIC_GENERATION"] = "1" - raise RuntimeError("Unsloth: Gemma 3N only works on transformers >= 4.53.0" + LATEST) + if transformers_version < Version("4.53.0"): + raise RuntimeError("Unsloth: Gemma 3N only works on transformers >= 4.53.0" + LATEST) else: for check_model_name in DISABLE_COMPILE_MODEL_NAMES: if check_model_name in lowered_model_name: