NeonBohdan commited on
Commit
b28fa4b
โ€ข
1 Parent(s): 2c967e5

Demo moved to Blocks

Browse files
Files changed (2) hide show
  1. README.md +1 -0
  2. app.py +36 -19
README.md CHANGED
@@ -4,6 +4,7 @@ emoji: ๐Ÿธ
4
  colorFrom: green
5
  colorTo: green
6
  sdk: gradio
 
7
  app_file: app.py
8
  pinned: false
9
  license: apache-2.0
 
4
  colorFrom: green
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 3.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -11,6 +11,12 @@ LANGUAGES = [
11
  "uk",
12
  ]
13
 
 
 
 
 
 
 
14
  coquiTTS = CoquiTTS()
15
 
16
 
@@ -23,22 +29,33 @@ def tts(text: str, language: str):
23
 
24
 
25
 
26
- iface = gr.Interface(
27
- fn=tts,
28
- inputs=[
29
- gr.inputs.Textbox(
30
- label="Input",
31
- default="Hello, how are you?",
32
- ),
33
- gr.inputs.Radio(
34
- label="Pick a Language",
35
- choices=LANGUAGES,
36
- ),
37
- ],
38
- outputs=gr.outputs.Audio(label="Output"),
39
- title="๐Ÿธ๐Ÿ’ฌ - NeonAI Coqui AI TTS Plugin",
40
- theme="huggingface",
41
- description="๐Ÿธ๐Ÿ’ฌ - a deep learning toolkit for Text-to-Speech, battle-tested in research and production",
42
- article="more info at https://github.com/coqui-ai/TTS",
43
- )
44
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
11
  "uk",
12
  ]
13
 
14
+ title = "๐Ÿธ๐Ÿ’ฌ - NeonAI Coqui AI TTS Plugin"
15
+ description = "๐Ÿธ๐Ÿ’ฌ - a deep learning toolkit for Text-to-Speech, battle-tested in research and production"
16
+ info = "more info at [Neon Coqui TTS Plugin](https://github.com/NeonGeckoCom/neon-tts-plugin-coqui), [Coqui TTS](https://github.com/coqui-ai/TTS)"
17
+
18
+
19
+
20
  coquiTTS = CoquiTTS()
21
 
22
 
 
29
 
30
 
31
 
32
+ with gr.Blocks() as blocks:
33
+ gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>"
34
+ + title
35
+ + "</h1>")
36
+ gr.Markdown(description)
37
+ with gr.Row():# equal_height=False
38
+ with gr.Column():# variant="panel"
39
+ textbox = gr.Textbox(
40
+ label="Input",
41
+ value="Hello, how are you?",
42
+ max_lines=3,
43
+ )
44
+ radio = gr.Radio(
45
+ label="Language",
46
+ choices=LANGUAGES,
47
+ )
48
+ with gr.Row():# mobile_collapse=False
49
+ submit = gr.Button("Submit", variant="primary")
50
+ audio = gr.Audio(label="Output", interactive=False)
51
+ gr.Markdown(info)
52
+
53
+ # actions
54
+ submit.click(
55
+ tts,
56
+ [textbox, radio],
57
+ [audio],
58
+ )
59
+
60
+
61
+ blocks.launch()