secilozksen commited on
Commit
8d3d7c4
·
1 Parent(s): 03a91c1

Update demo_dpr.py

Browse files
Files changed (1) hide show
  1. demo_dpr.py +1 -19
demo_dpr.py CHANGED
@@ -239,7 +239,7 @@ def qa_main_widgetsv2():
239
  header_html, unsafe_allow_html=True,
240
  )
241
  st.markdown("""---""")
242
- col1, col2, col3 = st.columns([2, 1, 1])
243
  with col1:
244
  form = st.form(key='first_form')
245
  question = form.text_area("What is your question?:", height=200)
@@ -259,24 +259,6 @@ def qa_main_widgetsv2():
259
  st.markdown(f"## Related Context - {i + 1} (score: {top_5_scores[i]:.2f})")
260
  st.markdown(context)
261
  st.markdown("""---""")
262
- with col2:
263
- st.markdown("## Original Questions")
264
- grid_response = interactive_table(dataframe_original)
265
- data1 = grid_response['selected_rows']
266
- if "grid_click_1" not in st.session_state:
267
- st.session_state.grid_click_1 = False
268
- if len(data1) > 0:
269
- st.session_state.grid_click_1 = True
270
- if st.session_state.grid_click_1:
271
- selection = data1[0]
272
- # st.markdown("## Context & Answer:")
273
- st.markdown("### Context:")
274
- st.write(selection['context'])
275
- st.markdown("### Question:")
276
- st.write(selection['question'])
277
- st.markdown("### Answer:")
278
- st.write(selection['answer'])
279
- st.session_state.grid_click_1 = False
280
  with col3:
281
  st.markdown("## Our Questions")
282
  grid_response = interactive_table(dataframe_bsbs)
 
239
  header_html, unsafe_allow_html=True,
240
  )
241
  st.markdown("""---""")
242
+ col1, col3 = st.columns([1, 1])
243
  with col1:
244
  form = st.form(key='first_form')
245
  question = form.text_area("What is your question?:", height=200)
 
259
  st.markdown(f"## Related Context - {i + 1} (score: {top_5_scores[i]:.2f})")
260
  st.markdown(context)
261
  st.markdown("""---""")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  with col3:
263
  st.markdown("## Our Questions")
264
  grid_response = interactive_table(dataframe_bsbs)