terry-li-hm commited on
Commit
94ef5c0
·
1 Parent(s): 41257f9
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -46,14 +46,14 @@ def launch():
46
  gr.Markdown("## Try an example:")
47
 
48
  # Define components
49
- audio_inputs = gr.Audio(label="Input", visible=False)
50
- text_outputs = gr.Textbox(lines=10, label="Output", visible=False)
51
 
52
  # Place the Examples component first
53
  gr.Examples(
54
  examples=[["example/scb.mp3"]],
55
- inputs=[audio_inputs],
56
- outputs=text_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
- gr.Audio(label="Input")
65
  fn_button = gr.Button("Process Audio", variant="primary")
66
 
67
  with gr.Column(scale=3):
68
- gr.Textbox(lines=10, label="Output")
69
 
70
  # Set up event handler
71
  fn_button.click(
72
  fn=lambda x: model_inference(x, "yue"),
73
- inputs=[audio_inputs],
74
- outputs=[text_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()