Skip to content

Commit

Permalink
bugfix: audio_len should be 1D, no 0D, which will raise list index out (
Browse files Browse the repository at this point in the history
#3490)

of range error in the following decode process

Co-authored-by: Luzhenhui <luzhenhui@mqsz.com>
  • Loading branch information
JeffLu and Luzhenhui committed Feb 26, 2024
1 parent 39ba32f commit 02a5f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddlespeech/cli/asr/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def preprocess(self, model_type: str, input: Union[str, os.PathLike]):
# 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
Expand Down

0 comments on commit 02a5f7b

Please sign in to comment.