Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -15,8 +15,9 @@ from my_model.KBVQA import KBVQA, prepare_kbvqa_model
|
|
15 |
|
16 |
|
17 |
def answer_question(caption, detected_objects_str, question, model):
|
18 |
-
|
19 |
answer = model.generate_answer(question, caption, detected_objects_str)
|
|
|
20 |
return answer
|
21 |
|
22 |
|
|
|
15 |
|
16 |
|
17 |
def answer_question(caption, detected_objects_str, question, model):
|
18 |
+
free_gpu_resources()
|
19 |
answer = model.generate_answer(question, caption, detected_objects_str)
|
20 |
+
free_gpu_resources()
|
21 |
return answer
|
22 |
|
23 |
|