fix: BYPASS_MODEL_ACCESS_CONTROL env var

This commit is contained in:
Timothy Jaeryang Baek committed 2024-12-09 23:39:23 -08:00
1 parent 2db837cab4
commit 1349c6049e
2 files changed
+9 -2

No files matched your search

+3
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}