From 3d3647e8e33706b01ed21f781270fc8b5e6557a5 Mon Sep 17 00:00:00 2001 From: Aries-ckt <916701291@qq.com> Date: Thu, 4 Jan 2024 23:52:10 +0800 Subject: [PATCH] fix(ChatKnowledge): delete Chroma by vector ids did not success (#1027) --- dbgpt/storage/vector_store/chroma_store.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbgpt/storage/vector_store/chroma_store.py b/dbgpt/storage/vector_store/chroma_store.py index 8587ff732..9149e3665 100644 --- a/dbgpt/storage/vector_store/chroma_store.py +++ b/dbgpt/storage/vector_store/chroma_store.py @@ -113,8 +113,10 @@ def delete_vector_name(self, vector_name): def delete_by_ids(self, ids): logger.info(f"begin delete chroma ids...") - collection = self.vector_store_client._collection - collection.delete(ids=ids) + ids = ids.split(",") + if len(ids) > 0: + collection = self.vector_store_client._collection + collection.delete(ids=ids) def _clean_persist_folder(self): for root, dirs, files in os.walk(self.persist_dir, topdown=False):