From 6db9d286d809cf8f29973d22e205d4bc0841a65a Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 30 Oct 2024 17:26:34 -0700 Subject: [PATCH] Update cross_entropy_loss.py --- unsloth/kernels/cross_entropy_loss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.py index 66d5046deb..9f16e8e605 100644 --- a/unsloth/kernels/cross_entropy_loss.py +++ b/unsloth/kernels/cross_entropy_loss.py @@ -273,8 +273,8 @@ class Fast_CrossEntropyLoss(torch.autograd.Function): n_chunks = div + (mod != 0) losses = torch.empty(n_rows, dtype = torch.float32, device = logits.device) - DO_SOFTCAPPING = (logit_softcapping != 0) - DO_LOGIT_SCALING = (logit_scaling != 0) + DO_SOFTCAPPING = logit_softcapping != 0 + DO_LOGIT_SCALING = logit_scaling != 0 if n_chunks == 1: # For small vocabs <= 65336 like Llama, Mistral