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 Hancb875a5b4568
diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.pyindex e5ba8b55f1c..a09f167db71 100644--- a/unsloth/kernels/cross_entropy_loss.py+++ b/unsloth/kernels/cross_entropy_loss.py@@ -377,17 +377,17 @@ def fast_cross_entropy_loss(pass-from transformers.models.llama.modeling_llama import (- LlamaForCausalLM,- CausalLMOutputWithPast,- Optional,- Union,- Cache,- List,- Tuple,-)+from transformers.models.llama.modeling_llama import LlamaForCausalLMdef patch_llama_for_causal_lm():import transformers.models.llama.modeling_llama+ from transformers.models.llama.modeling_llama import (+ CausalLMOutputWithPast,+ Optional,+ Union,+ Cache,+ List,+ Tuple,+ )import inspect, refunction = inspect.getsource(transformers.models.llama.modeling_llama.LlamaForCausalLM.forward)function = function.split("\n")@@ -448,9 +448,8 @@ def patch_llama_for_causal_lm():patched_function = f"class Unsloth_LlamaForCausalLM(LlamaForCausalLM):\n"\f" {function}\n"-- print(patched_function)- exec(patched_function)++ exec(patched_function, globals())transformers.models.llama.modeling_llama.LlamaForCausalLM = Unsloth_LlamaForCausalLMreturnpass