Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,14 +2,17 @@ import gradio as gr
|
|
2 |
import numpy as np
|
3 |
from datasets import load_dataset
|
4 |
|
5 |
-
|
6 |
-
id2label =
|
7 |
|
8 |
|
9 |
def generate_audio():
|
10 |
-
example =
|
11 |
audio = example["audio"]
|
12 |
-
return (
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
with gr.Blocks() as demo:
|
|
|
2 |
import numpy as np
|
3 |
from datasets import load_dataset
|
4 |
|
5 |
+
minds = load_dataset("PolyAI/minds14", name="en-AU", split="train")
|
6 |
+
id2label = minds.features["intent_class"].int2str
|
7 |
|
8 |
|
9 |
def generate_audio():
|
10 |
+
example = minds.shuffle()[0]
|
11 |
audio = example["audio"]
|
12 |
+
return (
|
13 |
+
audio["sampling_rate"],
|
14 |
+
audio["array"],
|
15 |
+
), id2label(example["intent_class"])
|
16 |
|
17 |
|
18 |
with gr.Blocks() as demo:
|