Snapshot download — mirrors snapshotDownload from @huggingface/hub.
Downloads an entire repository at a specific revision to a local cache
directory using the same layout as the Python huggingface_hub library:
~/.cache/huggingface/hub/
models--gpt2/
refs/
main <- contains the commit SHA
snapshots/
abc123def.../
config.json
tokenizer.json
...This makes snapshots compatible with tools that use the HuggingFace cache directory convention.
Summary
Functions
Returns the default HF Hub cache directory.
Downloads a full repository. See HuggingfaceClient.snapshot_download/2.
Builds the local folder name for a repo, matching the Python library layout.
Functions
@spec default_cache_dir() :: String.t()
Returns the default HF Hub cache directory.
@spec download( String.t(), keyword() ) :: {:ok, String.t()} | {:error, Exception.t()}
Downloads a full repository. See HuggingfaceClient.snapshot_download/2.
Builds the local folder name for a repo, matching the Python library layout.
Examples
"models--gpt2" # model
"datasets--rajpurkar--squad" # dataset
"spaces--gradio--hello_world" # space