SerenaTOUM commited on
Commit
ec54cef
·
verified ·
1 Parent(s): dc0594a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ tts= pipeline("text-to-speech", model="facebook/wav2vec2-base-100h")
5
+
6
+ # Definissons la fonction pour la synthèse vocale
7
+ def text_to_speech(text_input):
8
+ audio_output = tts_model(text_input)
9
+ return audio_output[0]["audio"]
10
+
11
+ # Interface Gradio
12
+ 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",
13
+ )
14
+
15
+ app.launch()