Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from transformers import pipeline
|
2 |
-
import gradio
|
|
|
3 |
|
4 |
username = 'bvallegc' ## Complete your username
|
5 |
model_id = f"{username}/distilhubert-finetuned-gtzan"
|
@@ -22,12 +23,11 @@ def classify_audio(filepath):
|
|
22 |
interface_options = {
|
23 |
"title": "Music Genre Classification",
|
24 |
"description": "The audio classifier for those who are the best and only want and require the best",
|
25 |
-
"interpretation": "default",
|
26 |
# Audio from validation file
|
27 |
"allow_flagging": "never"
|
28 |
}
|
29 |
|
30 |
-
demo =
|
31 |
-
fn=classify_audio, inputs=
|
32 |
)
|
33 |
demo.launch(debug=False)
|
|
|
1 |
from transformers import pipeline
|
2 |
+
import gradio
|
3 |
+
from gradio import Interface, Audio, Label, Number
|
4 |
|
5 |
username = 'bvallegc' ## Complete your username
|
6 |
model_id = f"{username}/distilhubert-finetuned-gtzan"
|
|
|
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 |
# Audio from validation file
|
27 |
"allow_flagging": "never"
|
28 |
}
|
29 |
|
30 |
+
demo = Interface(
|
31 |
+
fn=classify_audio, inputs= Audio(type="filepath"), outputs=[Label(), Number()], **interface_options
|
32 |
)
|
33 |
demo.launch(debug=False)
|