Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
rerank model
Browse files
pages/Multimodal_Conversational_Search.py
CHANGED
|
@@ -161,6 +161,8 @@ def handle_input():
|
|
| 161 |
print("Question: "+st.session_state.input_query)
|
| 162 |
print("-----------")
|
| 163 |
print("\n\n")
|
|
|
|
|
|
|
| 164 |
inputs = {}
|
| 165 |
for key in st.session_state:
|
| 166 |
if key.startswith('input_'):
|
|
@@ -183,7 +185,7 @@ def handle_input():
|
|
| 183 |
'image': out_['image'],
|
| 184 |
'table':out_['table']
|
| 185 |
})
|
| 186 |
-
|
| 187 |
|
| 188 |
|
| 189 |
def write_user_message(md):
|
|
@@ -326,6 +328,15 @@ def render_all():
|
|
| 326 |
write_user_message(q)
|
| 327 |
write_chat_message(a, q,index)
|
| 328 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
|
| 330 |
st.markdown("")
|
| 331 |
col_2, col_3 = st.columns([75, 20])
|
|
@@ -338,14 +349,6 @@ with col_3:
|
|
| 338 |
if play:
|
| 339 |
st.session_state.trigger_search = True # mark to run on next rerun
|
| 340 |
|
| 341 |
-
placeholder = st.empty()
|
| 342 |
-
with placeholder.container():
|
| 343 |
-
if st.session_state.trigger_search and st.session_state.input_query != "":
|
| 344 |
-
with st.spinner("Running search..."):
|
| 345 |
-
handle_input()
|
| 346 |
-
render_all()
|
| 347 |
-
st.session_state.trigger_search = False # reset AFTER running
|
| 348 |
-
|
| 349 |
|
| 350 |
|
| 351 |
|
|
|
|
| 161 |
print("Question: "+st.session_state.input_query)
|
| 162 |
print("-----------")
|
| 163 |
print("\n\n")
|
| 164 |
+
if(st.session_state.input_query==''):
|
| 165 |
+
return ""
|
| 166 |
inputs = {}
|
| 167 |
for key in st.session_state:
|
| 168 |
if key.startswith('input_'):
|
|
|
|
| 185 |
'image': out_['image'],
|
| 186 |
'table':out_['table']
|
| 187 |
})
|
| 188 |
+
st.session_state.input_query=""
|
| 189 |
|
| 190 |
|
| 191 |
def write_user_message(md):
|
|
|
|
| 328 |
write_user_message(q)
|
| 329 |
write_chat_message(a, q,index)
|
| 330 |
|
| 331 |
+
placeholder = st.empty()
|
| 332 |
+
with placeholder.container():
|
| 333 |
+
if st.session_state.trigger_search:
|
| 334 |
+
with st.spinner("Running search..."):
|
| 335 |
+
handle_input()
|
| 336 |
+
render_all()
|
| 337 |
+
st.session_state.trigger_search = False # reset AFTER running
|
| 338 |
+
|
| 339 |
+
|
| 340 |
|
| 341 |
st.markdown("")
|
| 342 |
col_2, col_3 = st.columns([75, 20])
|
|
|
|
| 349 |
if play:
|
| 350 |
st.session_state.trigger_search = True # mark to run on next rerun
|
| 351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
|
| 353 |
|
| 354 |
|