Skip to content

Commit 22208e5

Browse files
dbogunowiczcorey-nmbfineran
authored
[Cherry Pick] Using system_logging_config directly instead of using Depends (#858) (1.4.2) (#973)
* Using system_logging_config directly instead of using Depends (#858) * Update version.py --------- Co-authored-by: corey-nm <[email protected]> Co-authored-by: Benjamin Fineran <[email protected]>
1 parent c391607 commit 22208e5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/deepsparse/server/server.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
SystemLoggingMiddleware,
4040
log_system_information,
4141
)
42-
from fastapi import Depends, FastAPI, UploadFile
42+
from fastapi import FastAPI, UploadFile
4343
from starlette.responses import RedirectResponse
4444

4545

@@ -253,17 +253,13 @@ def _add_pipeline_endpoint(
253253
input_schema = pipeline.input_schema
254254
output_schema = pipeline.output_schema
255255

256-
async def endpoints_params():
257-
# global parameters that will be passed to all the endpoints of the server
258-
return {"system_logging_config": system_logging_config}
259-
260-
def _predict(request: pipeline.input_schema, params=Depends(endpoints_params)):
256+
def _predict(request: pipeline.input_schema):
261257
pipeline_outputs = pipeline(request)
262258
server_logger = pipeline.logger
263259
if server_logger:
264260
log_system_information(
265261
server_logger=server_logger,
266-
system_logging_config=params.get("system_logging_config"),
262+
system_logging_config=system_logging_config,
267263
)
268264
return pipeline_outputs
269265

0 commit comments

Comments
 (0)