Revenue_Prediction / README.md
sudhirpgcmma02's picture
Upload folder using huggingface_hub
c7da406 verified
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 check
  • POST /predict -> JSON with store_id and features or features_list
  • POST /predict_batch -> multipart CSV with store_id column

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)

  1. Create a new SpaceDocker → name: superkart-backend.
  2. Upload files in this folder (including Dockerfile).
  3. Add your trained models/ directory:
    models/
      store_101/
        RandomForest.joblib
        metadata.json
      store_102/
        XGBoost.joblib
        metadata.json
    
  4. The Space will build and expose the API at: https://Sales-prediction-sudhirpgcmma02.hf.space