vinayaggarwal5050 commited on
Commit
5366d8e
·
verified ·
1 Parent(s): b4f971f

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 transformers import pipeline
3
+
4
+ # Load the model directly from Hugging Face Hub
5
+ tts_pipeline = pipeline("text-to-speech", model="Abhinay45/XTTS-Hindi-finetuned")
6
+
7
+ def text_to_speech(text):
8
+ speech = tts_pipeline(text)
9
+ return speech['audio']
10
+
11
+ # Create a Gradio interface
12
+ iface = gr.Interface(fn=text_to_speech,
13
+ inputs="text",
14
+ outputs="audio",
15
+ title="Text to Speech")
16
+
17
+ iface.launch()