-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
56 lines (47 loc) · 1.76 KB
/
app.py
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
import streamlit as st
from ui_components import render_sidebar, render_main_content
from analysis import analyze_columns
from category_descriptions import render_category_descriptions
from testbench import render_testbench
from sentence_transformers import SentenceTransformer
def main():
"""
Main function to set up and run the Streamlit application.
This function configures the page, applies custom CSS, renders the sidebar and main content,
handles the analysis rerun if needed, and adds the category descriptions and testbench sections.
"""
st.set_page_config(page_title="ClassiFly", layout="wide")
# Load the Sentence Transformers model at startup
if 'sentence_transformer_model' not in st.session_state:
st.session_state.sentence_transformer_model = SentenceTransformer('all-MiniLM-L6-v2')
# Apply custom CSS
st.markdown("""
<style>
.streamlit-expanderHeader {
font-size: 1.2rem !important;
font-weight: 600 !important;
}
.streamlit-expanderContent {
font-size: 1rem !important;
}
/* Hide progress bar text */
.stProgress > div > div > div > div {
display: none !important;
}
/* Optionally, adjust the height of the progress bar */
.stProgress > div > div > div {
height: 10px !important;
}
</style>
""", unsafe_allow_html=True)
render_sidebar()
render_main_content()
if st.session_state.get('rerun_analysis', False):
analyze_columns()
st.session_state.rerun_analysis = False
# Add the category descriptions section
render_category_descriptions()
# Always render the testbench
render_testbench()
if __name__ == "__main__":
main()