Fix example test and test_fetcher for examples (#16478)

This commit is contained in:
Sylvain Gugger
2022-03-29 12:21:19 -04:00
committed by GitHub
parent 86cff21cf6
commit b62ac4d240
2 changed files with 4 additions and 4 deletions

View File

@@ -519,11 +519,11 @@ def main():
if task == "mnli-mm":
metrics = {k + "_mm": v for k, v in metrics.items()}
if "mnli" in task:
if task is not None and "mnli" in task:
combined.update(metrics)
trainer.log_metrics("eval", metrics)
trainer.save_metrics("eval", combined if "mnli" in task else metrics)
trainer.save_metrics("eval", combined if task is not None and "mnli" in task else metrics)
if training_args.do_predict:
logger.info("*** Predict ***")