NeonBohdan commited on
Commit
16953a8
1 Parent(s): 6406f50

Use phrases from test cases

Browse files
Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -5,19 +5,7 @@ import gradio as gr
5
  from neon_tts_plugin_coqui import CoquiTTS
6
 
7
 
8
- language_phrases = {
9
- "en": "Hello, how are you?",
10
- "es": "¿Hola, cómo estás?",
11
- "fr": "Bonjour, comment vas-tu?",
12
- "de": "Hallo, wie geht's dir?",
13
- "pl": "Witam, jak się masz?",
14
- "uk": "Привіт, як твої справи?",
15
- "nl": "Hallo, hoe is het?",
16
- "hu": "Helló, hogy vagy?",
17
- "fi": "Hei, kuinka voit?",
18
- }
19
-
20
- LANGUAGES = list(language_phrases.keys())
21
 
22
 
23
 
@@ -49,7 +37,7 @@ with gr.Blocks() as blocks:
49
  with gr.Column():# variant="panel"
50
  textbox = gr.Textbox(
51
  label="Input",
52
- value="Hello, how are you?",
53
  max_lines=3,
54
  )
55
  radio = gr.Radio(
@@ -70,7 +58,7 @@ with gr.Blocks() as blocks:
70
  [textbox, radio],
71
  [audio],
72
  )
73
- radio.change(lambda lang: language_phrases[lang], radio, textbox)
74
 
75
 
76
 
 
5
  from neon_tts_plugin_coqui import CoquiTTS
6
 
7
 
8
+ LANGUAGES = list(CoquiTTS.langs.keys())
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
 
11
 
 
37
  with gr.Column():# variant="panel"
38
  textbox = gr.Textbox(
39
  label="Input",
40
+ value=CoquiTTS.langs["en"]["sentence"],
41
  max_lines=3,
42
  )
43
  radio = gr.Radio(
 
58
  [textbox, radio],
59
  [audio],
60
  )
61
+ radio.change(lambda lang: CoquiTTS.langs[lang]["sentence"], radio, textbox)
62
 
63
 
64