Upload 3 files
Browse files- README.md +15 -14
- app.py +17 -0
- requirements.txt +4 -0
README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
license: apache-2.0
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Kurdish TTS
|
| 3 |
+
emoji: ๐
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "4.24.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# ๐ Kurdish TTS (Text-to-Speech)
|
| 14 |
+
|
| 15 |
+
Enter text and get synthesized speech audio using a pre-trained Coqui TTS model.
|
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
tts = pipeline("text-to-speech", model="ttscoqui/universal-libritts")
|
| 5 |
+
|
| 6 |
+
def synthesize(text):
|
| 7 |
+
audio = tts(text)["wav"]
|
| 8 |
+
# The pipeline returns numpy array, Gradio needs filepath or array + sample rate tuple
|
| 9 |
+
return (tts.feature_extractor.sampling_rate, audio)
|
| 10 |
+
|
| 11 |
+
gr.Interface(
|
| 12 |
+
fn=synthesize,
|
| 13 |
+
inputs=gr.Textbox(lines=3, placeholder="Enter text here..."),
|
| 14 |
+
outputs=gr.Audio(type="numpy"),
|
| 15 |
+
title="TTS Demo",
|
| 16 |
+
description="Enter text and get speech synthesis from Coqui TTS model."
|
| 17 |
+
).launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers
|
| 2 |
+
gradio
|
| 3 |
+
torch
|
| 4 |
+
soundfile
|