laubonghaudoi
commited on
Commit
•
6673fc0
1
Parent(s):
688fbf8
Fix formatting
Browse files- TTS_infer_pack/TTS.py +4 -8
- app.py +25 -25
TTS_infer_pack/TTS.py
CHANGED
@@ -166,20 +166,16 @@ class TTS_Config:
|
|
166 |
|
167 |
if (self.t2s_weights_path in [None, ""]) or (not os.path.exists(self.t2s_weights_path)):
|
168 |
self.t2s_weights_path = self.default_configs[default_config_key]['t2s_weights_path']
|
169 |
-
print(f"fall back to default t2s_weights_path: {
|
170 |
-
self.t2s_weights_path}")
|
171 |
if (self.vits_weights_path in [None, ""]) or (not os.path.exists(self.vits_weights_path)):
|
172 |
self.vits_weights_path = self.default_configs[default_config_key]['vits_weights_path']
|
173 |
-
print(f"fall back to default vits_weights_path: {
|
174 |
-
self.vits_weights_path}")
|
175 |
if (self.bert_base_path in [None, ""]) or (not os.path.exists(self.bert_base_path)):
|
176 |
self.bert_base_path = self.default_configs[default_config_key]['bert_base_path']
|
177 |
-
print(f"fall back to default bert_base_path: {
|
178 |
-
self.bert_base_path}")
|
179 |
if (self.cnhuhbert_base_path in [None, ""]) or (not os.path.exists(self.cnhuhbert_base_path)):
|
180 |
self.cnhuhbert_base_path = self.default_configs[default_config_key]['cnhuhbert_base_path']
|
181 |
-
print(f"fall back to default cnhuhbert_base_path: {
|
182 |
-
self.cnhuhbert_base_path}")
|
183 |
self.update_configs()
|
184 |
|
185 |
self.max_sec = None
|
|
|
166 |
|
167 |
if (self.t2s_weights_path in [None, ""]) or (not os.path.exists(self.t2s_weights_path)):
|
168 |
self.t2s_weights_path = self.default_configs[default_config_key]['t2s_weights_path']
|
169 |
+
print(f"fall back to default t2s_weights_path: {self.t2s_weights_path}")
|
|
|
170 |
if (self.vits_weights_path in [None, ""]) or (not os.path.exists(self.vits_weights_path)):
|
171 |
self.vits_weights_path = self.default_configs[default_config_key]['vits_weights_path']
|
172 |
+
print(f"fall back to default vits_weights_path: {self.vits_weights_path}")
|
|
|
173 |
if (self.bert_base_path in [None, ""]) or (not os.path.exists(self.bert_base_path)):
|
174 |
self.bert_base_path = self.default_configs[default_config_key]['bert_base_path']
|
175 |
+
print(f"fall back to default bert_base_path: {self.bert_base_path}")
|
|
|
176 |
if (self.cnhuhbert_base_path in [None, ""]) or (not os.path.exists(self.cnhuhbert_base_path)):
|
177 |
self.cnhuhbert_base_path = self.default_configs[default_config_key]['cnhuhbert_base_path']
|
178 |
+
print(f"fall back to default cnhuhbert_base_path: {self.cnhuhbert_base_path}")
|
|
|
179 |
self.update_configs()
|
180 |
|
181 |
self.max_sec = None
|
app.py
CHANGED
@@ -320,31 +320,31 @@ async def create_app():
|
|
320 |
GPT_dropdown.change(
|
321 |
tts_pipeline.init_t2s_weights, [GPT_dropdown], [])
|
322 |
|
323 |
-
with gr.Group():
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
return app
|
349 |
|
350 |
|
|
|
320 |
GPT_dropdown.change(
|
321 |
tts_pipeline.init_t2s_weights, [GPT_dropdown], [])
|
322 |
|
323 |
+
# with gr.Group():
|
324 |
+
# gr.Markdown(value=i18n(
|
325 |
+
# "文本切分工具。太长的文本合成出来效果不一定好,所以太长建议先切。合成会根据文本的换行分开合成再拼起来。"))
|
326 |
+
# with gr.Row():
|
327 |
+
# text_inp = gr.Textbox(label=i18n(
|
328 |
+
# "需要合成的切分前文本"), value="", lines=4)
|
329 |
+
# with gr.Column():
|
330 |
+
# _how_to_cut = gr.Radio(
|
331 |
+
# label=i18n("怎么切"),
|
332 |
+
# choices=[i18n("不切"), i18n("凑四句一切"), i18n("凑50字一切"), i18n(
|
333 |
+
# "按中文句号。切"), i18n("按英文句号.切"), i18n("按标点符号切"), ],
|
334 |
+
# value=i18n("凑四句一切"),
|
335 |
+
# interactive=True,
|
336 |
+
# )
|
337 |
+
# cut_text = gr.Button(i18n("切分"), variant="primary")
|
338 |
+
|
339 |
+
# def to_cut(text_inp, how_to_cut):
|
340 |
+
# if len(text_inp.strip()) == 0 or text_inp == []:
|
341 |
+
# return ""
|
342 |
+
# method = get_method(cut_method[how_to_cut])
|
343 |
+
# return method(text_inp)
|
344 |
+
|
345 |
+
# text_opt = gr.Textbox(label=i18n("切分后文本"), value="", lines=4)
|
346 |
+
# cut_text.click(to_cut, [text_inp, _how_to_cut], [text_opt])
|
347 |
+
# gr.Markdown(value=i18n("后续将支持转音素、手工修改音素、语音合成分步执行。"))
|
348 |
return app
|
349 |
|
350 |
|