Image_TO_Speech / app.py
Shangkhonil's picture
Create app.py
7c41e30 verified
raw
history blame contribute delete
588 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-to-speech", model="myshell-ai/MeloTTS-English")
def text_to_speech(text):
audio = pipe(text)
return audio["audio"]
title = "Text-to-Speech (MeloTTS)"
description = "Provide input text, and the model will convert it into speech."
interface = gr.Interface(
fn=text_to_speech,
inputs=gr.Textbox(label="Input Text", placeholder="Type something..."),
outputs=gr.Audio(label="Generated Speech"),
title=title,
description=description,
)
if __name__ == "__main__":
interface.launch()