Skip to content

Support specifying revision in push_to_hub#25578

Merged
sgugger merged 1 commit intohuggingface:mainfrom
jmif:main
Aug 22, 2023
Merged

Support specifying revision in push_to_hub#25578
sgugger merged 1 commit intohuggingface:mainfrom
jmif:main

Conversation

@jmif
Copy link
Contributor

@jmif jmif commented Aug 17, 2023

Resolves #22867 by adding revision to create_commit call and proactively creating the branch before committing.

Change hasn't been discussed or approved in an issue AFAIK. Haven't written tests but happy to once the general approach is approved. I've tested manually and the changes work.

@ArthurZucker
Copy link
Collaborator

cc @sgugger

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! LGTM but would like for @Wauplin to have a second look.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
revision (`str`, *optional*, defaults to None):
revision (`str`, *optional*):

Nit: we don't write the default when it's None as it's implied by optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed!

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Looks good to me!

It's unusual in huggingface_hub to proactively create the branch to push to when it doesn't exist but it actually makes sense so why not :)

@jmif jmif changed the title [WIP] Support specifying revision in push_to_hub Support specifying revision in push_to_hub Aug 21, 2023
@sgugger sgugger merged commit 58c36be into huggingface:main Aug 22, 2023
@sgugger
Copy link
Collaborator

sgugger commented Aug 22, 2023

Thanks again!

@RonanKMcGovern
Copy link

@jmif what is the syntax for using the revision?

I tried:

model.push_to_hub(adapter_model_name, revision="GPTQ")

but that just pushed to main.

@ArthurZucker
Copy link
Collaborator

@RonanKMcGovern could you open a new issue with the output of transformers-cli env and a snippet for reproduction?

parambharat pushed a commit to parambharat/transformers that referenced this pull request Sep 26, 2023
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.

push_to_hub with branch or revision keyword argument

6 participants