cnzzx commited on
Commit
4751cc9
·
1 Parent(s): d2ca3e2
Files changed (1) hide show
  1. models/vsa_model.py +4 -1
models/vsa_model.py CHANGED
@@ -372,6 +372,7 @@ class VisionSearchAssistant:
372
 
373
  del self.grounder
374
  torch.cuda.empty_cache()
 
375
 
376
  # Visual Captioning
377
  self.vlm = VLM(
@@ -415,6 +416,7 @@ class VisionSearchAssistant:
415
 
416
  del self.vlm
417
  torch.cuda.empty_cache()
 
418
 
419
  # Web Searching
420
  contexts = self.searcher(queries)
@@ -442,4 +444,5 @@ class VisionSearchAssistant:
442
  yield answer, 'answer'
443
 
444
  del self.vlm
445
- torch.cuda.empty_cache()
 
 
372
 
373
  del self.grounder
374
  torch.cuda.empty_cache()
375
+ torch.cuda.synchronize()
376
 
377
  # Visual Captioning
378
  self.vlm = VLM(
 
416
 
417
  del self.vlm
418
  torch.cuda.empty_cache()
419
+ torch.cuda.synchronize()
420
 
421
  # Web Searching
422
  contexts = self.searcher(queries)
 
444
  yield answer, 'answer'
445
 
446
  del self.vlm
447
+ torch.cuda.empty_cache()
448
+ torch.cuda.synchronize()