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/3711/head
JeffLu 8 months ago committed by GitHub
parent 39ba32fafb
commit 02a5f7bce8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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