Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +11 -1
- requirements.txt +2 -0
app.py
CHANGED
@@ -20,7 +20,17 @@ def classify_audio(filepath):
|
|
20 |
outputs[p["label"]] = p["score"]
|
21 |
return outputs
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
demo = gr.Interface(
|
24 |
-
fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=[gr.outputs.Label(), gr.Number(label="Prediction time (s)")]
|
25 |
)
|
26 |
demo.launch(debug=True)
|
|
|
20 |
outputs[p["label"]] = p["score"]
|
21 |
return outputs
|
22 |
|
23 |
+
interface_options = {
|
24 |
+
"title": "Music Genre Classification",
|
25 |
+
"description": "The audio classifier for those who are the best and only want and require the best",
|
26 |
+
"interpretation": "default",
|
27 |
+
"layout": "horizontal",
|
28 |
+
# Audio from validation file
|
29 |
+
"examples": ["000003.ogg", "000032.ogg", "000038.ogg", "000050.ogg", "000103.ogg"],
|
30 |
+
"allow_flagging": "never"
|
31 |
+
}
|
32 |
+
|
33 |
demo = gr.Interface(
|
34 |
+
fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=[gr.outputs.Label(), gr.Number(label="Prediction time (s)")], **interface_options
|
35 |
)
|
36 |
demo.launch(debug=True)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
git+https://github.com/huggingface/transformers
|