mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
feat: add chroma_upsert default collection id
This commit is contained in:
@ -59,17 +59,17 @@ class ChromaUpsert(Blackbox):
|
|||||||
# # chroma_query settings
|
# # chroma_query settings
|
||||||
if "settings" in settings:
|
if "settings" in settings:
|
||||||
chroma_embedding_model = settings["settings"].get("chroma_embedding_model")
|
chroma_embedding_model = settings["settings"].get("chroma_embedding_model")
|
||||||
chroma_host = settings["settings"].get("chroma_host")
|
chroma_host = settings["settings"].get("chroma_host", "localhost")
|
||||||
chroma_port = settings["settings"].get("chroma_port")
|
chroma_port = settings["settings"].get("chroma_port", "7000")
|
||||||
chroma_collection_id = settings["settings"].get("chroma_collection_id")
|
chroma_collection_id = settings["settings"].get("chroma_collection_id", DEFAULT_COLLECTION_ID)
|
||||||
user_chunk_size = settings["settings"].get("chunk_size", 256)
|
user_chunk_size = settings["settings"].get("chunk_size", 256)
|
||||||
user_chunk_overlap = settings["settings"].get("chunk_overlap", 10)
|
user_chunk_overlap = settings["settings"].get("chunk_overlap", 10)
|
||||||
user_separators = settings["settings"].get("separators", ["\n\n"])
|
user_separators = settings["settings"].get("separators", ["\n\n"])
|
||||||
else:
|
else:
|
||||||
chroma_embedding_model = settings.get("chroma_embedding_model")
|
chroma_embedding_model = settings.get("chroma_embedding_model")
|
||||||
chroma_host = settings.get("chroma_host")
|
chroma_host = settings.get("chroma_host", "localhost")
|
||||||
chroma_port = settings.get("chroma_port")
|
chroma_port = settings.get("chroma_port", "7000")
|
||||||
chroma_collection_id = settings.get("chroma_collection_id")
|
chroma_collection_id = settings.get("chroma_collection_id", DEFAULT_COLLECTION_ID)
|
||||||
user_chunk_size = settings.get("chunk_size", 256)
|
user_chunk_size = settings.get("chunk_size", 256)
|
||||||
user_chunk_overlap = settings.get("chunk_overlap", 10)
|
user_chunk_overlap = settings.get("chunk_overlap", 10)
|
||||||
user_separators = settings.get("separators", ["\n\n"])
|
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 == "":
|
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")
|
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
|
# load client and embedding model from init
|
||||||
if re.search(r"localhost", chroma_host) and re.search(r"7000", chroma_port):
|
if re.search(r"localhost", chroma_host) and re.search(r"7000", chroma_port):
|
||||||
client = self.client_1
|
client = self.client_1
|
||||||
|
|||||||
Reference in New Issue
Block a user