refactor: tts node add warning
parent
c5b56dec38
commit
c13427a0b1
|
|
@ -214,6 +214,8 @@ def split_and_transcribe(file_path, model, max_segment_length_ms=59000, audio_fo
|
||||||
|
|
||||||
|
|
||||||
def _remove_empty_lines(text):
|
def _remove_empty_lines(text):
|
||||||
|
if not isinstance(text, str):
|
||||||
|
raise AppApiException(500, '文本转语音节点,文本内容必须是字符串类型')
|
||||||
if not text:
|
if not text:
|
||||||
raise AppApiException(500, '文本转语音节点,文本内容不能为空')
|
raise AppApiException(500, '文本转语音节点,文本内容不能为空')
|
||||||
result = '\n'.join(line for line in text.split('\n') if line.strip())
|
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()
|
text = text.strip()
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue