wrice commited on
Commit
c13028f
1 Parent(s): f74d062

handle audio with different shapes

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -29,8 +29,8 @@ def denoise(model_name, inputs):
29
  print(f"Audio shape: {audio.shape}")
30
  print(f"Sample rate: {sr}")
31
 
32
- if audio.shape[1] > 1:
33
- audio = audio.mean(1, keepdim=True)
34
 
35
  print(f"Audio shape: {audio.shape}")
36
 
 
29
  print(f"Audio shape: {audio.shape}")
30
  print(f"Sample rate: {sr}")
31
 
32
+ if audio.shape[0] > 1:
33
+ audio = audio.mean(0, keepdim=True)
34
 
35
  print(f"Audio shape: {audio.shape}")
36