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

[collections] bugfix for capturing NotImplementedError of non-supported sup data types. #4297

Merged
merged 2 commits into from
Jun 2, 2022

Conversation

XuesongYang
Copy link
Collaborator

@XuesongYang XuesongYang commented Jun 1, 2022

What does this PR do ?

Fixed the bug that does not correctly capture NotImplementedError of non-supported supplementary data types. Original implementation as shown in https://github.com/NVIDIA/NeMo/blob/main/nemo/collections/tts/torch/data.py#L262-L263 will not raise any exception ever because the data_type has already been validated by looking it up in DATA_STR2DATA_CLASS in line 257.

Collection: [Note which collection this PR will affect]
nemo/collections/tts/torch/data.py

Changelog

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

Usage

  • You can potentially add a usage example below
# added a unit test for the function.
$ pytest --cpu tests/collections/tts/test_torch_tts.py::TestTTSDataset::test_raise_exception_on_not_supported_sup_data_types

========================================= test session starts =========================================
platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0 -- /home/xueyang/miniconda3/envs/nemo/bin/python
cachedir: .pytest_cache
rootdir: /home/xueyang/workspace/NeMo, configfile: setup.cfg
plugins: hydra-core-1.1.1
collected 1 item

tests/collections/tts/test_torch_tts.py::TestTTSDataset::test_raise_exception_on_not_supported_sup_data_types PASSED [100%]
==================================== 1 passed, 3 warnings in 2.95s ====================================

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)

@lgtm-com
Copy link

lgtm-com bot commented Jun 1, 2022

This pull request introduces 1 alert when merging 8f80086 into f9d45db - view on LGTM.com

new alerts:

  • 1 for Unused import

@XuesongYang XuesongYang changed the title [core] bugfix for capturing NotImplementedError of non-supported sup data types. [collections] bugfix for capturing NotImplementedError of non-supported sup data types. Jun 1, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jun 1, 2022

This pull request introduces 1 alert when merging 388bcb2 into f9d45db - view on LGTM.com

new alerts:

  • 1 for Unused import

@XuesongYang XuesongYang force-pushed the bugfix-ttsdataset branch 2 times, most recently from 68eedbd to e0b29cd Compare June 1, 2022 17:48
redoctopus
redoctopus previously approved these changes Jun 1, 2022
Copy link
Collaborator

@redoctopus redoctopus left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

Looks correct to me.

@XuesongYang XuesongYang merged commit 187e9a9 into main Jun 2, 2022
@XuesongYang XuesongYang deleted the bugfix-ttsdataset branch June 2, 2022 01:34
gkucsko pushed a commit to gkucsko/NeMo that referenced this pull request Jun 2, 2022
…lementary data types. (NVIDIA#4297)

Signed-off-by: Xuesong Yang <[email protected]>

Co-authored-by: Somshubra Majumdar <[email protected]>
Signed-off-by: Georg Kucsko <[email protected]>
@XuesongYang XuesongYang mentioned this pull request Jun 8, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants