forked from phoenix/litellm-mirror
build(litellm_server/main.py): fix config loading
This commit is contained in:
parent
05795551f2
commit
d011a4b5ea
2 changed files with 15 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue