EOS-POS / app.py
Ahmed107's picture
Create app.py
d864aed verified
raw
history blame
447 Bytes
from transformers import pipeline
model_id = "Ahmed107/whisper-tiny-finetuned-eos"
pipe = pipeline("audio-classification", model=model_id)
def classify_audio(filepath):
preds = pipe(filepath)
outputs = {}
for p in preds:
outputs[p["label"]] = p["score"]
return outputs
import gradio as gr
demo = gr.Interface(
fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=gr.outputs.Label()
)
demo.launch(debug=True)