brentspell commited on
Commit
3660947
1 Parent(s): bd1f0fe

fix problem with mono and no channels

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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