Skip to content

An adapter example to receive model responses over HTTPS.

License

Notifications You must be signed in to change notification settings

jonathanlo411/flask-ml-adapter

Repository files navigation

Flask ML Adapter



An adapter example to receive ML model responses over HTTPS.

Table of Contents

Details

This application demonstrates how python models can be called from a different codebase and context using HTTPS. Usually this would be done utilizing a system call via protobuf with gRPC but this process can be used if one does not want to go into microservices.

Models

Model Est. Full Classify Time Link
AdaBoostClassifier.pkl 13 seconds
GaussianNaiveBayes.pkl 4 seconds
GradientBoostClassifier.pkl 6 seconds
KerasFNN.pkl 1 minute 35 seconds
RandomForestClassifier.pkl 20 seconds
SupportVectorClassifier.pkl 5 seconds

Using

  1. Select a model from the drop down
  2. Identify Point or Full Classify 2.1. Select a point from the table and hit "Submit Classifier Request" 2.2 (OR) Hit "Classify All Points"
  3. Await results. Sample requests and response will be shown. screenshot of application

Running Locally

Using Setup Scripts

  1. Clone the repository
  2. cd into the repo and use setup.sh
./scripts/setup.sh
  1. After setup, use the start script
./scripts/start.sh

Manually

  1. Clone the repository.
  2. Create your virtual environment and install the requirements.
python3 -m venv flask-env
. flask-env/Scripts/activate  #or . flask-env/bin/activate
pip install -r requirements.txt
  1. Launch Flask
flask --app server run
# navigate to http://127.0.0.1:5000