Spaces:
Runtime error
Runtime error
create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load the model directly from Hugging Face Hub
|
5 |
+
tts_pipeline = pipeline("text-to-speech", model="Abhinay45/XTTS-Hindi-finetuned")
|
6 |
+
|
7 |
+
def text_to_speech(text):
|
8 |
+
speech = tts_pipeline(text)
|
9 |
+
return speech['audio']
|
10 |
+
|
11 |
+
# Create a Gradio interface
|
12 |
+
iface = gr.Interface(fn=text_to_speech,
|
13 |
+
inputs="text",
|
14 |
+
outputs="audio",
|
15 |
+
title="Text to Speech")
|
16 |
+
|
17 |
+
iface.launch()
|