Spaces:
Running
Running
futurespyhi
commited on
Commit
·
fbd7a0f
1
Parent(s):
15151e4
add debuging for npy files
Browse files- YuE/inference/infer.py +19 -0
YuE/inference/infer.py
CHANGED
|
@@ -420,6 +420,12 @@ os.makedirs(recons_mix_dir, exist_ok=True)
|
|
| 420 |
tracks = []
|
| 421 |
for npy in stage2_result:
|
| 422 |
codec_result = np.load(npy)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 423 |
decodec_rlt=[]
|
| 424 |
with torch.no_grad():
|
| 425 |
decoded_waveform = codec_model.decode(torch.as_tensor(codec_result.astype(np.int16), dtype=torch.long).unsqueeze(0).permute(1, 0, 2).to(device))
|
|
@@ -457,6 +463,19 @@ os.makedirs(vocoder_stems_dir, exist_ok=True)
|
|
| 457 |
vocal_output = None
|
| 458 |
instrumental_output = None
|
| 459 |
for npy in stage2_result:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 460 |
if '_itrack' in npy:
|
| 461 |
# Process instrumental
|
| 462 |
instrumental_output = process_audio(
|
|
|
|
| 420 |
tracks = []
|
| 421 |
for npy in stage2_result:
|
| 422 |
codec_result = np.load(npy)
|
| 423 |
+
print(f"Processing {npy}")
|
| 424 |
+
print(f" Shape: {npy_data.shape}")
|
| 425 |
+
print(f" Min/Max: {npy_data.min()}/{npy_data.max()}")
|
| 426 |
+
print(f" Non-zero: {np.count_nonzero(npy_data)}/{npy_data.size}")
|
| 427 |
+
print(f" Mean: {npy_data.mean():.4f}")
|
| 428 |
+
print("---")
|
| 429 |
decodec_rlt=[]
|
| 430 |
with torch.no_grad():
|
| 431 |
decoded_waveform = codec_model.decode(torch.as_tensor(codec_result.astype(np.int16), dtype=torch.long).unsqueeze(0).permute(1, 0, 2).to(device))
|
|
|
|
| 463 |
vocal_output = None
|
| 464 |
instrumental_output = None
|
| 465 |
for npy in stage2_result:
|
| 466 |
+
# Debug: Check .npy file content
|
| 467 |
+
npy_data = np.load(npy)
|
| 468 |
+
print(f"Processing {npy}")
|
| 469 |
+
print(f" Shape: {npy_data.shape}")
|
| 470 |
+
print(f" Data type: {npy_data.dtype}")
|
| 471 |
+
print(f" Min value: {npy_data.min()}")
|
| 472 |
+
print(f" Max value: {npy_data.max()}")
|
| 473 |
+
print(f" Mean value: {npy_data.mean():.4f}")
|
| 474 |
+
print(f" Std value: {npy_data.std():.4f}")
|
| 475 |
+
print(f" Non-zero elements: {np.count_nonzero(npy_data)}/{npy_data.size}")
|
| 476 |
+
print(f" First few values: {npy_data.flatten()[:10]}")
|
| 477 |
+
print("---")
|
| 478 |
+
|
| 479 |
if '_itrack' in npy:
|
| 480 |
# Process instrumental
|
| 481 |
instrumental_output = process_audio(
|