#1286 TypeError: VadOptions.__init__() got an unexpected keyword argument 'threshold'

112.46* Posted at: 7 hours ago 👁13

Traceback (most recent call last):
File "D:\xigaotest\pytransNew\pyvideotrans\videotrans\process\_overall.py", line 57, in run

segments, info = model.transcribe(

File "D:\xigaotest\pytransNew\pyvideotrans\venv\lib\site-packages\faster_whisper\transcribe.py", line 834, in transcribe

vad_parameters = VadOptions(**vad_parameters)

TypeError: VadOptions.__init__() got an unexpected keyword argument 'threshold'


=
system:Windows-10-10.0.26100-SP0
version:v3.83
frozen:False
language:zh
root_dir:D:/xigaotest/pytransNew/pyvideotrans
Python: 3.10.4 (main, May 28 2022, 20:04:37) [MSC v.1929 64 bit (AMD64)]

1 Replies

这个错误是由于 faster-whisper 库版本不兼容导致的。VadOptions.__init__() 方法不再接受 threshold 参数。

请按以下步骤解决:

  1. 升级 faster-whisper:

    • 打开命令提示符或 PowerShell
    • 运行命令:pip install --upgrade faster-whisper
  2. 如果使用预打包版:

    • 由于预打包版环境固定,建议从 GitHub 下载最新源码版本重新部署
    • 或者等待开发者发布修复此问题的更新版本
  3. 临时解决方案:

    • 在语音识别设置中暂时切换到其他识别渠道,如 openai-whisper(本地)

升级完成后,faster-whisper 应该能正确处理 VAD 参数,此错误将不再出现。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions