Spaces:
Sleeping
Sleeping
Update my_model/KBVQA.py
Browse files- my_model/KBVQA.py +3 -1
my_model/KBVQA.py
CHANGED
@@ -110,7 +110,9 @@ class KBVQA():
|
|
110 |
return p
|
111 |
|
112 |
|
113 |
-
def generate_answer(self, question,
|
|
|
|
|
114 |
prompt = self.format_prompt(question, caption=caption, objects=detected_objects_str)
|
115 |
num_tokens = len(self.kbvqa_tokenizer.tokenize(prompt))
|
116 |
if num_tokens > self.max_context_window:
|
|
|
110 |
return p
|
111 |
|
112 |
|
113 |
+
def generate_answer(self, question, image):
|
114 |
+
caption = self.get_caption(image)
|
115 |
+
image_with_boxes, detected_objects_str = self.detect_objects(image)
|
116 |
prompt = self.format_prompt(question, caption=caption, objects=detected_objects_str)
|
117 |
num_tokens = len(self.kbvqa_tokenizer.tokenize(prompt))
|
118 |
if num_tokens > self.max_context_window:
|