From 7b60d1d32d54fab9a86952c908ca8dddeca3e6d0 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 13 Mar 2025 06:15:42 -0700 Subject: [PATCH] Update vision.py --- unsloth/models/vision.py | 1 + 1 file changed, 1 insertion(+) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index efdf67a95e..fbb154ddd0 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -106,6 +106,7 @@ def unsloth_base_fast_generate( except: pass # Mixed precision autocast + if os.environ.get("UNSLOTH_FORCE_FLOAT32", "0") == "1": dtype = torch.float32 with torch.inference_mode(), torch.autocast(device_type = "cuda", dtype = dtype): output = self._old_generate(*args, **kwargs) pass