#4218 TaskCfgSTS(is_cuda=False, uuid='635624b598', cache_folder=None, target_dir='F:/zmm/Trailer.Music.Redefined-Evenant', sou

36.142* Posted at: 2 hours ago 👁7

翻译字幕阶段出错 [OpenAI ChatGPT] Unsupported parameter: max_output_tokens
Traceback (most recent call last):
File "videotrans\task\job.py", line 173, in run
File "videotrans\task\_translate_srt.py", line 44, in trans
File "videotrans\translator\__init__.py", line 966, in run
File "videotrans\translator\_base.py", line 101, in run
File "videotrans\translator\_base.py", line 164, 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 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_chatgpt.py", line 136, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1211, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1070, in request
openai.BadRequestError: Error code: 400 - {'error': {'message': 'Unsupported parameter: max_output_tokens', 'type': 'bad_response_status_code', 'param': '', 'code': 'bad_response_status_code'}}
TaskCfgSTS(is_cuda=False, uuid='635624b598', cache_folder=None, target_dir='F:/zmm/Trailer.Music.Redefined-Evenant', source_language=None, source_language_code='English', source_sub='F:/zmm/Trailer.Music.Redefined-Evenant/12.2D-1谐波和弦.mp4(Av787024986,P12).srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='Simplified Chinese', target_sub='F:/zmm/Trailer.Music.Redefined-Evenant/12.2D-1谐波和弦.mp4(Av787024986,P12).Simplified Chinese.srt', target_wav=None, target_wav_output=None, name='F:/zmm/Trailer.Music.Redefined-Evenant/12.2D-1谐波和弦.mp4(Av787024986,P12).srt', noextname='12.2D-1谐波和弦.mp4(Av787024986,P12)', basename='12.2D-1谐波和弦.mp4(Av787024986,P12).srt', ext='srt', dirname='F:/zmm/Trailer.Music.Redefined-Evenant', shound_del_name=None, translate_type=3)


=
system:Windows-10-10.0.22621-SP0
version:v3.98
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v3.95

1 Replies

这是由于 OpenAI ChatGPT 翻译渠道的 API 参数 max_output_tokens 不被当前使用的模型或 API 端点支持导致的。

解决方案:

  1. 打开 pyVideoTrans 软件。
  2. 点击顶部菜单栏的 翻译设置
  3. 在左侧列表中找到并点击 OpenAI ChatGPT
  4. 在右侧的 OpenAI 设置面板中,找到 模型 输入框。
  5. 检查并修改您填写的模型名称。请确保您使用的模型名称是 OpenAI 官方支持的,例如 gpt-3.5-turbogpt-4gpt-4o 等。如果您使用的是第三方兼容 OpenAI 的 API(如 DeepSeek),请确保其模型名称正确且支持 max_output_tokens 参数。
  6. 保存设置后重试翻译任务。

常见原因:

  • 使用了不正确的模型名称。
  • 使用了不支持 max_output_tokens 参数的旧版或第三方模型。

请查阅相关文档:

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.

Related resource