mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 00:59:52 +00:00
chromadb switch to cosine similarity
This commit is contained in:
parent
73c291193b
commit
89c77f05a8
@ -109,7 +109,10 @@ class ChromaClient:
|
|||||||
|
|
||||||
def insert(self, collection_name: str, items: list[VectorItem]):
|
def insert(self, collection_name: str, items: list[VectorItem]):
|
||||||
# Insert the items into the collection, if the collection does not exist, it will be created.
|
# Insert the items into the collection, if the collection does not exist, it will be created.
|
||||||
collection = self.client.get_or_create_collection(name=collection_name)
|
collection = self.client.get_or_create_collection(
|
||||||
|
name=collection_name,
|
||||||
|
metadata={"hnsw:space": "cosine"}
|
||||||
|
)
|
||||||
|
|
||||||
ids = [item["id"] for item in items]
|
ids = [item["id"] for item in items]
|
||||||
documents = [item["text"] for item in items]
|
documents = [item["text"] for item in items]
|
||||||
|
Loading…
Reference in New Issue
Block a user