Create app.py
Browse files
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()
|