fix: BYPASS_MODEL_ACCESS_CONTROL env var

This commit is contained in:
Timothy Jaeryang Baek
2024-12-09 23:39:23 -08:00
parent 2db837cab4
commit 1349c6049e
2 changed files with 9 additions and 2 deletions

View File

@@ -1265,6 +1265,9 @@ async def get_base_models(user=Depends(get_admin_user)):
async def generate_chat_completions(
form_data: dict, user=Depends(get_verified_user), bypass_filter: bool = False
):
if BYPASS_MODEL_ACCESS_CONTROL:
bypass_filter = True
model_list = await get_all_models()
models = {model["id"]: model for model in model_list}