Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,6 +70,9 @@ def image_qa_app(kbvqa):
|
|
70 |
image_data['analysis_done'] = True
|
71 |
|
72 |
if image_data['analysis_done']:
|
|
|
|
|
|
|
73 |
# Check if the question has already been asked
|
74 |
current_image_key = st.session_state.get('current_image_key')
|
75 |
question = st.text_input("Ask a question about this image:")
|
@@ -92,6 +95,9 @@ def image_qa_app(kbvqa):
|
|
92 |
# Display Q&A history
|
93 |
for q, a in qa_history:
|
94 |
st.text(f"Q: {q}\nA: {a}\n")
|
|
|
|
|
|
|
95 |
def process_new_image(image_key, image, kbvqa):
|
96 |
"""Process a new image and update the session state."""
|
97 |
if image_key not in st.session_state['images_data']:
|
|
|
70 |
image_data['analysis_done'] = True
|
71 |
|
72 |
if image_data['analysis_done']:
|
73 |
+
# Initialize qa_history
|
74 |
+
qa_history = []
|
75 |
+
|
76 |
# Check if the question has already been asked
|
77 |
current_image_key = st.session_state.get('current_image_key')
|
78 |
question = st.text_input("Ask a question about this image:")
|
|
|
95 |
# Display Q&A history
|
96 |
for q, a in qa_history:
|
97 |
st.text(f"Q: {q}\nA: {a}\n")
|
98 |
+
# Display Q&A history
|
99 |
+
for q, a in qa_history:
|
100 |
+
st.text(f"Q: {q}\nA: {a}\n")
|
101 |
def process_new_image(image_key, image, kbvqa):
|
102 |
"""Process a new image and update the session state."""
|
103 |
if image_key not in st.session_state['images_data']:
|