We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e7ff04 commit d30853bCopy full SHA for d30853b
src/huggingface_hub/_snapshot_download.py
@@ -256,9 +256,12 @@ def snapshot_download(
256
# In that case store a ref.
257
if revision != commit_hash:
258
ref_path = os.path.join(storage_folder, "refs", revision)
259
- os.makedirs(os.path.dirname(ref_path), exist_ok=True)
260
- with open(ref_path, "w") as f:
261
- f.write(commit_hash)
+ try:
+ os.makedirs(os.path.dirname(ref_path), exist_ok=True)
+ with open(ref_path, "w") as f:
262
+ f.write(commit_hash)
263
+ except OSError as e:
264
+ logger.warning(f"Ignored error while writing commit hash to {ref_path}: {e}.")
265
266
# we pass the commit_hash to hf_hub_download
267
# so no network call happens if we already
0 commit comments