Update my_model/KBVQA.py
Browse files- 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 |
-
|
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 |
|