Skip to content

Commit

Permalink
Fixed sampler override and audio_key in prepare_audio_data (NVIDIA#10980
Browse files Browse the repository at this point in the history
)

Signed-off-by: Ante Jukić <ajukic@nvidia.com>
  • Loading branch information
anteju authored Oct 22, 2024
1 parent 746203a commit 70d8cc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/audio/process_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def main(cfg: ProcessConfig) -> ProcessConfig:
audio_to_audio_model.set_trainer(trainer)
audio_to_audio_model = audio_to_audio_model.eval()

# override sampler
if cfg.sampler is not None:
# override sampler if necessary
if cfg.sampler:
logging.info('Overriding sampler with %s', cfg.sampler)

if hasattr(audio_to_audio_model, 'sampler'):
Expand Down
2 changes: 1 addition & 1 deletion nemo/collections/asr/parts/utils/transcribe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def prepare_audio_data(cfg: DictConfig) -> Tuple[List[str], bool]:
with NamedTemporaryFile(mode='w', suffix='.json', delete=False) as f:
for item in read_and_maybe_sort_manifest(cfg.dataset_manifest, try_sort=cfg.presort_manifest):
audio_file = get_full_path(audio_file=item[audio_key], manifest_file=cfg.dataset_manifest)
item[audio_key] = audio_file
item['audio_filepath'] = audio_file
filepaths.append(audio_file)
f.write(json.dumps(item) + "\n")
sorted_manifest_path = f.name
Expand Down

0 comments on commit 70d8cc1

Please sign in to comment.