Spaces:
Running
Running
Upload app.py
#3
by
KSummer
- opened
app.py
CHANGED
@@ -40,7 +40,7 @@ def create_tts_fn(net_g_ms, speaker_id):
|
|
40 |
text = text.replace('\n', ' ').replace('\r', '').replace(" ", "")
|
41 |
if limitation:
|
42 |
text_len = len(re.sub("\[([A-Z]{2})\]", "", text))
|
43 |
-
max_len =
|
44 |
if text_len > max_len:
|
45 |
return "Error: Text is too long", None
|
46 |
if language == 0:
|
@@ -138,7 +138,7 @@ if __name__ == '__main__':
|
|
138 |
)
|
139 |
with gr.Row():
|
140 |
with gr.Column():
|
141 |
-
input_text = gr.Textbox(label="Text (
|
142 |
lang = gr.Dropdown(label="Language", choices=["Chinese", "Japanese", "Mix(wrap the Chinese text with [ZH][ZH], wrap the Japanese text with [JA][JA])"],
|
143 |
type="index", value=language)
|
144 |
btn = gr.Button(value="Generate")
|
@@ -165,7 +165,7 @@ if __name__ == '__main__':
|
|
165 |
)
|
166 |
with gr.Row():
|
167 |
with gr.Column():
|
168 |
-
input_text = gr.Textbox(label="文本 (
|
169 |
lang = gr.Dropdown(label="语言", choices=["中文", "日语", "中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)"],
|
170 |
type="index", value="中文"if language == "Chinese" else "日语")
|
171 |
btn = gr.Button(value="生成")
|
|
|
40 |
text = text.replace('\n', ' ').replace('\r', '').replace(" ", "")
|
41 |
if limitation:
|
42 |
text_len = len(re.sub("\[([A-Z]{2})\]", "", text))
|
43 |
+
max_len = 1000
|
44 |
if text_len > max_len:
|
45 |
return "Error: Text is too long", None
|
46 |
if language == 0:
|
|
|
138 |
)
|
139 |
with gr.Row():
|
140 |
with gr.Column():
|
141 |
+
input_text = gr.Textbox(label="Text (1000 words limitation)", lines=5, value=example, elem_id=f"input-text-en-{name_en.replace(' ','')}")
|
142 |
lang = gr.Dropdown(label="Language", choices=["Chinese", "Japanese", "Mix(wrap the Chinese text with [ZH][ZH], wrap the Japanese text with [JA][JA])"],
|
143 |
type="index", value=language)
|
144 |
btn = gr.Button(value="Generate")
|
|
|
165 |
)
|
166 |
with gr.Row():
|
167 |
with gr.Column():
|
168 |
+
input_text = gr.Textbox(label="文本 (1000字上限)", lines=5, value=example, elem_id=f"input-text-zh-{name_zh}")
|
169 |
lang = gr.Dropdown(label="语言", choices=["中文", "日语", "中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)"],
|
170 |
type="index", value="中文"if language == "Chinese" else "日语")
|
171 |
btn = gr.Button(value="生成")
|