NVIDIA / NeMo

A scalable generative AI framework built for researchers and developers working on Large Language Models, Multimodal, and Speech AI (Automatic Speech Recognition and Text-to-Speech)
https://docs.nvidia.com/nemo-framework/user-guide/latest/overview.html
Apache License 2.0
11.86k stars 2.47k forks source link

How to Enable Spec Augmentation During Testing or Transcription #10113

Closed csetanmayjain closed 2 months ago

csetanmayjain commented 2 months ago

I have successfully applied Spec Augmentation during training, but I would like to know how to enable Spec Augmentation while testing or transcribing hypotheses.

Is it possible to apply Spec Augmentation during testing or transcription? If so, could you provide the necessary configurations or code snippets?

Thank

csetanmayjain commented 2 months ago

I managed to figure it out, and for those who are searching, they might find this as a helpful reference:

To address the issue, you can modify the code in nemo/collections/asr/models/ctc_models.py. Specifically, navigate to line 502, which is:

if self.spec_augmentation is not None and self.training:

You should update this line to:

if self.spec_augmentation is not None:

This change ensures that the self.training condition is no longer required for spec_augmentation. The rest of the configuration can remain unchanged.

Disclaimer: For you it might be possible that you have used different config., you have to modify that script accordingly