mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
build(litellm_server/main.py): fix config loading
This commit is contained in:
parent
1bd780185b
commit
13f20226f5
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