py
from huggingface_hub import Repository
repo = Repository("local_directory", clone_from="<user>/<model_id>")
save large files in `local_directory`
repo.git_add()
repo.auto_track_large_files()
repo.git_commit("Add large files")
repo.git_push()
No push rejected error anymore!
It is automatically used when leveraging the `commit` context manager:
py
from huggingface_hub import Repository
repo = Repository("local_directory", clone_from="<user>/<model_id>")
with repo.commit("Add large files"):
add large files
No push rejected error anymore!
- Auto track with LFS 177 (LysandreJik)
Documentation
- Update docs structure 145 (Pierrci)
- Update links to docs 147 (LysandreJik)
- Add new repo guide 153 (osanseviero)
- Add documentation for endpoints 155 (osanseviero)
- Document hf.co webhook publicly 156 (julien-c)
- docs: ✏️ mention the Training metrics tab 193 (severo)
- doc for Spaces 189 (julien-c)
Breaking changes
Reminder: the `huggingface_hub` library follows semantic versioning and is undergoing active development. While the first major version is not out (v1.0.0), you should expect breaking changes and we strongly recommend pinning the library to a specific version.
Two breaking changes are introduced with version v0.0.14.
The `whoami` return changes from a tuple to a dictionary
- Allow obtaining Inference API tokens with whoami 157 (osanseviero)
The `whoami` method changes its returned value from a tuple of `(<user>, [<organisations>])` to a dictionary containing a lot more information:
In versions v0.0.13 and below, here was the behavior of the `whoami` method from the `HfApi` class:
py
from huggingface_hub import HfFolder, HfApi
api = HfApi()
api.whoami(HfFolder.get_token())
('<user>', ['<org_0>', '<org_1>'])
In version v0.0.14, this is updated to the following:
py
from huggingface_hub import HfFolder, HfApi
api = HfApi()
api.whoami(HfFolder.get_token())
{
'type': str,
'name': str,
'fullname': str,
'email': str,
'emailVerified': bool,
'apiToken': str,
`plan': str,
'avatarUrl': str,
'orgs': List[str]
}
The `Repository`'s `use_auth_token` initialization parameter now defaults to `True`.
The `use_auth_token` initialization parameter of the `Repository` class now defaults to `True`. The behavior is unchanged if users are not logged in, at which point `Repository` remains agnostic to the `huggingface_hub`.
- Set use_auth_token to True by default 204 (LysandreJik)
Improvements and bugfixes
- Add sklearn code snippet 133 (osanseviero)
- Allow passing only model ID to clone when authenticated 150 (LysandreJik)
- More robust endpoint with toggled staging endpoint 148 (LysandreJik)
- Add config to list_models 152 (osanseviero)
- Fix audio-to-audio widget and add icon 142 (osanseviero)
- Upgrade spaCy to api 0.0.12 and remove allowlist 161 (osanseviero)
- docs: fix webhook response format 162 (severo)
- Update link in README.md 163 (nateraw)
- Revert "docs: fix webhook response format (162)" 165 (severo)
- Add Keras docker image 117 (osanseviero)
- Allow multiple models when testing a pipeline 124 (osanseviero)
- scikit rebased 170 (Narsil)
- Upgrading community frameworks to `audio-to-audio`. 94 (Narsil)
- Add sagemaker docs 173 (philschmid)
- Add Structured Data Classification as task 172 (osanseviero)
- Fixing keras outputs (widgets was ignoring because of type mismatch, now testing for it) 176 (Narsil)
- Updating spacy. 179 (Narsil)
- Create initial superb docker image structure 181 (osanseviero)
- Upgrading asteroid image. 175 (Narsil)
- Removing tests on huggingface_hub for unrelated changes in api-inference-community 180 (Narsil)
- Fixing audio-to-audio validation. 184 (Narsil)
- `rmdir api-inference-community/src/sentence-transformers` 188 (Pierrci)
- Allow generic inference for ASR for superb 185 (osanseviero)
- Add timestamp to snapshot download tests 201 (LysandreJik)
- No need for token to understand HF urls 203 (LysandreJik)
- Remove `--no_renames` argument to list deleted files. 205 (LysandreJik)