Phung commited on
Commit
3a7c3d3
Β·
1 Parent(s): 29126a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -245,7 +245,9 @@ def inference(task, language_instruction, phrase_list, location_list, inpainting
245
  with torch.autocast(device_type='cuda', dtype=torch.float16):
246
  if task == 'User provide boxes' or 'Available boxes':
247
  if style_image == None:
248
- return grounded_generation_box(get_model('base'), instruction, *args, **kwargs)
 
 
249
  else:
250
  return grounded_generation_box(get_model('style'), instruction, *args, **kwargs)
251
 
 
245
  with torch.autocast(device_type='cuda', dtype=torch.float16):
246
  if task == 'User provide boxes' or 'Available boxes':
247
  if style_image == None:
248
+ result = grounded_generation_box(get_model('base'), instruction, *args, **kwargs)
249
+ torch.cuda.empty_cache()
250
+ return result
251
  else:
252
  return grounded_generation_box(get_model('style'), instruction, *args, **kwargs)
253