利用 FastAPI 快速建立 inference api
From tiangolo/uvicorn-gunicorn-fastapi:python3.10
- python-multipart
- Pillow
- requests
- transformers
- torch
- torchvision
- torchaudio
訓練完的模型放在 model 目錄,make build 建立 docker image
make run
make dev
vim app/main.py
修改完要進入 container 重跑 app
docker exec -it ai-service bash
kill -HUP 1
curl --request POST --url http://localhost/predict -F file=@assets/zespri-1.jpg
make stress
make stress-loop
Setup MODEL and APP_TAG in the Makefile
make build