Skip to content

Commit cc0a010

Browse files
fix: standardize internal API communication across all pages
1 parent 6be91fd commit cc0a010

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

β€Žfrontend/pages/1_Predict_Dashboard.pyβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
st.set_page_config(page_title="Predict Patient Health", page_icon="🩺", layout="wide")
77
API_URL = os.getenv("API_URL", "http://localhost:8000")
8+
if "hf.space" in os.getenv("SPACE_ID", ""):
9+
API_URL = "http://localhost:8000"
810

911
st.title("🩺 Patient Edge Prediction Simulation")
1012

β€Žfrontend/pages/4_Patient_History.pyβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
st.set_page_config(page_title="Patient History", page_icon="πŸ—„οΈ", layout="wide")
77
API_URL = os.getenv("API_URL", "http://localhost:8000")
8+
if "hf.space" in os.getenv("SPACE_ID", ""):
9+
API_URL = "http://localhost:8000"
810

911
st.title("πŸ—„οΈ Patient Prediction History")
1012
st.markdown("Live database of all patient predictions and vitals logged by the system. Auto-refreshes every 5 seconds.")

β€Žfrontend/pages/5_MLOps_Settings.pyβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
st.set_page_config(page_title="MLOps Settings", page_icon="πŸ”„", layout="wide")
66
API_URL = os.getenv("API_URL", "http://localhost:8000")
7+
if "hf.space" in os.getenv("SPACE_ID", ""):
8+
API_URL = "http://localhost:8000"
79

810
st.title("πŸ”„ MLOps & Retraining")
911
st.markdown("Dynamically update the TinyML ensemble models by providing a new dataset.")

0 commit comments

Comments
Β (0)