prasadnu commited on
Commit
e62ee11
·
1 Parent(s): e8f9e83

colpali fix

Browse files
pages/Multimodal_Conversational_Search.py CHANGED
@@ -193,7 +193,9 @@ if clear:
193
  # st.session_state.input_maxTokens = 1024
194
 
195
 
196
- def handle_input():
 
 
197
  # st.session_state.answer_ready = True
198
  # st.session_state.show_columns = False # reset column display
199
  print("Question: "+st.session_state.input_query)
@@ -279,23 +281,23 @@ def render_answer(question,answer,index,res_img):
279
  st.write(ans_)
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.input_query = st.session_state.questions_[-1]["question"]
285
- # st.session_state.answers_.pop()
286
- # st.session_state.questions_.pop()
287
- handle_input()
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
- with placeholder.container():
294
- render_all()
295
 
296
  if(st.session_state.input_is_colpali):
297
  placeholder__ = st.empty()
298
- placeholder__.button("Show similarity map",key=rdn_key_1,on_click=show_maxsim)
299
 
300
 
301
  colu1,colu2,colu3 = st.columns([4,82,20])
@@ -365,7 +367,7 @@ def render_answer(question,answer,index,res_img):
365
  st.session_state.input_query = st.session_state.questions_[-1]["question"]
366
  st.session_state.answers_.pop()
367
  st.session_state.questions_.pop()
368
- handle_input()
369
  with placeholder.container():
370
  render_all()
371
 
@@ -425,7 +427,7 @@ with col_2:
425
  input = st.text_input( "Ask here",label_visibility = "collapsed",key="input_query")
426
  with col_3:
427
  #hidden = st.button("RUN",disabled=True,key = "hidden")
428
- play = st.button("Go",on_click=handle_input,key = "play")
429
  with st.sidebar:
430
  st.page_link("app.py", label=":orange[Home]", icon="🏠")
431
  st.subheader(":blue[Sample Data]")
 
193
  # st.session_state.input_maxTokens = 1024
194
 
195
 
196
+ def handle_input(state,dummy):
197
+ if(state == 'colpali_show_similarity_map'):
198
+ st.session_state.show_columns = True
199
  # st.session_state.answer_ready = True
200
  # st.session_state.show_columns = False # reset column display
201
  print("Question: "+st.session_state.input_query)
 
281
  st.write(ans_)
282
  rdn_key_1 = ''.join([random.choice(string.ascii_letters)
283
  for _ in range(10)])
284
+ # def show_maxsim():
285
+ # st.session_state.show_columns = True
286
+ # # st.session_state.input_query = st.session_state.questions_[-1]["question"]
287
+ # # st.session_state.answers_.pop()
288
+ # # st.session_state.questions_.pop()
289
+ # handle_input()
290
+ # print("*"*20)
291
+ # print(st.session_state.input_query)
292
+ # print(st.session_state.answers_)
293
+ # print(st.session_state.questions_)
294
+ # print("*"*20)
295
+ # with placeholder.container():
296
+ # render_all()
297
 
298
  if(st.session_state.input_is_colpali):
299
  placeholder__ = st.empty()
300
+ placeholder__.button("Show similarity map",key=rdn_key_1,on_click=handle_input,args=('colpali_show_similarity_map',None))
301
 
302
 
303
  colu1,colu2,colu3 = st.columns([4,82,20])
 
367
  st.session_state.input_query = st.session_state.questions_[-1]["question"]
368
  st.session_state.answers_.pop()
369
  st.session_state.questions_.pop()
370
+ handle_input("regenerate_",None)
371
  with placeholder.container():
372
  render_all()
373
 
 
427
  input = st.text_input( "Ask here",label_visibility = "collapsed",key="input_query")
428
  with col_3:
429
  #hidden = st.button("RUN",disabled=True,key = "hidden")
430
+ play = st.button("Go",on_click=handle_input,key = "play",args=(None,None),help = 'Enter the questions and click on "GO"')
431
  with st.sidebar:
432
  st.page_link("app.py", label=":orange[Home]", icon="🏠")
433
  st.subheader(":blue[Sample Data]")