Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,10 @@ from scipy.io.wavfile import write as write_wav
|
|
4 |
import tempfile
|
5 |
import torch
|
6 |
from numpy.core.multiarray import scalar
|
|
|
7 |
|
8 |
-
# Add NumPy scalar to safe globals to fix UnpicklingError
|
9 |
-
torch.serialization.add_safe_globals([scalar])
|
10 |
|
11 |
# Preload the models at startup
|
12 |
preload_models()
|
|
|
4 |
import tempfile
|
5 |
import torch
|
6 |
from numpy.core.multiarray import scalar
|
7 |
+
import numpy
|
8 |
|
9 |
+
# Add NumPy scalar and dtype to safe globals to fix UnpicklingError
|
10 |
+
torch.serialization.add_safe_globals([scalar, numpy.dtype])
|
11 |
|
12 |
# Preload the models at startup
|
13 |
preload_models()
|