Spaces:
Running
Running
handle audio with different shapes
Browse files
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[
|
33 |
-
audio = audio.mean(
|
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 |
|