ynhe commited on
Commit
1630d9e
·
1 Parent(s): 87ceef4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -99,8 +99,9 @@ def inference(video_path, input_tag, progress=gr.Progress()):
99
  frame_caption = ' '.join([f"Second {i+1}:{j}.\n" for i,j in enumerate(frame_caption_list)])
100
  dense_caption = ' '.join([f"Second {i+1} : {j}.\n" for (i,j) in dense_caption_list])
101
  del data, action_tensor, original_image, image,tmp,tmpa
102
- torch.cuda.empty_cache()
103
- torch.cuda.ipc_collect()
 
104
 
105
  return ' | '.join(tag_1),' | '.join(tag_2), frame_caption, dense_caption, synth_caption[0], gr.update(interactive = True), ','.join(set(prediction_list))
106
 
 
99
  frame_caption = ' '.join([f"Second {i+1}:{j}.\n" for i,j in enumerate(frame_caption_list)])
100
  dense_caption = ' '.join([f"Second {i+1} : {j}.\n" for (i,j) in dense_caption_list])
101
  del data, action_tensor, original_image, image,tmp,tmpa
102
+ if torch.cuda.is_available():
103
+ torch.cuda.empty_cache()
104
+ torch.cuda.ipc_collect()
105
 
106
  return ' | '.join(tag_1),' | '.join(tag_2), frame_caption, dense_caption, synth_caption[0], gr.update(interactive = True), ','.join(set(prediction_list))
107