Spaces:
Sleeping
Sleeping
Update app.py
Browse filesChanging the input format
app.py
CHANGED
@@ -4,13 +4,13 @@ from transformers import pipeline
|
|
4 |
pipe = pipeline("audio-classification",
|
5 |
model="juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands")
|
6 |
|
7 |
-
def predict(
|
8 |
-
return pipe(
|
9 |
|
10 |
demo = gr.Interface(
|
11 |
title='Audio commands datection',
|
12 |
fn=predict,
|
13 |
-
inputs='
|
14 |
outputs='text',
|
15 |
)
|
16 |
|
|
|
4 |
pipe = pipeline("audio-classification",
|
5 |
model="juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands")
|
6 |
|
7 |
+
def predict(audio_path):
|
8 |
+
return pipe(audio_path)[0]["label"]
|
9 |
|
10 |
demo = gr.Interface(
|
11 |
title='Audio commands datection',
|
12 |
fn=predict,
|
13 |
+
inputs=gr.Audio(source="upload", type='filepath'),
|
14 |
outputs='text',
|
15 |
)
|
16 |
|