#3727 RuntimeError: Gemini result is emtpy

123.110* Posted at: 2 hours ago 👁9

Gemini result is emtpy:Traceback (most recent call last):
File "videotrans\translator\_base.py", line 102, in run
File "videotrans\translator\_base.py", line 123, in _run_text
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 421, in exc_check
tenacity.RetryError: RetryError[]

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 990, in run
File "videotrans\translator\_base.py", line 104, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 120, in _item_task
RuntimeError: Gemini result is emtpy


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

1 Replies

这是由于 Gemini 翻译渠道返回了空结果导致的错误。

解决方案:

  1. 检查 Gemini API 密钥和模型:在 菜单 -> 翻译设置 -> Gemini 中,确认 API Key 填写正确且有效,并确保填写的模型名称(如 gemini-1.5-pro)是当前可用的。
  2. 调整翻译参数

    • 菜单 -> 工具 -> 高级选项 -> 字幕翻译调整 中,尝试将 AI翻译渠道每批字幕行数 调小(例如从 100 改为 20),以降低单次请求的负载。
    • 翻译后暂停秒 适当增加(例如设为 3-5 秒),以降低请求频率。
  3. 检查网络代理:如果 Gemini 服务在您所在地区受限,请确保在主界面的 网络代理地址 中填写了有效的代理地址(格式如 http://127.0.0.1:10808)。
  4. 尝试其他翻译渠道:作为临时替代,可以切换到其他 AI 翻译渠道,如 DeepSeek 或 OpenAI。

请查阅相关文档:

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