langchain-ai/langchain

ChromaDB document deletion not working

クローズ

#4,880 opened on 2023/05/17

 (25 件のコメント) (3 件のリアクション) (0 人の担当者)Python (22,617 件のフォーク)batch import
chromaexternalhelp wantedintegration

Repository metrics

Stars
 (136,758 個のスター)
PR merge metrics
 (平均マージ 10d 2h) (30d で 288 merged PRs)

説明

Issue you'd like to raise.

I am trying to delete a single document from Chroma db using the following code:

chroma_db = Chroma(persist_directory = embeddings_save_path, embedding_function = OpenAIEmbeddings(model = os.getenv("EMBEDDING_MODEL_NAME"), chunk_size = 1, max_retries = 5) )

chroma_db._collection.delete(ids = list_of_ids) chroma_db.persist()

However, the document is not actually being deleted. After loading/re-loading the chroma db from local, it is still showing the document in it.

I have tried the following things to fix the issue:

I have made sure that the list of ids is correct. I have tried deleting the document multiple times. I have tried restarting the Chroma db server. None of these things have worked.

I am not sure why the document is not being deleted. I would appreciate any help in resolving this issue.

Thanks, Anant Patankar

Suggestion:

No response

コントリビューターガイド