执行代码如下:
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
p = pipeline('auto-speech-recognition', 'damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch')
rec_result = p(audio_in='zh_test.wav')
print(rec_result)
报错信息:
/opt/conda/lib/python3.7/site-packages/torchaudio/compliance/kaldi.py in _get_window(waveform, padded_window_size, window_size, window_shift, window_type, blackman_coeff, snip_edges, raw_energy, energy_floor, dither, remove_dc_offset, preemphasis_coefficient)
175
176 # size (m, window_size)
--> 177 strided_input = _get_strided(waveform, window_size, window_shift, snip_edges)
178
179 if dither != 0.0:
/opt/conda/lib/python3.7/site-packages/torchaudio/compliance/kaldi.py in _get_strided(waveform, window_size, window_shift, snip_edges)
57 Tensor: 2D tensor of size (m, ``window_size``) where each row is a frame
58 """
---> 59 assert waveform.dim() == 1
60 num_samples = waveform.size(0)
61 strides = (window_shift * waveform.stride(0), waveform.stride(0))
AssertionError: