From 22208e517e752269fde474e729c1f9586a498ab1 Mon Sep 17 00:00:00 2001 From: dbogunowicz <97082108+dbogunowicz@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:50:30 +0100 Subject: [PATCH] [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 <109536191+corey-nm@users.noreply.github.com> Co-authored-by: Benjamin Fineran --- src/deepsparse/server/server.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/deepsparse/server/server.py b/src/deepsparse/server/server.py index 6e638ffbf8..230134048d 100644 --- a/src/deepsparse/server/server.py +++ b/src/deepsparse/server/server.py @@ -39,7 +39,7 @@ SystemLoggingMiddleware, log_system_information, ) -from fastapi import Depends, FastAPI, UploadFile +from fastapi import FastAPI, UploadFile from starlette.responses import RedirectResponse @@ -253,17 +253,13 @@ def _add_pipeline_endpoint( input_schema = pipeline.input_schema output_schema = pipeline.output_schema - async def endpoints_params(): - # global parameters that will be passed to all the endpoints of the server - return {"system_logging_config": system_logging_config} - - def _predict(request: pipeline.input_schema, params=Depends(endpoints_params)): + def _predict(request: pipeline.input_schema): pipeline_outputs = pipeline(request) server_logger = pipeline.logger if server_logger: log_system_information( server_logger=server_logger, - system_logging_config=params.get("system_logging_config"), + system_logging_config=system_logging_config, ) return pipeline_outputs