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

[fix] Simplify save_to_hub, remove git dependency, add 'token' argument #2376

Merged
merged 6 commits into from
Dec 13, 2023

Conversation

tomaarsen
Copy link
Collaborator

@tomaarsen tomaarsen commented Dec 13, 2023

Fixes #1777, Fixes #1760, Fixes #1925

Hello!

Pull Request overview

  • Simplify save_to_hub:
  • Add optional token argument. Doesn't need to be provided if huggingface-cli login has been done.
  • Add mocked tests, no actual model upload
  • (Softly) deprecates the "organization" argument.
  • NOTE: save_to_hub now returns the URL to the uploaded model files, not the commit!
  • Update dependencies:
    • transformers>=4.32.0, required for token as used in main
    • huggingface_hub>=0.15.1 as required by transformers>=4.32.0

Details

The huggingface_hub has updated its recommended workflow on how to upload files, and this PR follows the updated version.

NOTE: save_to_hub now returns the URL to the uploaded model files, not the commit! I theorize that this is not a big issue, as I don't suspect many people to use the returned URL.
E.g.

'https://huggingface.co/sentence-transformers-testing/stsb-bert-tiny-copy/tree/main/'
# instead of
'https://huggingface.co/sentence-transformers-testing/stsb-bert-tiny-copy/commit/33dd09cf19b688db045f3850f003497d957b632b'
  • Tom Aarsen

black with line length of 120
100% (but mocked) coverage on save_to_hub
transformers>4.32.0 is required for 'token'
huggingface_hub>=0.15.1 is required by transformers
@tomaarsen tomaarsen merged commit 1565ef6 into UKPLab:master Dec 13, 2023
8 checks passed
@tomaarsen tomaarsen deleted the fix/upload branch December 13, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants