mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
refac
This commit is contained in:
parent
b6108527c2
commit
b98d8aa8ec
1 changed files with 5 additions and 1 deletions
|
|
@ -220,7 +220,11 @@ def query_doc_with_hybrid_search(
|
||||||
zip(distances, metadatas, documents), key=lambda x: x[0], reverse=True
|
zip(distances, metadatas, documents), key=lambda x: x[0], reverse=True
|
||||||
)
|
)
|
||||||
sorted_items = sorted_items[:k]
|
sorted_items = sorted_items[:k]
|
||||||
|
|
||||||
|
if sorted_items:
|
||||||
distances, documents, metadatas = map(list, zip(*sorted_items))
|
distances, documents, metadatas = map(list, zip(*sorted_items))
|
||||||
|
else:
|
||||||
|
distances, documents, metadatas = [], [], []
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
"distances": [distances],
|
"distances": [distances],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue