m7mdal7aj commited on
Commit
1cdf777
1 Parent(s): 0d0bf71

Update my_model/KBVQA.py

Browse files
Files changed (1) hide show
  1. my_model/KBVQA.py +4 -1
my_model/KBVQA.py CHANGED
@@ -257,9 +257,12 @@ def prepare_kbvqa_model(only_reload_detection_model: bool = False, force_reload:
257
 
258
  if force_reload:
259
  loading_message = 'Force Reloading model.. this should take no more than a few minutes!'
260
- if kbvqa is not None:
261
  del kbvqa
 
262
  free_gpu_resources()
 
 
263
  free_gpu_resources()
264
  else: loading_message = 'Looading model.. this should take no more than a few minutes!'
265
 
 
257
 
258
  if force_reload:
259
  loading_message = 'Force Reloading model.. this should take no more than a few minutes!'
260
+ try:
261
  del kbvqa
262
+ except:
263
  free_gpu_resources()
264
+ pass
265
+
266
  free_gpu_resources()
267
  else: loading_message = 'Looading model.. this should take no more than a few minutes!'
268