Skip to content

Commit 6a346f0

Browse files
fix typo (#9708)
* fix typo Co-authored-by: Suraj Patil <[email protected]>
1 parent 4a20b7c commit 6a346f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/modeling_tf_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def compute_loss(self, labels, logits):
147147
loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(
148148
from_logits=True, reduction=tf.keras.losses.Reduction.NONE
149149
)
150-
# make sure only labels that are not equal to -100 do not affect loss
150+
# make sure only labels that are not equal to -100 affect the loss
151151
active_loss = tf.not_equal(tf.reshape(labels, (-1,)), -100)
152152
reduced_logits = tf.boolean_mask(tf.reshape(logits, (-1, shape_list(logits)[2])), active_loss)
153153
labels = tf.boolean_mask(tf.reshape(labels, (-1,)), active_loss)

0 commit comments

Comments
 (0)