소스 검색

refac: chroma

Timothy Jaeryang Baek 3 달 전
부모
커밋
942fd384de
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      backend/open_webui/retrieval/vector/dbs/chroma.py

+ 2 - 2
backend/open_webui/retrieval/vector/dbs/chroma.py

@@ -51,8 +51,8 @@ class ChromaClient:
 
 
     def has_collection(self, collection_name: str) -> bool:
     def has_collection(self, collection_name: str) -> bool:
         # Check if the collection exists based on the collection name.
         # Check if the collection exists based on the collection name.
-        collections = self.client.list_collections()
-        return collection_name in [collection.name for collection in collections]
+        collection_names = self.client.list_collections()
+        return collection_name in collection_names
 
 
     def delete_collection(self, collection_name: str):
     def delete_collection(self, collection_name: str):
         # Delete the collection based on the collection name.
         # Delete the collection based on the collection name.