#2190 openai.BadRequestError: Error code: 400 - {'error': {'message': 'chunking_strategy is not supported with this model', 't

216.238* Posted at: 10 hours ago 👁9

请求参数不正确:Error code: 400 - {'error': {'message': 'chunking_strategy is not supported with this model', 'type': 'invalid_request_error', 'param': 'chunking_strategy', 'code': 'unsupported_value'}}:
Traceback (most recent call last):
File "videotrans\util\TestSTT.py", line 18, in run
File "videotrans\recognition\__init__.py", line 218, in run
File "videotrans\recognition\_base.py", line 80, in run
File "videotrans\recognition\_openairecognapi.py", line 66, in _exec
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\audio\transcriptions.py", line 406, 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': 'chunking_strategy is not supported with this model', 'type': 'invalid_request_error', 'param': 'chunking_strategy', 'code': 'unsupported_value'}}


=
system:Windows-10-10.0.22631-SP0
version:v3.91
frozen:True
language:zh
root_dir:D:/AIkoux/AI/win-pyvideotrans-v3.91

1 Replies

此错误是由于在调用 OpenAI 语音识别 API 时,使用了不支持的 chunking_strategy 参数。该参数通常用于处理长音频,但您选择的模型不支持此功能。

解决方法:

  1. 检查并更换模型: 在软件主界面的“语音识别”区域,确保您选择的 OpenAI 模型是 whisper-1。这是官方支持长音频转录的模型。如果您选择了其他模型(如 gpt-4o-audio-preview),请切换回 whisper-1
  2. 检查识别模式: 如果您使用的是“整体识别”模式,软件会自动启用 chunking_strategy 来处理长音频。如果模型不支持,就会报错。请尝试切换到“批量推理”模式(按时长切分),这通常不会使用该参数。
  3. 更新软件: 确保您使用的是最新版本的 pyVideoTrans (v3.91)。此版本已对 OpenAI API 调用进行了优化。

操作步骤:

  • 在软件主界面,将“语音识别”的“识别模式”从“整体识别”改为“批量推理”。
  • 或者,在“语音识别”的模型选择下拉框中,确认并选择 whisper-1

如果以上方法无效,请提供更完整的操作日志(位于 D:/AIkoux/AI/win-pyvideotrans-v3.91/logs/ 目录下),以便进一步分析。

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