HenRick69 commited on
Commit
d9f05c7
1 Parent(s): 9890498

Update app.py

Browse files

New file structure

Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,3 +1,17 @@
1
  import gradio as gr
 
2
 
3
- gr.Interface.load("models/juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ pipe = pipeline("audio-classification",
5
+ model="juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands")
6
+
7
+ def predict(audio):
8
+ return pipe(audio)[0]["label"]
9
+
10
+ demo = gr.Interface(
11
+ title='Audio commands datection'
12
+ fn=predict,
13
+ inputs='audio',
14
+ outputs='text',
15
+ )
16
+
17
+ demo.launch()