Spaces:
Build error
Build error
SayaSS
commited on
Commit
•
a9e3d65
1
Parent(s):
6d20f9a
update app.py
Browse files
app.py
CHANGED
@@ -41,6 +41,8 @@ def create_tts_fn(net_g_ms, speaker_id):
|
|
41 |
if limitation:
|
42 |
text_len = len(re.sub("\[([A-Z]{2})\]", "", text))
|
43 |
max_len = 100
|
|
|
|
|
44 |
if text_len > max_len:
|
45 |
return "Error: Text is too long", None
|
46 |
if not is_symbol:
|
@@ -154,7 +156,7 @@ if __name__ == '__main__':
|
|
154 |
)
|
155 |
with gr.Row():
|
156 |
with gr.Column():
|
157 |
-
input_text = gr.Textbox(label="Text (100 words limitation)", lines=5, value=example, elem_id=f"input-text-en-{name_en.replace(' ','')}")
|
158 |
lang = gr.Dropdown(label="Language", choices=["Chinese", "Japanese", "Mix(wrap the Chinese text with [ZH][ZH], wrap the Japanese text with [JA][JA])"],
|
159 |
type="index", value=language)
|
160 |
temp_lang = gr.Variable(value=language)
|
@@ -213,7 +215,7 @@ if __name__ == '__main__':
|
|
213 |
)
|
214 |
with gr.Row():
|
215 |
with gr.Column():
|
216 |
-
input_text = gr.Textbox(label="文本 (100字上限)", lines=5, value=example, elem_id=f"input-text-zh-{name_zh}")
|
217 |
lang = gr.Dropdown(label="语言", choices=["中文", "日语", "中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)"],
|
218 |
type="index", value="中文"if language == "Chinese" else "日语")
|
219 |
temp_lang = gr.Variable(value=language)
|
|
|
41 |
if limitation:
|
42 |
text_len = len(re.sub("\[([A-Z]{2})\]", "", text))
|
43 |
max_len = 100
|
44 |
+
if is_symbol:
|
45 |
+
max_len *= 3
|
46 |
if text_len > max_len:
|
47 |
return "Error: Text is too long", None
|
48 |
if not is_symbol:
|
|
|
156 |
)
|
157 |
with gr.Row():
|
158 |
with gr.Column():
|
159 |
+
input_text = gr.Textbox(label="Text (100 words limitation)" if limitation else "Text", lines=5, value=example, elem_id=f"input-text-en-{name_en.replace(' ','')}")
|
160 |
lang = gr.Dropdown(label="Language", choices=["Chinese", "Japanese", "Mix(wrap the Chinese text with [ZH][ZH], wrap the Japanese text with [JA][JA])"],
|
161 |
type="index", value=language)
|
162 |
temp_lang = gr.Variable(value=language)
|
|
|
215 |
)
|
216 |
with gr.Row():
|
217 |
with gr.Column():
|
218 |
+
input_text = gr.Textbox(label="文本 (100字上限)" if limitation else "文本", lines=5, value=example, elem_id=f"input-text-zh-{name_zh}")
|
219 |
lang = gr.Dropdown(label="语言", choices=["中文", "日语", "中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)"],
|
220 |
type="index", value="中文"if language == "Chinese" else "日语")
|
221 |
temp_lang = gr.Variable(value=language)
|