Skip to content

Conversation

@gante
Copy link
Contributor

@gante gante commented Jan 23, 2023

What does this PR do?

As originally discussed in #20388, this PR makes model.save_pretrained() also call model.generation_config.save_pretrained() if it is a generation-capable model (on all 3 frameworks).

It also adds a bunch of tests, namely:

  • tests whether the generation config can be pushed to the hub
  • tests whether model.save_pretrained() actually saves generation_config.json if it is a model that can generate (on all 3 frameworks)

@gante gante requested a review from sgugger January 23, 2023 15:30
@gante gante changed the title Generate: save generation config with the model's save_pretrained Generate: save generation config with the models' .save_pretrained() Jan 23, 2023
@gante gante mentioned this pull request Jan 23, 2023
5 tasks
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

LGTM thanks for adding this functionality 😉 As discussed, this should solve most of the issues I had

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 23, 2023

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

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!

@gante gante merged commit 1eda4a4 into huggingface:main Jan 23, 2023
@gante gante deleted the generate_config_save_with_model branch January 23, 2023 16:21
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