From 0aadae45eb7b19e51bd5e0c122990fcd1e2c2957 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 17 Mar 2025 04:42:50 -0700 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index f84d80f280..dd7b02216a 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -1185,8 +1185,9 @@ def unsloth_compile_transformers( # Set forced float32 env flag os.environ["UNSLOTH_FORCE_FLOAT32"] = "0" do_forced_float32 = False + model_type_arch = model_types[1] for disable_name in FORCE_FLOAT32: - if (disable_name.lower() == model_types[1].lower() or \ + if (disable_name.lower() == model_type_arch.lower() or \ disable_name.lower() in model_name.lower()) and \ dtype == torch.float16: