Skip to content

Conversation

@gante
Copy link
Contributor

@gante gante commented Jan 29, 2025

What does this PR do?

Makes RUN_SLOW=1 py.test tests/models/bart/test_modeling_bart.py green.

(Issues found while working on #35802)

@gante gante requested a review from ydshieh January 29, 2025 18:25
@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.


model = model_class(config)
if "position_ids" not in inspect.signature(model.forward).parameters:
self.skipTest("Model does not support position_ids")
Copy link
Collaborator

Choose a reason for hiding this comment

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

For the record: self.skipTest will skip here and break the for loop for model_class in self.all_generative_model_classes.

Here is somehow fine as it's rare to have a model architecture with some model classes having position_ids but not other model class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is indeed undesirable :(

Do you have a better suggestion? continue to skip the iteration on the loop also doesn't seem adequate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can have pytest-subtests installed in CI env. and using TestCase.subTest and skip inside it where necessary.

But I have installed it yet because it's will change the test summary outputs (for which some adjustments have to be done IMO).

(I also had to fix something in pytest-subtests repository)

Copy link
Collaborator

Choose a reason for hiding this comment

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

For now, let's just do whatever you prefer (skip or continue), it's fine, we are aware of the situation and might take an action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay :)

I'm going to merge as is then -- as you wrote, it's uncommon for a model to have subclasses with different inputs regarding the input modality

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.

Great, thank you!

@gante gante merged commit 8bc4c89 into huggingface:main Jan 30, 2025
25 checks passed
@gante gante deleted the green_bart branch January 30, 2025 10:00
bursteratom pushed a commit to bursteratom/transformers that referenced this pull request Feb 5, 2025
elvircrn pushed a commit to elvircrn/transformers that referenced this pull request Feb 13, 2025
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Feb 16, 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