asigalov61 commited on
Commit
773be3e
1 Parent(s): 413d048

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ def GenerateAccompaniment(input_midi, input_num_tokens, input_conditioning_type,
32
 
33
  SEQ_LEN = 8192 # Models seq len
34
  PAD_IDX = 707 # Models pad index
35
- DEVICE = 'cuda' # 'cuda'
36
 
37
  # instantiate the model
38
 
@@ -59,7 +59,7 @@ def GenerateAccompaniment(input_midi, input_num_tokens, input_conditioning_type,
59
  if DEVICE == 'cpu':
60
  dtype = torch.bfloat16
61
  else:
62
- dtype = torch.float16
63
 
64
  ctx = torch.amp.autocast(device_type=DEVICE, dtype=dtype)
65
 
@@ -226,7 +226,7 @@ def GenerateAccompaniment(input_midi, input_num_tokens, input_conditioning_type,
226
  if input_conditioning_type == 'Chords-Times-Durations':
227
  output.append(durs[idx])
228
 
229
- x = torch.tensor([output] * 1, dtype=torch.long, device='cuda')
230
 
231
  o = 0
232
 
 
32
 
33
  SEQ_LEN = 8192 # Models seq len
34
  PAD_IDX = 707 # Models pad index
35
+ DEVICE = 'cpu' # 'cuda'
36
 
37
  # instantiate the model
38
 
 
59
  if DEVICE == 'cpu':
60
  dtype = torch.bfloat16
61
  else:
62
+ dtype = torch.bfloat16
63
 
64
  ctx = torch.amp.autocast(device_type=DEVICE, dtype=dtype)
65
 
 
226
  if input_conditioning_type == 'Chords-Times-Durations':
227
  output.append(durs[idx])
228
 
229
+ x = torch.tensor([output] * 1, dtype=torch.long, device=DEVICE)
230
 
231
  o = 0
232