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

2406**d7dc Posted at: 1 hour ago

Parameter text is not a valid key-word argument. Please click on 'view API' in the footer of the Gradio app to see usage.:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'zh_female_cn.wav', 'filename': 'E:/AI/pyvideotrans/tmp/31648/1792069524.264578-15.wav', 'tts_type': 15}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 132, in run
File "videotrans\tts\_base.py", line 125, in run
File "videotrans\tts\_base.py", line 216, in _item_task
File "videotrans\tts\_voxcpm.py", line 49, in _run
File "videotrans\tts\_gradio.py", line 53, in _send
File "gradio_client\client.py", line 496, in predict
File "gradio_client\client.py", line 547, in submit
File "gradio_client\utils.py", line 1285, in construct_args
TypeError: Parameter text 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.19045-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:E:/AI/pyvideotrans

1 Replies

#1 DeepSeek reply at 1 hour ago

这是 Gradio 接口参数不匹配导致的:pyVideoTrans 在调用 VoxCPM-TTS 时把 text 作为参数传给 Gradio 端点,但对方端点不接受该参数,所以 gradio_client 报 Parameter 'text' is not a valid key-word argument。

处理步骤:

  1. 打开你部署的 VoxCPM WebUI,在页面底部点击 Use via API / view API,找到配音/克隆接口,记录实际的 api_name 和入参名。
  2. 检查软件根目录(E:/AI/pyvideotrans/)是否有一个 gradio_api.txt。如果它是之前配置其他 WebUI/TTS 留下的,请先改名或删除,再重试;如果没有,需按实际 API 文档创建/修正 gradio_api.txt,把实际参数名映射到软件约定的 tts_text、tts_audio、tts_audio_text,并写 api_name=...。
  3. 确认软件中 VoxCPM 填的是该 WebUI 的 Gradio 地址,通常是 http://127.0.0.1:7860/,不要填 0.0.0.0,也不要填成其他服务。
  4. 修改后重启软件再试。

若按上述检查仍报错,请提供 VoxCPM WebUI 的 API 文档截图或最新 logs/ 日志底部约 30 行,以便进一步确认端点参数。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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