amedcj commited on
Commit
1a7c07d
ยท
verified ยท
1 Parent(s): c7c926b

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +15 -14
  2. app.py +17 -0
  3. requirements.txt +4 -0
README.md CHANGED
@@ -1,14 +1,15 @@
1
- ---
2
- title: Kmr Tts
3
- emoji: ๐ŸŒ–
4
- colorFrom: red
5
- colorTo: purple
6
- sdk: gradio
7
- sdk_version: 5.34.0
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- short_description: Kurdish TTS Servise
12
- ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
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