#1456 翻译字幕阶段出错:[Gemini AI] 网络连接失败。注意:某些国外服务需要科学上网才能访问:

219.71* Posted at: 3 hours ago 👁14

翻译字幕阶段出错:[Gemini AI] 网络连接失败。注意:某些国外服务需要科学上网才能访问:
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': 'Unable to submit request because thinking is not supported by this model. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini', '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 936, 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: Unable to submit request because thinking is not supported by this model. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini

1 Replies

这个错误是因为您选择的 Gemini 模型不支持 "thinking" 功能。请按以下步骤解决:

  1. 检查 Gemini 模型设置:在顶部菜单栏选择 翻译设置 -> Gemini AI,确保您选择的模型不是 gemini-1.5-flash-thinkinggemini-1.5-pro-thinking 这类带有 "thinking" 后缀的模型。
  2. 更换模型:建议更换为以下标准模型之一:

    • gemini-1.5-flash
    • gemini-1.5-pro
    • gemini-1.0-pro
  3. 检查网络代理:由于 Gemini 是国外服务,请确保在主界面的 网络代理 输入框中填写了正确的代理地址(例如 http://127.0.0.1:10808)。
  4. 验证 API Key:确认在 翻译设置 -> Gemini AI 中填写的 API Key 有效且未过期。

完成以上修改后,重新尝试翻译任务即可。

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