huzey commited on
Commit
09abd2f
1 Parent(s): f548a71

empty cache

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -267,7 +267,10 @@ def ncut_run(
267
 
268
  def _ncut_run(*args, **kwargs):
269
  try:
270
- return ncut_run(*args, **kwargs)
 
 
 
271
  except Exception as e:
272
  gr.Error(str(e))
273
  return [], "Error: " + str(e)
 
267
 
268
  def _ncut_run(*args, **kwargs):
269
  try:
270
+ ret = ncut_run(*args, **kwargs)
271
+ if torch.cuda.is_available():
272
+ torch.cuda.empty_cache()
273
+ return ret
274
  except Exception as e:
275
  gr.Error(str(e))
276
  return [], "Error: " + str(e)