Skip to content
Discussion options

You must be logged in to vote

FastAPI executes endpoints defined as def (without async) in the thread pool.
I guess the library you are using is not thread-safe and this leads to such problems.
As a solution, you may consider using Locking mechanism to ensure only one request uses model at a time.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants