Skip to content

Conversation

@anteju
Copy link
Collaborator

@anteju anteju commented Aug 5, 2025

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

This PR fixes an issue where for multichannel cuts, only the first channel was used as supervision.

Currently, processing a 2-channel audio file and using channel_selector=1 with Canary fails with the following error

  File "/home/.conda/envs/nemo_2.4/lib/python3.12/site-packages/nemo/collections/common/prompts/canary.py", line 171, in canary
    prompt.PROMPT_LANGUAGE_SLOT: ifnone(cut.supervisions[0].language, cut.custom.get("target_lang")),
                                        ~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

The reason for this failure is that LazyNeMoIterator prepared supervision without specifiying channel, resulting in supervision with channel=0. Afterwards, when with_channels was used to select the second channel (channel_selector=1) using _select_channel, the resulting cut had empty supervisions. Finally, this crashed when building the Canary prompt, as shown above.

Detailed description of the issue in this comment:

Collection: common

Changelog

  • Updated LazyNeMoIterator to use supervision with channel=cut.channel
  • Added unit test

Usage

This can be tested using the following scripts

Test using

bash test_transcribe.sh 0  # first channel
bash test_transcribe.sh 1  # second channel
bash test_transcribe.sh reference_channel  # transcribe channel defined in the field "reference_channel"

The following examples will raise an error:

bash test_transcribe.sh null  # channel selector set to None
bash test_transcribe.sh 2  # channel doesn't exist
bash test_transcribe.sh non_existent_field  # field doesn't exist

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

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

@github-actions github-actions bot added the common label Aug 5, 2025
@anteju anteju force-pushed the pr/lazy-nemo-iterator-with-mc-cuts branch from ff6d555 to 44f8ad7 Compare August 5, 2025 21:18
Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

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

Great catch, thank you. LGTM

@pzelasko pzelasko merged commit fd3ee74 into NVIDIA-NeMo:main Aug 6, 2025
212 of 217 checks passed
nasretdinovr pushed a commit to nasretdinovr/NeMo that referenced this pull request Aug 8, 2025
…14409)

* Fix LazyNeMoIterator supervision for multi-channel cuts

Signed-off-by: Ante Jukić <[email protected]>

* Apply isort and black reformatting

Signed-off-by: anteju <[email protected]>

---------

Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: anteju <[email protected]>
Co-authored-by: anteju <[email protected]>
guyueh1 pushed a commit to guyueh1/NeMo that referenced this pull request Aug 25, 2025
…14409)

* Fix LazyNeMoIterator supervision for multi-channel cuts

Signed-off-by: Ante Jukić <[email protected]>

* Apply isort and black reformatting

Signed-off-by: anteju <[email protected]>

---------

Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: anteju <[email protected]>
Co-authored-by: anteju <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
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.

2 participants