Mohamed Aymane Farhi commited on
Commit
828732e
1 Parent(s): 16ee3e4

Fix labels.

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -2,7 +2,14 @@
2
  from ttsmms import TTS
3
  import gradio as gr
4
 
5
- VARIANTS = ['shi', 'rif-script_latin', 'rif-script_arabic', 'kab', 'taq', 'ttq-script_tifinagh']
 
 
 
 
 
 
 
6
  MODELS = {}
7
 
8
  def tts(text, variant):
@@ -22,7 +29,7 @@ iface = gr.Interface(
22
  label="Text",
23
  default="Text to synthesize.",
24
  ),
25
- gr.inputs.Dropdown(label="Select a variant", choices=VARIANTS, default=VARIANTS[0])
26
  ],
27
  outputs=gr.outputs.Audio(label="Output", type="numpy"),
28
  examples=examples,
 
2
  from ttsmms import TTS
3
  import gradio as gr
4
 
5
+ ISO_CODES = {'Tachelhit': 'shi',
6
+ 'Tarifit (Latin script)': 'rif-script_latin',
7
+ 'Tarifit (Arabic script)': 'rif-script_arabic',
8
+ 'Taqbaylit': 'kab',
9
+ 'Tamasheq': 'taq',
10
+ 'Tamajaq, Tawallammat (Tifinagh script)': 'ttq-script_tifinagh'
11
+ }
12
+ VARIANTS = list(ISO_CODES.values())
13
  MODELS = {}
14
 
15
  def tts(text, variant):
 
29
  label="Text",
30
  default="Text to synthesize.",
31
  ),
32
+ gr.inputs.Dropdown(label="Variant", choices=ISO_CODES.values(), default=VARIANTS[0])
33
  ],
34
  outputs=gr.outputs.Audio(label="Output", type="numpy"),
35
  examples=examples,