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

142.91* Posted at: 12 hours ago 👁15

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8092, prompt_tokens=1281, total_tokens=9373, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=448), prompt_cache_hit_tokens=448, prompt_cache_miss_tokens=833)


=
system:Windows-10-10.0.26200-SP0
version:v3.86
frozen:True
language:zh
root_dir:D:/AN/PyVideoTrans/win-pyvideotrans-v3.86

1 Replies

这个错误提示“Could not parse response content as the length limit was reached”表明在使用AI大模型(如OpenAI、DeepSeek等)进行翻译或LLM重新断句时,模型的回复内容过长,超出了软件预设的解析长度限制。

核心原因与解决方案:

  1. 原因分析:您使用的AI模型(根据日志,很可能是OpenAI GPT-4o或类似模型)在翻译或处理字幕时,生成了非常长的回复(本次使用了超过8000个token),导致软件无法完整解析。
  2. 直接解决方案减少单次发送给AI的字幕文本量

    • 进入软件主界面,点击右下角的 “设置更多参数”
    • 在“字幕翻译调整”区域,找到 “同时翻译字幕数”
    • 将数值调小,例如从默认的 20 改为 53。这能显著降低每次请求的文本长度,避免触发长度限制。
  3. 高级调整(可选):如果问题在调整“同时翻译字幕数”后依然出现,可以尝试:

    • “工具” -> “选项” -> “高级选项” 中,找到“字幕翻译调整”。
    • 确保 “发送完整字幕” 的勾选状态符合您的需求。如果勾选,会将所有上下文一起发送,容易导致内容过长。您可以尝试取消勾选,让模型仅基于当前批次字幕进行翻译。
    • 检查 “LLM重新断句每批字词数”(在“通用设置”中)。如果这个值设置得过大(例如超过2000),也会导致单次请求内容过长。建议将其设置为 5001000 左右。

操作步骤总结:

  1. 在主界面,将“同时翻译字幕数”设置为一个较小的值(如5)。
  2. 重新执行翻译任务。
  3. 如果问题依旧,进入“高级选项”,调小“LLM重新断句每批字词数”并检查“发送完整字幕”选项。

完成以上调整后,通常可以解决此问题。如果调整后仍有其他错误,请提供新的日志信息。

有用的文档链接: 翻译结果有空白行或输出了提示词

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