Skip to content

Commit c13427a

Browse files
committed
refactor: tts node add warning
1 parent c5b56de commit c13427a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/common/util/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def split_and_transcribe(file_path, model, max_segment_length_ms=59000, audio_fo
214214

215215

216216
def _remove_empty_lines(text):
217+
if not isinstance(text, str):
218+
raise AppApiException(500, '文本转语音节点,文本内容必须是字符串类型')
217219
if not text:
218220
raise AppApiException(500, '文本转语音节点,文本内容不能为空')
219221
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:
248250
# 去除首尾空格
249251
text = text.strip()
250252
return text
251-

0 commit comments

Comments
 (0)