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

223.73* Posted at: 5 hours ago 👁9

内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=4096, prompt_tokens=1375, total_tokens=5471, completion_tokens_details=None, prompt_tokens_details=None)


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:zh
root_dir:G:/pyvideotrans

1 Replies

该错误是由于AI翻译渠道(如DeepSeek、OpenAI等)返回的响应内容过长,超出了其API的Token限制(通常是4096个Completion Token)导致的。

解决方案:

  1. 降低每次发送的字幕行数:这是最直接的解决方法。进入 菜单 -> 工具 -> 高级选项 -> 字幕翻译调整,将 AI翻译渠道每批字幕行数 从默认值(如100)降低到一个较小的值,例如 2010
  2. 检查并调整提示词:如果使用了“发送完整字幕”功能,并且自定义了较长的提示词,这也会显著增加Token消耗。可以尝试:

    • 暂时取消勾选 发送完整字幕
    • 检查 prompts 目录下的自定义提示词文件,确保其内容简洁。
  3. 更换翻译模型:如果当前使用的AI模型(如 deepseek-chat)上下文窗口较小,可以尝试切换到支持更长上下文的模型,例如 deepseek-v3gpt-4o
  4. 简化任务:如果视频对话密集,生成的字幕文件本身就很长,可以考虑先对字幕进行合并或简化处理,再翻译。

操作步骤摘要:

  1. 打开软件,点击顶部菜单栏的 工具 -> 高级选项
  2. 切换到 字幕翻译调整 选项卡。
  3. 找到 AI翻译渠道每批字幕行数,将其数值调小(例如改为20)。
  4. 点击 保存 并重启软件,重新尝试翻译任务。

请查阅相关文档:

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

Similar issues already exist