#1889 videotrans.configure._except.StopRetry: models/gemini-2.5-flash-preview-05-20 is not found for API version v1beta, or i

1.198* Posted at: 16 hours ago 👁10

网络连接失败: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: 404 NOT_FOUND. {'error': {'code': 404, 'message': 'models/gemini-2.5-flash-preview-05-20 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.', 'status': 'NOT_FOUND'}}

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 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: models/gemini-2.5-flash-preview-05-20 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.


=
system:Windows-10-10.0.26100-SP0
version:v3.83
frozen:True
language:zh
root_dir:D:/pyvideotrans

1 Replies

错误信息显示 Gemini 模型 gemini-2.5-flash-preview-05-20 在 API 版本 v1beta 中不存在或不被支持。这通常是因为软件内置的模型名称已过时,而 Google 更新了其 API 或模型列表。

解决方案:

  1. 更新模型名称:

    • 在软件主界面,点击 翻译设置 按钮。
    • 在打开的窗口中,找到 Gemini 的配置部分。
    • 模型名称 字段中的 gemini-2.5-flash-preview-05-20 修改为当前可用的模型,例如:

      • gemini-1.5-flash
      • gemini-1.5-pro
      • gemini-2.0-flash-exp
    • 保存设置。
  2. 检查 API 密钥和代理:

    • 确保 Gemini API Key 已正确填写且有效。
    • 如果在中国大陆使用,确保已正确配置网络代理(格式如 http://127.0.0.1:7860)。
  3. 查看官方模型列表(可选):

    • 如果你不确定当前可用的模型,可以访问 Google AI Studio 或 Gemini API 文档查看最新的模型列表。

修改模型名称后,重新尝试翻译即可。

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

Similar issues already exist

Trending Questions