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

Riva and k2 ASR WFST decoding #8921

Closed
wants to merge 2 commits into from
Closed

Riva and k2 ASR WFST decoding #8921

wants to merge 2 commits into from

Conversation

GNroy
Copy link
Collaborator

@GNroy GNroy commented Apr 14, 2024

What does this PR do ?

Adds Riva and k2 WFST decoding options for ASR inference.

if you are reading this, it means the PR is not finished.
What's left is:

  1. Documentation
  2. Usage example
  3. Tests

Collection: ASR

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# 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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

  • Related to # (issue)

Signed-off-by: Aleksandr Laptev <alaptev@nvidia.com>
@GNroy GNroy requested a review from artbataev April 14, 2024 19:24
@github-actions github-actions bot added the ASR label Apr 14, 2024
@GNroy GNroy marked this pull request as draft April 14, 2024 19:24
@GNroy
Copy link
Collaborator Author

GNroy commented Apr 14, 2024

jenkins

nemo/collections/asr/parts/submodules/wfst_decoder.py Dismissed Show dismissed Hide dismissed
nemo/collections/asr/parts/submodules/wfst_decoder.py Dismissed Show dismissed Hide dismissed

self._set_decoding_mode(decoding_mode)
self._set_decoder_config(config)
self._init_decoder()

Check warning

Code scanning / CodeQL

`__init__` method calls overridden method Warning

Call to self.
_init_decoder
in __init__ method, which is overridden by
method RivaGpuWfstDecoder._init_decoder
.
assert len(log_probs) == len(reference_texts)
word_ids = [[self._word2id[w] for w in text.split()] for text in reference_texts]
counts = torch.tensor([len(wid) for wid in word_ids])
decoding_mode_backup = self.decoding_mode

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable decoding_mode_backup is not used.
nemo/collections/asr/parts/submodules/wfst_decoder.py Dismissed Show dismissed Hide dismissed
nemo/collections/asr/parts/submodules/ctc_beam_decoding.py Dismissed Show dismissed Hide dismissed
nemo/collections/asr/parts/submodules/ctc_beam_decoding.py Dismissed Show dismissed Hide dismissed
nemo/collections/asr/parts/submodules/ctc_beam_decoding.py Dismissed Show dismissed Hide dismissed
if istate > 0:
for ostate in kaldifst.StateIterator(fst):
if ostate > 0 and istate != ostate:
label = token_ids[ostate] if ostate > 0 else blank_id

Check warning

Code scanning / CodeQL

Redundant comparison Warning

Test is always true, because of
this condition
.
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Apr 29, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant