Skip to content

Commit 8ab46ff

Browse files
authored
update hypothesis when passed through cfg (NVIDIA-NeMo#11366)
Signed-off-by: Nithin Rao Koluguri <nithinraok> Co-authored-by: Nithin Rao Koluguri <nithinraok>
1 parent ebc6a88 commit 8ab46ff

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

examples/asr/transcribe_speech.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ def main(cfg: TranscriptionConfig) -> Union[TranscriptionConfig, List[Hypothesis
275275

276276
# we will adjust this flag if the model does not support it
277277
compute_langs = cfg.compute_langs
278+
if cfg.timestamps:
279+
cfg.return_hypotheses = True
278280

279281
# Check whether model and decoder type match
280282
if isinstance(asr_model, EncDecCTCModel):

nemo/collections/asr/models/ctc_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def transcribe(
160160
A list of transcriptions (or raw log probabilities if logprobs is True) in the same order as
161161
paths2audio_files
162162
"""
163+
timestamps = timestamps or override_config.timestamps if override_config is not None else None
163164
if timestamps is not None:
164165
# else retain the decoder state (users can set it using change_decoding_strategy)
165166
if timestamps or (override_config is not None and override_config.timestamps):

nemo/collections/asr/models/rnnt_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def transcribe(
285285
* A list of greedy transcript texts / Hypothesis
286286
* An optional list of beam search transcript texts / Hypothesis / NBestHypothesis.
287287
"""
288-
288+
timestamps = timestamps or override_config.timestamps if override_config is not None else None
289289
if timestamps is not None:
290290
if timestamps or (override_config is not None and override_config.timestamps):
291291
logging.info(

0 commit comments

Comments
 (0)