#1120 videotrans.configure._except.StopRetry: The thinking budget 1 is invalid. Please choose a value between 128 and 32768.

194.156* Posted at: 22 hours ago 👁23

翻译字幕阶段出错:[Gemini AI] The thinking budget 1 is invalid. Please choose a value between 128 and 32768. :
Traceback (most recent call last):
File "videotrans\translator\_gemini.py", line 103, in _item_task
File "google\genai\models.py", line 5783, in generate_content_stream
File "google\genai\models.py", line 4666, in _generate_content_stream
File "google\genai\_api_client.py", line 774, in request_streamed
File "google\genai\_api_client.py", line 672, in _request
File "google\genai\errors.py", line 101, in raise_for_response
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'The thinking budget 1 is invalid. Please choose a value between 128 and 32768.', 'status': 'INVALID_ARGUMENT'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 146, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 920, in run
File "videotrans\translator\_base.py", line 80, in run
File "videotrans\translator\_base.py", line 143, in _run_srt
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 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 123, in _item_task
videotrans.configure._except.StopRetry: The thinking budget 1 is invalid. Please choose a value between 128 and 32768.


=
system:Windows-10-10.0.22631-SP0
version:v3.82
frozen:True
language:zh
root_dir:F:/win-videotrans-v3.82/win-videotrans-v3.82_20251019_125144

3 Replies

这个错误是因为 Gemini AI 翻译渠道的 "思考预算" 参数设置不正确。错误信息显示您设置的值为 1,但有效范围应在 128 到 32768 之间。

请按以下步骤修正:

  1. 在软件主界面,点击菜单栏的 翻译设置
  2. 在翻译设置窗口中,找到 Gemini AI 相关的配置项
  3. 将 "思考预算" 参数修改为 128 到 32768 之间的一个值(建议从 512 或 1024 开始尝试)
  4. 保存设置后重新运行翻译任务

如果设置界面中没有找到该选项,请检查您的 API 密钥配置是否正确,或者尝试重新配置 Gemini AI 翻译渠道。

求助,这个问题有谁知道怎么解决吗?Gemini AI的翻译设置里没有“思考预算”的选项。重新配置API也不好使。

这个问题是因为软件内部传递给 Gemini API 的参数超出了有效范围。虽然界面上没有"思考预算"的配置项,但可以通过以下方法解决:

  1. 临时解决方案:切换到其他翻译渠道,如 Google、Microsoft 或 OpenAI 等,完成当前任务。
  2. 根本解决方案

    • 在软件根目录找到并打开 videotrans/cfg.json 文件
    • 查找与 Gemini 相关的配置项,特别是 thinking_budget 或类似参数
    • 将其值修改为 128 到 32768 之间的数值(建议 512 或 1024)
    • 保存文件后重启软件

如果 cfg.json 中没有相关配置,这可能是软件版本的一个 bug。建议:

  • 检查是否有软件更新版本
  • 在 GitHub 项目页面提交 issue 报告此问题
  • 暂时使用其他翻译渠道替代

同时,您也可以在"高级选项"中尝试将"同时翻译的字幕数"设为 1,看看是否能绕过此问题。

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