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

[CLI] Support --create-branch option in huggingface-cli upload #1657

Closed
Wauplin opened this issue Sep 12, 2023 · 4 comments
Closed

[CLI] Support --create-branch option in huggingface-cli upload #1657

Wauplin opened this issue Sep 12, 2023 · 4 comments
Labels

Comments

@Wauplin
Copy link
Contributor

Wauplin commented Sep 12, 2023

Originally requested by @TheBloke on slack (private)

It'd be nice if it would also create a branch that didn't exist, or if there was a --create-branch boolean as it seems currently a branch (revision) has to exist before it can be uploaded to?

Q.: would we create it from latest or orphan. Might not be useful if #1655 is implemented as well.

@Wauplin Wauplin added the CLI label Sep 12, 2023
@kxhit
Copy link

kxhit commented Sep 20, 2023

HI @Wauplin
Would also want to have such a feature that I can upload to a specific new branch in the hf-repo. This will typically be useful when I have a project but want to store different implementation's model ckpt.

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 21, 2023

Hi @kxhit thanks for letting us know. As I see it, it would require to:

  • add a --create-branch argument here and here
  • add a check in __init__ that --create-branch and --create-pr are not used at the same time (print message otherwise + exit(1)). Also same for --every that is a particular case that we don't want to handle (yet?) IMO
  • add a check in __init__ that both --create-branch and --revision are used at the same time
  • add a create_branch(..., exists_ok=True) call just after repo creation here
  • add a unit test for that

Would you like to open a PR for it?

@kxhit
Copy link

kxhit commented Sep 21, 2023

Hi, thanks for your guidance. I will take a look but I'm currently busy on my diffusion/diffusers project. It would be great if someone could contribute to it!

@Wauplin
Copy link
Contributor Author

Wauplin commented Nov 24, 2023

In the end we went for a simpler solution where branch is automatically create if it doesn't exist. Discussed in #1841 and implemented in #1857.
Therefore closing this issue as "wont fix".

@Wauplin Wauplin closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants