Update app.py
Browse files
app.py
CHANGED
@@ -249,7 +249,7 @@ def generate_music(
|
|
249 |
with torch.no_grad():
|
250 |
decoded_waveform = codec_model.decode(
|
251 |
# Corrected line: Convert numpy array to PyTorch tensor with appropriate type
|
252 |
-
|
253 |
)
|
254 |
decoded_waveform = decoded_waveform.cpu().squeeze(0)
|
255 |
|
|
|
249 |
with torch.no_grad():
|
250 |
decoded_waveform = codec_model.decode(
|
251 |
# Corrected line: Convert numpy array to PyTorch tensor with appropriate type
|
252 |
+
torch.as_tensor(codec_result.astype(np.int16), dtype=torch.long).unsqueeze(0).permute(1, 0, 2).to(device)
|
253 |
)
|
254 |
decoded_waveform = decoded_waveform.cpu().squeeze(0)
|
255 |
|