Skip to content

Conversation

@gante
Copy link
Contributor

@gante gante commented Apr 18, 2025

What does this PR do?

tests/models/speecht5/test_modeling_speecht5.py::SpeechT5ForSpeechToTextTest::test_past_key_values_format was flaky, so a revisit was in order.

This PR rewrites test_past_key_values_format so that:

  1. It works with Cache objects
  2. We can pass custom expected cache shapes for advanced models like DeepSeek V3
  3. The checks performed are exactly the same as before

In the process, many model-level skips were removed 🤗

@github-actions github-actions bot marked this pull request as draft April 18, 2025 13:26
@github-actions
Copy link
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@gante gante requested review from ydshieh and zucchini-nlp April 18, 2025 13:26
@gante gante marked this pull request as ready for review April 18, 2025 13:26
@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

@zucchini-nlp zucchini-nlp 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 fixing it, has been annoying me a lot lately 😆


@pytest.mark.generate
# overridden because mllama has special cache for self and cross attentions
# overridden because mllama is not an encoder-decoder model, but has encoder-decoder-like cache
Copy link
Member

Choose a reason for hiding this comment

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

could also call super() with custom shapes, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly no :(

config.is_encoder_decoder is False -> doesn't perform encoder cache shape checks in the base test

@gante gante merged commit 362fa37 into huggingface:main Apr 22, 2025
20 checks passed
@gante gante deleted the update_test_past_key_values_format branch April 22, 2025 10:07
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
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