Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ enhanced_accessibility = False #@param {type:"boolean"}
|
|
10 |
#else:
|
11 |
# raise Exception("Language not supported.")
|
12 |
#@markdown ---
|
13 |
-
lang = "en"
|
14 |
use_gpu = False #@param {type:"boolean"}
|
15 |
|
16 |
from fastapi import FastAPI, Request, Form
|
@@ -60,7 +59,7 @@ import soundfile as sf
|
|
60 |
from piper_phonemize import phonemize_codepoints, phonemize_espeak, tashkeel_run
|
61 |
|
62 |
|
63 |
-
_LOGGER = logging.getLogger("piper_train.infer_onnx")
|
64 |
import os
|
65 |
#if not os.path.exists("./content/piper/src/python/lng"):
|
66 |
# import subprocess
|
@@ -74,7 +73,7 @@ import configparser
|
|
74 |
|
75 |
class Translator:
|
76 |
def __init__(self):
|
77 |
-
self.configs = {}
|
78 |
|
79 |
def load_language(self, language_name):
|
80 |
if language_name not in self.configs:
|
@@ -131,6 +130,7 @@ async def main(
|
|
131 |
]
|
132 |
sess_options = onnxruntime.SessionOptions()
|
133 |
model = None
|
|
|
134 |
onnx_models = detect_onnx_models(models_path)
|
135 |
|
136 |
if len(text_input) == 0:
|
|
|
10 |
#else:
|
11 |
# raise Exception("Language not supported.")
|
12 |
#@markdown ---
|
|
|
13 |
use_gpu = False #@param {type:"boolean"}
|
14 |
|
15 |
from fastapi import FastAPI, Request, Form
|
|
|
59 |
from piper_phonemize import phonemize_codepoints, phonemize_espeak, tashkeel_run
|
60 |
|
61 |
|
62 |
+
#_LOGGER = logging.getLogger("piper_train.infer_onnx")
|
63 |
import os
|
64 |
#if not os.path.exists("./content/piper/src/python/lng"):
|
65 |
# import subprocess
|
|
|
73 |
|
74 |
class Translator:
|
75 |
def __init__(self):
|
76 |
+
self.configs = {"en","es", "de", "pl"}
|
77 |
|
78 |
def load_language(self, language_name):
|
79 |
if language_name not in self.configs:
|
|
|
130 |
]
|
131 |
sess_options = onnxruntime.SessionOptions()
|
132 |
model = None
|
133 |
+
lang = speaker
|
134 |
onnx_models = detect_onnx_models(models_path)
|
135 |
|
136 |
if len(text_input) == 0:
|