Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,9 @@ title = "Keyword Spotting Wav2Vec2"
|
|
10 |
description = "Gradio demo for finetuned Wav2Vec2 model on a custom dataset to perform keyword spotting task. Classes are scene 1, scene 2, scene 3, yes, no and stop."
|
11 |
|
12 |
def classify_audio(filepath):
|
13 |
-
preds = pipe(filepath
|
|
|
|
|
14 |
outputs = {}
|
15 |
for p in preds:
|
16 |
outputs[p["label"]] = p["score"]
|
@@ -27,11 +29,6 @@ mic_classify = gr.Interface(
|
|
27 |
outputs=gr.outputs.Label()
|
28 |
)
|
29 |
|
30 |
-
file_classify = gr.Interface(
|
31 |
-
fn=classify_audio,
|
32 |
-
inputs=gr.Audio(sources="upload", type="filepath"),
|
33 |
-
outputs=gr.outputs.Label()
|
34 |
-
)
|
35 |
|
36 |
with demo:
|
37 |
gr.TabbedInterface(
|
|
|
10 |
description = "Gradio demo for finetuned Wav2Vec2 model on a custom dataset to perform keyword spotting task. Classes are scene 1, scene 2, scene 3, yes, no and stop."
|
11 |
|
12 |
def classify_audio(filepath):
|
13 |
+
preds = pipe(filepath,
|
14 |
+
chunk_length_s=1,
|
15 |
+
)
|
16 |
outputs = {}
|
17 |
for p in preds:
|
18 |
outputs[p["label"]] = p["score"]
|
|
|
29 |
outputs=gr.outputs.Label()
|
30 |
)
|
31 |
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
with demo:
|
34 |
gr.TabbedInterface(
|