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 -