#1821 服务返回错误:301 Moved Permanently301 Moved Permanentlynginx/1.24.0:Traceback (most recent call last): File "videotrans\util\

112.111* Posted at: 1 day ago 👁14

服务返回错误:
301 Moved Permanently

301 Moved Permanently
nginx/1.24.0

:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 907, in run
File "videotrans\translator\_base.py", line 83, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_localllm.py", line 54, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1156, in create
File "openai\_base_client.py", line 1259, in post
File "openai\_base_client.py", line 1047, in request
openai.APIStatusError:
301 Moved Permanently

301 Moved Permanently
nginx/1.24.0


=
system:Windows-10-10.0.26200-SP0
version:v3.83
frozen:True
language:zh
root_dir:D:/Download/win-videotrans-v3.83

1 Replies

错误显示 301 Moved Permanently,这表明您配置的本地 LLM 或 OpenAI 兼容 API 的 基础 URL 地址不正确,服务器返回了重定向响应。

请按以下步骤检查和修正:

  1. 检查基础 URL

    • 在软件主界面,点击菜单栏的 “翻译设置”
    • 找到您正在使用的翻译渠道(例如 OpenAI、LocalLLM 等)。
    • 仔细检查 “API接口地址”“Base URL” 字段。
    • 常见错误:地址末尾多写了 /v1 或缺少了 /v1。例如,对于 Ollama,正确地址应为 http://127.0.0.1:11434/v1;对于 OpenAI,则可能是 https://api.openai.com/v1
  2. 验证地址有效性

    • 将您填写的地址复制到浏览器地址栏中访问。
    • 如果返回类似上述的 301 错误或 404 Not Found,说明地址格式错误或服务未运行。
    • 请根据您实际部署的 LLM 服务文档,确认正确的 API 端点地址。
  3. 如果使用代理

    • 如果您通过代理访问外部 API(如 OpenAI),请确保在软件主界面第 5 行的 “网络代理地址” 中填写了正确的代理地址(例如 http://127.0.0.1:7890)。

修正地址后,请重试。如果问题依旧,请提供您配置的具体翻译渠道和填写的 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

Trending Questions