Update xtts.py
Browse files
xtts.py
CHANGED
@@ -10,7 +10,6 @@ from flask import Flask, Blueprint, request, jsonify, send_file
|
|
10 |
|
11 |
import torch
|
12 |
import torchaudio
|
13 |
-
import gradio as gr
|
14 |
|
15 |
app = Flask(__name__)
|
16 |
# def upload_bytes(bytes, ext=".wav"):
|
@@ -41,13 +40,13 @@ except:
|
|
41 |
tts=None
|
42 |
model=None
|
43 |
@app.route("/convert")
|
44 |
-
def predict(
|
45 |
global tts
|
46 |
global model
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
|
52 |
if text is None:
|
53 |
return jsonify({'error': 'text is missing'}), 400
|
@@ -149,5 +148,3 @@ def trim_sample_audio(speaker_wav):
|
|
149 |
except:
|
150 |
traceback.print_exc()
|
151 |
return speaker_wav
|
152 |
-
|
153 |
-
gr.Interface(predict, inputs=["text", "text"], outputs="text").launch()
|
|
|
10 |
|
11 |
import torch
|
12 |
import torchaudio
|
|
|
13 |
|
14 |
app = Flask(__name__)
|
15 |
# def upload_bytes(bytes, ext=".wav"):
|
|
|
40 |
tts=None
|
41 |
model=None
|
42 |
@app.route("/convert")
|
43 |
+
def predict():
|
44 |
global tts
|
45 |
global model
|
46 |
+
|
47 |
+
text = request.args.get('text')
|
48 |
+
sample = request.args.get('sample')
|
49 |
+
language = request.args.get('language')
|
50 |
|
51 |
if text is None:
|
52 |
return jsonify({'error': 'text is missing'}), 400
|
|
|
148 |
except:
|
149 |
traceback.print_exc()
|
150 |
return speaker_wav
|
|
|
|