#8987 语音识别阶段出错[DeepSeek] 'text'Traceback (most recent call last):

2605**ed47 Posted at: 20 hours ago

语音识别阶段出错[DeepSeek] 'text'
Traceback (most recent call last):

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

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

File "videotrans\task\speech2text.py", line 142, in recogn

File "videotrans\recognition\__init__.py", line 178, in run

File "videotrans\recognition\_base.py", line 101, in run

File "videotrans\recognition\_deepseek.py", line 32, in _exec

KeyError: 'text'
trk=语音转录
self.cfg.name='C:/Users/APPLE/Desktop/downloads/谁给的钢铁侠勇气敢单挑雷神和灭霸 [7710832687732378899].mp4',
self.cfg.target_dir='C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19/output',
self.cfg.cache_folder='C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19/tmp/11436/214db19f9f'
self.cfg.is_cuda=True
语音识别:DeepSeek, , 发音语言: zh
最长语音持续(秒): 5s
最短语音持续(毫秒): 3000ms
静音分割持续毫秒: 600ms
语音阈值: 0.45
选择VAD: silero
输出格式: srt
中日韩字幕单行字符数:15, 其他语言字幕单行字符数:40
self.cfg=TaskCfgSTT(uuid='214db19f9f', name='C:/Users/APPLE/Desktop/downloads/谁给的钢铁侠勇气敢单挑雷神和灭霸 [7710832687732378899].mp4', dirname='C:/Users/APPLE/Desktop/downloads', noextname='谁给的钢铁侠勇气敢单挑雷神和灭霸 [7710832687732378899]', basename='谁给的钢铁侠勇气敢单挑雷神和灭霸 [7710832687732378899].mp4', ext='mp4', target_dir='C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19/output', cache_folder='C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19/tmp/11436/214db19f9f', is_cuda=True, source_language='', source_language_code='', source_sub=None, source_wav=None, source_wav_output=None, target_language='', target_language_code='', target_sub='C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19/output/谁给的钢铁侠勇气敢单挑雷神和灭霸 [7710832687732378899].srt', target_wav=None, target_wav_output=None, detect_language='zh', recogn_type=13, model_name='large-v3-turbo', shibie_audio='C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19/tmp/11436/214db19f9f/谁给的钢铁侠勇气敢单挑雷神和灭霸 [7710832687732378899]-1795760858.5977695.wav', remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=False, fix_punc=0)


=
system:Windows-10-10.0.19045-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:C:/Users/APPLE/Desktop/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 20 hours ago

核心原因:DeepSeek 语音识别接口返回的响应中没有预期的 text 字段,导致程序解析时抛出 KeyError: 'text'。这通常是 API 密钥/地址/余额异常,或所选模型并非语音识别模型(返回了错误信息而非识别结果)。

排查步骤:

  1. 打开 菜单 → 翻译设置 → DeepSeek,确认:

    • API 地址填写正确(默认官方地址,不要随意改动);
    • API Key 已正确填写且无多余空格;
    • 账户余额充足(余额不足时返回的是错误信息,无 text 字段)。
  2. 确认使用的 DeepSeek 模型为语音识别(ASR)模型,而非聊天/翻译模型。若手动填写了模型名称,请检查是否写错。
  3. 该视频文件名含有中文、空格、方括号 [7710832687732378899],先重命名为简短英文(如 video1.mp4),放到浅层目录(如 D:/video1.mp4)后重试,排除路径与特殊字符干扰。
  4. 若仍报错,可临时切换语音识别渠道为 faster-whisper(内置) + large-v3-turbo 验证本地流程是否正常(也可顺便判断是 DeepSeek 渠道问题还是视频本身问题)。中文识别如需在线渠道,也可改用 豆包语音识别大模型极速版 或 Qwen-ASR(内置)。

若以上检查后依旧出现该报错,请提供 软件安装目录/logs/ 下最新日志文件底部约 30 行(含 DeepSeek 返回的原始响应内容),以便进一步分析。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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

Related resource