KhadgaA commited on
Commit
c25f63a
·
1 Parent(s): b371462

Fix padding issue in preprocess function

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -84,7 +84,11 @@ def preprocess(y,sr ):
84
  X = np.concatenate((f1, f2, f3), axis = 1)
85
  # Pad the array
86
  padding_rows = 448-len(X)
87
- X = np.vstack(( X, np.zeros((padding_rows, 15))))
 
 
 
 
88
 
89
  X_3D = np.expand_dims(X, axis=0)
90
 
 
84
  X = np.concatenate((f1, f2, f3), axis = 1)
85
  # Pad the array
86
  padding_rows = 448-len(X)
87
+
88
+ if padding_rows < 0:
89
+ X = X[:448, :15]
90
+ if padding_rows > 0:
91
+ X = np.vstack(( X, np.zeros((padding_rows, 15))))
92
 
93
  X_3D = np.expand_dims(X, axis=0)
94