vsouza commited on
Commit ·
ba781e2
1
Parent(s): 07707d9
remove unused templates
Browse files- .streamlit/config.toml +5 -0
- app.py +3 -19
- components/template0.py +0 -81
- components/template1.py +0 -81
- components/template2.py +0 -80
- components/template3.py +0 -57
- components/template4.py +0 -70
- components/template5.py +0 -50
- components/template7.py +0 -24
- components/template8.py +0 -81
.streamlit/config.toml
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[theme]
|
| 2 |
+
base="dark"
|
| 3 |
+
primaryColor="#3fb0e8"
|
| 4 |
+
#primaryColor="#0775db"
|
| 5 |
+
#secondaryBackgroundColor="#2353A1"
|
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from components import sidebar,
|
| 3 |
|
| 4 |
def main():
|
| 5 |
|
|
@@ -11,26 +11,10 @@ def main():
|
|
| 11 |
)
|
| 12 |
|
| 13 |
sidebar.sidebar_head()
|
| 14 |
-
page = st.sidebar.selectbox("Select page", ['
|
| 15 |
st.sidebar.markdown('---')
|
| 16 |
-
if page == '
|
| 17 |
-
template0.run()
|
| 18 |
-
if page == 'Template 1':
|
| 19 |
-
template1.run()
|
| 20 |
-
if page == 'Template 2':
|
| 21 |
-
template2.run()
|
| 22 |
-
if page == 'Template 3':
|
| 23 |
-
template3.run()
|
| 24 |
-
if page == 'Template 4':
|
| 25 |
-
template4.run()
|
| 26 |
-
if page == 'Template 5':
|
| 27 |
-
template5.run()
|
| 28 |
-
if page == 'Template 6':
|
| 29 |
template6.run()
|
| 30 |
-
if page == 'Template 7':
|
| 31 |
-
template7.run()
|
| 32 |
-
if page == 'Template 8':
|
| 33 |
-
template8.run()
|
| 34 |
|
| 35 |
if __name__ == '__main__':
|
| 36 |
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from components import sidebar, template6
|
| 3 |
|
| 4 |
def main():
|
| 5 |
|
|
|
|
| 11 |
)
|
| 12 |
|
| 13 |
sidebar.sidebar_head()
|
| 14 |
+
page = st.sidebar.selectbox("Select page", ['Main'])
|
| 15 |
st.sidebar.markdown('---')
|
| 16 |
+
if page == 'Main':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
template6.run()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
if __name__ == '__main__':
|
| 20 |
main()
|
components/template0.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import base64
|
| 3 |
-
from components import utils
|
| 4 |
-
|
| 5 |
-
def run():
|
| 6 |
-
with open('images/logo2.png', 'rb') as f:
|
| 7 |
-
data = f.read()
|
| 8 |
-
bin_str = base64.b64encode(data).decode()
|
| 9 |
-
st.markdown(f'<div class="header"> <figure><embed type="image/png" src="data:image/png;base64,{bin_str}" width="800px" height="200px"/></div>', unsafe_allow_html=True)
|
| 10 |
-
|
| 11 |
-
# Initial State
|
| 12 |
-
def initial_state():
|
| 13 |
-
if 'model' not in st.session_state:
|
| 14 |
-
st.session_state['model'] = False
|
| 15 |
-
|
| 16 |
-
if 'uploading_way' not in st.session_state:
|
| 17 |
-
st.session_state['uploading_way'] = None
|
| 18 |
-
|
| 19 |
-
initial_state()
|
| 20 |
-
|
| 21 |
-
col1, col2, col3 = st.columns([0.25,1,0.25])
|
| 22 |
-
utils.new_line(2)
|
| 23 |
-
|
| 24 |
-
# Description
|
| 25 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 26 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 27 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 28 |
-
st.divider()
|
| 29 |
-
|
| 30 |
-
# Dataframe selection
|
| 31 |
-
st.markdown("<h2 align='center'> <b> Getting Started", unsafe_allow_html=True)
|
| 32 |
-
utils.new_line(1)
|
| 33 |
-
st.write("The first step is to upload your data. You can upload your data in three ways: **Upload File**, **Select from Ours**, and **Download URL**. In all ways the data should be a csv file and should not exceed 200 MB.")
|
| 34 |
-
utils.new_line(1)
|
| 35 |
-
|
| 36 |
-
# Uploading Way
|
| 37 |
-
uploading_way = st.session_state.uploading_way
|
| 38 |
-
col1, col2, col3 = st.columns(3,gap='large')
|
| 39 |
-
|
| 40 |
-
# Upload
|
| 41 |
-
def upload_click(): st.session_state.uploading_way = "upload"
|
| 42 |
-
col1.markdown("<h5 align='center'> Upload File", unsafe_allow_html=True)
|
| 43 |
-
col1.button("Upload File", key="upload_file", use_container_width=True, on_click=upload_click)
|
| 44 |
-
|
| 45 |
-
# Select
|
| 46 |
-
def select_click(): st.session_state.uploading_way = "select"
|
| 47 |
-
col2.markdown("<h5 align='center'> Select from Ours", unsafe_allow_html=True)
|
| 48 |
-
col2.button("Select from Ours", key="select_from_ours", use_container_width=True, on_click=select_click)
|
| 49 |
-
|
| 50 |
-
# URL
|
| 51 |
-
def url_click(): st.session_state.uploading_way = "url"
|
| 52 |
-
col3.markdown("<h5 align='center'> Download URL", unsafe_allow_html=True)
|
| 53 |
-
col3.button("Download URL", key="write_url", use_container_width=True, on_click=url_click)
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
# Upload
|
| 57 |
-
if uploading_way == "upload":
|
| 58 |
-
uploaded_file = st.file_uploader("Upload the Dataset", type="csv")
|
| 59 |
-
if uploaded_file:
|
| 60 |
-
pass
|
| 61 |
-
# Select
|
| 62 |
-
elif uploading_way == "select":
|
| 63 |
-
selected = st.selectbox("Select Dataset", ["Select", "Sample 1", "Sample 2", "Sample 3", "Sample 4"])
|
| 64 |
-
if selected == "Sample 1":
|
| 65 |
-
pass
|
| 66 |
-
elif selected == "Sample 2":
|
| 67 |
-
pass
|
| 68 |
-
elif selected == "Sample 3":
|
| 69 |
-
pass
|
| 70 |
-
elif selected == "Sample 4":
|
| 71 |
-
pass
|
| 72 |
-
# URL
|
| 73 |
-
elif uploading_way == "url":
|
| 74 |
-
url = st.text_input("Enter URL to download the dataset")
|
| 75 |
-
if url:
|
| 76 |
-
pass
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
utils.local_css("test1.css")
|
| 80 |
-
|
| 81 |
-
utils.add_header('images/background2.png')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template1.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import base64
|
| 3 |
-
from components import utils
|
| 4 |
-
|
| 5 |
-
def run():
|
| 6 |
-
with open('images/logo2.png', 'rb') as f:
|
| 7 |
-
data = f.read()
|
| 8 |
-
bin_str = base64.b64encode(data).decode()
|
| 9 |
-
st.markdown(f'<div class="header"> <figure><embed type="image/png" src="data:image/png;base64,{bin_str}" width="800px" height="200px"/></div>', unsafe_allow_html=True)
|
| 10 |
-
|
| 11 |
-
# Initial State
|
| 12 |
-
def initial_state():
|
| 13 |
-
if 'model' not in st.session_state:
|
| 14 |
-
st.session_state['model'] = False
|
| 15 |
-
|
| 16 |
-
if 'uploading_way' not in st.session_state:
|
| 17 |
-
st.session_state['uploading_way'] = None
|
| 18 |
-
|
| 19 |
-
initial_state()
|
| 20 |
-
|
| 21 |
-
col1, col2, col3 = st.columns([0.25,1,0.25])
|
| 22 |
-
utils.new_line(2)
|
| 23 |
-
|
| 24 |
-
# Description
|
| 25 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 26 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 27 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 28 |
-
st.divider()
|
| 29 |
-
|
| 30 |
-
# Dataframe selection
|
| 31 |
-
st.markdown("<h2 align='center'> <b> Getting Started", unsafe_allow_html=True)
|
| 32 |
-
utils.new_line(1)
|
| 33 |
-
st.write("The first step is to upload your data. You can upload your data in three ways: **Upload File**, **Select from Ours**, and **Download URL**. In all ways the data should be a csv file and should not exceed 200 MB.")
|
| 34 |
-
utils.new_line(1)
|
| 35 |
-
|
| 36 |
-
# Uploading Way
|
| 37 |
-
uploading_way = st.session_state.uploading_way
|
| 38 |
-
col1, col2, col3 = st.columns(3,gap='large')
|
| 39 |
-
|
| 40 |
-
# Upload
|
| 41 |
-
def upload_click(): st.session_state.uploading_way = "upload"
|
| 42 |
-
col1.markdown("<h5 align='center'> Upload File", unsafe_allow_html=True)
|
| 43 |
-
col1.button("Upload File", key="upload_file", use_container_width=True, on_click=upload_click)
|
| 44 |
-
|
| 45 |
-
# Select
|
| 46 |
-
def select_click(): st.session_state.uploading_way = "select"
|
| 47 |
-
col2.markdown("<h5 align='center'> Select from Ours", unsafe_allow_html=True)
|
| 48 |
-
col2.button("Select from Ours", key="select_from_ours", use_container_width=True, on_click=select_click)
|
| 49 |
-
|
| 50 |
-
# URL
|
| 51 |
-
def url_click(): st.session_state.uploading_way = "url"
|
| 52 |
-
col3.markdown("<h5 align='center'> Download URL", unsafe_allow_html=True)
|
| 53 |
-
col3.button("Download URL", key="write_url", use_container_width=True, on_click=url_click)
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
# Upload
|
| 57 |
-
if uploading_way == "upload":
|
| 58 |
-
uploaded_file = st.file_uploader("Upload the Dataset", type="csv")
|
| 59 |
-
if uploaded_file:
|
| 60 |
-
pass
|
| 61 |
-
# Select
|
| 62 |
-
elif uploading_way == "select":
|
| 63 |
-
selected = st.selectbox("Select Dataset", ["Select", "Sample 1", "Sample 2", "Sample 3", "Sample 4"])
|
| 64 |
-
if selected == "Sample 1":
|
| 65 |
-
pass
|
| 66 |
-
elif selected == "Sample 2":
|
| 67 |
-
pass
|
| 68 |
-
elif selected == "Sample 3":
|
| 69 |
-
pass
|
| 70 |
-
elif selected == "Sample 4":
|
| 71 |
-
pass
|
| 72 |
-
# URL
|
| 73 |
-
elif uploading_way == "url":
|
| 74 |
-
url = st.text_input("Enter URL to download the dataset")
|
| 75 |
-
if url:
|
| 76 |
-
pass
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
utils.local_css("test.css")
|
| 80 |
-
|
| 81 |
-
utils.add_header('images/background2.png')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template2.py
DELETED
|
@@ -1,80 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import base64
|
| 3 |
-
from components import utils
|
| 4 |
-
|
| 5 |
-
def run():
|
| 6 |
-
with open('images/logo1.png', 'rb') as f:
|
| 7 |
-
data = f.read()
|
| 8 |
-
bin_str = base64.b64encode(data).decode()
|
| 9 |
-
st.markdown(f'<div class="header"> <figure><embed type="image/png" src="data:image/png;base64,{bin_str}" width="800px" height="200px"/></div>', unsafe_allow_html=True)
|
| 10 |
-
|
| 11 |
-
# Initial State
|
| 12 |
-
def initial_state():
|
| 13 |
-
if 'model' not in st.session_state:
|
| 14 |
-
st.session_state['model'] = False
|
| 15 |
-
|
| 16 |
-
if 'uploading_way' not in st.session_state:
|
| 17 |
-
st.session_state['uploading_way'] = None
|
| 18 |
-
|
| 19 |
-
initial_state()
|
| 20 |
-
|
| 21 |
-
col1, col2, col3 = st.columns([0.25,1,0.25])
|
| 22 |
-
utils.new_line(2)
|
| 23 |
-
|
| 24 |
-
# Description
|
| 25 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 26 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 27 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 28 |
-
st.divider()
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
# Dataframe selection
|
| 32 |
-
st.markdown("<h2 align='center'> <b> Getting Started", unsafe_allow_html=True)
|
| 33 |
-
utils.new_line(1)
|
| 34 |
-
st.write("The first step is to upload your data. You can upload your data in three ways: **Upload File**, **Select from Ours**, and **Download URL**. In all ways the data should be a csv file and should not exceed 200 MB.")
|
| 35 |
-
utils.new_line(1)
|
| 36 |
-
|
| 37 |
-
# Uploading Way
|
| 38 |
-
uploading_way = st.session_state.uploading_way
|
| 39 |
-
col1, col2, col3 = st.columns(3,gap='large')
|
| 40 |
-
|
| 41 |
-
# Upload
|
| 42 |
-
def upload_click(): st.session_state.uploading_way = "upload"
|
| 43 |
-
col1.markdown("<h5 align='center'> Upload File", unsafe_allow_html=True)
|
| 44 |
-
col1.button("Upload File", key="upload_file", use_container_width=True, on_click=upload_click)
|
| 45 |
-
|
| 46 |
-
# Select
|
| 47 |
-
def select_click(): st.session_state.uploading_way = "select"
|
| 48 |
-
col2.markdown("<h5 align='center'> Select from Ours", unsafe_allow_html=True)
|
| 49 |
-
col2.button("Select from Ours", key="select_from_ours", use_container_width=True, on_click=select_click)
|
| 50 |
-
|
| 51 |
-
# URL
|
| 52 |
-
def url_click(): st.session_state.uploading_way = "url"
|
| 53 |
-
col3.markdown("<h5 align='center'> Download URL", unsafe_allow_html=True)
|
| 54 |
-
col3.button("Download URL", key="write_url", use_container_width=True, on_click=url_click)
|
| 55 |
-
|
| 56 |
-
# Upload
|
| 57 |
-
if uploading_way == "upload":
|
| 58 |
-
uploaded_file = st.file_uploader("Upload the Dataset", type="csv")
|
| 59 |
-
if uploaded_file:
|
| 60 |
-
pass
|
| 61 |
-
# Select
|
| 62 |
-
elif uploading_way == "select":
|
| 63 |
-
selected = st.selectbox("Select Dataset", ["Select", "Sample 1", "Sample 2", "Sample 3", "Sample 4"])
|
| 64 |
-
if selected == "Sample 1":
|
| 65 |
-
pass
|
| 66 |
-
elif selected == "Sample 2":
|
| 67 |
-
pass
|
| 68 |
-
elif selected == "Sample 3":
|
| 69 |
-
pass
|
| 70 |
-
elif selected == "Sample 4":
|
| 71 |
-
pass
|
| 72 |
-
# URL
|
| 73 |
-
elif uploading_way == "url":
|
| 74 |
-
url = st.text_input("Enter URL to download the dataset")
|
| 75 |
-
if url:
|
| 76 |
-
pass
|
| 77 |
-
|
| 78 |
-
utils.local_css("test.css")
|
| 79 |
-
|
| 80 |
-
utils.add_header('images/background3.png')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template3.py
DELETED
|
@@ -1,57 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import os
|
| 3 |
-
from components import utils
|
| 4 |
-
|
| 5 |
-
def run():
|
| 6 |
-
# Connect to OpenAI GPT-3, fetch API key from Streamlit secrets
|
| 7 |
-
#openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 8 |
-
# Design move app further up and remove top padding
|
| 9 |
-
st.markdown('''<style>.css-1egvi7u {margin-top: -4rem;}</style>''',
|
| 10 |
-
unsafe_allow_html=True)
|
| 11 |
-
# Design change hyperlink href link color
|
| 12 |
-
st.markdown('''<style>.css-znku1x a {color: #9d03fc;}</style>''',
|
| 13 |
-
unsafe_allow_html=True) # darkmode
|
| 14 |
-
st.markdown('''<style>.css-znku1x a {color: #9d03fc;}</style>''',
|
| 15 |
-
unsafe_allow_html=True) # lightmode
|
| 16 |
-
# Design change height of text input fields headers
|
| 17 |
-
st.markdown('''<style>.css-qrbaxs {min-height: 0.0rem;}</style>''',
|
| 18 |
-
unsafe_allow_html=True)
|
| 19 |
-
# Design change spinner color to primary color
|
| 20 |
-
st.markdown('''<style>.stSpinner > div > div {border-top-color: #9d03fc;}</style>''',
|
| 21 |
-
unsafe_allow_html=True)
|
| 22 |
-
# Design change min height of text input box
|
| 23 |
-
st.markdown('''<style>.css-15tx938{min-height: 0.0rem;}</style>''',
|
| 24 |
-
unsafe_allow_html=True)
|
| 25 |
-
# Design hide top header line
|
| 26 |
-
#hide_decoration_bar_style = '''<style>header {visibility: hidden;}</style>'''
|
| 27 |
-
#st.markdown(hide_decoration_bar_style, unsafe_allow_html=True)
|
| 28 |
-
# Design hide "made with streamlit" footer menu area
|
| 29 |
-
#hide_streamlit_footer = """<style>#MainMenu {visibility: hidden;}
|
| 30 |
-
# footer {visibility: hidden;}</style>"""
|
| 31 |
-
#st.markdown(hide_streamlit_footer, unsafe_allow_html=True)
|
| 32 |
-
|
| 33 |
-
st.image('images/logo2.png') # TITLE and Creator information
|
| 34 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 35 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 36 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 37 |
-
|
| 38 |
-
st.write('\n') # add spacing
|
| 39 |
-
|
| 40 |
-
st.subheader('\nGetting Started\n')
|
| 41 |
-
with st.expander("Dataset Upload", expanded=False):
|
| 42 |
-
uploaded_file = st.file_uploader('File uploader', type=["csv", "txt", "json"])
|
| 43 |
-
if uploaded_file:
|
| 44 |
-
pass
|
| 45 |
-
else:
|
| 46 |
-
st.info("Please upload a file to get started.", icon='⚠')
|
| 47 |
-
|
| 48 |
-
with st.expander("Select from ours", expanded=False):
|
| 49 |
-
selected = st.selectbox("Select Dataset", ["Select", "Sample 1", "Sample 2", "Sample 3", "Sample 4"])
|
| 50 |
-
if selected == "Sample 1":
|
| 51 |
-
pass
|
| 52 |
-
elif selected == "Sample 2":
|
| 53 |
-
pass
|
| 54 |
-
elif selected == "Sample 3":
|
| 55 |
-
pass
|
| 56 |
-
elif selected == "Sample 4":
|
| 57 |
-
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template4.py
DELETED
|
@@ -1,70 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
from components import utils
|
| 3 |
-
|
| 4 |
-
def run():
|
| 5 |
-
st.markdown("# 🫀 Life Pulse AI")
|
| 6 |
-
# Initial State
|
| 7 |
-
def initial_state():
|
| 8 |
-
if 'model' not in st.session_state:
|
| 9 |
-
st.session_state['model'] = False
|
| 10 |
-
|
| 11 |
-
if 'uploading_way' not in st.session_state:
|
| 12 |
-
st.session_state['uploading_way'] = None
|
| 13 |
-
|
| 14 |
-
initial_state()
|
| 15 |
-
|
| 16 |
-
col1, col2, col3 = st.columns([0.25,1,0.25])
|
| 17 |
-
|
| 18 |
-
# Description
|
| 19 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 20 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 21 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 22 |
-
st.divider()
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
# Dataframe selection
|
| 26 |
-
st.markdown("<h2 align='center'> <b> Getting Started", unsafe_allow_html=True)
|
| 27 |
-
utils.new_line(1)
|
| 28 |
-
st.write("The first step is to upload your data. You can upload your data in three ways: **Upload File**, **Select from Ours**, and **Download URL**. In all ways the data should be a csv file and should not exceed 200 MB.")
|
| 29 |
-
utils.new_line(1)
|
| 30 |
-
|
| 31 |
-
# Uploading Way
|
| 32 |
-
uploading_way = st.session_state.uploading_way
|
| 33 |
-
col1, col2, col3 = st.columns(3,gap='large')
|
| 34 |
-
|
| 35 |
-
# Upload
|
| 36 |
-
def upload_click(): st.session_state.uploading_way = "upload"
|
| 37 |
-
col1.markdown("<h5 align='center'> Upload File", unsafe_allow_html=True)
|
| 38 |
-
col1.button("Upload File", key="upload_file", use_container_width=True, on_click=upload_click)
|
| 39 |
-
|
| 40 |
-
# Select
|
| 41 |
-
def select_click(): st.session_state.uploading_way = "select"
|
| 42 |
-
col2.markdown("<h5 align='center'> Select from Ours", unsafe_allow_html=True)
|
| 43 |
-
col2.button("Select from Ours", key="select_from_ours", use_container_width=True, on_click=select_click)
|
| 44 |
-
|
| 45 |
-
# URL
|
| 46 |
-
def url_click(): st.session_state.uploading_way = "url"
|
| 47 |
-
col3.markdown("<h5 align='center'> Download URL", unsafe_allow_html=True)
|
| 48 |
-
col3.button("Download URL", key="write_url", use_container_width=True, on_click=url_click)
|
| 49 |
-
|
| 50 |
-
# Upload
|
| 51 |
-
if uploading_way == "upload":
|
| 52 |
-
uploaded_file = st.file_uploader("Upload the Dataset", type="csv")
|
| 53 |
-
if uploaded_file:
|
| 54 |
-
pass
|
| 55 |
-
# Select
|
| 56 |
-
elif uploading_way == "select":
|
| 57 |
-
selected = st.selectbox("Select Dataset", ["Select", "Sample 1", "Sample 2", "Sample 3", "Sample 4"])
|
| 58 |
-
if selected == "Sample 1":
|
| 59 |
-
pass
|
| 60 |
-
elif selected == "Sample 2":
|
| 61 |
-
pass
|
| 62 |
-
elif selected == "Sample 3":
|
| 63 |
-
pass
|
| 64 |
-
elif selected == "Sample 4":
|
| 65 |
-
pass
|
| 66 |
-
# URL
|
| 67 |
-
elif uploading_way == "url":
|
| 68 |
-
url = st.text_input("Enter URL to download the dataset")
|
| 69 |
-
if url:
|
| 70 |
-
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template5.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
def run():
|
| 4 |
-
st.markdown("# 🫀 Life Pulse AI")
|
| 5 |
-
st.markdown("---")
|
| 6 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 7 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 8 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 9 |
-
st.divider()
|
| 10 |
-
gallery_tab, upload_tab, url_tab = st.tabs(["Samples", "Upload", "Download URL"])
|
| 11 |
-
with gallery_tab:
|
| 12 |
-
options = ["Sample 1", "Sample 2", "Sample 3", "Sample 4"]
|
| 13 |
-
file_name = st.selectbox("Select Dataset",
|
| 14 |
-
options=options, index=options.index("Sample 1"))
|
| 15 |
-
#file = gallery_dict[file_name]
|
| 16 |
-
|
| 17 |
-
if st.session_state.get("file_uploader") is not None:
|
| 18 |
-
st.warning("To use the Gallery, remove the uploaded image first.")
|
| 19 |
-
if st.session_state.get("dataset_url") not in ["", None]:
|
| 20 |
-
st.warning("To use the Gallery, remove the image URL first.")
|
| 21 |
-
|
| 22 |
-
#img = Image.open(file)
|
| 23 |
-
|
| 24 |
-
with upload_tab:
|
| 25 |
-
file = st.file_uploader("Upload Dataset", key="file_uploader")
|
| 26 |
-
if file is not None:
|
| 27 |
-
try:
|
| 28 |
-
pass
|
| 29 |
-
except:
|
| 30 |
-
st.error("The file you uploaded does not seem to be a valid dataset. Try uploading a CSV or txt file.")
|
| 31 |
-
if st.session_state.get("image_url") not in ["", None]:
|
| 32 |
-
st.warning("To use the file uploader, remove the URL first.")
|
| 33 |
-
|
| 34 |
-
with url_tab:
|
| 35 |
-
url_text = st.empty()
|
| 36 |
-
|
| 37 |
-
# FIXME: the button is a bit buggy, but it's worth fixing this later
|
| 38 |
-
|
| 39 |
-
# url_reset = st.button("Clear URL", key="url_reset")
|
| 40 |
-
# if url_reset and "image_url" in st.session_state:
|
| 41 |
-
# st.session_state["image_url"] = ""
|
| 42 |
-
# st.write(st.session_state["image_url"])
|
| 43 |
-
|
| 44 |
-
url = url_text.text_input("Enter URL to download the dataset", key="dataset_url")
|
| 45 |
-
|
| 46 |
-
if url!="":
|
| 47 |
-
try:
|
| 48 |
-
pass
|
| 49 |
-
except:
|
| 50 |
-
st.error("The URL does not seem to be valid.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template7.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
def run():
|
| 5 |
-
# Title
|
| 6 |
-
st.title("🫀 Life Pulse AI")
|
| 7 |
-
|
| 8 |
-
# Question
|
| 9 |
-
question = "Do you have datasets (e.g., ECG heartbeat categorization) to upload for analysis?"
|
| 10 |
-
choice = st.selectbox(question, ("Yes", "No, but I want to demo the software"))
|
| 11 |
-
|
| 12 |
-
if choice == "Yes":
|
| 13 |
-
# Display upload option
|
| 14 |
-
uploaded_file = st.file_uploader("Upload your document:", type=["txt", "pdf", "docx"])
|
| 15 |
-
if uploaded_file is not None:
|
| 16 |
-
st.success("Document uploaded successfully!")
|
| 17 |
-
# Perform analysis on the uploaded document here
|
| 18 |
-
else:
|
| 19 |
-
# Display analysis type selection
|
| 20 |
-
if st.button("Perform Analysis"):
|
| 21 |
-
# Perform the selected analysis here
|
| 22 |
-
st.info(f"Performing {analysis_type} analysis...")
|
| 23 |
-
|
| 24 |
-
# Optionally, you can add more instructions or information here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components/template8.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import base64
|
| 3 |
-
from components import utils
|
| 4 |
-
|
| 5 |
-
def run():
|
| 6 |
-
with open('images/logo2.png', 'rb') as f:
|
| 7 |
-
data = f.read()
|
| 8 |
-
bin_str = base64.b64encode(data).decode()
|
| 9 |
-
st.markdown(f'<div class="header"> <figure><embed type="image/png" src="data:image/png;base64,{bin_str}" width="800px" height="200px"/></div>', unsafe_allow_html=True)
|
| 10 |
-
|
| 11 |
-
# Initial State
|
| 12 |
-
def initial_state():
|
| 13 |
-
if 'model' not in st.session_state:
|
| 14 |
-
st.session_state['model'] = False
|
| 15 |
-
|
| 16 |
-
if 'uploading_way' not in st.session_state:
|
| 17 |
-
st.session_state['uploading_way'] = None
|
| 18 |
-
|
| 19 |
-
initial_state()
|
| 20 |
-
|
| 21 |
-
col1, col2, col3 = st.columns([0.25,1,0.25])
|
| 22 |
-
utils.new_line(2)
|
| 23 |
-
|
| 24 |
-
# Description
|
| 25 |
-
st.markdown("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
| 26 |
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
| 27 |
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,""", unsafe_allow_html=True)
|
| 28 |
-
st.divider()
|
| 29 |
-
|
| 30 |
-
# Dataframe selection
|
| 31 |
-
st.markdown("<h2 align='center'> <b> Getting Started", unsafe_allow_html=True)
|
| 32 |
-
utils.new_line(1)
|
| 33 |
-
st.write("The first step is to upload your data. You can upload your data in three ways: **Upload File**, **Select from Ours**, and **Download URL**. In all ways the data should be a csv file and should not exceed 200 MB.")
|
| 34 |
-
utils.new_line(1)
|
| 35 |
-
|
| 36 |
-
# Uploading Way
|
| 37 |
-
uploading_way = st.session_state.uploading_way
|
| 38 |
-
col1, col2, col3 = st.columns(3,gap='large')
|
| 39 |
-
|
| 40 |
-
# Upload
|
| 41 |
-
def upload_click(): st.session_state.uploading_way = "upload"
|
| 42 |
-
col1.markdown("<h5 align='center'> Upload File", unsafe_allow_html=True)
|
| 43 |
-
col1.button("Upload File", key="upload_file", use_container_width=True, on_click=upload_click)
|
| 44 |
-
|
| 45 |
-
# Select
|
| 46 |
-
def select_click(): st.session_state.uploading_way = "select"
|
| 47 |
-
col2.markdown("<h5 align='center'> Select from Ours", unsafe_allow_html=True)
|
| 48 |
-
col2.button("Select from Ours", key="select_from_ours", use_container_width=True, on_click=select_click)
|
| 49 |
-
|
| 50 |
-
# URL
|
| 51 |
-
def url_click(): st.session_state.uploading_way = "url"
|
| 52 |
-
col3.markdown("<h5 align='center'> Download URL", unsafe_allow_html=True)
|
| 53 |
-
col3.button("Download URL", key="write_url", use_container_width=True, on_click=url_click)
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
# Upload
|
| 57 |
-
if uploading_way == "upload":
|
| 58 |
-
uploaded_file = st.file_uploader("Upload the Dataset", type="csv")
|
| 59 |
-
if uploaded_file:
|
| 60 |
-
pass
|
| 61 |
-
# Select
|
| 62 |
-
elif uploading_way == "select":
|
| 63 |
-
selected = st.selectbox("Select Dataset", ["Select", "Sample 1", "Sample 2", "Sample 3", "Sample 4"])
|
| 64 |
-
if selected == "Sample 1":
|
| 65 |
-
pass
|
| 66 |
-
elif selected == "Sample 2":
|
| 67 |
-
pass
|
| 68 |
-
elif selected == "Sample 3":
|
| 69 |
-
pass
|
| 70 |
-
elif selected == "Sample 4":
|
| 71 |
-
pass
|
| 72 |
-
# URL
|
| 73 |
-
elif uploading_way == "url":
|
| 74 |
-
url = st.text_input("Enter URL to download the dataset")
|
| 75 |
-
if url:
|
| 76 |
-
pass
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
utils.local_css("test2.css")
|
| 80 |
-
|
| 81 |
-
utils.add_header('images/background2.png')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|