You need to sign in or sign up before continuing.
提交 19d015b6 编写于 作者: K KP

Add RFT for asr task.

上级 da08f1c1
......@@ -467,19 +467,18 @@ class ASRExecutor(BaseExecutor):
paddle.set_device(device)
self._init_from_path(model, lang, sample_rate, config, decode_method,
ckpt_path)
self.preprocess(model, audio_file)
if rtf:
k = self.__class__.__name__
CLI_TIMER[k]['start'].append(time.time())
self.infer(model)
self.preprocess(model, audio_file)
self.infer(model)
res = self.postprocess() # Retrieve result of asr.
if rtf:
CLI_TIMER[k]['end'].append(time.time())
audio, audio_sample_rate = soundfile.read(
audio_file, dtype="int16", always_2d=True)
CLI_TIMER[k]['extra'].append(audio.shape[0] / audio_sample_rate)
else:
self.infer(model)
res = self.postprocess() # Retrieve result of asr.
return res
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册