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
PaddlePaddle#3490)

of range error in the following decode process

Co-authored-by: Luzhenhui <[email protected]>
  • Loading branch information
2 people authored and luotao1 committed Jun 11, 2024
1 parent cb6fb7f commit 30b2d98
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 30b2d98

Please sign in to comment.