asigalov61
commited on
Commit
•
2dceebe
1
Parent(s):
53468ff
Update app.py
Browse files
app.py
CHANGED
@@ -81,11 +81,14 @@ def GenerateSong(input_melody_seed_number):
|
|
81 |
x = (torch.tensor(seed_melody, dtype=torch.long, device='cuda')[None, ...])
|
82 |
|
83 |
with ctx:
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
89 |
|
90 |
output = out[0].tolist()
|
91 |
|
|
|
81 |
x = (torch.tensor(seed_melody, dtype=torch.long, device='cuda')[None, ...])
|
82 |
|
83 |
with ctx:
|
84 |
+
with torch.inference_mode()
|
85 |
+
out = model.generate(x,
|
86 |
+
1024,
|
87 |
+
filter_logits_fn=top_k,
|
88 |
+
filter_kwargs={'k': 15},
|
89 |
+
temperature=0.9,
|
90 |
+
return_prime=False,
|
91 |
+
verbose=False)
|
92 |
|
93 |
output = out[0].tolist()
|
94 |
|