build(litellm_server/main.py): fix config loading

This commit is contained in:
Krrish Dholakia 2023-10-27 11:42:51 -07:00
parent 05795551f2
commit d011a4b5ea
2 changed files with 15 additions and 7 deletions

View file

@ -43,13 +43,12 @@ def set_callbacks():
def load_router_config(router: Optional[litellm.Router]):
def load_router_config(router: Optional[litellm.Router], config_file_path: Optional[str]='/app/config.yaml'):
config = {}
config_file = '/app/config.yaml'
try:
if os.path.exists(config_file):
with open(config_file, 'r') as file:
if os.path.exists(config_file_path):
with open(config_file_path, 'r') as file:
config = yaml.safe_load(file)
else:
pass