asigalov61 commited on
Commit
3b31b54
1 Parent(s): ed62ab6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -206,12 +206,12 @@ def GenerateAccompaniment(input_midi, input_num_tokens, input_acc_type):
206
  output1 = []
207
  output2 = []
208
 
209
- cur_time = 0
210
 
211
  for m in melody_chords[:input_num_tokens]:
212
 
213
  mel = copy.deepcopy(m)
214
- mel[0] = mel[0]-cur_time
215
 
216
  output1.extend(mel)
217
 
@@ -225,6 +225,7 @@ def GenerateAccompaniment(input_midi, input_num_tokens, input_acc_type):
225
  time = input_seq[-2]-512
226
 
227
  cur_time = 0
 
228
 
229
  for _ in range(num_toks_per_note):
230
  with ctx:
@@ -240,6 +241,8 @@ def GenerateAccompaniment(input_midi, input_num_tokens, input_acc_type):
240
  cur_time += o
241
 
242
  if cur_time < time and o < 384:
 
 
243
 
244
  out = torch.LongTensor([[o]]).cuda()
245
  x = torch.cat((x, out), 1)
 
206
  output1 = []
207
  output2 = []
208
 
209
+ ctime = 0
210
 
211
  for m in melody_chords[:input_num_tokens]:
212
 
213
  mel = copy.deepcopy(m)
214
+ mel[0] = mel[0]-ctime
215
 
216
  output1.extend(mel)
217
 
 
225
  time = input_seq[-2]-512
226
 
227
  cur_time = 0
228
+ ctime = 0
229
 
230
  for _ in range(num_toks_per_note):
231
  with ctx:
 
241
  cur_time += o
242
 
243
  if cur_time < time and o < 384:
244
+
245
+ ctime = cur_time
246
 
247
  out = torch.LongTensor([[o]]).cuda()
248
  x = torch.cat((x, out), 1)