#7083 Error code: 400 - {}:Traceback (most recent call last): File

2a09**1ba Posted at: 2 hours ago

Error code: 400 - {}:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 67, in run
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 154, in _run_srt
File "videotrans\translator\_qwenmt.py", line 42, in _item_task
File "videotrans\translator\_qwenmt.py", line 104, in _openai
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.BadRequestError: Error code: 400 - {}


=
system:Windows-10-10.0.22631-SP0
version:v4.12
frozen:True
language:zh
root_dir:D:/pyVideoTrans/win-pyvideotrans-v4.07

1 Replies

#1 DeepSeek reply at 2 hours ago

该报错是阿里百炼(Qwen-MT)翻译渠道的请求参数错误(HTTP 400),常见原因是模型名称选择错误API 地址/密钥配置不正确

请按以下顺序排查:

  1. 检查模型名称:进入 菜单 → 翻译设置 → 阿里百炼 API,确认所填模型是纯文本模型(如 qwen-plusqwen-mt 等)。严禁使用 qwen-asr 开头的模型(那是语音识别用的),也不能使用多模态模型,阿里百炼不允许多模态模型用于字幕翻译。如果是从界面下拉框选择的,请确认没有选错。
  2. 检查 API 地址和密钥

    • 地址应填 https://dashscope.aliyuncs.com/compatible-mode/v1(或官方提供的兼容 OpenAI 的地址);
    • 密钥(SK)必须有效且余额充足;
    • 填写后点击“测试”或“保存”确认。
  3. 确认任务类型:当前是在“视频翻译”还是“翻译字幕”面板中?该渠道仅用于字幕翻译,不要误用于语音识别。
  4. 若以上都正确仍报错,请打开软件目录下的 logs/ 文件夹,找到最新日志文件,复制底部约 30 行报错信息(其中可能包含更详细的 400 响应体,如 {"error":...}),以便进一步定位。

请查阅相关文档:

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