gradio_app / app.py
ankitchandel09's picture
Create app.py
011a4c2 verified
raw
history blame contribute delete
395 Bytes
import gradio as gr
from transformers import pipeline
# Load a reliable text-to-speech pipeline
text_to_speech = pipeline("text-to-speech", model="facebook/fastspeech2-en-ljspeech", framework="pt")
def generate_speech(text):
output = text_to_speech(text)
return output["audio"]
gr.Interface(fn=generate_speech, inputs="text", outputs="audio", title="Simple Voice Assistant").launch()