Expand description
Centralized hf-hub cache path construction.
All paths follow the hf-hub 0.5 cache layout:
{cache_root}/models--org--name/{snapshots,blobs,refs}/...
This module is the single source of truth for cache directory structure.
When hf-hub bumps, update this module and rerun the
cache_layout_matches_hf_hub integration test.
Functionsยง
- blob_
path - Blob path:
{repo_dir}/blobs/{etag}. - blobs_
dir - Blobs directory:
{repo_dir}/blobs/. - pointer_
path - Pointer path:
{repo_dir}/snapshots/{commit_hash}/{filename}. - ref_
path - Ref file path:
{repo_dir}/refs/{revision}. - refs_
dir - Refs directory:
{repo_dir}/refs/. - repo_
dir - Repo root directory:
{cache_root}/models--org--name/. - repo_
folder_ name - Repo folder name:
"models--org--name". - snapshot_
dir - Snapshot directory for a specific commit:
{repo_dir}/snapshots/{commit_hash}/. - snapshots_
dir - Snapshots directory:
{repo_dir}/snapshots/. - temp_
blob_ path - Temp blob path for chunked downloads:
{repo_dir}/blobs/{etag}.chunked.part.