terry-li-hm
commited on
Commit
·
1e836f3
1
Parent(s):
d3490a8
app.py
CHANGED
@@ -36,7 +36,7 @@ def model_inference(input_wav, language):
|
|
36 |
|
37 |
def launch():
|
38 |
# Create a custom theme
|
39 |
-
custom_theme = Base(text_color="rgb(70, 70, 70)")
|
40 |
|
41 |
with gr.Blocks(theme=custom_theme) as demo:
|
42 |
gr.Markdown("# Cantonese Call Transcriber")
|
@@ -55,13 +55,18 @@ def launch():
|
|
55 |
audio_input = gr.Audio(label="Input")
|
56 |
text_output = gr.Textbox(lines=10, label="Output")
|
57 |
|
58 |
-
#
|
|
|
|
|
|
|
|
|
59 |
gr.Examples(
|
60 |
examples=[["example/scb.mp3"]],
|
61 |
inputs=[audio_input],
|
62 |
outputs=[text_output],
|
63 |
fn=lambda x: model_inference(x, "yue"),
|
64 |
examples_per_page=1,
|
|
|
65 |
)
|
66 |
|
67 |
# Main interface
|
|
|
36 |
|
37 |
def launch():
|
38 |
# Create a custom theme
|
39 |
+
custom_theme = gr.themes.Base().set(text_color="rgb(70, 70, 70)")
|
40 |
|
41 |
with gr.Blocks(theme=custom_theme) as demo:
|
42 |
gr.Markdown("# Cantonese Call Transcriber")
|
|
|
55 |
audio_input = gr.Audio(label="Input")
|
56 |
text_output = gr.Textbox(lines=10, label="Output")
|
57 |
|
58 |
+
# Custom render function for Examples
|
59 |
+
def render_example(example):
|
60 |
+
return gr.Button("Try Example Audio")
|
61 |
+
|
62 |
+
# Update the Examples component
|
63 |
gr.Examples(
|
64 |
examples=[["example/scb.mp3"]],
|
65 |
inputs=[audio_input],
|
66 |
outputs=[text_output],
|
67 |
fn=lambda x: model_inference(x, "yue"),
|
68 |
examples_per_page=1,
|
69 |
+
render=render_example,
|
70 |
)
|
71 |
|
72 |
# Main interface
|