Skip to content

Commit af3df5e

Browse files
Back to main for mixin
Signed-off-by: Nune <ntadevosyan@nvidia.com>
1 parent 0284ab0 commit af3df5e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

nemo/collections/asr/parts/mixins/transcription.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,10 @@ def transcribe_generator(self, audio, override_config: Optional[TranscribeConfig
357357
else:
358358
dataloader = audio
359359

360-
verbose = getattr(transcribe_cfg, 'verbose', True)
361-
is_parallel_chunking = getattr(transcribe_cfg, 'do_parallel_chunking', False)
362-
363-
# Initialize parallel chunking state if needed
364-
if is_parallel_chunking:
365-
combined_batches_of_same_audio = {}
366-
prev_cut_id = None
360+
if hasattr(transcribe_cfg, 'verbose'):
361+
verbose = transcribe_cfg.verbose
362+
else:
363+
verbose = True
367364

368365
for test_batch in tqdm(dataloader, desc="Transcribing", disable=not verbose):
369366
# Move batch to device
@@ -372,17 +369,21 @@ def transcribe_generator(self, audio, override_config: Optional[TranscribeConfig
372369
model_outputs = self._transcribe_forward(test_batch, transcribe_cfg)
373370
processed_outputs = self._transcribe_output_processing(model_outputs, transcribe_cfg)
374371

372+
# clear up memory
375373
del test_batch, model_outputs
374+
375+
# Yield results if generator
376376
yield processed_outputs
377+
377378
del processed_outputs
379+
378380
finally:
379381
# set mode back to its original value
380382
self._transcribe_on_end(transcribe_cfg)
381383

382384
"""
383385
Transcribe Execution Flow
384386
"""
385-
386387

387388
def _transcribe_on_begin(self, audio, trcfg: TranscribeConfig):
388389
"""

0 commit comments

Comments
 (0)