From 6361653ad92748f519faca07a7ec129f585f1faf Mon Sep 17 00:00:00 2001 From: Kye Date: Thu, 10 Aug 2023 10:56:12 -0400 Subject: [PATCH] embedding size Former-commit-id: 838a095df95775b9e70776933ddd5c1f7ffa49af --- swarms/workers/vortex_worker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/swarms/workers/vortex_worker.py b/swarms/workers/vortex_worker.py index a87a9c78..d15967b4 100644 --- a/swarms/workers/vortex_worker.py +++ b/swarms/workers/vortex_worker.py @@ -49,7 +49,7 @@ class VortexWorkerAgent: self.worker_name = worker_name self.worker_role = worker_role - self.embedding_size = 8192 + self.embedding_size = embedding_size self.human_in_the_loop = human_in_the_loop self.search_kwargs = search_kwargs @@ -87,7 +87,8 @@ class VortexWorkerAgent: try: openai_api_key = self.openai_api_key or os.getenv("OPENAI_API_KEY") embeddings_model = OpenAIEmbeddings(openai_api_key=openai_api_key) - index = faiss.IndexFlatL2(embedding_size=self.embedding_size) + embedding_size = 8192 + index = faiss.IndexFlatL2(embedding_size=embedding_size) return FAISS(embeddings_model, index, InMemoryDocstore({}), {}) except Exception as error: logging.error(f"Failed to initialize vector store: {error}")