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

[CLAP] Replace hard-coded batch size to enable dynamic ONNX export #27790

Merged
merged 3 commits into from
Dec 9, 2023

Conversation

xenova
Copy link
Contributor

@xenova xenova commented Dec 1, 2023

What does this PR do?

This PR unblocks adding ONNX export support for CLAP models in Optimum (see PR), by replacing hard-coded batch size in the window_reverse function. This was already done in the past for other similar models (by @lewtun), but since then, CLAP was added (by @ArthurZucker), and this change was not brought across there.

Fixes huggingface/optimum#1552 (comment)

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.

@ArthurZucker @lewtun @echarlaix

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

LGTM thanks

src/transformers/models/clap/modeling_clap.py Outdated Show resolved Hide resolved
@xenova
Copy link
Contributor Author

xenova commented Dec 6, 2023

Added back the docstring 👍 - ready to merge imo? :)

@ArthurZucker
Copy link
Collaborator

ArthurZucker commented Dec 7, 2023

Yep just make style and rebase should do the trick for the CI

@xenova
Copy link
Contributor Author

xenova commented Dec 7, 2023

Done 👍 (failed style seemed to be unrelated; should be fixed now)
image

@ArthurZucker ArthurZucker merged commit ffd426e into huggingface:main Dec 9, 2023
18 checks passed
@ArthurZucker
Copy link
Collaborator

Thanks 👍🏻

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