Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load a reliable text-to-speech pipeline
|
5 |
+
text_to_speech = pipeline("text-to-speech", model="facebook/fastspeech2-en-ljspeech", framework="pt")
|
6 |
+
|
7 |
+
def generate_speech(text):
|
8 |
+
output = text_to_speech(text)
|
9 |
+
return output["audio"]
|
10 |
+
|
11 |
+
gr.Interface(fn=generate_speech, inputs="text", outputs="audio", title="Simple Voice Assistant").launch()
|