#1820 openai.BadRequestError: Error code: 400 - {'error': {'message': 'model is required', 'type': 'api_error', 'param': None,

112.111* Posted at: 9 hours ago 👁8

请求参数不正确:Error code: 400 - {'error': {'message': 'model is required', 'type': 'api_error', 'param': None, 'code': None}}:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 911, in run
File "videotrans\translator\_base.py", line 78, in run
File "videotrans\translator\_base.py", line 137, in _run_srt
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 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.BadRequestError: Error code: 400 - {'error': {'message': 'model is required', 'type': 'api_error', 'param': None, 'code': None}}


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

1 Replies

错误信息显示翻译请求缺少必需的 model 参数。这通常是因为您选择了 OpenAI、DeepSeek 等需要指定模型名称的 AI 翻译渠道,但未在设置中正确填写模型名称。

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

  1. 确认翻译渠道:在主界面第3行“翻译”下拉菜单中,确认您选择的是否为 OpenAI ChatGPTDeepSeek智谱AI阿里百炼 等需要指定模型的渠道。
  2. 填写模型名称

    • 点击主界面第3行右侧的 “翻译设置” 按钮。
    • 在弹出的窗口中,找到您所选渠道对应的配置项。
    • “模型名称”“model” 字段中,填入该渠道支持的、正确的模型名称。

      • 例如:对于 OpenAI,模型名称应为 gpt-3.5-turbogpt-4;对于 DeepSeek,应为 deepseek-chat
    • 确保您的 API KeyAPI地址(如需要)也已正确填写。
  3. 保存并重试:填写完毕后保存设置,然后重新运行翻译任务。

如果问题依旧,请提供您“翻译设置”窗口中对应渠道的配置截图,以便进一步分析。

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

Similar issues already exist

Trending Questions