#1617 Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8091, prompt_tokens

111.60* Posted at: 1 day ago 👁19

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8091, prompt_tokens=2615, total_tokens=10706, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=6794, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=1728), prompt_cache_hit_tokens=1728, prompt_cache_miss_tokens=887)


=
system:Windows-10-10.0.26100-SP0
version:v3.85
frozen:True
language:zh
root_dir:C:/Users/~/Desktop/win-pyvideotrans-v3.85

1 Replies

您遇到的是 OpenAI API 的 token 限制错误。当使用 OpenAI 进行翻译或 LLM 重新断句时,如果内容过长,会超出 API 的 token 限制。

解决方案:

  1. 减少单次处理量:

    • 工具/选项 -> 高级选项 中,找到“字幕翻译调整”区域。
    • 将“同时翻译字幕数”设置为较小的值,例如 510
    • 如果使用 LLM 重新断句,将“LLM重新断句每批字词数”也设置为较小的值。
  2. 分割长视频:

    • 如果视频本身很长,建议先使用视频剪辑工具将其分割成较短的片段,然后分别处理。
  3. 更换翻译引擎:

    • 如果上述方法无效,可以暂时使用 Google、微软等传统翻译引擎,它们通常没有 token 限制问题。
  4. 检查 API 配额:

    • 确认您的 OpenAI API 账户有足够的配额来处理长文本。

请优先尝试调整“同时翻译字幕数”参数,这通常能有效解决问题。

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