create app.y
Browse files123456789101112131415161718import gradio as grfrom transformers import pipeline
# Load modelclassifier = pipeline("audio-classification", model="yourusername/keyword-spotting-model")
def predict(audio): preds = classifier(audio) return {p["label"]: p["score"] for p in preds}
# Gradio UIgr.Interface( fn=predict, inputs=gr.Audio(source="microphone", type="filepath"), outputs=gr.Label(num_top_classes=3), title="🔊 Keyword Spotting", examples=["example1.wav", "example2.wav"]).launch()app.pyAdded+18