JMalott commited on
Commit
ce407a3
·
1 Parent(s): 27df13b

Update min_dalle/min_dalle.py

Browse files
Files changed (1) hide show
  1. min_dalle/min_dalle.py +2 -2
min_dalle/min_dalle.py CHANGED
@@ -241,7 +241,7 @@ class MinDalle:
241
 
242
  #torch.cuda.empty_cache()
243
  #torch.cpu.empty_cache()
244
- with torch.cuda.amp.autocast(dtype=torch.float16):
245
  image_tokens[i + 1], attention_state = self.decoder.forward(
246
  settings=settings,
247
  attention_mask=attention_mask,
@@ -252,7 +252,7 @@ class MinDalle:
252
  )
253
 
254
 
255
- with torch.cuda.amp.autocast(dtype=torch.float16):
256
  if ((i + 1) % 32 == 0 and progressive_outputs) or i + 1 == 256:
257
  yield self.image_grid_from_tokens(
258
  image_tokens=image_tokens[1:].T,
 
241
 
242
  #torch.cuda.empty_cache()
243
  #torch.cpu.empty_cache()
244
+ with torch.cpu.amp.autocast(dtype=torch.float16):
245
  image_tokens[i + 1], attention_state = self.decoder.forward(
246
  settings=settings,
247
  attention_mask=attention_mask,
 
252
  )
253
 
254
 
255
+ with torch.cpu.amp.autocast(dtype=torch.float16):
256
  if ((i + 1) % 32 == 0 and progressive_outputs) or i + 1 == 256:
257
  yield self.image_grid_from_tokens(
258
  image_tokens=image_tokens[1:].T,