Skip to main content

How-To Guides

Run the Portal Locally

Follow these steps to set up and run the GNN Food Flow Portal from a local checkout.

1. Clone the repository

git clone https://github.com/ICICLE-ai/GNNFoodFlowPortal.git
cd GNNFoodFlowPortal

2. Create a Python environment

Python 3.11 is recommended for the current 1.2.0 configuration.

conda create -n gnnfoodflow python=3.11
conda activate gnnfoodflow

3. Install dependencies

cd portal
pip install -r requirements.txt

The what-if workflow depends on PyTorch, PyTorch Geometric, and scikit-learn. If your platform requires a custom PyTorch wheel, install the correct PyTorch package for your operating system and accelerator before installing the remaining requirements.

4. Run Streamlit

streamlit run app.py

5. Open the portal

Streamlit will print a local URL, usually http://localhost:8501. Open that URL in a browser and use the portal navigation to switch between the parallel model and multi-task what-if workflows.

Use the Parallel Model Download Page

  1. Select Parallel Model Download.
  2. Choose the SCTG category and any origin or destination filters in the sidebar.
  3. Download Current Filtered Data for the rows currently used by the map.
  4. Download Summary Statistics for origin-destination totals with county and state labels.

Use the What-If Export

  1. Run either a one-to-one or one-to-many scenario.
  2. Review the baseline, modified, and delta outputs.
  3. Use the download button on the results page to export the scenario comparison as CSV.

Build the Docker Image

The portal includes a Dockerfile for container deployment.

cd portal
docker build -t gnn-food-flow-portal .
docker run --rm -p 8501:8501 gnn-food-flow-portal

For Tapis pod deployments, the image uses CPU-compatible PyTorch packages because the current pods do not provide GPU support. The build also uses a slim Python 3.11 base image, excludes local-only files through portal/.dockerignore, and cleans caches and generated bytecode to reduce image size.