浏览代码

fix: reranking

Timothy Jaeryang Baek 1 月之前
父节点
当前提交
fbff4e19de
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      backend/open_webui/retrieval/utils.py

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

@@ -966,7 +966,7 @@ class RerankCompressor(BaseDocumentCompressor):
             )
             scores = util.cos_sim(query_embedding, document_embedding)[0]
 
-        if scores:
+        if scores is not None:
             docs_with_scores = list(
                 zip(
                     documents,