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 Hanbef3496dbdf6
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.pyindex 87a3846fdba..5cefab90e1b 100644--- a/unsloth/models/vision.py+++ b/unsloth/models/vision.py@@ -54,7 +54,7 @@ def _wrap_fast_inference(generate, device_type, dtype, model):kwargs["pad_token_id"] = kwargs.pop("pad_token_id", model_eos_token_id)# Autocasted- with torch.autocast(device_type = model.device.type, dtype = dtype):+ with torch.autocast(device_type = device_type, dtype = dtype):output = generate(*args, **kwargs)passreturn output@@ -341,6 +341,7 @@ class FastBaseVisionModel:if dtype == "float16": dtype = torch.float16elif dtype == "bfloat16": dtype = torch.bfloat16pass+ device_type = model.device.type# Wrap model.generateif model.generate.__name__ != "_fast_generate":