Spaces:
Sleeping
Sleeping
DanielDBGC
commited on
Commit
·
5652706
1
Parent(s):
b653999
path
Browse files
app.py
CHANGED
@@ -6,14 +6,13 @@ from transformers import pipeline
|
|
6 |
pipeline = pipeline("audio-classification", model="DanielDBGC/my_awesome_lang_class_mind_model")
|
7 |
|
8 |
def predict(input_sound):
|
9 |
-
|
10 |
-
predictions = pipeline(input_sound[1])
|
11 |
return {p["label"]: p["score"] for p in predictions}
|
12 |
|
13 |
gradio_app = gr.Interface(
|
14 |
-
predict,
|
15 |
-
inputs= [gr.Audio(label="Record or upload someone speaking!", sources=['upload', 'microphone'], type
|
16 |
-
outputs=[gr.Label(label="Result", num_top_classes=3)],
|
17 |
title="Guess the language!",
|
18 |
)
|
19 |
|
|
|
6 |
pipeline = pipeline("audio-classification", model="DanielDBGC/my_awesome_lang_class_mind_model")
|
7 |
|
8 |
def predict(input_sound):
|
9 |
+
predictions = pipeline(input_sound)
|
|
|
10 |
return {p["label"]: p["score"] for p in predictions}
|
11 |
|
12 |
gradio_app = gr.Interface(
|
13 |
+
fn = predict,
|
14 |
+
inputs= [gr.Audio(label="Record or upload someone speaking!", sources=['upload', 'microphone'], type="filepath")],
|
15 |
+
outputs= [gr.Label(label="Result", num_top_classes=3)],
|
16 |
title="Guess the language!",
|
17 |
)
|
18 |
|