From cde1b66fa3876120cc28159bdda6fb31fabb3035 Mon Sep 17 00:00:00 2001 From: Wenliang Zhao Date: Mon, 4 Mar 2024 16:26:34 +0800 Subject: [PATCH] Update api.py --- melo/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/melo/api.py b/melo/api.py index 1f2f125..a48cc20 100644 --- a/melo/api.py +++ b/melo/api.py @@ -76,6 +76,8 @@ class TTS(nn.Module): print(" > Text split to sentences.") print('\n'.join(texts)) print(" > ===========================") + # remove too long texts to avoid memory issues + texts = [text for text in texts if len(text) < 50] return texts def tts_to_file(self, text, speaker_id, output_path=None, sdp_ratio=0.2, noise_scale=0.6, noise_scale_w=0.8, speed=1.0, pbar=None, format=None, position=None, quiet=False,):