poetry install
export DATABASE_URL=postgresql://localhost/aiserving
alembic upgrade head
- Web server
uvicorn ai_serving.main:app
- Worker
Note that --pool=solo
part is important as it creates child process to run AI model
celery -A ai_serving.tasks worker --loglevel=INFO --pool=solo --concurrency=4
To test, run test.py
It creates mnist model from examples, Create two jobs using it
And prints the result after running it