Commit
·
c8b06c0
1
Parent(s):
3e600ab
debugging handling mp3
Browse files
app.py
CHANGED
|
@@ -49,12 +49,14 @@ def separate_all_stems(audio_file_path: str, model_name: str):
|
|
| 49 |
if signal.num_channels == 1:
|
| 50 |
signal = signal.convert_to(stereo=True)
|
| 51 |
|
| 52 |
-
waveform = torch.
|
| 53 |
-
|
|
|
|
| 54 |
with torch.no_grad():
|
| 55 |
stems_batch = apply_model(
|
| 56 |
model,
|
| 57 |
-
waveform.unsqueeze(0).to(next(model.parameters()).device),
|
|
|
|
| 58 |
overlap=0.2,
|
| 59 |
shifts=1,
|
| 60 |
split=True,
|
|
|
|
| 49 |
if signal.num_channels == 1:
|
| 50 |
signal = signal.convert_to(stereo=True)
|
| 51 |
|
| 52 |
+
waveform = torch.from_numpy(signal.audio_data).float() # [channels, samples]
|
| 53 |
+
waveform = waveform.unsqueeze(0) # [1, channels, samples]
|
| 54 |
+
|
| 55 |
with torch.no_grad():
|
| 56 |
stems_batch = apply_model(
|
| 57 |
model,
|
| 58 |
+
#waveform.unsqueeze(0).to(next(model.parameters()).device),
|
| 59 |
+
waveform.to(next(model.parameters()).device),
|
| 60 |
overlap=0.2,
|
| 61 |
shifts=1,
|
| 62 |
split=True,
|