We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c067e2a + d0e93c0 commit 13b570cCopy full SHA for 13b570c
src/pipelines.js
@@ -628,7 +628,7 @@ class EmbeddingsPipeline extends Pipeline {
628
*/
629
_normalize(tensor) {
630
for (let batch of tensor) {
631
- let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b))
+ let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b, 0))
632
633
for (let i = 0; i < batch.data.length; ++i) {
634
batch.data[i] /= norm;
0 commit comments