diff --git a/src/models/idefics3/processing_idefics3.js b/src/models/idefics3/processing_idefics3.js index d861034a5..1bec97b32 100644 --- a/src/models/idefics3/processing_idefics3.js +++ b/src/models/idefics3/processing_idefics3.js @@ -11,8 +11,8 @@ import { count } from "../../utils/core.js"; */ function _prompt_split_image(image_seq_len, image_rows, image_cols, fake_token_around_image, image_token, global_img_token) { let text_split_images = ""; - for (let n_h = 0; n_h < image_rows; n_h++) { - for (let n_w = 0; n_w < image_cols; n_w++) { + for (let n_h = 0; n_h < image_rows; ++n_h) { + for (let n_w = 0; n_w < image_cols; ++n_w) { text_split_images += ( fake_token_around_image + `` + diff --git a/tests/processors.test.js b/tests/processors.test.js index c311f07b2..9b92131cf 100644 --- a/tests/processors.test.js +++ b/tests/processors.test.js @@ -701,7 +701,7 @@ describe("Processors", () => { ); compare(pixel_attention_mask.dims, [3, 2, 364, 364]); compare( - pixel_attention_mask.to('float32').mean().item(), + pixel_attention_mask.to("float32").mean().item(), 2 / 3, 0.001, // threshold );