Spaces:
Runtime error
Runtime error
m4jbz
commited on
Commit
•
25441a4
1
Parent(s):
2f74d5b
idk
Browse files
app.py
CHANGED
@@ -29,19 +29,28 @@ import soundfile as sf
|
|
29 |
|
30 |
from model import get_pretrained_model, language_to_models
|
31 |
|
32 |
-
title = "#
|
33 |
|
34 |
description = """
|
35 |
-
|
36 |
|
37 |
-
|
38 |
|
39 |
-
|
40 |
|
41 |
- <https://github.com/k2-fsa/sherpa-onnx>
|
42 |
|
43 |
-
|
44 |
-
<https://
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
"""
|
47 |
|
@@ -148,12 +157,21 @@ with demo:
|
|
148 |
)
|
149 |
|
150 |
with gr.Tabs():
|
151 |
-
with gr.TabItem("
|
152 |
input_text = gr.Textbox(
|
153 |
-
label="
|
154 |
-
info="
|
155 |
lines=3,
|
156 |
-
placeholder="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
)
|
158 |
|
159 |
input_speed = gr.Slider(
|
@@ -161,21 +179,38 @@ with demo:
|
|
161 |
maximum=10,
|
162 |
value=1,
|
163 |
step=0.1,
|
164 |
-
label="
|
165 |
)
|
166 |
|
167 |
-
input_button = gr.Button("
|
168 |
|
169 |
-
output_audio = gr.Audio(label="
|
170 |
|
171 |
output_info = gr.HTML(label="Info")
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
input_button.click(
|
174 |
process,
|
175 |
inputs=[
|
176 |
language_radio,
|
177 |
model_dropdown,
|
178 |
input_text,
|
|
|
179 |
input_speed,
|
180 |
],
|
181 |
outputs=[
|
|
|
29 |
|
30 |
from model import get_pretrained_model, language_to_models
|
31 |
|
32 |
+
title = "# Next-gen Kaldi: Text-to-speech (TTS)"
|
33 |
|
34 |
description = """
|
35 |
+
This space shows how to convert text to speech with Next-gen Kaldi.
|
36 |
|
37 |
+
It is running on CPU within a docker container provided by Hugging Face.
|
38 |
|
39 |
+
See more information by visiting the following links:
|
40 |
|
41 |
- <https://github.com/k2-fsa/sherpa-onnx>
|
42 |
|
43 |
+
If you want to deploy it locally, please see
|
44 |
+
<https://k2-fsa.github.io/sherpa/>
|
45 |
+
|
46 |
+
If you want to use Android APKs, please see
|
47 |
+
<https://k2-fsa.github.io/sherpa/onnx/tts/apk.html>
|
48 |
+
|
49 |
+
If you want to use Android text-to-speech engine APKs, please see
|
50 |
+
<https://k2-fsa.github.io/sherpa/onnx/tts/apk-engine.html>
|
51 |
+
|
52 |
+
If you want to download an all-in-one exe for Windows, please see
|
53 |
+
<https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models>
|
54 |
|
55 |
"""
|
56 |
|
|
|
157 |
)
|
158 |
|
159 |
with gr.Tabs():
|
160 |
+
with gr.TabItem("Please input your text"):
|
161 |
input_text = gr.Textbox(
|
162 |
+
label="Input text",
|
163 |
+
info="Your text",
|
164 |
lines=3,
|
165 |
+
placeholder="Please input your text here",
|
166 |
+
)
|
167 |
+
|
168 |
+
input_sid = gr.Textbox(
|
169 |
+
label="Speaker ID",
|
170 |
+
info="Speaker ID",
|
171 |
+
lines=1,
|
172 |
+
max_lines=1,
|
173 |
+
value="0",
|
174 |
+
placeholder="Speaker ID. Valid only for mult-speaker model",
|
175 |
)
|
176 |
|
177 |
input_speed = gr.Slider(
|
|
|
179 |
maximum=10,
|
180 |
value=1,
|
181 |
step=0.1,
|
182 |
+
label="Speed (larger->faster; smaller->slower)",
|
183 |
)
|
184 |
|
185 |
+
input_button = gr.Button("Submit")
|
186 |
|
187 |
+
output_audio = gr.Audio(label="Output")
|
188 |
|
189 |
output_info = gr.HTML(label="Info")
|
190 |
|
191 |
+
gr.Examples(
|
192 |
+
examples=examples,
|
193 |
+
fn=process,
|
194 |
+
inputs=[
|
195 |
+
language_radio,
|
196 |
+
model_dropdown,
|
197 |
+
input_text,
|
198 |
+
input_sid,
|
199 |
+
input_speed,
|
200 |
+
],
|
201 |
+
outputs=[
|
202 |
+
output_audio,
|
203 |
+
output_info,
|
204 |
+
],
|
205 |
+
)
|
206 |
+
|
207 |
input_button.click(
|
208 |
process,
|
209 |
inputs=[
|
210 |
language_radio,
|
211 |
model_dropdown,
|
212 |
input_text,
|
213 |
+
input_sid,
|
214 |
input_speed,
|
215 |
],
|
216 |
outputs=[
|