-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use deprecated Repository
anymore
#1641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! Can you run the styling checks? make style && make quality
? 🙏
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
It was actually more than just linting! 😬 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Wauplin for refactoring the code and examples to remove deprecations! ✨
Thanks for the reviews! |
* Don't use deprecated Repository anymore * oops
* Don't use deprecated Repository anymore * oops
Repository
is a deprecated feature inhuggingface_hub
. It is more robust to use the HTTP-based methods fromHfApi
instead. Here is a doc page explaining why it's better. Main reasons are 1. don't need to clone a repo to push files 2. faster upload speed 3. don't need git/git+lfs configured locally.transformers
switched to useHfApi
is all their training scripts in Aug 23' (see huggingface/transformers#25095) without breaking. Let's do the same forpeft
!I also removed the
get_full_repo_name
redefinition, in favor ofcreate_repo(repo_name, exists_ok=Ture).repo_id
=> no need to infer the explicit repo_id before creating_it.Disclaimer: I did not test those changes myself. Should be fine though.
Similar PRs: huggingface/accelerate#2658 huggingface/parler-tts#18