Skip to content

Commit

Permalink
Fix race-condition issue when downloading from multiple threads (#2534)
Browse files Browse the repository at this point in the history
* Fix race-condition issue when downloading from multiple threads

* correct fix
  • Loading branch information
Wauplin authored and hanouticelina committed Sep 12, 2024
1 parent 23bab6a commit 97ea578
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/huggingface_hub/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,8 @@ def _hf_hub_download_to_cache_dir(
filename=filename,
force_download=force_download,
)
_create_symlink(blob_path, pointer_path, new_blob=True)
if not os.path.exists(pointer_path):
_create_symlink(blob_path, pointer_path, new_blob=True)

return pointer_path

Expand Down

0 comments on commit 97ea578

Please sign in to comment.