NeMo icon indicating copy to clipboard operation
NeMo copied to clipboard

[Audio] TransformerUNet: predictive model support added

Open nasretdinovr opened this issue 8 months ago • 5 comments

[!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 adds support for using TransformerUNet as a predictive model.

Collection: audio

Changelog

  • Replaced hardcoded value "adaptive_rmsnorm=True" with a configurable argument
  • Handled None value for "condition" instead of raising an error

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

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:

  • [x] Make sure you read and followed Contributor guidelines
  • [x] 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:

  • [x] 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)

nasretdinovr avatar May 06 '25 18:05 nasretdinovr

Hey @nasretdinovr, CI has decided to skip all tests here because it believes that the file you touched -nemo/collections/audio/parts/submodules/transformerunet.py - is neither used by any file within nemo/ nor tests/.

Can you confirm? If so, we can go ahead and merge this PR

ko3n1g avatar May 07 '25 23:05 ko3n1g

Hey @nasretdinovr, CI has decided to skip all tests here because it believes that the file you touched -nemo/collections/audio/parts/submodules/transformerunet.py - is neither used by any file within nemo/ nor tests/.

Can you confirm? If so, we can go ahead and merge this PR

@ko3n1g

Actually, It is used at least by this test here.

The reason that CI decided so is probably because the model inside the file I touched nemo/collections/audio/parts/submodules/transformerunet.py is usually used as an estimator part inside more general Speech Enhancement class, e.g., from nemo.collections.audio.models import FlowMatchingAudioToAudioModel. I this case we only provide a dict of arguments of the estimator, and the estimator is initialized inside the general Speech Enhancement class.

I'm not sure if it is a problem, since it is just how everything should work in NeMo.

nasretdinovr avatar May 08 '25 11:05 nasretdinovr

Hey @nasretdinovr, CI has decided to skip all tests here because it believes that the file you touched -nemo/collections/audio/parts/submodules/transformerunet.py - is neither used by any file within nemo/ nor tests/. Can you confirm? If so, we can go ahead and merge this PR

@ko3n1g

Actually, It is used at least by this test here.

The reason that CI decided so is probably because the model inside the file I touched nemo/collections/audio/parts/submodules/transformerunet.py is usually used as an estimator part inside more general Speech Enhancement class, e.g., from nemo.collections.audio.models import FlowMatchingAudioToAudioModel. I this case we only provide a dict of arguments of the estimator, and the estimator is initialized inside the general Speech Enhancement class.

I'm not sure if it is a problem, since it is just how everything should work in NeMo.

Thanks a lot for this very valuable feedback. It's an edge-case the CI did not yet consider. I'll try to extend it by this use-case and will come back to your PR once its ready.

ko3n1g avatar May 08 '25 13:05 ko3n1g

@nasretdinovr @ko3n1g I added tests that explicitly use this class, we need them anyway

racoiaws avatar May 08 '25 18:05 racoiaws

@nasretdinovr @ko3n1g I added tests that explicitly use this class, we need them anyway

@racoiaws thanks for that

nasretdinovr avatar May 12 '25 12:05 nasretdinovr