From a048a791f44aa2799456fa646e52892f462da6db Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 23 Oct 2024 22:18:24 -0700 Subject: [PATCH] Update cross_entropy_loss.py --- unsloth/kernels/cross_entropy_loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.py index 35df257329..4895d27310 100644 --- a/unsloth/kernels/cross_entropy_loss.py +++ b/unsloth/kernels/cross_entropy_loss.py @@ -373,9 +373,9 @@ def fast_cross_entropy_loss( logit_softcapping, logit_scaling, ) - print(n_items) if n_items is None: n_items = torch.count_nonzero(labels != -100) + print(n_items) return loss.sum() / n_items pass