Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
rerank model
Browse files
pages/Multimodal_Conversational_Search.py
CHANGED
|
@@ -216,14 +216,14 @@ def render_answer(question,answer,index,res_img):
|
|
| 216 |
# st.audio(polly_response['AudioStream'].read(), format="audio/ogg")
|
| 217 |
# rdn_key_1 = ''.join([random.choice(string.ascii_letters)
|
| 218 |
# for _ in range(10)])
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
|
| 228 |
colu1,colu2,colu3 = st.columns([4,82,20])
|
| 229 |
with colu2:
|
|
@@ -327,9 +327,8 @@ def render_all():
|
|
| 327 |
placeholder = st.empty()
|
| 328 |
with placeholder.container():
|
| 329 |
with st.spinner("Running search..."):
|
| 330 |
-
#handle_input()
|
| 331 |
render_all()
|
| 332 |
-
|
| 333 |
|
| 334 |
|
| 335 |
|
|
@@ -340,13 +339,6 @@ with col_2:
|
|
| 340 |
with col_3:
|
| 341 |
play = st.button("Go",on_click=handle_input, key="play")
|
| 342 |
|
| 343 |
-
# # ❗ Do NOT run anything here
|
| 344 |
-
# if play:
|
| 345 |
-
# st.session_state.trigger_search = True # mark to run on next rerun
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
|
| 351 |
##### Sidebar #####
|
| 352 |
with st.sidebar:
|
|
|
|
| 216 |
# st.audio(polly_response['AudioStream'].read(), format="audio/ogg")
|
| 217 |
# rdn_key_1 = ''.join([random.choice(string.ascii_letters)
|
| 218 |
# for _ in range(10)])
|
| 219 |
+
def show_maxsim():
|
| 220 |
+
st.session_state.show_columns = True
|
| 221 |
+
st.session_state.maxSimImages = colpali.img_highlight(st.session_state.top_img, st.session_state.query_token_vectors, st.session_state.query_tokens)
|
| 222 |
+
handle_input()
|
| 223 |
+
with placeholder.container():
|
| 224 |
+
render_all()
|
| 225 |
+
if(st.session_state.input_is_colpali):
|
| 226 |
+
st.button("Show similarity map",key=rdn_key_1,on_click = show_maxsim)
|
| 227 |
|
| 228 |
colu1,colu2,colu3 = st.columns([4,82,20])
|
| 229 |
with colu2:
|
|
|
|
| 327 |
placeholder = st.empty()
|
| 328 |
with placeholder.container():
|
| 329 |
with st.spinner("Running search..."):
|
|
|
|
| 330 |
render_all()
|
| 331 |
+
|
| 332 |
|
| 333 |
|
| 334 |
|
|
|
|
| 339 |
with col_3:
|
| 340 |
play = st.button("Go",on_click=handle_input, key="play")
|
| 341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
|
| 343 |
##### Sidebar #####
|
| 344 |
with st.sidebar:
|