CentML / centml-python-client

Apache License 2.0
1 stars 0 forks source link

Compile_server, read UploadFiles in compile endpoint, not in background task #36

Closed destefy closed 7 months ago

destefy commented 8 months ago

FastAPI has issues using reading UploadFiles inside of background tasks: Discussion

When I try to do this, I get an error saying that the model file I'm trying to read is closed. However, I only get this error when the server is running in a separate container than the client meaning that when they are on the same machine the server can access the client's model file through some other mean, or that the file isn't closed.

Therefore, these PR changes read the file in the FastAPI endpoint and not the background task. Unfortunately this means the compilation endpoint's file reading is blocking as it waits for the file to be read.