lalalic commited on
Commit
9036972
·
verified ·
1 Parent(s): 31f696e

Update xtts.py

Browse files
Files changed (1) hide show
  1. xtts.py +5 -8
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(text, sample):
45
  global tts
46
  global model
47
- if request is not None:
48
- text = request.args.get('text')
49
- sample = request.args.get('sample')
50
- language = request.args.get('language')
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