pypi huggingface-hub 0.0.8
v0.0.8: Model Info, Snapshot download

latest releases: 0.21.3, 0.21.2, 0.21.1...
2 years ago
  • Addition of the HfApi.model_info method to retrieve information about a repo given a revision.
  • The accompanying snapshot_download utility to download to cache all files stored in that repo at that given revision.

Example usage of HfApi.model_info:

from huggingface_hub import HfApi

hf_api = HfApi()
model_info = hf_api.model_info("lysandre/dummy-hf-hub")

print("Model ID:", model_info.modelId)

for file in model_info.siblings:
    print("file:", file.rfilename)

outputs:

Model ID: lysandre/dummy-hf-hub
file: .gitattributes
file: README.md

Example usage of snapshot_download:

from huggingface_hub import snapshot_download
import os

repo_path = snapshot_download("lysandre/dummy-hf-hub")
print(os.listdir(repo_path))

outputs:

['.gitattributes', 'README.md']

Don't miss a new huggingface-hub release

NewReleases is sending notifications on new releases.