Update app.py
Browse files
app.py
CHANGED
@@ -21,25 +21,23 @@ a schonn no kuerzer Zäit huet de Wanderer säi Mantel ausgedoen. Do huet den No
|
|
21 |
datt d’Sonn vun hinnen zwee dee Stäerkste wier."""
|
22 |
|
23 |
def init():
|
24 |
-
key_list=
|
25 |
-
|
26 |
-
# print(key_list)
|
27 |
-
return(gr.update(label="Voice",choices=key_list,value="lb_LU-female2-medium",interactive=True))
|
28 |
|
29 |
def new_load_mod(instr="en_US-joe-medium"):
|
30 |
model=instr
|
31 |
print(f"model: {model}")
|
32 |
-
|
33 |
-
lang="lb"
|
34 |
print(f"lang: {lang}")
|
35 |
-
|
36 |
-
dia="lb_LU"
|
37 |
print(f"dia: {dia}")
|
38 |
-
|
39 |
-
name="female2"
|
40 |
print(f"name: {name}")
|
41 |
-
|
42 |
-
style="medium"
|
43 |
print(f"style: {style}")
|
44 |
file=f'{instr}.onnx'
|
45 |
print(f"file: {file}")
|
@@ -48,7 +46,7 @@ def new_load_mod(instr="en_US-joe-medium"):
|
|
48 |
if not os.path.isfile(f'{os.getcwd()}/voices/{file}'):
|
49 |
print(f"Model not found locally")
|
50 |
# m_path= f"https://huggingface.co/rhasspy/piper-voices/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
|
51 |
-
m_path= f"https://huggingface.co/mbarnig/
|
52 |
print(f"m_path: {m_path}")
|
53 |
print("Downloading json...")
|
54 |
json_file=requests.get(f"{m_path}.json")
|
|
|
21 |
datt d’Sonn vun hinnen zwee dee Stäerkste wier."""
|
22 |
|
23 |
def init():
|
24 |
+
key_list=['lb_LU-marylux-medium','lb_LU-femaleLOD-medium','lb_LU-androgynous-medium']
|
25 |
+
return(gr.update(label="Voice",choices=key_list,value="lb_LU-androgynous-medium",interactive=True))
|
|
|
|
|
26 |
|
27 |
def new_load_mod(instr="en_US-joe-medium"):
|
28 |
model=instr
|
29 |
print(f"model: {model}")
|
30 |
+
lang=instr.split("_")[0]
|
31 |
+
# lang="lb"
|
32 |
print(f"lang: {lang}")
|
33 |
+
dia=instr.split("-")[0]
|
34 |
+
# dia="lb_LU"
|
35 |
print(f"dia: {dia}")
|
36 |
+
name=instr.split("-")[1]
|
37 |
+
# name="female2"
|
38 |
print(f"name: {name}")
|
39 |
+
style=instr.split("-")[2]
|
40 |
+
# style="medium"
|
41 |
print(f"style: {style}")
|
42 |
file=f'{instr}.onnx'
|
43 |
print(f"file: {file}")
|
|
|
46 |
if not os.path.isfile(f'{os.getcwd()}/voices/{file}'):
|
47 |
print(f"Model not found locally")
|
48 |
# m_path= f"https://huggingface.co/rhasspy/piper-voices/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
|
49 |
+
m_path= f"https://huggingface.co/mbarnig/lb_rhasspy_piper_tts/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
|
50 |
print(f"m_path: {m_path}")
|
51 |
print("Downloading json...")
|
52 |
json_file=requests.get(f"{m_path}.json")
|