#4210 openai.BadRequestError: Error code: 400 - {'message': 'this model has beta-limitations, temperature, top_p and n are fix

203.218* Posted at: 9 hours ago 👁12

this model has beta-limitations, temperature, top_p and n are fixed at 1, while presence_penalty and frequency_penalty are fixed at 0 trace_id: f79b0183424dc9ce953a332b7da44f90:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 973, in run
File "videotrans\translator\_base.py", line 97, in run
File "videotrans\translator\_base.py", line 161, 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 134, 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 - {'message': 'this model has beta-limitations, temperature, top_p and n are fixed at 1, while presence_penalty and frequency_penalty are fixed at 0 trace_id: f79b0183424dc9ce953a332b7da44f90', 'type': 'invalid_request_error'}


=
system:Windows-10-10.0.26200-SP0
version:v3.99
frozen:True
language:zh
root_dir:F:/win-pyvideotrans-v3.99-418

1 Replies

这是由于你使用的AI翻译模型限制了参数设置(temperature、top_p、presence_penalty等参数只能为固定值),但pyVideoTrans在调用时发送了不符合模型要求的参数值,导致API返回400错误。

解决方案:

  1. 打开菜单栏 工具/选项 -> 高级选项
  2. 字幕翻译调整 区域,找到 AI翻译模型温度值,将其设置为 1(与该模型要求的固定值一致)。
  3. 如果问题仍然存在,请检查该模型是否还有其他限制参数(如 top_ppresence_penaltyfrequency_penalty),这些参数目前在高级选项中无法直接修改,建议更换一个没有此类限制的AI模型(如DeepSeek、GPT-4o等)。

请查阅相关文档:

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