Added max_sample_ arguments (#10551)

* reverted changes of logging and saving metrics

* added max_sample arguments

* fixed code

* white space diff

* reformetting code

* reformatted code
This commit is contained in:
Bhadresh Savani
2021-03-09 00:27:10 +05:30
committed by GitHub
parent 917f104502
commit dfd16af832
14 changed files with 516 additions and 118 deletions

View File

@@ -294,9 +294,16 @@ def main():
if training_args.do_eval:
logger.info("*** Evaluate ***")
result = trainer.evaluate()
trainer.log_metrics("eval", result)
trainer.save_metrics("eval", result)
results.update(result)
output_eval_file = os.path.join(training_args.output_dir, "eval_results.txt")
with open(output_eval_file, "w") as writer:
logger.info("***** Eval results *****")
for key, value in result.items():
logger.info(" %s = %s", key, value)
writer.write("%s = %s\n" % (key, value))
results.update(result)
return results