Skip to content

Commit 97ea578

Browse files
Wauplinhanouticelina
authored andcommitted
Fix race-condition issue when downloading from multiple threads (#2534)
* Fix race-condition issue when downloading from multiple threads * correct fix
1 parent 23bab6a commit 97ea578

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/huggingface_hub/file_download.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,8 @@ def _hf_hub_download_to_cache_dir(
13961396
filename=filename,
13971397
force_download=force_download,
13981398
)
1399-
_create_symlink(blob_path, pointer_path, new_blob=True)
1399+
if not os.path.exists(pointer_path):
1400+
_create_symlink(blob_path, pointer_path, new_blob=True)
14001401

14011402
return pointer_path
14021403

0 commit comments

Comments
 (0)