Spaces:
Build error
Build error
brentspell
commited on
Commit
•
d07be14
1
Parent(s):
012976e
add support for multichannel audio
Browse files
app.py
CHANGED
@@ -11,9 +11,9 @@ def extend(audio):
|
|
11 |
x = x.astype(np.float32) / 32767.0
|
12 |
|
13 |
with torch.no_grad():
|
14 |
-
y = model(torch.from_numpy(x), fs).
|
|
|
15 |
fs = int(model.sample_rate)
|
16 |
-
y = (y * 32767.0).astype(np.int16)
|
17 |
|
18 |
return fs, y
|
19 |
|
|
|
11 |
x = x.astype(np.float32) / 32767.0
|
12 |
|
13 |
with torch.no_grad():
|
14 |
+
y = np.stack([model(torch.from_numpy(x), fs) for x in x.T]).T
|
15 |
+
y = (y * 32767.0).astype(np.int16)
|
16 |
fs = int(model.sample_rate)
|
|
|
17 |
|
18 |
return fs, y
|
19 |
|