Skip to content

Commit 2593ff8

Browse files
authored
Do not scan CACHEDIR.TAG file in cache (#4036)
1 parent b8d92a2 commit 2593ff8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/huggingface_hub/utils/_cache_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,8 @@ def scan_cache_dir(cache_dir: str | Path | None = None) -> HFCacheInfo:
657657
for repo_path in cache_dir.iterdir():
658658
if repo_path.name == ".locks": # skip './.locks/' folder
659659
continue
660+
if repo_path.name == "CACHEDIR.TAG": # skip CACHEDIR.TAG file
661+
continue
660662
try:
661663
repos.add(_scan_cached_repo(repo_path))
662664
except CorruptedCacheException as e:

0 commit comments

Comments
 (0)