Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,14 +39,7 @@ data = {
|
|
39 |
}
|
40 |
# Define voices as an empty list
|
41 |
voices = []
|
42 |
-
|
43 |
-
#async def read_root(request: Request):
|
44 |
-
# return templates.TemplateResponse("interface.html", {"request": request, "data": data})
|
45 |
-
@app.get("/", response_class=HTMLResponse)
|
46 |
-
async def read_root(request: Request):
|
47 |
-
#data = {"your_data_key": "your_data_value"} # Replace with your data
|
48 |
-
return templates.TemplateResponse("interface.html", {"request": request, "data": data, "voices": voices})
|
49 |
-
import json
|
50 |
import logging
|
51 |
import math
|
52 |
import sys
|
@@ -65,7 +58,18 @@ import soundfile as sf
|
|
65 |
#from IPython.display import display, Audio, Markdown, clear_output
|
66 |
from piper_phonemize import phonemize_codepoints, phonemize_espeak, tashkeel_run
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
_LOGGER = logging.getLogger("piper_train.infer_onnx")
|
70 |
import os
|
71 |
#if not os.path.exists("./content/piper/src/python/lng"):
|
|
|
39 |
}
|
40 |
# Define voices as an empty list
|
41 |
voices = []
|
42 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
import logging
|
44 |
import math
|
45 |
import sys
|
|
|
58 |
#from IPython.display import display, Audio, Markdown, clear_output
|
59 |
from piper_phonemize import phonemize_codepoints, phonemize_espeak, tashkeel_run
|
60 |
|
61 |
+
with open("multi265ende175.onnx.json", "r") as config_file:
|
62 |
+
config_data = json.load(config_file)
|
63 |
+
speaker_id_map = config_data.get("speaker_id_map", {})
|
64 |
+
voices = [{"id": speaker_id, "name": speaker_name} for speaker_id, speaker_name in speaker_id_map.items()]
|
65 |
+
#@app.get("/", response_class=HTMLResponse)
|
66 |
+
#async def read_root(request: Request):
|
67 |
+
# return templates.TemplateResponse("interface.html", {"request": request, "data": data})
|
68 |
+
@app.get("/", response_class=HTMLResponse)
|
69 |
+
async def read_root(request: Request):
|
70 |
+
#data = {"your_data_key": "your_data_value"} # Replace with your data
|
71 |
+
return templates.TemplateResponse("interface.html", {"request": request, "data": data, "voices": voices})
|
72 |
+
import json
|
73 |
_LOGGER = logging.getLogger("piper_train.infer_onnx")
|
74 |
import os
|
75 |
#if not os.path.exists("./content/piper/src/python/lng"):
|