Skip to content

Commit

Permalink
Fix langchain-ai#29759: Use local chunk_size_ for looping in embed_do…
Browse files Browse the repository at this point in the history
…cuments
  • Loading branch information
chaymaeelaattabi committed Feb 12, 2025
1 parent f4e3e86 commit 4ad01ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/partners/openai/langchain_openai/embeddings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def embed_documents(
chunk_size_ = chunk_size or self.chunk_size
if not self.check_embedding_ctx_length:
embeddings: List[List[float]] = []
for i in range(0, len(texts), self.chunk_size):
for i in range(0, len(texts), chunk_size_):
response = self.client.create(
input=texts[i : i + chunk_size_], **self._invocation_params
)
Expand Down

0 comments on commit 4ad01ca

Please sign in to comment.