Update my_model/state_manager.py
Browse files
my_model/state_manager.py
CHANGED
@@ -282,7 +282,7 @@ class StateManager:
|
|
282 |
return caption, detected_objects_str, image_with_boxes
|
283 |
|
284 |
|
285 |
-
def add_to_qa_history(self, image_key, question, answer):
|
286 |
"""
|
287 |
Adds a question-answer pair to the QA history of a specific image, to be used as hitory tracker.
|
288 |
|
@@ -292,7 +292,7 @@ class StateManager:
|
|
292 |
answer (str): The answer generated by the KBVQA model.
|
293 |
"""
|
294 |
if image_key in st.session_state['images_data']:
|
295 |
-
st.session_state['images_data'][image_key]['qa_history'].append((question, answer))
|
296 |
|
297 |
|
298 |
def get_images_data(self):
|
|
|
282 |
return caption, detected_objects_str, image_with_boxes
|
283 |
|
284 |
|
285 |
+
def add_to_qa_history(self, image_key, question, answer, prompt_length):
|
286 |
"""
|
287 |
Adds a question-answer pair to the QA history of a specific image, to be used as hitory tracker.
|
288 |
|
|
|
292 |
answer (str): The answer generated by the KBVQA model.
|
293 |
"""
|
294 |
if image_key in st.session_state['images_data']:
|
295 |
+
st.session_state['images_data'][image_key]['qa_history'].append((question, answer, prompt_length))
|
296 |
|
297 |
|
298 |
def get_images_data(self):
|