YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

ST-GraphMamba Real Inference API

This API uses the exact model architecture and preprocessing from the supplied mohan-trafficpredict.ipynb.

Required files

Place these beside api.py:

  • st_graphmamba_metrla.pt
  • adj_METR-LA.pkl
  • METR-LA.h5

Endpoints

Health

GET /health

Predict from the latest real METR-LA window

GET /predict/latest

This takes the final 24 time steps from METR-LA.h5, applies the same normalization and four time features used during training, and calls the trained ST-GraphMamba model.

Predict from raw 24 x 207 values

POST /predict

Example JSON:

{
  "history": [
    [65.1, 64.2, "... 207 values ..."],
    "... 24 rows total ..."
  ]
}

The values must be raw speed values in mph in the same sensor-column order as the training METR-LA file.

Predict from CSV

POST /predict/file

Upload a CSV that resolves to exactly 24 x 207 numeric values.

Run locally

pip install -r requirements.txt
uvicorn api:app --host 0.0.0.0 --port 8000

Then open:

http://localhost:8000/docs

Important

The Static Hugging Face Space cannot execute this Python/PyTorch API. Deploy this API to a Python-capable service, then set the Static Space INFERENCE_URL to the public /predict endpoint.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support