#3933 翻譯SRT的時候。如果使用最新的GEMMA 4模型,因為預設會發送thinking budget參數,結果造成錯誤

219.68* Posted at: 1 day ago 👁21

翻譯SRT的時候。如果使用最新的GOOGLE的GEMMA 4模型,因為預設會發送thinking budget參數,結果造成錯誤,可能需要有一個選項可以不發送或是排除這個參數發送。

Thinking budget is not supported for this model.:Traceback (most recent call last):
File "videotrans\translator\_gemini.py", line 112, in _item_task
File "google\genai\models.py", line 5407, in generate_content_stream
File "google\genai\models.py", line 4101, in _generate_content_stream
File "google\genai\_api_client.py", line 1405, in request_streamed
File "google\genai\_api_client.py", line 1224, in _request
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 420, in exc_check
File "tenacity\__init__.py", line 187, in reraise
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 "google\genai\_api_client.py", line 1189, in _request_once
File "google\genai\errors.py", line 121, in raise_for_response
File "google\genai\errors.py", line 146, in raise_error
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Thinking budget is not supported for this model.', 'status': 'INVALID_ARGUMENT'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 981, in run
File "videotrans\translator\_base.py", line 102, in run
File "videotrans\translator\_base.py", line 165, 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 132, in _item_task
videotrans.configure._except.StopRetry: Thinking budget is not supported for this model.


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:zh
root_dir:C:/Software/win-pyvideotrans-v3.97

2 Replies

这是由于 Gemini 翻译渠道在调用最新的 Gemma 4 模型时,默认发送了模型不支持的 thinking budget 参数导致的。

解决方案:

  1. 在软件主界面,点击顶部菜单栏的 菜单 -> 翻译设置
  2. 在弹出的设置窗口中,找到并点击 Gemini 选项卡。
  3. Gemini 设置面板中,找到 模型 输入框。
  4. 将模型名称从 gemini-2.0-flash-expgemini-2.0-flash-thinking-exp 等实验性模型,更改为官方稳定模型,例如 gemini-1.5-flashgemini-1.5-pro
  5. 保存设置并重试翻译。

注意: 此问题源于 Google AI 的 API 更新,某些实验性模型不支持 thinking budget 参数。使用官方推荐的稳定模型可以避免此错误。

请查阅相关文档:

使用openai chatgpt渠道,以兼容方式填写相关信息使用

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.

Related resource