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

Clean-up generation tests after moving methods to private #29582

Merged
merged 10 commits into from
Mar 19, 2024

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

Folllowing #29437 , this PR removes tests that call "to be private" generation methods. Instead we check each generation method by passing its arguments to the generate method.

All tests in generation, including slow are passing.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@gante

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

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

Thank you for the cleanup! 🧼

@gante gante requested a review from amyeroberts March 11, 2024 17:11
@gante
Copy link
Member

gante commented Mar 11, 2024

@zucchini-nlp a more descriptive PR name would be nice :D Musicgen seems to need some retouches, looking at the failing CI.

@amyeroberts see the PR header in #29437 for more context on why we are deprecating calls to the internal decoding methods

@zucchini-nlp zucchini-nlp changed the title Generation tests Clean-up generation tests after moving methods to private Mar 11, 2024
@zucchini-nlp
Copy link
Member Author

Fixed MusicGen. All passed except for two tests for multigpu, but those are failing in main also. Not related to current changes

Copy link
Collaborator

@amyeroberts amyeroberts 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 working on this tidy up - great to see so much code killed.

Only request before merge is that we still have a max length backwards compatibility test

@@ -2455,220 +2037,6 @@ def test_diverse_beam_search(self):
],
)

def test_max_length_backward_compat_greedy(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should still have at least one test_max_length_backward_compat test which calls model.generate

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this tests, because we can only check it if the (now private) generate methods are called directly. When calling from the model.generate, the max_length get defined by default from the generation config.

We have a test test_default_max_length_warning, which check max_length warnings when calling directly generate

@gante
Copy link
Member

gante commented Mar 19, 2024

@zucchini-nlp suggestion: revert docsting changes, as they will cause CI to fail ( #29718 fixes the CI error) :)

@gante gante merged commit 425ba56 into huggingface:main Mar 19, 2024
19 checks passed
ArthurZucker pushed a commit that referenced this pull request Mar 20, 2024
* clean-up tests

* refine comments

* fix musicgen tests

* make style

* remove slow decorator from a test

* more clean-up

* fix other failing tests
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