Spaces:
Runtime error
Runtime error
SerenaTOUM
commited on
Create app.py
Browse files
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()
|