Spaces:
Running
on
T4
Running
on
T4
app look
Browse files
app.py
CHANGED
@@ -13,52 +13,46 @@ st.set_page_config(
|
|
13 |
page_icon="/home/ubuntu/images/opensearch_mark_default.png"
|
14 |
)
|
15 |
|
16 |
-
st
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
st.markdown("""
|
25 |
<style>
|
|
|
|
|
|
|
|
|
26 |
html, body, .main {
|
27 |
overflow: hidden;
|
28 |
height: 100vh;
|
29 |
-
}
|
30 |
-
</style>
|
31 |
-
""", unsafe_allow_html=True)
|
32 |
-
hide_img_fs = '''
|
33 |
-
<style>
|
34 |
-
button[title="View fullscreen"]{
|
35 |
-
visibility: hidden;}
|
36 |
-
</style>
|
37 |
-
'''
|
38 |
-
|
39 |
-
st.markdown(hide_img_fs, unsafe_allow_html=True)
|
40 |
-
st.markdown("""
|
41 |
-
<style>
|
42 |
-
body {
|
43 |
background-color: #1E1E1E;
|
44 |
color: #FFFFFF;
|
|
|
45 |
}
|
46 |
-
|
47 |
-
|
|
|
48 |
}
|
49 |
-
</style>
|
50 |
-
""", unsafe_allow_html=True)
|
51 |
-
# Font
|
52 |
-
st.markdown("""
|
53 |
-
<style>
|
54 |
-
@import url('https://fonts.cdnfonts.com/css/amazon-ember');
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
}
|
61 |
|
|
|
62 |
.title {
|
63 |
font-size: 40px;
|
64 |
color: #FF9900;
|
@@ -66,6 +60,7 @@ st.markdown("""
|
|
66 |
margin-bottom: 10px;
|
67 |
}
|
68 |
|
|
|
69 |
.demo-card {
|
70 |
background-color: #111111;
|
71 |
border-radius: 12px;
|
@@ -78,7 +73,7 @@ st.markdown("""
|
|
78 |
}
|
79 |
|
80 |
.demo-text {
|
81 |
-
font-size:
|
82 |
color: #c5c3c0;
|
83 |
font-family: 'Amazon Ember Cd RC 250', sans-serif;
|
84 |
}
|
@@ -91,18 +86,45 @@ st.markdown("""
|
|
91 |
border-radius: 6px;
|
92 |
font-size: 16px;
|
93 |
}
|
94 |
-
|
95 |
a .demo-card:hover {
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
}
|
100 |
-
|
101 |
</style>
|
102 |
""", unsafe_allow_html=True)
|
103 |
|
104 |
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
# Header with logo and title
|
107 |
extra, col_logo, col_title = st.columns([3,34, 63])
|
108 |
with col_logo:
|
|
|
13 |
page_icon="/home/ubuntu/images/opensearch_mark_default.png"
|
14 |
)
|
15 |
|
16 |
+
import streamlit as st
|
17 |
+
from PIL import Image
|
18 |
+
import base64
|
19 |
+
import yaml
|
20 |
+
import os
|
21 |
+
import urllib.request
|
22 |
+
import tarfile
|
23 |
+
from yaml.loader import SafeLoader
|
24 |
|
25 |
+
# Page setup
|
26 |
+
st.set_page_config(
|
27 |
+
layout="wide",
|
28 |
+
page_icon="/home/ubuntu/images/opensearch_mark_default.png"
|
29 |
+
|
30 |
+
)
|
31 |
st.markdown("""
|
32 |
<style>
|
33 |
+
/* Import Amazon Ember font */
|
34 |
+
@import url('https://fonts.cdnfonts.com/css/amazon-ember');
|
35 |
+
|
36 |
+
/* Global layout tweaks */
|
37 |
html, body, .main {
|
38 |
overflow: hidden;
|
39 |
height: 100vh;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
background-color: #1E1E1E;
|
41 |
color: #FFFFFF;
|
42 |
+
font-family: 'Amazon Ember', sans-serif;
|
43 |
}
|
44 |
+
|
45 |
+
.block-container {
|
46 |
+
padding-top: 5rem;
|
47 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
/* Hide Streamlit UI elements */
|
50 |
+
#MainMenu, header, footer,
|
51 |
+
button[title="View fullscreen"] {
|
52 |
+
visibility: hidden;
|
53 |
}
|
54 |
|
55 |
+
/* Title styling */
|
56 |
.title {
|
57 |
font-size: 40px;
|
58 |
color: #FF9900;
|
|
|
60 |
margin-bottom: 10px;
|
61 |
}
|
62 |
|
63 |
+
/* Demo card styling */
|
64 |
.demo-card {
|
65 |
background-color: #111111;
|
66 |
border-radius: 12px;
|
|
|
73 |
}
|
74 |
|
75 |
.demo-text {
|
76 |
+
font-size: 24px;
|
77 |
color: #c5c3c0;
|
78 |
font-family: 'Amazon Ember Cd RC 250', sans-serif;
|
79 |
}
|
|
|
86 |
border-radius: 6px;
|
87 |
font-size: 16px;
|
88 |
}
|
89 |
+
|
90 |
a .demo-card:hover {
|
91 |
+
background-color: #e46e08 !important;
|
92 |
+
color: black !important;
|
93 |
+
transition: 0.3s;
|
94 |
}
|
|
|
95 |
</style>
|
96 |
""", unsafe_allow_html=True)
|
97 |
|
98 |
|
99 |
|
100 |
+
|
101 |
+
# Header with logo and title
|
102 |
+
extra, col_logo, col_title = st.columns([3,40, 58])
|
103 |
+
with col_logo:
|
104 |
+
st.image("/home/ubuntu/AI-search-with-amazon-opensearch-service/OpenSearchApp/images/OS_AI_1_cropped.png", use_column_width=True)
|
105 |
+
|
106 |
+
#st.image("/home/ubuntu/images/OS_AI_1.png", use_column_width=True)
|
107 |
+
# with col_title:
|
108 |
+
# st.write("")
|
109 |
+
# st.markdown('<div class="title">OpenSearch AI demos</div>', unsafe_allow_html=True)
|
110 |
+
|
111 |
+
def demo_link_block(icon, title, target_page):
|
112 |
+
st.markdown(f"""
|
113 |
+
<a href="/{target_page}" target="_self" style="text-decoration: none;">
|
114 |
+
<div class="demo-card">
|
115 |
+
<div class="demo-text">{icon} {title}</div>
|
116 |
+
</div>
|
117 |
+
</a>
|
118 |
+
""", unsafe_allow_html=True)
|
119 |
+
|
120 |
+
st.write("")
|
121 |
+
demo_link_block("🔍", "AI Search", "Semantic_Search")
|
122 |
+
demo_link_block("💬","Multimodal Conversational Search", "Multimodal_Conversational_Search")
|
123 |
+
demo_link_block("🛍️","Agentic Shopping Assistant", "AI_Shopping_Assistant")
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
# Header with logo and title
|
129 |
extra, col_logo, col_title = st.columns([3,34, 63])
|
130 |
with col_logo:
|