-
Notifications
You must be signed in to change notification settings - Fork 2.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
Make TDT inference not require duration params #8207
Conversation
Signed-off-by: Hainan Xu <[email protected]>
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.
Overall it looks great! Minor comment about moving the new additional to RNNT char base class.
@@ -91,6 +91,11 @@ def __init__(self, cfg: DictConfig, trainer: Trainer = None): | |||
else: | |||
self.spec_augmentation = None | |||
|
|||
if loss_name == 'tdt': |
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.
This part should be closer to the loss definition above. Colocation of similar things
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.
done
@@ -208,15 +208,17 @@ def __init__(self, decoding_cfg, decoder, joint, blank_id: int): | |||
self.compute_timestamps = self.cfg.get('compute_timestamps', None) | |||
self.word_seperator = self.cfg.get('word_seperator', ' ') | |||
|
|||
if self.durations is not None: # this means it's a TDT model. | |||
if self.durations is not None and self.durations != []: # this means it's a TDT model. |
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 personally prefer checking for bool, which is more idiomatic and follows PEP8
For sequences (strings, lists, tuples), use the fact that empty sequences are false
https://peps.python.org/pep-0008/#programming-recommendations
But the current approach is also acceptable for me since it works.
@hainan-xv Thanks for the PR; I think it makes it more convenient to use decoding with TDT models. One minor comment about style. |
Signed-off-by: Hainan Xu <[email protected]>
Signed-off-by: Hainan Xu <[email protected]>
jenkins |
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.
Looks perfect, great work ! This should make it trivial for users to switch between rnnt and TDT
* Make TDT inference not require duration params Signed-off-by: Hainan Xu <[email protected]> * addressed review comments Signed-off-by: Hainan Xu <[email protected]> * stylistic change Signed-off-by: Hainan Xu <[email protected]> --------- Signed-off-by: Hainan Xu <[email protected]> Co-authored-by: Hainan Xu <[email protected]>
* Make TDT inference not require duration params Signed-off-by: Hainan Xu <[email protected]> * addressed review comments Signed-off-by: Hainan Xu <[email protected]> * stylistic change Signed-off-by: Hainan Xu <[email protected]> --------- Signed-off-by: Hainan Xu <[email protected]> Co-authored-by: Hainan Xu <[email protected]> Signed-off-by: stevehuang52 <[email protected]>
* Make TDT inference not require duration params Signed-off-by: Hainan Xu <[email protected]> * addressed review comments Signed-off-by: Hainan Xu <[email protected]> * stylistic change Signed-off-by: Hainan Xu <[email protected]> --------- Signed-off-by: Hainan Xu <[email protected]> Co-authored-by: Hainan Xu <[email protected]> Signed-off-by: Sasha Meister <[email protected]>
* Make TDT inference not require duration params Signed-off-by: Hainan Xu <[email protected]> * addressed review comments Signed-off-by: Hainan Xu <[email protected]> * stylistic change Signed-off-by: Hainan Xu <[email protected]> --------- Signed-off-by: Hainan Xu <[email protected]> Co-authored-by: Hainan Xu <[email protected]> Signed-off-by: Pablo Garay <[email protected]>
* Make TDT inference not require duration params Signed-off-by: Hainan Xu <[email protected]> * addressed review comments Signed-off-by: Hainan Xu <[email protected]> * stylistic change Signed-off-by: Hainan Xu <[email protected]> --------- Signed-off-by: Hainan Xu <[email protected]> Co-authored-by: Hainan Xu <[email protected]>
What does this PR do ?
Making it so that TDT inference doesn't require --duration params to be passed.
Collection: [Note which collection this PR will affect]
ASR
Changelog
The model now infers the duration params from model's loss configs.
Usage
# Add a code snippet demonstrating how to use this
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