Spaces:
Configuration error
Configuration error
address #43 #45
Browse files- gradio_app.py +5 -0
gradio_app.py
CHANGED
@@ -100,6 +100,11 @@ E2TTS_ema_model = load_model(
|
|
100 |
)
|
101 |
|
102 |
def split_text_into_batches(text, max_chars=200, split_words=SPLIT_WORDS):
|
|
|
|
|
|
|
|
|
|
|
103 |
sentences = re.split('([。.!?!?])', text)
|
104 |
sentences = [''.join(i) for i in zip(sentences[0::2], sentences[1::2])]
|
105 |
|
|
|
100 |
)
|
101 |
|
102 |
def split_text_into_batches(text, max_chars=200, split_words=SPLIT_WORDS):
|
103 |
+
if len(text.encode('utf-8')) <= max_chars:
|
104 |
+
return [text]
|
105 |
+
if text[-1] not in ['。', '.', '!', '!', '?', '?']:
|
106 |
+
text += '.'
|
107 |
+
|
108 |
sentences = re.split('([。.!?!?])', text)
|
109 |
sentences = [''.join(i) for i in zip(sentences[0::2], sentences[1::2])]
|
110 |
|