From befc13061b73243e2aa2c88541f19afc16b2228b Mon Sep 17 00:00:00 2001 From: Joshua Lochner Date: Sat, 4 Nov 2023 02:40:14 +0200 Subject: [PATCH] Fix typing issue with bigint literals --- src/models.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models.js b/src/models.js index ba1b1c28d..9af626c74 100644 --- a/src/models.js +++ b/src/models.js @@ -299,11 +299,11 @@ function preparePositionIds(session, feeds, use_cache_branch) { // Compute cumulative sum of the attention mask along the sequence length dimension for (let i = 0; i < feeds.attention_mask.dims[0]; ++i) { let start = i * feeds.attention_mask.dims[1]; - let sum = 0n; + let sum = BigInt(0); for (let j = 0; j < feeds.attention_mask.dims[1]; ++j) { const index = start + j; if (feeds.attention_mask.data[index] === 0n) { - data[index] = 1n; + data[index] = BigInt(1); } else { // === 1n data[index] = sum; sum += feeds.attention_mask.data[index];