Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openai: embeddings: supported chunk_size when check_embedding_ctx_length is disabled #23767

Merged
merged 5 commits into from
Sep 20, 2024

Conversation

adubovik
Copy link
Contributor

@adubovik adubovik commented Jul 2, 2024

Chunking of the input array controlled by self.chunk_size is being ignored when self.check_embedding_ctx_length is disabled. Effectively, the chunk size is assumed to be equal 1 in such a case. This is suprising.

The PR takes into account self.chunk_size passed by the user.

@efriis efriis added the partner label Jul 2, 2024
Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 11:05pm

@efriis efriis self-assigned this Jul 2, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. Ɑ: embeddings Related to text embedding models module 🔌: openai Primarily related to OpenAI integrations 🤖:improvement Medium size change to existing code to handle new use-cases labels Jul 2, 2024
@adubovik adubovik force-pushed the master branch 2 times, most recently from 215c34e to 03f6842 Compare July 2, 2024 14:36
@adubovik
Copy link
Contributor Author

adubovik commented Jul 4, 2024

@efriis is there something I could do to impove the PR? Thanks

@efriis
Copy link
Member

efriis commented Jul 12, 2024

reassigning to @baskaryan who recently refactored this!

@adubovik
Copy link
Contributor Author

Hi, @baskaryan! Do you have any suggestions?

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Sep 20, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Sep 20, 2024
@efriis efriis merged commit 3e2cb4e into langchain-ai:master Sep 20, 2024
27 checks passed
sfc-gh-nmoiseyev pushed a commit to sfc-gh-nmoiseyev/langchain that referenced this pull request Sep 21, 2024
…gth is disabled (langchain-ai#23767)

Chunking of the input array controlled by `self.chunk_size` is being
ignored when `self.check_embedding_ctx_length` is disabled. Effectively,
the chunk size is assumed to be equal 1 in such a case. This is
suprising.

The PR takes into account `self.chunk_size` passed by the user.

---------

Co-authored-by: Erick Friis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: embeddings Related to text embedding models module 🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. 🔌: openai Primarily related to OpenAI integrations partner size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants