ronniet commited on
Commit
32e218a
·
1 Parent(s): a8a85ac

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from TTS.api import TTS
3
+
4
+ tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=False)
5
+
6
+ def predict(text):
7
+ file_path = "output.wav"
8
+ tts.tts_to_file(text, speaker=tts.speakers[0], language="en", file_path=file_path)
9
+ return file_path
10
+
11
+ demo = gr.Interface(
12
+ fn=predict,
13
+ input='text',
14
+ output='audio'
15
+ )
16
+
17
+ demo.launch()