Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tts node add a prompt with empty text #1919

Merged
merged 1 commit into from
Dec 26, 2024
Merged

Conversation

shaohuzhang1
Copy link
Contributor

fix: tts node add a prompt with empty text --bug=1050887 --user=王孝刚 【应用编排】知识库检索节点为空,走到文本转语音节点会报错 https://www.tapd.cn/57709429/s/1637596

--bug=1050887 --user=王孝刚 【应用编排】知识库检索节点为空,走到文本转语音节点会报错 https://www.tapd.cn/57709429/s/1637596
Copy link

f2c-ci-robot bot commented Dec 26, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

f2c-ci-robot bot commented Dec 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is correct and complete for removing empty lines from text. It includes a check to ensure that the input text is not empty before proceeding with the removal of empty lines. No other modifications are necessary, so no further optimizations are needed in this context. Here's the summary:

No issues detected: The current implementation meets all requirements without any errors or room for improvement.

@wxg0103 wxg0103 merged commit 506187e into main Dec 26, 2024
4 of 5 checks passed
@wxg0103 wxg0103 deleted the pr@main@fix_1050887 branch December 26, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants