Memory issue with flask app
hasana-bi
HOBBYOP
a year ago
The app takes a audio file dropped in and generate transcripts. It uses OpenAI whisper package to do it.
The app is actually working, but only with very very small audio file. Even for a slightly larger file (300KB), it breaks, and shows an error saying Perhaps out or memory?
Locally I checked the peak memory use is around 400MB for this 300KB file. I believe the whisper python package takes some memory, but still the Hobby package says it has 8GB RAM. Shouldn't it be able to handle this?
1 Replies
brody
EMPLOYEE
a year ago
Try starting gunicorn with a uvicorn event worker instead of the default sync workers -
gunicorn run:create_app() --workers 3 --worker-class uvicorn.workers.UvicornWorker --timeout 600Make sure you have uvicorn in your requirements.txt too.
