Spaces:
Runtime error
Runtime error
terry-li-hm
commited on
Commit
·
666f662
1
Parent(s):
103d57b
Update
Browse files
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("
|
| 47 |
-
text_outputs = gr.Textbox(label="Results")
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 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,
|