Skip to content
Snippets Groups Projects
Unverified Commit 317f1408 authored by Emanuel Ferreira's avatar Emanuel Ferreira Committed by GitHub
Browse files

fix: revert embed batch temporarily (#520)

parent cd829474
No related branches found
No related tags found
No related merge requests found
...@@ -168,14 +168,14 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> { ...@@ -168,14 +168,14 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
): Promise<BaseNode[]> { ): Promise<BaseNode[]> {
const nodesWithEmbeddings: BaseNode[] = []; const nodesWithEmbeddings: BaseNode[] = [];
const embeddingResults = await this.embedModel.getTextEmbeddingsBatch(
nodes.map((node) => node.getContent(MetadataMode.EMBED)),
options,
);
for (let i = 0; i < nodes.length; ++i) { for (let i = 0; i < nodes.length; ++i) {
const node = nodes[i]; const node = nodes[i];
node.embedding = embeddingResults[i]; if (options?.logProgress) {
console.log(`Getting embedding for node ${i + 1}/${nodes.length}`);
}
node.embedding = await this.embedModel.getTextEmbedding(
node.getContent(MetadataMode.EMBED),
);
nodesWithEmbeddings.push(node); nodesWithEmbeddings.push(node);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment