diff --git a/dbgpt/serve/rag/connector.py b/dbgpt/serve/rag/connector.py index 6eb266015..d4a76ffc8 100644 --- a/dbgpt/serve/rag/connector.py +++ b/dbgpt/serve/rag/connector.py @@ -224,6 +224,7 @@ def delete_vector_name(self, vector_name: str): try: if self.vector_name_exists(): self.client.delete_vector_name(vector_name) + del pools[self._vector_store_type][vector_name] except Exception as e: logger.error(f"delete vector name {vector_name} failed: {e}") raise Exception(f"delete name {vector_name} failed") diff --git a/dbgpt/storage/vector_store/chroma_store.py b/dbgpt/storage/vector_store/chroma_store.py index 93191c715..fdc36e58f 100644 --- a/dbgpt/storage/vector_store/chroma_store.py +++ b/dbgpt/storage/vector_store/chroma_store.py @@ -4,6 +4,7 @@ from typing import Any, Dict, Iterable, List, Mapping, Optional, Union from chromadb import PersistentClient +from chromadb.api.client import SharedSystemClient from chromadb.config import Settings from dbgpt._private.pydantic import ConfigDict, Field @@ -201,6 +202,7 @@ def delete_vector_name(self, vector_name: str): logger.info(f"chroma vector_name:{vector_name} begin delete...") # self.vector_store_client.delete_collection() self._chroma_client.delete_collection(self._collection.name) + SharedSystemClient.clear_system_cache() self._clean_persist_folder() return True