Tirath5504 commited on
Commit
83d8dae
1 Parent(s): 847b6ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,8 +1,10 @@
1
- from transformers import pipeline
2
  import gradio as gr
3
 
4
  model_id = "Tirath5504/distilhubert-finetuned-gtzan"
5
- pipe = pipeline("audio-classification", model=model_id)
 
 
6
 
7
  def classify_audio(filepath):
8
  preds = pipe(filepath)
 
1
+ from transformers import pipeline, Wav2Vec2Processor, Wav2Vec2ForSequenceClassification
2
  import gradio as gr
3
 
4
  model_id = "Tirath5504/distilhubert-finetuned-gtzan"
5
+ processor = Wav2Vec2Processor.from_pretrained(model_id)
6
+ model = Wav2Vec2ForSequenceClassification.from_pretrained(model_id)
7
+ pipe = pipeline("audio-classification", model=model, processor=processor)
8
 
9
  def classify_audio(filepath):
10
  preds = pipe(filepath)