snapshot
snapshot
#
snapshot — a model's weights, downloaded once from Hugging Face into the scratch.
- Key. The
Weightsvalue is the whole cache key, so a snapshot is fetched once per pinned commit and then shared, pinned and evicted like any other object; a driver never touches~/.cache/huggingface. - Download.
huggingface_hub.snapshot_downloadfills a freshManagedDirwith the repository's files at that revision. - Hand over. The directory is the value: a driver receives it as its
--weightsargument.
snapshot(weights)
#
The files of weights' repository at its commit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weights
|
Weights
|
The repository and commit to download. |
required |
Returns:
| Type | Description |
|---|---|
ManagedDir
|
The directory holding the repository's files. |
Raises:
| Type | Description |
|---|---|
HfHubHTTPError
|
If the repository or revision cannot be fetched. |