Fix result saving errors of pytorch examples (#20276)

This commit is contained in:
Jiahao Li
2022-11-16 22:51:04 +08:00
committed by GitHub
parent e627e9b5ae
commit 9681f052a1
8 changed files with 26 additions and 27 deletions

View File

@@ -666,8 +666,8 @@ def main():
if args.push_to_hub:
repo.push_to_hub(commit_message="End of training", auto_lfs_prune=True)
with open(os.path.join(args.output_dir, "all_results.json"), "w") as f:
json.dump({"perplexity": perplexity}, f)
with open(os.path.join(args.output_dir, "all_results.json"), "w") as f:
json.dump({"perplexity": perplexity}, f)
if __name__ == "__main__":

View File

@@ -711,8 +711,8 @@ def main():
if args.push_to_hub:
repo.push_to_hub(commit_message="End of training", auto_lfs_prune=True)
with open(os.path.join(args.output_dir, "all_results.json"), "w") as f:
json.dump({"perplexity": perplexity}, f)
with open(os.path.join(args.output_dir, "all_results.json"), "w") as f:
json.dump({"perplexity": perplexity}, f)
if __name__ == "__main__":