Fix config
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
models = [
|
@@ -9,7 +10,17 @@ models = [
|
|
9 |
for model in models:
|
10 |
os.system(f"wget {model}")
|
11 |
os.system(f"unzip {model.split('/')[-1]}")
|
12 |
-
os.system(f"rm -fr {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
def convert(text, language, out = "out.wav"):
|
15 |
if language == "Hindi":
|
|
|
1 |
import os
|
2 |
+
import json
|
3 |
import gradio as gr
|
4 |
|
5 |
models = [
|
|
|
10 |
for model in models:
|
11 |
os.system(f"wget {model}")
|
12 |
os.system(f"unzip {model.split('/')[-1]}")
|
13 |
+
os.system(f"rm -fr {model.split('/')[-1]}")
|
14 |
+
lang = model.split('/')[-1].split('.')[0]
|
15 |
+
# read congig and fix speakers path
|
16 |
+
with open(f"{lang}/fastpitch/config.json", "r") as f:
|
17 |
+
config = json.load(f)
|
18 |
+
config["speakers_file"] = '/'.join(config["speakers_file"].split("/")[-3:])
|
19 |
+
config["model_args"]["speakers_file"] = config["speakers_file"]
|
20 |
+
# save updated config
|
21 |
+
with open(f"{lang}/fastpitch/config.json", "w") as f:
|
22 |
+
json.dump(config, f)
|
23 |
+
|
24 |
|
25 |
def convert(text, language, out = "out.wav"):
|
26 |
if language == "Hindi":
|