Spaces:
kevinwang676
/
Runtime error

Vaibhav Srivastav commited on
Commit
194fffd
1 Parent(s): ef414db
Files changed (2) hide show
  1. app.py +28 -0
  2. requirements.txt +0 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from TTS.api import TTS
3
+
4
+ tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1", gpu=True)
5
+
6
+ def predict(prompt, audio_file_pth):
7
+
8
+ tts.tts_to_file(text=prompt,
9
+ file_path="output.wav",
10
+ speaker_wav=audio_file_pth,
11
+ language="en")
12
+
13
+ return gr.make_waveform(audio="output.wav",)
14
+
15
+
16
+ title = "XTTS: MVP"
17
+
18
+ gr.Interface(
19
+ fn=predict,
20
+ inputs=[
21
+ gr.Textbox(label="Prompt", info = "One or two sentences at a time is better* (max: 10)", placeholder = "It took me quite a long time to develop a voice, and now that I have it I'm not going to be silent.",),
22
+ gr.Audio(label="Upload Speaker WAV", type="filepath"),
23
+ ],
24
+ outputs=[
25
+ gr.Video(label="Synthesised Speech"),
26
+ ],
27
+ title=title,
28
+ ).launch(debug=True)
requirements.txt ADDED
File without changes