Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
app look
Browse files
app.py
CHANGED
|
@@ -10,8 +10,6 @@ from yaml.loader import SafeLoader
|
|
| 10 |
|
| 11 |
|
| 12 |
st.set_page_config(
|
| 13 |
-
|
| 14 |
-
#page_title="Semantic Search using OpenSearch",
|
| 15 |
layout="wide",
|
| 16 |
page_icon="/home/ubuntu/images/opensearch_mark_default.png"
|
| 17 |
)
|
|
@@ -21,33 +19,17 @@ st.markdown("""<style>
|
|
| 21 |
</style>
|
| 22 |
""",unsafe_allow_html=True)
|
| 23 |
|
| 24 |
-
# with open('/home/ubuntu/AI-search-with-amazon-opensearch-service/OpenSearchApp/auth.yaml') as file:
|
| 25 |
-
# config = yaml.load(file, Loader=SafeLoader)
|
| 26 |
-
# authenticator = Authenticate(
|
| 27 |
-
# config['credentials'],
|
| 28 |
-
# config['cookie']['name'],
|
| 29 |
-
# config['cookie']['key'],
|
| 30 |
-
# config['cookie']['expiry_days'],
|
| 31 |
-
# config['preauthorized']
|
| 32 |
-
# )
|
| 33 |
-
# name, authentication_status, username = authenticator.login('Login', 'main')
|
| 34 |
-
|
| 35 |
-
|
| 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 |
-
|
| 43 |
-
# with col_0_3:
|
| 44 |
-
# st.markdown("<a style = 'font-size:150%;background-color: #e28743;color: white;padding: 5px 10px;text-align: center;text-decoration: none;margin: 10px 20px;border-radius: 12px;display: inline-block;' href = 'https://catalog.workshops.aws/opensearch-ml-search'>Workshop</a>",unsafe_allow_html=True)
|
| 45 |
-
|
| 46 |
|
| 47 |
#st.header(":rewind: Demos available")
|
| 48 |
st.write("")
|
| 49 |
-
|
| 50 |
-
#st.write("Choose a demo")
|
| 51 |
st.write("")
|
| 52 |
col_1_1,col_1_2,col_1_3 = st.columns([3,40,65])
|
| 53 |
with col_1_1:
|
|
@@ -55,16 +37,11 @@ with col_1_1:
|
|
| 55 |
with col_1_2:
|
| 56 |
st.markdown('<p style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Neural Search</p>',unsafe_allow_html=True)
|
| 57 |
with col_1_3:
|
| 58 |
-
demo_1 = st.button("
|
| 59 |
if(demo_1):
|
| 60 |
st.switch_page('pages/Semantic_Search.py')
|
| 61 |
st.write("")
|
| 62 |
-
|
| 63 |
-
#st.button("1. Semantic Search")
|
| 64 |
-
# image_ = Image.open('/home/ubuntu/images/Semantic_SEarch.png')
|
| 65 |
-
# new_image = image_.resize((1500, 1000))
|
| 66 |
-
# new_image.save('images/semantic_search_resize.png')
|
| 67 |
-
# st.image("images/semantic_search_resize.png")
|
| 68 |
col_2_1,col_2_2,col_2_3 = st.columns([3,40,65])
|
| 69 |
with col_2_1:
|
| 70 |
st.subheader(" ")
|
|
@@ -72,15 +49,11 @@ with col_2_2:
|
|
| 72 |
st.markdown('<p style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Multimodal Conversational Search</p>',unsafe_allow_html=True)
|
| 73 |
|
| 74 |
with col_2_3:
|
| 75 |
-
demo_2 = st.button("
|
| 76 |
if(demo_2):
|
| 77 |
st.switch_page('pages/Multimodal_Conversational_Search.py')
|
| 78 |
st.write("")
|
| 79 |
-
|
| 80 |
-
# image_ = Image.open('images/RAG_.png')
|
| 81 |
-
# new_image = image_.resize((1500, 1000))
|
| 82 |
-
# new_image.save('images/RAG_resize.png')
|
| 83 |
-
# st.image("images/RAG_resize.png")
|
| 84 |
|
| 85 |
col_3_1,col_3_2,col_3_3 = st.columns([3,40,65])
|
| 86 |
with col_3_1:
|
|
@@ -88,30 +61,10 @@ with col_3_1:
|
|
| 88 |
with col_3_2:
|
| 89 |
st.markdown('<div style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Agentic Shopping Assistant</div>',unsafe_allow_html=True)#<span style="fontSize:14px;color:#099ef3;fontWeight:bold;textDecorationLine:underline;textDecorationStyle: dashed;">New</span>
|
| 90 |
with col_3_3:
|
| 91 |
-
demo_3 = st.button("
|
| 92 |
if(demo_3):
|
| 93 |
st.switch_page('pages/AI_Shopping_Assistant.py')
|
| 94 |
-
# with st.sidebar:
|
| 95 |
-
# st.subheader("Choose a demo !")
|
| 96 |
-
|
| 97 |
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
# """
|
| 101 |
-
# <style>
|
| 102 |
-
|
| 103 |
-
# [data-testid="stHeader"]::after {
|
| 104 |
-
# content: "My Company Name";
|
| 105 |
-
# margin-left: 0px;
|
| 106 |
-
# margin-top: 0px;
|
| 107 |
-
# font-size: 30px;
|
| 108 |
-
# position: relative;
|
| 109 |
-
# left: 90%;
|
| 110 |
-
# top: 30%;
|
| 111 |
-
# }
|
| 112 |
-
# </style>
|
| 113 |
-
# """,
|
| 114 |
-
|
| 115 |
isExist = os.path.exists("/home/user/images_retail")
|
| 116 |
if not isExist:
|
| 117 |
os.makedirs("/home/user/images_retail")
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
st.set_page_config(
|
|
|
|
|
|
|
| 13 |
layout="wide",
|
| 14 |
page_icon="/home/ubuntu/images/opensearch_mark_default.png"
|
| 15 |
)
|
|
|
|
| 19 |
</style>
|
| 20 |
""",unsafe_allow_html=True)
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
AI_ICON = "images/opensearch-twitter-card.png"
|
| 23 |
col_0_1,col_0_2,col_0_3= st.columns([10,50,85])
|
| 24 |
with col_0_1:
|
| 25 |
st.image(AI_ICON, use_column_width='always')
|
| 26 |
with col_0_2:
|
| 27 |
st.markdown('<p style="fontSize:40px;color:#FF9900;fontFamily:\'Amazon Ember Display 500\', sans-serif;">OpenSearch AI demos</p>',unsafe_allow_html=True)
|
| 28 |
+
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
#st.header(":rewind: Demos available")
|
| 31 |
st.write("")
|
| 32 |
+
|
|
|
|
| 33 |
st.write("")
|
| 34 |
col_1_1,col_1_2,col_1_3 = st.columns([3,40,65])
|
| 35 |
with col_1_1:
|
|
|
|
| 37 |
with col_1_2:
|
| 38 |
st.markdown('<p style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Neural Search</p>',unsafe_allow_html=True)
|
| 39 |
with col_1_3:
|
| 40 |
+
demo_1 = st.button("Launch",key = "demo_1")
|
| 41 |
if(demo_1):
|
| 42 |
st.switch_page('pages/Semantic_Search.py')
|
| 43 |
st.write("")
|
| 44 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
col_2_1,col_2_2,col_2_3 = st.columns([3,40,65])
|
| 46 |
with col_2_1:
|
| 47 |
st.subheader(" ")
|
|
|
|
| 49 |
st.markdown('<p style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Multimodal Conversational Search</p>',unsafe_allow_html=True)
|
| 50 |
|
| 51 |
with col_2_3:
|
| 52 |
+
demo_2 = st.button("Launch",key = "demo_2")
|
| 53 |
if(demo_2):
|
| 54 |
st.switch_page('pages/Multimodal_Conversational_Search.py')
|
| 55 |
st.write("")
|
| 56 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
col_3_1,col_3_2,col_3_3 = st.columns([3,40,65])
|
| 59 |
with col_3_1:
|
|
|
|
| 61 |
with col_3_2:
|
| 62 |
st.markdown('<div style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Agentic Shopping Assistant</div>',unsafe_allow_html=True)#<span style="fontSize:14px;color:#099ef3;fontWeight:bold;textDecorationLine:underline;textDecorationStyle: dashed;">New</span>
|
| 63 |
with col_3_3:
|
| 64 |
+
demo_3 = st.button("Launch",key = "demo_3")
|
| 65 |
if(demo_3):
|
| 66 |
st.switch_page('pages/AI_Shopping_Assistant.py')
|
|
|
|
|
|
|
|
|
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
isExist = os.path.exists("/home/user/images_retail")
|
| 69 |
if not isExist:
|
| 70 |
os.makedirs("/home/user/images_retail")
|