ankitchandel09 commited on
Commit
011a4c2
·
verified ·
1 Parent(s): 485e183

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load a reliable text-to-speech pipeline
5
+ text_to_speech = pipeline("text-to-speech", model="facebook/fastspeech2-en-ljspeech", framework="pt")
6
+
7
+ def generate_speech(text):
8
+ output = text_to_speech(text)
9
+ return output["audio"]
10
+
11
+ gr.Interface(fn=generate_speech, inputs="text", outputs="audio", title="Simple Voice Assistant").launch()