Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
# Use AI4Bharat IndicF5 model which supports Odia
|
| 5 |
+
tts = pipeline("text-to-speech", model="ai4bharat/IndicF5")
|
| 6 |
+
|
| 7 |
+
def generate_audio(text):
|
| 8 |
+
out = tts(text)
|
| 9 |
+
return (22050, out["audio"]) # return sample rate + audio
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=generate_audio,
|
| 13 |
+
inputs=gr.Textbox(label="Enter Odia Text", placeholder="ଓଡ଼ିଆରେ ଟେକ୍ସଟ୍ ଲେଖନ୍ତୁ"),
|
| 14 |
+
outputs=gr.Audio(label="Generated Speech"),
|
| 15 |
+
title="Open Odia TTS",
|
| 16 |
+
description="Type any Odia text and listen. Powered by AI4Bharat IndicF5."
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
demo.launch()
|