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

[audio] Adding NGC checkpoints for SE and SR #11428

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions nemo/collections/audio/models/enhancement.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,24 @@ def evaluation_step(self, batch, batch_idx, dataloader_idx: int = 0, tag: str =

return {f'{tag}_loss': loss}

@classmethod
def list_available_models(cls) -> Optional[PretrainedModelInfo]:
"""
This method returns a list of pre-trained model which can be instantiated directly from NVIDIA's NGC cloud.

Returns:
List of available pre-trained models.
"""
results = []
model = PretrainedModelInfo(
pretrained_model_name="sr_ssl_flowmatching_16k_430m",
description="For details on this model, please refer to https://ngc.nvidia.com/catalog/models/nvidia:nemo:sr_ssl_flowmatching_16k_430m",
location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/sr_ssl_flowmatching_16k_430m/versions/v1/files/sr_ssl_flowmatching_16k_430m.nemo",
)
results.append(model)

return results


class SchroedingerBridgeAudioToAudioModel(AudioToAudioModel):
"""This models is using a Schrödinger Bridge process to generate
Expand Down Expand Up @@ -1235,3 +1253,27 @@ def evaluation_step(self, batch, batch_idx, dataloader_idx: int = 0, tag: str =
self.log('global_step', torch.tensor(self.trainer.global_step, dtype=torch.float32))

return {f'{tag}_loss': loss}

@classmethod
def list_available_models(cls) -> Optional[PretrainedModelInfo]:
"""
This method returns a list of pre-trained model which can be instantiated directly from NVIDIA's NGC cloud.

Returns:
List of available pre-trained models.
"""
results = []
model = PretrainedModelInfo(
pretrained_model_name="se_den_sb_16k_small",
description="For details on this model, please refer to https://ngc.nvidia.com/catalog/models/nvidia:nemo:se_den_sb_16k_small",
location="https://api.ngc.nvidia.com/v2/org/nvidia/team/nemo/models/se_den_sb_16k_small/versions/v1.0/files/se_den_sb_16k_small.nemo",
)
results.append(model)

model = PretrainedModelInfo(
pretrained_model_name="se_der_sb_16k_small",
description="For details on this model, please refer to https://ngc.nvidia.com/catalog/models/nvidia:nemo:se_der_sb_16k_small",
location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/se_der_sb_16k_small/versions/v1/files/se_der_sb_16k_small.nemo",
)
results.append(model)
return results
Loading