-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Update VITS modeling to enable ONNX export #28141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the added suggestion.
For futur reference best practice is this only when it power of 2 ? does pow(x,2) work better (but is slower I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In all cases it'll be casted to fp32 (no matter the exponent), using a multiplication instead removes this constraint, and should be "faster" (not that it'll have any impact here) |
* Update vits modeling for onnx export compatibility * fix style * Update src/transformers/models/vits/modeling_vits.py
* Update vits modeling for onnx export compatibility * fix style * Update src/transformers/models/vits/modeling_vits.py
* Update vits modeling for onnx export compatibility * fix style * Update src/transformers/models/vits/modeling_vits.py
* Update vits modeling for onnx export compatibility * fix style * Update src/transformers/models/vits/modeling_vits.py
This PR enables the ONNX export of VITS models in Optimum (huggingface/optimum#1607), currently the export is failing due to a cast operator added before the pow operator in the model graph, resulting in an issue during the concatenation of two values of different data type
cc @xenova