Spaces:
Runtime error
Runtime error
A newer version of the Streamlit SDK is available: 1.59.2
metadata
title: MLOps Mid Exam - Shipping Delay Prediction
emoji: 📦
colorFrom: blue
colorTo: purple
sdk: streamlit
app_file: deployment/app.py
pinned: false
MLOps Mid Exam – Shipping Delay Prediction
A lightweight MLOps project that predicts whether a shipment will arrive on time. The model is a scikit-learn pipeline (KNN + preprocessing) and the Streamlit app is deployed to Hugging Face Spaces while CI keeps the training artifacts healthy.
- Demo: https://huggingface.co/spaces/vorddd/MLOps-MidExam
- Model repo:
vorddd/shipping-delay-knn
How It Works
- The training notebook exports
models/best_model_pipeline.joblib. deployment/prediction.pyloads that file frommodels/during development and from the Hugging Face Hub in production (viahf_hub_download).deployment/app.pystitches a simple overview page, an EDA tab (deployment/eda.py), and the prediction form.- Runtime dependencies live in
deployment/requirements.txt; dev/test tooling stays inrequirements-dev.txt.
Run Locally
python -m venv .venv
.venv\Scripts\activate # or source .venv/bin/activate
pip install -r deployment/requirements.txt -r requirements-dev.txt
streamlit run deployment/app.py
Place the exported pipelines inside models/ (already ignored in CD) and Streamlit will use them automatically. pytest runs the quick smoke tests.
CI/CD
- CI (
.github/workflows/ci.yml): runs on pushes/PRs tomain, installs runtime + dev requirements, then executespytest. - CD (
.github/workflows/cd.yml): mirrors the minimal app bundle (README +deployment/folder + requirements) into a temp directory and force-pushes it to the Hugging Face Spacevorddd/MLOps-MidExamwithHF_TOKEN. If the token is missing, the deploy step exits gracefully.
This setup keeps the repository easy to iterate on locally while ensuring the public app always downloads the latest pipeline from the Hub.