Spaces:
Sleeping
Sleeping
Update app.py
Browse filesNew file structure
app.py
CHANGED
@@ -1,3 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|