From 8aea256a53ef4278dfa77275ec4873028ed0c3a8 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 15 Nov 2023 17:25:06 -0800 Subject: [PATCH] (chore) linting fixes --- litellm/deprecated_litellm_server/main.py | 4 ++-- litellm/deprecated_litellm_server/server_utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/deprecated_litellm_server/main.py b/litellm/deprecated_litellm_server/main.py index cebdb60e4..3bfc40f91 100644 --- a/litellm/deprecated_litellm_server/main.py +++ b/litellm/deprecated_litellm_server/main.py @@ -84,7 +84,7 @@ async def embedding(request: Request): # default to always using the "ENV" variables, only if AUTH_STRATEGY==DYNAMIC then reads headers if os.getenv("AUTH_STRATEGY", None) == "DYNAMIC" and "authorization" in request.headers: # if users pass LLM api keys as part of header api_key = request.headers.get("authorization") - api_key = api_key.replace("Bearer", "").strip() + api_key = api_key.replace("Bearer", "").strip() # type: ignore if len(api_key.strip()) > 0: api_key = api_key data["api_key"] = api_key @@ -174,7 +174,7 @@ async def router_embedding(request: Request): if llm_router is None: raise Exception("Save model list via config.yaml. Eg.: ` docker build -t myapp --build-arg CONFIG_FILE=myconfig.yaml .` or pass it in as model_list=[..] as part of the request body") - response = await llm_router.aembedding(model="gpt-3.5-turbo", + response = await llm_router.aembedding(model="gpt-3.5-turbo", # type: ignore messages=[{"role": "user", "content": "Hey, how's it going?"}]) if 'stream' in data and data['stream'] == True: # use generate_responses to stream responses diff --git a/litellm/deprecated_litellm_server/server_utils.py b/litellm/deprecated_litellm_server/server_utils.py index bcc17237c..9f9096fb6 100644 --- a/litellm/deprecated_litellm_server/server_utils.py +++ b/litellm/deprecated_litellm_server/server_utils.py @@ -53,8 +53,8 @@ def load_router_config(router: Optional[litellm.Router], config_file_path: Optio config = {} server_settings = {} try: - if os.path.exists(config_file_path): - with open(config_file_path, 'r') as file: + if os.path.exists(config_file_path): # type: ignore + with open(config_file_path, 'r') as file: # type: ignore config = yaml.safe_load(file) else: pass