From ee75d8b552f49c6fc6485b60eaa65d20d31d291f Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 18 Mar 2025 01:43:34 -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 29ba938104..1c7bdd0e6b 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -146,7 +146,7 @@ def unsloth_base_fast_generate( except: pass # Mixed precision autocast - with torch.inference_mode(): + with torch.inference_mode(), torch.autocast(device_type = "cuda", dtype = dtype): try: output = self._old_generate(*args, **kwargs) except: