asigalov61 commited on
Commit
2dceebe
1 Parent(s): 53468ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
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
- out = model.generate(x,
85
- 1024,
86
- temperature=0.9,
87
- return_prime=False,
88
- verbose=False)
 
 
 
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