Spaces:
Runtime error
Runtime error
Update app.py
Browse files71 unmodified lines72737475757677787979818081828385848586873 unmodified lines919293959495969771 unmodified lines
def classify_audio(filepath): start_time = timer() preds = pipe(filepath) # preds = predict_trunc(filepath) outputs = {} pred_time = round(timer() - start_time, 5) for p in preds: outputs[p["label"]] = p["score"], timer outputs[p["label"]] = p["score"] return outputs
title = "🎵 Music Genre Classifier"title = "Music Genre Classifier"description = """Demo for a music genre classifier trained on [GTZAN](https://huggingface.co/datasets/marsyas/gtzan)For more info checkout [GITHUB](https://github.com/AEscF)3 unmodified linesdemo = gr.Interface( fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=[gr.Label(label="Predictions"), gr.Number(label="Prediction time (s)")], outputs=[gr.Label(label="Predictions")], title=title, description=description, examples=filenames,app.py+4-5