[Bug Fix] Fix issue with chromadb not working with 0.6.0 and onwards (#2279)
This commit is contained in:
@@ -105,10 +105,10 @@ class ChromaDB(VectorStoreBase):
|
|||||||
chromadb.Collection: The created or retrieved collection.
|
chromadb.Collection: The created or retrieved collection.
|
||||||
"""
|
"""
|
||||||
# Skip creating collection if already exists
|
# Skip creating collection if already exists
|
||||||
collections = self.list_cols()
|
collection_info = self.client.get_collection(name=name)
|
||||||
for collection in collections:
|
if collection_info:
|
||||||
if collection.name == name:
|
logging.debug(f"Collection {name} already exists. Skipping creation.")
|
||||||
logging.debug(f"Collection {name} already exists. Skipping creation.")
|
return collection_info
|
||||||
|
|
||||||
collection = self.client.get_or_create_collection(
|
collection = self.client.get_or_create_collection(
|
||||||
name=name,
|
name=name,
|
||||||
|
|||||||
Reference in New Issue
Block a user