fffiloni commited on
Commit
2fadfd7
1 Parent(s): 8d74f2f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -0
main.py CHANGED
@@ -61,6 +61,7 @@ def setup(args):
61
  )
62
 
63
  torch.cuda.empty_cache() # Free up cached memory
 
64
 
65
  trainer = LatentNoiseTrainer(
66
  reward_losses=reward_losses,
@@ -79,6 +80,7 @@ def setup(args):
79
  )
80
 
81
  torch.cuda.empty_cache() # Free up cached memory
 
82
 
83
  # Create latents
84
  if args.model == "flux":
 
61
  )
62
 
63
  torch.cuda.empty_cache() # Free up cached memory
64
+ gc.collect()
65
 
66
  trainer = LatentNoiseTrainer(
67
  reward_losses=reward_losses,
 
80
  )
81
 
82
  torch.cuda.empty_cache() # Free up cached memory
83
+ gc.collect()
84
 
85
  # Create latents
86
  if args.model == "flux":