bugfix: audio_len should be 1D, no 0D, which will raise list index out (#3490)

of range error in the following decode process

Co-authored-by: Luzhenhui <luzhenhui@mqsz.com>
pull/3798/head
JeffLu 2 years ago committed by luotao1
parent cb6fb7fe11
commit 30b2d98386

@ -274,7 +274,7 @@ class ASRExecutor(BaseExecutor):
# fbank
audio = preprocessing(audio, **preprocess_args)
audio_len = paddle.to_tensor(audio.shape[0]).unsqueeze(axis=0)
audio_len = paddle.to_tensor([audio.shape[0]]).unsqueeze(axis=0)
audio = paddle.to_tensor(audio, dtype='float32').unsqueeze(axis=0)
self._inputs["audio"] = audio

Loading…
Cancel
Save