Spaces:
Sleeping
Sleeping
import streamlit as st | |
from start_page import main as start_page | |
# Import other pages. Assume each has a main function to run the page. | |
from pages.data_source_config import main as data_source_config | |
from pages.data_loading import main as data_loading | |
# Add imports for other pages similarly... | |
# Initialize session state for page navigation if not already set | |
if 'page' not in st.session_state: | |
st.session_state.page = 'start_page' | |
# Define a function to change the page | |
def change_page(page_name): | |
st.session_state.page = page_name | |
# Page selection (could also use st.sidebar for these) | |
st.sidebar.title("Navigation") | |
st.sidebar.button("Start Page", on_click=change_page, args=('start_page',)) | |
st.sidebar.button("Data Source Configuration", on_click=change_page, args=('data_source_config',)) | |
st.sidebar.button("Data Loading", on_click=change_page, args=('data_loading',)) | |
# Add buttons for other pages similarly... | |
# Page dispatch | |
if st.session_state.page == 'start_page': | |
start_page() | |
elif st.session_state.page == 'data_source_config': | |
data_source_config() | |
elif st.session_state.page == 'data_loading': | |
data_loading() | |
elif st.session_state.page == 'model_selection': | |
model_selection() | |
elif st.session_state.page == 'processing_embedding': | |
processing_embedding() | |
# The above could be optimized by mapping page names to functions | |