Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,11 +123,12 @@ def GenerateMIDI(num_tok, idrums, iinstr):
|
|
| 123 |
inp = torch.LongTensor([outy]).cuda()
|
| 124 |
|
| 125 |
with torch.amp.autocast(device_type='cuda', dtype=torch.bfloat16):
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
| 131 |
|
| 132 |
out0 = out[0].tolist()
|
| 133 |
outy.extend(out0)
|
|
|
|
| 123 |
inp = torch.LongTensor([outy]).cuda()
|
| 124 |
|
| 125 |
with torch.amp.autocast(device_type='cuda', dtype=torch.bfloat16):
|
| 126 |
+
with torch.inference_mode():
|
| 127 |
+
out = model.module.generate(inp,
|
| 128 |
+
1,
|
| 129 |
+
temperature=0.9,
|
| 130 |
+
return_prime=False,
|
| 131 |
+
verbose=False)
|
| 132 |
|
| 133 |
out0 = out[0].tolist()
|
| 134 |
outy.extend(out0)
|