From 7c73c6d3d4af7be3f93376bb87944567d51a7d06 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 18 Mar 2025 23:53:39 -0700 Subject: [PATCH] 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 8dcd36790e..ca4c348c8b 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -176,7 +176,7 @@ def unsloth_base_fast_generate( # Mixed precision autocast if os.environ.get("UNSLOTH_FORCE_FLOAT32", "0") == "1": - autocaster = torch.autocast(device_type = "cuda", dtype = dtype) + autocaster = torch.autocast(device_type = "cuda", dtype = torch.float16) else: autocaster = torch.autocast(device_type = "cuda", dtype = dtype) with torch.inference_mode(), autocaster: