pchopalli commited on
Commit
b56cdac
·
verified ·
1 Parent(s): 62a3b79
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datasets import load_dataset
2
+ mind=load_dataset("PolyAI/minds14", name="en-AU", split="train")
3
+ from transformers import pipeline
4
+ pipe=pipeline("audio-classification",
5
+ model="anton-l/xtreme_s_xlsr_300m_minds14"
6
+ )
7
+ import gradio as gr
8
+ def classify_speech(file):
9
+ pr=pipe(file)
10
+ outputs={}
11
+ for p in pr:
12
+ outputs[p["label"]]=p["score"]
13
+ return outputs
14
+ demo = gr.Interface(fn=classify_speech, inputs=gr.Audio(type='filepath'), outputs=gr.Label()
15
+ )
16
+ demo.launch()