Skip to content

Commit

Permalink
Simplify mkdir
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Bernstorff <martinbernstorff@gmail.com>
  • Loading branch information
peterbjorgensen and MartinBernstorff authored Nov 14, 2023
1 parent b63dc03 commit a9a17e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/dfm/common/data_cleaning/dolma_taggers/perplexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def _get_ccnet_pretrained_lm(lang: str) -> Path:
url = f"http://dl.fbaipublicfiles.com/cc_net/lm/{lang}.arpa.bin"
data_folder = Path("data_lm")

if not Path.exists(data_folder):
Path.mkdir(data_folder, parents=True)
Path.mkdir(data_folder, parents=True, exist_ok=True)

filename = f"{lang}.arpa.bin"
file_path = data_folder / filename
Expand Down

0 comments on commit a9a17e6

Please sign in to comment.