Commit
·
89e21ae
1
Parent(s):
5756e52
Revert "remove examples"
Browse filesThis reverts commit 5756e52bc24b57bbce297075494d336be3b05434.
app.py
CHANGED
@@ -59,6 +59,43 @@ css = """
|
|
59 |
.result_item_error {background-color:#ff7070;color:white;align-self:start}
|
60 |
"""
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
def update_model_dropdown(language: str):
|
64 |
if language in language_to_models:
|
@@ -155,6 +192,22 @@ with demo:
|
|
155 |
output_info = gr.HTML(label="Info")
|
156 |
output_textbox = gr.Textbox(label="Recognized speech from uploaded file")
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
upload_button.click(
|
159 |
process_uploaded_file,
|
160 |
inputs=[
|
|
|
59 |
.result_item_error {background-color:#ff7070;color:white;align-self:start}
|
60 |
"""
|
61 |
|
62 |
+
examples = [
|
63 |
+
[
|
64 |
+
"Chinese+English",
|
65 |
+
"csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28",
|
66 |
+
"midc2020-cui-bao-qiu.mp4",
|
67 |
+
],
|
68 |
+
[
|
69 |
+
"English",
|
70 |
+
"whisper-tiny.en",
|
71 |
+
"midc2020-daniel-povey.mp4",
|
72 |
+
],
|
73 |
+
[
|
74 |
+
"English",
|
75 |
+
"whisper-tiny.en",
|
76 |
+
"President-Obama-on-the-Importance-of-Education.mp4",
|
77 |
+
],
|
78 |
+
[
|
79 |
+
"English",
|
80 |
+
"whisper-tiny.en",
|
81 |
+
"jobs-at-stanford.mp4",
|
82 |
+
],
|
83 |
+
[
|
84 |
+
"English",
|
85 |
+
"yfyeung/icefall-asr-multidataset-pruned_transducer_stateless7-2023-05-04",
|
86 |
+
"obama's-message-for-america's-students.mp4",
|
87 |
+
],
|
88 |
+
]
|
89 |
+
|
90 |
+
for _, _, name in examples:
|
91 |
+
filename = get_file(
|
92 |
+
"csukuangfj/vad",
|
93 |
+
name,
|
94 |
+
subfolder=".",
|
95 |
+
)
|
96 |
+
|
97 |
+
shutil.copyfile(filename, name)
|
98 |
+
|
99 |
|
100 |
def update_model_dropdown(language: str):
|
101 |
if language in language_to_models:
|
|
|
192 |
output_info = gr.HTML(label="Info")
|
193 |
output_textbox = gr.Textbox(label="Recognized speech from uploaded file")
|
194 |
|
195 |
+
gr.Examples(
|
196 |
+
examples=examples,
|
197 |
+
inputs=[
|
198 |
+
language_radio,
|
199 |
+
model_dropdown,
|
200 |
+
uploaded_file,
|
201 |
+
],
|
202 |
+
outputs=[
|
203 |
+
output_video,
|
204 |
+
output_srt_file,
|
205 |
+
output_info,
|
206 |
+
output_textbox,
|
207 |
+
],
|
208 |
+
fn=process_uploaded_file,
|
209 |
+
)
|
210 |
+
|
211 |
upload_button.click(
|
212 |
process_uploaded_file,
|
213 |
inputs=[
|