Skip to content

Commit

Permalink
Fix no such file or directory error (huggingface#23783)
Browse files Browse the repository at this point in the history
* Fix no such file or directory error

* Address comment

* Fix formatting issue
  • Loading branch information
RissyRan authored and sheonhan committed Jun 1, 2023
1 parent 6673629 commit 6c47f56
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ def compute_metrics(p):
logging.info(f"{metric_name}: {value:.3f}")

if training_args.output_dir is not None:
os.makedirs(training_args.output_dir, exist_ok=True)
with open(os.path.join(training_args.output_dir, "all_results.json"), "w") as f:
f.write(json.dumps(eval_metrics))

Expand Down

0 comments on commit 6c47f56

Please sign in to comment.