Spaces:
Build error
Build error
fix problem with mono and no channels
Browse files
app.py
CHANGED
@@ -12,6 +12,8 @@ def extend(audio):
|
|
12 |
fs, x = audio
|
13 |
x = x[:int(MAX_LENGTH * fs)]
|
14 |
x = x.astype(np.float32) / 32767.0
|
|
|
|
|
15 |
|
16 |
with torch.no_grad():
|
17 |
y = np.stack([model(torch.from_numpy(x), fs) for x in x.T]).T
|
|
|
12 |
fs, x = audio
|
13 |
x = x[:int(MAX_LENGTH * fs)]
|
14 |
x = x.astype(np.float32) / 32767.0
|
15 |
+
if len(x.shape) == 1:
|
16 |
+
x = x[:, np.newaxis]
|
17 |
|
18 |
with torch.no_grad():
|
19 |
y = np.stack([model(torch.from_numpy(x), fs) for x in x.T]).T
|