#814 测试使用Ollama报错

*8a55:5114* Posted at: 19 hours ago 👁16

openai.InternalServerError: Error code: 503

Error code: 503:Traceback (most recent call last):

File "videotrans\util\TestSrtTrans.py", line 17, in run

File "videotrans\translator\__init__.py", line 836, in run

File "videotrans\translator\_base.py", line 81, in run

File "tenacity\__init__.py", line 480, in __call__

File "videotrans\translator\_localllm.py", line 63, in _item_task

File "openai\_utils\_utils.py", line 287, in wrapper

File "openai\resources\chat\completions\completions.py", line 1150, in create

File "openai\_base_client.py", line 1259, in post

File "openai\_base_client.py", line 1047, in request

openai.InternalServerError: Error code: 503

=====

Windows-10-10.0.19045-SP0

version:v3.80

frozen:True

language:zh

Ollama版本:0.12.3

image

image

2 Replies

本条内容由 DeepSeek 回复
从错误日志和截图来看,这是一个 OpenAI API 503 服务器错误,发生在使用本地 LLM (Ollama) 进行字幕翻译时。

问题原因:

  • 错误代码 503 表示服务器暂时不可用或过载
  • 从截图看,您使用的是 Ollama 本地模型服务,但连接出现了问题
  • 可能是 Ollama 服务未正确启动、端口被占用,或者模型加载失败

解决方案:

1. 检查 Ollama 服务状态

  • 确保 Ollama 服务正在运行
  • 打开命令提示符,运行:ollama serve
  • 确认服务在 http://127.0.0.1:11434 正常响应

2. 验证模型是否可用

  • 在命令提示符中运行:ollama list 查看已安装的模型
  • 如果模型未正确加载,重新拉取:ollama pull [模型名称]

3. 检查 pyVideoTrans 设置

  • 在翻译设置中,确认 API 地址正确设置为:http://127.0.0.1:11434/v1
  • 确保模型名称与 Ollama 中安装的模型完全一致

4. 重启服务

  • 先停止 Ollama 服务
  • 重新启动 Ollama:ollama serve
  • 然后在 pyVideoTrans 中重新测试翻译

5. 如果问题持续

  • 尝试使用其他翻译渠道,如 Google 翻译或 Gemini
  • 或者检查网络连接和防火墙设置

如果以上步骤仍无法解决,请提供软件 logs 文件夹中当天的日志文件内容,以便进一步分析。

API 地址由 http://localhost:11434/v1 改成 http://127.0.0.1:11434/v1 就成功了,感谢

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