|
import streamlit as st
|
|
import importlib.util
|
|
import os
|
|
|
|
st.set_page_config(
|
|
page_title="Tveir",
|
|
page_icon=":fog:",
|
|
)
|
|
|
|
st.sidebar.markdown('Main Page :balloon:')
|
|
st.title(':blue[Tveir]')
|
|
st.write('This is the index page.')
|
|
st.markdown('this is essentially a one-size-fits-all project.')
|
|
|
|
|
|
pages = {
|
|
"Home": None,
|
|
|
|
"Hotdog Page": "pages/2_hotdog.py",
|
|
"HuggingFace Tutorial": "pages/3_hf_tutorial.py",
|
|
"All place": "pages/4_all.py",
|
|
"Uber from Documentation": "pages/5_Uber_from_doc.py"
|
|
}
|
|
|
|
|
|
|
|
selected_page = st.sidebar.selectbox("Select a page", list(pages.keys()))
|
|
|
|
|
|
def load_page(page_path):
|
|
if page_path is not None and os.path.exists(page_path):
|
|
spec = importlib.util.spec_from_file_location("page_module", page_path)
|
|
page_module = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(page_module)
|
|
|
|
|
|
if selected_page in pages:
|
|
load_page(pages[selected_page])
|
|
|