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 Handc7b21305d15
diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.py
index 49bdbd10ea8..0034448be53 100644
--- a/unsloth/kernels/cross_entropy_loss.py
+++ b/unsloth/kernels/cross_entropy_loss.py
@@ -434,7 +434,7 @@ replacement = """ loss = None
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
function = function.split("\n")