#6222 翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数Could not parse response content as the length limit w

2602:f919* Posted at: 21 hours ago

翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=32770, prompt_tokens=3154, total_tokens=35924, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=32770, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=3154)
Traceback (most recent call last):

File "videotrans\translator\_base.py", line 71, in run

File "videotrans\translator\_base.py", line 204, in _run_srt

File "tenacity\__init__.py", line 338, in wrapped_f

File "tenacity\__init__.py", line 477, in call

File "tenacity\__init__.py", line 378, in iter

File "tenacity\__init__.py", line 421, in exc_check

tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 136, in process_task

File "videotrans\task\_stage_translate.py", line 31, in trans

File "videotrans\translator\_runner.py", line 63, in run

File "videotrans\translator\_base.py", line 74, in run

File "tenacity\__init__.py", line 480, in call

File "videotrans\translator\_openaicompat.py", line 92, in _item_task

openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=32770, prompt_tokens=3154, total_tokens=35924, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=32770, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=3154)
cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 批量翻译模式
原始输入文件名: D:/media/ml4t/CS7646_Lecture_00_Introduction_.mp4,
输出结果保存到文件夹: D:/media/_video_out/ml4t/CS7646_Lecture_00_Introduction_-mp4,
临时文件夹: D:/tool/win-pyvideotrans-v4.08/tmp/28920/5e7fe6e7ae
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunjian(Male/CN), 配音语言:简体中文, 已选 二次语音识别

[已选中 二次语音识别,但不会生效,因已选择 嵌入双字幕,需保证原始和目标字幕时间轴一致,而二次语音识别会重新生成时间轴不同的目标字幕]

音量:+0%, 语速:+0%, 已选 音频加速, 已选 视频慢速
字幕: 嵌入软字幕(双) 目标语言在上双字幕
代理地址:http://127.0.0.1:7897


=
system:Windows-10-10.0.26200-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/tool/win-pyvideotrans-v4.08

1 Replies

这是 DeepSeek 深度思考模型导致的问题。错误中 reasoning_tokens=32770 表明模型将几乎全部输出 token 消耗在了内部推理阶段,最终响应达到长度上限被截断,因此无法解析为有效翻译内容。

解决方法

  1. 降低每次发送字幕行数:进入 菜单 → 工具/选项 → 高级选项 → 字幕翻译调整,将 AI翻译渠道每批字幕行数 调小,建议设置为 20~30
  2. 更换为非深度思考模型:在 菜单 → 翻译设置 → DeepSeek 中,改用不带深度思考/推理的对话模型(如 deepseek-chatdeepseek-v3 等),避免 reasoning_tokens 占用全部输出空间。
  3. 增大 max_token:在 DeepSeek 渠道设置面板中尽量调大 max token 值;但注意该值受 API 上限约束,若已达到上限则需配合第 1、2 步。
  4. 关闭“发送完整字幕”:在主界面取消勾选 发送完整字幕,改用按行翻译模式,减少单次输出长度。
  5. 清除翻译缓存:如果调整后仍出现异常结果,删除 tmp/translate_cache/ 目录下的缓存文件后重试。

请查阅相关文档:

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource