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

[generate] move max time tests #35962

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Conversation

gante
Copy link
Member

@gante gante commented Jan 29, 2025

What does this PR do?

2-in-1 PR:

  1. Moves the tests regarding generate()'s max_time flag from specific models to the generation integration tests. It is a generate feature, and not a model feature
  2. Fixes the test -- e.g. the one on gpt2 had an incorrect assertion

(found while working on #35802 )

@gante gante requested a review from ydshieh January 29, 2025 16:23
@@ -4300,6 +4301,46 @@ def test_generate_from_inputs_embeds_with_bos_token_id_is_none(self):
with self.assertRaises(ValueError):
model.generate(max_length=20, bos_token_id=None)

@slow
def test_max_time(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

(this is almost a copy from the gpt2 test. the last assertion was incorrect, and it is fixed here)

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks.

(not sure class TokenHealingTestCase is the best class for this test, but it's super nit ...)

@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.

@gante
Copy link
Member Author

gante commented Jan 29, 2025

@ydshieh it is not 🙈 moving to the right class

Thank you for noticing it!

@gante gante merged commit 4d3b107 into huggingface:main Jan 29, 2025
25 checks passed
@gante gante deleted the fix_max_time_tests branch January 29, 2025 17:56
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.

3 participants