Fix suggested by @bhadreshpsavani (#11660)

This commit is contained in:
Matt
2021-05-10 14:28:04 +01:00
committed by GitHub
parent 575c979144
commit ef8d32c5ea

View File

@@ -522,7 +522,7 @@ def main():
# 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())