diff --git a/src/blackbox/chroma_upsert.py b/src/blackbox/chroma_upsert.py index 7433951..10e9d27 100755 --- a/src/blackbox/chroma_upsert.py +++ b/src/blackbox/chroma_upsert.py @@ -59,17 +59,17 @@ class ChromaUpsert(Blackbox): # # chroma_query settings if "settings" in settings: chroma_embedding_model = settings["settings"].get("chroma_embedding_model") - chroma_host = settings["settings"].get("chroma_host") - chroma_port = settings["settings"].get("chroma_port") - chroma_collection_id = settings["settings"].get("chroma_collection_id") + chroma_host = settings["settings"].get("chroma_host", "localhost") + chroma_port = settings["settings"].get("chroma_port", "7000") + chroma_collection_id = settings["settings"].get("chroma_collection_id", DEFAULT_COLLECTION_ID) user_chunk_size = settings["settings"].get("chunk_size", 256) user_chunk_overlap = settings["settings"].get("chunk_overlap", 10) user_separators = settings["settings"].get("separators", ["\n\n"]) else: chroma_embedding_model = settings.get("chroma_embedding_model") - chroma_host = settings.get("chroma_host") - chroma_port = settings.get("chroma_port") - chroma_collection_id = settings.get("chroma_collection_id") + chroma_host = settings.get("chroma_host", "localhost") + chroma_port = settings.get("chroma_port", "7000") + chroma_collection_id = settings.get("chroma_collection_id", DEFAULT_COLLECTION_ID) user_chunk_size = settings.get("chunk_size", 256) user_chunk_overlap = settings.get("chunk_overlap", 10) user_separators = settings.get("separators", ["\n\n"]) @@ -77,12 +77,6 @@ class ChromaUpsert(Blackbox): if chroma_embedding_model is None or chroma_embedding_model.isspace() or chroma_embedding_model == "": chroma_embedding_model = model_name=str(self.model_path / "bge-large-zh-v1.5") - if chroma_host is None or chroma_host.isspace() or chroma_host == "": - chroma_host = "localhost" - - if chroma_port is None or chroma_port.isspace() or chroma_port == "": - chroma_port = "7000" - # load client and embedding model from init if re.search(r"localhost", chroma_host) and re.search(r"7000", chroma_port): client = self.client_1