From c13427a0b1061bf7634c27835337da04dc67c07f Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 30 Dec 2024 11:24:32 +0800 Subject: [PATCH] refactor: tts node add warning --- apps/common/util/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/common/util/common.py b/apps/common/util/common.py index 0c1eeec5..3b8bab8a 100644 --- a/apps/common/util/common.py +++ b/apps/common/util/common.py @@ -214,6 +214,8 @@ def split_and_transcribe(file_path, model, max_segment_length_ms=59000, audio_fo def _remove_empty_lines(text): + if not isinstance(text, str): + raise AppApiException(500, '文本转语音节点,文本内容必须是字符串类型') if not text: raise AppApiException(500, '文本转语音节点,文本内容不能为空') result = '\n'.join(line for line in text.split('\n') if line.strip()) @@ -248,4 +250,3 @@ def markdown_to_plain_text(md: str) -> str: # 去除首尾空格 text = text.strip() return text -