Skip to content

Commit

Permalink
Merge branch 'rvankoert:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rvankoert authored Dec 7, 2023
2 parents 8a86bdf + 8e4b0a4 commit f06294d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/batch_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def output_predictions(predictions: List[Tuple[float, str]],
# Output the text to a file
output_dir = os.path.join(output_path, group_id)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
os.makedirs(output_dir, exist_ok=True)
logger.debug(f"Created output directory: {output_dir}")
with open(os.path.join(output_dir, identifier + ".txt"), "w") as f:
f.write(text + "\n")
Expand Down Expand Up @@ -446,6 +446,6 @@ def output_prediction_error(output_path: str,

output_dir = os.path.join(output_path, group_id)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
os.makedirs(output_dir, exist_ok=True)
with open(os.path.join(output_dir, identifier + ".error"), "w") as f:
f.write(str(text) + "\n")

0 comments on commit f06294d

Please sign in to comment.