"tests/vscode:/vscode.git/clone" did not exist on "a6b77598805f4e3c24a47767d503dc6ea20d1381"
Unverified Commit 5216607f authored by Eldar Kurtic's avatar Eldar Kurtic Committed by GitHub
Browse files

[MNLI example] Prevent overwriting matched with mismatched metrics (#16475)

* Prevent overwriting matched with mismatched metrics

* Fix style
parent ed31ab3f
......@@ -507,6 +507,7 @@ def main():
if data_args.task_name == "mnli":
tasks.append("mnli-mm")
eval_datasets.append(raw_datasets["validation_mismatched"])
combined = {}
for eval_dataset, task in zip(eval_datasets, tasks):
metrics = trainer.evaluate(eval_dataset=eval_dataset)
......@@ -516,8 +517,13 @@ def main():
)
metrics["eval_samples"] = min(max_eval_samples, len(eval_dataset))
if task == "mnli-mm":
metrics = {k + "_mm": v for k, v in metrics.items()}
if "mnli" in task:
combined.update(metrics)
trainer.log_metrics("eval", metrics)
trainer.save_metrics("eval", metrics)
trainer.save_metrics("eval", combined if "mnli" in task else metrics)
if training_args.do_predict:
logger.info("*** Predict ***")
......
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