Skip to content

Commit

Permalink
Clean up after bicleaner downloader (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatum authored Aug 7, 2024
1 parent f66a7b6 commit 9a82925
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pipeline/bicleaner/download_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ def check_result(result: subprocess.CompletedProcess):

def download(src: str, trg: str, output_path: str, compression_cmd: str) -> None:
tmp_dir = os.path.join(tempfile.gettempdir(), f"bicleaner-ai-{src}-{trg}")
if not os.path.exists(tmp_dir):
os.mkdir(tmp_dir)

if os.path.exists(tmp_dir):
# A previous download attempt failed, remove the temporary files.
shutil.rmtree(tmp_dir)

os.mkdir(tmp_dir)

# Attempt to download a model.
# 1: src-trg
Expand Down

0 comments on commit 9a82925

Please sign in to comment.