Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,8 +71,8 @@ dtype = 'bfloat16'
|
|
| 71 |
ptdtype = {'bfloat16': torch.bfloat16, 'float16': torch.float16}[dtype]
|
| 72 |
ctx = torch.amp.autocast(device_type=device_type, dtype=ptdtype)
|
| 73 |
|
| 74 |
-
SEQ_LEN =
|
| 75 |
-
PAD_IDX =
|
| 76 |
|
| 77 |
model = TransformerWrapper(num_tokens = PAD_IDX+1,
|
| 78 |
max_seq_len = SEQ_LEN,
|
|
@@ -210,7 +210,7 @@ def Generate_Chords_Textures(input_midi,
|
|
| 210 |
else:
|
| 211 |
seq = [705] + chords[:128] + [706]
|
| 212 |
|
| 213 |
-
x = torch.LongTensor(seq).
|
| 214 |
|
| 215 |
with ctx:
|
| 216 |
out = model.generate(x,
|
|
|
|
| 71 |
ptdtype = {'bfloat16': torch.bfloat16, 'float16': torch.float16}[dtype]
|
| 72 |
ctx = torch.amp.autocast(device_type=device_type, dtype=ptdtype)
|
| 73 |
|
| 74 |
+
SEQ_LEN = 8192
|
| 75 |
+
PAD_IDX = 18819
|
| 76 |
|
| 77 |
model = TransformerWrapper(num_tokens = PAD_IDX+1,
|
| 78 |
max_seq_len = SEQ_LEN,
|
|
|
|
| 210 |
else:
|
| 211 |
seq = [705] + chords[:128] + [706]
|
| 212 |
|
| 213 |
+
x = torch.LongTensor(seq).to(device_type)
|
| 214 |
|
| 215 |
with ctx:
|
| 216 |
out = model.generate(x,
|