FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

使用Whisper-large-v3和cam++的组合报错

Open MJ666-K opened this issue 1 year ago • 1 comments

from funasr import AutoModel import time

wav_file = "/mnt/data/toolbox_dir/voice_trans/test-file/vad_example.wav"

model = AutoModel( model="/mnt/data/toolbox_dir/voice_trans/Whisper-large-v3", vad_model="/mnt/data/toolbox_dir/voice_trans/speech_fsmn_vad_zh-cn-16k-common-pytorch", vad_kwargs={"max_single_segment_time": 30000}, punc_model="/mnt/data/toolbox_dir/voice_trans/punc_ct-transformer_cn-en-common-vocab471067-large", spk_model="/mnt/data/toolbox_dir/voice_trans/speech_campplus_sv_zh-cn_16k-common", device='cuda:2' )

start_time = time.time()

res = model.generate( input=wav_file, batch_size_s=300, batch_size=1 )


Why is it reported wrong? Please help me check it.


File "/root/anaconda3/lib/python3.12/runpy.py", line 198, in _run_module_as_main return _run_code(code, main_globals, None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.12/runpy.py", line 88, in _run_code exec(code, run_globals) File "/root/.vscode-server/extensions/ms-python.debugpy-2024.12.0/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 71, in cli.main() File "/root/.vscode-server/extensions/ms-python.debugpy-2024.12.0/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 501, in main run() File "/root/.vscode-server/extensions/ms-python.debugpy-2024.12.0/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 351, in run_file runpy.run_path(target, run_name="main") File "/root/.vscode-server/extensions/ms-python.debugpy-2024.12.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 310, in run_path return _run_module_code(code, init_globals, run_name, pkg_name=pkg_name, script_name=fname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.vscode-server/extensions/ms-python.debugpy-2024.12.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 127, in _run_module_code _run_code(code, mod_globals, init_globals, mod_name, mod_spec, pkg_name, script_name) File "/root/.vscode-server/extensions/ms-python.debugpy-2024.12.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 118, in _run_code exec(code, run_globals) File "/mnt/data/toolbox_dir/voice_trans/test.py", line 25, in res = model.generate( ^^^^^^^^^^^^^^^ File "/mnt/data/toolbox_dir/voice_trans/venv/lib/python3.12/site-packages/funasr/auto/auto_model.py", line 304, in generate return self.inference_with_vad(input, input_len=input_len, **cfg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/data/toolbox_dir/voice_trans/venv/lib/python3.12/site-packages/funasr/auto/auto_model.py", line 554, in inference_with_vad sv_output = postprocess(all_segments, None, labels, spk_embedding.cpu()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/data/toolbox_dir/voice_trans/venv/lib/python3.12/site-packages/funasr/models/campplus/utils.py", line 117, in postprocess assert len(segments) == len(labels) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError 0%| | 0/1 [00:46<?, ?it/s]

MJ666-K avatar Dec 03 '24 07:12 MJ666-K

batch_size_s=300, 这里好像只支持batch_size_s。不然的话,确实报错。

jinec avatar Mar 10 '25 02:03 jinec