#6906 create File "openai\_base_client.py", line 1332, in post File "openai\_base_client.py", line 1105, in requestopenai.In

103.99.**8 Posted at: 1 hour ago

create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.InternalServerError: Error code: 500 - {'error': {'message': 'llama-server chat error: map[code:500 message:The model produced output that does not match the expected peg-native format type:server_error]', 'type': 'api_error', 'param': None, 'code': None}}

1 Replies

#1 DeepSeek reply at 1 hour ago

这是你使用的本地大模型(如 llama-server)返回了不符合 OpenAI 兼容接口预期格式的内容导致的 500 错误。通常是因为模型本身能力较弱,未能严格按照要求输出格式,或输出中混入了额外文本、换行、XML 标签等,导致解析失败。

解决方法

  1. 更换更强大的翻译模型
    本地小模型(7B 级及以下)指令跟随能力较弱,极易输出格式错误。建议改用 DeepSeek、GPT-4o 等旗舰在线模型,或使用本地部署的更大参数模型。
  2. 关闭「发送完整字幕」
    高级选项 → 字幕翻译调整 中取消勾选「发送完整字幕」,改用逐行翻译模式,降低模型输出格式要求。
  3. 精简本地模型提示词
    如果你使用的是「兼容AI/本地模型」渠道,请打开以下两个文件,删除其中过于复杂的指令,只保留核心要求:

    • 软件目录/videotrans/prompts/srt/localllm.txt(发送完整字幕时)
    • 软件目录/videotrans/prompts/text/localllm.txt(未发送完整字幕时)

    注意:{} 包裹的变量不要修改或删除。

  4. 重启并检查本地模型服务
    确认 llama-server 已正常启动,且模型支持 OpenAI 兼容接口。若自行部署模型,可尝试重启服务。

请查阅相关文档:

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