Yurii Paniv commited on
Commit
62c5e2c
1 Parent(s): d85340b

Add gradio demo

Browse files
Files changed (3) hide show
  1. README.md +11 -0
  2. app.py +27 -0
  3. requirements.txt +1 -0
README.md CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  # qirimli-tts
2
  Text-to-Speech for Crimean Tatar language
3
 
 
1
+ ---
2
+ title: Qirimli Tts
3
+ emoji: 🦀
4
+ colorFrom: gray
5
+ colorTo: red
6
+ sdk: gradio
7
+ sdk_version: 3.6
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
  # qirimli-tts
13
  Text-to-Speech for Crimean Tatar language
14
 
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from crh_transliterator.transliterator import transliterate
3
+ from crh_preprocessor.preprocessor import preprocess
4
+
5
+
6
+ def tts(text: str) -> str:
7
+ text = transliterate(text)
8
+ text = preprocess(text)
9
+ return text
10
+
11
+
12
+ iface = gr.Interface(
13
+ fn=tts,
14
+ inputs=[
15
+ gr.components.Textbox(
16
+ label="Input",
17
+ value="Please input your sentence.",
18
+ ),
19
+ ],
20
+ outputs="text",
21
+ examples=[
22
+ ["Selâm! İşler nasıl?"],
23
+ ["Sağlıqnen qalıñız! Sağlıqnen barıñız! "],
24
+ ["Селям! Ишлер насыл?"],
25
+ ],
26
+ )
27
+ iface.launch()
requirements.txt CHANGED
@@ -0,0 +1 @@
 
 
1
+ gradio==3.6