huggingface_hub
bdb9d06b - fix: use cache for snapshots even if refs does not exist (#1306)

Commit
2 years ago
fix: use cache for snapshots even if refs does not exist (#1306) * fix: use cache for snapshots even if refs does not exist If one uses `hf_hub_download` only referencing specific commits the `refs` folder will not be created even though data will be cached via `snapshots` and `blobs`. Subsequent calls to `try_to_load_from_cache` were returning None even though the desired data was in the cache. Example: ```python # download something hf_hub_download(repo_id=repo, revision=commit_hash, filename=filepath, token=token) # returns None try_to_load_from_cache(repo_id=repo, revision=commit_hash, filename=filepath) ``` * FIX in case .not_exists + add tests Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Author
Parents
Loading