Spaces:
Sleeping
Sleeping
model path
Browse files- requirements.txt +3 -1
- src/streamlit_app.py +19 -2
requirements.txt
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
|
|
| 1 |
pandas
|
| 2 |
numpy
|
| 3 |
scikit-learn
|
| 4 |
streamlit
|
| 5 |
joblib
|
| 6 |
-
matplotlib
|
|
|
|
|
|
| 1 |
+
os
|
| 2 |
pandas
|
| 3 |
numpy
|
| 4 |
scikit-learn
|
| 5 |
streamlit
|
| 6 |
joblib
|
| 7 |
+
matplotlib
|
| 8 |
+
pathlib
|
src/streamlit_app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd, joblib, json
|
| 3 |
|
|
@@ -5,8 +6,24 @@ st.set_page_config(page_title="VO₂ Max & Training Readiness", page_icon="🏃"
|
|
| 5 |
st.title("🏃 VO₂ Max & Training Readiness (Synthetic, Demo)")
|
| 6 |
st.caption("CPU-only • Synthetic data • Not medical advice.")
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
@st.cache_resource
|
| 12 |
def load_model():
|
|
|
|
| 1 |
+
import os, joblib
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd, joblib, json
|
| 4 |
|
|
|
|
| 6 |
st.title("🏃 VO₂ Max & Training Readiness (Synthetic, Demo)")
|
| 7 |
st.caption("CPU-only • Synthetic data • Not medical advice.")
|
| 8 |
|
| 9 |
+
DATA_PATH = "assets/vo2_real_augmented.csv"
|
| 10 |
+
|
| 11 |
+
#MODEL_PATH = "model/vo2_predictor.joblib"
|
| 12 |
+
#MODEL_PATH = os.path.join(os.path.dirname(__file__), "..", "model", "vo2_predictor.joblib")
|
| 13 |
+
|
| 14 |
+
HERE = Path(__file__).resolve().parent
|
| 15 |
+
MODEL_PATH = HERE / "model" / "vo2_predictor.joblib" # src/model/...
|
| 16 |
+
# If your model is at repo_root/model, use: HERE.parent / "model" / "vo2_predictor.joblib"
|
| 17 |
+
|
| 18 |
+
print("CWD:", os.getcwd())
|
| 19 |
+
print("Script dir:", HERE)
|
| 20 |
+
print("Listing script dir:", list(HERE.iterdir()))
|
| 21 |
+
print("Listing model dir:", list((HERE / "model").glob("*")))
|
| 22 |
+
|
| 23 |
+
assert MODEL_PATH.exists(), f"Model not found at: {MODEL_PATH}"
|
| 24 |
+
|
| 25 |
+
pipe = joblib.load(MODEL_PATH)
|
| 26 |
+
|
| 27 |
|
| 28 |
@st.cache_resource
|
| 29 |
def load_model():
|