"vscode:/vscode.git/clone" did not exist on "888c4a2ae02fb4e6c4b53a4e6eb0b973a771362f"
Unverified Commit 7e56ba28 authored by Matt's avatar Matt Committed by GitHub
Browse files

Fix spurious warning in TF TokenClassification models (#15435)

parent 554d333e
......@@ -219,7 +219,7 @@ class TFTokenClassificationLoss:
# make sure only labels that are not equal to -100
# are taken into account as loss
if tf.math.reduce_any(labels == -1):
warnings.warn("Using `-1` to mask the loss for the token is deprecated. Please use `-100` instead.")
tf.print("Using `-1` to mask the loss for the token is deprecated. Please use `-100` instead.")
active_loss = tf.reshape(labels, (-1,)) != -1
else:
active_loss = tf.reshape(labels, (-1,)) != -100
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment