#679 openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid param model:deepseek-chat (sid: cha000daa55@dx1

*345:4606* Posted at: 13 hours ago 👁11

Error code: 400 - {'error': {'message': 'invalid param model:deepseek-chat (sid: cha000daa55@dx199892cb328b808312)', 'type': 'invalid_request_error', 'param': None, 'code': '10005'}}:Traceback (most recent call last):

File "videotrans\util\TestSrtTrans.py", line 17, in run

File "videotrans\translator\__init__.py", line 844, 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\_chatgpt.py", line 169, 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.BadRequestError: Error code: 400 - {'error': {'message': 'invalid param model:deepseek-chat (sid: cha000daa55@dx199892cb328b808312)', 'type': 'invalid_request_error', 'param': None, 'code': '10005'}}

=====

Windows-10-10.0.26100-SP0

version:v3.80

frozen:True

language:zh

1 Replies

本条内容由 DeepSeek 回复
这个错误是由于在 pyVideoTrans 中配置的 DeepSeek 翻译模型名称不正确导致的。错误信息明确指出 invalid param model:deepseek-chat,说明软件尝试使用的模型参数不被 DeepSeek API 接受。

解决方案:

1. 检查并更正模型名称:

  • 打开 pyVideoTrans 软件。
  • 进入 设置配置 界面,找到与 DeepSeek 翻译 相关的设置项。
  • 模型名称 (Model) 或类似的输入框中,将当前的 deepseek-chat 修改为 DeepSeek 官方支持的、正确的模型名称。根据 DeepSeek 官方文档,常见的正确模型名称可能是 deepseek-chat 的新版本标识(如 deepseek-chat-v2deepseek-chat-001)或者是通用模型如 deepseek-reasoner最稳妥的方法是查阅你所用 DeepSeek API 服务商(例如 OpenRouter 或官方平台)的最新文档,获取确切的模型名称列表。

2. 验证 API 密钥和基础 URL:

  • 同时,请确保你填写的 DeepSeek API 密钥是正确的、未过期的,并且拥有调用相应模型的权限。
  • 如果你是通过第三方平台(如 OpenRouter)使用 DeepSeek,请确保你填写的 API Base URL(例如 https://openrouter.ai/api/v1)也是正确的。

3. 重新测试:

  • 修改并保存配置后,可以使用软件内的“测试”功能或重新尝试翻译任务。

错误分析:

这个错误 (openai.BadRequestError) 发生在字幕翻译阶段。pyVideoTrans 使用了一个与 OpenAI API 兼容的库来调用 DeepSeek 的服务。当它向 DeepSeek 的 API 服务器发送请求时,服务器无法识别 model: deepseek-chat 这个参数,因此返回了 400 错误。这通常是因为模型名称已经更新,但软件内的默认配置或用户手动输入的配置没有同步更新。

请优先尝试第一步,修正模型名称即可解决问题。

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