瀏覽代碼

Merge pull request #13404 from NoMoreFood/dev

fix: Use SHA256 For Query Result Computation
Tim Jaeryang Baek 5 月之前
父節點
當前提交
61580e9490
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      backend/open_webui/retrieval/utils.py

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

@@ -207,7 +207,7 @@ def merge_and_sort_query_results(query_results: list[dict], k: int) -> dict:
 
 
         for distance, document, metadata in zip(distances, documents, metadatas):
         for distance, document, metadata in zip(distances, documents, metadatas):
             if isinstance(document, str):
             if isinstance(document, str):
-                doc_hash = hashlib.md5(
+                doc_hash = hashlib.sha256(
                     document.encode()
                     document.encode()
                 ).hexdigest()  # Compute a hash for uniqueness
                 ).hexdigest()  # Compute a hash for uniqueness