A blogging template to make it faster to share project code for blog posts
The purpose of this template is to quickly create projects for devs to experiment with code from my blog posts
- Python 3.8
- Poetry 1.1
- Docker
From within the root directory:
poetry install
Before serving in development using docker compose, you must follow the setup steps documented here:
Downloading & Saving a Trained Tensorflow Model README
Included a minimal example from fastapi to get started with a production server.
To rebuild the api run
docker-compose build
To serve the api locally run
docker-compose up api
To serve the full stack locally run
docker-compose up
Once that runs, you can use the api by going to the following endpoints:
- Main Api:
http://localhost:8000/ - Api Docs (Auto Generated from FastAPI):
http://localhost:8000/docs - Tensorflow Serving:
http://localhost:8501/v1/models/sentiment_model/metadata - Main Api endpoint returning model inference:
http://localhost:8000/text/
From within the root directory:
poetry run pytest tests