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 Hane7d0ce17a89b
diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.py
index cc3dbb1d871..f82defd4055 100644
--- a/unsloth/kernels/cross_entropy_loss.py
+++ b/unsloth/kernels/cross_entropy_loss.py
@@ -400,6 +400,6 @@ if (Version(torch.__version__) < Version("2.4.0")) and \
pass
# Patch CE Losses in transformers
-def patch_loss_functions():
- _patch_loss_functions(fast_cross_entropy_loss)
+def patch_loss_functions(torch_compile = True):
+ _patch_loss_functions(fast_cross_entropy_loss, torch_compile = torch_compile)
pass