Skip to content

Commit

Permalink
add fastconformer model for decoder timestamp
Browse files Browse the repository at this point in the history
Signed-off-by: biscayan <[email protected]>
  • Loading branch information
biscayan committed Feb 15, 2024
1 parent 1996bce commit ef41f84
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion nemo/collections/asr/parts/utils/decoder_timestamps_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def set_asr_model(self):
To assign a proper decoding function for generating timestamp output,
the name of .nemo file should include the architecture name such as:
'quartznet', 'conformer', and 'citrinet'.
'quartznet', 'conformer', 'fastconformer' and 'citrinet'.
decoder_delay_in_sec is the amount of delay that is compensated during the word timestamp extraction.
word_ts_anchor_offset is the reference point for a word and used for matching the word with diarization labels.
Expand All @@ -347,6 +347,17 @@ def set_asr_model(self):
self.word_ts_anchor_offset = if_none_get_default(self.params['word_ts_anchor_offset'], 0.12)
self.asr_batch_size = if_none_get_default(self.params['asr_batch_size'], 4)
self.model_stride_in_secs = 0.02

elif 'fastconformer' in self.ASR_model_name.lower():
self.run_ASR = self.run_ASR_BPE_CTC
self.encdec_class = EncDecCTCModelBPE
self.decoder_delay_in_sec = if_none_get_default(self.params['decoder_delay_in_sec'], 0.08)
self.word_ts_anchor_offset = if_none_get_default(self.params['word_ts_anchor_offset'], 0.12)
self.asr_batch_size = if_none_get_default(self.params['asr_batch_size'], 16)
self.model_stride_in_secs = 0.08
# fastConformer requires buffered inference and the parameters for buffered processing.
self.chunk_len_in_sec = 5
self.total_buffer_in_secs = 25

elif 'conformer' in self.ASR_model_name.lower():
self.run_ASR = self.run_ASR_BPE_CTC
Expand Down

0 comments on commit ef41f84

Please sign in to comment.