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

2408:8226* Posted at: 14 hours ago 👁10

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8192, prompt_tokens=1647, total_tokens=9839, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=1472), prompt_cache_hit_tokens=1472, prompt_cache_miss_tokens=175)


=
system:Windows-10-10.0.19045-SP0
version:v3.91
frozen:True
language:zh
root_dir:D:/tts

1 Replies

这是由于在视频翻译过程中,翻译渠道(AI大模型)返回的响应内容过长,超出了软件设定的处理限制(8192个令牌)导致的。

解决方案:

  1. 降低翻译并发:在软件菜单栏中,依次点击 工具 -> 高级选项 -> 通用设置,将“最大进程数”设置为 24,然后保存并重启软件。这可以降低同时向翻译API发送请求的负载。
  2. 调整翻译方式

    • 在“翻译设置”界面,取消勾选“发送完整字幕”选项。此选项会将整个SRT文件(包含时间轴)发送给AI,容易导致响应过长。
    • 改为按行翻译,虽然可能损失部分上下文,但能有效控制单次请求的文本长度。
  3. 优化提示词:如果使用自定义提示词,请检查 prompts 目录下的翻译提示词文件,确保其内容简洁,没有不必要的指令或示例,以减少AI回复的长度。
  4. 更换翻译渠道:如果当前使用的是本地小模型(如7B参数的Ollama模型),其处理长上下文能力较弱,建议更换为更强大的在线模型,如DeepSeek或OpenAI的模型。

请查阅相关文档:

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