Tirath5504
commited on
Commit
•
83d8dae
1
Parent(s):
847b6ab
Update app.py
Browse files
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 |
-
|
|
|
|
|
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)
|