Skip to content

Commit

Permalink
Fix suggested by @bhadreshpsavani (huggingface#11660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 authored and Iwontbecreative committed Jul 15, 2021
1 parent 03d41cf commit bb35a9e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def preprocess_function(examples):

# region Prediction losses
# This section is outside the scope() because it's very quick to compute, but behaves badly inside it
if "label" in datasets["test"].features:
if "test" in datasets and "label" in datasets["test"].features:
print("Computing prediction loss on test labels...")
labels = datasets["test"]["label"]
loss = float(loss_fn(labels, predictions).numpy())
Expand Down

0 comments on commit bb35a9e

Please sign in to comment.