terry-li-hm
commited on
Commit
·
94ef5c0
1
Parent(s):
41257f9
U2
Browse files
app.py
CHANGED
@@ -46,14 +46,14 @@ def launch():
|
|
46 |
gr.Markdown("## Try an example:")
|
47 |
|
48 |
# Define components
|
49 |
-
|
50 |
-
|
51 |
|
52 |
# Place the Examples component first
|
53 |
gr.Examples(
|
54 |
examples=[["example/scb.mp3"]],
|
55 |
-
inputs=[
|
56 |
-
outputs=
|
57 |
fn=lambda x: model_inference(x, "yue"),
|
58 |
examples_per_page=1,
|
59 |
)
|
@@ -61,17 +61,17 @@ def launch():
|
|
61 |
# Main interface
|
62 |
with gr.Row():
|
63 |
with gr.Column(scale=2):
|
64 |
-
|
65 |
fn_button = gr.Button("Process Audio", variant="primary")
|
66 |
|
67 |
with gr.Column(scale=3):
|
68 |
-
|
69 |
|
70 |
# Set up event handler
|
71 |
fn_button.click(
|
72 |
fn=lambda x: model_inference(x, "yue"),
|
73 |
-
inputs=[
|
74 |
-
outputs=[
|
75 |
)
|
76 |
|
77 |
demo.launch()
|
|
|
46 |
gr.Markdown("## Try an example:")
|
47 |
|
48 |
# Define components
|
49 |
+
audio_input = gr.Audio(label="Input")
|
50 |
+
text_output = gr.Textbox(lines=10, label="Output")
|
51 |
|
52 |
# Place the Examples component first
|
53 |
gr.Examples(
|
54 |
examples=[["example/scb.mp3"]],
|
55 |
+
inputs=[audio_input],
|
56 |
+
outputs=[text_output],
|
57 |
fn=lambda x: model_inference(x, "yue"),
|
58 |
examples_per_page=1,
|
59 |
)
|
|
|
61 |
# Main interface
|
62 |
with gr.Row():
|
63 |
with gr.Column(scale=2):
|
64 |
+
audio_input
|
65 |
fn_button = gr.Button("Process Audio", variant="primary")
|
66 |
|
67 |
with gr.Column(scale=3):
|
68 |
+
text_output
|
69 |
|
70 |
# Set up event handler
|
71 |
fn_button.click(
|
72 |
fn=lambda x: model_inference(x, "yue"),
|
73 |
+
inputs=[audio_input],
|
74 |
+
outputs=[text_output],
|
75 |
)
|
76 |
|
77 |
demo.launch()
|