Browse Source

fix: model dump issue

Timothy J. Baek 6 months ago
parent
commit
dcab991d44
1 changed files with 2 additions and 1 deletions
  1. 2 1
      backend/open_webui/apps/retrieval/utils.py

+ 2 - 1
backend/open_webui/apps/retrieval/utils.py

@@ -193,7 +193,8 @@ def query_collection(
                     k=k,
                     k=k,
                     query_embedding=query_embedding,
                     query_embedding=query_embedding,
                 )
                 )
-                results.append(result.model_dump())
+                if result is not None:
+                    results.append(result.model_dump())
             except Exception as e:
             except Exception as e:
                 log.exception(f"Error when querying the collection: {e}")
                 log.exception(f"Error when querying the collection: {e}")
         else:
         else: