| 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() | |