BOENE commited on
Commit
a0d3885
1 Parent(s): e709059

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def classify_audio(filepath):
4
+ preds = pipe(filepath)
5
+ outputs = {}
6
+ for p in preds:
7
+ outputs[p["label"]] = p["score"]
8
+ return outputs
9
+
10
+ demo = gr.Interface(
11
+ fn=classify_audio,
12
+ inputs=gr.Audio(type="filepath"),
13
+ outputs=gr.Label(),
14
+ live=True
15
+ )
16
+ demo.launch()