fffiloni commited on
Commit
44b9114
·
1 Parent(s): 9ef2c85

Update imagic.py

Browse files
Files changed (1) hide show
  1. imagic.py +3 -1
imagic.py CHANGED
@@ -318,7 +318,9 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
318
 
319
  with torch.no_grad():
320
  torch.cuda.empty_cache()
321
- optimizer.step()
 
 
322
  optimizer.zero_grad()
323
 
324
  # Checks if the accelerator has performed an optimization step behind the scenes
 
318
 
319
  with torch.no_grad():
320
  torch.cuda.empty_cache()
321
+
322
+ with torch.no_grad():
323
+ optimizer.step()
324
  optimizer.zero_grad()
325
 
326
  # Checks if the accelerator has performed an optimization step behind the scenes