"""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( "
drAIML provides information, not diagnosis. " "It does not replace a clinician. In an emergency call your local emergency number. ยท " "MIT ยท v1 on GitHub
", unsafe_allow_html=True)