Unverified Commit b62ac4d2 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Fix example test and test_fetcher for examples (#16478)

parent 86cff21c
...@@ -519,11 +519,11 @@ def main(): ...@@ -519,11 +519,11 @@ def main():
if task == "mnli-mm": if task == "mnli-mm":
metrics = {k + "_mm": v for k, v in metrics.items()} 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) combined.update(metrics)
trainer.log_metrics("eval", 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: if training_args.do_predict:
logger.info("*** Predict ***") logger.info("*** Predict ***")
......
...@@ -465,9 +465,9 @@ def infer_tests_to_run(output_file, diff_with_last_commit=False, filters=None): ...@@ -465,9 +465,9 @@ def infer_tests_to_run(output_file, diff_with_last_commit=False, filters=None):
test_files_to_run.append(f) test_files_to_run.append(f)
# Example files are tested separately # Example files are tested separately
elif f.startswith("examples/pytorch"): elif f.startswith("examples/pytorch"):
test_files_to_run.append("examples/pytorch/test_examples.py") test_files_to_run.append("examples/pytorch/test_pytorch_examples.py")
elif f.startswith("examples/flax"): elif f.startswith("examples/flax"):
test_files_to_run.append("examples/flax/test_examples.py") test_files_to_run.append("examples/flax/test_flax_examples.py")
else: else:
new_tests = module_to_test_file(f) new_tests = module_to_test_file(f)
if new_tests is not None: if new_tests is not None:
......
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