Skip to content
Advertisement

why is my fastapi or uvicorn getting shutdown?

I am trying to run a service that uses simple transformers Roberta model to do classification. the inferencing script/function itself is working as expected when tested. when i include that with fast api its shutting down the server.

JavaScript

JavaScript

error :

JavaScript

inferencing script :

JavaScript

update: tried with flask and the service is working but when adding uvicorn on top of flask its getting stuck in a loop of restart.

Advertisement

Answer

I have solved this issue by starting a process pool using multiprocessing explicitly.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement