Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import sklearn
|
3 |
+
import joblib
|
4 |
+
|
5 |
+
model = joblib.load("snare_kick_classifier.joblib")
|
6 |
+
|
7 |
+
def classify(audio):
|
8 |
+
return model.predict([audio])[0]
|
9 |
+
|
10 |
+
gr.Interface(fn=classify,
|
11 |
+
inputs=gr.inputs.Audio(source="microphone", type="file", label="Audio"),
|
12 |
+
outputs="text",
|
13 |
+
title="Kick or Snare?",
|
14 |
+
description="A simple classifier that tells you whether the sound you're playing is a kick or a snare.",
|
15 |
+
).launch()
|