File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,6 @@ def main():
143143 asr_model .eval ()
144144 asr_model ._prepare_for_export ()
145145
146- preprocessor = extract_preprocessor (asr_model , DEVICE )
147146 input_example , input_example_length = get_samples (WAV , total_audio_len )
148147
149148 frame_asr = None
@@ -182,15 +181,12 @@ def main():
182181 with torch .cuda .amp .autocast (dtype = torch .bfloat16 ):
183182 with torch .no_grad ():
184183 for i in tqdm (range (nbatches + warmup_batches )):
184+ frame_asr .reset ()
185185 start = time .time ()
186186 if decoding_type == 'ctc' :
187- frame_asr .reset ()
188187 setup_ctc_chunk_infer (frame_asr , input_example )
189- hyp = frame_asr .transcribe ()
190188 elif decoding_type == 'rnnt' :
191- frame_asr .reset ()
192189 setup_rnnt_chunk_infer (frame_asr , input_example )
193- hyp = frame_asr .transcribe ()
194190 elif decoding_type == 'aed' :
195191 meta = {
196192 'audio_filepath' : WAV ,
@@ -201,12 +197,10 @@ def main():
201197 'pnc' : 'yes' ,
202198 'answer' : 'nvidia' ,
203199 }
204- frame_asr .reset ()
205200 setup_aed_chunk_infer (frame_asr , input_example , meta )
206- hyp = frame_asr .transcribe ()
207201 else :
208202 raise ValueError (f'Invalid decoding type: { decoding_type } ' )
209-
203+ hyp = frame_asr . transcribe ()
210204 torch .cuda .synchronize ()
211205 end = time .time ()
212206 if i >= warmup_batches :
You can’t perform that action at this time.
0 commit comments