Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def init():
|
|
26 |
# print(key_list)
|
27 |
return(gr.update(label="Voice",choices=key_list,value="lb_LU-marylux-medium",interactive=True))
|
28 |
|
29 |
-
def new_load_mod(instr="
|
30 |
model=instr
|
31 |
print(f"model: {model}")
|
32 |
lang=instr.split("_")[0]
|
@@ -35,7 +35,7 @@ def new_load_mod(instr="lb_LU-marylux-medium"):
|
|
35 |
style=instr.split("-")[2]
|
36 |
file=f'{instr}.onnx'
|
37 |
print(f"Loading model: {file}")
|
38 |
-
print(f"os
|
39 |
if not os.path.isfile(f'{os.getcwd()}/voices/{file}'):
|
40 |
print(f"Model not found locally")
|
41 |
m_path= f"https://huggingface.co/rhasspy/piper-voices/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
|
@@ -53,7 +53,7 @@ def new_load_mod(instr="lb_LU-marylux-medium"):
|
|
53 |
pp.json_ob=f'{os.getcwd()}/voices/{file}.json'
|
54 |
print("Model Loaded")
|
55 |
|
56 |
-
def load_mod(instr="
|
57 |
load_mes=gr.Info(f"""Loading Model...<br>{instr}""",duration=2)
|
58 |
# new_load_mod(instr=instr)
|
59 |
new_load_mod(instr=instr)
|
|
|
26 |
# print(key_list)
|
27 |
return(gr.update(label="Voice",choices=key_list,value="lb_LU-marylux-medium",interactive=True))
|
28 |
|
29 |
+
def new_load_mod(instr="en_US-joe-medium"):
|
30 |
model=instr
|
31 |
print(f"model: {model}")
|
32 |
lang=instr.split("_")[0]
|
|
|
35 |
style=instr.split("-")[2]
|
36 |
file=f'{instr}.onnx'
|
37 |
print(f"Loading model: {file}")
|
38 |
+
print(f"os.path: {os.path}")
|
39 |
if not os.path.isfile(f'{os.getcwd()}/voices/{file}'):
|
40 |
print(f"Model not found locally")
|
41 |
m_path= f"https://huggingface.co/rhasspy/piper-voices/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
|
|
|
53 |
pp.json_ob=f'{os.getcwd()}/voices/{file}.json'
|
54 |
print("Model Loaded")
|
55 |
|
56 |
+
def load_mod(instr="en_US-joe-medium"):
|
57 |
load_mes=gr.Info(f"""Loading Model...<br>{instr}""",duration=2)
|
58 |
# new_load_mod(instr=instr)
|
59 |
new_load_mod(instr=instr)
|