Spaces:
Runtime error
Runtime error
Vojta Fluger
commited on
Commit
·
18fa67c
1
Parent(s):
b4f0ec8
fixed crash error with audio
Browse files
app.py
CHANGED
|
@@ -85,9 +85,10 @@ class DancePredictor:
|
|
| 85 |
if waveform.ndim == 1:
|
| 86 |
waveform = np.stack([waveform, waveform]).T
|
| 87 |
waveform = torch.from_numpy(waveform.T)
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
| 91 |
|
| 92 |
waveform = torchaudio.functional.resample(
|
| 93 |
waveform, sample_rate, self.resample_frequency
|
|
|
|
| 85 |
if waveform.ndim == 1:
|
| 86 |
waveform = np.stack([waveform, waveform]).T
|
| 87 |
waveform = torch.from_numpy(waveform.T)
|
| 88 |
+
# Convert to proper format instead of using deprecated apply_codec
|
| 89 |
+
# The apply_codec was mainly used for format conversion, but since we're already
|
| 90 |
+
# working with tensor data, we can skip this step
|
| 91 |
+
waveform = waveform.float()
|
| 92 |
|
| 93 |
waveform = torchaudio.functional.resample(
|
| 94 |
waveform, sample_rate, self.resample_frequency
|