bvallegc commited on
Commit
d5e6332
·
1 Parent(s): 97df2cd

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from transformers import pipeline
2
- import gradio as gr
 
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 = gr.interface(
31
- fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=[gr.outputs.Label()], **interface_options
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)