-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
onnx export for G2P models #8177
Conversation
Hello, i am trying to make G2P models exportable, but i am running into issues with ONNX export. |
both (t5 and ctc) return this error:
|
makes G2P ctc model exportable Signed-off-by: Peter Pisljar <peter.pisljar@gmail.com> Signed-off-by: ppisljar <peter.pisljar@gmail.com>
Signed-off-by: ppisljar <peter.pisljar@gmail.com>
for more information, see https://pre-commit.ci Signed-off-by: ppisljar <peter.pisljar@gmail.com>
i was able to get onnx export to finish (with a lot of warnings) for CTC model, if i changed the last lines to :
as it seems that returning a string was an issue ? however when i try to use this onnx model, it tells me it has 0 inputs:
returns [] |
in the latest commit e93ffec ctc decoding is skipped, in this way export works succesfully for CTC model as well. is it not possible to make ctc decoding part of the onnx model ? |
for more information, see https://pre-commit.ci Signed-off-by: ppisljar <peter.pisljar@gmail.com>
for more information, see https://pre-commit.ci Signed-off-by: ppisljar <peter.pisljar@gmail.com>
for more information, see https://pre-commit.ci Signed-off-by: ppisljar <peter.pisljar@gmail.com>
for more information, see https://pre-commit.ci Signed-off-by: ppisljar <peter.pisljar@gmail.com>
for more information, see https://pre-commit.ci Signed-off-by: ppisljar <peter.pisljar@gmail.com>
i verified the generated onnx models and they seem to work correctly. still i would really appreciate if someone can guide to towards making ctc decoding part of the nemo model as well as without it its quite hard to consume it. |
@rlangman can you take a look ? |
@borisfom could you take a look at this? |
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.
I left a few questions, but it would be nice to hear from someone who is more familiar with ONNX and these particular models.
def output_types(self): | ||
return self._output_types | ||
|
||
def input_example(self, max_batch=1, max_dim=44): |
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.
It looks like max_batch
and max_dim
are not used. Are they required by the export code?
|
||
def forward_for_export(self, input_ids): | ||
outputs = self.model.generate( | ||
input_ids, output_scores=True, return_dict_in_generate=True, max_length=model_max_target_len |
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.
would max_length=model_max_target_len
be max_length=self.max_target_len
?
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
Signed-off-by: Peter Pisljar <peter.pisljar@gmail.com>
Signed-off-by: Peter Pisljar <peter.pisljar@gmail.com>
jenkins |
jenkins |
ping |
jenkins |
jenkins |
1 similar comment
jenkins |
What does this PR do ?
Adds support for ONNX export to G2P models (CTC/byT5)
Collection: tts
Jenkins CI
To run Jenkins, a NeMo User with write access must comment
jenkins
on the PR.Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information