Update xtts.py
Browse files
xtts.py
CHANGED
@@ -33,10 +33,10 @@ default_sample=f'{os.path.dirname(os.path.abspath(__file__))}/sample.wav', f'{sa
|
|
33 |
ffmpeg=f'{os.path.dirname(os.path.abspath(__file__))}/ffmpeg'
|
34 |
|
35 |
def predict(text, sample=None, language="zh"):
|
|
|
36 |
global tts
|
37 |
global model
|
38 |
try:
|
39 |
-
get_tts()
|
40 |
text= re.sub("([^\x00-\x7F]|\w)(\.|\。|\?)",r"\1 \2\2",text)
|
41 |
wav = tts.tts(
|
42 |
text,
|
@@ -154,6 +154,7 @@ def tts_play():
|
|
154 |
|
155 |
@app.route("/clone")
|
156 |
def clone():
|
|
|
157 |
get_tts()
|
158 |
source=request.args.get('source')
|
159 |
sample=request.args.get('sample')
|
@@ -198,7 +199,7 @@ def get_tts():
|
|
198 |
model.__get_conditioning_latents=model.get_conditioning_latents
|
199 |
model.get_conditioning_latents=get_conditioning_latents
|
200 |
logging.info("model is ready")
|
201 |
-
return ready
|
202 |
|
203 |
# import gradio as gr
|
204 |
# demo=gr.Interface(predict, inputs=["text", "text"], outputs=gr.Audio())
|
|
|
33 |
ffmpeg=f'{os.path.dirname(os.path.abspath(__file__))}/ffmpeg'
|
34 |
|
35 |
def predict(text, sample=None, language="zh"):
|
36 |
+
get_tts()
|
37 |
global tts
|
38 |
global model
|
39 |
try:
|
|
|
40 |
text= re.sub("([^\x00-\x7F]|\w)(\.|\。|\?)",r"\1 \2\2",text)
|
41 |
wav = tts.tts(
|
42 |
text,
|
|
|
154 |
|
155 |
@app.route("/clone")
|
156 |
def clone():
|
157 |
+
global tts
|
158 |
get_tts()
|
159 |
source=request.args.get('source')
|
160 |
sample=request.args.get('sample')
|
|
|
199 |
model.__get_conditioning_latents=model.get_conditioning_latents
|
200 |
model.get_conditioning_latents=get_conditioning_latents
|
201 |
logging.info("model is ready")
|
202 |
+
return "ready"
|
203 |
|
204 |
# import gradio as gr
|
205 |
# demo=gr.Interface(predict, inputs=["text", "text"], outputs=gr.Audio())
|