Skip to content

Commit

Permalink
fix: tts node add a prompt with empty text
Browse files Browse the repository at this point in the history
--bug=1050887 --user=王孝刚 【应用编排】知识库检索节点为空,走到文本转语音节点会报错 https://www.tapd.cn/57709429/s/1637596
  • Loading branch information
wxg0103 committed Dec 26, 2024
1 parent f1c7ae9 commit a14f065
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/common/util/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 text:
raise AppApiException(500, '文本转语音节点,文本内容不能为空')
result = '\n'.join(line for line in text.split('\n') if line.strip())
return markdown_to_plain_text(result)

Expand Down

0 comments on commit a14f065

Please sign in to comment.