Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
colpali fix
Browse files
pages/Multimodal_Conversational_Search.py
CHANGED
|
@@ -280,15 +280,16 @@ def render_answer(question,answer,index,res_img):
|
|
| 280 |
rdn_key_1 = ''.join([random.choice(string.ascii_letters)
|
| 281 |
for _ in range(10)])
|
| 282 |
def show_maxsim():
|
| 283 |
-
st.session_state.answers_.pop()
|
| 284 |
-
st.session_state.questions_.pop()
|
| 285 |
st.session_state.show_columns = True
|
| 286 |
st.session_state.maxSimImages = colpali.img_highlight(st.session_state.top_img, st.session_state.query_token_vectors, st.session_state.query_tokens)
|
| 287 |
-
st.session_state.input_query = st.session_state.questions_[-1]["question"]
|
| 288 |
handle_input()
|
| 289 |
with placeholder.container():
|
| 290 |
-
render_all()
|
| 291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
if(st.session_state.input_is_colpali):
|
| 293 |
st.button("Show similarity map",key=rdn_key_1,on_click = show_maxsim)
|
| 294 |
|
|
|
|
| 280 |
rdn_key_1 = ''.join([random.choice(string.ascii_letters)
|
| 281 |
for _ in range(10)])
|
| 282 |
def show_maxsim():
|
|
|
|
|
|
|
| 283 |
st.session_state.show_columns = True
|
| 284 |
st.session_state.maxSimImages = colpali.img_highlight(st.session_state.top_img, st.session_state.query_token_vectors, st.session_state.query_tokens)
|
|
|
|
| 285 |
handle_input()
|
| 286 |
with placeholder.container():
|
| 287 |
+
render_all()
|
| 288 |
+
print("*"*20)
|
| 289 |
+
print(st.session_state.input_query)
|
| 290 |
+
print(st.session_state.answers_)
|
| 291 |
+
print(st.session_state.questions_)
|
| 292 |
+
print("*"*20)
|
| 293 |
if(st.session_state.input_is_colpali):
|
| 294 |
st.button("Show similarity map",key=rdn_key_1,on_click = show_maxsim)
|
| 295 |
|