FireRedTeam commited on
Commit
66d962d
·
1 Parent(s): 64bc319

update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -3
app.py CHANGED
@@ -1,7 +1,34 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  demo.launch()
 
1
  import gradio as gr
2
 
 
 
3
 
4
+ def asr_inference(audio_file):
5
+ if not audio_file:
6
+ return "Please upload a wav file"
7
+ model = None
8
+ text_output = "Developing " + audio_file
9
+ return text_output
10
+
11
+
12
+ with gr.Blocks(title="FireRedASR") as demo:
13
+ gr.HTML(
14
+ "<h1 style='text-align: center'>FireRedASR</h1>"
15
+ )
16
+ gr.Markdown("Upload an audio file (wav) to get speech-to-text results.")
17
+
18
+ with gr.Row():
19
+ with gr.Column():
20
+ audio_file = gr.Audio(label="Upload Audio", sources=["microphone", "upload"], type="filepath")
21
+ #audio_file = gr.Audio(label="Upload wav file", sources=["upload"], type="filepath")
22
+ asr_button = gr.Button("Start Recognition", variant="primary")
23
+
24
+ with gr.Column():
25
+ text_output = gr.Textbox(label="Model Result", interactive=False, lines=6, max_lines=12)
26
+
27
+ asr_button.click(
28
+ fn=asr_inference,
29
+ inputs=[audio_file],
30
+ outputs=[text_output]
31
+ )
32
+
33
+
34
  demo.launch()