Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def classify_audio(filepath):
|
|
15 |
{"country": 0.8339303731918335, "rock":0.11914275586605072}
|
16 |
"""
|
17 |
preds = pipe(filepath)
|
18 |
-
classification = [{"label": p["label"],
|
19 |
return {"classification": classification}
|
20 |
|
21 |
|
@@ -29,6 +29,6 @@ interface_options = {
|
|
29 |
}
|
30 |
|
31 |
demo = gr.Interface(
|
32 |
-
fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=[gr.outputs.Label()
|
33 |
)
|
34 |
demo.launch(debug=True)
|
|
|
15 |
{"country": 0.8339303731918335, "rock":0.11914275586605072}
|
16 |
"""
|
17 |
preds = pipe(filepath)
|
18 |
+
classification = [{"label": p["label"], "score": p["score"]} for p in preds]
|
19 |
return {"classification": classification}
|
20 |
|
21 |
|
|
|
29 |
}
|
30 |
|
31 |
demo = gr.Interface(
|
32 |
+
fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=[gr.outputs.Label()], **interface_options
|
33 |
)
|
34 |
demo.launch(debug=True)
|