Skip to content
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

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Apr 12, 2024

Repository is a deprecated feature in huggingface_hub. It is more robust to use the HTTP-based methods from HfApi 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 use HfApi is all their training scripts in Aug 23' (see huggingface/transformers#25095) without breaking. Let's do the same for peft!

I also removed the get_full_repo_name redefinition, in favor of create_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

Copy link
Contributor

@younesbelkada younesbelkada left a 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 ? 🙏

@HuggingFaceDocBuilderDev

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.

@Wauplin
Copy link
Contributor Author

Wauplin commented Apr 12, 2024

It was actually more than just linting! 😬
Fixed it in 70532bf :)

Copy link
Contributor

@pacman100 pacman100 left a 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! ✨

@Wauplin
Copy link
Contributor Author

Wauplin commented Apr 12, 2024

Thanks for the reviews!

@Wauplin Wauplin merged commit 9f0cfc9 into main Apr 12, 2024
14 checks passed
DTennant pushed a commit to DTennant/peft that referenced this pull request Apr 16, 2024
* Don't use deprecated Repository anymore

* oops
DTennant pushed a commit to DTennant/peft that referenced this pull request Apr 19, 2024
* Don't use deprecated Repository anymore

* oops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants