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 llama.py
Daniel Han6e4970133758
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex 9e764197e16..86f25888e82 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -1537,7 +1537,6 @@ passdef unsloth_fast_generate(self,- inputs: Optional[torch.Tensor] = None,*args,**kwargs,):@@ -1577,7 +1576,7 @@ def unsloth_fast_generate(# Mixed precision autocastwith torch.inference_mode(), torch.autocast(device_type = "cuda", dtype = dtype):- output = self._old_generate(self, inputs, *args, **kwargs)+ output = self._old_generate(*args, **kwargs)pass# Return accelerate back@@ -2612,7 +2611,6 @@ class FastLlamaModel:@staticmethoddef for_inference(model):- m = modeldef _for_inference(m):if hasattr(m, "gradient_checkpointing"): m.gradient_checkpointing = Falseif hasattr(m, "training"): m.training = False@@ -2621,6 +2619,7 @@ class FastLlamaModel:# Set a flag for generation!m._flag_for_generation = Truepass+ m = modelwhile hasattr(m, "model"):_for_inference(m)m = m.model@@ -2656,6 +2655,7 @@ class FastLlamaModel:# Set a flag for generation!if hasattr(m, "_flag_for_generation"): del m._flag_for_generationpass+ m = modelwhile hasattr(m, "model"):_for_inference(m)m = m.model