INNER CODE UNIT · Python

load_artifacts

Niketkumardheeryan/ML-CaPsule · Air_quality_prediction/app.py:45

def load_artifacts():
    if not MODEL_PATH.is_file():
        raise FileNotFoundError(
            f"Model artifact not found at {MODEL_PATH}. "
            "Run AQI_pred.ipynb to generate weights.pkl first."
        )
    return joblib.load(MODEL_PATH)

try:
    data = load_artifacts()
except FileNotFoundError as error:
    st.error("The trained AQI model is not available yet.")
    st.info(
        "Open `AQI_pred.ipynb`, run all cells, and confirm that "
        "`weights.pkl` is created in the `Air_quality_prediction` folder."
    )
    st.code(str(error))
    st.stop()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…