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 cross_entropy_loss.py
Daniel Han45554fb66d0f
diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.pyindex 58104e4dfa0..d06bf69913f 100644--- a/unsloth/kernels/cross_entropy_loss.py+++ b/unsloth/kernels/cross_entropy_loss.py@@ -440,10 +440,12 @@ def patch_llama_for_causal_lm():function[ function.find(" if not return_dict"):]function = function.replace("logits = logits.float()", "\n")+ # Missed spacesfunction = function.split("\n")- function = [" "*4 + x for x in function]+ # Not the first one though!+ function = [function[0]] + [" "*4 + x for x in function[1:]]function = "\n".join(function)-+patched_function = f"class Unsloth_LlamaForCausalLM(LlamaForCausalLM):\n"\f" {function}\n"