Skip to content

Commit

Permalink
fix:to compatible with chroma old collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-ckt committed May 11, 2024
1 parent 592be90 commit d5da9db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dbgpt/storage/vector_store/chroma_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

logger = logging.getLogger(__name__)

CHROMA_COLLECTION_NAME = "langchain"

@register_resource(
_("Chroma Vector Store"),
Expand Down Expand Up @@ -81,7 +82,7 @@ def __init__(self, vector_store_config: ChromaVectorConfig) -> None:
"hnsw:space": "cosine"
}
self._collection = self._chroma_client.get_or_create_collection(
name=vector_store_config.name,
name=CHROMA_COLLECTION_NAME,
embedding_function=None,
metadata=collection_metadata,
)
Expand Down Expand Up @@ -151,6 +152,7 @@ def vector_name_exists(self) -> bool:
files = list(filter(lambda f: f != "chroma.sqlite3", files))
return len(files) > 0


def load_document(self, chunks: List[Chunk]) -> List[str]:
"""Load document to vector store."""
logger.info("ChromaStore load document")
Expand Down

0 comments on commit d5da9db

Please sign in to comment.