File size: 523 Bytes
b56cdac 0b0728d b56cdac b1f189e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from datasets import load_dataset
# mind=load_dataset("PolyAI/minds14", name="en-AU", split="train")
from transformers import pipeline
pipe=pipeline("audio-classification",
model="anton-l/xtreme_s_xlsr_300m_minds14"
)
import gradio as gr
def classify_speech(file):
pr=pipe(file)
outputs={}
for p in pr:
outputs[p["label"]]=p["score"]
return outputs
demo = gr.Interface(fn=classify_speech, inputs=gr.Audio(type='filepath'), outputs=gr.Label()
)
demo.launch(share=True)
|