Spaces:
Running
Running
ORI-Muchim
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -28,16 +28,13 @@ def get_text(text, hps):
|
|
28 |
|
29 |
|
30 |
def create_tts_fn(model, hps, speaker_ids):
|
31 |
-
def tts_fn(text, speaker, speed
|
32 |
print(speaker, text)
|
33 |
if limitation:
|
34 |
text_len = len(text)
|
35 |
max_len = 500
|
36 |
-
if
|
37 |
-
|
38 |
-
else:
|
39 |
-
if len(hps.data.text_cleaners) > 0 and hps.data.text_cleaners[0] == "zh_ja_mixture_cleaners":
|
40 |
-
text_len = len(re.sub("(\[ZH\]|\[JA\])", "", text))
|
41 |
if text_len > max_len:
|
42 |
return "Error: Text is too long", None
|
43 |
|
|
|
28 |
|
29 |
|
30 |
def create_tts_fn(model, hps, speaker_ids):
|
31 |
+
def tts_fn(text, speaker, speed):
|
32 |
print(speaker, text)
|
33 |
if limitation:
|
34 |
text_len = len(text)
|
35 |
max_len = 500
|
36 |
+
if len(hps.data.text_cleaners) > 0 and hps.data.text_cleaners[0] == "zh_ja_mixture_cleaners":
|
37 |
+
text_len = len(re.sub("(\[ZH\]|\[JA\])", "", text))
|
|
|
|
|
|
|
38 |
if text_len > max_len:
|
39 |
return "Error: Text is too long", None
|
40 |
|