Skip to content

Create branch if missing in hugginface-cli upload #1857

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

Merged
merged 5 commits into from
Nov 24, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Nov 23, 2023

Solves #1841 and #1657 cc @AlpinDale

With this PR, running huggingface-cli upload ... ... --revision=my-branch will automatically create the branch if it does not exist yet. I added some tests and adapted the docs.

Note:

  • it is similar to repo creation if repo doesn't exist yet
  • branch is created from the latest main
  • does not apply if --create-pr

@Wauplin Wauplin requested a review from LysandreJik November 23, 2023 16:40
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 23, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2b38375) 48.47% compared to head (dc18e3f) 82.46%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1857       +/-   ##
===========================================
+ Coverage   48.47%   82.46%   +33.98%     
===========================================
  Files          64       64               
  Lines        7795     7801        +6     
===========================================
+ Hits         3779     6433     +2654     
+ Misses       4016     1368     -2648     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Wauplin, this looks good to me and makes sense form an API perspective

@Wauplin
Copy link
Contributor Author

Wauplin commented Nov 24, 2023

Thanks for the quick review @LysandreJik!

@Wauplin Wauplin merged commit a4d5fd9 into main Nov 24, 2023
@Wauplin Wauplin deleted the 1841-create-branch-if-missing-in-cli-upload branch November 24, 2023 12:15
@julien-c
Copy link
Member

API makes sense to me too

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

Successfully merging this pull request may close these issues.

4 participants