Skip to content

Conversation

@alex-jw-brooks
Copy link
Contributor

Turns on the tests for granite speech now that the 3.3 model is up! Integration tests guard with peft, since they will fail if the lora isn't applied.

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.

@eustlb

@github-actions github-actions bot marked this pull request as draft April 16, 2025 18:05
@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.

@alex-jw-brooks alex-jw-brooks marked this pull request as ready for review April 16, 2025 18:05
@github-actions github-actions bot requested a review from ydshieh April 16, 2025 18:06
@ydshieh ydshieh requested a review from eustlb April 17, 2025 07:56

@slow
@pytest.mark.skip("Public models not yet available")
@pytest.mark.skipif(not is_peft_available(), reason="Outputs diverge without lora")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand very well here. Could you explain what are the different situations when peft is in the system and not in the system, it will cause this code in this test doing something differently and output will be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @ydshieh! Definitely - granite speech has a modality specific Lora that is only enabled when there are audio inputs. In this way, it lets users call it with audio for tasks like transcription, which will have the Lora enabled, and then choose to pass the raw text in through a second generate call if they want to, which is the same as calling the underlying llm (i.e., Lora is not enabled). This part of the model code will probably make it more clear:

if is_peft_available and self._hf_peft_config_loaded:

If Peft isn't installed, the model will not load the bundled audio Lora. This will cause the integration tests to fail with wrong outputs, which is why they are skipped if peft isn't installed

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 17, 2025

run-slow: granite_speech

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs: This comment contains run-slow, running the specified jobs:

models: ['models/granite_speech']
quantizations: [] ...

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 17, 2025

There are 3 tests failed if you could take a look first

https://github.com/huggingface/transformers/actions/runs/14511526296/job/40711224726

@alex-jw-brooks
Copy link
Contributor Author

Thanks @ydshieh - hopefully should be fixed now 🤞

@alex-jw-brooks alex-jw-brooks force-pushed the enable_granite_speech_tests branch from d00dd5a to 968242b Compare May 5, 2025 19:20
@alex-jw-brooks
Copy link
Contributor Author

Hi @ydshieh, can you please take another look at this PR when you have a moment? Our team just released a 2b variant of the speech model, so I've updated the tests to use it

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.

Very nice, all green!

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

@ydshieh ydshieh merged commit 06c4d05 into huggingface:main May 6, 2025
15 checks passed
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
* Enable granite speech 3.3 tests

* skip sdpa test for granite speech

* Explicitly move model to device

* Use granite speech 2b in tests

---------

Co-authored-by: Yih-Dar <[email protected]>
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