From 2ac5b84e26b412d00985b200d3a8a35becb86532 Mon Sep 17 00:00:00 2001 From: Amnon Catav Date: Mon, 30 Oct 2023 13:45:11 +0200 Subject: [PATCH] change defaults --- config/config.yaml | 2 +- src/canopy/knowledge_base/knowledge_base.py | 2 +- src/canopy/knowledge_base/record_encoder/openai.py | 2 +- src/canopy_server/api_models.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 58f63211..dba56a62 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -46,7 +46,7 @@ chat_engine: type: OpenAIRecordEncoder params: model_name: text-embedding-ada-002 - batch_size: 100 + batch_size: 400 chunker: type: MarkdownChunker diff --git a/src/canopy/knowledge_base/knowledge_base.py b/src/canopy/knowledge_base/knowledge_base.py index 85687685..1c7e855c 100644 --- a/src/canopy/knowledge_base/knowledge_base.py +++ b/src/canopy/knowledge_base/knowledge_base.py @@ -490,7 +490,7 @@ def _query_index(self, def upsert(self, documents: List[Document], namespace: str = "", - batch_size: int = 100, + batch_size: int = 200, show_progress_bar: bool = False): """ Upsert documents into the knowledge base. diff --git a/src/canopy/knowledge_base/record_encoder/openai.py b/src/canopy/knowledge_base/record_encoder/openai.py index ce18a3f8..9d4cf578 100644 --- a/src/canopy/knowledge_base/record_encoder/openai.py +++ b/src/canopy/knowledge_base/record_encoder/openai.py @@ -17,7 +17,7 @@ class OpenAIRecordEncoder(DenseRecordEncoder): def __init__(self, *, model_name: str = "text-embedding-ada-002", - batch_size: int = 100, + batch_size: int = 400, **kwargs): encoder = OpenAIEncoder(model_name) super().__init__(dense_encoder=encoder, batch_size=batch_size, **kwargs) diff --git a/src/canopy_server/api_models.py b/src/canopy_server/api_models.py index 98ddb799..dae422f5 100644 --- a/src/canopy_server/api_models.py +++ b/src/canopy_server/api_models.py @@ -19,7 +19,7 @@ class ContextQueryRequest(BaseModel): class ContextUpsertRequest(BaseModel): documents: List[Document] - batch_size: int = 100 + batch_size: int = 200 class ContextDeleteRequest(BaseModel):