prasadnu commited on
Commit
9f4360a
·
1 Parent(s): 852e88a

app fixes UI

Browse files
pages/Multimodal_Conversational_Search.py CHANGED
@@ -78,7 +78,7 @@ if "answers_" not in st.session_state:
78
  st.session_state.answers_ = []
79
 
80
  if "input_index" not in st.session_state:
81
- st.session_state.input_index = "hpijan2024hometrack"#"globalwarmingnew"#"hpijan2024hometrack_no_img_no_table"
82
 
83
  if "input_is_rerank" not in st.session_state:
84
  st.session_state.input_is_rerank = True
@@ -228,14 +228,28 @@ def render_answer(question,answer,index,res_img):
228
  row = st.columns(cols_per_row)
229
  for j, item in enumerate(res_img[i:i+cols_per_row]):
230
  with row[j]:
 
 
 
 
 
 
231
  st.image(item['file'])
 
232
 
233
  else:
234
  st.session_state.image_placeholder = st.empty()
235
  with st.session_state.image_placeholder.container():
236
  col3_,col4_,col5_ = st.columns([33,33,33])
237
  with col3_:
 
 
 
 
 
 
238
  st.image(res_img[i]['file'])
 
239
  else:
240
  if(res_img[i]['file'].lower()!='none' and idx < 1):
241
  col3,col4,col5 = st.columns([33,33,33])
@@ -244,8 +258,14 @@ def render_answer(question,answer,index,res_img):
244
  caption = res_img[i]['caption']
245
 
246
  with cols[idx]:
247
-
 
 
 
 
 
248
  st.image(parent_dirname+"/figures/"+st.session_state.input_index+"/"+img+".jpg")
 
249
 
250
  idx = idx+1
251
  if(len(answer["table"] )>0):
 
78
  st.session_state.answers_ = []
79
 
80
  if "input_index" not in st.session_state:
81
+ st.session_state.input_index = "globalwarmingnew"#"hpijan2024hometrack"#"hpijan2024hometrack"#"covid19ie"#"choosetheknnalgorithmforyourbillionscaleusecasewithopensearchawsbigdatablog"
82
 
83
  if "input_is_rerank" not in st.session_state:
84
  st.session_state.input_is_rerank = True
 
228
  row = st.columns(cols_per_row)
229
  for j, item in enumerate(res_img[i:i+cols_per_row]):
230
  with row[j]:
231
+ st.markdown(
232
+ """
233
+ <div style='max-height:500px; overflow:auto; border:1px solid #444; padding:4px;'>
234
+ """,
235
+ unsafe_allow_html=True
236
+ )
237
  st.image(item['file'])
238
+ st.markdown("</div>", unsafe_allow_html=True)
239
 
240
  else:
241
  st.session_state.image_placeholder = st.empty()
242
  with st.session_state.image_placeholder.container():
243
  col3_,col4_,col5_ = st.columns([33,33,33])
244
  with col3_:
245
+ st.markdown(
246
+ """
247
+ <div style='max-height:500px; overflow:auto; border:1px solid #444; padding:4px;'>
248
+ """,
249
+ unsafe_allow_html=True
250
+ )
251
  st.image(res_img[i]['file'])
252
+ st.markdown("</div>", unsafe_allow_html=True)
253
  else:
254
  if(res_img[i]['file'].lower()!='none' and idx < 1):
255
  col3,col4,col5 = st.columns([33,33,33])
 
258
  caption = res_img[i]['caption']
259
 
260
  with cols[idx]:
261
+ st.markdown(
262
+ """
263
+ <div style='max-height:500px; overflow:auto; border:1px solid #444; padding:4px;'>
264
+ """,
265
+ unsafe_allow_html=True
266
+ )
267
  st.image(parent_dirname+"/figures/"+st.session_state.input_index+"/"+img+".jpg")
268
+ st.markdown("</div>", unsafe_allow_html=True)
269
 
270
  idx = idx+1
271
  if(len(answer["table"] )>0):