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
fix: config.torch_dtype in LlamaModel_fast_forward_inference (#2091)
lurf2100a98f17f5c3
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex 4bf13571694..61cf05e1101 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -652,13 +652,7 @@ def LlamaModel_fast_forward(if inputs_embeds is None:inputs_embeds = self.embed_tokens(input_ids)- # inputs_embeds = inputs_embeds.to(self.config.torch_dtype)- torch_dtype = __DTYPE_MAP.get(self.config.torch_dtype, None)- if torch_dtype is not None:- inputs_embeds = inputs_embeds.to(torch_dtype)- else:- raise TypeError("Unsloth: torch_dtype for models is not bfloat16, float16 or float32!")- pass+ inputs_embeds = inputs_embeds.to(_get_dtype(self.config.torch_dtype))# Normalized from GemmaIS_GEMMA = self.config.model_type.startswith("gemma")@@ -924,7 +918,7 @@ def LlamaModel_fast_forward_inference(mlp_size = self.config.intermediate_sizeX = self.model.embed_tokens(input_ids)- X = X.to(self.config.torch_dtype)+ X = X.to(_get_dtype(self.config.torch_dtype))bsz, q_len, hd = X.shapeassert(q_len == 1)# Get saved buffers to reduce memory movement