Browse Source

fix: filter outlet

Timothy J. Baek 11 months ago
parent
commit
a9e5003c4f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      backend/main.py

+ 4 - 4
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