HKUST-Audio
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -42,7 +42,7 @@ model.eval().cuda()
|
|
42 |
|
43 |
|
44 |
wav, sr = sf.read("test.wav")
|
45 |
-
wav_tensor = torch.from_numpy(wav).float().unsqueeze(0)
|
46 |
|
47 |
|
48 |
with torch.no_grad():
|
@@ -51,7 +51,7 @@ with torch.no_grad():
|
|
51 |
vq_code = model.encode_code(input_waveform=wav_tensor)
|
52 |
print("Code:", vq_code )
|
53 |
|
54 |
-
recon_wav = model.decode_code(vq_code).cpu()
|
55 |
|
56 |
|
57 |
sf.write("reconstructed.wav", recon_wav[0, 0, :].numpy(), sr)
|
|
|
42 |
|
43 |
|
44 |
wav, sr = sf.read("test.wav")
|
45 |
+
wav_tensor = torch.from_numpy(wav).float().unsqueeze(0) # Shape: (1, T)
|
46 |
|
47 |
|
48 |
with torch.no_grad():
|
|
|
51 |
vq_code = model.encode_code(input_waveform=wav_tensor)
|
52 |
print("Code:", vq_code )
|
53 |
|
54 |
+
recon_wav = model.decode_code(vq_code).cpu() # Shape: (1, 1, T')
|
55 |
|
56 |
|
57 |
sf.write("reconstructed.wav", recon_wav[0, 0, :].numpy(), sr)
|