File size: 843 Bytes
2eeab11 271d9ed 2eeab11 |
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 |
from streamlit import session_state as sst
import asyncio
from pages import landing_page, model_inference_page
if "page" not in sst:
sst['page'] = 'landing_page'
def reset_sst():
for key in list(sst.keys()):
if key != "page" and key != 'device':
sst.pop(key, None)
# Main function to handle navigation
async def main():
"""
Main function that handles the navigation logic based on the current page.
Returns:
None
"""
# Navigation logic
if sst["page"] == "landing_page":
reset_sst() # reset all session state variables before navigating to the landing page
await landing_page() # Call the landing page function
elif sst["page"] == "model_inference_page":
await model_inference_page() # Call the model inference page function
asyncio.run(main()) |