Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,13 +71,7 @@ pipe = pipeline("audio-classification", model=model_id, device=device)
|
|
| 71 |
|
| 72 |
|
| 73 |
def classify_audio(filepath):
|
| 74 |
-
|
| 75 |
-
Goes from
|
| 76 |
-
[{'score': 0.8339303731918335, 'label': 'country'},
|
| 77 |
-
{'score': 0.11914275586605072, 'label': 'rock'},]
|
| 78 |
-
to
|
| 79 |
-
{"country": 0.8339303731918335, "rock":0.11914275586605072}
|
| 80 |
-
"""
|
| 81 |
start_time = timer()
|
| 82 |
preds = pipe(filepath)
|
| 83 |
# preds = predict_trunc(filepath)
|
|
@@ -93,7 +87,7 @@ description = """
|
|
| 93 |
Demo for a music genre classifier trained on [GTZAN](https://huggingface.co/datasets/marsyas/gtzan)
|
| 94 |
For more info checkout [GITHUB](https://github.com/AEscF)
|
| 95 |
"""
|
| 96 |
-
filenames = ['
|
| 97 |
filenames = [[f"./{f}"] for f in filenames]
|
| 98 |
demo = gr.Interface(
|
| 99 |
fn=classify_audio,
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
def classify_audio(filepath):
|
| 74 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
start_time = timer()
|
| 76 |
preds = pipe(filepath)
|
| 77 |
# preds = predict_trunc(filepath)
|
|
|
|
| 87 |
Demo for a music genre classifier trained on [GTZAN](https://huggingface.co/datasets/marsyas/gtzan)
|
| 88 |
For more info checkout [GITHUB](https://github.com/AEscF)
|
| 89 |
"""
|
| 90 |
+
filenames = ['EN_0049.wav', "FR_0098.wav", "JP_0222.wav",]
|
| 91 |
filenames = [[f"./{f}"] for f in filenames]
|
| 92 |
demo = gr.Interface(
|
| 93 |
fn=classify_audio,
|