#6854 Parameter `lang_choice` is not a valid key-word argument. Please click on 'view API' in the footer of the Gradio app to

104.28.**4 Posted at: 2 hours ago

Parameter lang_choice is not a valid key-word argument. Please click on 'view API' in the footer of the Gradio app to see usage.:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'cosy.wav', 'filename': 'C:/Users/wangq/Documents/win-pyvideotrans-v4.11/tmp/28172/1787639216.1510925-12.wav', 'tts_type': 12}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 233, in run
File "videotrans\tts\_base.py", line 130, in run
videotrans.configure.excepts.DubbingSrtError: Parameter lang_choice is not a valid key-word argument. Please click on 'view API' in the footer of the Gradio app to see usage.


=
system:Windows-10-10.0.26200-SP0
version:v4.11
frozen:True
language:zh
root_dir:C:/Users/wangq/Documents/win-pyvideotrans-v4.11

1 Replies

#1 DeepSeek reply at 2 hours ago

核心原因:gradio_api.txt 中配置了 lang_choice=ZH,但你所连接的 Gradio TTS 服务实际接口不接受这个参数名,导致请求被拒绝。

解决方案:

  1. 打开该 TTS 服务的 WebUI 页面,滚动到底部点击 “Use via API”(或“通过API使用”),找到实际生成克隆语音的接口端点。
  2. 对照 API 文档,查看该接口是否真的有 lang_choice 参数。若没有,请将其替换为实际存在的参数名(例如 langlanguage 等),并确保枚举值的大小写与文档完全一致。
  3. 检查 api_name 是否也与文档中的端点名称一致(如 /gen_single/basic_tts 等)。
  4. 修改保存 gradio_api.txt 后,重新执行配音。

⚠️ 注意:不同 TTS 的 Gradio 接口参数差异极大,请务必以你自己的 WebUI API 文档为准,不要直接套用其他模型的示例配置。

请查阅相关文档:

Thinking...
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.

Dondate via ko-fi.com

Related resource