Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 949 Bytes

README.md

File metadata and controls

51 lines (35 loc) · 949 Bytes

What is this?

BART Large MNLI as a JSON web API

Dev Set Up

  1. Ensure Python3 is installed
which python3
  1. Pip Install Pytorch
pip3 install torch
  1. Install transformers
pip3 install transformers
  1. Install flask
pip3 install flask
  1. Run flask
cd app
export FLASK_APP=main
export FLASK_ENV=development
flask run
  1. Test it out
curl -X POST http://localhost:5000/transform -d '{"sequence_to_classify": "one day I will see the world", "candidate_labels":["travel","cooking","dancing"]}' -H 'Content-Type: application/json'

Heroku support

  • Note the presence of requirements.txt, Procfile, and wsgi.py. This app can be pushed to Heroku and it would just work.