Spaces:
Running
on
T4
Running
on
T4
File size: 2,863 Bytes
2e2dda5 72c9086 2e2dda5 e280474 2e2dda5 e280474 2e2dda5 e280474 2e2dda5 e280474 2e2dda5 e280474 2e2dda5 e280474 2e2dda5 e280474 2e2dda5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
import streamlit as st
from PIL import Image
import base64
import yaml
import os
import urllib.request
import tarfile
import subprocess
from yaml.loader import SafeLoader
st.set_page_config(
layout="wide",
page_icon="/home/ubuntu/images/opensearch_mark_default.png"
)
st.markdown("""<style>
@import url('https://fonts.cdnfonts.com/css/amazon-ember');
</style>
""",unsafe_allow_html=True)
AI_ICON = "images/opensearch-twitter-card.png"
col_0_1,col_0_2,col_0_3= st.columns([10,50,85])
with col_0_1:
st.image(AI_ICON, use_column_width='always')
with col_0_2:
st.markdown('<p style="fontSize:40px;color:#FF9900;fontFamily:\'Amazon Ember Display 500\', sans-serif;">OpenSearch AI demos</p>',unsafe_allow_html=True)
#st.header(":rewind: Demos available")
st.write("")
st.write("")
col_1_1,col_1_2,col_1_3 = st.columns([3,40,65])
with col_1_1:
st.subheader(" ")
with col_1_2:
st.markdown('<p style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Neural Search</p>',unsafe_allow_html=True)
with col_1_3:
demo_1 = st.button("Launch",key = "demo_1")
if(demo_1):
st.switch_page('pages/Semantic_Search.py')
st.write("")
col_2_1,col_2_2,col_2_3 = st.columns([3,40,65])
with col_2_1:
st.subheader(" ")
with col_2_2:
st.markdown('<p style="fontSize:28px;color:#c5c3c0;fontFamily:\'Amazon Ember Cd RC 250\', sans-serif;">Multimodal Conversational Search</p>',unsafe_allow_html=True)
with col_2_3:
demo_2 = st.button("Launch",key = "demo_2")
if(demo_2):
st.switch_page('pages/Multimodal_Conversational_Search.py')
st.write("")
col_3_1,col_3_2,col_3_3 = st.columns([3,40,65])
with col_3_1:
st.subheader(" ")
with col_3_2:
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>
with col_3_3:
demo_3 = st.button("Launch",key = "demo_3")
if(demo_3):
st.switch_page('pages/AI_Shopping_Assistant.py')
isExist = os.path.exists("/home/user/images_retail")
if not isExist:
os.makedirs("/home/user/images_retail")
metadata_file = urllib.request.urlretrieve('https://aws-blogs-artifacts-public.s3.amazonaws.com/BDB-3144/products-data.yml', '/home/user/products.yaml')
img_filename,headers= urllib.request.urlretrieve('https://aws-blogs-artifacts-public.s3.amazonaws.com/BDB-3144/images.tar.gz', '/home/user/images_retail/images.tar.gz')
print(img_filename)
file = tarfile.open('/home/user/images_retail/images.tar.gz')
file.extractall('/home/user/images_retail/')
file.close()
#remove images.tar.gz
os.remove('/home/user/images_retail/images.tar.gz') |