Spaces:
Runtime error
Runtime error
metadata
title: SuperKart Backend API
emoji: ⚙️
colorFrom: blue
colorTo: purple
sdk: docker
app_file: api.py
pinned: false
SuperKart Backend
This is the Flask backend that serves trained models for sales forecasting.
SuperKart Backend (Flask API)
Endpoints:
GET /health-> health checkPOST /predict-> JSON withstore_idandfeaturesorfeatures_listPOST /predict_batch-> multipart CSV withstore_idcolumn
Run locally
pip install -r requirements.txt
export PORT=7860
python api.py
# or gunicorn
gunicorn -b 0.0.0.0:$PORT api:app --workers 2 --threads 8 --timeout 180
Deploy to Hugging Face Spaces (Docker)
- Create a new Space → Docker → name:
superkart-backend. - Upload files in this folder (including
Dockerfile). - Add your trained
models/directory:models/ store_101/ RandomForest.joblib metadata.json store_102/ XGBoost.joblib metadata.json - The Space will build and expose the API at:
https://Sales-prediction-sudhirpgcmma02.hf.space