Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,10 @@ def inference(text, text_lang,
|
|
119 |
if text == '':
|
120 |
wprint("Please input text to generate/θ―·θΎε
₯ηζζε")
|
121 |
return None
|
122 |
-
text=trim_text(text,text_language)
|
|
|
|
|
|
|
123 |
try:
|
124 |
lang=dict_language[text_lang]
|
125 |
inputs={
|
@@ -219,7 +222,7 @@ def duration(audio_file_path):
|
|
219 |
return False
|
220 |
|
221 |
def update_model(choice):
|
222 |
-
|
223 |
model_info = models[choice]
|
224 |
gpt_path = abs_path(model_info["gpt_weight"])
|
225 |
sovits_path = abs_path(model_info["sovits_weight"])
|
@@ -276,7 +279,7 @@ def clone_voice(user_voice,user_text,user_lang):
|
|
276 |
wprint("Please enter text to generate/θ―·θΎε
₯ηζζε")
|
277 |
return None
|
278 |
user_text=trim_text(user_text,user_lang)
|
279 |
-
global gpt_path, sovits_path
|
280 |
gpt_path = abs_path("pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt")
|
281 |
#tprint(f'Model loaded:{gpt_path}')
|
282 |
sovits_path = abs_path("pretrained_models/s2G488k.pth")
|
|
|
119 |
if text == '':
|
120 |
wprint("Please input text to generate/θ―·θΎε
₯ηζζε")
|
121 |
return None
|
122 |
+
text=trim_text(text,text_language)
|
123 |
+
tts_pipline.init_vits_weights(sovits_path)
|
124 |
+
tts_pipline.init_t2s_weights(gpt_path)
|
125 |
+
|
126 |
try:
|
127 |
lang=dict_language[text_lang]
|
128 |
inputs={
|
|
|
222 |
return False
|
223 |
|
224 |
def update_model(choice):
|
225 |
+
global gpt_path,sovits_path
|
226 |
model_info = models[choice]
|
227 |
gpt_path = abs_path(model_info["gpt_weight"])
|
228 |
sovits_path = abs_path(model_info["sovits_weight"])
|
|
|
279 |
wprint("Please enter text to generate/θ―·θΎε
₯ηζζε")
|
280 |
return None
|
281 |
user_text=trim_text(user_text,user_lang)
|
282 |
+
#global gpt_path, sovits_path
|
283 |
gpt_path = abs_path("pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt")
|
284 |
#tprint(f'Model loaded:{gpt_path}')
|
285 |
sovits_path = abs_path("pretrained_models/s2G488k.pth")
|