mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-01 20:07:31 +02:00
Fix: Normalze all database distances to score in [0, 1]
This commit is contained in:
@@ -99,7 +99,8 @@ class QdrantClient:
|
||||
ids=get_result.ids,
|
||||
documents=get_result.documents,
|
||||
metadatas=get_result.metadatas,
|
||||
distances=[[point.score for point in query_response.points]],
|
||||
# qdrant distance is [-1, 1], normalize to [0, 1]
|
||||
distances=[[(point.score + 1.0)/2.0 for point in query_response.points]],
|
||||
)
|
||||
|
||||
def query(self, collection_name: str, filter: dict, limit: Optional[int] = None):
|
||||
|
||||
Reference in New Issue
Block a user