#7605 请求API地址不存在或模型名称错误: Error code: 404 - {'error': {'message':

64.118**7 Posted at: 1 hour ago

请求API地址不存在或模型名称错误: Error code: 404 - {'error': {'message': "model 'qwen:7b' not found", 'type': 'not_found_error', 'param': None, 'code': None}}: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 79, in run
File "videotrans\translator\_base.py", line 97, 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 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\_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.NotFoundError: Error code: 404 - {'error': {'message': "model 'qwen:7b' not found", 'type': 'not_found_error', 'param': None, 'code': None}}


=
Windows-10-10.0.19045-SP0
version:v3.80
frozen:True
language:zh

3 Replies

#1 DeepSeek reply at 1 hour ago

这是由于你填写的本地大模型(兼容AI/本地模型)中,模型名称 qwen:7b 在目标 API 服务端不存在,导致返回 404 错误。

该错误与 pyVideoTrans 本身无关,而是你本地的 LLM 服务(如 Ollama / LM Studio / Xinference 等)里并没有加载名为 qwen:7b 的模型。

排查与解决步骤

  1. 确认本地 LLM 服务是否已启动

    • 例如使用 Ollama,需先执行 ollama serve,确保服务在运行。

  2. 查看你本地实际可用的模型名称

    • Ollama:终端执行 ollama list,复制列出的模型完整名称(例如 qwen2.5:7b、qwen2:7b 等,注意带版本号)。

    • LM Studio / Xinference 等:在对应界面查看已加载模型的确切 ID。

  3. 核对 API 地址

    • 进入 菜单 → 翻译设置 → 兼容AI/本地模型(或对应渠道),确认填写的 API 地址正确,例如 Ollama 默认是 http://127.0.0.1:11434/v1,不要带多余路径或写成 0.0.0.0(须改为 127.0.0.1)。

  4. 修正模型名称

    • 将软件里填写的 qwen:7b 改为第 2 步中查到的真实存在的模型名称(区分大小写,需完全一致)。

    • 若本地确实没有该模型,请先拉取:Ollama 执行 ollama pull qwen2.5:7b(或其他可用模型)。

  5. 保存后重新测试

    • 使用软件菜单里的翻译测试功能或重新执行翻译任务验证。

补充说明

  • 本地小参数模型(7B 级)指令跟随能力较弱,翻译时容易出现提示词泄漏或 <TRANSLATE_TEXT> 标签残留,如遇此情况可参考下方文档精简提示词。

  • 若第三方服务兼容 OpenAI 格式,建议优先填写到 OpenAI渠道 / OpenAI兼容渠道 中,而非自定义翻译 API。

请查阅相关文档:

#2 64.118**7 reply at 41 minutes ago

是的,我的模型名称搞错了,现在已经解决

#3 DeepSeek reply at 41 minutes ago

问题已解决。

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource