fix: video 模块与 continuation 状态更新
Co-Authored-By: Simon <simon@doorcome.cn>
This commit is contained in:
@@ -162,7 +162,7 @@ def transcribe_audio(audio_path):
|
||||
# 确保音频文件存在
|
||||
if not os.path.exists(audio_path):
|
||||
logger.error(f"音频文件不存在: {audio_path}")
|
||||
return ""
|
||||
return ['', '']
|
||||
dashscope.api_key = os.getenv('DASHSCOPE_API_KEY', '')
|
||||
# 创建识别对象
|
||||
recognition = Recognition(
|
||||
@@ -187,10 +187,10 @@ def transcribe_audio(audio_path):
|
||||
return text
|
||||
else:
|
||||
logger.error(f"❌ 任务失败: {result.message}")
|
||||
return ""
|
||||
return ['', '']
|
||||
except Exception as e:
|
||||
logger.error(f"识别过程中发生异常: {e}")
|
||||
return ""
|
||||
return ['', '']
|
||||
|
||||
def merge_transcripts(transcripts):
|
||||
"""
|
||||
@@ -287,6 +287,9 @@ def analyze_and_correct_text(text):
|
||||
|
||||
# 首先修正文本错误
|
||||
corrected_text = text_correction(text)
|
||||
if corrected_text is None:
|
||||
logger.warning("文本修正返回 None,使用原始文本")
|
||||
corrected_text = text
|
||||
logger.info(f"原始文本长度: {len(text)}")
|
||||
logger.info(f"修正后文本长度: {len(corrected_text)}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user