Releases: huggingface/huggingface_hub
Releases · huggingface/huggingface_hub
v0.0.8: Model Info, Snapshot download
- 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']
v0.0.7: Networking improvements + PyTorch mixin
-
Networking improvements by @Pierrci and @lhoestq (#21 and #22)
-
Adding mixin class for ease saving, uploading, downloading a PyTorch model. See PR #11 by @vasudevgupta7
Example usage:
from huggingface_hub import ModelHubMixin
class MyModel(nn.Module, ModelHubMixin):
def __init__(self, **kwargs):
super().__init__()
self.config = kwargs.pop("config", None)
self.layer = ...
def forward(self, ...):
return ...
model = MyModel()
# saving model to local directory & pushing to hub
model.save_pretrained("mymodel", push_to_hub=True, config={"act": "gelu"})
# initiatizing model & loading it from trained-weights
model = MyModel.from_pretrained("username/mymodel@main")
Thanks a ton for your contributions
v0.0.6
Repository class + other tweaks
v0.0.5 v0.0.5
Repository class
- v0.0.4
Repository helper class to interact with git/git-lfs programmatically
-
[Repository] more forgiving lfs_track
-
added stderr and exceptions (#19)
-
added stderr and exceptions
-
added log to push and check for commit error
-
fixed quality
-
doc improvements + small tweaks
-
[git_add] actually take input pattern
-
less brittle test if local_dir is an actual git repo
Co-authored-by: Julien Chaumond [email protected]
-
-
v0.0.3
Repository helper class to interact with git/git-lfs programmatically
v0.0.3rc2 v0.0.3rc2
v0.0.3rc1
Support for dataset repos and other improvements
v0.0.2 v0.0.2
Dummy release to check that everything works
v0.0.1 Update python-release.yml