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 cross_entropy_loss.py

Daniel Han5bb6b3bbd262
diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.py
index d06bf69913f..e791664a6fd 100644
--- a/unsloth/kernels/cross_entropy_loss.py
+++ b/unsloth/kernels/cross_entropy_loss.py
@@ -437,7 +437,7 @@ def patch_llama_for_causal_lm():
function = \
function[:function.find(" loss = None")] + \
replacement + \
- function[ function.find(" if not return_dict"):]
+ function[ function.find("if not return_dict"):]
function = function.replace("logits = logits.float()", "\n")
# Missed spaces