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

Add SSL import functionality for Audio Lexical PNC Models #5834

Merged
merged 7 commits into from
Jan 23, 2023

Conversation

trias702
Copy link
Collaborator

Signed-off-by: Daniel Egert degert@nvidia.com

What does this PR do ?

This PR allows the audio lexical PNC model to also import pretrained SSL models for the audio encoder, and allows importing any audio encoder which is on disk, and not just on NGC

Collection: [Note which collection this PR will affect]
NLP

Changelog

  • Changes punctuation_capitalization_lexical_audio_model.py to support .restore_from instead of just .from_pretrained
  • Changes punctuation_capitalization_lexical_audio_model.py to support SSL models for the encoder by correct removing the SSL decoder_losses
  • Changes punctuation_capitalization_model.py to support inference with a list of bytes instead of just list of strings for audio filepaths on disk. This allows using a bytestream which is necessary for Riva sharded tar files
  • Changes punctuation_capitalization_infer_dataset.py to support the same bytestream changes
  • Changes punctuation_capitalization_model.py to remove superfluous debug print statements outside nemo logging which were accidentally left in

Usage

You can now specify model.audio_encoder.pretrained_model to be a .nemo file on disk rather than just the name of a model in NGC. This is set in the config yaml of the audio lexical model.

model:
  audio_encoder:
    pretrained_model: /path/to/my_ssl_model.nemo  # this now works
    freeze:
      is_enabled: false # If set to True weights of audio encoder will not be updated during training.
      d_model: 256 # Input dimension of MultiheadAttentionMechanism and PositionwiseFeedForward
      d_ff: 1024 # Hidden dimension of PositionwiseFeedForward
      num_layers: 4 # Number of additional Conformer layers

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: Daniel Egert <degert@nvidia.com>
@github-actions github-actions bot added the NLP label Jan 20, 2023
Copy link
Collaborator

@jubick1337 jubick1337 left a comment

Choose a reason for hiding this comment

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

LGTM just minor changes

@jubick1337 jubick1337 merged commit cc00b1d into NVIDIA:main Jan 23, 2023
Kipok pushed a commit to Kipok/NeMo that referenced this pull request Jan 31, 2023
* Initial commit of changes for SSL functionality

Signed-off-by: Daniel Egert <degert@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Deleted comment lines as per request

Signed-off-by: Daniel Egert <degert@nvidia.com>

Signed-off-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matvei Novikov <mattyson.so@gmail.com>
ericharper pushed a commit that referenced this pull request Jan 31, 2023
* Initial commit of changes for SSL functionality

Signed-off-by: Daniel Egert <degert@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Deleted comment lines as per request

Signed-off-by: Daniel Egert <degert@nvidia.com>

Signed-off-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matvei Novikov <mattyson.so@gmail.com>
ericharper pushed a commit that referenced this pull request Jan 31, 2023
* Initial commit of changes for SSL functionality

Signed-off-by: Daniel Egert <degert@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Deleted comment lines as per request

Signed-off-by: Daniel Egert <degert@nvidia.com>

Signed-off-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matvei Novikov <mattyson.so@gmail.com>
Kipok pushed a commit to Kipok/NeMo that referenced this pull request Jan 31, 2023
* Initial commit of changes for SSL functionality

Signed-off-by: Daniel Egert <degert@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Deleted comment lines as per request

Signed-off-by: Daniel Egert <degert@nvidia.com>

Signed-off-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matvei Novikov <mattyson.so@gmail.com>
@trias702 trias702 deleted the audio_lexical_ssl branch February 4, 2023 00:14
titu1994 pushed a commit to titu1994/NeMo that referenced this pull request Mar 24, 2023
* Initial commit of changes for SSL functionality

Signed-off-by: Daniel Egert <degert@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Deleted comment lines as per request

Signed-off-by: Daniel Egert <degert@nvidia.com>

Signed-off-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: Daniel Egert <degert@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matvei Novikov <mattyson.so@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants