Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update vision.py

Daniel Hancdd005bf5aac
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py
index 8dcd36790ef..ca4c348c8b2 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: