prasadnu commited on
Commit
bf1dfe7
·
1 Parent(s): abde31c

rerank model

Browse files
pages/Multimodal_Conversational_Search.py CHANGED
@@ -280,31 +280,31 @@ def render_answer(question,answer,index,res_img):
280
  st.write(answer["source"])
281
 
282
 
283
- # with col_3:
284
- # if(index == len(st.session_state.questions_)):
285
-
286
- # rdn_key = ''.join([random.choice(string.ascii_letters)
287
- # for _ in range(10)])
288
- # currentValue = ''.join(st.session_state.input_rag_searchType)+str(st.session_state.input_is_rerank)+str(st.session_state.input_table_with_sql)+st.session_state.input_index
289
- # oldValue = ''.join(st.session_state.inputs_["rag_searchType"])+str(st.session_state.inputs_["is_rerank"])+str(st.session_state.inputs_["table_with_sql"])+str(st.session_state.inputs_["index"])
290
- # def on_button_click():
291
- # if(currentValue!=oldValue or 1==1):
292
- # st.session_state.input_query = st.session_state.questions_[-1]["question"]
293
- # st.session_state.answers_.pop()
294
- # st.session_state.questions_.pop()
295
 
296
- # handle_input()
297
- # with placeholder.container():
298
- # render_all()
299
- # if("currentValue" in st.session_state):
300
- # del st.session_state["currentValue"]
301
-
302
- # try:
303
- # del regenerate
304
- # except:
305
- # pass
306
- # placeholder__ = st.empty()
307
- # placeholder__.button("🔄",key=rdn_key,on_click=on_button_click)
308
 
309
 
310
  #Each answer will have context of the question asked in order to associate the provided feedback with the respective question
@@ -327,8 +327,7 @@ def render_all():
327
 
328
  placeholder = st.empty()
329
  with placeholder.container():
330
- with st.spinner("Running search..."):
331
- render_all()
332
 
333
 
334
 
 
280
  st.write(answer["source"])
281
 
282
 
283
+ with col_3:
284
+ if(index == len(st.session_state.questions_)):
285
+
286
+ rdn_key = ''.join([random.choice(string.ascii_letters)
287
+ for _ in range(10)])
288
+ currentValue = ''.join(st.session_state.input_rag_searchType)+str(st.session_state.input_is_rerank)+str(st.session_state.input_table_with_sql)+st.session_state.input_index
289
+ oldValue = ''.join(st.session_state.inputs_["rag_searchType"])+str(st.session_state.inputs_["is_rerank"])+str(st.session_state.inputs_["table_with_sql"])+str(st.session_state.inputs_["index"])
290
+ def on_button_click():
291
+ if(currentValue!=oldValue or 1==1):
292
+ st.session_state.input_query = st.session_state.questions_[-1]["question"]
293
+ st.session_state.answers_.pop()
294
+ st.session_state.questions_.pop()
295
 
296
+ handle_input()
297
+ with placeholder.container():
298
+ render_all()
299
+ if("currentValue" in st.session_state):
300
+ del st.session_state["currentValue"]
301
+
302
+ try:
303
+ del regenerate
304
+ except:
305
+ pass
306
+ placeholder__ = st.empty()
307
+ placeholder__.button("🔄",key=rdn_key,on_click=on_button_click)
308
 
309
 
310
  #Each answer will have context of the question asked in order to associate the provided feedback with the respective question
 
327
 
328
  placeholder = st.empty()
329
  with placeholder.container():
330
+ render_all()
 
331
 
332
 
333