-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use cache for snapshots even if refs does not exist #1306
fix: use cache for snapshots even if refs does not exist #1306
Conversation
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) ```
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` will return 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) ``` huggingface/huggingface_hub#1306
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` will return 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) ``` huggingface/huggingface_hub#1306
Hi @brycedrennan, thanks for reporting the issue and opening a PR for it! (and sorry for not having it merged under 12 hours 😛 |
The documentation is not available anymore as the PR was closed or merged. |
Thanks @Wauplin 😀 |
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` will return 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) ``` huggingface/huggingface_hub#1306
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` will return 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) ``` huggingface/huggingface_hub#1306
If one uses
hf_hub_download
only referencing specific commits therefs
folder will not be created even though data will be cached viasnapshots
andblobs
. Subsequent calls totry_to_load_from_cache
will return None even though the desired data was in the cache.Example: