Chroma 数据库嵌入没有

问题描述 投票:0回答:1

我正在使用 Chromadb 服务器,当我添加数据并使用 get 查询时,我发现没有嵌入。

chroma_client = chromadb.HttpClient(host='localhost', port='8000')

collection = chroma_client.get_or_create_collection(name="my_collectionvvv")


collection.add(
    documents=["This is a document", "This is another document"],
    metadatas=[{"source": "my_source"}, {"source": "my_source"}],
    ids=["id1", "id2"]
)
# client = chromadb.PersistentClient(path="/Users/guitai/chromadb")

results = collection.query(
    query_texts=["document"],
    n_results=2,
    include=["embeddings", "documents", "metadatas","distances"]
)
results1 = collection.get(
    ids=['id1'],
    include=["embeddings", "documents", "metadatas"]
)
print(results)
print(results1)

enter image description here

chroma_client = chromadb.Client()

这是正确的,但是 chromadb 服务器无法保存嵌入。

python=3.9 色度数据库=0.4.3

langchain chromadb
1个回答
0
投票

如果您访问 docs.trychroma.com,您会发现他们排除了嵌入,这可能会提高性能。

enter image description here


© www.soinside.com 2019 - 2024. All rights reserved.