"""drAIML 2.0.0 โ open healthcare consultation. Runs in the browser via stlite on huggingface.co/spaces/PYTHAI/drAIML.""" import os import streamlit as st from draiml import __version__, state st.set_page_config(page_title="drAIML โ open healthcare consultation", page_icon="โ๏ธ", layout="wide") if "hf_token" not in st.session_state: # token handed over by the page's "Sign in with Hugging Face" st.session_state.hf_token = os.environ.get("HF_TOKEN") or "" st.session_state.hf_user = os.environ.get("HF_USER") or "" st.session_state.hf_oauth = bool(st.session_state.hf_token) state.start_loading() # fetch the evidence index in the background while the visitor reads/types pages = [ st.Page("views/consult.py", title="Consultation", icon="๐ฉบ", default=True), st.Page("views/evidence.py", title="Evidence search", icon="๐"), st.Page("views/models.py", title="Models", icon="๐ง "), st.Page("views/datasets.py", title="Datasets", icon="๐"), st.Page("views/about.py", title="About ยท Oath", icon="โ๏ธ"), ] nav = st.navigation(pages) with st.sidebar: st.markdown(f"### โ๏ธ drAIML `{__version__}`") if st.session_state.hf_oauth: st.caption(f"Signed in as **{st.session_state.hf_user or 'Hugging Face user'}** โ hosted models bill your HF account.") else: st.caption("Not signed in. Browse freely; to consult a hosted model, sign in with Hugging Face " "(top bar) or bring a key.") nav.run() st.markdown( "