Skip to content

Commit bfa5d66

Browse files
committed
Update types
1 parent a5322c4 commit bfa5d66

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"jest-environment-node": "^30.0.0-alpha.6",
7070
"jsdoc-to-markdown": "^9.1.1",
7171
"prettier": "3.4.2",
72-
"typescript": "^5.7.2",
72+
"typescript": "^5.8.2",
7373
"wavefile": "11.0.0",
7474
"webpack": "^5.97.1",
7575
"webpack-cli": "^5.1.4",

src/models/idefics3/image_processing_idefics3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class Idefics3ImageProcessor extends ImageProcessor {
147147
const start_offset = i * pixel_attention_mask_stride + num_patches * h * w;
148148
const end_offset = (i + 1) * pixel_attention_mask_stride;
149149

150-
// @ts-expect-error
150+
// @ts-ignore
151151
pixel_attention_mask_data.fill(false, start_offset, end_offset);
152152
}
153153
}

src/utils/audio.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function hertz_to_mel(freq, mel_scale = "htk") {
150150
throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');
151151
}
152152

153+
// @ts-expect-error ts(2322)
153154
return typeof freq === 'number' ? fn(freq) : freq.map(x => fn(x));
154155
}
155156

@@ -173,6 +174,7 @@ function mel_to_hertz(mels, mel_scale = "htk") {
173174
throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');
174175
}
175176

177+
// @ts-expect-error ts(2322)
176178
return typeof mels === 'number' ? fn(mels) : mels.map(x => fn(x));
177179
}
178180

src/utils/maths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
/**
12-
* @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray
12+
* @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array} TypedArray
1313
* @typedef {BigInt64Array | BigUint64Array} BigTypedArray
1414
* @typedef {TypedArray | BigTypedArray} AnyTypedArray
1515
*/

src/utils/tensor.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { TensorOpRegistry } from '../ops/registry.js';
2222

2323
export const DataTypeMap = Object.freeze({
2424
float32: Float32Array,
25-
// @ts-expect-error ts(2552) Limited availability of Float16Array across browsers:
25+
// @ts-ignore ts(2552) Limited availability of Float16Array across browsers:
2626
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array
2727
float16: typeof Float16Array !== "undefined" ? Float16Array: Uint16Array,
2828
float64: Float64Array,
@@ -91,8 +91,9 @@ export class Tensor {
9191
// Create new tensor
9292
this.ort_tensor = new ONNXTensor(
9393
/** @type {DataType} */(args[0]),
94+
// @ts-expect-error ts(2769) Type 'number' is not assignable to type 'bigint'.
9495
/** @type {Exclude<import('./maths.js').AnyTypedArray, Uint8ClampedArray>} */(args[1]),
95-
args[2]
96+
args[2],
9697
);
9798
}
9899

0 commit comments

Comments
 (0)