Spaces:
Running
Running
Commit
·
c90210a
1
Parent(s):
5861cfb
Update utils/tools.py
Browse files- utils/tools.py +2 -4
utils/tools.py
CHANGED
@@ -44,9 +44,7 @@ def load_wav(wav_path, sr=None):
|
|
44 |
|
45 |
"""
|
46 |
wav, fs = sf.read(wav_path)
|
47 |
-
|
48 |
-
print('The wav file %s has %d channels, select the first one to proceed.' %(wav_path, wav.ndim))
|
49 |
-
wav = wav[:,0]
|
50 |
assert sr is None or fs == sr, f'{sr} kHz audio is required. Got {fs}'
|
51 |
peak = np.abs(wav).max()
|
52 |
if peak > 1.0:
|
@@ -168,4 +166,4 @@ def load_checkpoint(model, optimizer, scheduler, checkpoint_path, load_only_para
|
|
168 |
steps = state_dict["steps"]
|
169 |
epochs = state_dict["epochs"]
|
170 |
|
171 |
-
return steps, epochs
|
|
|
44 |
|
45 |
"""
|
46 |
wav, fs = sf.read(wav_path)
|
47 |
+
assert wav.ndim == 1, 'Single-channel audio is required.'
|
|
|
|
|
48 |
assert sr is None or fs == sr, f'{sr} kHz audio is required. Got {fs}'
|
49 |
peak = np.abs(wav).max()
|
50 |
if peak > 1.0:
|
|
|
166 |
steps = state_dict["steps"]
|
167 |
epochs = state_dict["epochs"]
|
168 |
|
169 |
+
return steps, epochs
|