-
Notifications
You must be signed in to change notification settings - Fork 736
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
Introduce batching support for embedding documents #1214
Comments
Using this #1140 as a starting point, introduce a new API for batching for all vector stores and embedding models to use. |
- When embedding documents, allow batching the documents using some criteria. - `BatchingStrategy` interface with a `TokenCountBatchingStrategy` implementation that uses the openai max input token size of 8191 as the default. - Add a default method in EmbeddingModel to embed document using this new batching strategy. - Change `MilvusVectorStore` to make use of this new batching API. - Adding unit tests for `TokenCountBatchingStrategy`. - Adding openai integration test to call the embed API that uses batching. Resolves spring-projects#1214
@sobychacko hi, I also encountered the same problem in PG. The segmentation process I use , #1200 . |
- When embedding documents, allow batching the documents using some criteria. - `BatchingStrategy` interface with a `TokenCountBatchingStrategy` implementation that uses the openai max input token size of 8191 as the default. - Add a default method in EmbeddingModel to embed document using this new batching strategy. - Change `MilvusVectorStore` to make use of this new batching API. - Adding unit tests for `TokenCountBatchingStrategy`. - Adding openai integration test to call the embed API that uses batching. Resolves spring-projects#1214 Other vector stores will be updated seperately
@impactCn Sorry for the delay in responding. We just merged similar batching changes for the PG vector store. Can you take a look and see if that satisfies your use case? If there is a gap, we can improve on that. Thanks! |
Introduce a way for
EmbeddingModel
implementations to embedDocument
objects using a batching strategy.The text was updated successfully, but these errors were encountered: