modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
6.46k stars 688 forks source link

paraformer-en与vad联合使用时报错result中没有'timestamp'字段 #1747

Closed Wu-Jiayang closed 4 months ago

Wu-Jiayang commented 4 months ago

Notice: In order to resolve issues more efficiently, please raise issue following the template. (注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

🐛 Bug

paraformer-en与vad联合使用时报错result中没有'timestamp'字段

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. Run cmd '....'
  2. See error

image

KeyError (note: full exception trace is shown but execution is paused at: _run_module_as_main) 'timestamp' File "/opt/conda/lib/python3.10/site-packages/funasr/auto/auto_model.py", line 458, in inference_with_vad result['timestamp'], File "/opt/conda/lib/python3.10/site-packages/funasr/auto/auto_model.py", line 232, in generate return self.inference_with_vad(input, input_len=input_len, **cfg) File "/workspace/insurance-text-data/test.py", line 11, in res = model.generate(input='asr_example_en.wav') # 文档说只支持wav File "/opt/conda/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/opt/conda/lib/python3.10/runpy.py", line 196, in _run_module_as_main (Current frame) return _run_code(code, main_globals, None, KeyError: 'timestamp'

Code sample

from funasr import AutoModel

model = AutoModel(
    model="paraformer-en", 
    vad_model="fsmn-vad",
    punc_model="ct-punc", 
    spk_model="cam++"
)

res = model.generate(input='asr_example_en.wav')  # 文档说只支持wav
print(res)

Expected behavior

Environment

Additional context

R1ckShi commented 4 months ago

paraformer-en模型不支持返回时间戳