Spaces:
Runtime error
Runtime error
DewiBrynJones
commited on
Commit
•
403d26a
1
Parent(s):
be40fff
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,25 @@
|
|
1 |
import gradio as gr
|
2 |
-
import json
|
3 |
import pandas as pd
|
|
|
4 |
import collections
|
5 |
import scipy.signal
|
6 |
import numpy as np
|
|
|
7 |
from functools import partial
|
8 |
|
|
|
|
|
9 |
from openwakeword.model import Model
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
# Load openWakeWord models
|
12 |
model = Model(
|
13 |
inference_framework="onnx",
|
14 |
-
wakeword_models=["borah_da.onnx"], # can also leave this argument empty to load all of the included pre-trained models
|
15 |
)
|
16 |
|
17 |
# Define function to process audio
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import pandas as pd
|
3 |
+
import json
|
4 |
import collections
|
5 |
import scipy.signal
|
6 |
import numpy as np
|
7 |
+
|
8 |
from functools import partial
|
9 |
|
10 |
+
import importlib.resources as ir
|
11 |
+
|
12 |
from openwakeword.model import Model
|
13 |
|
14 |
+
# One-time download of all pre-trained models (or only select models)
|
15 |
+
with ir.path('openwakeword', 'resources') as oir:
|
16 |
+
if not oir.is_dir():
|
17 |
+
openwakeword.utils.download_models()
|
18 |
+
|
19 |
# Load openWakeWord models
|
20 |
model = Model(
|
21 |
inference_framework="onnx",
|
22 |
+
#wakeword_models=["borah_da.onnx"], # can also leave this argument empty to load all of the included pre-trained models
|
23 |
)
|
24 |
|
25 |
# Define function to process audio
|