Skip to content

Commit

Permalink
refactor: Faster getEmbeddings() (Anush008#14)
Browse files Browse the repository at this point in the history
* refactor: Faster get embeddings()

* Update fastembed.ts
  • Loading branch information
Anush008 authored Feb 3, 2024
1 parent 1a36bd4 commit a715c6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fastembed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getEmbeddings(
): number[][] {
const [x, y, z] = dimensions;

return Array.from({ length: x }, (_, index) => {
return new Array(x).fill(undefined).map((_, index) => {
const startIndex = index * y * z;
const endIndex = startIndex + z;
return data.slice(startIndex, endIndex);
Expand Down

0 comments on commit a715c6c

Please sign in to comment.