Skip to content

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.

Update llama.py

Daniel Handf62b6242dc9
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index 7f3be1c279e..06bbcb20576 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -980,9 +980,9 @@ def CausalLM_fast_forward(fast_forward_inference):
elif num_logits_to_keep != 0:
logits = self.lm_head(hidden_states[:, -num_logits_to_keep:, :].to(lm_head.dtype))
else:
- print(HAS_CUT_CROSS_ENTROPY, labels)
if HAS_CUT_CROSS_ENTROPY and labels is not None:
n_items = kwargs.get("num_items_in_batch", None) or kwargs.get("n_items", None)
+ print(HAS_CUT_CROSS_ENTROPY, labels)
loss = fused_linear_cross_entropy(
hidden_states = hidden_states,
lm_weight = lm_head,