terry-li-hm commited on
Commit
666f662
·
1 Parent(s): 103d57b
Files changed (1) hide show
  1. app.py +17 -8
app.py CHANGED
@@ -35,22 +35,31 @@ def model_inference(input_wav, language):
35
 
36
  def launch():
37
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
 
 
38
  with gr.Row():
39
- with gr.Column():
 
40
  audio_inputs = gr.Audio(label="Upload audio or use the microphone")
41
  language_inputs = gr.Dropdown(
42
  choices=["auto", "zh", "en", "yue", "ja", "ko", "nospeech"],
43
  value="auto",
44
  label="Language",
45
  )
46
- fn_button = gr.Button("Start", variant="primary")
47
- text_outputs = gr.Textbox(label="Results")
48
 
49
- gr.Examples(
50
- examples=[["example/mtr.mp3", "yue"]],
51
- inputs=[audio_inputs, language_inputs],
52
- examples_per_page=20,
53
- )
 
 
 
 
 
 
 
54
 
55
  fn_button.click(
56
  model_inference,
 
35
 
36
  def launch():
37
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
38
+ gr.Markdown("# SenseVoice Audio Processing")
39
+
40
  with gr.Row():
41
+ with gr.Column(scale=2):
42
+ gr.Markdown("## Input")
43
  audio_inputs = gr.Audio(label="Upload audio or use the microphone")
44
  language_inputs = gr.Dropdown(
45
  choices=["auto", "zh", "en", "yue", "ja", "ko", "nospeech"],
46
  value="auto",
47
  label="Language",
48
  )
49
+ fn_button = gr.Button("Process Audio", variant="primary")
 
50
 
51
+ with gr.Column(scale=3):
52
+ gr.Markdown("## Output")
53
+ text_outputs = gr.Textbox(label="Results", lines=10)
54
+
55
+ with gr.Row():
56
+ gr.Markdown("## Examples")
57
+ gr.Examples(
58
+ examples=[["example/mtr.mp3", "yue"]],
59
+ inputs=[audio_inputs, language_inputs],
60
+ outputs=text_outputs,
61
+ fn=model_inference,
62
+ )
63
 
64
  fn_button.click(
65
  model_inference,