Update README.md
Browse files
README.md
CHANGED
@@ -34,7 +34,6 @@ import torch
|
|
34 |
import IPython.display as ipd
|
35 |
|
36 |
def redistribute_codes(row):
|
37 |
-
row = row[row > 128266]
|
38 |
row_length = row.size(0)
|
39 |
new_length = (row_length // 7) * 7
|
40 |
trimmed_row = row[:new_length]
|
@@ -53,9 +52,14 @@ def redistribute_codes(row):
|
|
53 |
|
54 |
with torch.no_grad():
|
55 |
|
56 |
-
codes = [torch.concat(layer_1)
|
57 |
-
torch.concat(layer_2)
|
58 |
-
torch.concat(layer_3)
|
|
|
|
|
|
|
|
|
|
|
59 |
audio_hat = snac_model.decode(codes)
|
60 |
return audio_hat.cpu()[0, 0]
|
61 |
|
|
|
34 |
import IPython.display as ipd
|
35 |
|
36 |
def redistribute_codes(row):
|
|
|
37 |
row_length = row.size(0)
|
38 |
new_length = (row_length // 7) * 7
|
39 |
trimmed_row = row[:new_length]
|
|
|
52 |
|
53 |
with torch.no_grad():
|
54 |
|
55 |
+
codes = [torch.concat(layer_1),
|
56 |
+
torch.concat(layer_2),
|
57 |
+
torch.concat(layer_3)]
|
58 |
+
|
59 |
+
for i in range(len(codes)):
|
60 |
+
codes[i][codes[i] < 0] = 0
|
61 |
+
codes[i] = codes[i][None]
|
62 |
+
|
63 |
audio_hat = snac_model.decode(codes)
|
64 |
return audio_hat.cpu()[0, 0]
|
65 |
|