Skip to content

Commit

Permalink
🐛 Set Azure OpenAI chunk_size to 16. (#30795)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwaxxer authored Sep 27, 2023
1 parent 3834b61 commit 0964d0e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def __init__(self, config: OpenAIEmbeddingConfigModel, chunk_size: int):

class AzureOpenAIEmbedder(BaseOpenAIEmbedder):
def __init__(self, config: AzureOpenAIEmbeddingConfigModel, chunk_size: int):
super().__init__(OpenAIEmbeddings(openai_api_key=config.openai_key, chunk_size=8191, max_retries=15, openai_api_type="azure", openai_api_version="2023-05-15", openai_api_base=config.api_base, deployment=config.deployment), chunk_size) # type: ignore
# Azure OpenAI API has — as of 20230927 — a limit of 16 documents per request
super().__init__(OpenAIEmbeddings(openai_api_key=config.openai_key, chunk_size=16, max_retries=15, openai_api_type="azure", openai_api_version="2023-05-15", openai_api_base=config.api_base, deployment=config.deployment), chunk_size) # type: ignore


COHERE_VECTOR_SIZE = 1024
Expand Down

0 comments on commit 0964d0e

Please sign in to comment.