generated from abrenneke/rivet-plugin-example
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement batch processing for Ollama embeddings
This change introduces batch processing for the Ollama embeddings node. Previously, the node processed each document separately, making multiple API requests. The updated implementation now processes all documents in a single batch, reducing the number of API requests and improving the overall performance. The key changes are: - Create a single array to store the embeddings for all documents - Iterate over the input documents and fetch the embeddings for each one - Populate the embeddings array with the results from the Ollama API - Return the embeddings array as the output of the node This change aims to optimize the performance of the Ollama embeddings node by processing multiple documents in a single batch, reducing the number of API requests and improving the overall efficiency of the node.
- Loading branch information
1 parent
bf94543
commit fda9a6d
Showing
1 changed file
with
42 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters