From a9e5003c4f9a6e753bc297bd32868106dd154ca1 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 2 Jun 2024 17:49:44 -0700 Subject: [PATCH] fix: filter outlet --- backend/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/main.py b/backend/main.py index a28f353aa..d2e4d3177 100644 --- a/backend/main.py +++ b/backend/main.py @@ -498,10 +498,10 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)): ] sorted_filters = sorted(filters, key=lambda x: x["pipeline"]["priority"]) - model = app.state.MODELS[model_id] - - if "pipeline" in model: - sorted_filters = [model] + sorted_filters + if model_id in app.state.MODELS: + model = app.state.MODELS[model_id] + if "pipeline" in model: + sorted_filters = [model] + sorted_filters for filter in sorted_filters: r = None