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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Update vision.py
Daniel Han28f80c89575f
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.pyindex 1c7bdd0e6b0..46069ce8449 100644--- a/unsloth/models/vision.py+++ b/unsloth/models/vision.py@@ -53,6 +53,7 @@ import mathimport functoolsfrom typing import Optional, Tuple, List, Unionimport re, inspect, sys+import contextlibimport typestry:from huggingface_hub.utils import get_token@@ -146,7 +147,11 @@ def unsloth_base_fast_generate(except: pass# Mixed precision autocast- with torch.inference_mode(), torch.autocast(device_type = "cuda", dtype = dtype):+ if os.environ.get("UNSLOTH_FORCE_FLOAT32", "0") == "1":+ autocaster = contextlib.nullcontext()+ else:+ autocaster = torch.autocast(device_type = "cuda", dtype = dtype)+ with torch.inference_mode(), autocaster:try:output = self._old_generate(*args, **kwargs)except: