chuanli-lambda commited on
Commit
dc3964b
1 Parent(s): 1e22e27

Clear GPU memory cache so less likely to OOM

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -109,6 +109,9 @@ def run(*args):
109
 
110
  ims = sample(sampler, model, conds, 0*conds, scale, start_code, ddim_steps=steps)
111
  # return make_row(ims)
 
 
 
112
  return ims
113
 
114
 
 
109
 
110
  ims = sample(sampler, model, conds, 0*conds, scale, start_code, ddim_steps=steps)
111
  # return make_row(ims)
112
+
113
+ # Clear GPU memory cache so less likely to OOM
114
+ torch.cuda.empty_cache()
115
  return ims
116
 
117