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

27.17**0 Posted at: 2 hours ago

Parameter temperature 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_tw.wav', 'filename': 'G:/win-pyvideotrans-v4.11/tmp/2676/1788521864.3003464-ttsapi.wav', 'tts_type': 35}
Traceback (most recent call last):
File "videotrans\tts\_ttsapi.py", line 147, 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 temperature is not a valid key-word argument. Please click on 'view API' in the footer of the Gradio app to see usage.

The above exception was the direct cause of the following exception:

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 103, in run
File "videotrans\tts\_base.py", line 206, in _exec
File "videotrans\tts\_base.py", line 166, in _local_mul_thread
File "videotrans\tts\_base.py", line 218, in _item_task
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_ttsapi.py", line 55, in _run
File "videotrans\tts\_ttsapi.py", line 157, in _send
videotrans.configure.excepts.StopTask: Parameter temperature 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.11
frozen:True
language:zh
root_dir:G:/win-pyvideotrans-v4.11

3 Replies

#1 DeepSeek reply at 2 hours ago

这是自定义 Gradio TTS 接口参数不匹配导致的。报错明确指出你调用的 Gradio WebUI 端点不接受 temperature 参数,但软件在请求时传入了它。

解决方法

  1. 打开软件根目录下的 gradio_api.txt 文件。
  2. 查找是否存在 temperature=... 这一行,如果有,直接删除该行并保存。
  3. 如果没有找到,请检查该文件中是否还有其他你手动添加的、WebUI API 文档中不存在的参数,全部删除。
  4. 保存后重新执行配音。

重点核对

打开该 Gradio WebUI 页面底部 Use via API 文档,只保留文档中列出的参数名,并按 参数名=参数值 格式填写。其中目标文本、参考音频、参考音频文本分别使用固定占位符:

  • tts_text(配音文本)
  • tts_audio(参考音频路径)
  • tts_audio_text(参考音频对应文字,若模型不需要则不写)

请查阅相关文档:

#2 27.17**0 reply at 2 hours ago

根本不会去读取gradio_api

#3 DeepSeek reply at 2 hours ago

报错本质是:软件向你的 Gradio WebUI 发送请求时,多传了一个它不认识的 temperature 参数,而对方接口不接受。虽然你感觉“没读取 gradio_api.txt”,但该参数几乎一定是从某个配置中带出来的。

排查步骤:

  1. 检查 gradio_api.txt 位置和内容

    • 文件必须位于软件根目录(即 sp.exe 所在文件夹),文件名完全一致为 gradio_api.txt,注意无空格、无后缀。
    • 打开文件,搜索是否有 temperature 所在行,如有,删除整行并保存。
  2. 如果文件里没有 temperature,检查“自定义TTS API”设置面板

    • 打开菜单 设置 → TTS设置 → 自定义TTS API,看看是否有“温度/temperature”之类的输入框,将其留空或删除。
  3. 重新启动软件后重试

    • 修改配置文件或设置后,需完全关闭并重新打开 sp.exe 才会生效。
  4. 终极方法:清空配置重建

    • 进入 videotrans 文件夹,删除 params.jsoncfg.json(如需备份可先复制),重启软件,重新配置自定义 TTS API。

如果以上操作后仍报错,请提供你的 gradio_api.txt 完整内容和自定义 TTS 设置界面的截图,以便进一步定位。

请查阅相关文档:

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