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 _utils.py
Daniel Han1bd7c733a673
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.pyindex a150b1004cc..3b4e276bbd5 100644--- a/unsloth/models/_utils.py+++ b/unsloth/models/_utils.py@@ -1016,13 +1016,6 @@ def _unsloth_pre_compute_loss(self, model, inputs, *args, **kwargs):"Read more on gradient accumulation issues here: https://unsloth.ai/blog/gradient")pass-- # if os.environ.get("UNSLOTH_FORCE_FLOAT32", "0") == "0":- # autocaster = contextlib.nullcontext()- # else:- # autocaster = torch.autocast(device_type = "cuda", dtype = torch.float32)- # with autocaster:- # outputs = self._old_compute_loss(model, inputs, *args, **kwargs)outputs = self._old_compute_loss(model, inputs, *args, **kwargs)return outputspass@@ -1167,6 +1160,12 @@ def unsloth_compile_transformers()returnpass+ if trust_remote_code:+ print(+ "Unsloth: We can't trace models if `trust_remote_code = True`, "\+ "so turning off some optimizations!"+ )+ returnif disable: returnfor model_type in model_types: