Text-to-speech / app.py
SerenaTOUM's picture
Create app.py
ec54cef verified
raw
history blame contribute delete
499 Bytes
import gradio as gr
from transformers import pipeline
tts= pipeline("text-to-speech", model="facebook/wav2vec2-base-100h")
# Definissons la fonction pour la synthèse vocale
def text_to_speech(text_input):
audio_output = tts_model(text_input)
return audio_output[0]["audio"]
# Interface Gradio
app = gr.Interface(fn=text_to_speech, inputs="text", outputs="audio", title="Text-to-Speech", description="Convert your text into speech . Please , enter your text in english",
)
app.launch()