prasadnu commited on
Commit
72c9086
ยท
1 Parent(s): 4e01126

RAG upfated

Browse files
app.py CHANGED
@@ -36,7 +36,7 @@ st.markdown("""<style>
36
  AI_ICON = "images/opensearch-twitter-card.png"
37
  col_0_1,col_0_2,col_0_3= st.columns([10,50,85])
38
  with col_0_1:
39
- st.image(AI_ICON, use_container_width='always')
40
  with col_0_2:
41
  st.markdown('<p style="fontSize:40px;color:#FF9900;fontFamily:\'Amazon Ember Display 500\', sans-serif;">OpenSearch AI demos</p>',unsafe_allow_html=True)
42
  #st.header("OpenSearch AI demos")#,divider = 'rainbow'
 
36
  AI_ICON = "images/opensearch-twitter-card.png"
37
  col_0_1,col_0_2,col_0_3= st.columns([10,50,85])
38
  with col_0_1:
39
+ st.image(AI_ICON, use_column_width='always')
40
  with col_0_2:
41
  st.markdown('<p style="fontSize:40px;color:#FF9900;fontFamily:\'Amazon Ember Display 500\', sans-serif;">OpenSearch AI demos</p>',unsafe_allow_html=True)
42
  #st.header("OpenSearch AI demos")#,divider = 'rainbow'
pages/AI_Shopping_Assistant.py CHANGED
@@ -167,7 +167,7 @@ st.markdown("""
167
  def write_logo():
168
  col1, col2, col3 = st.columns([5, 1, 5])
169
  with col2:
170
- st.image(AI_ICON, use_container_width='always')
171
 
172
  def write_top_bar():
173
  col1, col2 = st.columns([77,23])
@@ -175,7 +175,7 @@ def write_top_bar():
175
  st.page_link("app.py", label=":orange[Home]", icon="๐Ÿ ")
176
  st.header("AI Shopping assistant",divider='rainbow')
177
 
178
- #st.image(AI_ICON, use_container_width='always')
179
 
180
  with col2:
181
  st.write("")
@@ -263,7 +263,7 @@ def write_user_message(md):
263
  col1, col2 = st.columns([3,97])
264
 
265
  with col1:
266
- st.image(USER_ICON, use_container_width='always')
267
  with col2:
268
  #st.warning(md['question'])
269
 
@@ -276,7 +276,7 @@ def render_answer(question,answer,index):
276
 
277
  col1, col2, col_3 = st.columns([4,74,22])
278
  with col1:
279
- st.image(AI_ICON, use_container_width='always')
280
  with col2:
281
  use_interim_results = False
282
  src_dict = {}
@@ -306,11 +306,11 @@ def render_answer(question,answer,index):
306
  resizedImg = img.resize((230, 180), Image.Resampling.LANCZOS)
307
  if(index ==0):
308
  with img_col1:
309
- st.image(resizedImg,use_container_width = True,caption = item['title'])
310
  if(index ==1):
311
  with img_col2:
312
- st.image(resizedImg,use_container_width = True,caption = item['title'])
313
- #st.image(parent_dirname+"/retrieved_esci_images/"+item['id']+"_resized.jpg",caption = item['title'],use_container_width = True)
314
 
315
 
316
  if(answer['last_tool']['name'] == "generate_images" or answer['last_tool']['name'] == "get_any_general_recommendation"):
@@ -326,7 +326,7 @@ def render_answer(question,answer,index):
326
  img_ = Image.open(BytesIO(s3_stream))
327
  resizedImg = img_.resize((230, 180), Image.Resampling.LANCZOS)
328
  with gen_img_col1:
329
- st.image(resizedImg,caption = "Generated image for "+key.split(".")[0],use_container_width = True)
330
  st.write("<br>",unsafe_allow_html = True)
331
 
332
 
 
167
  def write_logo():
168
  col1, col2, col3 = st.columns([5, 1, 5])
169
  with col2:
170
+ st.image(AI_ICON, use_column_width='always')
171
 
172
  def write_top_bar():
173
  col1, col2 = st.columns([77,23])
 
175
  st.page_link("app.py", label=":orange[Home]", icon="๐Ÿ ")
176
  st.header("AI Shopping assistant",divider='rainbow')
177
 
178
+ #st.image(AI_ICON, use_column_width='always')
179
 
180
  with col2:
181
  st.write("")
 
263
  col1, col2 = st.columns([3,97])
264
 
265
  with col1:
266
+ st.image(USER_ICON, use_column_width='always')
267
  with col2:
268
  #st.warning(md['question'])
269
 
 
276
 
277
  col1, col2, col_3 = st.columns([4,74,22])
278
  with col1:
279
+ st.image(AI_ICON, use_column_width='always')
280
  with col2:
281
  use_interim_results = False
282
  src_dict = {}
 
306
  resizedImg = img.resize((230, 180), Image.Resampling.LANCZOS)
307
  if(index ==0):
308
  with img_col1:
309
+ st.image(resizedImg,use_column_width = True,caption = item['title'])
310
  if(index ==1):
311
  with img_col2:
312
+ st.image(resizedImg,use_column_width = True,caption = item['title'])
313
+ #st.image(parent_dirname+"/retrieved_esci_images/"+item['id']+"_resized.jpg",caption = item['title'],use_column_width = True)
314
 
315
 
316
  if(answer['last_tool']['name'] == "generate_images" or answer['last_tool']['name'] == "get_any_general_recommendation"):
 
326
  img_ = Image.open(BytesIO(s3_stream))
327
  resizedImg = img_.resize((230, 180), Image.Resampling.LANCZOS)
328
  with gen_img_col1:
329
+ st.image(resizedImg,caption = "Generated image for "+key.split(".")[0],use_column_width = True)
330
  st.write("<br>",unsafe_allow_html = True)
331
 
332
 
pages/Multimodal_Conversational_Search.py CHANGED
@@ -146,7 +146,7 @@ service = 'es'
146
  def write_logo():
147
  col1, col2, col3 = st.columns([5, 1, 5])
148
  with col2:
149
- st.image(AI_ICON, use_container_width='always')
150
 
151
  def write_top_bar():
152
  col1, col2 = st.columns([77,23])
@@ -154,7 +154,7 @@ def write_top_bar():
154
  st.write("")
155
  st.header("Chat with your data",divider='rainbow')
156
 
157
- #st.image(AI_ICON, use_container_width='always')
158
 
159
  with col2:
160
  st.write("")
@@ -242,7 +242,7 @@ def write_user_message(md):
242
  col1, col2 = st.columns([3,97])
243
 
244
  with col1:
245
- st.image(USER_ICON, use_container_width='always')
246
  with col2:
247
  #st.warning(md['question'])
248
 
@@ -255,7 +255,7 @@ def render_answer(question,answer,index,res_img):
255
 
256
  col1, col2, col_3 = st.columns([4,74,22])
257
  with col1:
258
- st.image(AI_ICON, use_container_width='always')
259
  with col2:
260
  ans_ = answer['answer']
261
  st.write(ans_)
 
146
  def write_logo():
147
  col1, col2, col3 = st.columns([5, 1, 5])
148
  with col2:
149
+ st.image(AI_ICON, use_column_width='always')
150
 
151
  def write_top_bar():
152
  col1, col2 = st.columns([77,23])
 
154
  st.write("")
155
  st.header("Chat with your data",divider='rainbow')
156
 
157
+ #st.image(AI_ICON, use_column_width='always')
158
 
159
  with col2:
160
  st.write("")
 
242
  col1, col2 = st.columns([3,97])
243
 
244
  with col1:
245
+ st.image(USER_ICON, use_column_width='always')
246
  with col2:
247
  #st.warning(md['question'])
248
 
 
255
 
256
  col1, col2, col_3 = st.columns([4,74,22])
257
  with col1:
258
+ st.image(AI_ICON, use_column_width='always')
259
  with col2:
260
  ans_ = answer['answer']
261
  st.write(ans_)
pages/Semantic_Search.py CHANGED
@@ -609,7 +609,7 @@ def write_top_bar():
609
  # st.write("")
610
  col1, col2,col3,col4 = st.columns([2.5,35,8,7])
611
  with col1:
612
- st.image(TEXT_ICON, use_container_width='always')
613
  with col2:
614
  #st.markdown("")
615
  input = st.text_input( "Ask here",label_visibility = "collapsed",key="input_text",placeholder = "Type your query")
@@ -622,7 +622,7 @@ def write_top_bar():
622
  col5, col6 = st.columns([4.5,95])
623
 
624
  with col5:
625
- st.image(IMAGE_ICON, use_container_width='always')
626
  with col6:
627
  with st.expander(':green[Search by using an image]'):
628
  tab2, tab1 = st.tabs(["Upload Image","Generate Image by AI"])
@@ -953,7 +953,7 @@ def write_user_message(md,ans):
953
  col1, col2, col3 = st.columns([3,40,20])
954
 
955
  with col1:
956
- st.image(USER_ICON, use_container_width='always')
957
  with col2:
958
  #st.warning(md['question'])
959
  st.markdown("<div style='fontSize:15px;padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;'>Input Text: </div><div style='fontSize:25px;padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;font-style: italic;color:#e28743'>"+md['question']+"</div>", unsafe_allow_html = True)
@@ -1005,7 +1005,7 @@ def write_user_message(md,ans):
1005
  def render_answer(answer,index):
1006
  column1, column2 = st.columns([6,90])
1007
  with column1:
1008
- st.image(AI_ICON, use_container_width='always')
1009
  with column2:
1010
  st.markdown("<div style='fontSize:25px;padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;'>Results </div>", unsafe_allow_html = True)
1011
  if(st.session_state.input_evaluate == "enabled" and st.session_state.input_ndcg > 0):
@@ -1179,7 +1179,7 @@ def render_answer(answer,index):
1179
 
1180
  placeholder__ = st.empty()
1181
 
1182
- placeholder__.button("๐Ÿ”„",key=rdn_key,on_click=on_button_click, help = "This will regenerate the responses with new settings that you entered, Note: To see difference in responses, you should change any of the applicable settings")#,type="primary",use_container_width=True)
1183
 
1184
  if(filter_out > 0):
1185
  placeholder_no_results.text(str(filter_out)+" result(s) removed due to missing or in-appropriate content")
 
609
  # st.write("")
610
  col1, col2,col3,col4 = st.columns([2.5,35,8,7])
611
  with col1:
612
+ st.image(TEXT_ICON, use_column_width='always')
613
  with col2:
614
  #st.markdown("")
615
  input = st.text_input( "Ask here",label_visibility = "collapsed",key="input_text",placeholder = "Type your query")
 
622
  col5, col6 = st.columns([4.5,95])
623
 
624
  with col5:
625
+ st.image(IMAGE_ICON, use_column_width='always')
626
  with col6:
627
  with st.expander(':green[Search by using an image]'):
628
  tab2, tab1 = st.tabs(["Upload Image","Generate Image by AI"])
 
953
  col1, col2, col3 = st.columns([3,40,20])
954
 
955
  with col1:
956
+ st.image(USER_ICON, use_column_width='always')
957
  with col2:
958
  #st.warning(md['question'])
959
  st.markdown("<div style='fontSize:15px;padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;'>Input Text: </div><div style='fontSize:25px;padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;font-style: italic;color:#e28743'>"+md['question']+"</div>", unsafe_allow_html = True)
 
1005
  def render_answer(answer,index):
1006
  column1, column2 = st.columns([6,90])
1007
  with column1:
1008
+ st.image(AI_ICON, use_column_width='always')
1009
  with column2:
1010
  st.markdown("<div style='fontSize:25px;padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;'>Results </div>", unsafe_allow_html = True)
1011
  if(st.session_state.input_evaluate == "enabled" and st.session_state.input_ndcg > 0):
 
1179
 
1180
  placeholder__ = st.empty()
1181
 
1182
+ placeholder__.button("๐Ÿ”„",key=rdn_key,on_click=on_button_click, help = "This will regenerate the responses with new settings that you entered, Note: To see difference in responses, you should change any of the applicable settings")#,type="primary",use_column_width=True)
1183
 
1184
  if(filter_out > 0):
1185
  placeholder_no_results.text(str(filter_out)+" result(s) removed due to missing or in-appropriate content")