trace-mcp 1.25.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/cli.js +2021 -1504
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/index.js +1048 -942
- package/dist/index.js.map +1 -1
- package/hooks/trace-mcp-launcher.cmd +7 -0
- package/hooks/trace-mcp-launcher.ps1 +162 -0
- package/hooks/trace-mcp-launcher.sh +169 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9843,6 +9843,7 @@ __export(transformers_node_exports, {
|
|
|
9843
9843
|
SmolLM3ForCausalLM: () => SmolLM3ForCausalLM,
|
|
9844
9844
|
SmolLM3Model: () => SmolLM3Model,
|
|
9845
9845
|
SmolLM3PreTrainedModel: () => SmolLM3PreTrainedModel,
|
|
9846
|
+
SmolVLMForConditionalGeneration: () => SmolVLMForConditionalGeneration,
|
|
9846
9847
|
SmolVLMImageProcessor: () => Idefics3ImageProcessor,
|
|
9847
9848
|
SmolVLMProcessor: () => Idefics3Processor,
|
|
9848
9849
|
SnacDecoderModel: () => SnacDecoderModel,
|
|
@@ -10023,6 +10024,7 @@ __export(transformers_node_exports, {
|
|
|
10023
10024
|
interpolate: () => interpolate,
|
|
10024
10025
|
interpolate_4d: () => interpolate_4d,
|
|
10025
10026
|
layer_norm: () => layer_norm,
|
|
10027
|
+
load_audio: () => load_audio,
|
|
10026
10028
|
load_image: () => load_image,
|
|
10027
10029
|
load_video: () => load_video,
|
|
10028
10030
|
log_softmax: () => log_softmax,
|
|
@@ -12184,14 +12186,14 @@ function dynamic_time_warping(matrix) {
|
|
|
12184
12186
|
time_indices.reverse();
|
|
12185
12187
|
return [text_indices, time_indices];
|
|
12186
12188
|
}
|
|
12187
|
-
async function
|
|
12189
|
+
async function es(a = {}) {
|
|
12188
12190
|
var r = a, s = !!globalThis.window, f = !!globalThis.WorkerGlobalScope, i = f && self.name?.startsWith("em-pthread");
|
|
12189
12191
|
r.mountExternalData = (e, t) => {
|
|
12190
12192
|
e.startsWith("./") && (e = e.substring(2)), (r.Uc || (r.Uc = /* @__PURE__ */ new Map())).set(e, t);
|
|
12191
12193
|
}, r.unmountExternalData = () => {
|
|
12192
12194
|
delete r.Uc;
|
|
12193
|
-
}, globalThis.SharedArrayBuffer ?? new WebAssembly.Memory({ initial: 0, maximum: 0,
|
|
12194
|
-
let
|
|
12195
|
+
}, globalThis.SharedArrayBuffer ?? new WebAssembly.Memory({ initial: 0, maximum: 0, shared: true }).buffer.constructor;
|
|
12196
|
+
let d = () => {
|
|
12195
12197
|
let e = (t) => (...n) => {
|
|
12196
12198
|
let o = Me;
|
|
12197
12199
|
return n = t(...n), Me != o ? new Promise((u, c) => {
|
|
@@ -12200,12 +12202,12 @@ async function ts(a = {}) {
|
|
|
12200
12202
|
};
|
|
12201
12203
|
(() => {
|
|
12202
12204
|
for (let t of ["_OrtAppendExecutionProvider", "_OrtCreateSession", "_OrtRun", "_OrtRunWithBinding", "_OrtBindInput"]) r[t] = e(r[t]);
|
|
12203
|
-
})(), typeof jsepRunAsync < "u" && (r._OrtRun = jsepRunAsync(r._OrtRun), r._OrtRunWithBinding = jsepRunAsync(r._OrtRunWithBinding)),
|
|
12205
|
+
})(), typeof jsepRunAsync < "u" && (r._OrtRun = jsepRunAsync(r._OrtRun), r._OrtRunWithBinding = jsepRunAsync(r._OrtRunWithBinding)), d = void 0;
|
|
12204
12206
|
};
|
|
12205
12207
|
r.asyncInit = () => {
|
|
12206
|
-
|
|
12208
|
+
d?.();
|
|
12207
12209
|
};
|
|
12208
|
-
var
|
|
12210
|
+
var l, m, y = (e, t) => {
|
|
12209
12211
|
throw t;
|
|
12210
12212
|
}, w = import.meta.url, T = "";
|
|
12211
12213
|
if (s || f) {
|
|
@@ -12216,7 +12218,7 @@ async function ts(a = {}) {
|
|
|
12216
12218
|
f && (m = (e) => {
|
|
12217
12219
|
var t = new XMLHttpRequest();
|
|
12218
12220
|
return t.open("GET", e, false), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
|
|
12219
|
-
}),
|
|
12221
|
+
}), l = async (e) => {
|
|
12220
12222
|
if (oe(e)) return new Promise((n, o) => {
|
|
12221
12223
|
var u = new XMLHttpRequest();
|
|
12222
12224
|
u.open("GET", e, true), u.responseType = "arraybuffer", u.onload = () => {
|
|
@@ -12228,7 +12230,7 @@ async function ts(a = {}) {
|
|
|
12228
12230
|
throw Error(t.status + " : " + t.url);
|
|
12229
12231
|
};
|
|
12230
12232
|
}
|
|
12231
|
-
var g, v, S, C, R, H, U = console.log.bind(console), M = console.error.bind(console), Y = U,
|
|
12233
|
+
var g, v, S, C, R, H, U = console.log.bind(console), M = console.error.bind(console), Y = U, O = M, W = false, oe = (e) => e.startsWith("file://");
|
|
12232
12234
|
function p() {
|
|
12233
12235
|
Fe.buffer != X.buffer && se();
|
|
12234
12236
|
}
|
|
@@ -12243,53 +12245,53 @@ async function ts(a = {}) {
|
|
|
12243
12245
|
for (let c of u) e(c);
|
|
12244
12246
|
self.onmessage = e;
|
|
12245
12247
|
};
|
|
12246
|
-
for (let c of n.
|
|
12247
|
-
postMessage({ Oc: "callHandler",
|
|
12248
|
-
}, c == "print" && (Y = r[c]), c == "printErr" && (
|
|
12249
|
-
Fe = n.
|
|
12248
|
+
for (let c of n.ce) r[c] && !r[c].proxy || (r[c] = (...h) => {
|
|
12249
|
+
postMessage({ Oc: "callHandler", be: c, args: h });
|
|
12250
|
+
}, c == "print" && (Y = r[c]), c == "printErr" && (O = r[c]));
|
|
12251
|
+
Fe = n.ie, se(), v = n.je, bt(), Gt();
|
|
12250
12252
|
} else if (o === "run") {
|
|
12251
12253
|
(function(u) {
|
|
12252
12254
|
var c = (p(), A)[u + 52 >>> 2 >>> 0];
|
|
12253
12255
|
u = (p(), A)[u + 56 >>> 2 >>> 0], Co(c, c - u), D(c);
|
|
12254
12256
|
})(n.Nc), Wr(n.Nc, 0, 0, 1, 0, 0), bn(), Ar(n.Nc), ne || (po(), ne = true);
|
|
12255
12257
|
try {
|
|
12256
|
-
|
|
12258
|
+
$s(n.ge, n.Wc);
|
|
12257
12259
|
} catch (u) {
|
|
12258
12260
|
if (u != "unwind") throw u;
|
|
12259
12261
|
}
|
|
12260
|
-
} else n.target !== "setimmediate" && (o === "checkMailbox" ? ne && Dt() : o && (
|
|
12262
|
+
} else n.target !== "setimmediate" && (o === "checkMailbox" ? ne && Dt() : o && (O(`worker: received unknown command ${o}`), O(n)));
|
|
12261
12263
|
} catch (u) {
|
|
12262
12264
|
throw xo(), u;
|
|
12263
12265
|
}
|
|
12264
12266
|
};
|
|
12265
|
-
var
|
|
12267
|
+
var vc = e, ne = false;
|
|
12266
12268
|
self.onunhandledrejection = (t) => {
|
|
12267
12269
|
throw t.reason || t;
|
|
12268
12270
|
}, self.onmessage = e;
|
|
12269
12271
|
}
|
|
12270
|
-
var X, J, Ue, Q, x, A, _, ae,
|
|
12272
|
+
var X, J, Ue, Q, x, A, _, ae, me, q, we, re = false;
|
|
12271
12273
|
function se() {
|
|
12272
12274
|
var e = Fe.buffer;
|
|
12273
|
-
r.HEAP8 = X = new Int8Array(e), Ue = new Int16Array(e), r.HEAPU8 = J = new Uint8Array(e), Q = new Uint16Array(e), r.HEAP32 = x = new Int32Array(e), r.HEAPU32 = A = new Uint32Array(e), _ = new Float32Array(e), ae = new Float64Array(e),
|
|
12275
|
+
r.HEAP8 = X = new Int8Array(e), Ue = new Int16Array(e), r.HEAPU8 = J = new Uint8Array(e), Q = new Uint16Array(e), r.HEAP32 = x = new Int32Array(e), r.HEAPU32 = A = new Uint32Array(e), _ = new Float32Array(e), ae = new Float64Array(e), me = new BigInt64Array(e), q = new BigUint64Array(e);
|
|
12274
12276
|
}
|
|
12275
12277
|
function hr() {
|
|
12276
12278
|
re = true, i ? H() : ke._b();
|
|
12277
12279
|
}
|
|
12278
12280
|
function Te(e) {
|
|
12279
|
-
throw
|
|
12281
|
+
throw O(e = "Aborted(" + e + ")"), W = true, e = new WebAssembly.RuntimeError(e + ". Build with -sASSERTIONS for more info."), R?.(e), e;
|
|
12280
12282
|
}
|
|
12281
12283
|
function Ye() {
|
|
12282
|
-
return { a: { f:
|
|
12284
|
+
return { a: { f: zs, J: Vs, k: js, p: Hs, l: Ys, sa: qs, b: Js, ca: Xs, Ja: Sn, q: Qs, da: Ln, Za: On, Fa: Bn, Ha: Mn, _a: Cn, Xa: Un, Qa: Dn, Wa: Pn, oa: _n, Ga: Rn, Xb: Nn, Ya: kn, Yb: Wn, db: Zs, Da: ei, Sb: ti, Qb: ni, Ca: ai, M: si, I: ii, Rb: ui, ja: hi, Tb: yi, Ta: bi, Vb: gi, Ka: Ti, Ob: vi, ka: Ei, Sa: Ar, ab: Si, U: Li, n: Ui, c: Er, rb: Di, w: Pi, L: _i, z: Ri, j: Ni, o: Yn, sb: ki, G: Wi, T: Fi, h: Gi, u: $i, m: zi, i: Vi, Na: ji, Oa: Hi, Pa: Yi, La: Qn, Ma: Zn, Pb: Kn, eb: Ji, cb: Zi, Y: Ki, qb: eu, la: tu, bb: Xi, fb: ru, $a: nu, Wb: ou, N: qi, gb: au, X: su, Ub: iu, nb: yu, C: bu, ra: wu, qa: gu, pb: Tu, W: vu, v: Eu, mb: Su, lb: Au, kb: Iu, ob: xu, jb: Lu, ib: Ou, hb: Bu, Ua: ao, Va: so, Ia: br, V: io, na: uo, Ra: fo, ma: co, Cb: Ff, xa: Pf, Db: Wf, ya: Df, F: Ef, e: ff, s: sf, x: af, B: gf, Fb: Mf, ba: Bf, D: lf, za: Cf, $: _f, ga: Of, Gb: Lf, Hb: xf, Ba: Sf, Aa: If2, Ib: Af, wa: kf, aa: Uf, d: uf, A: df, r: cf, Bb: Gf, t: mf, y: Tf, H: pf, E: hf, K: vf, R: Rf, ia: wf, _: Nf, Jb: bf, Kb: yf, g: Cu, a: Fe, Nb: qe, Eb: Uu, ha: Du, O: Pu, pa: _u, Lb: Ru, ta: Nu, Q: ku, yb: Wu, zb: Fu, ua: Gu, ea: $u, P: zu, Ea: Vu, va: ju, Z: Hu, wb: Yu, Zb: qu, S: Ju, Ab: Xu, tb: Qu, ub: Ku, vb: ef, fa: tf, xb: rf, Mb: nf } };
|
|
12283
12285
|
}
|
|
12284
12286
|
async function bt() {
|
|
12285
12287
|
function e(o, u) {
|
|
12286
12288
|
var c = ke = o.exports;
|
|
12287
12289
|
o = {};
|
|
12288
|
-
for (let [h, b] of Object.entries(c)) typeof b == "function" ? (c =
|
|
12290
|
+
for (let [h, b] of Object.entries(c)) typeof b == "function" ? (c = Ai(b), o[h] = c) : o[h] = b;
|
|
12289
12291
|
return ke = o, ke = (function() {
|
|
12290
12292
|
var h = ke, b = (I) => (F) => I(F) >>> 0, E = (I) => () => I() >>> 0;
|
|
12291
12293
|
return (h = Object.assign({}, h)).$b = b(h.$b), h.Cc = E(h.Cc), h.Ec = b(h.Ec), h.rd = /* @__PURE__ */ ((I) => (F, j3) => I(F, j3) >>> 0)(h.rd), h.wd = b(h.wd), h.xd = E(h.xd), h.Bd = b(h.Bd), h;
|
|
12292
|
-
})(), hn.push(ke.id), lo = (o = ke).$b, po = o.ac, r._OrtInit = o.bc, r._OrtGetLastError = o.cc, r._OrtCreateSessionOptions = o.dc, r._OrtAppendExecutionProvider = o.ec, r._OrtAddFreeDimensionOverride = o.fc, r._OrtAddSessionConfigEntry = o.gc, r._OrtReleaseSessionOptions = o.hc, r._OrtCreateSession = o.ic, r._OrtReleaseSession = o.jc, r._OrtGetInputOutputCount = o.kc, r._OrtGetInputOutputMetadata = o.lc, r._OrtFree = o.mc, r._OrtCreateTensor = o.nc, r._OrtGetTensorData = o.oc, r._OrtReleaseTensor = o.pc, r._OrtCreateRunOptions = o.qc, r._OrtAddRunConfigEntry = o.rc, r._OrtReleaseRunOptions = o.sc, r._OrtCreateBinding = o.tc, r._OrtBindInput = o.uc, r._OrtBindOutput = o.vc, r._OrtClearBoundOutputs = o.wc, r._OrtReleaseBinding = o.xc, r._OrtRunWithBinding = o.yc, r._OrtRun = o.zc, r._OrtEndProfiling = o.Ac, Dr = r._OrtGetWebGpuDevice = o.Bc, Wt = o.Cc, xe = r._free = o.Dc, pt = r._malloc = o.Ec, mo = r._wgpuBufferRelease = o.Fc, ho = r._wgpuCreateInstance = o.Gc, yo = o.Hc, bo = o.Ic, wo = o.Jc, go = o.Kc, To = o.Lc, vo = o.Pc, Eo = o.Zc, So = o._c, Ao = o.$c, Pr = o.bd, _r = o.cd, Rr = o.dd, Nr = o.ed, Et = o.fd, kr = o.gd, Io = o.hd, Wr = o.kd, xo = o.ld, Lo = o.md, Oo = o.nd, Fr = o.od, Bo = o.pd, Mo = o.qd, Gr = o.rd, N = o.sd, St = o.td, Co = o.ud, D = o.vd, Ft = o.wd, P = o.xd, Uo = o.yd, $r = o.zd, Do = o.Ad, Po = o.Bd, _o = o.Cd, zr = o.Dd, Ro = o.Ed, No = o.Fd, ko = o.Gd, Wo = o.Hd, Fo = o.Id, Go = o.Jd, $o = o.Kd, zo = o.Ld, Vo = o.Md, jo = o.Nd, Ho = o.Od, Yo = o.Pd, qo = o.Qd, Jo = o.Rd, Xo = o.Td, Qo = o.Ud, Zo = o.Vd, Ko = o.Wd, ea = o.Yd, ta = o.Zd, ra = o._d, na = o.$d, oa = o.ae, aa = o.
|
|
12294
|
+
})(), hn.push(ke.id), lo = (o = ke).$b, po = o.ac, r._OrtInit = o.bc, r._OrtGetLastError = o.cc, r._OrtCreateSessionOptions = o.dc, r._OrtAppendExecutionProvider = o.ec, r._OrtAddFreeDimensionOverride = o.fc, r._OrtAddSessionConfigEntry = o.gc, r._OrtReleaseSessionOptions = o.hc, r._OrtCreateSession = o.ic, r._OrtReleaseSession = o.jc, r._OrtGetInputOutputCount = o.kc, r._OrtGetInputOutputMetadata = o.lc, r._OrtFree = o.mc, r._OrtCreateTensor = o.nc, r._OrtGetTensorData = o.oc, r._OrtReleaseTensor = o.pc, r._OrtCreateRunOptions = o.qc, r._OrtAddRunConfigEntry = o.rc, r._OrtReleaseRunOptions = o.sc, r._OrtCreateBinding = o.tc, r._OrtBindInput = o.uc, r._OrtBindOutput = o.vc, r._OrtClearBoundOutputs = o.wc, r._OrtReleaseBinding = o.xc, r._OrtRunWithBinding = o.yc, r._OrtRun = o.zc, r._OrtEndProfiling = o.Ac, Dr = r._OrtGetWebGpuDevice = o.Bc, Wt = o.Cc, xe = r._free = o.Dc, pt = r._malloc = o.Ec, mo = r._wgpuBufferRelease = o.Fc, ho = r._wgpuCreateInstance = o.Gc, yo = o.Hc, bo = o.Ic, wo = o.Jc, go = o.Kc, To = o.Lc, vo = o.Pc, Eo = o.Zc, So = o._c, Ao = o.$c, Pr = o.bd, _r = o.cd, Rr = o.dd, Nr = o.ed, Et = o.fd, kr = o.gd, Io = o.hd, Wr = o.kd, xo = o.ld, Lo = o.md, Oo = o.nd, Fr = o.od, Bo = o.pd, Mo = o.qd, Gr = o.rd, N = o.sd, St = o.td, Co = o.ud, D = o.vd, Ft = o.wd, P = o.xd, Uo = o.yd, $r = o.zd, Do = o.Ad, Po = o.Bd, _o = o.Cd, zr = o.Dd, Ro = o.Ed, No = o.Fd, ko = o.Gd, Wo = o.Hd, Fo = o.Id, Go = o.Jd, $o = o.Kd, zo = o.Ld, Vo = o.Md, jo = o.Nd, Ho = o.Od, Yo = o.Pd, qo = o.Qd, Jo = o.Rd, Xo = o.Td, Qo = o.Ud, Zo = o.Vd, Ko = o.Wd, ea = o.Yd, ta = o.Zd, ra = o._d, na = o.$d, oa = o.ae, aa = o.oe, sa = o.pe, ia = o.qe, ua = o.re, fa = o.se, ca = o.te, da = o.ue, la = o.ve, pa = o.we, ma = o.xe, ha = o.ye, ya = o.Ye, ba = o.Ze, wa = o._e, ga = o.$e, v = u, ke;
|
|
12293
12295
|
}
|
|
12294
12296
|
var t, n = Ye();
|
|
12295
12297
|
return r.instantiateWasm ? new Promise((o) => {
|
|
@@ -12302,13 +12304,13 @@ async function ts(a = {}) {
|
|
|
12302
12304
|
var c = fetch(u, { credentials: "same-origin" });
|
|
12303
12305
|
return await WebAssembly.instantiateStreaming(c, o);
|
|
12304
12306
|
} catch (h) {
|
|
12305
|
-
|
|
12307
|
+
O(`wasm streaming compile failed: ${h}`), O("falling back to ArrayBuffer instantiation");
|
|
12306
12308
|
}
|
|
12307
12309
|
return (async function(h, b) {
|
|
12308
12310
|
try {
|
|
12309
12311
|
var E = await (async function(I) {
|
|
12310
12312
|
if (!g) try {
|
|
12311
|
-
var F = await
|
|
12313
|
+
var F = await l(I);
|
|
12312
12314
|
return new Uint8Array(F);
|
|
12313
12315
|
} catch {
|
|
12314
12316
|
}
|
|
@@ -12321,7 +12323,7 @@ async function ts(a = {}) {
|
|
|
12321
12323
|
})(h);
|
|
12322
12324
|
return await WebAssembly.instantiate(E, b);
|
|
12323
12325
|
} catch (I) {
|
|
12324
|
-
|
|
12326
|
+
O(`failed to asynchronously prepare wasm: ${I}`), Te(I);
|
|
12325
12327
|
}
|
|
12326
12328
|
})(u, o);
|
|
12327
12329
|
})(n), e(t.instance, t.module));
|
|
@@ -12340,11 +12342,11 @@ async function ts(a = {}) {
|
|
|
12340
12342
|
var t = We.pop();
|
|
12341
12343
|
if (!t) return 6;
|
|
12342
12344
|
gt.push(t), Je[e.Nc] = t, t.Nc = e.Nc;
|
|
12343
|
-
var n = { Oc: "run",
|
|
12345
|
+
var n = { Oc: "run", ge: e.fe, Wc: e.Wc, Nc: e.Nc };
|
|
12344
12346
|
return t.postMessage(n, e.Yc), 0;
|
|
12345
12347
|
}, G = 0, V = (e, t, ...n) => {
|
|
12346
12348
|
var o, u = 16 * n.length, c = P(), h = Ft(u), b = h >>> 3;
|
|
12347
|
-
for (o of n) typeof o == "bigint" ? ((p(),
|
|
12349
|
+
for (o of n) typeof o == "bigint" ? ((p(), me)[b++ >>> 0] = 1n, (p(), me)[b++ >>> 0] = o) : ((p(), me)[b++ >>> 0] = 0n, (p(), ae)[b++ >>> 0] = o);
|
|
12348
12350
|
return e = Lo(e, 0, u, h, t), D(c), e;
|
|
12349
12351
|
};
|
|
12350
12352
|
function qe(e) {
|
|
@@ -12375,16 +12377,16 @@ async function ts(a = {}) {
|
|
|
12375
12377
|
var c = u.data;
|
|
12376
12378
|
if (u = c.Oc, c.Vc && c.Vc != Wt()) {
|
|
12377
12379
|
var h = Je[c.Vc];
|
|
12378
|
-
h ? h.postMessage(c, c.Yc) :
|
|
12380
|
+
h ? h.postMessage(c, c.Yc) : O(`Internal error! Worker sent a message "${u}" to target pthread ${c.Vc}, but that thread no longer exists!`);
|
|
12379
12381
|
} else u === "checkMailbox" ? Dt() : u === "spawnThread" ? Z(c) : u === "cleanupThread" ? he(() => {
|
|
12380
|
-
yn(Je[c.
|
|
12381
|
-
}) : u === "loaded" ? (e.loaded = true, t(e)) : c.target === "setimmediate" ? e.postMessage(c) : u === "uncaughtException" ? e.onerror(c.error) : u === "callHandler" ? r[c.
|
|
12382
|
+
yn(Je[c.he]);
|
|
12383
|
+
}) : u === "loaded" ? (e.loaded = true, t(e)) : c.target === "setimmediate" ? e.postMessage(c) : u === "uncaughtException" ? e.onerror(c.error) : u === "callHandler" ? r[c.be](...c.args) : u && O(`worker sent an unknown command ${u}`);
|
|
12382
12384
|
}, e.onerror = (u) => {
|
|
12383
|
-
throw
|
|
12385
|
+
throw O(`worker sent an error! ${u.filename}:${u.lineno}: ${u.message}`), u;
|
|
12384
12386
|
};
|
|
12385
12387
|
var n, o = [];
|
|
12386
12388
|
for (n of []) r.propertyIsEnumerable(n) && o.push(n);
|
|
12387
|
-
e.postMessage({ Oc: "load",
|
|
12389
|
+
e.postMessage({ Oc: "load", ce: o, ie: Fe, je: v });
|
|
12388
12390
|
});
|
|
12389
12391
|
function gn() {
|
|
12390
12392
|
var e = new Worker((() => {
|
|
@@ -12393,14 +12395,14 @@ async function ts(a = {}) {
|
|
|
12393
12395
|
})(), { type: "module", workerData: "em-pthread", name: "em-pthread" });
|
|
12394
12396
|
We.push(e);
|
|
12395
12397
|
}
|
|
12396
|
-
var Fe,
|
|
12398
|
+
var Fe, $s = (e, t) => {
|
|
12397
12399
|
G = 0, e = zr(e, t), 0 < G ? S = e : Fr(e);
|
|
12398
|
-
}, Ct = [], Ut = 0,
|
|
12399
|
-
function
|
|
12400
|
+
}, Ct = [], Ut = 0, ce = (e) => -9007199254740992 > e || 9007199254740992 < e ? NaN : Number(e);
|
|
12401
|
+
function zs(e) {
|
|
12400
12402
|
var t = new wr(e >>>= 0);
|
|
12401
12403
|
return (p(), X)[t.Qc + 12 >>> 0] == 0 && (Tn(t, true), Ut--), vn(t, false), Ct.push(t), Po(e);
|
|
12402
12404
|
}
|
|
12403
|
-
var ft = 0,
|
|
12405
|
+
var ft = 0, Vs = () => {
|
|
12404
12406
|
N(0, 0);
|
|
12405
12407
|
var e = Ct.pop();
|
|
12406
12408
|
Uo(e.Xc), ft = 0;
|
|
@@ -12429,35 +12431,35 @@ async function ts(a = {}) {
|
|
|
12429
12431
|
}
|
|
12430
12432
|
return St(o), t;
|
|
12431
12433
|
};
|
|
12432
|
-
function
|
|
12434
|
+
function js() {
|
|
12433
12435
|
return gr([]);
|
|
12434
12436
|
}
|
|
12435
|
-
function
|
|
12437
|
+
function Hs(e) {
|
|
12436
12438
|
return gr([e >>> 0]);
|
|
12437
12439
|
}
|
|
12438
|
-
function
|
|
12440
|
+
function Ys(e, t, n, o) {
|
|
12439
12441
|
return gr([e >>> 0, t >>> 0, n >>> 0, o >>> 0]);
|
|
12440
12442
|
}
|
|
12441
|
-
var
|
|
12443
|
+
var qs = () => {
|
|
12442
12444
|
var e = Ct.pop();
|
|
12443
12445
|
e || Te("no exception to throw");
|
|
12444
12446
|
var t = e.Xc;
|
|
12445
12447
|
throw (p(), X)[e.Qc + 13 >>> 0] == 0 && (Ct.push(e), vn(e, true), Tn(e, false), Ut++), $r(t), ft = t;
|
|
12446
12448
|
};
|
|
12447
|
-
function
|
|
12449
|
+
function Js(e, t, n) {
|
|
12448
12450
|
var o = new wr(e >>>= 0);
|
|
12449
12451
|
throw t >>>= 0, n >>>= 0, (p(), A)[o.Qc + 16 >>> 2 >>> 0] = 0, (p(), A)[o.Qc + 4 >>> 2 >>> 0] = t, (p(), A)[o.Qc + 8 >>> 2 >>> 0] = n, $r(e), Ut++, ft = e;
|
|
12450
12452
|
}
|
|
12451
|
-
var
|
|
12453
|
+
var Xs = () => Ut;
|
|
12452
12454
|
function En(e, t, n, o) {
|
|
12453
12455
|
return i ? V(2, 1, e, t, n, o) : Sn(e, t, n, o);
|
|
12454
12456
|
}
|
|
12455
12457
|
function Sn(e, t, n, o) {
|
|
12456
12458
|
if (e >>>= 0, t >>>= 0, n >>>= 0, o >>>= 0, !globalThis.SharedArrayBuffer) return 6;
|
|
12457
12459
|
var u = [];
|
|
12458
|
-
return i && u.length === 0 ? En(e, t, n, o) : (e = {
|
|
12460
|
+
return i && u.length === 0 ? En(e, t, n, o) : (e = { fe: n, Nc: e, Wc: o, Yc: u }, i ? (e.Oc = "spawnThread", postMessage(e, u), 0) : Z(e));
|
|
12459
12461
|
}
|
|
12460
|
-
function
|
|
12462
|
+
function Qs(e) {
|
|
12461
12463
|
throw ft ||= e >>> 0, ft;
|
|
12462
12464
|
}
|
|
12463
12465
|
var An = globalThis.TextDecoder && new TextDecoder(), In = (e, t, n, o) => {
|
|
@@ -12518,14 +12520,14 @@ async function ts(a = {}) {
|
|
|
12518
12520
|
function Wn(e, t, n) {
|
|
12519
12521
|
if (i) return V(15, 1, e, t, n);
|
|
12520
12522
|
}
|
|
12521
|
-
var
|
|
12523
|
+
var Zs = () => Te(""), Be = (e) => {
|
|
12522
12524
|
e >>>= 0;
|
|
12523
12525
|
for (var t = ""; ; ) {
|
|
12524
12526
|
var n = (p(), J)[e++ >>> 0];
|
|
12525
12527
|
if (!n) return t;
|
|
12526
12528
|
t += String.fromCharCode(n);
|
|
12527
12529
|
}
|
|
12528
|
-
}, Tr = {}, vr = {},
|
|
12530
|
+
}, Tr = {}, vr = {}, Ks = {}, dt = class extends Error {
|
|
12529
12531
|
constructor(e) {
|
|
12530
12532
|
super(e), this.name = "BindingError";
|
|
12531
12533
|
}
|
|
@@ -12533,12 +12535,12 @@ async function ts(a = {}) {
|
|
|
12533
12535
|
function De(e, t, n = {}) {
|
|
12534
12536
|
return (function(o, u, c = {}) {
|
|
12535
12537
|
var h = u.name;
|
|
12536
|
-
if (!o) throw new
|
|
12538
|
+
if (!o) throw new dt(`type "${h}" must have a positive integer typeid pointer`);
|
|
12537
12539
|
if (vr.hasOwnProperty(o)) {
|
|
12538
|
-
if (c.
|
|
12539
|
-
throw new
|
|
12540
|
+
if (c.de) return;
|
|
12541
|
+
throw new dt(`Cannot register type '${h}' twice`);
|
|
12540
12542
|
}
|
|
12541
|
-
vr[o] = u, delete
|
|
12543
|
+
vr[o] = u, delete Ks[o], Tr.hasOwnProperty(o) && (u = Tr[o], delete Tr[o], u.forEach((b) => b()));
|
|
12542
12544
|
})(e, t, n);
|
|
12543
12545
|
}
|
|
12544
12546
|
var Fn = (e, t, n) => {
|
|
@@ -12550,12 +12552,12 @@ async function ts(a = {}) {
|
|
|
12550
12552
|
case 4:
|
|
12551
12553
|
return n ? (o) => (p(), x)[o >>> 2 >>> 0] : (o) => (p(), A)[o >>> 2 >>> 0];
|
|
12552
12554
|
case 8:
|
|
12553
|
-
return n ? (o) => (p(),
|
|
12555
|
+
return n ? (o) => (p(), me)[o >>> 3 >>> 0] : (o) => (p(), q)[o >>> 3 >>> 0];
|
|
12554
12556
|
default:
|
|
12555
12557
|
throw new TypeError(`invalid integer width (${t}): ${e}`);
|
|
12556
12558
|
}
|
|
12557
12559
|
};
|
|
12558
|
-
function
|
|
12560
|
+
function ei(e, t, n, o, u) {
|
|
12559
12561
|
e >>>= 0, n >>>= 0, t = Be(t >>> 0);
|
|
12560
12562
|
let c = (h) => h;
|
|
12561
12563
|
if (o = o === 0n) {
|
|
@@ -12564,7 +12566,7 @@ async function ts(a = {}) {
|
|
|
12564
12566
|
}
|
|
12565
12567
|
De(e, { name: t, Mc: c, Sc: (h, b) => (typeof b == "number" && (b = BigInt(b)), b), Rc: Fn(t, n, !o), Tc: null });
|
|
12566
12568
|
}
|
|
12567
|
-
function
|
|
12569
|
+
function ti(e, t, n, o) {
|
|
12568
12570
|
De(e >>>= 0, { name: t = Be(t >>> 0), Mc: function(u) {
|
|
12569
12571
|
return !!u;
|
|
12570
12572
|
}, Sc: function(u, c) {
|
|
@@ -12578,7 +12580,7 @@ async function ts(a = {}) {
|
|
|
12578
12580
|
9 < (e >>>= 0) && --Xe[e + 1] == 0 && (Xe[e] = void 0, Gn.push(e));
|
|
12579
12581
|
}
|
|
12580
12582
|
var ve = (e) => {
|
|
12581
|
-
if (!e) throw new
|
|
12583
|
+
if (!e) throw new dt(`Cannot use deleted val. handle = ${e}`);
|
|
12582
12584
|
return Xe[e];
|
|
12583
12585
|
}, Ie = (e) => {
|
|
12584
12586
|
switch (e) {
|
|
@@ -12598,14 +12600,14 @@ async function ts(a = {}) {
|
|
|
12598
12600
|
function Sr(e) {
|
|
12599
12601
|
return this.Mc((p(), A)[e >>> 2 >>> 0]);
|
|
12600
12602
|
}
|
|
12601
|
-
var
|
|
12603
|
+
var ri = { name: "emscripten::val", Mc: (e) => {
|
|
12602
12604
|
var t = ve(e);
|
|
12603
12605
|
return Er(e), t;
|
|
12604
12606
|
}, Sc: (e, t) => Ie(t), Rc: Sr, Tc: null };
|
|
12605
|
-
function
|
|
12606
|
-
return De(e >>> 0,
|
|
12607
|
+
function ni(e) {
|
|
12608
|
+
return De(e >>> 0, ri);
|
|
12607
12609
|
}
|
|
12608
|
-
var
|
|
12610
|
+
var oi = (e, t) => {
|
|
12609
12611
|
switch (t) {
|
|
12610
12612
|
case 4:
|
|
12611
12613
|
return function(n) {
|
|
@@ -12619,10 +12621,10 @@ async function ts(a = {}) {
|
|
|
12619
12621
|
throw new TypeError(`invalid float width (${t}): ${e}`);
|
|
12620
12622
|
}
|
|
12621
12623
|
};
|
|
12622
|
-
function
|
|
12623
|
-
n >>>= 0, De(e >>>= 0, { name: t = Be(t >>> 0), Mc: (o) => o, Sc: (o, u) => u, Rc:
|
|
12624
|
+
function ai(e, t, n) {
|
|
12625
|
+
n >>>= 0, De(e >>>= 0, { name: t = Be(t >>> 0), Mc: (o) => o, Sc: (o, u) => u, Rc: oi(t, n), Tc: null });
|
|
12624
12626
|
}
|
|
12625
|
-
function
|
|
12627
|
+
function si(e, t, n, o, u) {
|
|
12626
12628
|
e >>>= 0, n >>>= 0, t = Be(t >>> 0);
|
|
12627
12629
|
let c = (b) => b;
|
|
12628
12630
|
if (o === 0) {
|
|
@@ -12631,13 +12633,13 @@ async function ts(a = {}) {
|
|
|
12631
12633
|
}
|
|
12632
12634
|
De(e, { name: t, Mc: c, Sc: (b, E) => E, Rc: Fn(t, n, o !== 0), Tc: null });
|
|
12633
12635
|
}
|
|
12634
|
-
function
|
|
12636
|
+
function ii(e, t, n) {
|
|
12635
12637
|
function o(c) {
|
|
12636
12638
|
var h = (p(), A)[c >>> 2 >>> 0];
|
|
12637
12639
|
return c = (p(), A)[c + 4 >>> 2 >>> 0], new u((p(), X).buffer, c, h);
|
|
12638
12640
|
}
|
|
12639
12641
|
var u = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array][t];
|
|
12640
|
-
De(e >>>= 0, { name: n = Be(n >>> 0), Mc: o, Rc: o }, {
|
|
12642
|
+
De(e >>>= 0, { name: n = Be(n >>> 0), Mc: o, Rc: o }, { de: true });
|
|
12641
12643
|
}
|
|
12642
12644
|
var Pe = (e, t, n) => {
|
|
12643
12645
|
var o = (p(), J);
|
|
@@ -12670,28 +12672,28 @@ async function ts(a = {}) {
|
|
|
12670
12672
|
}
|
|
12671
12673
|
return t;
|
|
12672
12674
|
};
|
|
12673
|
-
function
|
|
12675
|
+
function ui(e, t) {
|
|
12674
12676
|
De(e >>>= 0, { name: t = Be(t >>> 0), Mc(n) {
|
|
12675
12677
|
var o = (p(), A)[n >>> 2 >>> 0];
|
|
12676
12678
|
return o = ct(n + 4, o, true), xe(n), o;
|
|
12677
12679
|
}, Sc(n, o) {
|
|
12678
12680
|
o instanceof ArrayBuffer && (o = new Uint8Array(o));
|
|
12679
12681
|
var u = typeof o == "string";
|
|
12680
|
-
if (!(u || ArrayBuffer.isView(o) && o.BYTES_PER_ELEMENT == 1)) throw new
|
|
12682
|
+
if (!(u || ArrayBuffer.isView(o) && o.BYTES_PER_ELEMENT == 1)) throw new dt("Cannot pass non-string to std::string");
|
|
12681
12683
|
var c = u ? _e(o) : o.length, h = pt(4 + c + 1), b = h + 4;
|
|
12682
12684
|
return (p(), A)[h >>> 2 >>> 0] = c, u ? Pe(o, b, c + 1) : (p(), J).set(o, b >>> 0), n !== null && n.push(xe, h), h;
|
|
12683
12685
|
}, Rc: Sr, Tc(n) {
|
|
12684
12686
|
xe(n);
|
|
12685
12687
|
} });
|
|
12686
12688
|
}
|
|
12687
|
-
var $n = globalThis.TextDecoder ? new TextDecoder("utf-16le") : void 0,
|
|
12689
|
+
var $n = globalThis.TextDecoder ? new TextDecoder("utf-16le") : void 0, fi = (e, t, n) => {
|
|
12688
12690
|
if (e >>>= 1, 16 < (t = In((p(), Q), e, t / 2, n)) - e && $n) return $n.decode((p(), Q).slice(e, t));
|
|
12689
12691
|
for (n = ""; e < t; ++e) {
|
|
12690
12692
|
var o = (p(), Q)[e >>> 0];
|
|
12691
12693
|
n += String.fromCharCode(o);
|
|
12692
12694
|
}
|
|
12693
12695
|
return n;
|
|
12694
|
-
},
|
|
12696
|
+
}, ci = (e, t, n) => {
|
|
12695
12697
|
if (n ??= 2147483647, 2 > n) return 0;
|
|
12696
12698
|
var o = t;
|
|
12697
12699
|
n = (n -= 2) < 2 * e.length ? n / 2 : e.length;
|
|
@@ -12700,7 +12702,7 @@ async function ts(a = {}) {
|
|
|
12700
12702
|
(p(), Ue)[t >>> 1 >>> 0] = c, t += 2;
|
|
12701
12703
|
}
|
|
12702
12704
|
return (p(), Ue)[t >>> 1 >>> 0] = 0, t - o;
|
|
12703
|
-
}, di = (e) => 2 * e.length,
|
|
12705
|
+
}, di = (e) => 2 * e.length, li = (e, t, n) => {
|
|
12704
12706
|
var o = "";
|
|
12705
12707
|
e >>>= 2;
|
|
12706
12708
|
for (var u = 0; !(u >= t / 4); u++) {
|
|
@@ -12709,7 +12711,7 @@ async function ts(a = {}) {
|
|
|
12709
12711
|
o += String.fromCodePoint(c);
|
|
12710
12712
|
}
|
|
12711
12713
|
return o;
|
|
12712
|
-
},
|
|
12714
|
+
}, pi = (e, t, n) => {
|
|
12713
12715
|
if (t >>>= 0, n ??= 2147483647, 4 > n) return 0;
|
|
12714
12716
|
var o = t;
|
|
12715
12717
|
n = o + n - 4;
|
|
@@ -12718,30 +12720,30 @@ async function ts(a = {}) {
|
|
|
12718
12720
|
if (65535 < c && u++, (p(), x)[t >>> 2 >>> 0] = c, (t += 4) + 4 > n) break;
|
|
12719
12721
|
}
|
|
12720
12722
|
return (p(), x)[t >>> 2 >>> 0] = 0, t - o;
|
|
12721
|
-
},
|
|
12723
|
+
}, mi = (e) => {
|
|
12722
12724
|
for (var t = 0, n = 0; n < e.length; ++n) 65535 < e.codePointAt(n) && n++, t += 4;
|
|
12723
12725
|
return t;
|
|
12724
12726
|
};
|
|
12725
|
-
function
|
|
12726
|
-
if (e >>>= 0, t >>>= 0, n = Be(n >>>= 0), t === 2) var o =
|
|
12727
|
-
else o =
|
|
12727
|
+
function hi(e, t, n) {
|
|
12728
|
+
if (e >>>= 0, t >>>= 0, n = Be(n >>>= 0), t === 2) var o = fi, u = ci, c = di;
|
|
12729
|
+
else o = li, u = pi, c = mi;
|
|
12728
12730
|
De(e, { name: n, Mc: (h) => {
|
|
12729
12731
|
var b = (p(), A)[h >>> 2 >>> 0];
|
|
12730
12732
|
return b = o(h + 4, b * t, true), xe(h), b;
|
|
12731
12733
|
}, Sc: (h, b) => {
|
|
12732
|
-
if (typeof b != "string") throw new
|
|
12734
|
+
if (typeof b != "string") throw new dt(`Cannot pass non-string to C++ string type ${n}`);
|
|
12733
12735
|
var E = c(b), I = pt(4 + E + t);
|
|
12734
12736
|
return (p(), A)[I >>> 2 >>> 0] = E / t, u(b, I + 4, E + t), h !== null && h.push(xe, I), I;
|
|
12735
12737
|
}, Rc: Sr, Tc(h) {
|
|
12736
12738
|
xe(h);
|
|
12737
12739
|
} });
|
|
12738
12740
|
}
|
|
12739
|
-
function
|
|
12740
|
-
De(e >>>= 0, {
|
|
12741
|
+
function yi(e, t) {
|
|
12742
|
+
De(e >>>= 0, { ee: true, name: t = Be(t >>> 0), Mc: () => {
|
|
12741
12743
|
}, Sc: () => {
|
|
12742
12744
|
} });
|
|
12743
12745
|
}
|
|
12744
|
-
function
|
|
12746
|
+
function bi(e) {
|
|
12745
12747
|
Wr(e >>> 0, !f, 1, !s, 131072, false), bn();
|
|
12746
12748
|
}
|
|
12747
12749
|
var he = (e) => {
|
|
@@ -12754,32 +12756,32 @@ async function ts(a = {}) {
|
|
|
12754
12756
|
} catch (t) {
|
|
12755
12757
|
t instanceof wt || t == "unwind" || y(0, t);
|
|
12756
12758
|
}
|
|
12757
|
-
},
|
|
12759
|
+
}, wi = !Atomics.waitAsync || globalThis.navigator?.userAgent && 91 > Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./) || [])[2]);
|
|
12758
12760
|
function Ar(e) {
|
|
12759
|
-
e >>>= 0,
|
|
12761
|
+
e >>>= 0, wi || (Atomics.waitAsync((p(), x), e >>> 2, e).value.then(Dt), e += 128, Atomics.store((p(), x), e >>> 2, 1));
|
|
12760
12762
|
}
|
|
12761
12763
|
var Dt = () => he(() => {
|
|
12762
12764
|
var e = Wt();
|
|
12763
12765
|
e && (Ar(e), Mo());
|
|
12764
12766
|
});
|
|
12765
|
-
function
|
|
12767
|
+
function gi(e, t) {
|
|
12766
12768
|
(e >>>= 0) == t >>> 0 ? setTimeout(Dt) : i ? postMessage({ Vc: e, Oc: "checkMailbox" }) : (e = Je[e]) && e.postMessage({ Oc: "checkMailbox" });
|
|
12767
12769
|
}
|
|
12768
12770
|
var Ir = [];
|
|
12769
|
-
function
|
|
12771
|
+
function Ti(e, t, n, o, u) {
|
|
12770
12772
|
for (t >>>= 0, u >>>= 0, Ir.length = 0, n = u >>> 3, o = u + o >>> 3; n < o; ) {
|
|
12771
12773
|
var c;
|
|
12772
|
-
c = (p(),
|
|
12774
|
+
c = (p(), me)[n++ >>> 0] ? (p(), me)[n++ >>> 0] : (p(), ae)[n++ >>> 0], Ir.push(c);
|
|
12773
12775
|
}
|
|
12774
12776
|
return (t ? Vr[t] : of[e])(...Ir);
|
|
12775
12777
|
}
|
|
12776
|
-
var
|
|
12778
|
+
var vi = () => {
|
|
12777
12779
|
G = 0;
|
|
12778
12780
|
};
|
|
12779
|
-
function
|
|
12780
|
-
e >>>= 0, i ? postMessage({ Oc: "cleanupThread",
|
|
12781
|
+
function Ei(e) {
|
|
12782
|
+
e >>>= 0, i ? postMessage({ Oc: "cleanupThread", he: e }) : yn(Je[e]);
|
|
12781
12783
|
}
|
|
12782
|
-
function
|
|
12784
|
+
function Si(e) {
|
|
12783
12785
|
}
|
|
12784
12786
|
var Pt = (e) => {
|
|
12785
12787
|
try {
|
|
@@ -12788,24 +12790,24 @@ async function ts(a = {}) {
|
|
|
12788
12790
|
Te(t);
|
|
12789
12791
|
}
|
|
12790
12792
|
};
|
|
12791
|
-
function
|
|
12793
|
+
function Ai(e) {
|
|
12792
12794
|
var t = (...n) => {
|
|
12793
12795
|
_t.push(e);
|
|
12794
12796
|
try {
|
|
12795
12797
|
return e(...n);
|
|
12796
12798
|
} finally {
|
|
12797
|
-
W || (_t.pop(), Me && Ge === 1 && _t.length === 0 && (Ge = 0, G += 1, Pt(
|
|
12799
|
+
W || (_t.pop(), Me && Ge === 1 && _t.length === 0 && (Ge = 0, G += 1, Pt(ba), typeof Fibers < "u" && Fibers.Be()));
|
|
12798
12800
|
}
|
|
12799
12801
|
};
|
|
12800
12802
|
return jn.set(e, t), t;
|
|
12801
12803
|
}
|
|
12802
|
-
var Ge = 0, Me = null, zn = 0, _t = [], xr = /* @__PURE__ */ new Map(), Vn = /* @__PURE__ */ new Map(), jn = /* @__PURE__ */ new Map(),
|
|
12804
|
+
var Ge = 0, Me = null, zn = 0, _t = [], xr = /* @__PURE__ */ new Map(), Vn = /* @__PURE__ */ new Map(), jn = /* @__PURE__ */ new Map(), Ii = 0, Lr = null, xi = [], Hn = (e) => (function(t) {
|
|
12803
12805
|
if (!W) {
|
|
12804
12806
|
if (Ge === 0) {
|
|
12805
12807
|
var n = false, o = false;
|
|
12806
12808
|
t((u = 0) => {
|
|
12807
12809
|
if (!W && (zn = u, n = true, o)) {
|
|
12808
|
-
Ge = 2, Pt(() =>
|
|
12810
|
+
Ge = 2, Pt(() => wa(Me)), typeof MainLoop < "u" && MainLoop.Xd && MainLoop.resume(), u = false;
|
|
12809
12811
|
try {
|
|
12810
12812
|
var c = (function() {
|
|
12811
12813
|
var E = (p(), x)[Me + 8 >>> 2 >>> 0];
|
|
@@ -12824,42 +12826,42 @@ async function ts(a = {}) {
|
|
|
12824
12826
|
}), o = true, n || (Ge = 1, Me = (function() {
|
|
12825
12827
|
var u = pt(65548), c = u + 12;
|
|
12826
12828
|
if ((p(), A)[u >>> 2 >>> 0] = c, (p(), A)[u + 4 >>> 2 >>> 0] = c + 65536, c = _t[0], !xr.has(c)) {
|
|
12827
|
-
var h =
|
|
12829
|
+
var h = Ii++;
|
|
12828
12830
|
xr.set(c, h), Vn.set(h, c);
|
|
12829
12831
|
}
|
|
12830
12832
|
return c = xr.get(c), (p(), x)[u + 8 >>> 2 >>> 0] = c, u;
|
|
12831
|
-
})(), typeof MainLoop < "u" && MainLoop.Xd && MainLoop.pause(), Pt(() =>
|
|
12832
|
-
} else Ge === 2 ? (Ge = 0, Pt(
|
|
12833
|
+
})(), typeof MainLoop < "u" && MainLoop.Xd && MainLoop.pause(), Pt(() => ya(Me)));
|
|
12834
|
+
} else Ge === 2 ? (Ge = 0, Pt(ga), xe(Me), Me = null, xi.forEach(he)) : Te(`invalid state: ${Ge}`);
|
|
12833
12835
|
return zn;
|
|
12834
12836
|
}
|
|
12835
12837
|
})((t) => {
|
|
12836
12838
|
e().then(t);
|
|
12837
12839
|
});
|
|
12838
|
-
function
|
|
12840
|
+
function Li(e) {
|
|
12839
12841
|
return e >>>= 0, Hn(async () => {
|
|
12840
12842
|
var t = await ve(e);
|
|
12841
12843
|
return Ie(t);
|
|
12842
12844
|
});
|
|
12843
12845
|
}
|
|
12844
|
-
var Or = [],
|
|
12846
|
+
var Or = [], Oi = (e) => {
|
|
12845
12847
|
var t = Or.length;
|
|
12846
12848
|
return Or.push(e), t;
|
|
12847
|
-
},
|
|
12849
|
+
}, Bi = (e, t) => {
|
|
12848
12850
|
for (var n = Array(e), o = 0; o < e; ++o) {
|
|
12849
12851
|
var u = o, c = (p(), A)[t + 4 * o >>> 2 >>> 0], h = vr[c];
|
|
12850
|
-
if (h === void 0) throw e = `parameter ${o}`, c = lo(c), t = Be(c), xe(c), new
|
|
12852
|
+
if (h === void 0) throw e = `parameter ${o}`, c = lo(c), t = Be(c), xe(c), new dt(`${e} has unknown type ${t}`);
|
|
12851
12853
|
n[u] = h;
|
|
12852
12854
|
}
|
|
12853
12855
|
return n;
|
|
12854
|
-
},
|
|
12856
|
+
}, Mi = (e, t, n) => {
|
|
12855
12857
|
var o = [];
|
|
12856
12858
|
return e = e(o, n), o.length && ((p(), A)[t >>> 2 >>> 0] = Ie(o)), e;
|
|
12857
|
-
},
|
|
12858
|
-
var t =
|
|
12859
|
+
}, Ci = {}, Rt = (e) => {
|
|
12860
|
+
var t = Ci[e];
|
|
12859
12861
|
return t === void 0 ? Be(e) : t;
|
|
12860
12862
|
};
|
|
12861
|
-
function
|
|
12862
|
-
var [o, ...u] =
|
|
12863
|
+
function Ui(e, t, n) {
|
|
12864
|
+
var [o, ...u] = Bi(e, t >>> 0);
|
|
12863
12865
|
t = o.Sc.bind(o);
|
|
12864
12866
|
var c = u.map((E) => E.Rc.bind(E));
|
|
12865
12867
|
e--;
|
|
@@ -12880,67 +12882,67 @@ async function ts(a = {}) {
|
|
|
12880
12882
|
case 1:
|
|
12881
12883
|
h.getStringOrSymbol = Rt, b = "toValue(handle)[getStringOrSymbol(methodName)]";
|
|
12882
12884
|
}
|
|
12883
|
-
return b += `(${e})`, o.
|
|
12885
|
+
return b += `(${e})`, o.ee || (h.toReturnWire = t, h.emval_returnValue = Mi, b = `return emval_returnValue(toReturnWire, destructorsRef, ${b})`), b = `return function (handle, methodName, destructorsRef, args) {
|
|
12884
12886
|
${b}
|
|
12885
|
-
}`, n = new Function(Object.keys(h), b)(...Object.values(h)), b = `methodCaller<(${u.map((E) => E.name)}) => ${o.name}>`,
|
|
12887
|
+
}`, n = new Function(Object.keys(h), b)(...Object.values(h)), b = `methodCaller<(${u.map((E) => E.name)}) => ${o.name}>`, Oi(Object.defineProperty(n, "name", { value: b }));
|
|
12886
12888
|
}
|
|
12887
|
-
function
|
|
12889
|
+
function Di(e, t) {
|
|
12888
12890
|
return t >>>= 0, (e = ve(e >>> 0)) == ve(t);
|
|
12889
12891
|
}
|
|
12890
|
-
function
|
|
12892
|
+
function Pi(e) {
|
|
12891
12893
|
return (e >>>= 0) ? (e = Rt(e), Ie(globalThis[e])) : Ie(globalThis);
|
|
12892
12894
|
}
|
|
12893
|
-
function
|
|
12895
|
+
function _i(e) {
|
|
12894
12896
|
return e = Rt(e >>> 0), Ie(r[e]);
|
|
12895
12897
|
}
|
|
12896
|
-
function
|
|
12898
|
+
function Ri(e, t) {
|
|
12897
12899
|
return t >>>= 0, e = ve(e >>> 0), t = ve(t), Ie(e[t]);
|
|
12898
12900
|
}
|
|
12899
|
-
function
|
|
12901
|
+
function Ni(e) {
|
|
12900
12902
|
9 < (e >>>= 0) && (Xe[e + 1] += 1);
|
|
12901
12903
|
}
|
|
12902
12904
|
function Yn(e, t, n, o, u) {
|
|
12903
12905
|
return Or[e >>> 0](t >>> 0, n >>> 0, o >>> 0, u >>> 0);
|
|
12904
12906
|
}
|
|
12905
|
-
function
|
|
12907
|
+
function ki(e, t, n, o, u) {
|
|
12906
12908
|
return Yn(e >>> 0, t >>> 0, n >>> 0, o >>> 0, u >>> 0);
|
|
12907
12909
|
}
|
|
12908
|
-
function
|
|
12910
|
+
function Wi() {
|
|
12909
12911
|
return Ie([]);
|
|
12910
12912
|
}
|
|
12911
|
-
function
|
|
12913
|
+
function Fi(e) {
|
|
12912
12914
|
e = ve(e >>> 0);
|
|
12913
12915
|
for (var t = Array(e.length), n = 0; n < e.length; n++) t[n] = e[n];
|
|
12914
12916
|
return Ie(t);
|
|
12915
12917
|
}
|
|
12916
|
-
function
|
|
12918
|
+
function Gi(e) {
|
|
12917
12919
|
return Ie(Rt(e >>> 0));
|
|
12918
12920
|
}
|
|
12919
|
-
function
|
|
12921
|
+
function $i() {
|
|
12920
12922
|
return Ie({});
|
|
12921
12923
|
}
|
|
12922
|
-
function
|
|
12924
|
+
function zi(e) {
|
|
12923
12925
|
for (var t = ve(e >>>= 0); t.length; ) {
|
|
12924
12926
|
var n = t.pop();
|
|
12925
12927
|
t.pop()(n);
|
|
12926
12928
|
}
|
|
12927
12929
|
Er(e);
|
|
12928
12930
|
}
|
|
12929
|
-
function
|
|
12931
|
+
function Vi(e, t, n) {
|
|
12930
12932
|
t >>>= 0, n >>>= 0, e = ve(e >>> 0), t = ve(t), n = ve(n), e[t] = n;
|
|
12931
12933
|
}
|
|
12932
|
-
function
|
|
12933
|
-
e =
|
|
12934
|
+
function ji(e, t) {
|
|
12935
|
+
e = ce(e), t >>>= 0, e = new Date(1e3 * e), (p(), x)[t >>> 2 >>> 0] = e.getUTCSeconds(), (p(), x)[t + 4 >>> 2 >>> 0] = e.getUTCMinutes(), (p(), x)[t + 8 >>> 2 >>> 0] = e.getUTCHours(), (p(), x)[t + 12 >>> 2 >>> 0] = e.getUTCDate(), (p(), x)[t + 16 >>> 2 >>> 0] = e.getUTCMonth(), (p(), x)[t + 20 >>> 2 >>> 0] = e.getUTCFullYear() - 1900, (p(), x)[t + 24 >>> 2 >>> 0] = e.getUTCDay(), e = (e.getTime() - Date.UTC(e.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864e5 | 0, (p(), x)[t + 28 >>> 2 >>> 0] = e;
|
|
12934
12936
|
}
|
|
12935
12937
|
var qn = (e) => e % 4 == 0 && (e % 100 != 0 || e % 400 == 0), Jn = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], Xn = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
|
|
12936
|
-
function
|
|
12937
|
-
e =
|
|
12938
|
+
function Hi(e, t) {
|
|
12939
|
+
e = ce(e), t >>>= 0, e = new Date(1e3 * e), (p(), x)[t >>> 2 >>> 0] = e.getSeconds(), (p(), x)[t + 4 >>> 2 >>> 0] = e.getMinutes(), (p(), x)[t + 8 >>> 2 >>> 0] = e.getHours(), (p(), x)[t + 12 >>> 2 >>> 0] = e.getDate(), (p(), x)[t + 16 >>> 2 >>> 0] = e.getMonth(), (p(), x)[t + 20 >>> 2 >>> 0] = e.getFullYear() - 1900, (p(), x)[t + 24 >>> 2 >>> 0] = e.getDay();
|
|
12938
12940
|
var n = (qn(e.getFullYear()) ? Jn : Xn)[e.getMonth()] + e.getDate() - 1 | 0;
|
|
12939
12941
|
(p(), x)[t + 28 >>> 2 >>> 0] = n, (p(), x)[t + 36 >>> 2 >>> 0] = -60 * e.getTimezoneOffset(), n = new Date(e.getFullYear(), 6, 1).getTimezoneOffset();
|
|
12940
12942
|
var o = new Date(e.getFullYear(), 0, 1).getTimezoneOffset();
|
|
12941
12943
|
e = 0 | (n != o && e.getTimezoneOffset() == Math.min(o, n)), (p(), x)[t + 32 >>> 2 >>> 0] = e;
|
|
12942
12944
|
}
|
|
12943
|
-
function
|
|
12945
|
+
function Yi(e) {
|
|
12944
12946
|
e >>>= 0;
|
|
12945
12947
|
var t = new Date((p(), x)[e + 20 >>> 2 >>> 0] + 1900, (p(), x)[e + 16 >>> 2 >>> 0], (p(), x)[e + 12 >>> 2 >>> 0], (p(), x)[e + 8 >>> 2 >>> 0], (p(), x)[e + 4 >>> 2 >>> 0], (p(), x)[e >>> 2 >>> 0], 0), n = (p(), x)[e + 32 >>> 2 >>> 0], o = t.getTimezoneOffset(), u = new Date(t.getFullYear(), 6, 1).getTimezoneOffset(), c = new Date(t.getFullYear(), 0, 1).getTimezoneOffset(), h = Math.min(c, u);
|
|
12946
12948
|
return 0 > n ? (p(), x)[e + 32 >>> 2 >>> 0] = +(u != c && h == o) : 0 < n != (h == o) && (u = Math.max(c, u), t.setTime(t.getTime() + 6e4 * ((0 < n ? h : u) - o))), (p(), x)[e + 24 >>> 2 >>> 0] = t.getDay(), n = (qn(t.getFullYear()) ? Jn : Xn)[t.getMonth()] + t.getDate() - 1 | 0, (p(), x)[e + 28 >>> 2 >>> 0] = n, (p(), x)[e >>> 2 >>> 0] = t.getSeconds(), (p(), x)[e + 4 >>> 2 >>> 0] = t.getMinutes(), (p(), x)[e + 8 >>> 2 >>> 0] = t.getHours(), (p(), x)[e + 12 >>> 2 >>> 0] = t.getDate(), (p(), x)[e + 16 >>> 2 >>> 0] = t.getMonth(), (p(), x)[e + 20 >>> 2 >>> 0] = t.getYear(), e = t.getTime(), BigInt(isNaN(e) ? -1 : e / 1e3);
|
|
@@ -12951,16 +12953,16 @@ async function ts(a = {}) {
|
|
|
12951
12953
|
function Zn(e, t, n, o, u, c) {
|
|
12952
12954
|
if (i) return V(17, 1, e, t, n, o, u, c);
|
|
12953
12955
|
}
|
|
12954
|
-
var Tt = {},
|
|
12956
|
+
var Tt = {}, qi = () => performance.timeOrigin + performance.now();
|
|
12955
12957
|
function Kn(e, t) {
|
|
12956
12958
|
if (i) return V(18, 1, e, t);
|
|
12957
12959
|
if (Tt[e] && (clearTimeout(Tt[e].id), delete Tt[e]), !t) return 0;
|
|
12958
12960
|
var n = setTimeout(() => {
|
|
12959
12961
|
delete Tt[e], he(() => Bo(e, performance.timeOrigin + performance.now()));
|
|
12960
12962
|
}, t);
|
|
12961
|
-
return Tt[e] = { id: n,
|
|
12963
|
+
return Tt[e] = { id: n, Ae: t }, 0;
|
|
12962
12964
|
}
|
|
12963
|
-
function
|
|
12965
|
+
function Ji(e, t, n, o) {
|
|
12964
12966
|
e >>>= 0, t >>>= 0, n >>>= 0, o >>>= 0;
|
|
12965
12967
|
var u = (/* @__PURE__ */ new Date()).getFullYear(), c = new Date(u, 0, 1).getTimezoneOffset();
|
|
12966
12968
|
u = new Date(u, 6, 1).getTimezoneOffset();
|
|
@@ -12970,43 +12972,43 @@ async function ts(a = {}) {
|
|
|
12970
12972
|
return `UTC${0 <= b ? "-" : "+"}${String(Math.floor(E / 60)).padStart(2, "0")}${String(E % 60).padStart(2, "0")}`;
|
|
12971
12973
|
})(c), t = t(u), u < c ? (Pe(e, n, 17), Pe(t, o, 17)) : (Pe(e, o, 17), Pe(t, n, 17));
|
|
12972
12974
|
}
|
|
12973
|
-
var
|
|
12974
|
-
function
|
|
12975
|
+
var Xi = () => Date.now(), Qi = 1;
|
|
12976
|
+
function Zi(e, t, n) {
|
|
12975
12977
|
if (n >>>= 0, !(0 <= e && 3 >= e)) return 28;
|
|
12976
12978
|
if (e === 0) e = Date.now();
|
|
12977
12979
|
else {
|
|
12978
|
-
if (!
|
|
12980
|
+
if (!Qi) return 52;
|
|
12979
12981
|
e = performance.timeOrigin + performance.now();
|
|
12980
12982
|
}
|
|
12981
|
-
return e = Math.round(1e6 * e), (p(),
|
|
12983
|
+
return e = Math.round(1e6 * e), (p(), me)[n >>> 3 >>> 0] = BigInt(e), 0;
|
|
12982
12984
|
}
|
|
12983
12985
|
var Br = [], eo = (e, t) => {
|
|
12984
12986
|
Br.length = 0;
|
|
12985
12987
|
for (var n; n = (p(), J)[e++ >>> 0]; ) {
|
|
12986
12988
|
var o = n != 105;
|
|
12987
|
-
t += (o &= n != 112) && t % 8 ? 4 : 0, Br.push(n == 112 ? (p(), A)[t >>> 2 >>> 0] : n == 106 ? (p(),
|
|
12989
|
+
t += (o &= n != 112) && t % 8 ? 4 : 0, Br.push(n == 112 ? (p(), A)[t >>> 2 >>> 0] : n == 106 ? (p(), me)[t >>> 3 >>> 0] : n == 105 ? (p(), x)[t >>> 2 >>> 0] : (p(), ae)[t >>> 3 >>> 0]), t += o ? 8 : 4;
|
|
12988
12990
|
}
|
|
12989
12991
|
return Br;
|
|
12990
12992
|
};
|
|
12991
|
-
function
|
|
12993
|
+
function Ki(e, t, n) {
|
|
12992
12994
|
return e >>>= 0, t = eo(t >>> 0, n >>> 0), Vr[e](...t);
|
|
12993
12995
|
}
|
|
12994
|
-
function
|
|
12996
|
+
function eu(e, t, n) {
|
|
12995
12997
|
return e >>>= 0, t = eo(t >>> 0, n >>> 0), Vr[e](...t);
|
|
12996
12998
|
}
|
|
12997
|
-
var
|
|
12999
|
+
var tu = () => {
|
|
12998
13000
|
};
|
|
12999
|
-
function
|
|
13000
|
-
return
|
|
13001
|
+
function ru(e, t) {
|
|
13002
|
+
return O(ct(e >>> 0, t >>> 0));
|
|
13001
13003
|
}
|
|
13002
|
-
var
|
|
13004
|
+
var nu = () => {
|
|
13003
13005
|
throw G += 1, "unwind";
|
|
13004
13006
|
};
|
|
13005
|
-
function
|
|
13007
|
+
function ou() {
|
|
13006
13008
|
return 4294901760;
|
|
13007
13009
|
}
|
|
13008
|
-
var
|
|
13009
|
-
function
|
|
13010
|
+
var au = () => 1, su = () => navigator.hardwareConcurrency;
|
|
13011
|
+
function iu(e) {
|
|
13010
13012
|
e >>>= 0;
|
|
13011
13013
|
var t = (p(), J).length;
|
|
13012
13014
|
if (e <= t || 4294901760 < e) return false;
|
|
@@ -13034,13 +13036,13 @@ async function ts(a = {}) {
|
|
|
13034
13036
|
(p(), A)[e >>> 2 >>> 0] = t;
|
|
13035
13037
|
var n = (p(), A)[e >>> 2 >>> 0];
|
|
13036
13038
|
(p(), A)[e + 4 >>> 2 >>> 0] = (t - n) / 4294967296;
|
|
13037
|
-
}, vt = (e) => (p(), A)[e >>> 2 >>> 0] + 4294967296 * (p(), x)[e + 4 >>> 2 >>> 0],
|
|
13038
|
-
|
|
13039
|
-
}, Re = [], Nt = [],
|
|
13039
|
+
}, vt = (e) => (p(), A)[e >>> 2 >>> 0] + 4294967296 * (p(), x)[e + 4 >>> 2 >>> 0], de = [], uu = (e, t) => {
|
|
13040
|
+
de[e >>> 0] = t;
|
|
13041
|
+
}, Re = [], Nt = [], lt = (e, t) => {
|
|
13040
13042
|
Nt[e] = new Promise((n) => t.finally(() => n(e)));
|
|
13041
|
-
},
|
|
13042
|
-
if (e) return
|
|
13043
|
-
},
|
|
13043
|
+
}, L = (e) => {
|
|
13044
|
+
if (e) return de[e >>> 0];
|
|
13045
|
+
}, fu = (e, t) => {
|
|
13044
13046
|
for (e = (p(), A)[e >>> 2 >>> 0]; e; e = (p(), A)[e >>> 2 >>> 0]) t[(p(), x)[e + 4 >>> 2 >>> 0]](e);
|
|
13045
13047
|
}, kt = (e, t, n) => {
|
|
13046
13048
|
(p(), A)[e >>> 2 >>> 0] = t, (p(), A)[e + 4 >>> 2 >>> 0] = n;
|
|
@@ -13050,10 +13052,10 @@ async function ts(a = {}) {
|
|
|
13050
13052
|
}, Ne = (e) => {
|
|
13051
13053
|
var t = (p(), A)[e >>> 2 >>> 0];
|
|
13052
13054
|
return e = (p(), A)[e + 4 >>> 2 >>> 0], t ? ct(t, e) : e === 0 ? "" : void 0;
|
|
13053
|
-
},
|
|
13054
|
-
var t = Ne(e + 4), n = (n = (p(), A)[e + 12 >>> 2 >>> 0]) ?
|
|
13055
|
+
}, cu = (e) => {
|
|
13056
|
+
var t = Ne(e + 4), n = (n = (p(), A)[e + 12 >>> 2 >>> 0]) ? L(n) : "auto";
|
|
13055
13057
|
if (e += 16) {
|
|
13056
|
-
var o =
|
|
13058
|
+
var o = L((p(), A)[e + 4 >>> 2 >>> 0]), u = (p(), A)[e + 16 >>> 2 >>> 0], c = (p(), A)[e + 20 >>> 2 >>> 0];
|
|
13057
13059
|
if (u) {
|
|
13058
13060
|
for (var h = {}, b = 0; b < u; ++b) {
|
|
13059
13061
|
var E = c + 24 * b;
|
|
@@ -13068,11 +13070,11 @@ async function ts(a = {}) {
|
|
|
13068
13070
|
function n(o, u) {
|
|
13069
13071
|
o = e[o], (p(), A)[t + u >>> 2 >>> 0] = o;
|
|
13070
13072
|
}
|
|
13071
|
-
n("maxTextureDimension1D", 4), n("maxTextureDimension2D", 8), n("maxTextureDimension3D", 12), n("maxTextureArrayLayers", 16), n("maxBindGroups", 20), n("maxBindGroupsPlusVertexBuffers", 24), n("maxBindingsPerBindGroup", 28), n("maxDynamicUniformBuffersPerPipelineLayout", 32), n("maxDynamicStorageBuffersPerPipelineLayout", 36), n("maxSampledTexturesPerShaderStage", 40), n("maxSamplersPerShaderStage", 44), n("maxStorageBuffersPerShaderStage", 48), n("maxStorageTexturesPerShaderStage", 52), n("maxUniformBuffersPerShaderStage", 56), n("minUniformBufferOffsetAlignment", 80), n("minStorageBufferOffsetAlignment", 84), Mr(t + 64, e.maxUniformBufferBindingSize), Mr(t + 72, e.maxStorageBufferBindingSize), n("maxVertexBuffers", 88), Mr(t + 96, e.maxBufferSize), n("maxVertexAttributes", 104), n("maxVertexBufferArrayStride", 108), n("maxInterStageShaderVariables", 112), n("maxColorAttachments", 116), n("maxColorAttachmentBytesPerSample", 120), n("maxComputeWorkgroupStorageSize", 124), n("maxComputeInvocationsPerWorkgroup", 128), n("maxComputeWorkgroupSizeX", 132), n("maxComputeWorkgroupSizeY", 136), n("maxComputeWorkgroupSizeZ", 140), n("maxComputeWorkgroupsPerDimension", 144), e.
|
|
13072
|
-
}, du = [, "validation", "out-of-memory", "internal"],
|
|
13073
|
-
function
|
|
13074
|
-
t =
|
|
13075
|
-
var h =
|
|
13073
|
+
n("maxTextureDimension1D", 4), n("maxTextureDimension2D", 8), n("maxTextureDimension3D", 12), n("maxTextureArrayLayers", 16), n("maxBindGroups", 20), n("maxBindGroupsPlusVertexBuffers", 24), n("maxBindingsPerBindGroup", 28), n("maxDynamicUniformBuffersPerPipelineLayout", 32), n("maxDynamicStorageBuffersPerPipelineLayout", 36), n("maxSampledTexturesPerShaderStage", 40), n("maxSamplersPerShaderStage", 44), n("maxStorageBuffersPerShaderStage", 48), n("maxStorageTexturesPerShaderStage", 52), n("maxUniformBuffersPerShaderStage", 56), n("minUniformBufferOffsetAlignment", 80), n("minStorageBufferOffsetAlignment", 84), Mr(t + 64, e.maxUniformBufferBindingSize), Mr(t + 72, e.maxStorageBufferBindingSize), n("maxVertexBuffers", 88), Mr(t + 96, e.maxBufferSize), n("maxVertexAttributes", 104), n("maxVertexBufferArrayStride", 108), n("maxInterStageShaderVariables", 112), n("maxColorAttachments", 116), n("maxColorAttachmentBytesPerSample", 120), n("maxComputeWorkgroupStorageSize", 124), n("maxComputeInvocationsPerWorkgroup", 128), n("maxComputeWorkgroupSizeX", 132), n("maxComputeWorkgroupSizeY", 136), n("maxComputeWorkgroupSizeZ", 140), n("maxComputeWorkgroupsPerDimension", 144), e.ze !== void 0 && n("maxImmediateSize", 148);
|
|
13074
|
+
}, du = [, "validation", "out-of-memory", "internal"], lu = [, "compatibility", "core"], no = { 1: "core-features-and-limits", 2: "depth-clip-control", 3: "depth32float-stencil8", 4: "texture-compression-bc", 5: "texture-compression-bc-sliced-3d", 6: "texture-compression-etc2", 7: "texture-compression-astc", 8: "texture-compression-astc-sliced-3d", 9: "timestamp-query", 10: "indirect-first-instance", 11: "shader-f16", 12: "rg11b10ufloat-renderable", 13: "bgra8unorm-storage", 14: "float32-filterable", 15: "float32-blendable", 16: "clip-distances", 17: "dual-source-blending", 18: "subgroups", 19: "texture-formats-tier1", 20: "texture-formats-tier2", 21: "primitive-index", 22: "texture-component-swizzle", 327692: "chromium-experimental-unorm16-texture-formats", 327729: "chromium-experimental-multi-draw-indirect" }, pu = [, "low-power", "high-performance"], mu = [, "occlusion", "timestamp"], hu = { undefined: 1, unknown: 1, destroyed: 2 };
|
|
13075
|
+
function yu(e, t, n, o, u, c) {
|
|
13076
|
+
t = ce(t), n = ce(n), o >>>= 0, u >>>= 0, c >>>= 0;
|
|
13077
|
+
var h = L(e >>> 0);
|
|
13076
13078
|
if (e = {}, c) {
|
|
13077
13079
|
var b = (p(), A)[c + 12 >>> 2 >>> 0];
|
|
13078
13080
|
if (b) {
|
|
@@ -13085,22 +13087,22 @@ async function ts(a = {}) {
|
|
|
13085
13087
|
fe = I + fe, (fe = (p(), A)[fe >>> 2 >>> 0]) == 4294967295 || Qe && fe == 0 || (F[ye] = fe);
|
|
13086
13088
|
}, ue = function(ye, fe) {
|
|
13087
13089
|
fe = I + fe;
|
|
13088
|
-
var Qe = (p(), A)[fe >>> 2 >>> 0],
|
|
13089
|
-
Qe == 4294967295 &&
|
|
13090
|
+
var Qe = (p(), A)[fe >>> 2 >>> 0], $f = (p(), A)[fe + 4 >>> 2 >>> 0];
|
|
13091
|
+
Qe == 4294967295 && $f == 4294967295 || (F[ye] = vt(fe));
|
|
13090
13092
|
};
|
|
13091
13093
|
var j3 = B, te = ue, F = {};
|
|
13092
13094
|
B("maxTextureDimension1D", 4), B("maxTextureDimension2D", 8), B("maxTextureDimension3D", 12), B("maxTextureArrayLayers", 16), B("maxBindGroups", 20), B("maxBindGroupsPlusVertexBuffers", 24), B("maxDynamicUniformBuffersPerPipelineLayout", 32), B("maxDynamicStorageBuffersPerPipelineLayout", 36), B("maxSampledTexturesPerShaderStage", 40), B("maxSamplersPerShaderStage", 44), B("maxStorageBuffersPerShaderStage", 48), B("maxStorageTexturesPerShaderStage", 52), B("maxUniformBuffersPerShaderStage", 56), B("minUniformBufferOffsetAlignment", 80), B("minStorageBufferOffsetAlignment", 84), ue("maxUniformBufferBindingSize", 64), ue("maxStorageBufferBindingSize", 72), B("maxVertexBuffers", 88), ue("maxBufferSize", 96), B("maxVertexAttributes", 104), B("maxVertexBufferArrayStride", 108), B("maxInterStageShaderVariables", 112), B("maxColorAttachments", 116), B("maxColorAttachmentBytesPerSample", 120), B("maxComputeWorkgroupStorageSize", 124), B("maxComputeInvocationsPerWorkgroup", 128), B("maxComputeWorkgroupSizeX", 132), B("maxComputeWorkgroupSizeY", 136), B("maxComputeWorkgroupSizeZ", 140), B("maxComputeWorkgroupsPerDimension", 144), B("maxImmediateSize", 148, true), e.requiredLimits = F;
|
|
13093
13095
|
}
|
|
13094
13096
|
(b = (p(), A)[c + 24 >>> 2 >>> 0]) && (b = { label: Ne(b + 4) }, e.defaultQueue = b), e.label = Ne(c + 4);
|
|
13095
13097
|
}
|
|
13096
|
-
G += 1,
|
|
13098
|
+
G += 1, lt(t, h.requestDevice(e).then((B) => {
|
|
13097
13099
|
--G, he(() => {
|
|
13098
|
-
|
|
13100
|
+
de[u >>> 0] = B.queue, de[o >>> 0] = B, G += 1, lt(n, B.lost.then((ue) => {
|
|
13099
13101
|
he(() => {
|
|
13100
13102
|
B.onuncapturederror = () => {
|
|
13101
13103
|
};
|
|
13102
13104
|
var ye = P(), fe = Ce(ue.message);
|
|
13103
|
-
_r(n,
|
|
13105
|
+
_r(n, hu[ue.reason], fe), D(ye);
|
|
13104
13106
|
}), --G;
|
|
13105
13107
|
})), B.onuncapturederror = (ue) => {
|
|
13106
13108
|
var ye = 5;
|
|
@@ -13116,17 +13118,17 @@ async function ts(a = {}) {
|
|
|
13116
13118
|
});
|
|
13117
13119
|
}));
|
|
13118
13120
|
}
|
|
13119
|
-
function
|
|
13120
|
-
var t =
|
|
13121
|
+
function bu(e) {
|
|
13122
|
+
var t = L(e >>>= 0), n = Re[e];
|
|
13121
13123
|
if (n) {
|
|
13122
13124
|
for (var o = 0; o < n.length; ++o) n[o]();
|
|
13123
13125
|
delete Re[e];
|
|
13124
13126
|
}
|
|
13125
13127
|
t.destroy();
|
|
13126
13128
|
}
|
|
13127
|
-
function
|
|
13129
|
+
function wu(e, t, n) {
|
|
13128
13130
|
n >>>= 0;
|
|
13129
|
-
var o =
|
|
13131
|
+
var o = L(e >>>= 0);
|
|
13130
13132
|
n == 4294967295 && (n = void 0);
|
|
13131
13133
|
try {
|
|
13132
13134
|
var u = o.getMappedRange(t >>> 0, n);
|
|
@@ -13136,9 +13138,9 @@ async function ts(a = {}) {
|
|
|
13136
13138
|
var c = Gr(16, u.byteLength);
|
|
13137
13139
|
return (p(), J).set(new Uint8Array(u), c >>> 0), Re[e].push(() => xe(c)), c;
|
|
13138
13140
|
}
|
|
13139
|
-
function
|
|
13141
|
+
function gu(e, t, n) {
|
|
13140
13142
|
n >>>= 0;
|
|
13141
|
-
var o =
|
|
13143
|
+
var o = L(e >>>= 0);
|
|
13142
13144
|
n == 4294967295 && (n = void 0);
|
|
13143
13145
|
try {
|
|
13144
13146
|
var u = o.getMappedRange(t >>> 0, n);
|
|
@@ -13150,10 +13152,10 @@ async function ts(a = {}) {
|
|
|
13150
13152
|
new Uint8Array(u).set((p(), J).subarray(c >>> 0, c + u.byteLength >>> 0)), xe(c);
|
|
13151
13153
|
}), c;
|
|
13152
13154
|
}
|
|
13153
|
-
function
|
|
13154
|
-
e >>>= 0, t =
|
|
13155
|
-
var c =
|
|
13156
|
-
Re[e] = [], u == 4294967295 && (u = void 0), G += 1,
|
|
13155
|
+
function Tu(e, t, n, o, u) {
|
|
13156
|
+
e >>>= 0, t = ce(t), n = ce(n), u >>>= 0;
|
|
13157
|
+
var c = L(e);
|
|
13158
|
+
Re[e] = [], u == 4294967295 && (u = void 0), G += 1, lt(t, c.mapAsync(n, o >>> 0, u).then(() => {
|
|
13157
13159
|
--G, he(() => {
|
|
13158
13160
|
Rr(t, 1, 0);
|
|
13159
13161
|
});
|
|
@@ -13165,31 +13167,31 @@ async function ts(a = {}) {
|
|
|
13165
13167
|
});
|
|
13166
13168
|
}));
|
|
13167
13169
|
}
|
|
13168
|
-
function
|
|
13169
|
-
var t =
|
|
13170
|
+
function vu(e) {
|
|
13171
|
+
var t = L(e >>>= 0), n = Re[e];
|
|
13170
13172
|
if (n) {
|
|
13171
13173
|
for (var o = 0; o < n.length; ++o) n[o]();
|
|
13172
13174
|
delete Re[e], t.unmap();
|
|
13173
13175
|
}
|
|
13174
13176
|
}
|
|
13175
|
-
function
|
|
13176
|
-
delete
|
|
13177
|
+
function Eu(e) {
|
|
13178
|
+
delete de[e >>> 0];
|
|
13177
13179
|
}
|
|
13178
|
-
function
|
|
13180
|
+
function Su(e, t, n) {
|
|
13179
13181
|
e >>>= 0, t >>>= 0, n >>>= 0;
|
|
13180
13182
|
var o = !!(p(), A)[t + 32 >>> 2 >>> 0];
|
|
13181
|
-
t = { label: Ne(t + 4), usage: (p(), A)[t + 16 >>> 2 >>> 0], size: vt(t + 24), mappedAtCreation: o }, e =
|
|
13183
|
+
t = { label: Ne(t + 4), usage: (p(), A)[t + 16 >>> 2 >>> 0], size: vt(t + 24), mappedAtCreation: o }, e = L(e);
|
|
13182
13184
|
try {
|
|
13183
13185
|
var u = e.createBuffer(t);
|
|
13184
13186
|
} catch {
|
|
13185
13187
|
return false;
|
|
13186
13188
|
}
|
|
13187
|
-
return
|
|
13189
|
+
return de[n >>> 0] = u, o && (Re[n] = []), true;
|
|
13188
13190
|
}
|
|
13189
|
-
function
|
|
13190
|
-
e >>>= 0, t =
|
|
13191
|
+
function Au(e, t, n, o) {
|
|
13192
|
+
e >>>= 0, t = ce(t), o >>>= 0, n = cu(n >>> 0), e = L(e), G += 1, lt(t, e.createComputePipelineAsync(n).then((u) => {
|
|
13191
13193
|
--G, he(() => {
|
|
13192
|
-
|
|
13194
|
+
de[o >>> 0] = u, Pr(t, 1, o, 0);
|
|
13193
13195
|
});
|
|
13194
13196
|
}, (u) => {
|
|
13195
13197
|
--G, he(() => {
|
|
@@ -13198,16 +13200,16 @@ async function ts(a = {}) {
|
|
|
13198
13200
|
});
|
|
13199
13201
|
}));
|
|
13200
13202
|
}
|
|
13201
|
-
function
|
|
13203
|
+
function Iu(e, t, n) {
|
|
13202
13204
|
e >>>= 0, t >>>= 0, n >>>= 0;
|
|
13203
13205
|
var o = (p(), A)[t >>> 2 >>> 0], u = (p(), x)[o + 4 >>> 2 >>> 0];
|
|
13204
|
-
t = { label: Ne(t + 4), code: "" }, u === 2 && (t.code = to(o + 8)), e =
|
|
13206
|
+
t = { label: Ne(t + 4), code: "" }, u === 2 && (t.code = to(o + 8)), e = L(e).createShaderModule(t), de[n >>> 0] = e;
|
|
13205
13207
|
}
|
|
13206
|
-
var
|
|
13207
|
-
(e =
|
|
13208
|
+
var xu = (e) => {
|
|
13209
|
+
(e = L(e)).onuncapturederror = null, e.destroy();
|
|
13208
13210
|
};
|
|
13209
|
-
function
|
|
13210
|
-
t =
|
|
13211
|
+
function Lu(e, t) {
|
|
13212
|
+
t = ce(t), e = L(e >>> 0), G += 1, lt(t, e.popErrorScope().then((n) => {
|
|
13211
13213
|
--G, he(() => {
|
|
13212
13214
|
var o = 5;
|
|
13213
13215
|
n ? n instanceof GPUValidationError ? o = 2 : n instanceof GPUOutOfMemoryError ? o = 3 : n instanceof GPUInternalError && (o = 4) : o = 1;
|
|
@@ -13221,14 +13223,14 @@ async function ts(a = {}) {
|
|
|
13221
13223
|
});
|
|
13222
13224
|
}));
|
|
13223
13225
|
}
|
|
13224
|
-
function
|
|
13225
|
-
if (t =
|
|
13226
|
-
var u = { featureLevel:
|
|
13227
|
-
(e = (p(), A)[n >>> 2 >>> 0]) !== 0 && (p(), u.
|
|
13226
|
+
function Ou(e, t, n, o) {
|
|
13227
|
+
if (t = ce(t), o >>>= 0, n >>>= 0) {
|
|
13228
|
+
var u = { featureLevel: lu[(p(), x)[n + 4 >>> 2 >>> 0]], powerPreference: pu[(p(), x)[n + 8 >>> 2 >>> 0]], forceFallbackAdapter: !!(p(), A)[n + 12 >>> 2 >>> 0] };
|
|
13229
|
+
(e = (p(), A)[n >>> 2 >>> 0]) !== 0 && (p(), u.De = !!(p(), A)[e + 8 >>> 2 >>> 0]);
|
|
13228
13230
|
}
|
|
13229
|
-
"gpu" in navigator ? (G += 1,
|
|
13231
|
+
"gpu" in navigator ? (G += 1, lt(t, navigator.gpu.requestAdapter(u).then((c) => {
|
|
13230
13232
|
--G, he(() => {
|
|
13231
|
-
if (c)
|
|
13233
|
+
if (c) de[o >>> 0] = c, Et(t, 1, o, 0);
|
|
13232
13234
|
else {
|
|
13233
13235
|
var h = P(), b = Ce("WebGPU not available on this browser (requestAdapter returned null)");
|
|
13234
13236
|
Et(t, 3, o, b), D(h);
|
|
@@ -13241,7 +13243,7 @@ async function ts(a = {}) {
|
|
|
13241
13243
|
});
|
|
13242
13244
|
}))) : (u = P(), e = Ce("WebGPU not available on this browser (navigator.gpu is not available)"), Et(t, 3, o, e), D(u));
|
|
13243
13245
|
}
|
|
13244
|
-
function
|
|
13246
|
+
function Bu(e, t, n) {
|
|
13245
13247
|
return e >>>= 0, t >>>= 0, n >>>= 0, Hn(async () => {
|
|
13246
13248
|
var o = [];
|
|
13247
13249
|
if (n) {
|
|
@@ -13292,7 +13294,7 @@ async function ts(a = {}) {
|
|
|
13292
13294
|
function fo(e, t, n, o) {
|
|
13293
13295
|
return i ? V(23, 1, e, t, n, o) : 70;
|
|
13294
13296
|
}
|
|
13295
|
-
var
|
|
13297
|
+
var Mu = [null, [], []];
|
|
13296
13298
|
function co(e, t, n, o) {
|
|
13297
13299
|
if (i) return V(24, 1, e, t, n, o);
|
|
13298
13300
|
t >>>= 0, n >>>= 0, o >>>= 0;
|
|
@@ -13300,115 +13302,118 @@ async function ts(a = {}) {
|
|
|
13300
13302
|
var h = (p(), A)[t >>> 2 >>> 0], b = (p(), A)[t + 4 >>> 2 >>> 0];
|
|
13301
13303
|
t += 8;
|
|
13302
13304
|
for (var E = 0; E < b; E++) {
|
|
13303
|
-
var I = e, F = (p(), J)[h + E >>> 0], j3 =
|
|
13304
|
-
F === 0 || F === 10 ? ((I === 1 ? Y :
|
|
13305
|
+
var I = e, F = (p(), J)[h + E >>> 0], j3 = Mu[I];
|
|
13306
|
+
F === 0 || F === 10 ? ((I === 1 ? Y : O)(xn(j3)), j3.length = 0) : j3.push(F);
|
|
13305
13307
|
}
|
|
13306
13308
|
u += b;
|
|
13307
13309
|
}
|
|
13308
13310
|
return (p(), A)[o >>> 2 >>> 0] = u, 0;
|
|
13309
13311
|
}
|
|
13310
|
-
function
|
|
13312
|
+
function Cu(e) {
|
|
13311
13313
|
return e >>> 0;
|
|
13312
13314
|
}
|
|
13315
|
+
function Uu(e, t) {
|
|
13316
|
+
return ro(L(e >>> 0).limits, t >>> 0), 1;
|
|
13317
|
+
}
|
|
13313
13318
|
function Du(e, t) {
|
|
13314
|
-
return
|
|
13319
|
+
return L(e >>> 0).features.has(no[t]);
|
|
13315
13320
|
}
|
|
13316
|
-
function Pu(e
|
|
13317
|
-
return
|
|
13321
|
+
function Pu(e) {
|
|
13322
|
+
return BigInt(L(e >>> 0).size);
|
|
13318
13323
|
}
|
|
13319
13324
|
function _u(e) {
|
|
13320
|
-
return BigInt(
|
|
13321
|
-
}
|
|
13322
|
-
function Ru(e) {
|
|
13323
|
-
return BigInt(O(e >>> 0).usage);
|
|
13325
|
+
return BigInt(L(e >>> 0).usage);
|
|
13324
13326
|
}
|
|
13325
|
-
function
|
|
13327
|
+
function Ru(e, t) {
|
|
13326
13328
|
if (e >>>= 0, t >>>= 0) {
|
|
13327
13329
|
var n = Ne(t + 4);
|
|
13328
|
-
n = { label: n, timestampWrites: t = (t = (p(), A)[t + 12 >>> 2 >>> 0]) !== 0 ? { querySet:
|
|
13330
|
+
n = { label: n, timestampWrites: t = (t = (p(), A)[t + 12 >>> 2 >>> 0]) !== 0 ? { querySet: L((p(), A)[t + 4 >>> 2 >>> 0]), beginningOfPassWriteIndex: (p(), A)[t + 8 >>> 2 >>> 0], endOfPassWriteIndex: (p(), A)[t + 12 >>> 2 >>> 0] } : void 0 };
|
|
13329
13331
|
}
|
|
13330
|
-
return t =
|
|
13332
|
+
return t = L(e), e = To(0), n = t.beginComputePass(n), de[e >>> 0] = n, e;
|
|
13333
|
+
}
|
|
13334
|
+
function Nu(e, t, n, o) {
|
|
13335
|
+
n = ce(n), (o = ce(o)) == -1 && (o = void 0), (e = L(e >>> 0)).clearBuffer(L(t >>> 0), n, o);
|
|
13331
13336
|
}
|
|
13332
13337
|
function ku(e, t, n, o, u, c) {
|
|
13333
|
-
n =
|
|
13338
|
+
n = ce(n), u = ce(u), c = ce(c), L(e >>> 0).copyBufferToBuffer(L(t >>> 0), n, L(o >>> 0), u, c);
|
|
13334
13339
|
}
|
|
13335
13340
|
function Wu(e) {
|
|
13336
|
-
var t =
|
|
13337
|
-
return e = wo(0), t = t.finish(),
|
|
13341
|
+
var t = L(e >>> 0);
|
|
13342
|
+
return e = wo(0), t = t.finish(), de[e >>> 0] = t, e;
|
|
13338
13343
|
}
|
|
13339
13344
|
function Fu(e, t, n, o, u, c) {
|
|
13340
|
-
c =
|
|
13345
|
+
c = ce(c), L(e >>> 0).resolveQuerySet(L(t >>> 0), n, o, L(u >>> 0), c);
|
|
13341
13346
|
}
|
|
13342
13347
|
function Gu(e, t, n, o) {
|
|
13343
|
-
|
|
13348
|
+
L(e >>> 0).dispatchWorkgroups(t, n, o);
|
|
13344
13349
|
}
|
|
13345
13350
|
function $u(e, t, n) {
|
|
13346
|
-
n =
|
|
13351
|
+
n = ce(n), L(e >>> 0).dispatchWorkgroupsIndirect(L(t >>> 0), n);
|
|
13347
13352
|
}
|
|
13348
13353
|
function zu(e) {
|
|
13349
|
-
|
|
13354
|
+
L(e >>> 0).end();
|
|
13350
13355
|
}
|
|
13351
13356
|
function Vu(e, t, n, o, u) {
|
|
13352
|
-
o >>>= 0, u >>>= 0, e =
|
|
13357
|
+
o >>>= 0, u >>>= 0, e = L(e >>> 0), n = L(n >>> 0), o == 0 ? e.setBindGroup(t, n) : e.setBindGroup(t, n, (p(), A), u >>> 2, o);
|
|
13353
13358
|
}
|
|
13354
13359
|
function ju(e, t) {
|
|
13355
|
-
|
|
13360
|
+
L(e >>> 0).setPipeline(L(t >>> 0));
|
|
13356
13361
|
}
|
|
13357
13362
|
function Hu(e, t, n) {
|
|
13358
|
-
|
|
13363
|
+
L(e >>> 0).Ce(L(t >>> 0), n);
|
|
13359
13364
|
}
|
|
13360
13365
|
function Yu(e, t) {
|
|
13361
|
-
var n =
|
|
13362
|
-
return e = bo(0), t = n.getBindGroupLayout(t),
|
|
13366
|
+
var n = L(e >>> 0);
|
|
13367
|
+
return e = bo(0), t = n.getBindGroupLayout(t), de[e >>> 0] = t, e;
|
|
13363
13368
|
}
|
|
13364
13369
|
function qu(e, t) {
|
|
13365
13370
|
function n(u) {
|
|
13366
13371
|
var c = (p(), A)[u + 8 >>> 2 >>> 0], h = (p(), A)[u + 32 >>> 2 >>> 0], b = (p(), A)[u + 36 >>> 2 >>> 0], E = 0;
|
|
13367
|
-
return
|
|
13372
|
+
return fu(u, { 327681: (I) => {
|
|
13368
13373
|
E = (p(), A)[I + 8 >>> 2 >>> 0];
|
|
13369
|
-
} }), c ? ((h = vt(u + 24)) == -1 && (h = void 0), c = { buffer:
|
|
13374
|
+
} }), c ? ((h = vt(u + 24)) == -1 && (h = void 0), c = { buffer: L(c), offset: vt(u + 16), size: h }) : c = L(h || b || E), { binding: (p(), A)[u + 4 >>> 2 >>> 0], resource: c };
|
|
13370
13375
|
}
|
|
13371
|
-
e >>>= 0, t = { label: Ne(4 + (t >>>= 0)), layout:
|
|
13376
|
+
e >>>= 0, t = { label: Ne(4 + (t >>>= 0)), layout: L((p(), A)[t + 12 >>> 2 >>> 0]), entries: (function(u, c) {
|
|
13372
13377
|
for (var h = [], b = 0; b < u; ++b) h.push(n(c + 40 * b));
|
|
13373
13378
|
return h;
|
|
13374
|
-
})((p(), A)[t + 16 >>> 2 >>> 0], (p(), A)[t + 20 >>> 2 >>> 0]) }, e =
|
|
13379
|
+
})((p(), A)[t + 16 >>> 2 >>> 0], (p(), A)[t + 20 >>> 2 >>> 0]) }, e = L(e);
|
|
13375
13380
|
var o = yo(0);
|
|
13376
|
-
return
|
|
13381
|
+
return uu(o, e.createBindGroup(t)), o;
|
|
13377
13382
|
}
|
|
13378
13383
|
function Ju(e, t) {
|
|
13379
13384
|
var n;
|
|
13380
|
-
return e >>>= 0, (t >>>= 0) && (n = { label: Ne(t + 4) }), t =
|
|
13385
|
+
return e >>>= 0, (t >>>= 0) && (n = { label: Ne(t + 4) }), t = L(e), e = go(0), n = t.createCommandEncoder(n), de[e >>> 0] = n, e;
|
|
13381
13386
|
}
|
|
13382
13387
|
function Xu(e, t) {
|
|
13383
|
-
e >>>= 0, t >>>= 0, t = { type:
|
|
13384
|
-
var n =
|
|
13385
|
-
return e = vo(0), t = n.createQuerySet(t),
|
|
13388
|
+
e >>>= 0, t >>>= 0, t = { type: mu[(p(), x)[t + 12 >>> 2 >>> 0]], count: (p(), A)[t + 16 >>> 2 >>> 0] };
|
|
13389
|
+
var n = L(e);
|
|
13390
|
+
return e = vo(0), t = n.createQuerySet(t), de[e >>> 0] = t, e;
|
|
13386
13391
|
}
|
|
13387
13392
|
function Qu(e, t) {
|
|
13388
|
-
e =
|
|
13393
|
+
e = L(e >>> 0).adapterInfo, t >>>= 0, (p(), A)[t + 52 >>> 2 >>> 0] = e.subgroupMinSize, (p(), A)[t + 56 >>> 2 >>> 0] = e.subgroupMaxSize;
|
|
13389
13394
|
var n = e.vendor + e.architecture + e.device + e.description, o = _e(n) + 1, u = pt(o);
|
|
13390
13395
|
return u && Pe(n, u, o), n = u, o = _e(e.vendor), kt(t + 4, n, o), n += o, o = _e(e.architecture), kt(t + 12, n, o), n += o, o = _e(e.device), kt(t + 20, n, o), kt(t + 28, n + o, _e(e.description)), (p(), x)[t + 36 >>> 2 >>> 0] = 2, e = e.isFallbackAdapter ? 3 : 4, (p(), x)[t + 40 >>> 2 >>> 0] = e, (p(), A)[t + 44 >>> 2 >>> 0] = 0, (p(), A)[t + 48 >>> 2 >>> 0] = 0, 1;
|
|
13391
13396
|
}
|
|
13392
13397
|
var Zu = { "core-features-and-limits": 1, "depth-clip-control": 2, "depth32float-stencil8": 3, "texture-compression-bc": 4, "texture-compression-bc-sliced-3d": 5, "texture-compression-etc2": 6, "texture-compression-astc": 7, "texture-compression-astc-sliced-3d": 8, "timestamp-query": 9, "indirect-first-instance": 10, "shader-f16": 11, "rg11b10ufloat-renderable": 12, "bgra8unorm-storage": 13, "float32-filterable": 14, "float32-blendable": 15, "clip-distances": 16, "dual-source-blending": 17, subgroups: 18, "texture-formats-tier1": 19, "texture-formats-tier2": 20, "primitive-index": 21, "texture-component-swizzle": 22, "chromium-experimental-unorm16-texture-formats": 327692, "chromium-experimental-multi-draw-indirect": 327729 };
|
|
13393
13398
|
function Ku(e, t) {
|
|
13394
13399
|
t >>>= 0;
|
|
13395
|
-
var n =
|
|
13400
|
+
var n = L(e >>> 0);
|
|
13396
13401
|
e = pt(4 * n.features.size);
|
|
13397
13402
|
var o = 0, u = 0;
|
|
13398
13403
|
for (let c of n.features) 0 <= (n = Zu[c]) && ((p(), x)[e + o >>> 2 >>> 0] = n, o += 4, u++);
|
|
13399
13404
|
(p(), A)[t + 4 >>> 2 >>> 0] = e, (p(), A)[t >>> 2 >>> 0] = u;
|
|
13400
13405
|
}
|
|
13401
13406
|
function ef(e, t) {
|
|
13402
|
-
return ro(
|
|
13407
|
+
return ro(L(e >>> 0).limits, t >>> 0), 1;
|
|
13403
13408
|
}
|
|
13404
13409
|
function tf(e, t) {
|
|
13405
|
-
|
|
13410
|
+
L(e >>> 0).pushErrorScope(du[t]);
|
|
13406
13411
|
}
|
|
13407
13412
|
function rf(e, t, n) {
|
|
13408
|
-
t >>>= 0, n >>>= 0, e =
|
|
13413
|
+
t >>>= 0, n >>>= 0, e = L(e >>> 0), t = Array.from((p(), x).subarray(n >>> 2 >>> 0, n + 4 * t >>> 2 >>> 0), (o) => L(o)), e.submit(t);
|
|
13409
13414
|
}
|
|
13410
13415
|
function nf(e, t, n, o, u) {
|
|
13411
|
-
n =
|
|
13416
|
+
n = ce(n), o >>>= 0, u >>>= 0, e = L(e >>> 0), t = L(t >>> 0), o = (p(), J).subarray(o >>> 0, o + u >>> 0), e.writeBuffer(t, n, o, 0, u);
|
|
13412
13417
|
}
|
|
13413
13418
|
i || (function() {
|
|
13414
13419
|
for (var e = r.numThreads - 1; e--; ) gn();
|
|
@@ -13431,7 +13436,7 @@ async function ts(a = {}) {
|
|
|
13431
13436
|
(p(), x)[e >>> 2 >>> 0] = t;
|
|
13432
13437
|
break;
|
|
13433
13438
|
case "i64":
|
|
13434
|
-
(p(),
|
|
13439
|
+
(p(), me)[e >>> 3 >>> 0] = BigInt(t);
|
|
13435
13440
|
break;
|
|
13436
13441
|
case "float":
|
|
13437
13442
|
(p(), _)[e >>> 2 >>> 0] = t;
|
|
@@ -13455,7 +13460,7 @@ async function ts(a = {}) {
|
|
|
13455
13460
|
case "i32":
|
|
13456
13461
|
return (p(), x)[e >>> 2 >>> 0];
|
|
13457
13462
|
case "i64":
|
|
13458
|
-
return (p(),
|
|
13463
|
+
return (p(), me)[e >>> 3 >>> 0];
|
|
13459
13464
|
case "float":
|
|
13460
13465
|
return (p(), _)[e >>> 2 >>> 0];
|
|
13461
13466
|
case "double":
|
|
@@ -13466,7 +13471,7 @@ async function ts(a = {}) {
|
|
|
13466
13471
|
Te(`invalid type for getValue: ${t}`);
|
|
13467
13472
|
}
|
|
13468
13473
|
}, r.UTF8ToString = ct, r.stringToUTF8 = Pe, r.lengthBytesUTF8 = _e;
|
|
13469
|
-
var lo, po, Dr, Wt, xe, pt, mo, ho, yo, bo, wo, go, To, vo, Eo, So, Ao, Pr, _r, Rr, Nr, Et, kr, Io, Wr, xo, Lo, Oo, Fr, Bo, Mo, Gr, N, St, Co, D, Ft, P, Uo, $r, Do, Po, _o, zr, Ro, No, ko, Wo, Fo, Go, $o, zo, Vo, jo, Ho, Yo, qo, Jo, Xo, Qo, Zo, Ko, ea, ta, ra, na, oa, aa, sa, ia, ua, fa, ca,
|
|
13474
|
+
var lo, po, Dr, Wt, xe, pt, mo, ho, yo, bo, wo, go, To, vo, Eo, So, Ao, Pr, _r, Rr, Nr, Et, kr, Io, Wr, xo, Lo, Oo, Fr, Bo, Mo, Gr, N, St, Co, D, Ft, P, Uo, $r, Do, Po, _o, zr, Ro, No, ko, Wo, Fo, Go, $o, zo, Vo, jo, Ho, Yo, qo, Jo, Xo, Qo, Zo, Ko, ea, ta, ra, na, oa, aa, sa, ia, ua, fa, ca, da, la, pa, ma, ha, ya, ba, wa, ga, ke, of = [qe, yr, En, Ln, On, Bn, Mn, Cn, Un, Dn, Pn, _n, Rn, Nn, kn, Wn, Qn, Zn, Kn, ao, so, io, uo, fo, co], Vr = { 969132: (e, t, n, o, u) => {
|
|
13470
13475
|
if (r === void 0 || !r.Uc) return 1;
|
|
13471
13476
|
if ((e = ct(Number(e >>> 0))).startsWith("./") && (e = e.substring(2)), !(e = r.Uc.get(e))) return 2;
|
|
13472
13477
|
if (t = Number(t >>> 0), n = Number(n >>> 0), o = Number(o >>> 0), t + n > e.byteLength) return 3;
|
|
@@ -13477,7 +13482,7 @@ async function ts(a = {}) {
|
|
|
13477
13482
|
(p(), J).set(c, o >>> 0);
|
|
13478
13483
|
break;
|
|
13479
13484
|
case 1:
|
|
13480
|
-
r.ad ? r.ad(o, c) : r.
|
|
13485
|
+
r.ad ? r.ad(o, c) : r.ne(o, c);
|
|
13481
13486
|
break;
|
|
13482
13487
|
default:
|
|
13483
13488
|
return 4;
|
|
@@ -13486,11 +13491,11 @@ async function ts(a = {}) {
|
|
|
13486
13491
|
} catch {
|
|
13487
13492
|
return 4;
|
|
13488
13493
|
}
|
|
13489
|
-
},
|
|
13494
|
+
}, 969956: (e, t, n) => {
|
|
13490
13495
|
r.Sd(e, (p(), J).subarray(t >>> 0, t + n >>> 0));
|
|
13491
|
-
},
|
|
13496
|
+
}, 970020: () => r.le(), 970062: (e) => {
|
|
13492
13497
|
r.jd(e);
|
|
13493
|
-
},
|
|
13498
|
+
}, 970099: () => typeof wasmOffsetConverter < "u" };
|
|
13494
13499
|
function af(e, t, n, o) {
|
|
13495
13500
|
var u = P();
|
|
13496
13501
|
try {
|
|
@@ -13536,7 +13541,7 @@ async function ts(a = {}) {
|
|
|
13536
13541
|
N(1, 0);
|
|
13537
13542
|
}
|
|
13538
13543
|
}
|
|
13539
|
-
function
|
|
13544
|
+
function df(e, t) {
|
|
13540
13545
|
var n = P();
|
|
13541
13546
|
try {
|
|
13542
13547
|
Vo(e, t);
|
|
@@ -13545,7 +13550,7 @@ async function ts(a = {}) {
|
|
|
13545
13550
|
N(1, 0);
|
|
13546
13551
|
}
|
|
13547
13552
|
}
|
|
13548
|
-
function
|
|
13553
|
+
function lf(e, t, n, o, u, c, h) {
|
|
13549
13554
|
var b = P();
|
|
13550
13555
|
try {
|
|
13551
13556
|
return Wo(e, t, n, o, u, c, h);
|
|
@@ -13656,22 +13661,13 @@ async function ts(a = {}) {
|
|
|
13656
13661
|
function Af(e, t) {
|
|
13657
13662
|
var n = P();
|
|
13658
13663
|
try {
|
|
13659
|
-
return
|
|
13664
|
+
return ha(e, t);
|
|
13660
13665
|
} catch (o) {
|
|
13661
13666
|
if (D(n), o !== o + 0) throw o;
|
|
13662
13667
|
return N(1, 0), 0n;
|
|
13663
13668
|
}
|
|
13664
13669
|
}
|
|
13665
|
-
function If2(e
|
|
13666
|
-
var c = P();
|
|
13667
|
-
try {
|
|
13668
|
-
aa(e, t, n, o, u);
|
|
13669
|
-
} catch (h) {
|
|
13670
|
-
if (D(c), h !== h + 0) throw h;
|
|
13671
|
-
N(1, 0);
|
|
13672
|
-
}
|
|
13673
|
-
}
|
|
13674
|
-
function xf(e) {
|
|
13670
|
+
function If2(e) {
|
|
13675
13671
|
var t = P();
|
|
13676
13672
|
try {
|
|
13677
13673
|
return Jo(e);
|
|
@@ -13680,34 +13676,52 @@ async function ts(a = {}) {
|
|
|
13680
13676
|
return N(1, 0), 0n;
|
|
13681
13677
|
}
|
|
13682
13678
|
}
|
|
13683
|
-
function
|
|
13679
|
+
function xf(e, t, n, o) {
|
|
13680
|
+
var u = P();
|
|
13681
|
+
try {
|
|
13682
|
+
return aa(e, t, n, o);
|
|
13683
|
+
} catch (c) {
|
|
13684
|
+
if (D(u), c !== c + 0) throw c;
|
|
13685
|
+
N(1, 0);
|
|
13686
|
+
}
|
|
13687
|
+
}
|
|
13688
|
+
function Lf(e, t, n, o, u) {
|
|
13689
|
+
var c = P();
|
|
13690
|
+
try {
|
|
13691
|
+
return sa(e, t, n, o, u);
|
|
13692
|
+
} catch (h) {
|
|
13693
|
+
if (D(c), h !== h + 0) throw h;
|
|
13694
|
+
N(1, 0);
|
|
13695
|
+
}
|
|
13696
|
+
}
|
|
13697
|
+
function Of(e, t, n, o, u, c) {
|
|
13684
13698
|
var h = P();
|
|
13685
13699
|
try {
|
|
13686
|
-
return
|
|
13700
|
+
return ia(e, t, n, o, u, c);
|
|
13687
13701
|
} catch (b) {
|
|
13688
13702
|
if (D(h), b !== b + 0) throw b;
|
|
13689
13703
|
N(1, 0);
|
|
13690
13704
|
}
|
|
13691
13705
|
}
|
|
13692
|
-
function
|
|
13706
|
+
function Bf(e, t, n, o, u, c) {
|
|
13693
13707
|
var h = P();
|
|
13694
13708
|
try {
|
|
13695
|
-
return
|
|
13709
|
+
return ea(e, t, n, o, u, c);
|
|
13696
13710
|
} catch (b) {
|
|
13697
13711
|
if (D(h), b !== b + 0) throw b;
|
|
13698
13712
|
N(1, 0);
|
|
13699
13713
|
}
|
|
13700
13714
|
}
|
|
13701
|
-
function
|
|
13715
|
+
function Mf(e, t, n, o, u, c) {
|
|
13702
13716
|
var h = P();
|
|
13703
13717
|
try {
|
|
13704
|
-
return
|
|
13718
|
+
return ua(e, t, n, o, u, c);
|
|
13705
13719
|
} catch (b) {
|
|
13706
13720
|
if (D(h), b !== b + 0) throw b;
|
|
13707
13721
|
N(1, 0);
|
|
13708
13722
|
}
|
|
13709
13723
|
}
|
|
13710
|
-
function
|
|
13724
|
+
function Cf(e, t, n, o, u, c, h, b) {
|
|
13711
13725
|
var E = P();
|
|
13712
13726
|
try {
|
|
13713
13727
|
return ta(e, t, n, o, u, c, h, b);
|
|
@@ -13716,34 +13730,34 @@ async function ts(a = {}) {
|
|
|
13716
13730
|
N(1, 0);
|
|
13717
13731
|
}
|
|
13718
13732
|
}
|
|
13719
|
-
function
|
|
13733
|
+
function Uf(e, t, n, o, u) {
|
|
13720
13734
|
var c = P();
|
|
13721
13735
|
try {
|
|
13722
|
-
return
|
|
13736
|
+
return fa(e, t, n, o, u);
|
|
13723
13737
|
} catch (h) {
|
|
13724
13738
|
if (D(c), h !== h + 0) throw h;
|
|
13725
13739
|
return N(1, 0), 0n;
|
|
13726
13740
|
}
|
|
13727
13741
|
}
|
|
13728
|
-
function
|
|
13742
|
+
function Df(e, t, n, o) {
|
|
13729
13743
|
var u = P();
|
|
13730
13744
|
try {
|
|
13731
|
-
return
|
|
13745
|
+
return ca(e, t, n, o);
|
|
13732
13746
|
} catch (c) {
|
|
13733
13747
|
if (D(u), c !== c + 0) throw c;
|
|
13734
13748
|
N(1, 0);
|
|
13735
13749
|
}
|
|
13736
13750
|
}
|
|
13737
|
-
function
|
|
13751
|
+
function Pf(e, t, n, o) {
|
|
13738
13752
|
var u = P();
|
|
13739
13753
|
try {
|
|
13740
|
-
return
|
|
13754
|
+
return da(e, t, n, o);
|
|
13741
13755
|
} catch (c) {
|
|
13742
13756
|
if (D(u), c !== c + 0) throw c;
|
|
13743
13757
|
N(1, 0);
|
|
13744
13758
|
}
|
|
13745
13759
|
}
|
|
13746
|
-
function
|
|
13760
|
+
function _f(e, t, n, o, u, c, h, b, E, I, F, j3) {
|
|
13747
13761
|
var te = P();
|
|
13748
13762
|
try {
|
|
13749
13763
|
return la(e, t, n, o, u, c, h, b, E, I, F, j3);
|
|
@@ -13752,43 +13766,25 @@ async function ts(a = {}) {
|
|
|
13752
13766
|
N(1, 0);
|
|
13753
13767
|
}
|
|
13754
13768
|
}
|
|
13755
|
-
function
|
|
13769
|
+
function Rf(e, t, n, o, u, c, h, b, E, I, F) {
|
|
13756
13770
|
var j3 = P();
|
|
13757
13771
|
try {
|
|
13758
|
-
|
|
13772
|
+
pa(e, t, n, o, u, c, h, b, E, I, F);
|
|
13759
13773
|
} catch (te) {
|
|
13760
13774
|
if (D(j3), te !== te + 0) throw te;
|
|
13761
13775
|
N(1, 0);
|
|
13762
13776
|
}
|
|
13763
13777
|
}
|
|
13764
|
-
function
|
|
13778
|
+
function Nf(e, t, n, o, u, c, h, b, E, I, F, j3, te, B, ue, ye) {
|
|
13765
13779
|
var fe = P();
|
|
13766
13780
|
try {
|
|
13767
|
-
|
|
13781
|
+
ma(e, t, n, o, u, c, h, b, E, I, F, j3, te, B, ue, ye);
|
|
13768
13782
|
} catch (Qe) {
|
|
13769
13783
|
if (D(fe), Qe !== Qe + 0) throw Qe;
|
|
13770
13784
|
N(1, 0);
|
|
13771
13785
|
}
|
|
13772
13786
|
}
|
|
13773
|
-
function
|
|
13774
|
-
var u = P();
|
|
13775
|
-
try {
|
|
13776
|
-
return ma(e, t, n, o);
|
|
13777
|
-
} catch (c) {
|
|
13778
|
-
if (D(u), c !== c + 0) throw c;
|
|
13779
|
-
N(1, 0);
|
|
13780
|
-
}
|
|
13781
|
-
}
|
|
13782
|
-
function kf(e, t, n, o, u) {
|
|
13783
|
-
var c = P();
|
|
13784
|
-
try {
|
|
13785
|
-
return ha(e, t, n, o, u);
|
|
13786
|
-
} catch (h) {
|
|
13787
|
-
if (D(c), h !== h + 0) throw h;
|
|
13788
|
-
N(1, 0);
|
|
13789
|
-
}
|
|
13790
|
-
}
|
|
13791
|
-
function Wf(e, t, n) {
|
|
13787
|
+
function kf(e, t, n) {
|
|
13792
13788
|
var o = P();
|
|
13793
13789
|
try {
|
|
13794
13790
|
return Qo(e, t, n);
|
|
@@ -13797,7 +13793,7 @@ async function ts(a = {}) {
|
|
|
13797
13793
|
return N(1, 0), 0n;
|
|
13798
13794
|
}
|
|
13799
13795
|
}
|
|
13800
|
-
function
|
|
13796
|
+
function Wf(e, t, n) {
|
|
13801
13797
|
var o = P();
|
|
13802
13798
|
try {
|
|
13803
13799
|
return Xo(e, t, n);
|
|
@@ -13806,7 +13802,7 @@ async function ts(a = {}) {
|
|
|
13806
13802
|
N(1, 0);
|
|
13807
13803
|
}
|
|
13808
13804
|
}
|
|
13809
|
-
function
|
|
13805
|
+
function Ff(e, t, n) {
|
|
13810
13806
|
var o = P();
|
|
13811
13807
|
try {
|
|
13812
13808
|
return Zo(e, t, n);
|
|
@@ -13815,7 +13811,7 @@ async function ts(a = {}) {
|
|
|
13815
13811
|
N(1, 0);
|
|
13816
13812
|
}
|
|
13817
13813
|
}
|
|
13818
|
-
function
|
|
13814
|
+
function Gf(e, t, n, o) {
|
|
13819
13815
|
var u = P();
|
|
13820
13816
|
try {
|
|
13821
13817
|
Ko(e, t, n, o);
|
|
@@ -13841,7 +13837,7 @@ async function ts(a = {}) {
|
|
|
13841
13837
|
if (!E) {
|
|
13842
13838
|
let I = ((F, j3 = 0) => {
|
|
13843
13839
|
var te = Ao(j3);
|
|
13844
|
-
return j3 = So(j3, te),
|
|
13840
|
+
return j3 = So(j3, te), de[te >>> 0] = F.queue, de[j3 >>> 0] = F, j3;
|
|
13845
13841
|
})(b, E = ho(0));
|
|
13846
13842
|
E = [u++, E, I], t.set(b, E);
|
|
13847
13843
|
}
|
|
@@ -13855,7 +13851,7 @@ async function ts(a = {}) {
|
|
|
13855
13851
|
var E = o;
|
|
13856
13852
|
if (o = void 0, b) {
|
|
13857
13853
|
let I = Dr(E);
|
|
13858
|
-
c.set(b, I), E === 0 && e(n ??
|
|
13854
|
+
c.set(b, I), E === 0 && e(n ?? L(I));
|
|
13859
13855
|
}
|
|
13860
13856
|
n = void 0;
|
|
13861
13857
|
}
|
|
@@ -13867,14 +13863,14 @@ async function ts(a = {}) {
|
|
|
13867
13863
|
if (I) return b[h] = [I, NaN], I;
|
|
13868
13864
|
if (I = b[h]) return I[1]++, I[0];
|
|
13869
13865
|
if ((E = c.get(E)) === void 0) throw Error("Invalid session handle passed to webgpuRegisterBuffer");
|
|
13870
|
-
return E = ((F, j3 = 0) => (F.mapState === "unmapped" || Te(), j3 = Eo(j3),
|
|
13866
|
+
return E = ((F, j3 = 0) => (F.mapState === "unmapped" || Te(), j3 = Eo(j3), de[j3 >>> 0] = F, j3))(b, E), b[h] = [E, 1], E;
|
|
13871
13867
|
}, r.webgpuUnregisterBuffer = (b) => {
|
|
13872
13868
|
let E = b[h];
|
|
13873
13869
|
if (!E) throw Error("Buffer is not registered");
|
|
13874
13870
|
E[1]--, E[1] === 0 && (mo(E[0]), delete b[h]);
|
|
13875
|
-
}, r.webgpuGetBuffer = (b) =>
|
|
13871
|
+
}, r.webgpuGetBuffer = (b) => L(b), r.webgpuCreateDownloader = (b, E, I) => {
|
|
13876
13872
|
if ((I = c.get(I)) === void 0) throw Error("Invalid session handle passed to webgpuRegisterBuffer");
|
|
13877
|
-
let F =
|
|
13873
|
+
let F = L(I), j3 = 16 * Math.ceil(Number(E) / 16);
|
|
13878
13874
|
return async () => {
|
|
13879
13875
|
let te = F.createBuffer({ size: j3, usage: 9 });
|
|
13880
13876
|
try {
|
|
@@ -13887,16 +13883,16 @@ async function ts(a = {}) {
|
|
|
13887
13883
|
}, r.ad = (b, E) => {
|
|
13888
13884
|
var I = E.buffer;
|
|
13889
13885
|
let F = E.byteOffset, j3 = E.byteLength;
|
|
13890
|
-
if (E = 16 * Math.ceil(Number(j3) / 16), b =
|
|
13886
|
+
if (E = 16 * Math.ceil(Number(j3) / 16), b = L(b), !n) {
|
|
13891
13887
|
var te = Dr(o);
|
|
13892
|
-
n =
|
|
13888
|
+
n = L(te);
|
|
13893
13889
|
}
|
|
13894
13890
|
let B = (te = n.createBuffer({ mappedAtCreation: true, size: E, usage: 6 })).getMappedRange();
|
|
13895
13891
|
new Uint8Array(B).set(new Uint8Array(I, F, j3)), te.unmap(), (I = n.createCommandEncoder()).copyBufferToBuffer(te, 0, b, 0, E), n.queue.submit([I.finish()]), te.destroy();
|
|
13896
13892
|
};
|
|
13897
13893
|
}, r.webnnInit = (e) => {
|
|
13898
13894
|
let t = e[0];
|
|
13899
|
-
[r.
|
|
13895
|
+
[r.le, r.jd, r.webnnEnsureTensor, r.Sd, r.webnnDownloadTensor, r.ke, r.webnnEnableTraceEvent] = e.slice(1), r.webnnReleaseTensorId = r.jd, r.webnnUploadTensor = r.Sd, r.webnnRegisterMLContext = r.ke, r.webnnOnRunStart = (n) => t.onRunStart(n), r.webnnOnRunEnd = t.onRunEnd.bind(t), r.webnnOnReleaseSession = (n) => {
|
|
13900
13896
|
t.onReleaseSession(n);
|
|
13901
13897
|
}, r.webnnCreateMLTensorDownloader = (n, o) => t.createMLTensorDownloader(n, o), r.webnnRegisterMLTensor = (n, o, u, c) => t.registerMLTensor(n, o, u, c), r.webnnCreateMLContext = (n) => t.createMLContext(n), r.webnnRegisterMLConstant = (n, o, u, c, h, b) => t.registerMLConstant(n, o, u, c, h, r.Uc, b), r.webnnRegisterGraphInput = t.registerGraphInput.bind(t), r.webnnIsGraphInput = t.isGraphInput.bind(t), r.webnnRegisterGraphOutput = t.registerGraphOutput.bind(t), r.webnnIsGraphOutput = t.isGraphOutput.bind(t), r.webnnCreateTemporaryTensor = t.createTemporaryTensor.bind(t), r.webnnIsGraphInputOutputTypeSupported = t.isGraphInputOutputTypeSupported.bind(t);
|
|
13902
13898
|
}, re ? r : new Promise((e, t) => {
|
|
@@ -14669,7 +14665,7 @@ async function saveBlob(path310, blob) {
|
|
|
14669
14665
|
throw new Error("Unable to save because filesystem is disabled in this environment.");
|
|
14670
14666
|
}
|
|
14671
14667
|
}
|
|
14672
|
-
async function
|
|
14668
|
+
async function load_audio(url2, sampling_rate) {
|
|
14673
14669
|
if (typeof AudioContext === "undefined") {
|
|
14674
14670
|
throw Error(
|
|
14675
14671
|
"Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing."
|
|
@@ -16416,11 +16412,69 @@ async function auto_encoder_forward(self2, model_inputs) {
|
|
|
16416
16412
|
const decoded = await self2.decode(encoded);
|
|
16417
16413
|
return decoded;
|
|
16418
16414
|
}
|
|
16415
|
+
function getPastKeyValues(decoderResults, pastKeyValues) {
|
|
16416
|
+
const pkvs = /* @__PURE__ */ Object.create(null);
|
|
16417
|
+
for (const name in decoderResults) {
|
|
16418
|
+
if (name.startsWith("present")) {
|
|
16419
|
+
const newName = name.replace("present_ssm", "past_ssm").replace("present_conv", "past_conv").replace("present_recurrent", "past_recurrent").replace("present", "past_key_values");
|
|
16420
|
+
const is_encoder_pkv = name.includes("encoder");
|
|
16421
|
+
if (is_encoder_pkv && pastKeyValues) {
|
|
16422
|
+
pkvs[newName] = pastKeyValues[newName];
|
|
16423
|
+
} else {
|
|
16424
|
+
pkvs[newName] = decoderResults[name];
|
|
16425
|
+
}
|
|
16426
|
+
}
|
|
16427
|
+
}
|
|
16428
|
+
if (pastKeyValues) {
|
|
16429
|
+
pastKeyValues.update(pkvs);
|
|
16430
|
+
return pastKeyValues;
|
|
16431
|
+
}
|
|
16432
|
+
return new DynamicCache(pkvs);
|
|
16433
|
+
}
|
|
16434
|
+
function getAttentions(model_output) {
|
|
16435
|
+
const attentions = {};
|
|
16436
|
+
for (const attnName of ["cross_attentions", "encoder_attentions", "decoder_attentions"]) {
|
|
16437
|
+
for (const name in model_output) {
|
|
16438
|
+
if (name.startsWith(attnName)) {
|
|
16439
|
+
if (!(attnName in attentions)) {
|
|
16440
|
+
attentions[attnName] = [];
|
|
16441
|
+
}
|
|
16442
|
+
attentions[attnName].push(model_output[name]);
|
|
16443
|
+
}
|
|
16444
|
+
}
|
|
16445
|
+
}
|
|
16446
|
+
return attentions;
|
|
16447
|
+
}
|
|
16448
|
+
function addPastKeyValues(self2, decoderFeeds, pastKeyValues) {
|
|
16449
|
+
if (pastKeyValues && Object.keys(pastKeyValues).length > 0) {
|
|
16450
|
+
Object.assign(decoderFeeds, pastKeyValues);
|
|
16451
|
+
return pastKeyValues;
|
|
16452
|
+
}
|
|
16453
|
+
const session = self2.sessions["decoder_model_merged"] ?? self2.sessions["model"];
|
|
16454
|
+
const batch_size = (decoderFeeds[self2.main_input_name] ?? decoderFeeds.attention_mask)?.dims?.[0] ?? 1;
|
|
16455
|
+
const dtype = session?.config?.kv_cache_dtype ?? "float32";
|
|
16456
|
+
const cls = dtype === "float16" ? DataTypeMap.float16 : DataTypeMap.float32;
|
|
16457
|
+
const shapes = getCacheShapes(self2.config, { batch_size });
|
|
16458
|
+
const entries = /* @__PURE__ */ Object.create(null);
|
|
16459
|
+
for (const name in shapes) {
|
|
16460
|
+
const size = shapes[name].reduce((a, b) => a * b, 1);
|
|
16461
|
+
const t = new Tensor22(dtype, new cls(size), shapes[name]);
|
|
16462
|
+
decoderFeeds[name] = t;
|
|
16463
|
+
entries[name] = t;
|
|
16464
|
+
}
|
|
16465
|
+
if (pastKeyValues) {
|
|
16466
|
+
pastKeyValues.update(entries);
|
|
16467
|
+
return pastKeyValues;
|
|
16468
|
+
}
|
|
16469
|
+
return new DynamicCache(entries);
|
|
16470
|
+
}
|
|
16419
16471
|
async function decoder_forward(self2, model_inputs, is_encoder_decoder = false) {
|
|
16420
16472
|
const session = self2.sessions[is_encoder_decoder ? "decoder_model_merged" : "model"];
|
|
16421
16473
|
const { past_key_values, ...new_model_inputs } = model_inputs;
|
|
16422
16474
|
if (session.inputNames.includes("use_cache_branch")) {
|
|
16423
|
-
new_model_inputs.use_cache_branch = boolTensor(
|
|
16475
|
+
new_model_inputs.use_cache_branch = boolTensor(
|
|
16476
|
+
past_key_values != null && Object.keys(past_key_values).length > 0
|
|
16477
|
+
);
|
|
16424
16478
|
}
|
|
16425
16479
|
if (session.inputNames.includes("position_ids") && new_model_inputs.attention_mask && !new_model_inputs.position_ids) {
|
|
16426
16480
|
const start_index = ["paligemma", "gemma3_text", "gemma3"].includes(self2.config.model_type) ? 1 : 0;
|
|
@@ -16429,7 +16483,7 @@ async function decoder_forward(self2, model_inputs, is_encoder_decoder = false)
|
|
|
16429
16483
|
if (session.inputNames.includes("num_logits_to_keep") && !new_model_inputs.num_logits_to_keep) {
|
|
16430
16484
|
new_model_inputs.num_logits_to_keep = new Tensor22("int64", [0n], []);
|
|
16431
16485
|
}
|
|
16432
|
-
|
|
16486
|
+
addPastKeyValues(self2, new_model_inputs, past_key_values);
|
|
16433
16487
|
const fixed = pick(new_model_inputs, session.inputNames);
|
|
16434
16488
|
return await sessionRun(session, fixed);
|
|
16435
16489
|
}
|
|
@@ -17151,7 +17205,7 @@ async function get_available_dtypes(modelId, { config = null, model_file_name =
|
|
|
17151
17205
|
);
|
|
17152
17206
|
return probeResults.filter((r) => r.available).map((r) => r.dtype);
|
|
17153
17207
|
}
|
|
17154
|
-
var ONNX_NODE, import_sharp, __defProp2, __require2, __export2, VERSION, HAS_SELF, IS_FS_AVAILABLE, IS_PATH_AVAILABLE, IS_WEB_CACHE_AVAILABLE, IS_DENO_RUNTIME, IS_BUN_RUNTIME, IS_DENO_WEB_RUNTIME, IS_PROCESS_AVAILABLE, IS_NODE_ENV, IS_BROWSER_ENV, IS_WEBWORKER_ENV, IS_WEB_ENV, IS_WEBGPU_AVAILABLE, IS_WEBNN_AVAILABLE, IS_CRYPTO_AVAILABLE, IS_CHROME_AVAILABLE, IS_SERVICE_WORKER_ENV, isSafari, IS_SAFARI, apis, RUNNING_LOCALLY, dirname__, DEFAULT_CACHE_DIR, DEFAULT_LOCAL_MODEL_PATH, localModelPath, DEFAULT_FETCH, LogLevel, logLevel, env2, Callable, DefaultProgressCallback, logger2, DictionarySplitter, DictionarySplitter_default, AddedToken, AddedToken_default, BYTES_TO_UNICODE, reverse_dictionary, UNICODE_TO_BYTES, BLOOM_SPLIT_CHARS, PROBLEMATIC_REGEX_MAP, PUNCTUATION_REGEX, clean_up_tokenization, create_pattern, escape_reg_exp, fuse_unk, is_chinese_char, is_integral_number, len, lowercase_and_remove_accents, merge_arrays, object_to_map, regex_split, remove_accents, validate_object, whitespace_split, Callable2, Callable_default, Normalizer, Normalizer_default, BertNormalizer, BertNormalizer_default, Precompiled, Precompiled_default, Sequence, Sequence_default, Replace, Replace_default, UnicodeNormalizer, UnicodeNormalizer_default, NFC, NFC_default, NFD, NFD_default, NFKC, NFKC_default, NFKD, NFKD_default, Strip, Strip_default, StripAccents, StripAccents_default, Lowercase, Lowercase_default, Prepend, Prepend_default, create_normalizer_default, PreTokenizer, PreTokenizer_default, ByteLevel, ByteLevel_default, Whitespace, Whitespace_default, Metaspace, Metaspace_default, Split, Split_default, Punctuation, Punctuation_default, Digits, Digits_default, BertPreTokenizer, BertPreTokenizer_default, Replace2, Replace_default2, Sequence2, Sequence_default2, WhitespaceSplit, WhitespaceSplit_default, FixedLength, FixedLength_default, create_pre_tokenizer_default, TokenizerModel, TokenizerModel_default, WordPieceTokenizer, WordPiece_default, CharTrieNode, CharTrie, CharTrie_default, TokenLatticeNode, TokenLattice, TokenLattice_default, Unigram, Unigram_default, PriorityQueue, PriorityQueue_default, LRUCache, LRUCache_default, BPE, BPE_default, Legacy, Legacy_default, create_tokenizer_model_default, PostProcessor, PostProcessor_default, TemplateProcessing, TemplateProcessing_default, ByteLevel2, ByteLevel_default2, BertProcessing, BertProcessing_default, RobertaProcessing, RobertaProcessing_default, Sequence3, Sequence_default3, create_post_processor_default, Decoder, Decoder_default, ByteLevel3, ByteLevel_default3, WordPiece, WordPiece_default2, Metaspace2, Metaspace_default2, BPE2, BPE_default2, CTC, CTC_default, Sequence4, Sequence_default4, Replace3, Replace_default3, Fuse, Fuse_default, Strip2, Strip_default2, ByteFallback, ByteFallback_default, create_decoder_default, Tokenizer, Tokenizer_default, TOKEN_TYPES, Token, ORDERED_MAPPING_TABLE, ESCAPE_CHARACTERS, Statement, Program, If, For, Break, Continue, SetStatement, Macro, Comment, Expression, MemberExpression, CallExpression, Identifier, Literal, IntegerLiteral, FloatLiteral, StringLiteral, ArrayLiteral, TupleLiteral, ObjectLiteral, BinaryExpression, FilterExpression, FilterStatement, SelectExpression, TestExpression, UnaryExpression, SliceExpression, KeywordArgumentExpression, SpreadExpression, CallStatement, Ternary, BreakControl, ContinueControl, RuntimeValue, IntegerValue, FloatValue, StringValue, BooleanValue, NON_ASCII_CHARS, ObjectValue, KeywordArgumentsValue, ArrayValue, TupleValue, FunctionValue, NullValue, UndefinedValue, Environment, Interpreter, NEWLINE, OPEN_STATEMENT, CLOSE_STATEMENT, Template, CONTENT_TYPE_MAP, FileResponse, Random, _default, random, _weightedIndex, rng, FileCache, ERROR_MAPPING, MAX_EXTERNAL_DATA_CHUNKS, REPO_ID_REGEX, HASH_ALGORITHM, HASH_CACHE_NAME, makeHashDescriptor, CrossOriginStorage, LRUCache2, MAX_CACHE_SIZE, cache, INFLIGHT_LOADS, P2FFT, NP2FFT, FFT, uint16_to_float32, ort_webgpu_bundle_min_exports, jr, Vf, jf, Hf, Hr, k, At, Yf, $t, zt, Ze, Ke, qf, va, Yr, Ea, Sa, Aa, Ia, ie, qr, K, xa, La, Oa, Ba, Jr, Ma, Ca, Ua, Da, Pa, _a, et, It, Ra, Na, ka, Wa, Fa, Ga, le, Vt, Le, Xr, $a, za, tt, rt, $e, ze, Qr, jt, Va, Jf, ja, Ha, Ya, qa, Ja, Zr, Ve, Ht, Ka, Qa, Za, Xf, es, rs, Qf, Zf, ns, ss, tn, Kf, ge, is, en, ec, tc, us, rc, os2, fs4, as, cs, Yt, rn, nn, rr, ls, nc, oc, ac, qt, z, je, be, Lt, $, nr, ds, ps, sc, ic, uc, on, ot, fc, ms, hs, He, or, mt, at, Ot, ar, sr, an, st, Bt, sn, ys, bs, cc, lc, ws, gs, Ts, dc, de, un, Es, cn, Ss, pc, vs, mc, As, ir, ur, fn, Is, xs, Ls, fr, hc, ln, Os, yc, Jt, Xt, it, bc, Bs, xt, Qt, Zt, Ms, Kt, er, tr, Kr, ut, Ee, Mt, lr, dr, cr, dn, pn, ht, yt, gc, Cs, Us, Ds, Ps, _s, Rs, Ns, mn, ks, Tc, pr, Ws, Gs, Fs, mr, vc, $s, Xa, Td, DEVICE_TO_EXECUTION_PROVIDER_MAPPING, ONNX_LOG_LEVEL_NAMES, supportedDevices, defaultDevices, ONNX, ORT_SYMBOL, InferenceSession2, webInitChain, wasmLoadPromise, webInferenceChain, ONNX_ENV, wrap, TensorOpRegistry, DEVICE_TYPES, DEFAULT_DEVICE, isWebGpuFp16Supported, DATA_TYPES, DEFAULT_DEVICE_DTYPE, DEFAULT_DEVICE_DTYPE_MAPPING, DEFAULT_DTYPE_SUFFIX_MAPPING, DataTypeMap, Tensor22, arrayToIndexTensor, SPECIAL_TOKEN_ATTRIBUTES, PreTrainedTokenizer, tokenizers_exports, AlbertTokenizer, BartTokenizer, BertTokenizer, BlenderbotSmallTokenizer, BlenderbotTokenizer, BloomTokenizer, CamembertTokenizer, CLIPTokenizer, CodeLlamaTokenizer, CodeGenTokenizer, CohereTokenizer, CohereAsrTokenizer, ConvBertTokenizer, DebertaV2Tokenizer, DebertaTokenizer, DistilBertTokenizer, ElectraTokenizer, EsmTokenizer, FalconTokenizer, GemmaTokenizer, GPTNeoXTokenizer, GPT2Tokenizer, HerbertTokenizer, LlamaTokenizer, M2M100Tokenizer, MarianTokenizer, MBartTokenizer, MBart50Tokenizer, MgpstrTokenizer, MobileBertTokenizer, MPNetTokenizer, NllbTokenizer, NougatTokenizer, Qwen2Tokenizer, RobertaTokenizer, RoFormerTokenizer, SiglipTokenizer, SpeechT5Tokenizer, SqueezeBertTokenizer, T5Tokenizer, VitsDecoder, VitsTokenizer, Wav2Vec2CTCTokenizer, WHISPER_LANGUAGES, WHISPER_LANGUAGE_MAPPING, WHISPER_TO_LANGUAGE_CODE_MAPPING, PUNCTUATION_REGEX2, PUNCTUATION_ONLY_REGEX, TIMESTAMP_MERGE_TOLERANCE, WhisperTokenizer, XLMRobertaTokenizer, XLMTokenizer, AutoTokenizer, GITHUB_ISSUE_URL, FEATURE_EXTRACTOR_NAME, IMAGE_PROCESSOR_NAME, PROCESSOR_NAME, CHAT_TEMPLATE_NAME, Processor, processors_exports, FeatureExtractor, feature_extractors_exports, HERTZ_TO_MEL_MAPPING, MEL_TO_HERTZ_MAPPING, RawAudio, ASTFeatureExtractor, EncodecFeatureExtractor, ChatterboxFeatureExtractor, ClapFeatureExtractor, EPSILON, ParakeetFeatureExtractor, CohereAsrFeatureExtractor, DacFeatureExtractor, Gemma3nAudioFeatureExtractor, Gemma4AudioFeatureExtractor, GraniteSpeechFeatureExtractor, MoonshineFeatureExtractor, PyAnnoteFeatureExtractor, SeamlessM4TFeatureExtractor, SnacFeatureExtractor, SpeechT5FeatureExtractor, Wav2Vec2FeatureExtractor, WeSpeakerFeatureExtractor, VoxtralRealtimeFeatureExtractor, WhisperFeatureExtractor, AutoFeatureExtractor, ChatterboxProcessor, NO_SPACE_LANGUAGES, CohereAsrProcessor, createCanvasFunction, ImageDataClass, loadImageFunction, RESAMPLING_MAPPING, CONTENT_TYPE_MAP2, RawImage, load_image, ImageProcessor, image_processors_exports, BeitFeatureExtractor, BitImageProcessor, ChineseCLIPFeatureExtractor, CHMv2ImageProcessor, CLIPImageProcessor, CLIPFeatureExtractor, ConvNextImageProcessor, ConvNextFeatureExtractor, DeiTImageProcessor, DeiTFeatureExtractor, DetrImageProcessor, DetrFeatureExtractor, DINOv3ViTImageProcessor, DonutImageProcessor, DonutFeatureExtractor, DPTImageProcessor, DPTFeatureExtractor, EfficientNetImageProcessor, Gemma3ImageProcessor, Gemma4ImageProcessor, Qwen2VLImageProcessor, Glm46VImageProcessor, GLPNFeatureExtractor, GroundingDinoImageProcessor, Idefics3ImageProcessor, VLMImageProcessor, JinaCLIPImageProcessor, Lfm2VlImageProcessor, LlavaOnevisionImageProcessor, MaskFormerImageProcessor, MaskFormerFeatureExtractor, Mask2FormerImageProcessor, MobileNetV1ImageProcessor, MobileNetV1FeatureExtractor, MobileNetV2ImageProcessor, MobileNetV2FeatureExtractor, MobileNetV3ImageProcessor, MobileNetV3FeatureExtractor, MobileNetV4ImageProcessor, MobileNetV4FeatureExtractor, MobileViTImageProcessor, MobileViTFeatureExtractor, NougatImageProcessor, OwlViTImageProcessor, OwlViTFeatureExtractor, Owlv2ImageProcessor, IMAGE_SIZE, SLICE_AXES, ceil, floor, sqrt, Phi3VImageProcessor, PixtralImageProcessor, PvtImageProcessor, RTDetrImageProcessor, SamImageProcessor, SapiensImageProcessor, SapiensFeatureExtractor, SegformerImageProcessor, SegformerFeatureExtractor, SiglipImageProcessor, Swin2SRImageProcessor, ViTImageProcessor, ViTFeatureExtractor, VitMatteImageProcessor, VitPoseImageProcessor, YolosImageProcessor, YolosFeatureExtractor, AutoImageProcessor, Florence2Processor, Gemma3Processor, Gemma3nProcessor, Gemma4Processor, Qwen2VLProcessor, Glm46VProcessor, GraniteSpeechProcessor, GroundingDinoProcessor, Idefics3Processor, VLChatProcessor, JinaCLIPProcessor, Lfm2VlProcessor, LlavaProcessor, DECODE_TYPE_MAPPING, MgpstrProcessor, MoonshineProcessor, OwlViTProcessor, IMAGE_TOKEN, PaliGemmaProcessor, IMAGE_TOKEN2, IMAGE_TOKEN_PATTERN, Phi3VProcessor, PixtralProcessor, PyAnnoteProcessor, Qwen2_5_VLProcessor, Qwen3VLProcessor, SamProcessor, Sam2Processor, Sam2VideoProcessor, SpeechT5Processor, UltravoxProcessor, AUDIO_TOKEN, BEGIN_AUDIO_TOKEN, NUM_AUDIO_TOKENS, VoxtralProcessor, NUM_LEFT_PAD_TOKENS, NUM_DELAY_TOKENS, AUDIO_LENGTH_PER_TOK, OFFLINE_STREAMING_BUFFER_TOKENS, STREAMING_PAD_TOKEN_ID, VoxtralRealtimeProcessor, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM, WhisperProcessor, AutoProcessor, PretrainedConfig, AutoConfig, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, MaskedLMOutput, QuestionAnsweringModelOutput, CausalLMOutput, ImageMattingOutput, LogitsProcessor, LogitsWarper, LogitsProcessorList, ForcedBOSTokenLogitsProcessor, ForcedEOSTokenLogitsProcessor, SuppressTokensLogitsProcessor, SuppressTokensAtBeginLogitsProcessor, WhisperTimeStampLogitsProcessor, NoRepeatNGramLogitsProcessor, RepetitionPenaltyLogitsProcessor, MinLengthLogitsProcessor, MinNewTokensLengthLogitsProcessor, NoBadWordsLogitsProcessor, ClassifierFreeGuidanceLogitsProcessor, TemperatureLogitsWarper, TopPLogitsWarper, TopKLogitsWarper, GenerationConfig, StoppingCriteria, StoppingCriteriaList, MaxLengthCriteria, EosTokenCriteria, InterruptableStoppingCriteria, LogitsSampler, GreedySampler, MultinomialSampler, BeamSearchSampler, _DynamicCache, DynamicCache, MODEL_TYPES, MODEL_SESSION_CONFIG, MODEL_MAPPING_NAMES, MODEL_RUNTIME_CONFIG, MODEL_TYPE_MAPPING, MODEL_NAME_TO_CLASS_MAPPING, MODEL_CLASS_TO_NAME_MAPPING, PreTrainedModel, models_exports, AlbertPreTrainedModel, AlbertModel, AlbertForSequenceClassification, AlbertForQuestionAnswering, AlbertForMaskedLM, ApertusPreTrainedModel, ApertusModel, ApertusForCausalLM, AfmoePreTrainedModel, AfmoeModel, AfmoeForCausalLM, ArceePreTrainedModel, ArceeModel, ArceeForCausalLM, ASTPreTrainedModel, ASTModel, ASTForAudioClassification, BartPretrainedModel, BartModel, BartForConditionalGeneration, BartForSequenceClassification, BeitPreTrainedModel, BeitModel, BeitForImageClassification, BertPreTrainedModel, BertModel, BertForMaskedLM, BertForSequenceClassification, BertForTokenClassification, BertForQuestionAnswering, BlenderbotPreTrainedModel, BlenderbotModel, BlenderbotForConditionalGeneration, BlenderbotSmallPreTrainedModel, BlenderbotSmallModel, BlenderbotSmallForConditionalGeneration, BloomPreTrainedModel, BloomModel, BloomForCausalLM, CamembertPreTrainedModel, CamembertModel, CamembertForMaskedLM, CamembertForSequenceClassification, CamembertForTokenClassification, CamembertForQuestionAnswering, SILENCE_TOKEN, START_SPEECH_TOKEN, ChatterboxPreTrainedModel, ChatterboxModel, ChineseCLIPPreTrainedModel, ChineseCLIPModel, CHMv2PreTrainedModel, CHMv2ForDepthEstimation, ClapPreTrainedModel, ClapModel, ClapTextModelWithProjection, ClapAudioModelWithProjection, CLIPPreTrainedModel, CLIPModel, CLIPTextModel, CLIPTextModelWithProjection, CLIPVisionModel, CLIPVisionModelWithProjection, CLIPSegPreTrainedModel, CLIPSegModel, CLIPSegForImageSegmentation, CodeGenPreTrainedModel, CodeGenModel, CodeGenForCausalLM, CoherePreTrainedModel, CohereModel, CohereForCausalLM, Cohere2PreTrainedModel, Cohere2Model, Cohere2ForCausalLM, CohereAsrPreTrainedModel, CohereAsrModel, CohereAsrForConditionalGeneration, ConvBertPreTrainedModel, ConvBertModel, ConvBertForMaskedLM, ConvBertForSequenceClassification, ConvBertForTokenClassification, ConvBertForQuestionAnswering, ConvNextPreTrainedModel, ConvNextModel, ConvNextForImageClassification, ConvNextV2PreTrainedModel, ConvNextV2Model, ConvNextV2ForImageClassification, RTDetrPreTrainedModel, RTDetrModel, RTDetrForObjectDetection, RTDetrObjectDetectionOutput, DFinePreTrainedModel, DFineModel, DFineForObjectDetection, DacEncoderOutput, DacDecoderOutput, DacPreTrainedModel, DacModel, DacEncoderModel, DacDecoderModel, DebertaPreTrainedModel, DebertaModel, DebertaForMaskedLM, DebertaForSequenceClassification, DebertaForTokenClassification, DebertaForQuestionAnswering, DeepseekV3PreTrainedModel, DeepseekV3Model, DeepseekV3ForCausalLM, DebertaV2PreTrainedModel, DebertaV2Model, DebertaV2ForMaskedLM, DebertaV2ForSequenceClassification, DebertaV2ForTokenClassification, DebertaV2ForQuestionAnswering, DecisionTransformerPreTrainedModel, DecisionTransformerModel, DeiTPreTrainedModel, DeiTModel, DeiTForImageClassification, DepthAnythingPreTrainedModel, DepthAnythingForDepthEstimation, DepthProPreTrainedModel, DepthProForDepthEstimation, DetrPreTrainedModel, DetrModel, DetrForObjectDetection, DetrForSegmentation, DetrObjectDetectionOutput, DetrSegmentationOutput, Dinov2PreTrainedModel, Dinov2Model, Dinov2ForImageClassification, Dinov2WithRegistersPreTrainedModel, Dinov2WithRegistersModel, Dinov2WithRegistersForImageClassification, DINOv3ConvNextPreTrainedModel, DINOv3ConvNextModel, DINOv3ViTPreTrainedModel, DINOv3ViTModel, DistilBertPreTrainedModel, DistilBertModel, DistilBertForSequenceClassification, DistilBertForTokenClassification, DistilBertForQuestionAnswering, DistilBertForMaskedLM, DonutSwinPreTrainedModel, DonutSwinModel, DPTPreTrainedModel, DPTModel, DPTForDepthEstimation, EfficientNetPreTrainedModel, EfficientNetModel, EfficientNetForImageClassification, ElectraPreTrainedModel, ElectraModel, ElectraForMaskedLM, ElectraForSequenceClassification, ElectraForTokenClassification, ElectraForQuestionAnswering, Ernie4_5PretrainedModel, Ernie4_5Model, Ernie4_5ForCausalLM, EsmPreTrainedModel, EsmModel, EsmForMaskedLM, EsmForSequenceClassification, EsmForTokenClassification, EuroBertPreTrainedModel, EuroBertModel, EuroBertForMaskedLM, EuroBertForSequenceClassification, EuroBertForTokenClassification, ExaonePreTrainedModel, ExaoneModel, ExaoneForCausalLM, FalconPreTrainedModel, FalconModel, FalconForCausalLM, FalconH1PreTrainedModel, FalconH1Model, FalconH1ForCausalLM, FastViTPreTrainedModel, FastViTModel, FastViTForImageClassification, Florence2PreTrainedModel, Florence2ForConditionalGeneration, GemmaPreTrainedModel, GemmaModel, GemmaForCausalLM, Gemma2PreTrainedModel, Gemma2Model, Gemma2ForCausalLM, LlavaPreTrainedModel, LlavaForConditionalGeneration, Moondream1ForConditionalGeneration, LlavaQwen2ForCausalLM, Gemma3PreTrainedModel, Gemma3Model, Gemma3ForConditionalGeneration, Gemma3ForCausalLM, Gemma3nPreTrainedModel, Gemma3nForConditionalGeneration, Gemma3nForCausalLM, Gemma4ForConditionalGeneration, Gemma4ForCausalLM, GlmPreTrainedModel, GlmModel, GlmForCausalLM, GlmMoeDsaPreTrainedModel, GlmMoeDsaModel, GlmMoeDsaForCausalLM, Qwen2VLPreTrainedModel, Qwen2VLForConditionalGeneration, Qwen2VLForCausalLM, Qwen2_5_VLForConditionalGeneration, Qwen2_5_VLForCausalLM, GlmOcrForConditionalGeneration, GLPNPreTrainedModel, GLPNModel, GLPNForDepthEstimation, GPTBigCodePreTrainedModel, GPTBigCodeModel, GPTBigCodeForCausalLM, GPTNeoPreTrainedModel, GPTNeoModel, GPTNeoForCausalLM, GPTNeoXPreTrainedModel, GPTNeoXModel, GPTNeoXForCausalLM, GptOssPreTrainedModel, GptOssModel, GptOssForCausalLM, GPT2PreTrainedModel, GPT2Model, GPT2LMHeadModel, GPTJPreTrainedModel, GPTJModel, GPTJForCausalLM, GranitePreTrainedModel, GraniteModel, GraniteForCausalLM, GraniteMoeHybridPreTrainedModel, GraniteMoeHybridModel, GraniteMoeHybridForCausalLM, UltravoxPreTrainedModel, UltravoxModel, GraniteSpeechForConditionalGeneration, GroundingDinoPreTrainedModel, GroundingDinoForObjectDetection, GroupViTPreTrainedModel, GroupViTModel, HeliumPreTrainedModel, HeliumModel, HeliumForCausalLM, HieraPreTrainedModel, HieraModel, HieraForImageClassification, Wav2Vec2PreTrainedModel, Wav2Vec2Model, Wav2Vec2ForCTC, Wav2Vec2ForSequenceClassification, Wav2Vec2ForAudioFrameClassification, HubertPreTrainedModel, HubertModel, HubertForCTC, HubertForSequenceClassification, HunYuanDenseV1PreTrainedModel, HunYuanDenseV1Model, HunYuanDenseV1ForCausalLM, Idefics3ForConditionalGeneration, IJepaPreTrainedModel, IJepaModel, IJepaForImageClassification, JAISPreTrainedModel, JAISModel, JAISLMHeadModel, JinaCLIPPreTrainedModel, JinaCLIPModel, JinaCLIPTextModel, JinaCLIPVisionModel, Lfm2PreTrainedModel, Lfm2Model, Lfm2ForCausalLM, LightOnOcrForConditionalGeneration, Lfm2MoePreTrainedModel, Lfm2MoeModel, Lfm2MoeForCausalLM, Lfm2VlForConditionalGeneration, LlamaPreTrainedModel, LlamaModel, LlamaForCausalLM, Llama4PreTrainedModel, Llama4ForCausalLM, LongT5PreTrainedModel, LongT5Model, LongT5ForConditionalGeneration, M2M100PreTrainedModel, M2M100Model, M2M100ForConditionalGeneration, MarianPreTrainedModel, MarianModel, MarianMTModel, MaskFormerPreTrainedModel, MaskFormerModel, MaskFormerForInstanceSegmentation, MBartPreTrainedModel, MBartModel, MBartForConditionalGeneration, MBartForSequenceClassification, MBartForCausalLM, Metric3DPreTrainedModel, Metric3DForDepthEstimation, Metric3Dv2PreTrainedModel, Metric3Dv2ForDepthEstimation, MgpstrModelOutput, MgpstrPreTrainedModel, MgpstrForSceneTextRecognition, MimiEncoderOutput, MimiDecoderOutput, MimiPreTrainedModel, MimiModel, MimiEncoderModel, MimiDecoderModel, MistralPreTrainedModel, MistralModel, MistralForCausalLM, Mistral4PreTrainedModel, Mistral4Model, Mistral4ForCausalLM, MobileBertPreTrainedModel, MobileBertModel, MobileBertForMaskedLM, MobileBertForSequenceClassification, MobileBertForQuestionAnswering, MobileLLMPreTrainedModel, MobileLLMModel, MobileLLMForCausalLM, MobileNetV1PreTrainedModel, MobileNetV1Model, MobileNetV1ForImageClassification, MobileNetV1ForSemanticSegmentation, MobileNetV2PreTrainedModel, MobileNetV2Model, MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV3PreTrainedModel, MobileNetV3Model, MobileNetV3ForImageClassification, MobileNetV3ForSemanticSegmentation, MobileNetV4PreTrainedModel, MobileNetV4Model, MobileNetV4ForImageClassification, MobileNetV4ForSemanticSegmentation, MobileViTPreTrainedModel, MobileViTModel, MobileViTForImageClassification, MobileViTV2PreTrainedModel, MobileViTV2Model, MobileViTV2ForImageClassification, ModernBertPreTrainedModel, ModernBertModel, ModernBertForMaskedLM, ModernBertForSequenceClassification, ModernBertForTokenClassification, ModernBertDecoderPreTrainedModel, ModernBertDecoderModel, ModernBertDecoderForCausalLM, MoonshinePreTrainedModel, MoonshineModel, MoonshineForConditionalGeneration, MPNetPreTrainedModel, MPNetModel, MPNetForMaskedLM, MPNetForSequenceClassification, MPNetForTokenClassification, MPNetForQuestionAnswering, MptPreTrainedModel, MptModel, MptForCausalLM, MT5PreTrainedModel, MT5Model, MT5ForConditionalGeneration, MultiModalityPreTrainedModel, MultiModalityCausalLM, MusicgenPreTrainedModel, MusicgenModel, MusicgenForCausalLM, MusicgenForConditionalGeneration, NanoChatPreTrainedModel, NanoChatModel, NanoChatForCausalLM, NemotronHPreTrainedModel, NemotronHModel, NemotronHForCausalLM, NeoBertPreTrainedModel, NeoBertModel, NeoBertForMaskedLM, NeoBertForSequenceClassification, NeoBertForTokenClassification, NeoBertForQuestionAnswering, NomicBertPreTrainedModel, NomicBertModel, OlmoPreTrainedModel, OlmoModel, OlmoForCausalLM, Olmo2PreTrainedModel, Olmo2Model, Olmo2ForCausalLM, Olmo3PreTrainedModel, Olmo3Model, Olmo3ForCausalLM, OlmoHybridPreTrainedModel, OlmoHybridModel, OlmoHybridForCausalLM, OpenELMPreTrainedModel, OpenELMModel, OpenELMForCausalLM, OPTPreTrainedModel, OPTModel, OPTForCausalLM, Owlv2PreTrainedModel, Owlv2Model, Owlv2ForObjectDetection, OwlViTPreTrainedModel, OwlViTModel, OwlViTForObjectDetection, PaliGemmaForConditionalGeneration, ParakeetPreTrainedModel, ParakeetForCTC, PatchTSMixerPreTrainedModel, PatchTSMixerModel, PatchTSMixerForPrediction, PatchTSTPreTrainedModel, PatchTSTModel, PatchTSTForPrediction, PhiPreTrainedModel, PhiModel, PhiForCausalLM, Phi3PreTrainedModel, Phi3Model, Phi3ForCausalLM, Phi3VPreTrainedModel, Phi3VForCausalLM, PvtPreTrainedModel, PvtModel, PvtForImageClassification, PyAnnotePreTrainedModel, PyAnnoteModel, PyAnnoteForAudioFrameClassification, Qwen2PreTrainedModel, Qwen2Model, Qwen2ForCausalLM, Qwen2MoePreTrainedModel, Qwen2MoeModel, Qwen2MoeForCausalLM, Qwen3PreTrainedModel, Qwen3Model, Qwen3ForCausalLM, Qwen3MoePreTrainedModel, Qwen3MoeModel, Qwen3MoeForCausalLM, Qwen3NextPreTrainedModel, Qwen3NextModel, Qwen3NextForCausalLM, Qwen3VLForConditionalGeneration, Qwen3VLForCausalLM, Qwen3VLMoeForConditionalGeneration, Qwen3VLMoeForCausalLM, Qwen3_5ForConditionalGeneration, Qwen3_5ForCausalLM, Qwen3_5MoeForConditionalGeneration, Qwen3_5MoeForCausalLM, ResNetPreTrainedModel, ResNetModel, ResNetForImageClassification, RFDetrPreTrainedModel, RFDetrModel, RFDetrForObjectDetection, RFDetrObjectDetectionOutput, RobertaPreTrainedModel, RobertaModel, RobertaForMaskedLM, RobertaForSequenceClassification, RobertaForTokenClassification, RobertaForQuestionAnswering, RoFormerPreTrainedModel, RoFormerModel, RoFormerForMaskedLM, RoFormerForSequenceClassification, RoFormerForTokenClassification, RoFormerForQuestionAnswering, RTDetrV2PreTrainedModel, RTDetrV2Model, RTDetrV2ForObjectDetection, RTDetrV2ObjectDetectionOutput, SamImageSegmentationOutput, SamPreTrainedModel, SamModel, Sam2ImageSegmentationOutput, Sam2PreTrainedModel, Sam2Model, EdgeTamModel, Sam3TrackerModel, SapiensPreTrainedModel, SapiensForSemanticSegmentation, SapiensForDepthEstimation, SapiensForNormalEstimation, SegformerPreTrainedModel, SegformerModel, SegformerForImageClassification, SegformerForSemanticSegmentation, SiglipPreTrainedModel, SiglipModel, SiglipTextModel, SiglipVisionModel, SmolLM3PreTrainedModel, SmolLM3Model, SmolLM3ForCausalLM, SnacPreTrainedModel, SnacModel, SnacEncoderModel, SnacDecoderModel, SolarOpenPreTrainedModel, SolarOpenModel, SolarOpenForCausalLM, SpeechT5PreTrainedModel, SpeechT5Model, SpeechT5ForSpeechToText, SpeechT5ForTextToSpeech, SpeechT5HifiGan, SqueezeBertPreTrainedModel, SqueezeBertModel, SqueezeBertForMaskedLM, SqueezeBertForSequenceClassification, SqueezeBertForQuestionAnswering, StableLmPreTrainedModel, StableLmModel, StableLmForCausalLM, Starcoder2PreTrainedModel, Starcoder2Model, Starcoder2ForCausalLM, StyleTextToSpeech2PreTrainedModel, StyleTextToSpeech2Model, SupertonicPreTrainedModel, SupertonicForConditionalGeneration, SwinPreTrainedModel, SwinModel, SwinForImageClassification, SwinForSemanticSegmentation, Swin2SRPreTrainedModel, Swin2SRModel, Swin2SRForImageSuperResolution, T5PreTrainedModel, T5Model, T5ForConditionalGeneration, TableTransformerPreTrainedModel, TableTransformerModel, TableTransformerForObjectDetection, TableTransformerObjectDetectionOutput, TrOCRPreTrainedModel, TrOCRForCausalLM, UniSpeechPreTrainedModel, UniSpeechModel, UniSpeechForCTC, UniSpeechForSequenceClassification, UniSpeechSatPreTrainedModel, UniSpeechSatModel, UniSpeechSatForCTC, UniSpeechSatForSequenceClassification, UniSpeechSatForAudioFrameClassification, VaultGemmaPreTrainedModel, VaultGemmaModel, VaultGemmaForCausalLM, VisionEncoderDecoderModel, ViTPreTrainedModel, ViTModel, ViTForImageClassification, ViTMAEPreTrainedModel, ViTMAEModel, ViTMSNPreTrainedModel, ViTMSNModel, ViTMSNForImageClassification, VitMattePreTrainedModel, VitMatteForImageMatting, VitPosePreTrainedModel, VitPoseForPoseEstimation, VitsModelOutput, VitsPreTrainedModel, VitsModel, VoxtralForConditionalGeneration, CONV1_LEFT_PAD, CONV2_LEFT_PAD, states, AudioExhaustedCriteria, VoxtralRealtimePreTrainedModel, VoxtralRealtimeForConditionalGeneration, Wav2Vec2BertPreTrainedModel, Wav2Vec2BertModel, Wav2Vec2BertForCTC, Wav2Vec2BertForSequenceClassification, XVectorOutput, WavLMPreTrainedModel, WavLMModel, WavLMForCTC, WavLMForSequenceClassification, WavLMForXVector, WavLMForAudioFrameClassification, WeSpeakerResNetPreTrainedModel, WeSpeakerResNetModel, WhisperGenerationConfig, WhisperPreTrainedModel, WhisperModel, WhisperForConditionalGeneration, LiteWhisperForConditionalGeneration, XLMPreTrainedModel, XLMModel, XLMWithLMHeadModel, XLMForSequenceClassification, XLMForTokenClassification, XLMForQuestionAnswering, XLMRobertaPreTrainedModel, XLMRobertaModel, XLMRobertaForMaskedLM, XLMRobertaForSequenceClassification, XLMRobertaForTokenClassification, XLMRobertaForQuestionAnswering, YolosPreTrainedModel, YolosModel, YolosForObjectDetection, YolosObjectDetectionOutput, YoutuPreTrainedModel, YoutuModel, YoutuForCausalLM, MODEL_MAPPING_NAMES_ENCODER_ONLY, MODEL_MAPPING_NAMES_ENCODER_DECODER, MODEL_MAPPING_NAMES_AUTO_ENCODER, MODEL_MAPPING_NAMES_DECODER_ONLY, MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES, MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES, MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES, MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES, MODEL_FOR_CAUSAL_LM_MAPPING_NAMES, MODEL_FOR_MULTIMODALITY_MAPPING_NAMES, MODEL_FOR_MASKED_LM_MAPPING_NAMES, MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES, MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES, MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES, MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES, MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES, MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES, MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES, MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES, MODEL_FOR_MASK_GENERATION_MAPPING_NAMES, MODEL_FOR_CTC_MAPPING_NAMES, MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES, MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES, MODEL_FOR_TIME_SERIES_PREDICTION_MAPPING_NAMES, MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES, MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES, MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES, MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES, MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES, MODEL_CLASS_TYPE_MAPPING, CUSTOM_MAPPING, CUSTOM_ARCHITECTURES_MAPPING, CUSTOM_ARCHITECTURES, MODEL_MAPPINGS, PretrainedMixin, AutoModel, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoModelForSeq2SeqLM, AutoModelForSpeechSeq2Seq, AutoModelForTextToSpectrogram, AutoModelForTextToWaveform, AutoModelForCausalLM, AutoModelForMaskedLM, AutoModelForQuestionAnswering, AutoModelForVision2Seq, AutoModelForImageClassification, AutoModelForImageSegmentation, AutoModelForSemanticSegmentation, AutoModelForUniversalSegmentation, AutoModelForObjectDetection, AutoModelForZeroShotObjectDetection, AutoModelForMaskGeneration, AutoModelForCTC, AutoModelForAudioClassification, AutoModelForXVector, AutoModelForAudioFrameClassification, AutoModelForDocumentQuestionAnswering, AutoModelForImageMatting, AutoModelForImageToImage, AutoModelForDepthEstimation, AutoModelForNormalEstimation, AutoModelForPoseEstimation, AutoModelForImageFeatureExtraction, AutoModelForImageTextToText, AutoModelForAudioTextToText, Pipeline, TextClassificationPipeline, TokenClassificationPipeline, QuestionAnsweringPipeline, FillMaskPipeline, Text2TextGenerationPipeline, SummarizationPipeline, TranslationPipeline, TextGenerationPipeline, ZeroShotClassificationPipeline, AudioClassificationPipeline, ZeroShotAudioClassificationPipeline, AutomaticSpeechRecognitionPipeline, TextToAudioPipeline, ImageToTextPipeline, ImageClassificationPipeline, SUBTASKS_MAPPING, ImageSegmentationPipeline, BackgroundRemovalPipeline, ZeroShotImageClassificationPipeline, ObjectDetectionPipeline, ZeroShotObjectDetectionPipeline, DocumentQuestionAnsweringPipeline, ImageToImagePipeline, DepthEstimationPipeline, FeatureExtractionPipeline, ImageFeatureExtractionPipeline, SUPPORTED_TASKS, TASK_ALIASES, is_chinese_char2, BaseStreamer, stdout_write, TextStreamer, WhisperTextStreamer, RawVideoFrame, RawVideo, CONCRETE_DTYPES, ModelRegistry;
|
|
17208
|
+
var ONNX_NODE, import_sharp, __defProp2, __require2, __export2, VERSION, HAS_SELF, IS_FS_AVAILABLE, IS_PATH_AVAILABLE, IS_WEB_CACHE_AVAILABLE, IS_DENO_RUNTIME, IS_BUN_RUNTIME, IS_DENO_WEB_RUNTIME, IS_PROCESS_AVAILABLE, IS_NODE_ENV, IS_BROWSER_ENV, IS_WEBWORKER_ENV, IS_WEB_ENV, IS_WEBGPU_AVAILABLE, IS_WEBNN_AVAILABLE, IS_CRYPTO_AVAILABLE, IS_CHROME_AVAILABLE, IS_SERVICE_WORKER_ENV, isSafari, IS_SAFARI, apis, RUNNING_LOCALLY, dirname__, DEFAULT_CACHE_DIR, DEFAULT_LOCAL_MODEL_PATH, localModelPath, DEFAULT_FETCH, LogLevel, logLevel, env2, Callable, DefaultProgressCallback, logger2, DictionarySplitter, DictionarySplitter_default, AddedToken, AddedToken_default, BYTES_TO_UNICODE, reverse_dictionary, UNICODE_TO_BYTES, BLOOM_SPLIT_CHARS, PROBLEMATIC_REGEX_MAP, PUNCTUATION_REGEX, clean_up_tokenization, create_pattern, escape_reg_exp, fuse_unk, is_chinese_char, is_integral_number, len, lowercase_and_remove_accents, merge_arrays, object_to_map, regex_split, remove_accents, validate_object, whitespace_split, Callable2, Callable_default, Normalizer, Normalizer_default, BertNormalizer, BertNormalizer_default, Precompiled, Precompiled_default, Sequence, Sequence_default, Replace, Replace_default, UnicodeNormalizer, UnicodeNormalizer_default, NFC, NFC_default, NFD, NFD_default, NFKC, NFKC_default, NFKD, NFKD_default, Strip, Strip_default, StripAccents, StripAccents_default, Lowercase, Lowercase_default, Prepend, Prepend_default, create_normalizer_default, PreTokenizer, PreTokenizer_default, ByteLevel, ByteLevel_default, Whitespace, Whitespace_default, Metaspace, Metaspace_default, Split, Split_default, Punctuation, Punctuation_default, Digits, Digits_default, BertPreTokenizer, BertPreTokenizer_default, Replace2, Replace_default2, Sequence2, Sequence_default2, WhitespaceSplit, WhitespaceSplit_default, FixedLength, FixedLength_default, create_pre_tokenizer_default, TokenizerModel, TokenizerModel_default, WordPieceTokenizer, WordPiece_default, CharTrieNode, CharTrie, CharTrie_default, TokenLatticeNode, TokenLattice, TokenLattice_default, Unigram, Unigram_default, PriorityQueue, PriorityQueue_default, LRUCache, LRUCache_default, BPE, BPE_default, Legacy, Legacy_default, create_tokenizer_model_default, PostProcessor, PostProcessor_default, TemplateProcessing, TemplateProcessing_default, ByteLevel2, ByteLevel_default2, BertProcessing, BertProcessing_default, RobertaProcessing, RobertaProcessing_default, Sequence3, Sequence_default3, create_post_processor_default, Decoder, Decoder_default, ByteLevel3, ByteLevel_default3, WordPiece, WordPiece_default2, Metaspace2, Metaspace_default2, BPE2, BPE_default2, CTC, CTC_default, Sequence4, Sequence_default4, Replace3, Replace_default3, Fuse, Fuse_default, Strip2, Strip_default2, ByteFallback, ByteFallback_default, create_decoder_default, Tokenizer, Tokenizer_default, TOKEN_TYPES, Token, ORDERED_MAPPING_TABLE, ESCAPE_CHARACTERS, Statement, Program, If, For, Break, Continue, SetStatement, Macro, Comment, Expression, MemberExpression, CallExpression, Identifier, Literal, IntegerLiteral, FloatLiteral, StringLiteral, ArrayLiteral, TupleLiteral, ObjectLiteral, BinaryExpression, FilterExpression, FilterStatement, SelectExpression, TestExpression, UnaryExpression, SliceExpression, KeywordArgumentExpression, SpreadExpression, CallStatement, Ternary, BreakControl, ContinueControl, RuntimeValue, IntegerValue, FloatValue, StringValue, BooleanValue, NON_ASCII_CHARS, ObjectValue, KeywordArgumentsValue, ArrayValue, TupleValue, FunctionValue, NullValue, UndefinedValue, Environment, Interpreter, NEWLINE, OPEN_STATEMENT, CLOSE_STATEMENT, Template, CONTENT_TYPE_MAP, FileResponse, Random, _default, random, _weightedIndex, rng, FileCache, ERROR_MAPPING, MAX_EXTERNAL_DATA_CHUNKS, REPO_ID_REGEX, HASH_ALGORITHM, HASH_CACHE_NAME, makeHashDescriptor, CrossOriginStorage, LRUCache2, MAX_CACHE_SIZE, cache, INFLIGHT_LOADS, P2FFT, NP2FFT, FFT, uint16_to_float32, ort_webgpu_bundle_min_exports, jr, zf, Vf, jf, Hr, k, At, Hf, $t, zt, Ze, Ke, Yf, Ta, Yr, va, Ea, Sa, Aa, ie, qr, K, Ia, xa, La, Oa, Jr, Ba, Ma, Ca, Ua, Da, Pa, et, It, _a, Ra, Na, ka, Wa, Fa, le, Vt, Le, Xr, Ga, $a, tt, rt, $e, ze, Qr, jt, za, qf, Va, ja, Ha, Ya, qa, Zr, Ve, Ht, Za, Xa, Qa, Jf, Ka, ts, Xf, Qf, rs, as, tn, Zf, ge, ss, en, Kf, ec, is, tc, ns, us, os2, fs4, Yt, rn, nn, rr, cs, rc, nc, oc, qt, z, je, be, Lt, $, nr, ds, ls, ac, sc, ic, on, ot, uc, ps, ms, He, or, mt, at, Ot, ar, sr, an, st, Bt, sn, hs, ys, fc, cc, bs, ws, gs, dc, pe, un, vs, cn, Es, lc, Ts, pc, Ss, ir, ur, fn, As, Is, xs, fr, mc, dn, Ls, hc, Jt, Xt, it, yc, Os, xt, Qt, Zt, Bs, Kt, er, tr, Kr, ut, Ee, Mt, dr, lr, cr, ln, pn, ht, yt, wc, Ms, Cs, Us, Ds, Ps, _s, Rs, mn, Ns, gc, pr, ks, Fs, Ws, mr, Tc, Gs, Ja, gl, DEVICE_TO_EXECUTION_PROVIDER_MAPPING, ONNX_LOG_LEVEL_NAMES, supportedDevices, defaultDevices, ONNX, ORT_SYMBOL, InferenceSession2, webInitChain, wasmLoadPromise, webInferenceChain, ONNX_ENV, wrap, TensorOpRegistry, DEVICE_TYPES, DEFAULT_DEVICE, isWebGpuFp16Supported, DATA_TYPES, DEFAULT_DEVICE_DTYPE, DEFAULT_DEVICE_DTYPE_MAPPING, DEFAULT_DTYPE_SUFFIX_MAPPING, DataTypeMap, Tensor22, arrayToIndexTensor, SPECIAL_TOKEN_ATTRIBUTES, PreTrainedTokenizer, tokenizers_exports, AlbertTokenizer, BartTokenizer, BertTokenizer, BlenderbotSmallTokenizer, BlenderbotTokenizer, BloomTokenizer, CamembertTokenizer, CLIPTokenizer, CodeLlamaTokenizer, CodeGenTokenizer, CohereTokenizer, CohereAsrTokenizer, ConvBertTokenizer, DebertaV2Tokenizer, DebertaTokenizer, DistilBertTokenizer, ElectraTokenizer, EsmTokenizer, FalconTokenizer, GemmaTokenizer, GPTNeoXTokenizer, GPT2Tokenizer, HerbertTokenizer, LlamaTokenizer, M2M100Tokenizer, MarianTokenizer, MBartTokenizer, MBart50Tokenizer, MgpstrTokenizer, MobileBertTokenizer, MPNetTokenizer, NllbTokenizer, NougatTokenizer, Qwen2Tokenizer, RobertaTokenizer, RoFormerTokenizer, SiglipTokenizer, SpeechT5Tokenizer, SqueezeBertTokenizer, T5Tokenizer, VitsDecoder, VitsTokenizer, Wav2Vec2CTCTokenizer, WHISPER_LANGUAGES, WHISPER_LANGUAGE_MAPPING, WHISPER_TO_LANGUAGE_CODE_MAPPING, PUNCTUATION_REGEX2, PUNCTUATION_ONLY_REGEX, TIMESTAMP_MERGE_TOLERANCE, WhisperTokenizer, XLMRobertaTokenizer, XLMTokenizer, AutoTokenizer, GITHUB_ISSUE_URL, FEATURE_EXTRACTOR_NAME, IMAGE_PROCESSOR_NAME, PROCESSOR_NAME, CHAT_TEMPLATE_NAME, Processor, processors_exports, FeatureExtractor, feature_extractors_exports, read_audio, HERTZ_TO_MEL_MAPPING, MEL_TO_HERTZ_MAPPING, RawAudio, ASTFeatureExtractor, EncodecFeatureExtractor, ChatterboxFeatureExtractor, ClapFeatureExtractor, EPSILON, ParakeetFeatureExtractor, CohereAsrFeatureExtractor, DacFeatureExtractor, Gemma3nAudioFeatureExtractor, Gemma4AudioFeatureExtractor, GraniteSpeechFeatureExtractor, MoonshineFeatureExtractor, PyAnnoteFeatureExtractor, SeamlessM4TFeatureExtractor, SnacFeatureExtractor, SpeechT5FeatureExtractor, Wav2Vec2FeatureExtractor, WeSpeakerFeatureExtractor, VoxtralRealtimeFeatureExtractor, WhisperFeatureExtractor, AutoFeatureExtractor, ChatterboxProcessor, NO_SPACE_LANGUAGES, CohereAsrProcessor, createCanvasFunction, ImageDataClass, loadImageFunction, RESAMPLING_MAPPING, CONTENT_TYPE_MAP2, RawImage, load_image, ImageProcessor, image_processors_exports, BeitFeatureExtractor, BitImageProcessor, ChineseCLIPFeatureExtractor, CHMv2ImageProcessor, CLIPImageProcessor, CLIPFeatureExtractor, ConvNextImageProcessor, ConvNextFeatureExtractor, DeiTImageProcessor, DeiTFeatureExtractor, DetrImageProcessor, DetrFeatureExtractor, DINOv3ViTImageProcessor, DonutImageProcessor, DonutFeatureExtractor, DPTImageProcessor, DPTFeatureExtractor, EfficientNetImageProcessor, Gemma3ImageProcessor, Gemma4ImageProcessor, Qwen2VLImageProcessor, Glm46VImageProcessor, GLPNFeatureExtractor, GroundingDinoImageProcessor, Idefics3ImageProcessor, VLMImageProcessor, JinaCLIPImageProcessor, Lfm2VlImageProcessor, LlavaOnevisionImageProcessor, MaskFormerImageProcessor, MaskFormerFeatureExtractor, Mask2FormerImageProcessor, MobileNetV1ImageProcessor, MobileNetV1FeatureExtractor, MobileNetV2ImageProcessor, MobileNetV2FeatureExtractor, MobileNetV3ImageProcessor, MobileNetV3FeatureExtractor, MobileNetV4ImageProcessor, MobileNetV4FeatureExtractor, MobileViTImageProcessor, MobileViTFeatureExtractor, NougatImageProcessor, OwlViTImageProcessor, OwlViTFeatureExtractor, Owlv2ImageProcessor, IMAGE_SIZE, SLICE_AXES, ceil, floor, sqrt, Phi3VImageProcessor, PixtralImageProcessor, PvtImageProcessor, RTDetrImageProcessor, SamImageProcessor, SapiensImageProcessor, SapiensFeatureExtractor, SegformerImageProcessor, SegformerFeatureExtractor, SiglipImageProcessor, Swin2SRImageProcessor, ViTImageProcessor, ViTFeatureExtractor, VitMatteImageProcessor, VitPoseImageProcessor, YolosImageProcessor, YolosFeatureExtractor, AutoImageProcessor, Florence2Processor, Gemma3Processor, Gemma3nProcessor, Gemma4Processor, Qwen2VLProcessor, Glm46VProcessor, GraniteSpeechProcessor, GroundingDinoProcessor, Idefics3Processor, VLChatProcessor, JinaCLIPProcessor, Lfm2VlProcessor, LlavaProcessor, DECODE_TYPE_MAPPING, MgpstrProcessor, MoonshineProcessor, OwlViTProcessor, IMAGE_TOKEN, PaliGemmaProcessor, IMAGE_TOKEN2, IMAGE_TOKEN_PATTERN, Phi3VProcessor, PixtralProcessor, PyAnnoteProcessor, Qwen2_5_VLProcessor, Qwen3VLProcessor, SamProcessor, Sam2Processor, Sam2VideoProcessor, SpeechT5Processor, UltravoxProcessor, AUDIO_TOKEN, BEGIN_AUDIO_TOKEN, NUM_AUDIO_TOKENS, VoxtralProcessor, NUM_LEFT_PAD_TOKENS, NUM_DELAY_TOKENS, AUDIO_LENGTH_PER_TOK, OFFLINE_STREAMING_BUFFER_TOKENS, STREAMING_PAD_TOKEN_ID, VoxtralRealtimeProcessor, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM, WhisperProcessor, AutoProcessor, PretrainedConfig, AutoConfig, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, MaskedLMOutput, QuestionAnsweringModelOutput, CausalLMOutput, ImageMattingOutput, LogitsProcessor, LogitsWarper, LogitsProcessorList, ForcedBOSTokenLogitsProcessor, ForcedEOSTokenLogitsProcessor, SuppressTokensLogitsProcessor, SuppressTokensAtBeginLogitsProcessor, WhisperTimeStampLogitsProcessor, NoRepeatNGramLogitsProcessor, RepetitionPenaltyLogitsProcessor, MinLengthLogitsProcessor, MinNewTokensLengthLogitsProcessor, NoBadWordsLogitsProcessor, ClassifierFreeGuidanceLogitsProcessor, TemperatureLogitsWarper, TopPLogitsWarper, TopKLogitsWarper, GenerationConfig, StoppingCriteria, StoppingCriteriaList, MaxLengthCriteria, EosTokenCriteria, InterruptableStoppingCriteria, LogitsSampler, GreedySampler, MultinomialSampler, BeamSearchSampler, _DynamicCache, DynamicCache, MODEL_TYPES, MODEL_SESSION_CONFIG, MODEL_MAPPING_NAMES, MODEL_RUNTIME_CONFIG, MODEL_TYPE_MAPPING, MODEL_NAME_TO_CLASS_MAPPING, MODEL_CLASS_TO_NAME_MAPPING, PreTrainedModel, models_exports, AlbertPreTrainedModel, AlbertModel, AlbertForSequenceClassification, AlbertForQuestionAnswering, AlbertForMaskedLM, ApertusPreTrainedModel, ApertusModel, ApertusForCausalLM, AfmoePreTrainedModel, AfmoeModel, AfmoeForCausalLM, ArceePreTrainedModel, ArceeModel, ArceeForCausalLM, ASTPreTrainedModel, ASTModel, ASTForAudioClassification, BartPretrainedModel, BartModel, BartForConditionalGeneration, BartForSequenceClassification, BeitPreTrainedModel, BeitModel, BeitForImageClassification, BertPreTrainedModel, BertModel, BertForMaskedLM, BertForSequenceClassification, BertForTokenClassification, BertForQuestionAnswering, BlenderbotPreTrainedModel, BlenderbotModel, BlenderbotForConditionalGeneration, BlenderbotSmallPreTrainedModel, BlenderbotSmallModel, BlenderbotSmallForConditionalGeneration, BloomPreTrainedModel, BloomModel, BloomForCausalLM, CamembertPreTrainedModel, CamembertModel, CamembertForMaskedLM, CamembertForSequenceClassification, CamembertForTokenClassification, CamembertForQuestionAnswering, SILENCE_TOKEN, START_SPEECH_TOKEN, ChatterboxPreTrainedModel, ChatterboxModel, ChineseCLIPPreTrainedModel, ChineseCLIPModel, CHMv2PreTrainedModel, CHMv2ForDepthEstimation, ClapPreTrainedModel, ClapModel, ClapTextModelWithProjection, ClapAudioModelWithProjection, CLIPPreTrainedModel, CLIPModel, CLIPTextModel, CLIPTextModelWithProjection, CLIPVisionModel, CLIPVisionModelWithProjection, CLIPSegPreTrainedModel, CLIPSegModel, CLIPSegForImageSegmentation, CodeGenPreTrainedModel, CodeGenModel, CodeGenForCausalLM, CoherePreTrainedModel, CohereModel, CohereForCausalLM, Cohere2PreTrainedModel, Cohere2Model, Cohere2ForCausalLM, CohereAsrPreTrainedModel, CohereAsrModel, CohereAsrForConditionalGeneration, ConvBertPreTrainedModel, ConvBertModel, ConvBertForMaskedLM, ConvBertForSequenceClassification, ConvBertForTokenClassification, ConvBertForQuestionAnswering, ConvNextPreTrainedModel, ConvNextModel, ConvNextForImageClassification, ConvNextV2PreTrainedModel, ConvNextV2Model, ConvNextV2ForImageClassification, RTDetrPreTrainedModel, RTDetrModel, RTDetrForObjectDetection, RTDetrObjectDetectionOutput, DFinePreTrainedModel, DFineModel, DFineForObjectDetection, DacEncoderOutput, DacDecoderOutput, DacPreTrainedModel, DacModel, DacEncoderModel, DacDecoderModel, DebertaPreTrainedModel, DebertaModel, DebertaForMaskedLM, DebertaForSequenceClassification, DebertaForTokenClassification, DebertaForQuestionAnswering, DeepseekV3PreTrainedModel, DeepseekV3Model, DeepseekV3ForCausalLM, DebertaV2PreTrainedModel, DebertaV2Model, DebertaV2ForMaskedLM, DebertaV2ForSequenceClassification, DebertaV2ForTokenClassification, DebertaV2ForQuestionAnswering, DecisionTransformerPreTrainedModel, DecisionTransformerModel, DeiTPreTrainedModel, DeiTModel, DeiTForImageClassification, DepthAnythingPreTrainedModel, DepthAnythingForDepthEstimation, DepthProPreTrainedModel, DepthProForDepthEstimation, DetrPreTrainedModel, DetrModel, DetrForObjectDetection, DetrForSegmentation, DetrObjectDetectionOutput, DetrSegmentationOutput, Dinov2PreTrainedModel, Dinov2Model, Dinov2ForImageClassification, Dinov2WithRegistersPreTrainedModel, Dinov2WithRegistersModel, Dinov2WithRegistersForImageClassification, DINOv3ConvNextPreTrainedModel, DINOv3ConvNextModel, DINOv3ViTPreTrainedModel, DINOv3ViTModel, DistilBertPreTrainedModel, DistilBertModel, DistilBertForSequenceClassification, DistilBertForTokenClassification, DistilBertForQuestionAnswering, DistilBertForMaskedLM, DonutSwinPreTrainedModel, DonutSwinModel, DPTPreTrainedModel, DPTModel, DPTForDepthEstimation, EfficientNetPreTrainedModel, EfficientNetModel, EfficientNetForImageClassification, ElectraPreTrainedModel, ElectraModel, ElectraForMaskedLM, ElectraForSequenceClassification, ElectraForTokenClassification, ElectraForQuestionAnswering, Ernie4_5PretrainedModel, Ernie4_5Model, Ernie4_5ForCausalLM, EsmPreTrainedModel, EsmModel, EsmForMaskedLM, EsmForSequenceClassification, EsmForTokenClassification, EuroBertPreTrainedModel, EuroBertModel, EuroBertForMaskedLM, EuroBertForSequenceClassification, EuroBertForTokenClassification, ExaonePreTrainedModel, ExaoneModel, ExaoneForCausalLM, FalconPreTrainedModel, FalconModel, FalconForCausalLM, FalconH1PreTrainedModel, FalconH1Model, FalconH1ForCausalLM, FastViTPreTrainedModel, FastViTModel, FastViTForImageClassification, Florence2PreTrainedModel, Florence2ForConditionalGeneration, GemmaPreTrainedModel, GemmaModel, GemmaForCausalLM, Gemma2PreTrainedModel, Gemma2Model, Gemma2ForCausalLM, LlavaPreTrainedModel, LlavaForConditionalGeneration, Moondream1ForConditionalGeneration, LlavaQwen2ForCausalLM, Gemma3PreTrainedModel, Gemma3Model, Gemma3ForConditionalGeneration, Gemma3ForCausalLM, Gemma3nPreTrainedModel, Gemma3nForConditionalGeneration, Gemma3nForCausalLM, Gemma4ForConditionalGeneration, Gemma4ForCausalLM, GlmPreTrainedModel, GlmModel, GlmForCausalLM, GlmMoeDsaPreTrainedModel, GlmMoeDsaModel, GlmMoeDsaForCausalLM, Qwen2VLPreTrainedModel, Qwen2VLForConditionalGeneration, Qwen2VLForCausalLM, Qwen2_5_VLForConditionalGeneration, Qwen2_5_VLForCausalLM, GlmOcrForConditionalGeneration, GLPNPreTrainedModel, GLPNModel, GLPNForDepthEstimation, GPTBigCodePreTrainedModel, GPTBigCodeModel, GPTBigCodeForCausalLM, GPTNeoPreTrainedModel, GPTNeoModel, GPTNeoForCausalLM, GPTNeoXPreTrainedModel, GPTNeoXModel, GPTNeoXForCausalLM, GptOssPreTrainedModel, GptOssModel, GptOssForCausalLM, GPT2PreTrainedModel, GPT2Model, GPT2LMHeadModel, GPTJPreTrainedModel, GPTJModel, GPTJForCausalLM, GranitePreTrainedModel, GraniteModel, GraniteForCausalLM, GraniteMoeHybridPreTrainedModel, GraniteMoeHybridModel, GraniteMoeHybridForCausalLM, UltravoxPreTrainedModel, UltravoxModel, GraniteSpeechForConditionalGeneration, GroundingDinoPreTrainedModel, GroundingDinoForObjectDetection, GroupViTPreTrainedModel, GroupViTModel, HeliumPreTrainedModel, HeliumModel, HeliumForCausalLM, HieraPreTrainedModel, HieraModel, HieraForImageClassification, Wav2Vec2PreTrainedModel, Wav2Vec2Model, Wav2Vec2ForCTC, Wav2Vec2ForSequenceClassification, Wav2Vec2ForAudioFrameClassification, HubertPreTrainedModel, HubertModel, HubertForCTC, HubertForSequenceClassification, HunYuanDenseV1PreTrainedModel, HunYuanDenseV1Model, HunYuanDenseV1ForCausalLM, Idefics3ForConditionalGeneration, IJepaPreTrainedModel, IJepaModel, IJepaForImageClassification, JAISPreTrainedModel, JAISModel, JAISLMHeadModel, JinaCLIPPreTrainedModel, JinaCLIPModel, JinaCLIPTextModel, JinaCLIPVisionModel, Lfm2PreTrainedModel, Lfm2Model, Lfm2ForCausalLM, LightOnOcrForConditionalGeneration, Lfm2MoePreTrainedModel, Lfm2MoeModel, Lfm2MoeForCausalLM, Lfm2VlForConditionalGeneration, LlamaPreTrainedModel, LlamaModel, LlamaForCausalLM, Llama4PreTrainedModel, Llama4ForCausalLM, LongT5PreTrainedModel, LongT5Model, LongT5ForConditionalGeneration, M2M100PreTrainedModel, M2M100Model, M2M100ForConditionalGeneration, MarianPreTrainedModel, MarianModel, MarianMTModel, MaskFormerPreTrainedModel, MaskFormerModel, MaskFormerForInstanceSegmentation, MBartPreTrainedModel, MBartModel, MBartForConditionalGeneration, MBartForSequenceClassification, MBartForCausalLM, Metric3DPreTrainedModel, Metric3DForDepthEstimation, Metric3Dv2PreTrainedModel, Metric3Dv2ForDepthEstimation, MgpstrModelOutput, MgpstrPreTrainedModel, MgpstrForSceneTextRecognition, MimiEncoderOutput, MimiDecoderOutput, MimiPreTrainedModel, MimiModel, MimiEncoderModel, MimiDecoderModel, MistralPreTrainedModel, MistralModel, MistralForCausalLM, Mistral4PreTrainedModel, Mistral4Model, Mistral4ForCausalLM, MobileBertPreTrainedModel, MobileBertModel, MobileBertForMaskedLM, MobileBertForSequenceClassification, MobileBertForQuestionAnswering, MobileLLMPreTrainedModel, MobileLLMModel, MobileLLMForCausalLM, MobileNetV1PreTrainedModel, MobileNetV1Model, MobileNetV1ForImageClassification, MobileNetV1ForSemanticSegmentation, MobileNetV2PreTrainedModel, MobileNetV2Model, MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV3PreTrainedModel, MobileNetV3Model, MobileNetV3ForImageClassification, MobileNetV3ForSemanticSegmentation, MobileNetV4PreTrainedModel, MobileNetV4Model, MobileNetV4ForImageClassification, MobileNetV4ForSemanticSegmentation, MobileViTPreTrainedModel, MobileViTModel, MobileViTForImageClassification, MobileViTV2PreTrainedModel, MobileViTV2Model, MobileViTV2ForImageClassification, ModernBertPreTrainedModel, ModernBertModel, ModernBertForMaskedLM, ModernBertForSequenceClassification, ModernBertForTokenClassification, ModernBertDecoderPreTrainedModel, ModernBertDecoderModel, ModernBertDecoderForCausalLM, MoonshinePreTrainedModel, MoonshineModel, MoonshineForConditionalGeneration, MPNetPreTrainedModel, MPNetModel, MPNetForMaskedLM, MPNetForSequenceClassification, MPNetForTokenClassification, MPNetForQuestionAnswering, MptPreTrainedModel, MptModel, MptForCausalLM, MT5PreTrainedModel, MT5Model, MT5ForConditionalGeneration, MultiModalityPreTrainedModel, MultiModalityCausalLM, MusicgenPreTrainedModel, MusicgenModel, MusicgenForCausalLM, MusicgenForConditionalGeneration, NanoChatPreTrainedModel, NanoChatModel, NanoChatForCausalLM, NemotronHPreTrainedModel, NemotronHModel, NemotronHForCausalLM, NeoBertPreTrainedModel, NeoBertModel, NeoBertForMaskedLM, NeoBertForSequenceClassification, NeoBertForTokenClassification, NeoBertForQuestionAnswering, NomicBertPreTrainedModel, NomicBertModel, OlmoPreTrainedModel, OlmoModel, OlmoForCausalLM, Olmo2PreTrainedModel, Olmo2Model, Olmo2ForCausalLM, Olmo3PreTrainedModel, Olmo3Model, Olmo3ForCausalLM, OlmoHybridPreTrainedModel, OlmoHybridModel, OlmoHybridForCausalLM, OpenELMPreTrainedModel, OpenELMModel, OpenELMForCausalLM, OPTPreTrainedModel, OPTModel, OPTForCausalLM, Owlv2PreTrainedModel, Owlv2Model, Owlv2ForObjectDetection, OwlViTPreTrainedModel, OwlViTModel, OwlViTForObjectDetection, PaliGemmaForConditionalGeneration, ParakeetPreTrainedModel, ParakeetForCTC, PatchTSMixerPreTrainedModel, PatchTSMixerModel, PatchTSMixerForPrediction, PatchTSTPreTrainedModel, PatchTSTModel, PatchTSTForPrediction, PhiPreTrainedModel, PhiModel, PhiForCausalLM, Phi3PreTrainedModel, Phi3Model, Phi3ForCausalLM, Phi3VPreTrainedModel, Phi3VForCausalLM, PvtPreTrainedModel, PvtModel, PvtForImageClassification, PyAnnotePreTrainedModel, PyAnnoteModel, PyAnnoteForAudioFrameClassification, Qwen2PreTrainedModel, Qwen2Model, Qwen2ForCausalLM, Qwen2MoePreTrainedModel, Qwen2MoeModel, Qwen2MoeForCausalLM, Qwen3PreTrainedModel, Qwen3Model, Qwen3ForCausalLM, Qwen3MoePreTrainedModel, Qwen3MoeModel, Qwen3MoeForCausalLM, Qwen3NextPreTrainedModel, Qwen3NextModel, Qwen3NextForCausalLM, Qwen3VLForConditionalGeneration, Qwen3VLForCausalLM, Qwen3VLMoeForConditionalGeneration, Qwen3VLMoeForCausalLM, Qwen3_5ForConditionalGeneration, Qwen3_5ForCausalLM, Qwen3_5MoeForConditionalGeneration, Qwen3_5MoeForCausalLM, ResNetPreTrainedModel, ResNetModel, ResNetForImageClassification, RFDetrPreTrainedModel, RFDetrModel, RFDetrForObjectDetection, RFDetrObjectDetectionOutput, RobertaPreTrainedModel, RobertaModel, RobertaForMaskedLM, RobertaForSequenceClassification, RobertaForTokenClassification, RobertaForQuestionAnswering, RoFormerPreTrainedModel, RoFormerModel, RoFormerForMaskedLM, RoFormerForSequenceClassification, RoFormerForTokenClassification, RoFormerForQuestionAnswering, RTDetrV2PreTrainedModel, RTDetrV2Model, RTDetrV2ForObjectDetection, RTDetrV2ObjectDetectionOutput, SamImageSegmentationOutput, SamPreTrainedModel, SamModel, Sam2ImageSegmentationOutput, Sam2PreTrainedModel, Sam2Model, EdgeTamModel, Sam3TrackerModel, SapiensPreTrainedModel, SapiensForSemanticSegmentation, SapiensForDepthEstimation, SapiensForNormalEstimation, SegformerPreTrainedModel, SegformerModel, SegformerForImageClassification, SegformerForSemanticSegmentation, SiglipPreTrainedModel, SiglipModel, SiglipTextModel, SiglipVisionModel, SmolLM3PreTrainedModel, SmolLM3Model, SmolLM3ForCausalLM, SmolVLMForConditionalGeneration, SnacPreTrainedModel, SnacModel, SnacEncoderModel, SnacDecoderModel, SolarOpenPreTrainedModel, SolarOpenModel, SolarOpenForCausalLM, SpeechT5PreTrainedModel, SpeechT5Model, SpeechT5ForSpeechToText, SpeechT5ForTextToSpeech, SpeechT5HifiGan, SqueezeBertPreTrainedModel, SqueezeBertModel, SqueezeBertForMaskedLM, SqueezeBertForSequenceClassification, SqueezeBertForQuestionAnswering, StableLmPreTrainedModel, StableLmModel, StableLmForCausalLM, Starcoder2PreTrainedModel, Starcoder2Model, Starcoder2ForCausalLM, StyleTextToSpeech2PreTrainedModel, StyleTextToSpeech2Model, SupertonicPreTrainedModel, SupertonicForConditionalGeneration, SwinPreTrainedModel, SwinModel, SwinForImageClassification, SwinForSemanticSegmentation, Swin2SRPreTrainedModel, Swin2SRModel, Swin2SRForImageSuperResolution, T5PreTrainedModel, T5Model, T5ForConditionalGeneration, TableTransformerPreTrainedModel, TableTransformerModel, TableTransformerForObjectDetection, TableTransformerObjectDetectionOutput, TrOCRPreTrainedModel, TrOCRForCausalLM, UniSpeechPreTrainedModel, UniSpeechModel, UniSpeechForCTC, UniSpeechForSequenceClassification, UniSpeechSatPreTrainedModel, UniSpeechSatModel, UniSpeechSatForCTC, UniSpeechSatForSequenceClassification, UniSpeechSatForAudioFrameClassification, VaultGemmaPreTrainedModel, VaultGemmaModel, VaultGemmaForCausalLM, VisionEncoderDecoderModel, ViTPreTrainedModel, ViTModel, ViTForImageClassification, ViTMAEPreTrainedModel, ViTMAEModel, ViTMSNPreTrainedModel, ViTMSNModel, ViTMSNForImageClassification, VitMattePreTrainedModel, VitMatteForImageMatting, VitPosePreTrainedModel, VitPoseForPoseEstimation, VitsModelOutput, VitsPreTrainedModel, VitsModel, VoxtralForConditionalGeneration, CONV1_LEFT_PAD, CONV2_LEFT_PAD, states, AudioExhaustedCriteria, VoxtralRealtimePreTrainedModel, VoxtralRealtimeForConditionalGeneration, Wav2Vec2BertPreTrainedModel, Wav2Vec2BertModel, Wav2Vec2BertForCTC, Wav2Vec2BertForSequenceClassification, XVectorOutput, WavLMPreTrainedModel, WavLMModel, WavLMForCTC, WavLMForSequenceClassification, WavLMForXVector, WavLMForAudioFrameClassification, WeSpeakerResNetPreTrainedModel, WeSpeakerResNetModel, WhisperGenerationConfig, WhisperPreTrainedModel, WhisperModel, WhisperForConditionalGeneration, LiteWhisperForConditionalGeneration, XLMPreTrainedModel, XLMModel, XLMWithLMHeadModel, XLMForSequenceClassification, XLMForTokenClassification, XLMForQuestionAnswering, XLMRobertaPreTrainedModel, XLMRobertaModel, XLMRobertaForMaskedLM, XLMRobertaForSequenceClassification, XLMRobertaForTokenClassification, XLMRobertaForQuestionAnswering, YolosPreTrainedModel, YolosModel, YolosForObjectDetection, YolosObjectDetectionOutput, YoutuPreTrainedModel, YoutuModel, YoutuForCausalLM, MODEL_MAPPING_NAMES_ENCODER_ONLY, MODEL_MAPPING_NAMES_ENCODER_DECODER, MODEL_MAPPING_NAMES_AUTO_ENCODER, MODEL_MAPPING_NAMES_DECODER_ONLY, MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES, MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES, MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES, MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES, MODEL_FOR_CAUSAL_LM_MAPPING_NAMES, MODEL_FOR_MULTIMODALITY_MAPPING_NAMES, MODEL_FOR_MASKED_LM_MAPPING_NAMES, MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES, MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES, MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES, MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES, MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES, MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES, MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES, MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES, MODEL_FOR_MASK_GENERATION_MAPPING_NAMES, MODEL_FOR_CTC_MAPPING_NAMES, MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES, MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES, MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES, MODEL_FOR_TIME_SERIES_PREDICTION_MAPPING_NAMES, MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES, MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES, MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES, MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES, MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES, MODEL_CLASS_TYPE_MAPPING, CUSTOM_MAPPING, CUSTOM_ARCHITECTURES_MAPPING, CUSTOM_ARCHITECTURES, MODEL_MAPPINGS, PretrainedMixin, AutoModel, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoModelForSeq2SeqLM, AutoModelForSpeechSeq2Seq, AutoModelForTextToSpectrogram, AutoModelForTextToWaveform, AutoModelForCausalLM, AutoModelForMaskedLM, AutoModelForQuestionAnswering, AutoModelForVision2Seq, AutoModelForImageClassification, AutoModelForImageSegmentation, AutoModelForSemanticSegmentation, AutoModelForUniversalSegmentation, AutoModelForObjectDetection, AutoModelForZeroShotObjectDetection, AutoModelForMaskGeneration, AutoModelForCTC, AutoModelForAudioClassification, AutoModelForXVector, AutoModelForAudioFrameClassification, AutoModelForDocumentQuestionAnswering, AutoModelForImageMatting, AutoModelForImageToImage, AutoModelForDepthEstimation, AutoModelForNormalEstimation, AutoModelForPoseEstimation, AutoModelForImageFeatureExtraction, AutoModelForImageTextToText, AutoModelForAudioTextToText, Pipeline, TextClassificationPipeline, TokenClassificationPipeline, QuestionAnsweringPipeline, FillMaskPipeline, Text2TextGenerationPipeline, SummarizationPipeline, TranslationPipeline, TextGenerationPipeline, ZeroShotClassificationPipeline, AudioClassificationPipeline, ZeroShotAudioClassificationPipeline, AutomaticSpeechRecognitionPipeline, TextToAudioPipeline, ImageToTextPipeline, ImageClassificationPipeline, SUBTASKS_MAPPING, ImageSegmentationPipeline, BackgroundRemovalPipeline, ZeroShotImageClassificationPipeline, ObjectDetectionPipeline, ZeroShotObjectDetectionPipeline, DocumentQuestionAnsweringPipeline, ImageToImagePipeline, DepthEstimationPipeline, FeatureExtractionPipeline, ImageFeatureExtractionPipeline, SUPPORTED_TASKS, TASK_ALIASES, is_chinese_char2, BaseStreamer, stdout_write, TextStreamer, WhisperTextStreamer, RawVideoFrame, RawVideo, CONCRETE_DTYPES, ModelRegistry;
|
|
17155
17209
|
var init_transformers_node = __esm({
|
|
17156
17210
|
"node_modules/@huggingface/transformers/dist/transformers.node.mjs"() {
|
|
17157
17211
|
"use strict";
|
|
@@ -17169,7 +17223,7 @@ var init_transformers_node = __esm({
|
|
|
17169
17223
|
for (var name in all)
|
|
17170
17224
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
17171
17225
|
};
|
|
17172
|
-
VERSION = "4.0
|
|
17226
|
+
VERSION = "4.1.0";
|
|
17173
17227
|
HAS_SELF = typeof self !== "undefined";
|
|
17174
17228
|
IS_FS_AVAILABLE = !isEmpty(fs2);
|
|
17175
17229
|
IS_PATH_AVAILABLE = !isEmpty(path3);
|
|
@@ -22524,21 +22578,21 @@ var init_transformers_node = __esm({
|
|
|
22524
22578
|
})();
|
|
22525
22579
|
ort_webgpu_bundle_min_exports = {};
|
|
22526
22580
|
__export2(ort_webgpu_bundle_min_exports, {
|
|
22527
|
-
InferenceSession: () =>
|
|
22528
|
-
TRACE: () =>
|
|
22581
|
+
InferenceSession: () => qf,
|
|
22582
|
+
TRACE: () => Ga,
|
|
22529
22583
|
TRACE_EVENT_BEGIN: () => $e,
|
|
22530
22584
|
TRACE_EVENT_END: () => ze,
|
|
22531
22585
|
TRACE_FUNC_BEGIN: () => tt,
|
|
22532
22586
|
TRACE_FUNC_END: () => rt,
|
|
22533
22587
|
Tensor: () => Le,
|
|
22534
|
-
default: () =>
|
|
22588
|
+
default: () => gl,
|
|
22535
22589
|
env: () => K,
|
|
22536
22590
|
registerBackend: () => Ke
|
|
22537
22591
|
});
|
|
22538
22592
|
jr = Object.defineProperty;
|
|
22539
|
-
|
|
22540
|
-
|
|
22541
|
-
|
|
22593
|
+
zf = Object.getOwnPropertyDescriptor;
|
|
22594
|
+
Vf = Object.getOwnPropertyNames;
|
|
22595
|
+
jf = Object.prototype.hasOwnProperty;
|
|
22542
22596
|
Hr = ((a) => typeof __require2 < "u" ? __require2 : typeof Proxy < "u" ? new Proxy(a, { get: (r, s) => (typeof __require2 < "u" ? __require2 : r)[s] }) : a)(function(a) {
|
|
22543
22597
|
if (typeof __require2 < "u") return __require2.apply(this, arguments);
|
|
22544
22598
|
throw Error('Dynamic require of "' + a + '" is not supported');
|
|
@@ -22547,11 +22601,11 @@ var init_transformers_node = __esm({
|
|
|
22547
22601
|
At = (a, r) => {
|
|
22548
22602
|
for (var s in r) jr(a, s, { get: r[s], enumerable: true });
|
|
22549
22603
|
};
|
|
22550
|
-
|
|
22551
|
-
if (r && typeof r == "object" || typeof r == "function") for (let i of
|
|
22604
|
+
Hf = (a, r, s, f) => {
|
|
22605
|
+
if (r && typeof r == "object" || typeof r == "function") for (let i of Vf(r)) !jf.call(a, i) && i !== s && jr(a, i, { get: () => r[i], enumerable: !(f = zf(r, i)) || f.enumerable });
|
|
22552
22606
|
return a;
|
|
22553
22607
|
};
|
|
22554
|
-
$t = (a) =>
|
|
22608
|
+
$t = (a) => Hf(jr({}, "__esModule", { value: true }), a);
|
|
22555
22609
|
Yr = k(() => {
|
|
22556
22610
|
"use strict";
|
|
22557
22611
|
zt = /* @__PURE__ */ new Map(), Ze = [], Ke = (a, r, s) => {
|
|
@@ -22565,8 +22619,8 @@ var init_transformers_node = __esm({
|
|
|
22565
22619
|
if (s >= 0) {
|
|
22566
22620
|
let i = Ze.indexOf(a);
|
|
22567
22621
|
i !== -1 && Ze.splice(i, 1);
|
|
22568
|
-
for (let
|
|
22569
|
-
Ze.splice(
|
|
22622
|
+
for (let d = 0; d < Ze.length; d++) if (zt.get(Ze[d]).priority <= s) {
|
|
22623
|
+
Ze.splice(d, 0, a);
|
|
22570
22624
|
return;
|
|
22571
22625
|
}
|
|
22572
22626
|
Ze.push(a);
|
|
@@ -22574,7 +22628,7 @@ var init_transformers_node = __esm({
|
|
|
22574
22628
|
return;
|
|
22575
22629
|
}
|
|
22576
22630
|
throw new TypeError("not a valid backend");
|
|
22577
|
-
},
|
|
22631
|
+
}, Yf = async (a) => {
|
|
22578
22632
|
let r = zt.get(a);
|
|
22579
22633
|
if (!r) return "backend not found.";
|
|
22580
22634
|
if (r.initialized) return r.backend;
|
|
@@ -22589,95 +22643,95 @@ var init_transformers_node = __esm({
|
|
|
22589
22643
|
delete r.initPromise;
|
|
22590
22644
|
}
|
|
22591
22645
|
}
|
|
22592
|
-
},
|
|
22593
|
-
let r = a.executionProviders || [], s = r.map((y) => typeof y == "string" ? y : y.name), f = s.length === 0 ? Ze : s, i,
|
|
22646
|
+
}, Ta = async (a) => {
|
|
22647
|
+
let r = a.executionProviders || [], s = r.map((y) => typeof y == "string" ? y : y.name), f = s.length === 0 ? Ze : s, i, d = [], l = /* @__PURE__ */ new Set();
|
|
22594
22648
|
for (let y of f) {
|
|
22595
|
-
let w = await
|
|
22596
|
-
typeof w == "string" ?
|
|
22649
|
+
let w = await Yf(y);
|
|
22650
|
+
typeof w == "string" ? d.push({ name: y, err: w }) : (i || (i = w), i === w && l.add(y));
|
|
22597
22651
|
}
|
|
22598
|
-
if (!i) throw new Error(`no available backend found. ERR: ${
|
|
22599
|
-
for (let { name: y, err: w } of
|
|
22600
|
-
let m = r.filter((y) =>
|
|
22652
|
+
if (!i) throw new Error(`no available backend found. ERR: ${d.map((y) => `[${y.name}] ${y.err}`).join(", ")}`);
|
|
22653
|
+
for (let { name: y, err: w } of d) s.includes(y) && console.warn(`removing requested execution provider "${y}" from session options because it is not available: ${w}`);
|
|
22654
|
+
let m = r.filter((y) => l.has(typeof y == "string" ? y : y.name));
|
|
22601
22655
|
return [i, new Proxy(a, { get: (y, w) => w === "executionProviders" ? m : Reflect.get(y, w) })];
|
|
22602
22656
|
};
|
|
22603
22657
|
});
|
|
22604
|
-
|
|
22658
|
+
va = k(() => {
|
|
22605
22659
|
"use strict";
|
|
22606
22660
|
Yr();
|
|
22607
22661
|
});
|
|
22608
|
-
|
|
22662
|
+
Sa = k(() => {
|
|
22609
22663
|
"use strict";
|
|
22610
|
-
|
|
22664
|
+
Ea = "1.24.0-dev.20251116-b39e144322";
|
|
22611
22665
|
});
|
|
22612
22666
|
qr = k(() => {
|
|
22613
22667
|
"use strict";
|
|
22614
|
-
|
|
22615
|
-
|
|
22668
|
+
Sa();
|
|
22669
|
+
Aa = "warning", ie = { wasm: {}, webgl: {}, webgpu: {}, versions: { common: Ea }, set logLevel(a) {
|
|
22616
22670
|
if (a !== void 0) {
|
|
22617
22671
|
if (typeof a != "string" || ["verbose", "info", "warning", "error", "fatal"].indexOf(a) === -1) throw new Error(`Unsupported logging level: ${a}`);
|
|
22618
|
-
|
|
22672
|
+
Aa = a;
|
|
22619
22673
|
}
|
|
22620
22674
|
}, get logLevel() {
|
|
22621
|
-
return
|
|
22675
|
+
return Aa;
|
|
22622
22676
|
} };
|
|
22623
22677
|
Object.defineProperty(ie, "logLevel", { enumerable: true });
|
|
22624
22678
|
});
|
|
22625
|
-
|
|
22679
|
+
Ia = k(() => {
|
|
22626
22680
|
"use strict";
|
|
22627
22681
|
qr();
|
|
22628
22682
|
K = ie;
|
|
22629
22683
|
});
|
|
22630
|
-
|
|
22684
|
+
Oa = k(() => {
|
|
22631
22685
|
"use strict";
|
|
22632
|
-
|
|
22686
|
+
xa = (a, r) => {
|
|
22633
22687
|
let s = typeof document < "u" ? document.createElement("canvas") : new OffscreenCanvas(1, 1);
|
|
22634
22688
|
s.width = a.dims[3], s.height = a.dims[2];
|
|
22635
22689
|
let f = s.getContext("2d");
|
|
22636
22690
|
if (f != null) {
|
|
22637
|
-
let i,
|
|
22638
|
-
r?.tensorLayout !== void 0 && r.tensorLayout === "NHWC" ? (i = a.dims[2],
|
|
22639
|
-
let
|
|
22691
|
+
let i, d;
|
|
22692
|
+
r?.tensorLayout !== void 0 && r.tensorLayout === "NHWC" ? (i = a.dims[2], d = a.dims[3]) : (i = a.dims[3], d = a.dims[2]);
|
|
22693
|
+
let l = r?.format !== void 0 ? r.format : "RGB", m = r?.norm, y, w;
|
|
22640
22694
|
m === void 0 || m.mean === void 0 ? y = [255, 255, 255, 255] : typeof m.mean == "number" ? y = [m.mean, m.mean, m.mean, m.mean] : (y = [m.mean[0], m.mean[1], m.mean[2], 0], m.mean[3] !== void 0 && (y[3] = m.mean[3])), m === void 0 || m.bias === void 0 ? w = [0, 0, 0, 0] : typeof m.bias == "number" ? w = [m.bias, m.bias, m.bias, m.bias] : (w = [m.bias[0], m.bias[1], m.bias[2], 0], m.bias[3] !== void 0 && (w[3] = m.bias[3]));
|
|
22641
|
-
let T =
|
|
22642
|
-
|
|
22643
|
-
for (let R = 0; R <
|
|
22644
|
-
let U = (a.data[g++] - w[0]) * y[0], M = (a.data[v++] - w[1]) * y[1], Y = (a.data[S++] - w[2]) * y[2],
|
|
22645
|
-
f.fillStyle = "rgba(" + U + "," + M + "," + Y + "," +
|
|
22695
|
+
let T = d * i, g = 0, v = T, S = T * 2, C = -1;
|
|
22696
|
+
l === "RGBA" ? (g = 0, v = T, S = T * 2, C = T * 3) : l === "RGB" ? (g = 0, v = T, S = T * 2) : l === "RBG" && (g = 0, S = T, v = T * 2);
|
|
22697
|
+
for (let R = 0; R < d; R++) for (let H = 0; H < i; H++) {
|
|
22698
|
+
let U = (a.data[g++] - w[0]) * y[0], M = (a.data[v++] - w[1]) * y[1], Y = (a.data[S++] - w[2]) * y[2], O = C === -1 ? 255 : (a.data[C++] - w[3]) * y[3];
|
|
22699
|
+
f.fillStyle = "rgba(" + U + "," + M + "," + Y + "," + O + ")", f.fillRect(H, R, 1, 1);
|
|
22646
22700
|
}
|
|
22647
22701
|
if ("toDataURL" in s) return s.toDataURL();
|
|
22648
22702
|
throw new Error("toDataURL is not supported");
|
|
22649
22703
|
} else throw new Error("Can not access image data");
|
|
22650
|
-
},
|
|
22704
|
+
}, La = (a, r) => {
|
|
22651
22705
|
let s = typeof document < "u" ? document.createElement("canvas").getContext("2d") : new OffscreenCanvas(1, 1).getContext("2d"), f;
|
|
22652
22706
|
if (s != null) {
|
|
22653
|
-
let i,
|
|
22654
|
-
r?.tensorLayout !== void 0 && r.tensorLayout === "NHWC" ? (i = a.dims[2],
|
|
22707
|
+
let i, d, l;
|
|
22708
|
+
r?.tensorLayout !== void 0 && r.tensorLayout === "NHWC" ? (i = a.dims[2], d = a.dims[1], l = a.dims[3]) : (i = a.dims[3], d = a.dims[2], l = a.dims[1]);
|
|
22655
22709
|
let m = r !== void 0 && r.format !== void 0 ? r.format : "RGB", y = r?.norm, w, T;
|
|
22656
22710
|
y === void 0 || y.mean === void 0 ? w = [255, 255, 255, 255] : typeof y.mean == "number" ? w = [y.mean, y.mean, y.mean, y.mean] : (w = [y.mean[0], y.mean[1], y.mean[2], 255], y.mean[3] !== void 0 && (w[3] = y.mean[3])), y === void 0 || y.bias === void 0 ? T = [0, 0, 0, 0] : typeof y.bias == "number" ? T = [y.bias, y.bias, y.bias, y.bias] : (T = [y.bias[0], y.bias[1], y.bias[2], 0], y.bias[3] !== void 0 && (T[3] = y.bias[3]));
|
|
22657
|
-
let g =
|
|
22658
|
-
if (r !== void 0 && (r.format !== void 0 &&
|
|
22659
|
-
let v = 4, S = 0, C = 1, R = 2, H = 3, U = 0, M = g, Y = g * 2,
|
|
22660
|
-
m === "RGBA" ? (U = 0, M = g, Y = g * 2,
|
|
22661
|
-
for (let W = 0; W <
|
|
22711
|
+
let g = d * i;
|
|
22712
|
+
if (r !== void 0 && (r.format !== void 0 && l === 4 && r.format !== "RGBA" || l === 3 && r.format !== "RGB" && r.format !== "BGR")) throw new Error("Tensor format doesn't match input tensor dims");
|
|
22713
|
+
let v = 4, S = 0, C = 1, R = 2, H = 3, U = 0, M = g, Y = g * 2, O = -1;
|
|
22714
|
+
m === "RGBA" ? (U = 0, M = g, Y = g * 2, O = g * 3) : m === "RGB" ? (U = 0, M = g, Y = g * 2) : m === "RBG" && (U = 0, Y = g, M = g * 2), f = s.createImageData(i, d);
|
|
22715
|
+
for (let W = 0; W < d * i; S += v, C += v, R += v, H += v, W++) f.data[S] = (a.data[U++] - T[0]) * w[0], f.data[C] = (a.data[M++] - T[1]) * w[1], f.data[R] = (a.data[Y++] - T[2]) * w[2], f.data[H] = O === -1 ? 255 : (a.data[O++] - T[3]) * w[3];
|
|
22662
22716
|
} else throw new Error("Can not access image data");
|
|
22663
22717
|
return f;
|
|
22664
22718
|
};
|
|
22665
22719
|
});
|
|
22666
|
-
|
|
22720
|
+
Pa = k(() => {
|
|
22667
22721
|
"use strict";
|
|
22668
22722
|
Vt();
|
|
22669
22723
|
Jr = (a, r) => {
|
|
22670
22724
|
if (a === void 0) throw new Error("Image buffer must be defined");
|
|
22671
22725
|
if (r.height === void 0 || r.width === void 0) throw new Error("Image height and width must be defined");
|
|
22672
22726
|
if (r.tensorLayout === "NHWC") throw new Error("NHWC Tensor layout is not supported yet");
|
|
22673
|
-
let { height: s, width: f } = r, i = r.norm ?? { mean: 255, bias: 0 },
|
|
22674
|
-
typeof i.mean == "number" ?
|
|
22727
|
+
let { height: s, width: f } = r, i = r.norm ?? { mean: 255, bias: 0 }, d, l;
|
|
22728
|
+
typeof i.mean == "number" ? d = [i.mean, i.mean, i.mean, i.mean] : d = [i.mean[0], i.mean[1], i.mean[2], i.mean[3] ?? 255], typeof i.bias == "number" ? l = [i.bias, i.bias, i.bias, i.bias] : l = [i.bias[0], i.bias[1], i.bias[2], i.bias[3] ?? 0];
|
|
22675
22729
|
let m = r.format !== void 0 ? r.format : "RGBA", y = r.tensorFormat !== void 0 && r.tensorFormat !== void 0 ? r.tensorFormat : "RGB", w = s * f, T = y === "RGBA" ? new Float32Array(w * 4) : new Float32Array(w * 3), g = 4, v = 0, S = 1, C = 2, R = 3, H = 0, U = w, M = w * 2, Y = -1;
|
|
22676
22730
|
m === "RGB" && (g = 3, v = 0, S = 1, C = 2, R = -1), y === "RGBA" ? Y = w * 3 : y === "RBG" ? (H = 0, M = w, U = w * 2) : y === "BGR" && (M = 0, U = w, H = w * 2);
|
|
22677
|
-
for (let W = 0; W < w; W++, v += g, C += g, S += g, R += g) T[H++] = (a[v] +
|
|
22731
|
+
for (let W = 0; W < w; W++, v += g, C += g, S += g, R += g) T[H++] = (a[v] + l[0]) / d[0], T[U++] = (a[S] + l[1]) / d[1], T[M++] = (a[C] + l[2]) / d[2], Y !== -1 && R !== -1 && (T[Y++] = (a[R] + l[3]) / d[3]);
|
|
22678
22732
|
return y === "RGBA" ? new le("float32", T, [1, 4, s, f]) : new le("float32", T, [1, 3, s, f]);
|
|
22679
|
-
},
|
|
22680
|
-
let s = typeof HTMLImageElement < "u" && a instanceof HTMLImageElement, f = typeof ImageData < "u" && a instanceof ImageData, i = typeof ImageBitmap < "u" && a instanceof ImageBitmap,
|
|
22733
|
+
}, Ba = async (a, r) => {
|
|
22734
|
+
let s = typeof HTMLImageElement < "u" && a instanceof HTMLImageElement, f = typeof ImageData < "u" && a instanceof ImageData, i = typeof ImageBitmap < "u" && a instanceof ImageBitmap, d = typeof a == "string", l, m = r ?? {}, y = () => {
|
|
22681
22735
|
if (typeof document < "u") return document.createElement("canvas");
|
|
22682
22736
|
if (typeof OffscreenCanvas < "u") return new OffscreenCanvas(1, 1);
|
|
22683
22737
|
throw new Error("Canvas is not supported");
|
|
@@ -22692,7 +22746,7 @@ var init_transformers_node = __esm({
|
|
|
22692
22746
|
if (m = r, r.tensorFormat !== void 0) throw new Error("Image input config format must be RGBA for HTMLImageElement");
|
|
22693
22747
|
m.tensorFormat = "RGBA", m.height = v, m.width = S;
|
|
22694
22748
|
} else m.tensorFormat = "RGBA", m.height = v, m.width = S;
|
|
22695
|
-
g.drawImage(a, 0, 0),
|
|
22749
|
+
g.drawImage(a, 0, 0), l = g.getImageData(0, 0, S, v).data;
|
|
22696
22750
|
} else throw new Error("Can not access image data");
|
|
22697
22751
|
} else if (f) {
|
|
22698
22752
|
let T, g;
|
|
@@ -22700,9 +22754,9 @@ var init_transformers_node = __esm({
|
|
|
22700
22754
|
let v = y();
|
|
22701
22755
|
v.width = g, v.height = T;
|
|
22702
22756
|
let S = w(v);
|
|
22703
|
-
if (S != null) S.putImageData(a, 0, 0),
|
|
22757
|
+
if (S != null) S.putImageData(a, 0, 0), l = S.getImageData(0, 0, g, T).data;
|
|
22704
22758
|
else throw new Error("Can not access image data");
|
|
22705
|
-
} else
|
|
22759
|
+
} else l = a.data;
|
|
22706
22760
|
} else if (i) {
|
|
22707
22761
|
if (r === void 0) throw new Error("Please provide image config with format for Imagebitmap");
|
|
22708
22762
|
let T = y();
|
|
@@ -22710,10 +22764,10 @@ var init_transformers_node = __esm({
|
|
|
22710
22764
|
let g = w(T);
|
|
22711
22765
|
if (g != null) {
|
|
22712
22766
|
let v = a.height, S = a.width;
|
|
22713
|
-
return g.drawImage(a, 0, 0, S, v),
|
|
22767
|
+
return g.drawImage(a, 0, 0, S, v), l = g.getImageData(0, 0, S, v).data, m.height = v, m.width = S, Jr(l, m);
|
|
22714
22768
|
} else throw new Error("Can not access image data");
|
|
22715
22769
|
} else {
|
|
22716
|
-
if (
|
|
22770
|
+
if (d) return new Promise((T, g) => {
|
|
22717
22771
|
let v = y(), S = w(v);
|
|
22718
22772
|
if (!a || !S) return g();
|
|
22719
22773
|
let C = new Image();
|
|
@@ -22725,33 +22779,33 @@ var init_transformers_node = __esm({
|
|
|
22725
22779
|
});
|
|
22726
22780
|
throw new Error("Input data provided is not supported - aborted tensor creation");
|
|
22727
22781
|
}
|
|
22728
|
-
if (
|
|
22782
|
+
if (l !== void 0) return Jr(l, m);
|
|
22729
22783
|
throw new Error("Input data provided is not supported - aborted tensor creation");
|
|
22784
|
+
}, Ma = (a, r) => {
|
|
22785
|
+
let { width: s, height: f, download: i, dispose: d } = r, l = [1, f, s, 4];
|
|
22786
|
+
return new le({ location: "texture", type: "float32", texture: a, dims: l, download: i, dispose: d });
|
|
22730
22787
|
}, Ca = (a, r) => {
|
|
22731
|
-
let {
|
|
22732
|
-
return new le({ location: "
|
|
22788
|
+
let { dataType: s, dims: f, download: i, dispose: d } = r;
|
|
22789
|
+
return new le({ location: "gpu-buffer", type: s ?? "float32", gpuBuffer: a, dims: f, download: i, dispose: d });
|
|
22733
22790
|
}, Ua = (a, r) => {
|
|
22734
|
-
let { dataType: s, dims: f, download: i, dispose:
|
|
22735
|
-
return new le({ location: "
|
|
22736
|
-
}, Da = (a, r) => {
|
|
22737
|
-
let { dataType: s, dims: f, download: i, dispose: l } = r;
|
|
22738
|
-
return new le({ location: "ml-tensor", type: s ?? "float32", mlTensor: a, dims: f, download: i, dispose: l });
|
|
22739
|
-
}, Pa = (a, r, s) => new le({ location: "cpu-pinned", type: a, data: r, dims: s ?? [r.length] });
|
|
22791
|
+
let { dataType: s, dims: f, download: i, dispose: d } = r;
|
|
22792
|
+
return new le({ location: "ml-tensor", type: s ?? "float32", mlTensor: a, dims: f, download: i, dispose: d });
|
|
22793
|
+
}, Da = (a, r, s) => new le({ location: "cpu-pinned", type: a, data: r, dims: s ?? [r.length] });
|
|
22740
22794
|
});
|
|
22741
|
-
|
|
22795
|
+
Na = k(() => {
|
|
22742
22796
|
"use strict";
|
|
22743
|
-
et = /* @__PURE__ */ new Map([["float32", Float32Array], ["uint8", Uint8Array], ["int8", Int8Array], ["uint16", Uint16Array], ["int16", Int16Array], ["int32", Int32Array], ["bool", Uint8Array], ["float64", Float64Array], ["uint32", Uint32Array], ["int4", Uint8Array], ["uint4", Uint8Array]]), It = /* @__PURE__ */ new Map([[Float32Array, "float32"], [Uint8Array, "uint8"], [Int8Array, "int8"], [Uint16Array, "uint16"], [Int16Array, "int16"], [Int32Array, "int32"], [Float64Array, "float64"], [Uint32Array, "uint32"]]),
|
|
22744
|
-
if (!
|
|
22745
|
-
|
|
22797
|
+
et = /* @__PURE__ */ new Map([["float32", Float32Array], ["uint8", Uint8Array], ["int8", Int8Array], ["uint16", Uint16Array], ["int16", Int16Array], ["int32", Int32Array], ["bool", Uint8Array], ["float64", Float64Array], ["uint32", Uint32Array], ["int4", Uint8Array], ["uint4", Uint8Array]]), It = /* @__PURE__ */ new Map([[Float32Array, "float32"], [Uint8Array, "uint8"], [Int8Array, "int8"], [Uint16Array, "uint16"], [Int16Array, "int16"], [Int32Array, "int32"], [Float64Array, "float64"], [Uint32Array, "uint32"]]), _a = false, Ra = () => {
|
|
22798
|
+
if (!_a) {
|
|
22799
|
+
_a = true;
|
|
22746
22800
|
let a = typeof BigInt64Array < "u" && BigInt64Array.from, r = typeof BigUint64Array < "u" && BigUint64Array.from, s = globalThis.Float16Array, f = typeof s < "u" && s.from;
|
|
22747
22801
|
a && (et.set("int64", BigInt64Array), It.set(BigInt64Array, "int64")), r && (et.set("uint64", BigUint64Array), It.set(BigUint64Array, "uint64")), f ? (et.set("float16", s), It.set(s, "float16")) : et.set("float16", Uint16Array);
|
|
22748
22802
|
}
|
|
22749
22803
|
};
|
|
22750
22804
|
});
|
|
22751
|
-
|
|
22805
|
+
Fa = k(() => {
|
|
22752
22806
|
"use strict";
|
|
22753
22807
|
Vt();
|
|
22754
|
-
|
|
22808
|
+
ka = (a) => {
|
|
22755
22809
|
let r = 1;
|
|
22756
22810
|
for (let s = 0; s < a.length; s++) {
|
|
22757
22811
|
let f = a[s];
|
|
@@ -22760,7 +22814,7 @@ var init_transformers_node = __esm({
|
|
|
22760
22814
|
r *= f;
|
|
22761
22815
|
}
|
|
22762
22816
|
return r;
|
|
22763
|
-
},
|
|
22817
|
+
}, Wa = (a, r) => {
|
|
22764
22818
|
switch (a.location) {
|
|
22765
22819
|
case "cpu":
|
|
22766
22820
|
return new le(a.type, a.data, r);
|
|
@@ -22779,15 +22833,15 @@ var init_transformers_node = __esm({
|
|
|
22779
22833
|
});
|
|
22780
22834
|
Vt = k(() => {
|
|
22781
22835
|
"use strict";
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
22836
|
+
Oa();
|
|
22837
|
+
Pa();
|
|
22838
|
+
Na();
|
|
22839
|
+
Fa();
|
|
22786
22840
|
le = class {
|
|
22787
22841
|
constructor(r, s, f) {
|
|
22788
|
-
|
|
22789
|
-
let i,
|
|
22790
|
-
if (typeof r == "object" && "location" in r) switch (this.dataLocation = r.location, i = r.type,
|
|
22842
|
+
Ra();
|
|
22843
|
+
let i, d;
|
|
22844
|
+
if (typeof r == "object" && "location" in r) switch (this.dataLocation = r.location, i = r.type, d = r.dims, r.location) {
|
|
22791
22845
|
case "cpu-pinned": {
|
|
22792
22846
|
let m = et.get(i);
|
|
22793
22847
|
if (!m) throw new TypeError(`unsupported type "${i}" to create tensor from pinned buffer`);
|
|
@@ -22844,32 +22898,32 @@ var init_transformers_node = __esm({
|
|
|
22844
22898
|
}
|
|
22845
22899
|
if (y === void 0) y = [m.length];
|
|
22846
22900
|
else if (!Array.isArray(y)) throw new TypeError("A tensor's dims must be a number array");
|
|
22847
|
-
|
|
22901
|
+
d = y, this.cpuData = m, this.dataLocation = "cpu";
|
|
22848
22902
|
}
|
|
22849
|
-
let
|
|
22850
|
-
if (this.cpuData &&
|
|
22851
|
-
this.type = i, this.dims =
|
|
22903
|
+
let l = ka(d);
|
|
22904
|
+
if (this.cpuData && l !== this.cpuData.length && !((i === "uint4" || i === "int4") && Math.ceil(l / 2) === this.cpuData.length)) throw new Error(`Tensor's size(${l}) does not match data length(${this.cpuData.length}).`);
|
|
22905
|
+
this.type = i, this.dims = d, this.size = l;
|
|
22852
22906
|
}
|
|
22853
22907
|
static async fromImage(r, s) {
|
|
22854
|
-
return
|
|
22908
|
+
return Ba(r, s);
|
|
22855
22909
|
}
|
|
22856
22910
|
static fromTexture(r, s) {
|
|
22857
|
-
return
|
|
22911
|
+
return Ma(r, s);
|
|
22858
22912
|
}
|
|
22859
22913
|
static fromGpuBuffer(r, s) {
|
|
22860
|
-
return
|
|
22914
|
+
return Ca(r, s);
|
|
22861
22915
|
}
|
|
22862
22916
|
static fromMLTensor(r, s) {
|
|
22863
|
-
return
|
|
22917
|
+
return Ua(r, s);
|
|
22864
22918
|
}
|
|
22865
22919
|
static fromPinnedBuffer(r, s, f) {
|
|
22866
|
-
return
|
|
22920
|
+
return Da(r, s, f);
|
|
22867
22921
|
}
|
|
22868
22922
|
toDataURL(r) {
|
|
22869
|
-
return
|
|
22923
|
+
return xa(this, r);
|
|
22870
22924
|
}
|
|
22871
22925
|
toImageData(r) {
|
|
22872
|
-
return
|
|
22926
|
+
return La(this, r);
|
|
22873
22927
|
}
|
|
22874
22928
|
get data() {
|
|
22875
22929
|
if (this.ensureValid(), !this.cpuData) throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");
|
|
@@ -22921,7 +22975,7 @@ var init_transformers_node = __esm({
|
|
|
22921
22975
|
}
|
|
22922
22976
|
reshape(r) {
|
|
22923
22977
|
if (this.ensureValid(), this.downloader || this.disposer) throw new Error("Cannot reshape a tensor that owns GPU resource.");
|
|
22924
|
-
return
|
|
22978
|
+
return Wa(this, r);
|
|
22925
22979
|
}
|
|
22926
22980
|
};
|
|
22927
22981
|
});
|
|
@@ -22933,29 +22987,29 @@ var init_transformers_node = __esm({
|
|
|
22933
22987
|
Qr = k(() => {
|
|
22934
22988
|
"use strict";
|
|
22935
22989
|
qr();
|
|
22936
|
-
|
|
22990
|
+
Ga = (a, r) => {
|
|
22937
22991
|
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) || console.timeStamp(`${a}::ORT::${r}`);
|
|
22938
|
-
},
|
|
22992
|
+
}, $a = (a, r) => {
|
|
22939
22993
|
let s = new Error().stack?.split(/\r\n|\r|\n/g) || [], f = false;
|
|
22940
22994
|
for (let i = 0; i < s.length; i++) {
|
|
22941
22995
|
if (f && !s[i].includes("TRACE_FUNC")) {
|
|
22942
|
-
let
|
|
22943
|
-
r && (
|
|
22996
|
+
let d = `FUNC_${a}::${s[i].trim().split(" ")[1]}`;
|
|
22997
|
+
r && (d += `::${r}`), Ga("CPU", d);
|
|
22944
22998
|
return;
|
|
22945
22999
|
}
|
|
22946
23000
|
s[i].includes("TRACE_FUNC") && (f = true);
|
|
22947
23001
|
}
|
|
22948
23002
|
}, tt = (a) => {
|
|
22949
|
-
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) ||
|
|
23003
|
+
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) || $a("BEGIN", a);
|
|
22950
23004
|
}, rt = (a) => {
|
|
22951
|
-
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) ||
|
|
23005
|
+
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) || $a("END", a);
|
|
22952
23006
|
}, $e = (a) => {
|
|
22953
23007
|
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) || console.time(`ORT::${a}`);
|
|
22954
23008
|
}, ze = (a) => {
|
|
22955
23009
|
(typeof ie.trace > "u" ? !ie.wasm.trace : !ie.trace) || console.timeEnd(`ORT::${a}`);
|
|
22956
23010
|
};
|
|
22957
23011
|
});
|
|
22958
|
-
|
|
23012
|
+
za = k(() => {
|
|
22959
23013
|
"use strict";
|
|
22960
23014
|
Yr();
|
|
22961
23015
|
Xr();
|
|
@@ -22966,37 +23020,37 @@ var init_transformers_node = __esm({
|
|
|
22966
23020
|
}
|
|
22967
23021
|
async run(r, s, f) {
|
|
22968
23022
|
tt(), $e("InferenceSession.run");
|
|
22969
|
-
let i = {},
|
|
23023
|
+
let i = {}, d = {};
|
|
22970
23024
|
if (typeof r != "object" || r === null || r instanceof Le || Array.isArray(r)) throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");
|
|
22971
|
-
let
|
|
23025
|
+
let l = true;
|
|
22972
23026
|
if (typeof s == "object") {
|
|
22973
23027
|
if (s === null) throw new TypeError("Unexpected argument[1]: cannot be null.");
|
|
22974
23028
|
if (s instanceof Le) throw new TypeError("'fetches' cannot be a Tensor");
|
|
22975
23029
|
if (Array.isArray(s)) {
|
|
22976
23030
|
if (s.length === 0) throw new TypeError("'fetches' cannot be an empty array.");
|
|
22977
|
-
|
|
23031
|
+
l = false;
|
|
22978
23032
|
for (let w of s) {
|
|
22979
23033
|
if (typeof w != "string") throw new TypeError("'fetches' must be a string array or an object.");
|
|
22980
23034
|
if (this.outputNames.indexOf(w) === -1) throw new RangeError(`'fetches' contains invalid output name: ${w}.`);
|
|
22981
23035
|
i[w] = null;
|
|
22982
23036
|
}
|
|
22983
|
-
if (typeof f == "object" && f !== null)
|
|
23037
|
+
if (typeof f == "object" && f !== null) d = f;
|
|
22984
23038
|
else if (typeof f < "u") throw new TypeError("'options' must be an object.");
|
|
22985
23039
|
} else {
|
|
22986
23040
|
let w = false, T = Object.getOwnPropertyNames(s);
|
|
22987
23041
|
for (let g of this.outputNames) if (T.indexOf(g) !== -1) {
|
|
22988
23042
|
let v = s[g];
|
|
22989
|
-
(v === null || v instanceof Le) && (w = true,
|
|
23043
|
+
(v === null || v instanceof Le) && (w = true, l = false, i[g] = v);
|
|
22990
23044
|
}
|
|
22991
23045
|
if (w) {
|
|
22992
|
-
if (typeof f == "object" && f !== null)
|
|
23046
|
+
if (typeof f == "object" && f !== null) d = f;
|
|
22993
23047
|
else if (typeof f < "u") throw new TypeError("'options' must be an object.");
|
|
22994
|
-
} else
|
|
23048
|
+
} else d = s;
|
|
22995
23049
|
}
|
|
22996
23050
|
} else if (typeof s < "u") throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");
|
|
22997
23051
|
for (let w of this.inputNames) if (typeof r[w] > "u") throw new Error(`input '${w}' is missing in 'feeds'.`);
|
|
22998
|
-
if (
|
|
22999
|
-
let m = await this.handler.run(r, i,
|
|
23052
|
+
if (l) for (let w of this.outputNames) i[w] = null;
|
|
23053
|
+
let m = await this.handler.run(r, i, d), y = {};
|
|
23000
23054
|
for (let w in m) if (Object.hasOwnProperty.call(m, w)) {
|
|
23001
23055
|
let T = m[w];
|
|
23002
23056
|
T instanceof Le ? y[w] = T : y[w] = new Le(T.type, T.data, T.dims);
|
|
@@ -23008,29 +23062,29 @@ var init_transformers_node = __esm({
|
|
|
23008
23062
|
}
|
|
23009
23063
|
static async create(r, s, f, i) {
|
|
23010
23064
|
tt(), $e("InferenceSession.create");
|
|
23011
|
-
let
|
|
23065
|
+
let d, l = {};
|
|
23012
23066
|
if (typeof r == "string") {
|
|
23013
|
-
if (
|
|
23067
|
+
if (d = r, typeof s == "object" && s !== null) l = s;
|
|
23014
23068
|
else if (typeof s < "u") throw new TypeError("'options' must be an object.");
|
|
23015
23069
|
} else if (r instanceof Uint8Array) {
|
|
23016
|
-
if (
|
|
23070
|
+
if (d = r, typeof s == "object" && s !== null) l = s;
|
|
23017
23071
|
else if (typeof s < "u") throw new TypeError("'options' must be an object.");
|
|
23018
23072
|
} else if (r instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && r instanceof SharedArrayBuffer) {
|
|
23019
23073
|
let T = r, g = 0, v = r.byteLength;
|
|
23020
|
-
if (typeof s == "object" && s !== null)
|
|
23074
|
+
if (typeof s == "object" && s !== null) l = s;
|
|
23021
23075
|
else if (typeof s == "number") {
|
|
23022
23076
|
if (g = s, !Number.isSafeInteger(g)) throw new RangeError("'byteOffset' must be an integer.");
|
|
23023
23077
|
if (g < 0 || g >= T.byteLength) throw new RangeError(`'byteOffset' is out of range [0, ${T.byteLength}).`);
|
|
23024
23078
|
if (v = r.byteLength - g, typeof f == "number") {
|
|
23025
23079
|
if (v = f, !Number.isSafeInteger(v)) throw new RangeError("'byteLength' must be an integer.");
|
|
23026
23080
|
if (v <= 0 || g + v > T.byteLength) throw new RangeError(`'byteLength' is out of range (0, ${T.byteLength - g}].`);
|
|
23027
|
-
if (typeof i == "object" && i !== null)
|
|
23081
|
+
if (typeof i == "object" && i !== null) l = i;
|
|
23028
23082
|
else if (typeof i < "u") throw new TypeError("'options' must be an object.");
|
|
23029
23083
|
} else if (typeof f < "u") throw new TypeError("'byteLength' must be a number.");
|
|
23030
23084
|
} else if (typeof s < "u") throw new TypeError("'options' must be an object.");
|
|
23031
|
-
|
|
23085
|
+
d = new Uint8Array(T, g, v);
|
|
23032
23086
|
} else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");
|
|
23033
|
-
let [m, y] = await
|
|
23087
|
+
let [m, y] = await Ta(l), w = await m.createInferenceSessionHandler(d, y);
|
|
23034
23088
|
return ze("InferenceSession.create"), rt(), new a(w);
|
|
23035
23089
|
}
|
|
23036
23090
|
startProfiling() {
|
|
@@ -23053,10 +23107,13 @@ var init_transformers_node = __esm({
|
|
|
23053
23107
|
}
|
|
23054
23108
|
};
|
|
23055
23109
|
});
|
|
23110
|
+
Va = k(() => {
|
|
23111
|
+
"use strict";
|
|
23112
|
+
za();
|
|
23113
|
+
qf = jt;
|
|
23114
|
+
});
|
|
23056
23115
|
ja = k(() => {
|
|
23057
23116
|
"use strict";
|
|
23058
|
-
Va();
|
|
23059
|
-
Jf = jt;
|
|
23060
23117
|
});
|
|
23061
23118
|
Ha = k(() => {
|
|
23062
23119
|
"use strict";
|
|
@@ -23067,35 +23124,32 @@ var init_transformers_node = __esm({
|
|
|
23067
23124
|
qa = k(() => {
|
|
23068
23125
|
"use strict";
|
|
23069
23126
|
});
|
|
23070
|
-
Ja = k(() => {
|
|
23071
|
-
"use strict";
|
|
23072
|
-
});
|
|
23073
23127
|
Zr = {};
|
|
23074
|
-
At(Zr, { InferenceSession: () =>
|
|
23128
|
+
At(Zr, { InferenceSession: () => qf, TRACE: () => Ga, TRACE_EVENT_BEGIN: () => $e, TRACE_EVENT_END: () => ze, TRACE_FUNC_BEGIN: () => tt, TRACE_FUNC_END: () => rt, Tensor: () => Le, env: () => K, registerBackend: () => Ke });
|
|
23075
23129
|
Ve = k(() => {
|
|
23076
23130
|
"use strict";
|
|
23077
|
-
|
|
23078
|
-
|
|
23079
|
-
|
|
23131
|
+
va();
|
|
23132
|
+
Ia();
|
|
23133
|
+
Va();
|
|
23080
23134
|
Xr();
|
|
23135
|
+
ja();
|
|
23081
23136
|
Ha();
|
|
23082
|
-
Ya();
|
|
23083
23137
|
Qr();
|
|
23138
|
+
Ya();
|
|
23084
23139
|
qa();
|
|
23085
|
-
Ja();
|
|
23086
23140
|
});
|
|
23087
23141
|
Ht = k(() => {
|
|
23088
23142
|
"use strict";
|
|
23089
23143
|
});
|
|
23090
|
-
|
|
23091
|
-
At(
|
|
23092
|
-
|
|
23144
|
+
Za = {};
|
|
23145
|
+
At(Za, { default: () => Jf });
|
|
23146
|
+
Ka = k(() => {
|
|
23093
23147
|
"use strict";
|
|
23094
23148
|
Kr();
|
|
23095
23149
|
je();
|
|
23096
23150
|
Yt();
|
|
23097
|
-
|
|
23098
|
-
|
|
23151
|
+
Xa = "ort-wasm-proxy-worker", Qa = globalThis.self?.name === Xa;
|
|
23152
|
+
Qa && (self.onmessage = (a) => {
|
|
23099
23153
|
let { type: r, in: s } = a.data;
|
|
23100
23154
|
try {
|
|
23101
23155
|
switch (r) {
|
|
@@ -23114,8 +23168,8 @@ var init_transformers_node = __esm({
|
|
|
23114
23168
|
let { epName: f, env: i } = s;
|
|
23115
23169
|
Xt(i, f).then(() => {
|
|
23116
23170
|
postMessage({ type: r });
|
|
23117
|
-
}, (
|
|
23118
|
-
postMessage({ type: r, err:
|
|
23171
|
+
}, (d) => {
|
|
23172
|
+
postMessage({ type: r, err: d });
|
|
23119
23173
|
});
|
|
23120
23174
|
break;
|
|
23121
23175
|
}
|
|
@@ -23126,10 +23180,10 @@ var init_transformers_node = __esm({
|
|
|
23126
23180
|
}
|
|
23127
23181
|
case "create": {
|
|
23128
23182
|
let { model: f, options: i } = s;
|
|
23129
|
-
Qt(f, i).then((
|
|
23130
|
-
postMessage({ type: r, out:
|
|
23131
|
-
}, (
|
|
23132
|
-
postMessage({ type: r, err:
|
|
23183
|
+
Qt(f, i).then((d) => {
|
|
23184
|
+
postMessage({ type: r, out: d });
|
|
23185
|
+
}, (d) => {
|
|
23186
|
+
postMessage({ type: r, err: d });
|
|
23133
23187
|
});
|
|
23134
23188
|
break;
|
|
23135
23189
|
}
|
|
@@ -23137,9 +23191,9 @@ var init_transformers_node = __esm({
|
|
|
23137
23191
|
Zt(s), postMessage({ type: r });
|
|
23138
23192
|
break;
|
|
23139
23193
|
case "run": {
|
|
23140
|
-
let { sessionId: f, inputIndices: i, inputs:
|
|
23141
|
-
Kt(f, i,
|
|
23142
|
-
y.some((w) => w[3] !== "cpu") ? postMessage({ type: r, err: "Proxy does not support non-cpu tensor location." }) : postMessage({ type: r, out: y }, tr([...
|
|
23194
|
+
let { sessionId: f, inputIndices: i, inputs: d, outputIndices: l, options: m } = s;
|
|
23195
|
+
Kt(f, i, d, l, new Array(l.length).fill(null), m).then((y) => {
|
|
23196
|
+
y.some((w) => w[3] !== "cpu") ? postMessage({ type: r, err: "Proxy does not support non-cpu tensor location." }) : postMessage({ type: r, out: y }, tr([...d, ...y]));
|
|
23143
23197
|
}, (y) => {
|
|
23144
23198
|
postMessage({ type: r, err: y });
|
|
23145
23199
|
});
|
|
@@ -23154,83 +23208,83 @@ var init_transformers_node = __esm({
|
|
|
23154
23208
|
postMessage({ type: r, err: f });
|
|
23155
23209
|
}
|
|
23156
23210
|
});
|
|
23157
|
-
|
|
23211
|
+
Jf = Qa ? null : (a) => new Worker(a ?? ge, { type: "module", name: Xa });
|
|
23158
23212
|
});
|
|
23159
|
-
|
|
23160
|
-
At(
|
|
23161
|
-
|
|
23213
|
+
ts = {};
|
|
23214
|
+
At(ts, { default: () => Xf });
|
|
23215
|
+
rs = k(() => {
|
|
23162
23216
|
"use strict";
|
|
23163
|
-
|
|
23164
|
-
|
|
23217
|
+
Xf = es, Qf = globalThis.self?.name?.startsWith("em-pthread");
|
|
23218
|
+
Qf && es();
|
|
23165
23219
|
});
|
|
23166
23220
|
Yt = k(() => {
|
|
23167
23221
|
"use strict";
|
|
23168
23222
|
Ht();
|
|
23169
|
-
|
|
23223
|
+
as = typeof location > "u" ? void 0 : location.origin, tn = import.meta.url > "file:" && import.meta.url < "file;", Zf = () => {
|
|
23170
23224
|
if (true) {
|
|
23171
23225
|
if (tn) {
|
|
23172
23226
|
let a = URL;
|
|
23173
|
-
return new URL(new a("ort.webgpu.bundle.min.mjs", import.meta.url).href,
|
|
23227
|
+
return new URL(new a("ort.webgpu.bundle.min.mjs", import.meta.url).href, as).href;
|
|
23174
23228
|
}
|
|
23175
23229
|
return import.meta.url;
|
|
23176
23230
|
}
|
|
23177
|
-
}, ge =
|
|
23231
|
+
}, ge = Zf(), ss = () => {
|
|
23178
23232
|
if (ge && !ge.startsWith("blob:")) return ge.substring(0, ge.lastIndexOf("/") + 1);
|
|
23179
23233
|
}, en = (a, r) => {
|
|
23180
23234
|
try {
|
|
23181
23235
|
let s = r ?? ge;
|
|
23182
|
-
return (s ? new URL(a, s) : new URL(a)).origin ===
|
|
23236
|
+
return (s ? new URL(a, s) : new URL(a)).origin === as;
|
|
23183
23237
|
} catch {
|
|
23184
23238
|
return false;
|
|
23185
23239
|
}
|
|
23186
|
-
},
|
|
23240
|
+
}, Kf = (a, r) => {
|
|
23187
23241
|
let s = r ?? ge;
|
|
23188
23242
|
try {
|
|
23189
23243
|
return (s ? new URL(a, s) : new URL(a)).href;
|
|
23190
23244
|
} catch {
|
|
23191
23245
|
return;
|
|
23192
23246
|
}
|
|
23193
|
-
},
|
|
23247
|
+
}, ec = (a, r) => `${r ?? "./"}${a}`, is = async (a) => {
|
|
23194
23248
|
let s = await (await fetch(a, { credentials: "same-origin" })).blob();
|
|
23195
23249
|
return URL.createObjectURL(s);
|
|
23196
|
-
},
|
|
23250
|
+
}, tc = async (a) => (await import(
|
|
23197
23251
|
/*webpackIgnore:true*/
|
|
23198
23252
|
/*@vite-ignore*/
|
|
23199
23253
|
a
|
|
23200
|
-
)).default,
|
|
23254
|
+
)).default, ns = (Ka(), $t(Za)).default, us = async () => {
|
|
23201
23255
|
if (!ge) throw new Error("Failed to load proxy worker: cannot determine the script source URL.");
|
|
23202
|
-
if (en(ge)) return [void 0,
|
|
23203
|
-
let a = await
|
|
23204
|
-
return [a,
|
|
23205
|
-
},
|
|
23206
|
-
let i =
|
|
23256
|
+
if (en(ge)) return [void 0, ns()];
|
|
23257
|
+
let a = await is(ge);
|
|
23258
|
+
return [a, ns(a)];
|
|
23259
|
+
}, os2 = (rs(), $t(ts)).default, fs4 = async (a, r, s, f) => {
|
|
23260
|
+
let i = os2 && !(a || r);
|
|
23207
23261
|
if (i) if (ge) i = en(ge) || f && !s;
|
|
23208
23262
|
else if (f && !s) i = true;
|
|
23209
23263
|
else throw new Error("cannot determine the script source URL.");
|
|
23210
|
-
if (i) return [void 0,
|
|
23264
|
+
if (i) return [void 0, os2];
|
|
23211
23265
|
{
|
|
23212
|
-
let
|
|
23213
|
-
return [m ? y : void 0, await
|
|
23266
|
+
let d = "ort-wasm-simd-threaded.asyncify.mjs", l = a ?? Kf(d, r), m = s && l && !en(l, r), y = m ? await is(l) : l ?? ec(d, r);
|
|
23267
|
+
return [m ? y : void 0, await tc(y)];
|
|
23214
23268
|
}
|
|
23215
23269
|
};
|
|
23216
23270
|
});
|
|
23217
23271
|
je = k(() => {
|
|
23218
23272
|
"use strict";
|
|
23219
23273
|
Yt();
|
|
23220
|
-
nn = false, rr = false,
|
|
23274
|
+
nn = false, rr = false, cs = false, rc = () => {
|
|
23221
23275
|
if (typeof SharedArrayBuffer > "u") return false;
|
|
23222
23276
|
try {
|
|
23223
23277
|
return typeof MessageChannel < "u" && new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)), WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]));
|
|
23224
23278
|
} catch {
|
|
23225
23279
|
return false;
|
|
23226
23280
|
}
|
|
23227
|
-
},
|
|
23281
|
+
}, nc = () => {
|
|
23228
23282
|
try {
|
|
23229
23283
|
return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 30, 1, 28, 0, 65, 0, 253, 15, 253, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 186, 1, 26, 11]));
|
|
23230
23284
|
} catch {
|
|
23231
23285
|
return false;
|
|
23232
23286
|
}
|
|
23233
|
-
},
|
|
23287
|
+
}, oc = () => {
|
|
23234
23288
|
try {
|
|
23235
23289
|
return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 19, 1, 17, 0, 65, 1, 253, 15, 65, 2, 253, 15, 65, 3, 253, 15, 253, 147, 2, 11]));
|
|
23236
23290
|
} catch {
|
|
@@ -23239,17 +23293,17 @@ var init_transformers_node = __esm({
|
|
|
23239
23293
|
}, qt = async (a) => {
|
|
23240
23294
|
if (nn) return Promise.resolve();
|
|
23241
23295
|
if (rr) throw new Error("multiple calls to 'initializeWebAssembly()' detected.");
|
|
23242
|
-
if (
|
|
23296
|
+
if (cs) throw new Error("previous call to 'initializeWebAssembly()' failed.");
|
|
23243
23297
|
rr = true;
|
|
23244
23298
|
let r = a.initTimeout, s = a.numThreads;
|
|
23245
23299
|
if (a.simd !== false) {
|
|
23246
23300
|
if (a.simd === "relaxed") {
|
|
23247
|
-
if (!
|
|
23248
|
-
} else if (!
|
|
23301
|
+
if (!oc()) throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.");
|
|
23302
|
+
} else if (!nc()) throw new Error("WebAssembly SIMD is not supported in the current environment.");
|
|
23249
23303
|
}
|
|
23250
|
-
let f =
|
|
23304
|
+
let f = rc();
|
|
23251
23305
|
s > 1 && !f && (typeof self < "u" && !self.crossOriginIsolated && console.warn("env.wasm.numThreads is set to " + s + ", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."), console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."), a.numThreads = s = 1);
|
|
23252
|
-
let i = a.wasmPaths,
|
|
23306
|
+
let i = a.wasmPaths, d = typeof i == "string" ? i : void 0, l = i?.mjs, m = l?.href ?? l, y = i?.wasm, w = y?.href ?? y, T = a.wasmBinary, [g, v] = await fs4(m, d, s > 1, !!T || !!w), S = false, C = [];
|
|
23253
23307
|
if (r > 0 && C.push(new Promise((R) => {
|
|
23254
23308
|
setTimeout(() => {
|
|
23255
23309
|
S = true, R();
|
|
@@ -23257,16 +23311,16 @@ var init_transformers_node = __esm({
|
|
|
23257
23311
|
})), C.push(new Promise((R, H) => {
|
|
23258
23312
|
let U = { numThreads: s };
|
|
23259
23313
|
if (T) U.wasmBinary = T, U.locateFile = (M) => M;
|
|
23260
|
-
else if (w ||
|
|
23314
|
+
else if (w || d) U.locateFile = (M) => w ?? d + M;
|
|
23261
23315
|
else if (m && m.indexOf("blob:") !== 0) U.locateFile = (M) => new URL(M, m).href;
|
|
23262
23316
|
else if (g) {
|
|
23263
|
-
let M =
|
|
23317
|
+
let M = ss();
|
|
23264
23318
|
M && (U.locateFile = (Y) => M + Y);
|
|
23265
23319
|
}
|
|
23266
23320
|
v(U).then((M) => {
|
|
23267
23321
|
rr = false, nn = true, rn = M, R(), g && URL.revokeObjectURL(g);
|
|
23268
23322
|
}, (M) => {
|
|
23269
|
-
rr = false,
|
|
23323
|
+
rr = false, cs = true, H(M);
|
|
23270
23324
|
});
|
|
23271
23325
|
})), await Promise.race(C), S) throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`);
|
|
23272
23326
|
}, z = () => {
|
|
@@ -23285,26 +23339,26 @@ var init_transformers_node = __esm({
|
|
|
23285
23339
|
if (s.has(a)) throw new Error("Circular reference in options");
|
|
23286
23340
|
s.add(a);
|
|
23287
23341
|
}
|
|
23288
|
-
Object.entries(a).forEach(([i,
|
|
23289
|
-
let
|
|
23290
|
-
if (typeof
|
|
23291
|
-
else if (typeof
|
|
23292
|
-
else if (typeof
|
|
23293
|
-
else throw new Error(`Can't handle extra config type: ${typeof
|
|
23342
|
+
Object.entries(a).forEach(([i, d]) => {
|
|
23343
|
+
let l = r ? r + i : i;
|
|
23344
|
+
if (typeof d == "object") Lt(d, l + ".", s, f);
|
|
23345
|
+
else if (typeof d == "string" || typeof d == "number") f(l, d.toString());
|
|
23346
|
+
else if (typeof d == "boolean") f(l, d ? "1" : "0");
|
|
23347
|
+
else throw new Error(`Can't handle extra config type: ${typeof d}`);
|
|
23294
23348
|
});
|
|
23295
23349
|
}, $ = (a) => {
|
|
23296
23350
|
let r = z(), s = r.stackSave();
|
|
23297
23351
|
try {
|
|
23298
23352
|
let f = r.PTR_SIZE, i = r.stackAlloc(2 * f);
|
|
23299
23353
|
r._OrtGetLastError(i, i + f);
|
|
23300
|
-
let
|
|
23301
|
-
throw new Error(`${a} ERROR_CODE: ${
|
|
23354
|
+
let d = Number(r.getValue(i, f === 4 ? "i32" : "i64")), l = r.getValue(i + f, "*"), m = l ? r.UTF8ToString(l) : "";
|
|
23355
|
+
throw new Error(`${a} ERROR_CODE: ${d}, ERROR_MESSAGE: ${m}`);
|
|
23302
23356
|
} finally {
|
|
23303
23357
|
r.stackRestore(s);
|
|
23304
23358
|
}
|
|
23305
23359
|
};
|
|
23306
23360
|
});
|
|
23307
|
-
|
|
23361
|
+
ls = k(() => {
|
|
23308
23362
|
"use strict";
|
|
23309
23363
|
je();
|
|
23310
23364
|
nr();
|
|
@@ -23316,21 +23370,21 @@ var init_transformers_node = __esm({
|
|
|
23316
23370
|
if (a?.logVerbosityLevel === void 0) i.logVerbosityLevel = 0;
|
|
23317
23371
|
else if (typeof a.logVerbosityLevel != "number" || !Number.isInteger(a.logVerbosityLevel)) throw new Error(`log verbosity level is not valid: ${a.logVerbosityLevel}`);
|
|
23318
23372
|
a?.terminate === void 0 && (i.terminate = false);
|
|
23319
|
-
let
|
|
23320
|
-
return a?.tag !== void 0 && (
|
|
23321
|
-
let y = be(
|
|
23322
|
-
r._OrtAddRunConfigEntry(s, y, w) !== 0 && $(`Can't set a run config entry: ${
|
|
23373
|
+
let d = 0;
|
|
23374
|
+
return a?.tag !== void 0 && (d = be(a.tag, f)), s = r._OrtCreateRunOptions(i.logSeverityLevel, i.logVerbosityLevel, !!i.terminate, d), s === 0 && $("Can't create run options."), a?.extra !== void 0 && Lt(a.extra, "", /* @__PURE__ */ new WeakSet(), (l, m) => {
|
|
23375
|
+
let y = be(l, f), w = be(m, f);
|
|
23376
|
+
r._OrtAddRunConfigEntry(s, y, w) !== 0 && $(`Can't set a run config entry: ${l} - ${m}.`);
|
|
23323
23377
|
}), [s, f];
|
|
23324
|
-
} catch (
|
|
23325
|
-
throw s !== 0 && r._OrtReleaseRunOptions(s), f.forEach((
|
|
23378
|
+
} catch (d) {
|
|
23379
|
+
throw s !== 0 && r._OrtReleaseRunOptions(s), f.forEach((l) => r._free(l)), d;
|
|
23326
23380
|
}
|
|
23327
23381
|
};
|
|
23328
23382
|
});
|
|
23329
|
-
|
|
23383
|
+
ms = k(() => {
|
|
23330
23384
|
"use strict";
|
|
23331
23385
|
je();
|
|
23332
23386
|
nr();
|
|
23333
|
-
|
|
23387
|
+
ac = (a) => {
|
|
23334
23388
|
switch (a) {
|
|
23335
23389
|
case "disabled":
|
|
23336
23390
|
return 0;
|
|
@@ -23345,7 +23399,7 @@ var init_transformers_node = __esm({
|
|
|
23345
23399
|
default:
|
|
23346
23400
|
throw new Error(`unsupported graph optimization level: ${a}`);
|
|
23347
23401
|
}
|
|
23348
|
-
},
|
|
23402
|
+
}, sc = (a) => {
|
|
23349
23403
|
switch (a) {
|
|
23350
23404
|
case "sequential":
|
|
23351
23405
|
return 0;
|
|
@@ -23354,47 +23408,47 @@ var init_transformers_node = __esm({
|
|
|
23354
23408
|
default:
|
|
23355
23409
|
throw new Error(`unsupported execution mode: ${a}`);
|
|
23356
23410
|
}
|
|
23357
|
-
},
|
|
23411
|
+
}, ic = (a) => {
|
|
23358
23412
|
a.extra || (a.extra = {}), a.extra.session || (a.extra.session = {});
|
|
23359
23413
|
let r = a.extra.session;
|
|
23360
23414
|
r.use_ort_model_bytes_directly || (r.use_ort_model_bytes_directly = "1"), a.executionProviders && a.executionProviders.some((s) => (typeof s == "string" ? s : s.name) === "webgpu") && (a.enableMemPattern = false);
|
|
23361
23415
|
}, on = (a, r, s, f) => {
|
|
23362
|
-
let i = be(r, f),
|
|
23363
|
-
z()._OrtAddSessionConfigEntry(a, i,
|
|
23416
|
+
let i = be(r, f), d = be(s, f);
|
|
23417
|
+
z()._OrtAddSessionConfigEntry(a, i, d) !== 0 && $(`Can't set a session config entry: ${r} - ${s}.`);
|
|
23364
23418
|
}, ot = (a, r, s, f) => {
|
|
23365
|
-
let i = be(r, f),
|
|
23366
|
-
a.push([i,
|
|
23367
|
-
},
|
|
23419
|
+
let i = be(r, f), d = be(s, f);
|
|
23420
|
+
a.push([i, d]);
|
|
23421
|
+
}, uc = async (a, r, s) => {
|
|
23368
23422
|
let f = r.executionProviders;
|
|
23369
23423
|
for (let i of f) {
|
|
23370
|
-
let
|
|
23371
|
-
switch (
|
|
23424
|
+
let d = typeof i == "string" ? i : i.name, l = [];
|
|
23425
|
+
switch (d) {
|
|
23372
23426
|
case "webnn":
|
|
23373
|
-
if (
|
|
23427
|
+
if (d = "WEBNN", typeof i != "string") {
|
|
23374
23428
|
let v = i?.deviceType;
|
|
23375
23429
|
v && on(a, "deviceType", v, s);
|
|
23376
23430
|
}
|
|
23377
23431
|
break;
|
|
23378
23432
|
case "webgpu":
|
|
23379
23433
|
{
|
|
23380
|
-
|
|
23434
|
+
d = "WebGPU";
|
|
23381
23435
|
let g;
|
|
23382
23436
|
if (typeof i != "string") {
|
|
23383
23437
|
let S = i;
|
|
23384
23438
|
if (S.device) if (typeof GPUDevice < "u" && S.device instanceof GPUDevice) g = S.device;
|
|
23385
23439
|
else throw new Error("Invalid GPU device set in WebGPU EP options.");
|
|
23386
23440
|
let { enableGraphCapture: C } = r;
|
|
23387
|
-
if (typeof C == "boolean" && C && ot(
|
|
23441
|
+
if (typeof C == "boolean" && C && ot(l, "enableGraphCapture", "1", s), typeof S.preferredLayout == "string" && ot(l, "preferredLayout", S.preferredLayout, s), S.forceCpuNodeNames) {
|
|
23388
23442
|
let R = Array.isArray(S.forceCpuNodeNames) ? S.forceCpuNodeNames : [S.forceCpuNodeNames];
|
|
23389
|
-
ot(
|
|
23443
|
+
ot(l, "forceCpuNodeNames", R.join(`
|
|
23390
23444
|
`), s);
|
|
23391
23445
|
}
|
|
23392
|
-
S.validationMode && ot(
|
|
23446
|
+
S.validationMode && ot(l, "validationMode", S.validationMode, s);
|
|
23393
23447
|
}
|
|
23394
23448
|
let v = z().webgpuRegisterDevice(g);
|
|
23395
23449
|
if (v) {
|
|
23396
23450
|
let [S, C, R] = v;
|
|
23397
|
-
ot(
|
|
23451
|
+
ot(l, "deviceId", S.toString(), s), ot(l, "webgpuInstance", C.toString(), s), ot(l, "webgpuDevice", R.toString(), s);
|
|
23398
23452
|
}
|
|
23399
23453
|
}
|
|
23400
23454
|
break;
|
|
@@ -23402,25 +23456,25 @@ var init_transformers_node = __esm({
|
|
|
23402
23456
|
case "cpu":
|
|
23403
23457
|
continue;
|
|
23404
23458
|
default:
|
|
23405
|
-
throw new Error(`not supported execution provider: ${
|
|
23459
|
+
throw new Error(`not supported execution provider: ${d}`);
|
|
23406
23460
|
}
|
|
23407
|
-
let m = be(
|
|
23461
|
+
let m = be(d, s), y = l.length, w = 0, T = 0;
|
|
23408
23462
|
if (y > 0) {
|
|
23409
23463
|
w = z()._malloc(y * z().PTR_SIZE), s.push(w), T = z()._malloc(y * z().PTR_SIZE), s.push(T);
|
|
23410
|
-
for (let g = 0; g < y; g++) z().setValue(w + g * z().PTR_SIZE,
|
|
23464
|
+
for (let g = 0; g < y; g++) z().setValue(w + g * z().PTR_SIZE, l[g][0], "*"), z().setValue(T + g * z().PTR_SIZE, l[g][1], "*");
|
|
23411
23465
|
}
|
|
23412
|
-
await z()._OrtAppendExecutionProvider(a, m, w, T, y) !== 0 && $(`Can't append execution provider: ${
|
|
23466
|
+
await z()._OrtAppendExecutionProvider(a, m, w, T, y) !== 0 && $(`Can't append execution provider: ${d}.`);
|
|
23413
23467
|
}
|
|
23414
|
-
},
|
|
23468
|
+
}, ps = async (a) => {
|
|
23415
23469
|
let r = z(), s = 0, f = [], i = a || {};
|
|
23416
|
-
|
|
23470
|
+
ic(i);
|
|
23417
23471
|
try {
|
|
23418
|
-
let
|
|
23472
|
+
let d = ac(i.graphOptimizationLevel ?? "all"), l = sc(i.executionMode ?? "sequential"), m = typeof i.logId == "string" ? be(i.logId, f) : 0, y = i.logSeverityLevel ?? 2;
|
|
23419
23473
|
if (!Number.isInteger(y) || y < 0 || y > 4) throw new Error(`log severity level is not valid: ${y}`);
|
|
23420
23474
|
let w = i.logVerbosityLevel ?? 0;
|
|
23421
23475
|
if (!Number.isInteger(w) || w < 0 || w > 4) throw new Error(`log verbosity level is not valid: ${w}`);
|
|
23422
23476
|
let T = typeof i.optimizedModelFilePath == "string" ? be(i.optimizedModelFilePath, f) : 0;
|
|
23423
|
-
if (s = r._OrtCreateSessionOptions(
|
|
23477
|
+
if (s = r._OrtCreateSessionOptions(d, !!i.enableCpuMemArena, !!i.enableMemPattern, l, !!i.enableProfiling, 0, m, y, w, T), s === 0 && $("Can't create session options."), i.executionProviders && await uc(s, i, f), i.enableGraphCapture !== void 0) {
|
|
23424
23478
|
if (typeof i.enableGraphCapture != "boolean") throw new Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);
|
|
23425
23479
|
on(s, "enableGraphCapture", i.enableGraphCapture.toString(), f);
|
|
23426
23480
|
}
|
|
@@ -23433,8 +23487,8 @@ var init_transformers_node = __esm({
|
|
|
23433
23487
|
return i.extra !== void 0 && Lt(i.extra, "", /* @__PURE__ */ new WeakSet(), (g, v) => {
|
|
23434
23488
|
on(s, g, v, f);
|
|
23435
23489
|
}), [s, f];
|
|
23436
|
-
} catch (
|
|
23437
|
-
throw s !== 0 && r._OrtReleaseSessionOptions(s) !== 0 && $("Can't release session options."), f.forEach((
|
|
23490
|
+
} catch (d) {
|
|
23491
|
+
throw s !== 0 && r._OrtReleaseSessionOptions(s) !== 0 && $("Can't release session options."), f.forEach((l) => r._free(l)), d;
|
|
23438
23492
|
}
|
|
23439
23493
|
};
|
|
23440
23494
|
});
|
|
@@ -23511,7 +23565,7 @@ var init_transformers_node = __esm({
|
|
|
23511
23565
|
throw new Error(`unsupported data type: ${a}`);
|
|
23512
23566
|
}
|
|
23513
23567
|
}, mt = (a, r) => {
|
|
23514
|
-
let s = [-1, 4, 1, 1, 2, 2, 4, 8, -1, 1, 2, 8, 4, 8, -1, -1, -1, -1, -1, -1, -1, 0.5, 0.5][a], f = typeof r == "number" ? r : r.reduce((i,
|
|
23568
|
+
let s = [-1, 4, 1, 1, 2, 2, 4, 8, -1, 1, 2, 8, 4, 8, -1, -1, -1, -1, -1, -1, -1, 0.5, 0.5][a], f = typeof r == "number" ? r : r.reduce((i, d) => i * d, 1);
|
|
23515
23569
|
return s > 0 ? Math.ceil(f * s) : void 0;
|
|
23516
23570
|
}, at = (a) => {
|
|
23517
23571
|
switch (a) {
|
|
@@ -23586,7 +23640,7 @@ var init_transformers_node = __esm({
|
|
|
23586
23640
|
} catch (r) {
|
|
23587
23641
|
if (r.code === "ERR_FS_FILE_TOO_LARGE") {
|
|
23588
23642
|
let { createReadStream: s } = Hr("node:fs"), f = s(a), i = [];
|
|
23589
|
-
for await (let
|
|
23643
|
+
for await (let d of f) i.push(d);
|
|
23590
23644
|
return new Uint8Array(Buffer.concat(i));
|
|
23591
23645
|
}
|
|
23592
23646
|
throw r;
|
|
@@ -23598,80 +23652,80 @@ var init_transformers_node = __esm({
|
|
|
23598
23652
|
if (f < 1073741824) return new Uint8Array(await r.arrayBuffer());
|
|
23599
23653
|
{
|
|
23600
23654
|
if (!r.body) throw new Error(`failed to load external data file: ${a}, no response body.`);
|
|
23601
|
-
let i = r.body.getReader(),
|
|
23655
|
+
let i = r.body.getReader(), d;
|
|
23602
23656
|
try {
|
|
23603
|
-
|
|
23657
|
+
d = new ArrayBuffer(f);
|
|
23604
23658
|
} catch (m) {
|
|
23605
23659
|
if (m instanceof RangeError) {
|
|
23606
23660
|
let y = Math.ceil(f / 65536);
|
|
23607
|
-
|
|
23661
|
+
d = new WebAssembly.Memory({ initial: y, maximum: y }).buffer;
|
|
23608
23662
|
} else throw m;
|
|
23609
23663
|
}
|
|
23610
|
-
let
|
|
23664
|
+
let l = 0;
|
|
23611
23665
|
for (; ; ) {
|
|
23612
23666
|
let { done: m, value: y } = await i.read();
|
|
23613
23667
|
if (m) break;
|
|
23614
23668
|
let w = y.byteLength;
|
|
23615
|
-
new Uint8Array(
|
|
23669
|
+
new Uint8Array(d, l, w).set(y), l += w;
|
|
23616
23670
|
}
|
|
23617
|
-
return new Uint8Array(
|
|
23671
|
+
return new Uint8Array(d, 0, f);
|
|
23618
23672
|
}
|
|
23619
23673
|
}
|
|
23620
23674
|
else return a instanceof Blob ? new Uint8Array(await a.arrayBuffer()) : a instanceof Uint8Array ? a : new Uint8Array(a);
|
|
23621
23675
|
};
|
|
23622
23676
|
});
|
|
23623
|
-
|
|
23677
|
+
ys = k(() => {
|
|
23624
23678
|
"use strict";
|
|
23625
23679
|
st();
|
|
23626
|
-
|
|
23680
|
+
hs = (a, r) => new (at(r))(a);
|
|
23627
23681
|
});
|
|
23628
23682
|
un = k(() => {
|
|
23629
23683
|
"use strict";
|
|
23630
23684
|
st();
|
|
23631
|
-
|
|
23632
|
-
console.log(`[${
|
|
23633
|
-
},
|
|
23634
|
-
|
|
23685
|
+
fc = ["V", "I", "W", "E", "F"], cc = (a, r) => {
|
|
23686
|
+
console.log(`[${fc[a]},${(/* @__PURE__ */ new Date()).toISOString()}]${r}`);
|
|
23687
|
+
}, gs = (a, r) => {
|
|
23688
|
+
bs = a, ws = r;
|
|
23635
23689
|
}, dc = (a, r) => {
|
|
23636
|
-
let s = Ot(a), f = Ot(
|
|
23637
|
-
s >= f &&
|
|
23638
|
-
},
|
|
23639
|
-
|
|
23690
|
+
let s = Ot(a), f = Ot(bs);
|
|
23691
|
+
s >= f && cc(s, typeof r == "function" ? r() : r);
|
|
23692
|
+
}, pe = (...a) => {
|
|
23693
|
+
ws && dc(...a);
|
|
23640
23694
|
};
|
|
23641
23695
|
});
|
|
23642
|
-
|
|
23696
|
+
Is = k(() => {
|
|
23643
23697
|
"use strict";
|
|
23644
23698
|
st();
|
|
23645
23699
|
un();
|
|
23646
|
-
|
|
23700
|
+
vs = /* @__PURE__ */ new Map([["float32", 32], ["float16", 16], ["int32", 32], ["uint32", 32], ["int64", 64], ["uint64", 64], ["int8", 8], ["uint8", 8], ["int4", 4], ["uint4", 4]]), cn = (a, r) => {
|
|
23647
23701
|
if (r === "int32") return a;
|
|
23648
|
-
let s =
|
|
23702
|
+
let s = vs.get(r);
|
|
23649
23703
|
if (!s) throw new Error(`WebNN backend does not support data type: ${r}`);
|
|
23650
23704
|
let f = s / 8;
|
|
23651
23705
|
if (a.byteLength % f !== 0) throw new Error(`Invalid Uint8Array length - must be a multiple of ${f}.`);
|
|
23652
|
-
let i = a.byteLength / f,
|
|
23706
|
+
let i = a.byteLength / f, d = new (at(r))(a.buffer, a.byteOffset, i);
|
|
23653
23707
|
switch (r) {
|
|
23654
23708
|
case "int64":
|
|
23655
23709
|
case "uint64": {
|
|
23656
|
-
let
|
|
23710
|
+
let l = new Int32Array(i);
|
|
23657
23711
|
for (let m = 0; m < i; m++) {
|
|
23658
|
-
let y =
|
|
23712
|
+
let y = d[m];
|
|
23659
23713
|
if (y > 2147483647n || y < -2147483648n) throw new Error("Can not convert int64 data to int32 - value out of range.");
|
|
23660
|
-
|
|
23714
|
+
l[m] = Number(y);
|
|
23661
23715
|
}
|
|
23662
|
-
return new Uint8Array(
|
|
23716
|
+
return new Uint8Array(l.buffer);
|
|
23663
23717
|
}
|
|
23664
23718
|
case "int8":
|
|
23665
23719
|
case "uint8":
|
|
23666
23720
|
case "uint32": {
|
|
23667
|
-
if (r === "uint32" &&
|
|
23668
|
-
let
|
|
23669
|
-
return new Uint8Array(
|
|
23721
|
+
if (r === "uint32" && d.some((m) => m > 2147483647)) throw new Error("Can not convert uint32 data to int32 - value out of range.");
|
|
23722
|
+
let l = Int32Array.from(d, Number);
|
|
23723
|
+
return new Uint8Array(l.buffer);
|
|
23670
23724
|
}
|
|
23671
23725
|
default:
|
|
23672
23726
|
throw new Error(`Unsupported data conversion from ${r} to 'int32'`);
|
|
23673
23727
|
}
|
|
23674
|
-
},
|
|
23728
|
+
}, Es = (a, r) => {
|
|
23675
23729
|
if (r === "int32") return a;
|
|
23676
23730
|
if (a.byteLength % 4 !== 0) throw new Error("Invalid Uint8Array length - must be a multiple of 4 (int32).");
|
|
23677
23731
|
let s = a.byteLength / 4, f = new Int32Array(a.buffer, a.byteOffset, s);
|
|
@@ -23681,12 +23735,12 @@ var init_transformers_node = __esm({
|
|
|
23681
23735
|
return new Uint8Array(i.buffer);
|
|
23682
23736
|
}
|
|
23683
23737
|
case "uint64": {
|
|
23684
|
-
if (f.some((
|
|
23738
|
+
if (f.some((d) => d < 0)) throw new Error("Can not convert int32 data to uin64 - negative value found.");
|
|
23685
23739
|
let i = BigUint64Array.from(f, BigInt);
|
|
23686
23740
|
return new Uint8Array(i.buffer);
|
|
23687
23741
|
}
|
|
23688
23742
|
case "int8": {
|
|
23689
|
-
if (f.some((
|
|
23743
|
+
if (f.some((d) => d < -128 || d > 127)) throw new Error("Can not convert int32 data to int8 - value out of range.");
|
|
23690
23744
|
let i = Int8Array.from(f, Number);
|
|
23691
23745
|
return new Uint8Array(i.buffer);
|
|
23692
23746
|
}
|
|
@@ -23695,22 +23749,22 @@ var init_transformers_node = __esm({
|
|
|
23695
23749
|
return Uint8Array.from(f, Number);
|
|
23696
23750
|
}
|
|
23697
23751
|
case "uint32": {
|
|
23698
|
-
if (f.some((
|
|
23752
|
+
if (f.some((d) => d < 0)) throw new Error("Can not convert int32 data to uint32 - negative value found.");
|
|
23699
23753
|
let i = Uint32Array.from(f, Number);
|
|
23700
23754
|
return new Uint8Array(i.buffer);
|
|
23701
23755
|
}
|
|
23702
23756
|
default:
|
|
23703
23757
|
throw new Error(`Unsupported data conversion from 'int32' to ${r}`);
|
|
23704
23758
|
}
|
|
23705
|
-
},
|
|
23706
|
-
let s =
|
|
23759
|
+
}, lc = 1, Ts = () => lc++, pc = /* @__PURE__ */ new Map([["int8", "int32"], ["uint8", "int32"], ["uint32", "int32"], ["int64", "int32"]]), Ss = (a, r) => {
|
|
23760
|
+
let s = vs.get(a);
|
|
23707
23761
|
if (!s) throw new Error(`WebNN backend does not support data type: ${a}`);
|
|
23708
23762
|
return r.length > 0 ? Math.ceil(r.reduce((f, i) => f * i) * s / 8) : 0;
|
|
23709
23763
|
}, ir = class {
|
|
23710
23764
|
constructor(r) {
|
|
23711
23765
|
this.isDataConverted = false;
|
|
23712
|
-
let { sessionId: s, context: f, tensor: i, dataType:
|
|
23713
|
-
this.sessionId = s, this.mlContext = f, this.mlTensor = i, this.dataType =
|
|
23766
|
+
let { sessionId: s, context: f, tensor: i, dataType: d, shape: l, fallbackDataType: m } = r;
|
|
23767
|
+
this.sessionId = s, this.mlContext = f, this.mlTensor = i, this.dataType = d, this.tensorShape = l, this.fallbackDataType = m;
|
|
23714
23768
|
}
|
|
23715
23769
|
get tensor() {
|
|
23716
23770
|
return this.mlTensor;
|
|
@@ -23725,17 +23779,17 @@ var init_transformers_node = __esm({
|
|
|
23725
23779
|
return this.tensorShape;
|
|
23726
23780
|
}
|
|
23727
23781
|
get byteLength() {
|
|
23728
|
-
return
|
|
23782
|
+
return Ss(this.dataType, this.tensorShape);
|
|
23729
23783
|
}
|
|
23730
23784
|
destroy() {
|
|
23731
|
-
|
|
23785
|
+
pe("verbose", () => "[WebNN] TensorWrapper.destroy"), this.mlTensor.destroy();
|
|
23732
23786
|
}
|
|
23733
23787
|
write(r) {
|
|
23734
23788
|
this.mlContext.writeTensor(this.mlTensor, r);
|
|
23735
23789
|
}
|
|
23736
23790
|
async read(r) {
|
|
23737
23791
|
if (this.fallbackDataType) {
|
|
23738
|
-
let s = await this.mlContext.readTensor(this.mlTensor), f =
|
|
23792
|
+
let s = await this.mlContext.readTensor(this.mlTensor), f = Es(new Uint8Array(s), this.dataType);
|
|
23739
23793
|
if (r) {
|
|
23740
23794
|
(r instanceof ArrayBuffer ? new Uint8Array(r) : new Uint8Array(r.buffer, r.byteOffset, r.byteLength)).set(f);
|
|
23741
23795
|
return;
|
|
@@ -23743,7 +23797,7 @@ var init_transformers_node = __esm({
|
|
|
23743
23797
|
} else return r ? this.mlContext.readTensor(this.mlTensor, r) : this.mlContext.readTensor(this.mlTensor);
|
|
23744
23798
|
}
|
|
23745
23799
|
canReuseTensor(r, s, f) {
|
|
23746
|
-
return this.mlContext === r && this.dataType === s && this.tensorShape.length === f.length && this.tensorShape.every((i,
|
|
23800
|
+
return this.mlContext === r && this.dataType === s && this.tensorShape.length === f.length && this.tensorShape.every((i, d) => i === f[d]);
|
|
23747
23801
|
}
|
|
23748
23802
|
setIsDataConverted(r) {
|
|
23749
23803
|
this.isDataConverted = r;
|
|
@@ -23760,15 +23814,15 @@ var init_transformers_node = __esm({
|
|
|
23760
23814
|
this.tensorWrapper && (this.tensorManager.releaseTensor(this.tensorWrapper), this.wrapper = void 0);
|
|
23761
23815
|
}
|
|
23762
23816
|
async ensureTensor(r, s, f, i) {
|
|
23763
|
-
let
|
|
23764
|
-
if (!
|
|
23765
|
-
if (m =
|
|
23766
|
-
|
|
23817
|
+
let d = this.tensorManager.getMLContext(r), l = this.tensorManager.getMLOpSupportLimits(r), m;
|
|
23818
|
+
if (!l?.input.dataTypes.includes(s)) {
|
|
23819
|
+
if (m = pc.get(s), !m || l?.input.dataTypes.includes(m)) throw new Error(`WebNN backend does not support data type: ${s}`);
|
|
23820
|
+
pe("verbose", () => `[WebNN] TensorIdTracker.ensureTensor: fallback dataType from ${s} to ${m}`);
|
|
23767
23821
|
}
|
|
23768
23822
|
if (this.wrapper) {
|
|
23769
|
-
if (this.wrapper.canReuseTensor(
|
|
23823
|
+
if (this.wrapper.canReuseTensor(d, s, f)) return this.wrapper.tensor;
|
|
23770
23824
|
if (i) {
|
|
23771
|
-
if (this.wrapper.byteLength !==
|
|
23825
|
+
if (this.wrapper.byteLength !== Ss(s, f)) throw new Error("Unable to copy data to tensor with different size.");
|
|
23772
23826
|
this.activeUpload = new Uint8Array(await this.wrapper.read());
|
|
23773
23827
|
}
|
|
23774
23828
|
this.tensorManager.releaseTensor(this.wrapper);
|
|
@@ -23784,13 +23838,13 @@ var init_transformers_node = __esm({
|
|
|
23784
23838
|
if (r.byteLength === this.wrapper.byteLength) {
|
|
23785
23839
|
this.wrapper.write(s);
|
|
23786
23840
|
return;
|
|
23787
|
-
} else
|
|
23841
|
+
} else pe("verbose", () => "Data size does not match tensor size. Releasing tensor."), this.releaseTensor();
|
|
23788
23842
|
}
|
|
23789
23843
|
this.activeUpload ? this.activeUpload.set(s) : this.activeUpload = new Uint8Array(s);
|
|
23790
23844
|
}
|
|
23791
23845
|
async download(r) {
|
|
23792
23846
|
if (this.activeUpload) {
|
|
23793
|
-
let s = this.wrapper?.isDataConverted ?
|
|
23847
|
+
let s = this.wrapper?.isDataConverted ? Es(this.activeUpload, this.wrapper?.type) : this.activeUpload;
|
|
23794
23848
|
if (r) {
|
|
23795
23849
|
r instanceof ArrayBuffer ? new Uint8Array(r).set(s) : new Uint8Array(r.buffer, r.byteOffset, r.byteLength).set(s);
|
|
23796
23850
|
return;
|
|
@@ -23815,18 +23869,18 @@ var init_transformers_node = __esm({
|
|
|
23815
23869
|
return this.backend.getMLOpSupportLimits(r);
|
|
23816
23870
|
}
|
|
23817
23871
|
reserveTensorId() {
|
|
23818
|
-
let r =
|
|
23872
|
+
let r = Ts();
|
|
23819
23873
|
return this.tensorTrackersById.set(r, new ur(this)), r;
|
|
23820
23874
|
}
|
|
23821
23875
|
releaseTensorId(r) {
|
|
23822
23876
|
let s = this.tensorTrackersById.get(r);
|
|
23823
23877
|
s && (this.tensorTrackersById.delete(r), s.tensorWrapper && this.releaseTensor(s.tensorWrapper));
|
|
23824
23878
|
}
|
|
23825
|
-
async ensureTensor(r, s, f, i,
|
|
23826
|
-
|
|
23827
|
-
let
|
|
23828
|
-
if (!
|
|
23829
|
-
return
|
|
23879
|
+
async ensureTensor(r, s, f, i, d) {
|
|
23880
|
+
pe("verbose", () => `[WebNN] TensorManager.ensureTensor {tensorId: ${s}, dataType: ${f}, shape: ${i}, copyOld: ${d}}`);
|
|
23881
|
+
let l = this.tensorTrackersById.get(s);
|
|
23882
|
+
if (!l) throw new Error("Tensor not found.");
|
|
23883
|
+
return l.ensureTensor(r, f, i, d);
|
|
23830
23884
|
}
|
|
23831
23885
|
upload(r, s) {
|
|
23832
23886
|
let f = this.tensorTrackersById.get(r);
|
|
@@ -23834,7 +23888,7 @@ var init_transformers_node = __esm({
|
|
|
23834
23888
|
f.upload(s);
|
|
23835
23889
|
}
|
|
23836
23890
|
async download(r, s) {
|
|
23837
|
-
|
|
23891
|
+
pe("verbose", () => `[WebNN] TensorManager.download {tensorId: ${r}, dstBuffer: ${s?.byteLength}}`);
|
|
23838
23892
|
let f = this.tensorTrackersById.get(r);
|
|
23839
23893
|
if (!f) throw new Error("Tensor not found.");
|
|
23840
23894
|
return f.download(s);
|
|
@@ -23844,42 +23898,42 @@ var init_transformers_node = __esm({
|
|
|
23844
23898
|
this.freeTensors = this.freeTensors.filter((s) => s.sessionId !== r);
|
|
23845
23899
|
}
|
|
23846
23900
|
registerTensor(r, s, f, i) {
|
|
23847
|
-
let
|
|
23848
|
-
return this.tensorTrackersById.set(
|
|
23901
|
+
let d = this.getMLContext(r), l = Ts(), m = new ir({ sessionId: r, context: d, tensor: s, dataType: f, shape: i });
|
|
23902
|
+
return this.tensorTrackersById.set(l, new ur(this, m)), this.externalTensors.add(m), l;
|
|
23849
23903
|
}
|
|
23850
|
-
async getCachedTensor(r, s, f, i,
|
|
23904
|
+
async getCachedTensor(r, s, f, i, d, l, m) {
|
|
23851
23905
|
let y = this.getMLContext(r);
|
|
23852
23906
|
for (let [T, g] of this.freeTensors.entries()) if (g.canReuseTensor(y, s, f)) {
|
|
23853
|
-
|
|
23907
|
+
pe("verbose", () => `[WebNN] Reusing tensor {dataType: ${s}, ${m ? `fallbackDataType: ${m},` : ""} shape: ${f}`);
|
|
23854
23908
|
let v = this.freeTensors.splice(T, 1)[0];
|
|
23855
23909
|
return v.sessionId = r, v;
|
|
23856
23910
|
}
|
|
23857
|
-
|
|
23858
|
-
let w = await y.createTensor({ dataType: m ?? s, shape: f, dimensions: f, usage: i, writable:
|
|
23911
|
+
pe("verbose", () => `[WebNN] MLContext.createTensor {dataType: ${s}, ${m ? `fallbackDataType: ${m},` : ""} shape: ${f}}`);
|
|
23912
|
+
let w = await y.createTensor({ dataType: m ?? s, shape: f, dimensions: f, usage: i, writable: d, readable: l });
|
|
23859
23913
|
return new ir({ sessionId: r, context: y, tensor: w, dataType: s, shape: f, fallbackDataType: m });
|
|
23860
23914
|
}
|
|
23861
23915
|
releaseTensor(r) {
|
|
23862
23916
|
this.externalTensors.has(r) && this.externalTensors.delete(r), this.freeTensors.push(r);
|
|
23863
23917
|
}
|
|
23864
|
-
},
|
|
23918
|
+
}, As = (...a) => new fn(...a);
|
|
23865
23919
|
});
|
|
23866
|
-
|
|
23867
|
-
At(
|
|
23868
|
-
|
|
23920
|
+
xs = {};
|
|
23921
|
+
At(xs, { WebNNBackend: () => dn });
|
|
23922
|
+
Ls = k(() => {
|
|
23869
23923
|
"use strict";
|
|
23870
23924
|
st();
|
|
23871
23925
|
je();
|
|
23872
|
-
|
|
23873
|
-
|
|
23926
|
+
ys();
|
|
23927
|
+
Is();
|
|
23874
23928
|
un();
|
|
23875
|
-
fr = /* @__PURE__ */ new Map([[1, "float32"], [10, "float16"], [6, "int32"], [12, "uint32"], [7, "int64"], [13, "uint64"], [22, "int4"], [21, "uint4"], [3, "int8"], [2, "uint8"], [9, "uint8"]]),
|
|
23929
|
+
fr = /* @__PURE__ */ new Map([[1, "float32"], [10, "float16"], [6, "int32"], [12, "uint32"], [7, "int64"], [13, "uint64"], [22, "int4"], [21, "uint4"], [3, "int8"], [2, "uint8"], [9, "uint8"]]), mc = (a, r) => {
|
|
23876
23930
|
if (a === r) return true;
|
|
23877
23931
|
if (a === void 0 || r === void 0) return false;
|
|
23878
23932
|
let s = Object.keys(a).sort(), f = Object.keys(r).sort();
|
|
23879
|
-
return s.length === f.length && s.every((i,
|
|
23880
|
-
},
|
|
23933
|
+
return s.length === f.length && s.every((i, d) => i === f[d] && a[i] === r[i]);
|
|
23934
|
+
}, dn = class {
|
|
23881
23935
|
constructor(r) {
|
|
23882
|
-
this.tensorManager =
|
|
23936
|
+
this.tensorManager = As(this);
|
|
23883
23937
|
this.mlContextBySessionId = /* @__PURE__ */ new Map();
|
|
23884
23938
|
this.sessionIdsByMLContext = /* @__PURE__ */ new Map();
|
|
23885
23939
|
this.mlContextCache = [];
|
|
@@ -23889,20 +23943,20 @@ var init_transformers_node = __esm({
|
|
|
23889
23943
|
this.temporaryGraphOutputs = [];
|
|
23890
23944
|
this.temporarySessionTensorIds = /* @__PURE__ */ new Map();
|
|
23891
23945
|
this.mlOpSupportLimitsBySessionId = /* @__PURE__ */ new Map();
|
|
23892
|
-
|
|
23946
|
+
gs(r.logLevel, !!r.debug);
|
|
23893
23947
|
}
|
|
23894
23948
|
get currentSessionId() {
|
|
23895
23949
|
if (this.activeSessionId === void 0) throw new Error("No active session");
|
|
23896
23950
|
return this.activeSessionId;
|
|
23897
23951
|
}
|
|
23898
23952
|
onRunStart(r) {
|
|
23899
|
-
|
|
23953
|
+
pe("verbose", () => `[WebNN] onRunStart {sessionId: ${r}}`), this.activeSessionId = r;
|
|
23900
23954
|
}
|
|
23901
23955
|
onRunEnd(r) {
|
|
23902
|
-
|
|
23956
|
+
pe("verbose", () => `[WebNN] onRunEnd {sessionId: ${r}}`);
|
|
23903
23957
|
let s = this.temporarySessionTensorIds.get(r);
|
|
23904
23958
|
if (s) {
|
|
23905
|
-
for (let f of s)
|
|
23959
|
+
for (let f of s) pe("verbose", () => `[WebNN] releasing temporary tensor {tensorId: ${f}}`), this.tensorManager.releaseTensorId(f);
|
|
23906
23960
|
this.temporarySessionTensorIds.delete(r), this.activeSessionId = void 0;
|
|
23907
23961
|
}
|
|
23908
23962
|
}
|
|
@@ -23922,7 +23976,7 @@ var init_transformers_node = __esm({
|
|
|
23922
23976
|
return this.mlContextCache.push({ mlContext: i }), i;
|
|
23923
23977
|
}
|
|
23924
23978
|
}
|
|
23925
|
-
let s = this.mlContextCache.findIndex((f) =>
|
|
23979
|
+
let s = this.mlContextCache.findIndex((f) => mc(f.options, r));
|
|
23926
23980
|
if (s !== -1) return this.mlContextCache[s].mlContext;
|
|
23927
23981
|
{
|
|
23928
23982
|
let f = await navigator.ml.createContext(r);
|
|
@@ -23942,7 +23996,7 @@ var init_transformers_node = __esm({
|
|
|
23942
23996
|
let f = this.sessionIdsByMLContext.get(s);
|
|
23943
23997
|
if (f.delete(r), f.size === 0) {
|
|
23944
23998
|
this.sessionIdsByMLContext.delete(s);
|
|
23945
|
-
let i = this.mlContextCache.findIndex((
|
|
23999
|
+
let i = this.mlContextCache.findIndex((d) => d.mlContext === s);
|
|
23946
24000
|
i !== -1 && this.mlContextCache.splice(i, 1);
|
|
23947
24001
|
}
|
|
23948
24002
|
}
|
|
@@ -23956,25 +24010,25 @@ var init_transformers_node = __esm({
|
|
|
23956
24010
|
return this.tensorManager.reserveTensorId();
|
|
23957
24011
|
}
|
|
23958
24012
|
releaseTensorId(r) {
|
|
23959
|
-
|
|
24013
|
+
pe("verbose", () => `[WebNN] releaseTensorId {tensorId: ${r}}`), this.tensorManager.releaseTensorId(r);
|
|
23960
24014
|
}
|
|
23961
|
-
async ensureTensor(r, s, f, i,
|
|
23962
|
-
let
|
|
23963
|
-
if (!
|
|
23964
|
-
return this.tensorManager.ensureTensor(r ?? this.currentSessionId, s,
|
|
24015
|
+
async ensureTensor(r, s, f, i, d) {
|
|
24016
|
+
let l = fr.get(f);
|
|
24017
|
+
if (!l) throw new Error(`Unsupported ONNX data type: ${f}`);
|
|
24018
|
+
return this.tensorManager.ensureTensor(r ?? this.currentSessionId, s, l, i, d);
|
|
23965
24019
|
}
|
|
23966
24020
|
async createTemporaryTensor(r, s, f) {
|
|
23967
|
-
|
|
24021
|
+
pe("verbose", () => `[WebNN] createTemporaryTensor {onnxDataType: ${s}, shape: ${f}}`);
|
|
23968
24022
|
let i = fr.get(s);
|
|
23969
24023
|
if (!i) throw new Error(`Unsupported ONNX data type: ${s}`);
|
|
23970
|
-
let
|
|
23971
|
-
await this.tensorManager.ensureTensor(r,
|
|
23972
|
-
let
|
|
23973
|
-
return
|
|
24024
|
+
let d = this.tensorManager.reserveTensorId();
|
|
24025
|
+
await this.tensorManager.ensureTensor(r, d, i, f, false);
|
|
24026
|
+
let l = this.temporarySessionTensorIds.get(r);
|
|
24027
|
+
return l ? l.push(d) : this.temporarySessionTensorIds.set(r, [d]), d;
|
|
23974
24028
|
}
|
|
23975
24029
|
uploadTensor(r, s) {
|
|
23976
24030
|
if (!z().shouldTransferToMLTensor) throw new Error("Trying to upload to a MLTensor while shouldTransferToMLTensor is false");
|
|
23977
|
-
|
|
24031
|
+
pe("verbose", () => `[WebNN] uploadTensor {tensorId: ${r}, data: ${s.byteLength}}`), this.tensorManager.upload(r, s);
|
|
23978
24032
|
}
|
|
23979
24033
|
async downloadTensor(r, s) {
|
|
23980
24034
|
return this.tensorManager.download(r, s);
|
|
@@ -23982,24 +24036,24 @@ var init_transformers_node = __esm({
|
|
|
23982
24036
|
createMLTensorDownloader(r, s) {
|
|
23983
24037
|
return async () => {
|
|
23984
24038
|
let f = await this.tensorManager.download(r);
|
|
23985
|
-
return
|
|
24039
|
+
return hs(f, s);
|
|
23986
24040
|
};
|
|
23987
24041
|
}
|
|
23988
24042
|
registerMLTensor(r, s, f, i) {
|
|
23989
|
-
let
|
|
23990
|
-
if (!
|
|
23991
|
-
let
|
|
23992
|
-
return
|
|
24043
|
+
let d = fr.get(f);
|
|
24044
|
+
if (!d) throw new Error(`Unsupported ONNX data type: ${f}`);
|
|
24045
|
+
let l = this.tensorManager.registerTensor(r, s, d, i);
|
|
24046
|
+
return pe("verbose", () => `[WebNN] registerMLTensor {tensor: ${s}, dataType: ${d}, dimensions: ${i}} -> {tensorId: ${l}}`), l;
|
|
23993
24047
|
}
|
|
23994
|
-
registerMLConstant(r, s, f, i,
|
|
23995
|
-
if (!
|
|
24048
|
+
registerMLConstant(r, s, f, i, d, l, m = false) {
|
|
24049
|
+
if (!l) throw new Error("External mounted files are not available.");
|
|
23996
24050
|
let y = r;
|
|
23997
24051
|
r.startsWith("./") && (y = r.substring(2));
|
|
23998
|
-
let w =
|
|
24052
|
+
let w = l.get(y);
|
|
23999
24053
|
if (!w) throw new Error(`File with name ${y} not found in preloaded files.`);
|
|
24000
24054
|
if (s + f > w.byteLength) throw new Error("Out of bounds: data offset and length exceed the external file data size.");
|
|
24001
24055
|
let T = w.slice(s, s + f).buffer, g;
|
|
24002
|
-
switch (
|
|
24056
|
+
switch (d.dataType) {
|
|
24003
24057
|
case "float32":
|
|
24004
24058
|
g = new Float32Array(T);
|
|
24005
24059
|
break;
|
|
@@ -24015,7 +24069,7 @@ var init_transformers_node = __esm({
|
|
|
24015
24069
|
case "int64":
|
|
24016
24070
|
if (m) {
|
|
24017
24071
|
let v = cn(new Uint8Array(T), "int64");
|
|
24018
|
-
g = new Int32Array(v.buffer),
|
|
24072
|
+
g = new Int32Array(v.buffer), d.dataType = "int32";
|
|
24019
24073
|
} else g = new BigInt64Array(T);
|
|
24020
24074
|
break;
|
|
24021
24075
|
case "uint64":
|
|
@@ -24030,9 +24084,9 @@ var init_transformers_node = __esm({
|
|
|
24030
24084
|
g = new Uint8Array(T);
|
|
24031
24085
|
break;
|
|
24032
24086
|
default:
|
|
24033
|
-
throw new Error(`Unsupported data type: ${
|
|
24087
|
+
throw new Error(`Unsupported data type: ${d.dataType} in creating WebNN Constant from external data.`);
|
|
24034
24088
|
}
|
|
24035
|
-
return
|
|
24089
|
+
return pe("verbose", () => `[WebNN] registerMLConstant {dataType: ${d.dataType}, shape: ${d.shape}}} ${m ? "(Note: it was int64 data type and registered to int32 as workaround)" : ""}`), i.constant(d, g);
|
|
24036
24090
|
}
|
|
24037
24091
|
registerGraphInput(r) {
|
|
24038
24092
|
this.temporaryGraphInputs.push(r);
|
|
@@ -24049,8 +24103,8 @@ var init_transformers_node = __esm({
|
|
|
24049
24103
|
return f ? f.includes(s) : false;
|
|
24050
24104
|
}
|
|
24051
24105
|
isGraphInputOutputTypeSupported(r, s, f = true) {
|
|
24052
|
-
let i = fr.get(He(s)),
|
|
24053
|
-
return typeof i > "u" ? false : f ? !!
|
|
24106
|
+
let i = fr.get(He(s)), d = this.mlOpSupportLimitsBySessionId.get(r);
|
|
24107
|
+
return typeof i > "u" ? false : f ? !!d?.input.dataTypes.includes(i) : !!d?.output.dataTypes.includes(i);
|
|
24054
24108
|
}
|
|
24055
24109
|
flush() {
|
|
24056
24110
|
}
|
|
@@ -24059,16 +24113,16 @@ var init_transformers_node = __esm({
|
|
|
24059
24113
|
Kr = k(() => {
|
|
24060
24114
|
"use strict";
|
|
24061
24115
|
Ve();
|
|
24062
|
-
|
|
24063
|
-
|
|
24116
|
+
ls();
|
|
24117
|
+
ms();
|
|
24064
24118
|
st();
|
|
24065
24119
|
je();
|
|
24066
24120
|
nr();
|
|
24067
24121
|
sn();
|
|
24068
|
-
|
|
24122
|
+
hc = (a, r) => {
|
|
24069
24123
|
z()._OrtInit(a, r) !== 0 && $("Can't initialize onnxruntime.");
|
|
24070
24124
|
}, Jt = async (a) => {
|
|
24071
|
-
|
|
24125
|
+
hc(a.wasm.numThreads, Ot(a.logLevel));
|
|
24072
24126
|
}, Xt = async (a, r) => {
|
|
24073
24127
|
z().asyncInit?.();
|
|
24074
24128
|
let s = a.webgpu.adapter;
|
|
@@ -24088,34 +24142,34 @@ var init_transformers_node = __esm({
|
|
|
24088
24142
|
if (r === "webgpu" && z().webgpuInit((f) => {
|
|
24089
24143
|
a.webgpu.device = f;
|
|
24090
24144
|
}), r === "webnn") {
|
|
24091
|
-
let f = new (
|
|
24092
|
-
z().webnnInit([f, () => f.reserveTensorId(), (i) => f.releaseTensorId(i), async (i,
|
|
24093
|
-
f.uploadTensor(i,
|
|
24094
|
-
}, async (i,
|
|
24145
|
+
let f = new (Ls(), $t(xs)).WebNNBackend(a);
|
|
24146
|
+
z().webnnInit([f, () => f.reserveTensorId(), (i) => f.releaseTensorId(i), async (i, d, l, m, y) => f.ensureTensor(i, d, l, m, y), (i, d) => {
|
|
24147
|
+
f.uploadTensor(i, d);
|
|
24148
|
+
}, async (i, d) => f.downloadTensor(i, d), (i, d) => f.registerMLContext(i, d), !!a.trace]);
|
|
24095
24149
|
}
|
|
24096
|
-
}, it = /* @__PURE__ */ new Map(),
|
|
24150
|
+
}, it = /* @__PURE__ */ new Map(), yc = (a) => {
|
|
24097
24151
|
let r = z(), s = r.stackSave();
|
|
24098
24152
|
try {
|
|
24099
24153
|
let f = r.PTR_SIZE, i = r.stackAlloc(2 * f);
|
|
24100
24154
|
r._OrtGetInputOutputCount(a, i, i + f) !== 0 && $("Can't get session input/output count.");
|
|
24101
|
-
let
|
|
24102
|
-
return [Number(r.getValue(i,
|
|
24155
|
+
let l = f === 4 ? "i32" : "i64";
|
|
24156
|
+
return [Number(r.getValue(i, l)), Number(r.getValue(i + f, l))];
|
|
24103
24157
|
} finally {
|
|
24104
24158
|
r.stackRestore(s);
|
|
24105
24159
|
}
|
|
24106
|
-
},
|
|
24160
|
+
}, Os = (a, r) => {
|
|
24107
24161
|
let s = z(), f = s.stackSave(), i = 0;
|
|
24108
24162
|
try {
|
|
24109
|
-
let
|
|
24110
|
-
s._OrtGetInputOutputMetadata(a, r,
|
|
24111
|
-
let y = Number(s.getValue(
|
|
24112
|
-
i = Number(s.getValue(
|
|
24163
|
+
let d = s.PTR_SIZE, l = s.stackAlloc(2 * d);
|
|
24164
|
+
s._OrtGetInputOutputMetadata(a, r, l, l + d) !== 0 && $("Can't get session input/output metadata.");
|
|
24165
|
+
let y = Number(s.getValue(l, "*"));
|
|
24166
|
+
i = Number(s.getValue(l + d, "*"));
|
|
24113
24167
|
let w = s.HEAP32[i / 4];
|
|
24114
24168
|
if (w === 0) return [y, 0];
|
|
24115
24169
|
let T = s.HEAPU32[i / 4 + 1], g = [];
|
|
24116
24170
|
for (let v = 0; v < T; v++) {
|
|
24117
|
-
let S = Number(s.getValue(i + 8 + v *
|
|
24118
|
-
g.push(S !== 0 ? s.UTF8ToString(S) : Number(s.getValue(i + 8 + (v + T) *
|
|
24171
|
+
let S = Number(s.getValue(i + 8 + v * d, "*"));
|
|
24172
|
+
g.push(S !== 0 ? s.UTF8ToString(S) : Number(s.getValue(i + 8 + (v + T) * d, "*")));
|
|
24119
24173
|
}
|
|
24120
24174
|
return [y, w, g];
|
|
24121
24175
|
} finally {
|
|
@@ -24128,35 +24182,35 @@ var init_transformers_node = __esm({
|
|
|
24128
24182
|
}, Qt = async (a, r) => {
|
|
24129
24183
|
let s, f, i = z();
|
|
24130
24184
|
Array.isArray(a) ? [s, f] = a : a.buffer === i.HEAPU8.buffer ? [s, f] = [a.byteOffset, a.byteLength] : [s, f] = xt(a);
|
|
24131
|
-
let
|
|
24185
|
+
let d = 0, l = 0, m = 0, y = [], w = [], T = [];
|
|
24132
24186
|
try {
|
|
24133
|
-
if ([
|
|
24134
|
-
let
|
|
24187
|
+
if ([l, y] = await ps(r), r?.externalData && i.mountExternalData) {
|
|
24188
|
+
let O = [];
|
|
24135
24189
|
for (let W of r.externalData) {
|
|
24136
24190
|
let oe = typeof W == "string" ? W : W.path;
|
|
24137
|
-
|
|
24191
|
+
O.push(Bt(typeof W == "string" ? W : W.data).then((p) => {
|
|
24138
24192
|
i.mountExternalData(oe, p);
|
|
24139
24193
|
}));
|
|
24140
24194
|
}
|
|
24141
|
-
await Promise.all(
|
|
24195
|
+
await Promise.all(O);
|
|
24142
24196
|
}
|
|
24143
|
-
for (let
|
|
24144
|
-
if (i.shouldTransferToMLTensor = false, typeof
|
|
24145
|
-
let oe =
|
|
24197
|
+
for (let O of r?.executionProviders ?? []) if ((typeof O == "string" ? O : O.name) === "webnn") {
|
|
24198
|
+
if (i.shouldTransferToMLTensor = false, typeof O != "string") {
|
|
24199
|
+
let oe = O, p = oe?.context, ne = oe?.gpuDevice, X = oe?.deviceType, J = oe?.powerPreference;
|
|
24146
24200
|
p ? i.currentContext = p : ne ? i.currentContext = await i.webnnCreateMLContext(ne) : i.currentContext = await i.webnnCreateMLContext({ deviceType: X, powerPreference: J });
|
|
24147
24201
|
} else i.currentContext = await i.webnnCreateMLContext();
|
|
24148
24202
|
break;
|
|
24149
24203
|
}
|
|
24150
|
-
|
|
24151
|
-
let [g, v] =
|
|
24152
|
-
for (let
|
|
24153
|
-
let [W, oe, p] =
|
|
24204
|
+
d = await i._OrtCreateSession(s, f, l), i.webgpuOnCreateSession?.(d), d === 0 && $("Can't create a session."), i.jsepOnCreateSession?.(), i.currentContext && (i.webnnRegisterMLContext(d, i.currentContext), i.currentContext = void 0, i.shouldTransferToMLTensor = true);
|
|
24205
|
+
let [g, v] = yc(d), S = !!r?.enableGraphCapture, C = [], R = [], H = [], U = [], M = [];
|
|
24206
|
+
for (let O = 0; O < g; O++) {
|
|
24207
|
+
let [W, oe, p] = Os(d, O);
|
|
24154
24208
|
W === 0 && $("Can't get an input name."), w.push(W);
|
|
24155
24209
|
let ne = i.UTF8ToString(W);
|
|
24156
24210
|
C.push(ne), H.push(oe === 0 ? { name: ne, isTensor: false } : { name: ne, isTensor: true, type: or(oe), shape: p });
|
|
24157
24211
|
}
|
|
24158
|
-
for (let
|
|
24159
|
-
let [W, oe, p] =
|
|
24212
|
+
for (let O = 0; O < v; O++) {
|
|
24213
|
+
let [W, oe, p] = Os(d, O + g);
|
|
24160
24214
|
W === 0 && $("Can't get an output name."), T.push(W);
|
|
24161
24215
|
let ne = i.UTF8ToString(W);
|
|
24162
24216
|
R.push(ne), U.push(oe === 0 ? { name: ne, isTensor: false } : { name: ne, isTensor: true, type: or(oe), shape: p });
|
|
@@ -24166,7 +24220,7 @@ var init_transformers_node = __esm({
|
|
|
24166
24220
|
continue;
|
|
24167
24221
|
}
|
|
24168
24222
|
let X = typeof r?.preferredOutputLocation == "string" ? r.preferredOutputLocation : r?.preferredOutputLocation?.[ne] ?? "cpu", J = i.webnnIsGraphOutput;
|
|
24169
|
-
if (X === "cpu" && J && J(
|
|
24223
|
+
if (X === "cpu" && J && J(d, ne)) {
|
|
24170
24224
|
M.push("ml-tensor-cpu-output");
|
|
24171
24225
|
continue;
|
|
24172
24226
|
}
|
|
@@ -24176,25 +24230,25 @@ var init_transformers_node = __esm({
|
|
|
24176
24230
|
}
|
|
24177
24231
|
}
|
|
24178
24232
|
let Y = null;
|
|
24179
|
-
return M.some((
|
|
24233
|
+
return M.some((O) => O === "gpu-buffer" || O === "ml-tensor" || O === "ml-tensor-cpu-output") && (m = i._OrtCreateBinding(d), m === 0 && $("Can't create IO binding."), Y = { handle: m, outputPreferredLocations: M, outputPreferredLocationsEncoded: M.map((O) => O === "ml-tensor-cpu-output" ? "ml-tensor" : O).map((O) => an(O)) }), it.set(d, [d, w, T, Y, S, false]), [d, C, R, H, U];
|
|
24180
24234
|
} catch (g) {
|
|
24181
|
-
throw w.forEach((v) => i._OrtFree(v)), T.forEach((v) => i._OrtFree(v)), m !== 0 && i._OrtReleaseBinding(m) !== 0 && $("Can't release IO binding."),
|
|
24235
|
+
throw w.forEach((v) => i._OrtFree(v)), T.forEach((v) => i._OrtFree(v)), m !== 0 && i._OrtReleaseBinding(m) !== 0 && $("Can't release IO binding."), d !== 0 && i._OrtReleaseSession(d) !== 0 && $("Can't release session."), g;
|
|
24182
24236
|
} finally {
|
|
24183
|
-
i._free(s),
|
|
24237
|
+
i._free(s), l !== 0 && i._OrtReleaseSessionOptions(l) !== 0 && $("Can't release session options."), y.forEach((g) => i._free(g)), i.unmountExternalData?.();
|
|
24184
24238
|
}
|
|
24185
24239
|
}, Zt = (a) => {
|
|
24186
24240
|
let r = z(), s = it.get(a);
|
|
24187
24241
|
if (!s) throw new Error(`cannot release session. invalid session id: ${a}`);
|
|
24188
|
-
let [f, i,
|
|
24189
|
-
|
|
24190
|
-
},
|
|
24242
|
+
let [f, i, d, l, m] = s;
|
|
24243
|
+
l && (m && r._OrtClearBoundOutputs(l.handle) !== 0 && $("Can't clear bound outputs."), r._OrtReleaseBinding(l.handle) !== 0 && $("Can't release IO binding.")), r.jsepOnReleaseSession?.(a), r.webnnOnReleaseSession?.(a), r.webgpuOnReleaseSession?.(a), i.forEach((y) => r._OrtFree(y)), d.forEach((y) => r._OrtFree(y)), r._OrtReleaseSession(f) !== 0 && $("Can't release session."), it.delete(a);
|
|
24244
|
+
}, Bs = async (a, r, s, f, i, d, l = false) => {
|
|
24191
24245
|
if (!a) {
|
|
24192
24246
|
r.push(0);
|
|
24193
24247
|
return;
|
|
24194
24248
|
}
|
|
24195
24249
|
let m = z(), y = m.PTR_SIZE, w = a[0], T = a[1], g = a[3], v = g, S, C;
|
|
24196
24250
|
if (w === "string" && (g === "gpu-buffer" || g === "ml-tensor")) throw new Error("String tensor is not supported on GPU.");
|
|
24197
|
-
if (
|
|
24251
|
+
if (l && g !== "gpu-buffer") throw new Error(`External buffer must be provided for input/output index ${d} when enableGraphCapture is true.`);
|
|
24198
24252
|
if (g === "gpu-buffer") {
|
|
24199
24253
|
let U = a[2].gpuBuffer;
|
|
24200
24254
|
C = mt(He(w), T);
|
|
@@ -24220,8 +24274,8 @@ var init_transformers_node = __esm({
|
|
|
24220
24274
|
} else {
|
|
24221
24275
|
let M = m.webnnIsGraphInput, Y = m.webnnIsGraphOutput;
|
|
24222
24276
|
if (w !== "string" && M && Y) {
|
|
24223
|
-
let
|
|
24224
|
-
if (M(f,
|
|
24277
|
+
let O = m.UTF8ToString(i);
|
|
24278
|
+
if (M(f, O) || Y(f, O)) {
|
|
24225
24279
|
let W = He(w);
|
|
24226
24280
|
C = mt(W, T), v = "ml-tensor";
|
|
24227
24281
|
let oe = m.webnnCreateTemporaryTensor, p = m.webnnUploadTensor;
|
|
@@ -24236,54 +24290,54 @@ var init_transformers_node = __esm({
|
|
|
24236
24290
|
try {
|
|
24237
24291
|
T.forEach((M, Y) => m.setValue(H + Y * y, M, y === 4 ? "i32" : "i64"));
|
|
24238
24292
|
let U = m._OrtCreateTensor(He(w), S, C, H, T.length, an(v));
|
|
24239
|
-
U === 0 && $(`Can't create tensor for input/output. session=${f}, index=${
|
|
24293
|
+
U === 0 && $(`Can't create tensor for input/output. session=${f}, index=${d}.`), r.push(U);
|
|
24240
24294
|
} finally {
|
|
24241
24295
|
m.stackRestore(R);
|
|
24242
24296
|
}
|
|
24243
|
-
}, Kt = async (a, r, s, f, i,
|
|
24244
|
-
let
|
|
24297
|
+
}, Kt = async (a, r, s, f, i, d) => {
|
|
24298
|
+
let l = z(), m = l.PTR_SIZE, y = it.get(a);
|
|
24245
24299
|
if (!y) throw new Error(`cannot run inference. invalid session id: ${a}`);
|
|
24246
|
-
let w = y[0], T = y[1], g = y[2], v = y[3], S = y[4], C = y[5], R = r.length, H = f.length, U = 0, M = [], Y = [],
|
|
24300
|
+
let w = y[0], T = y[1], g = y[2], v = y[3], S = y[4], C = y[5], R = r.length, H = f.length, U = 0, M = [], Y = [], O = [], W = [], oe = [], p = l.stackSave(), ne = l.stackAlloc(R * m), X = l.stackAlloc(R * m), J = l.stackAlloc(H * m), Ue = l.stackAlloc(H * m);
|
|
24247
24301
|
try {
|
|
24248
|
-
[U, M] = ds(
|
|
24249
|
-
for (let _ = 0; _ < R; _++) await
|
|
24250
|
-
for (let _ = 0; _ < H; _++) await
|
|
24302
|
+
[U, M] = ds(d), $e("wasm prepareInputOutputTensor");
|
|
24303
|
+
for (let _ = 0; _ < R; _++) await Bs(s[_], Y, W, a, T[r[_]], r[_], S);
|
|
24304
|
+
for (let _ = 0; _ < H; _++) await Bs(i[_], O, W, a, g[f[_]], R + f[_], S);
|
|
24251
24305
|
ze("wasm prepareInputOutputTensor");
|
|
24252
|
-
for (let _ = 0; _ < R; _++)
|
|
24253
|
-
for (let _ = 0; _ < H; _++)
|
|
24306
|
+
for (let _ = 0; _ < R; _++) l.setValue(ne + _ * m, Y[_], "*"), l.setValue(X + _ * m, T[r[_]], "*");
|
|
24307
|
+
for (let _ = 0; _ < H; _++) l.setValue(J + _ * m, O[_], "*"), l.setValue(Ue + _ * m, g[f[_]], "*");
|
|
24254
24308
|
if (v && !C) {
|
|
24255
|
-
let { handle: _, outputPreferredLocations: ae, outputPreferredLocationsEncoded:
|
|
24309
|
+
let { handle: _, outputPreferredLocations: ae, outputPreferredLocationsEncoded: me } = v;
|
|
24256
24310
|
if (T.length !== R) throw new Error(`input count from feeds (${R}) is expected to be always equal to model's input count (${T.length}).`);
|
|
24257
24311
|
$e("wasm bindInputsOutputs");
|
|
24258
24312
|
for (let q = 0; q < R; q++) {
|
|
24259
24313
|
let we = r[q];
|
|
24260
|
-
await
|
|
24314
|
+
await l._OrtBindInput(_, T[we], Y[q]) !== 0 && $(`Can't bind input[${q}] for session=${a}.`);
|
|
24261
24315
|
}
|
|
24262
24316
|
for (let q = 0; q < H; q++) {
|
|
24263
24317
|
let we = f[q];
|
|
24264
|
-
i[q]?.[3] ? (oe.push(
|
|
24318
|
+
i[q]?.[3] ? (oe.push(O[q]), l._OrtBindOutput(_, g[we], O[q], 0) !== 0 && $(`Can't bind pre-allocated output[${q}] for session=${a}.`)) : l._OrtBindOutput(_, g[we], 0, me[we]) !== 0 && $(`Can't bind output[${q}] to ${ae[q]} for session=${a}.`);
|
|
24265
24319
|
}
|
|
24266
24320
|
ze("wasm bindInputsOutputs"), it.set(a, [w, T, g, v, S, true]);
|
|
24267
24321
|
}
|
|
24268
|
-
|
|
24322
|
+
l.jsepOnRunStart?.(w), l.webnnOnRunStart?.(w);
|
|
24269
24323
|
let Q;
|
|
24270
|
-
v ? Q = await
|
|
24324
|
+
v ? Q = await l._OrtRunWithBinding(w, v.handle, H, J, U) : Q = await l._OrtRun(w, X, ne, R, Ue, H, J, U), Q !== 0 && $("failed to call OrtRun().");
|
|
24271
24325
|
let x = [], A = [];
|
|
24272
24326
|
$e("wasm ProcessOutputTensor");
|
|
24273
24327
|
for (let _ = 0; _ < H; _++) {
|
|
24274
|
-
let ae = Number(
|
|
24275
|
-
if (ae ===
|
|
24276
|
-
x.push(i[_]), ae !==
|
|
24328
|
+
let ae = Number(l.getValue(J + _ * m, "*"));
|
|
24329
|
+
if (ae === O[_] || oe.includes(O[_])) {
|
|
24330
|
+
x.push(i[_]), ae !== O[_] && l._OrtReleaseTensor(ae) !== 0 && $("Can't release tensor.");
|
|
24277
24331
|
continue;
|
|
24278
24332
|
}
|
|
24279
|
-
let
|
|
24333
|
+
let me = l.stackSave(), q = l.stackAlloc(4 * m), we = false, re, se = 0;
|
|
24280
24334
|
try {
|
|
24281
|
-
|
|
24282
|
-
let Te = m === 4 ? "i32" : "i64", Ye = Number(
|
|
24283
|
-
se =
|
|
24284
|
-
let bt =
|
|
24285
|
-
for (let ee = 0; ee < wt; ee++) Se.push(Number(
|
|
24286
|
-
|
|
24335
|
+
l._OrtGetTensorData(ae, q, q + m, q + 2 * m, q + 3 * m) !== 0 && $(`Can't access output tensor data on index ${_}.`);
|
|
24336
|
+
let Te = m === 4 ? "i32" : "i64", Ye = Number(l.getValue(q, Te));
|
|
24337
|
+
se = l.getValue(q + m, "*");
|
|
24338
|
+
let bt = l.getValue(q + m * 2, "*"), wt = Number(l.getValue(q + m * 3, Te)), Se = [];
|
|
24339
|
+
for (let ee = 0; ee < wt; ee++) Se.push(Number(l.getValue(bt + ee * m, Te)));
|
|
24340
|
+
l._OrtFree(bt) !== 0 && $("Can't free memory for tensor dims.");
|
|
24287
24341
|
let Ae = Se.reduce((ee, Z) => ee * Z, 1);
|
|
24288
24342
|
re = or(Ye);
|
|
24289
24343
|
let Oe = v?.outputPreferredLocations[f[_]];
|
|
@@ -24291,58 +24345,58 @@ var init_transformers_node = __esm({
|
|
|
24291
24345
|
if (Oe === "gpu-buffer" || Oe === "ml-tensor") throw new Error("String tensor is not supported on GPU.");
|
|
24292
24346
|
let ee = [];
|
|
24293
24347
|
for (let Z = 0; Z < Ae; Z++) {
|
|
24294
|
-
let G =
|
|
24295
|
-
ee.push(
|
|
24348
|
+
let G = l.getValue(se + Z * m, "*"), V = l.getValue(se + (Z + 1) * m, "*"), qe = Z === Ae - 1 ? void 0 : V - G;
|
|
24349
|
+
ee.push(l.UTF8ToString(G, qe));
|
|
24296
24350
|
}
|
|
24297
24351
|
x.push([re, Se, ee, "cpu"]);
|
|
24298
24352
|
} else if (Oe === "gpu-buffer" && Ae > 0) {
|
|
24299
|
-
let ee =
|
|
24353
|
+
let ee = l.webgpuGetBuffer;
|
|
24300
24354
|
if (!ee) throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');
|
|
24301
24355
|
let Z = ee(se), G = mt(Ye, Ae);
|
|
24302
24356
|
if (G === void 0 || !ar(re)) throw new Error(`Unsupported data type: ${re}`);
|
|
24303
24357
|
we = true;
|
|
24304
24358
|
{
|
|
24305
|
-
|
|
24306
|
-
let V =
|
|
24359
|
+
l.webgpuRegisterBuffer(Z, a, se);
|
|
24360
|
+
let V = l.webgpuCreateDownloader(Z, G, a);
|
|
24307
24361
|
x.push([re, Se, { gpuBuffer: Z, download: async () => {
|
|
24308
24362
|
let qe = await V();
|
|
24309
24363
|
return new (at(re))(qe);
|
|
24310
24364
|
}, dispose: () => {
|
|
24311
|
-
|
|
24365
|
+
l._OrtReleaseTensor(ae) !== 0 && $("Can't release tensor.");
|
|
24312
24366
|
} }, "gpu-buffer"]);
|
|
24313
24367
|
}
|
|
24314
24368
|
} else if (Oe === "ml-tensor" && Ae > 0) {
|
|
24315
|
-
let ee =
|
|
24369
|
+
let ee = l.webnnEnsureTensor, Z = l.webnnIsGraphInputOutputTypeSupported;
|
|
24316
24370
|
if (!ee || !Z) throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');
|
|
24317
24371
|
if (mt(Ye, Ae) === void 0 || !sr(re)) throw new Error(`Unsupported data type: ${re}`);
|
|
24318
24372
|
if (!Z(a, re, false)) throw new Error(`preferredLocation "ml-tensor" for ${re} output is not supported by current WebNN Context.`);
|
|
24319
24373
|
let V = await ee(a, se, Ye, Se, false);
|
|
24320
|
-
we = true, x.push([re, Se, { mlTensor: V, download:
|
|
24321
|
-
|
|
24374
|
+
we = true, x.push([re, Se, { mlTensor: V, download: l.webnnCreateMLTensorDownloader(se, re), dispose: () => {
|
|
24375
|
+
l.webnnReleaseTensorId(se), l._OrtReleaseTensor(ae);
|
|
24322
24376
|
} }, "ml-tensor"]);
|
|
24323
24377
|
} else if (Oe === "ml-tensor-cpu-output" && Ae > 0) {
|
|
24324
|
-
let ee =
|
|
24378
|
+
let ee = l.webnnCreateMLTensorDownloader(se, re)(), Z = x.length;
|
|
24325
24379
|
we = true, A.push((async () => {
|
|
24326
24380
|
let G = [Z, await ee];
|
|
24327
|
-
return
|
|
24381
|
+
return l.webnnReleaseTensorId(se), l._OrtReleaseTensor(ae), G;
|
|
24328
24382
|
})()), x.push([re, Se, [], "cpu"]);
|
|
24329
24383
|
} else {
|
|
24330
24384
|
let ee = at(re), Z = new ee(Ae);
|
|
24331
|
-
new Uint8Array(Z.buffer, Z.byteOffset, Z.byteLength).set(
|
|
24385
|
+
new Uint8Array(Z.buffer, Z.byteOffset, Z.byteLength).set(l.HEAPU8.subarray(se, se + Z.byteLength)), x.push([re, Se, Z, "cpu"]);
|
|
24332
24386
|
}
|
|
24333
24387
|
} finally {
|
|
24334
|
-
|
|
24388
|
+
l.stackRestore(me), re === "string" && se && l._free(se), we || l._OrtReleaseTensor(ae);
|
|
24335
24389
|
}
|
|
24336
24390
|
}
|
|
24337
|
-
v && !S && (
|
|
24391
|
+
v && !S && (l._OrtClearBoundOutputs(v.handle) !== 0 && $("Can't clear bound outputs."), it.set(a, [w, T, g, v, S, false]));
|
|
24338
24392
|
for (let [_, ae] of await Promise.all(A)) x[_][2] = ae;
|
|
24339
24393
|
return ze("wasm ProcessOutputTensor"), x;
|
|
24340
24394
|
} finally {
|
|
24341
|
-
|
|
24342
|
-
Q && Q[3] === "gpu-buffer" &&
|
|
24395
|
+
l.webnnOnRunEnd?.(w), l.stackRestore(p), s.forEach((Q) => {
|
|
24396
|
+
Q && Q[3] === "gpu-buffer" && l.webgpuUnregisterBuffer(Q[2].gpuBuffer);
|
|
24343
24397
|
}), i.forEach((Q) => {
|
|
24344
|
-
Q && Q[3] === "gpu-buffer" &&
|
|
24345
|
-
}), Y.forEach((Q) =>
|
|
24398
|
+
Q && Q[3] === "gpu-buffer" && l.webgpuUnregisterBuffer(Q[2].gpuBuffer);
|
|
24399
|
+
}), Y.forEach((Q) => l._OrtReleaseTensor(Q)), O.forEach((Q) => l._OrtReleaseTensor(Q)), W.forEach((Q) => l._free(Q)), U !== 0 && l._OrtReleaseRunOptions(U), M.forEach((Q) => l._free(Q));
|
|
24346
24400
|
}
|
|
24347
24401
|
}, er = (a) => {
|
|
24348
24402
|
let r = z(), s = it.get(a);
|
|
@@ -24364,15 +24418,15 @@ var init_transformers_node = __esm({
|
|
|
24364
24418
|
Kr();
|
|
24365
24419
|
je();
|
|
24366
24420
|
Yt();
|
|
24367
|
-
ut = () => !!K.wasm.proxy && typeof document < "u", Mt = false,
|
|
24421
|
+
ut = () => !!K.wasm.proxy && typeof document < "u", Mt = false, dr = false, lr = false, pn = /* @__PURE__ */ new Map(), ht = (a, r) => {
|
|
24368
24422
|
let s = pn.get(a);
|
|
24369
24423
|
s ? s.push(r) : pn.set(a, [r]);
|
|
24370
24424
|
}, yt = () => {
|
|
24371
|
-
if (Mt || !
|
|
24372
|
-
},
|
|
24425
|
+
if (Mt || !dr || lr || !Ee) throw new Error("worker not ready");
|
|
24426
|
+
}, wc = (a) => {
|
|
24373
24427
|
switch (a.data.type) {
|
|
24374
24428
|
case "init-wasm":
|
|
24375
|
-
Mt = false, a.data.err ? (
|
|
24429
|
+
Mt = false, a.data.err ? (lr = true, ln[1](a.data.err)) : (dr = true, ln[0]()), cr && (URL.revokeObjectURL(cr), cr = void 0);
|
|
24376
24430
|
break;
|
|
24377
24431
|
case "init-ep":
|
|
24378
24432
|
case "copy-from":
|
|
@@ -24386,14 +24440,14 @@ var init_transformers_node = __esm({
|
|
|
24386
24440
|
}
|
|
24387
24441
|
default:
|
|
24388
24442
|
}
|
|
24389
|
-
},
|
|
24390
|
-
if (!
|
|
24443
|
+
}, Ms = async () => {
|
|
24444
|
+
if (!dr) {
|
|
24391
24445
|
if (Mt) throw new Error("multiple calls to 'initWasm()' detected.");
|
|
24392
|
-
if (
|
|
24446
|
+
if (lr) throw new Error("previous call to 'initWasm()' failed.");
|
|
24393
24447
|
if (Mt = true, ut()) return new Promise((a, r) => {
|
|
24394
|
-
Ee?.terminate(),
|
|
24448
|
+
Ee?.terminate(), us().then(([s, f]) => {
|
|
24395
24449
|
try {
|
|
24396
|
-
Ee = f, Ee.onerror = (
|
|
24450
|
+
Ee = f, Ee.onerror = (d) => r(d), Ee.onmessage = wc, ln = [a, r];
|
|
24397
24451
|
let i = { type: "init-wasm", in: K };
|
|
24398
24452
|
!i.in.wasm.wasmPaths && (s || tn) && (i.in.wasm.wasmPaths = { wasm: new URL("ort-wasm-simd-threaded.asyncify.wasm", import.meta.url).href }), Ee.postMessage(i), cr = s;
|
|
24399
24453
|
} catch (i) {
|
|
@@ -24402,51 +24456,51 @@ var init_transformers_node = __esm({
|
|
|
24402
24456
|
}, r);
|
|
24403
24457
|
});
|
|
24404
24458
|
try {
|
|
24405
|
-
await qt(K.wasm), await Jt(K),
|
|
24459
|
+
await qt(K.wasm), await Jt(K), dr = true;
|
|
24406
24460
|
} catch (a) {
|
|
24407
|
-
throw
|
|
24461
|
+
throw lr = true, a;
|
|
24408
24462
|
} finally {
|
|
24409
24463
|
Mt = false;
|
|
24410
24464
|
}
|
|
24411
24465
|
}
|
|
24412
|
-
},
|
|
24466
|
+
}, Cs = async (a) => {
|
|
24413
24467
|
if (ut()) return yt(), new Promise((r, s) => {
|
|
24414
24468
|
ht("init-ep", [r, s]);
|
|
24415
24469
|
let f = { type: "init-ep", in: { epName: a, env: K } };
|
|
24416
24470
|
Ee.postMessage(f);
|
|
24417
24471
|
});
|
|
24418
24472
|
await Xt(K, a);
|
|
24419
|
-
},
|
|
24473
|
+
}, Us = async (a) => ut() ? (yt(), new Promise((r, s) => {
|
|
24420
24474
|
ht("copy-from", [r, s]);
|
|
24421
24475
|
let f = { type: "copy-from", in: { buffer: a } };
|
|
24422
24476
|
Ee.postMessage(f, [a.buffer]);
|
|
24423
|
-
})) : xt(a),
|
|
24477
|
+
})) : xt(a), Ds = async (a, r) => {
|
|
24424
24478
|
if (ut()) {
|
|
24425
24479
|
if (r?.preferredOutputLocation) throw new Error('session option "preferredOutputLocation" is not supported for proxy.');
|
|
24426
24480
|
return yt(), new Promise((s, f) => {
|
|
24427
24481
|
ht("create", [s, f]);
|
|
24428
|
-
let i = { type: "create", in: { model: a, options: { ...r } } },
|
|
24429
|
-
a instanceof Uint8Array &&
|
|
24482
|
+
let i = { type: "create", in: { model: a, options: { ...r } } }, d = [];
|
|
24483
|
+
a instanceof Uint8Array && d.push(a.buffer), Ee.postMessage(i, d);
|
|
24430
24484
|
});
|
|
24431
24485
|
} else return Qt(a, r);
|
|
24432
|
-
},
|
|
24486
|
+
}, Ps = async (a) => {
|
|
24433
24487
|
if (ut()) return yt(), new Promise((r, s) => {
|
|
24434
24488
|
ht("release", [r, s]);
|
|
24435
24489
|
let f = { type: "release", in: a };
|
|
24436
24490
|
Ee.postMessage(f);
|
|
24437
24491
|
});
|
|
24438
24492
|
Zt(a);
|
|
24439
|
-
},
|
|
24493
|
+
}, _s = async (a, r, s, f, i, d) => {
|
|
24440
24494
|
if (ut()) {
|
|
24441
|
-
if (s.some((
|
|
24442
|
-
if (i.some((
|
|
24443
|
-
return yt(), new Promise((
|
|
24444
|
-
ht("run", [
|
|
24445
|
-
let y = s, w = { type: "run", in: { sessionId: a, inputIndices: r, inputs: y, outputIndices: f, options:
|
|
24495
|
+
if (s.some((l) => l[3] !== "cpu")) throw new Error("input tensor on GPU is not supported for proxy.");
|
|
24496
|
+
if (i.some((l) => l)) throw new Error("pre-allocated output tensor is not supported for proxy.");
|
|
24497
|
+
return yt(), new Promise((l, m) => {
|
|
24498
|
+
ht("run", [l, m]);
|
|
24499
|
+
let y = s, w = { type: "run", in: { sessionId: a, inputIndices: r, inputs: y, outputIndices: f, options: d } };
|
|
24446
24500
|
Ee.postMessage(w, tr(y));
|
|
24447
24501
|
});
|
|
24448
|
-
} else return Kt(a, r, s, f, i,
|
|
24449
|
-
},
|
|
24502
|
+
} else return Kt(a, r, s, f, i, d);
|
|
24503
|
+
}, Rs = async (a) => {
|
|
24450
24504
|
if (ut()) return yt(), new Promise((r, s) => {
|
|
24451
24505
|
ht("end-profiling", [r, s]);
|
|
24452
24506
|
let f = { type: "end-profiling", in: a };
|
|
@@ -24455,14 +24509,14 @@ var init_transformers_node = __esm({
|
|
|
24455
24509
|
er(a);
|
|
24456
24510
|
};
|
|
24457
24511
|
});
|
|
24458
|
-
|
|
24512
|
+
ks = k(() => {
|
|
24459
24513
|
"use strict";
|
|
24460
24514
|
Ve();
|
|
24461
24515
|
mn();
|
|
24462
24516
|
st();
|
|
24463
24517
|
Ht();
|
|
24464
24518
|
sn();
|
|
24465
|
-
|
|
24519
|
+
Ns = (a, r) => {
|
|
24466
24520
|
switch (a.location) {
|
|
24467
24521
|
case "cpu":
|
|
24468
24522
|
return [a.type, a.dims, a.data, "cpu"];
|
|
@@ -24473,7 +24527,7 @@ var init_transformers_node = __esm({
|
|
|
24473
24527
|
default:
|
|
24474
24528
|
throw new Error(`invalid data location: ${a.location} for ${r()}`);
|
|
24475
24529
|
}
|
|
24476
|
-
},
|
|
24530
|
+
}, gc = (a) => {
|
|
24477
24531
|
switch (a[3]) {
|
|
24478
24532
|
case "cpu":
|
|
24479
24533
|
return new Le(a[0], a[2], a[1]);
|
|
@@ -24494,49 +24548,49 @@ var init_transformers_node = __esm({
|
|
|
24494
24548
|
}
|
|
24495
24549
|
}, pr = class {
|
|
24496
24550
|
async fetchModelAndCopyToWasmMemory(r) {
|
|
24497
|
-
return
|
|
24551
|
+
return Us(await Bt(r));
|
|
24498
24552
|
}
|
|
24499
24553
|
async loadModel(r, s) {
|
|
24500
24554
|
tt();
|
|
24501
24555
|
let f;
|
|
24502
|
-
typeof r == "string" ? f = await this.fetchModelAndCopyToWasmMemory(r) : f = r, [this.sessionId, this.inputNames, this.outputNames, this.inputMetadata, this.outputMetadata] = await
|
|
24556
|
+
typeof r == "string" ? f = await this.fetchModelAndCopyToWasmMemory(r) : f = r, [this.sessionId, this.inputNames, this.outputNames, this.inputMetadata, this.outputMetadata] = await Ds(f, s), rt();
|
|
24503
24557
|
}
|
|
24504
24558
|
async dispose() {
|
|
24505
|
-
return
|
|
24559
|
+
return Ps(this.sessionId);
|
|
24506
24560
|
}
|
|
24507
24561
|
async run(r, s, f) {
|
|
24508
24562
|
tt();
|
|
24509
|
-
let i = [],
|
|
24563
|
+
let i = [], d = [];
|
|
24510
24564
|
Object.entries(r).forEach((v) => {
|
|
24511
24565
|
let S = v[0], C = v[1], R = this.inputNames.indexOf(S);
|
|
24512
24566
|
if (R === -1) throw new Error(`invalid input '${S}'`);
|
|
24513
|
-
i.push(C),
|
|
24567
|
+
i.push(C), d.push(R);
|
|
24514
24568
|
});
|
|
24515
|
-
let
|
|
24569
|
+
let l = [], m = [];
|
|
24516
24570
|
Object.entries(s).forEach((v) => {
|
|
24517
24571
|
let S = v[0], C = v[1], R = this.outputNames.indexOf(S);
|
|
24518
24572
|
if (R === -1) throw new Error(`invalid output '${S}'`);
|
|
24519
|
-
|
|
24573
|
+
l.push(C), m.push(R);
|
|
24520
24574
|
});
|
|
24521
|
-
let y = i.map((v, S) =>
|
|
24522
|
-
for (let v = 0; v < T.length; v++) g[this.outputNames[m[v]]] =
|
|
24575
|
+
let y = i.map((v, S) => Ns(v, () => `input "${this.inputNames[d[S]]}"`)), w = l.map((v, S) => v ? Ns(v, () => `output "${this.outputNames[m[S]]}"`) : null), T = await _s(this.sessionId, d, y, m, w, f), g = {};
|
|
24576
|
+
for (let v = 0; v < T.length; v++) g[this.outputNames[m[v]]] = l[v] ?? gc(T[v]);
|
|
24523
24577
|
return rt(), g;
|
|
24524
24578
|
}
|
|
24525
24579
|
startProfiling() {
|
|
24526
24580
|
}
|
|
24527
24581
|
endProfiling() {
|
|
24528
|
-
|
|
24582
|
+
Rs(this.sessionId);
|
|
24529
24583
|
}
|
|
24530
24584
|
};
|
|
24531
24585
|
});
|
|
24532
|
-
|
|
24533
|
-
At(
|
|
24534
|
-
|
|
24586
|
+
Fs = {};
|
|
24587
|
+
At(Fs, { OnnxruntimeWebAssemblyBackend: () => mr, initializeFlags: () => Ws, wasmBackend: () => Tc });
|
|
24588
|
+
Gs = k(() => {
|
|
24535
24589
|
"use strict";
|
|
24536
24590
|
Ve();
|
|
24537
24591
|
mn();
|
|
24538
|
-
|
|
24539
|
-
|
|
24592
|
+
ks();
|
|
24593
|
+
Ws = () => {
|
|
24540
24594
|
(typeof K.wasm.initTimeout != "number" || K.wasm.initTimeout < 0) && (K.wasm.initTimeout = 0);
|
|
24541
24595
|
let a = K.wasm.simd;
|
|
24542
24596
|
if (typeof a != "boolean" && a !== void 0 && a !== "fixed" && a !== "relaxed" && (console.warn(`Property "env.wasm.simd" is set to unknown value "${a}". Reset it to \`false\` and ignore SIMD feature checking.`), K.wasm.simd = false), typeof K.wasm.proxy != "boolean" && (K.wasm.proxy = false), typeof K.wasm.trace != "boolean" && (K.wasm.trace = false), typeof K.wasm.numThreads != "number" || !Number.isInteger(K.wasm.numThreads) || K.wasm.numThreads <= 0) if (typeof self < "u" && !self.crossOriginIsolated) K.wasm.numThreads = 1;
|
|
@@ -24546,24 +24600,24 @@ var init_transformers_node = __esm({
|
|
|
24546
24600
|
}
|
|
24547
24601
|
}, mr = class {
|
|
24548
24602
|
async init(r) {
|
|
24549
|
-
|
|
24603
|
+
Ws(), await Ms(), await Cs(r);
|
|
24550
24604
|
}
|
|
24551
24605
|
async createInferenceSessionHandler(r, s) {
|
|
24552
24606
|
let f = new pr();
|
|
24553
24607
|
return await f.loadModel(r, s), f;
|
|
24554
24608
|
}
|
|
24555
|
-
},
|
|
24609
|
+
}, Tc = new mr();
|
|
24556
24610
|
});
|
|
24557
24611
|
Ve();
|
|
24558
24612
|
Ve();
|
|
24559
24613
|
Ve();
|
|
24560
|
-
|
|
24561
|
-
|
|
24614
|
+
Ja = "1.26.0-dev.20260410-5e55544225";
|
|
24615
|
+
gl = Zr;
|
|
24562
24616
|
{
|
|
24563
|
-
let a = (
|
|
24617
|
+
let a = (Gs(), $t(Fs)).wasmBackend;
|
|
24564
24618
|
Ke("webgpu", a, 5), Ke("webnn", a, 5), Ke("cpu", a, 10), Ke("wasm", a, 10);
|
|
24565
24619
|
}
|
|
24566
|
-
Object.defineProperty(K.versions, "web", { value:
|
|
24620
|
+
Object.defineProperty(K.versions, "web", { value: Ja, enumerable: true });
|
|
24567
24621
|
DEVICE_TO_EXECUTION_PROVIDER_MAPPING = Object.freeze({
|
|
24568
24622
|
auto: null,
|
|
24569
24623
|
// Auto-detect based on device and environment
|
|
@@ -25776,8 +25830,14 @@ var init_transformers_node = __esm({
|
|
|
25776
25830
|
uint8: "uint8",
|
|
25777
25831
|
q4: "q4",
|
|
25778
25832
|
bnb4: "bnb4",
|
|
25779
|
-
q4f16: "q4f16"
|
|
25780
|
-
// fp16 model with
|
|
25833
|
+
q4f16: "q4f16",
|
|
25834
|
+
// fp16 model with 4-bit block weight quantization
|
|
25835
|
+
q2: "q2",
|
|
25836
|
+
q2f16: "q2f16",
|
|
25837
|
+
// fp16 model with 2-bit block weight quantization
|
|
25838
|
+
q1: "q1",
|
|
25839
|
+
q1f16: "q1f16"
|
|
25840
|
+
// fp16 model with 1-bit block weight quantization
|
|
25781
25841
|
});
|
|
25782
25842
|
DEFAULT_DEVICE_DTYPE = DATA_TYPES.fp32;
|
|
25783
25843
|
DEFAULT_DEVICE_DTYPE_MAPPING = Object.freeze({
|
|
@@ -25791,7 +25851,11 @@ var init_transformers_node = __esm({
|
|
|
25791
25851
|
[DATA_TYPES.uint8]: "_uint8",
|
|
25792
25852
|
[DATA_TYPES.q8]: "_quantized",
|
|
25793
25853
|
[DATA_TYPES.q4]: "_q4",
|
|
25854
|
+
[DATA_TYPES.q2]: "_q2",
|
|
25855
|
+
[DATA_TYPES.q1]: "_q1",
|
|
25794
25856
|
[DATA_TYPES.q4f16]: "_q4f16",
|
|
25857
|
+
[DATA_TYPES.q2f16]: "_q2f16",
|
|
25858
|
+
[DATA_TYPES.q1f16]: "_q1f16",
|
|
25795
25859
|
[DATA_TYPES.bnb4]: "_bnb4"
|
|
25796
25860
|
});
|
|
25797
25861
|
DataTypeMap = Object.freeze({
|
|
@@ -26591,7 +26655,8 @@ var init_transformers_node = __esm({
|
|
|
26591
26655
|
"mask_token"
|
|
26592
26656
|
// additional_special_tokens (TODO)
|
|
26593
26657
|
];
|
|
26594
|
-
PreTrainedTokenizer = class extends
|
|
26658
|
+
PreTrainedTokenizer = class extends /** @type {new (tokenizerJSON: Object, tokenizerConfig: Object) => PreTrainedTokenizerCallback} */
|
|
26659
|
+
Callable {
|
|
26595
26660
|
return_token_type_ids = false;
|
|
26596
26661
|
padding_side = "right";
|
|
26597
26662
|
/**
|
|
@@ -26685,37 +26750,21 @@ var init_transformers_node = __esm({
|
|
|
26685
26750
|
);
|
|
26686
26751
|
}
|
|
26687
26752
|
}
|
|
26688
|
-
/**
|
|
26689
|
-
* @typedef {number[]|number[][]|Tensor} BatchEncodingItem
|
|
26690
|
-
*
|
|
26691
|
-
* @typedef {Object} BatchEncoding Holds the output of the tokenizer's call function.
|
|
26692
|
-
* @property {BatchEncodingItem} input_ids List of token ids to be fed to a model.
|
|
26693
|
-
* @property {BatchEncodingItem} attention_mask List of indices specifying which tokens should be attended to by the model.
|
|
26694
|
-
* @property {BatchEncodingItem} [token_type_ids] List of token type ids to be fed to a model.
|
|
26695
|
-
*/
|
|
26696
26753
|
/**
|
|
26697
26754
|
* Encode/tokenize the given text(s).
|
|
26698
|
-
* @
|
|
26699
|
-
* @
|
|
26700
|
-
* @param {
|
|
26701
|
-
* @param {
|
|
26702
|
-
* @
|
|
26703
|
-
|
|
26704
|
-
|
|
26705
|
-
|
|
26706
|
-
|
|
26707
|
-
|
|
26708
|
-
|
|
26709
|
-
|
|
26710
|
-
|
|
26711
|
-
add_special_tokens = true,
|
|
26712
|
-
padding = false,
|
|
26713
|
-
truncation = null,
|
|
26714
|
-
max_length = null,
|
|
26715
|
-
return_tensor = true,
|
|
26716
|
-
// Different to HF
|
|
26717
|
-
return_token_type_ids = null
|
|
26718
|
-
} = {}) {
|
|
26755
|
+
* @template {string|string[]} TText
|
|
26756
|
+
* @template {boolean} [TReturnTensor=true]
|
|
26757
|
+
* @param {TText} text The text to tokenize.
|
|
26758
|
+
* @param {TokenizerCallOptions<TText, TReturnTensor>} [options] Additional tokenization options.
|
|
26759
|
+
* @returns {BatchEncoding<BatchEncodingItem<TText, TReturnTensor>>} Object to be passed to the model.
|
|
26760
|
+
*/
|
|
26761
|
+
_call(text, options = {}) {
|
|
26762
|
+
const { text_pair = null, add_special_tokens = true, padding = false, return_token_type_ids = null } = options;
|
|
26763
|
+
let { truncation = null, max_length = null } = options;
|
|
26764
|
+
const return_tensor = (
|
|
26765
|
+
/** @type {TReturnTensor} */
|
|
26766
|
+
options.return_tensor ?? true
|
|
26767
|
+
);
|
|
26719
26768
|
const isBatched = Array.isArray(text);
|
|
26720
26769
|
let encodedTokens;
|
|
26721
26770
|
if (isBatched) {
|
|
@@ -26819,7 +26868,7 @@ var init_transformers_node = __esm({
|
|
|
26819
26868
|
}
|
|
26820
26869
|
}
|
|
26821
26870
|
return (
|
|
26822
|
-
/** @type {BatchEncoding} */
|
|
26871
|
+
/** @type {BatchEncoding<BatchEncodingItem<TText, TReturnTensor>>} */
|
|
26823
26872
|
result
|
|
26824
26873
|
);
|
|
26825
26874
|
}
|
|
@@ -27005,7 +27054,10 @@ var init_transformers_node = __esm({
|
|
|
27005
27054
|
*
|
|
27006
27055
|
* @param {Message[]} conversation A list of message objects with `"role"` and `"content"` keys,
|
|
27007
27056
|
* representing the chat history so far.
|
|
27008
|
-
* @
|
|
27057
|
+
* @template {boolean} [TTokenize=true]
|
|
27058
|
+
* @template {boolean} [TReturnTensor=true]
|
|
27059
|
+
* @template {boolean} [TReturnDict=true]
|
|
27060
|
+
* @param {Object} [options] An optional object containing the following properties:
|
|
27009
27061
|
* @param {string|null} [options.chat_template=null] A Jinja template to use for this conversion. If
|
|
27010
27062
|
* this is not passed, the model's chat template will be used instead.
|
|
27011
27063
|
* @param {Object[]} [options.tools=null]
|
|
@@ -27024,30 +27076,43 @@ var init_transformers_node = __esm({
|
|
|
27024
27076
|
* the start of an assistant message. This is useful when you want to generate a response from the model.
|
|
27025
27077
|
* Note that this argument will be passed to the chat template, and so it must be supported in the
|
|
27026
27078
|
* template for this argument to have any effect.
|
|
27027
|
-
* @param {
|
|
27079
|
+
* @param {TTokenize} [options.tokenize=true] Whether to tokenize the output. If false, the output will be a string.
|
|
27028
27080
|
* @param {boolean} [options.padding=false] Whether to pad sequences to the maximum length. Has no effect if tokenize is false.
|
|
27029
27081
|
* @param {boolean} [options.truncation=false] Whether to truncate sequences to the maximum length. Has no effect if tokenize is false.
|
|
27030
27082
|
* @param {number|null} [options.max_length=null] Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is false.
|
|
27031
27083
|
* If not specified, the tokenizer's `max_length` attribute will be used as a default.
|
|
27032
|
-
* @param {
|
|
27033
|
-
* @param {
|
|
27084
|
+
* @param {TReturnTensor} [options.return_tensor=true] Whether to return the output as a Tensor or an Array. Has no effect if tokenize is false.
|
|
27085
|
+
* @param {TReturnDict} [options.return_dict=true] Whether to return a dictionary with named outputs. Has no effect if tokenize is false.
|
|
27034
27086
|
* @param {Object} [options.tokenizer_kwargs={}] Additional options to pass to the tokenizer.
|
|
27035
|
-
* @returns {
|
|
27036
|
-
*/
|
|
27037
|
-
apply_chat_template(conversation,
|
|
27038
|
-
|
|
27039
|
-
|
|
27040
|
-
|
|
27041
|
-
|
|
27042
|
-
|
|
27043
|
-
|
|
27044
|
-
|
|
27045
|
-
|
|
27046
|
-
|
|
27047
|
-
|
|
27048
|
-
|
|
27049
|
-
|
|
27050
|
-
|
|
27087
|
+
* @returns {ApplyChatTemplateReturn<TTokenize, TReturnTensor, TReturnDict>} The tokenized output.
|
|
27088
|
+
*/
|
|
27089
|
+
apply_chat_template(conversation, options = (
|
|
27090
|
+
/** @type {ApplyChatTemplateOptions<TTokenize, TReturnTensor, TReturnDict>} */
|
|
27091
|
+
{}
|
|
27092
|
+
)) {
|
|
27093
|
+
let {
|
|
27094
|
+
tools = null,
|
|
27095
|
+
documents = null,
|
|
27096
|
+
chat_template = null,
|
|
27097
|
+
add_generation_prompt = false,
|
|
27098
|
+
tokenize: tokenize2 = (
|
|
27099
|
+
/** @type {TTokenize} */
|
|
27100
|
+
true
|
|
27101
|
+
),
|
|
27102
|
+
padding = false,
|
|
27103
|
+
truncation = false,
|
|
27104
|
+
max_length = null,
|
|
27105
|
+
return_tensor = (
|
|
27106
|
+
/** @type {TReturnTensor} */
|
|
27107
|
+
true
|
|
27108
|
+
),
|
|
27109
|
+
return_dict = (
|
|
27110
|
+
/** @type {TReturnDict} */
|
|
27111
|
+
true
|
|
27112
|
+
),
|
|
27113
|
+
tokenizer_kwargs = {},
|
|
27114
|
+
...kwargs
|
|
27115
|
+
} = options;
|
|
27051
27116
|
chat_template = this.get_chat_template({ chat_template, tools });
|
|
27052
27117
|
if (typeof chat_template !== "string") {
|
|
27053
27118
|
throw Error(`chat_template must be a string, but got ${typeof chat_template}`);
|
|
@@ -27081,9 +27146,15 @@ var init_transformers_node = __esm({
|
|
|
27081
27146
|
return_tensor,
|
|
27082
27147
|
...tokenizer_kwargs
|
|
27083
27148
|
});
|
|
27084
|
-
return
|
|
27149
|
+
return (
|
|
27150
|
+
/** @type {ApplyChatTemplateReturn<TTokenize, TReturnTensor, TReturnDict>} */
|
|
27151
|
+
return_dict ? out : out.input_ids
|
|
27152
|
+
);
|
|
27085
27153
|
}
|
|
27086
|
-
return
|
|
27154
|
+
return (
|
|
27155
|
+
/** @type {ApplyChatTemplateReturn<TTokenize, TReturnTensor, TReturnDict>} */
|
|
27156
|
+
rendered
|
|
27157
|
+
);
|
|
27087
27158
|
}
|
|
27088
27159
|
};
|
|
27089
27160
|
tokenizers_exports = {};
|
|
@@ -28160,6 +28231,7 @@ var init_transformers_node = __esm({
|
|
|
28160
28231
|
WeSpeakerFeatureExtractor: () => WeSpeakerFeatureExtractor,
|
|
28161
28232
|
WhisperFeatureExtractor: () => WhisperFeatureExtractor
|
|
28162
28233
|
});
|
|
28234
|
+
read_audio = load_audio;
|
|
28163
28235
|
HERTZ_TO_MEL_MAPPING = {
|
|
28164
28236
|
htk: (freq) => 2595 * Math.log10(1 + freq / 700),
|
|
28165
28237
|
kaldi: (freq) => 1127 * Math.log(1 + freq / 700),
|
|
@@ -34302,6 +34374,9 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
34302
34374
|
/** @type {any} */
|
|
34303
34375
|
this
|
|
34304
34376
|
);
|
|
34377
|
+
if (Object.keys(self2).length === 0) {
|
|
34378
|
+
return 0;
|
|
34379
|
+
}
|
|
34305
34380
|
for (const name in self2) {
|
|
34306
34381
|
if (name.startsWith("past_key_values.")) {
|
|
34307
34382
|
return self2[name].dims.at(-2);
|
|
@@ -34309,6 +34384,20 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
34309
34384
|
}
|
|
34310
34385
|
throw new Error("Unable to determine sequence length from the cache.");
|
|
34311
34386
|
}
|
|
34387
|
+
/**
|
|
34388
|
+
* Update the cache in-place with new entries, disposing replaced GPU tensors.
|
|
34389
|
+
* @param {Record<string, Tensor>} newEntries The new name → Tensor mappings.
|
|
34390
|
+
*/
|
|
34391
|
+
update(newEntries) {
|
|
34392
|
+
for (const key in newEntries) {
|
|
34393
|
+
const oldValue = this[key];
|
|
34394
|
+
const newValue = newEntries[key];
|
|
34395
|
+
if (oldValue && oldValue !== newValue && oldValue.location === "gpu-buffer") {
|
|
34396
|
+
oldValue.dispose();
|
|
34397
|
+
}
|
|
34398
|
+
this[key] = newValue;
|
|
34399
|
+
}
|
|
34400
|
+
}
|
|
34312
34401
|
/**
|
|
34313
34402
|
* Dispose all contained tensors whose data resides on the GPU.
|
|
34314
34403
|
* Returns a promise that resolves when all disposals are complete.
|
|
@@ -34852,7 +34941,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
34852
34941
|
* @returns {Object} The updated model inputs for the next generation iteration.
|
|
34853
34942
|
*/
|
|
34854
34943
|
_update_model_kwargs_for_generation({ generated_input_ids, outputs, model_inputs, is_encoder_decoder }) {
|
|
34855
|
-
model_inputs["past_key_values"] =
|
|
34944
|
+
model_inputs["past_key_values"] = getPastKeyValues(outputs, model_inputs.past_key_values);
|
|
34856
34945
|
model_inputs["input_ids"] = new Tensor22("int64", generated_input_ids.flat(), [generated_input_ids.length, 1]);
|
|
34857
34946
|
if (!is_encoder_decoder) {
|
|
34858
34947
|
model_inputs.attention_mask = cat(
|
|
@@ -35001,7 +35090,10 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
35001
35090
|
generation_config = this._prepare_generation_config(generation_config, kwargs);
|
|
35002
35091
|
let { inputs_tensor, model_inputs, model_input_name } = this._prepare_model_inputs({
|
|
35003
35092
|
inputs,
|
|
35004
|
-
model_kwargs:
|
|
35093
|
+
model_kwargs: (
|
|
35094
|
+
/** @type {Record<string, Tensor|number[]>} */
|
|
35095
|
+
kwargs
|
|
35096
|
+
)
|
|
35005
35097
|
});
|
|
35006
35098
|
const is_encoder_decoder = this.config.is_encoder_decoder;
|
|
35007
35099
|
if (!is_encoder_decoder) {
|
|
@@ -35051,7 +35143,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
35051
35143
|
outputs = await this.forward(model_inputs);
|
|
35052
35144
|
if (generation_config.return_dict_in_generate) {
|
|
35053
35145
|
if (generation_config.output_attentions) {
|
|
35054
|
-
const token_attentions =
|
|
35146
|
+
const token_attentions = getAttentions(outputs);
|
|
35055
35147
|
for (const key in token_attentions) {
|
|
35056
35148
|
if (!(key in attentions)) {
|
|
35057
35149
|
attentions[key] = [];
|
|
@@ -35093,8 +35185,18 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
35093
35185
|
if (streamer) {
|
|
35094
35186
|
streamer.end();
|
|
35095
35187
|
}
|
|
35096
|
-
const past_key_values = this.getPastKeyValues(outputs, model_inputs.past_key_values, true);
|
|
35097
35188
|
const sequences = new Tensor22("int64", all_input_ids.flat(), [all_input_ids.length, all_input_ids[0].length]);
|
|
35189
|
+
const past_key_values = getPastKeyValues(outputs, model_inputs.past_key_values);
|
|
35190
|
+
const cachedTensors = new Set(Object.values(past_key_values));
|
|
35191
|
+
for (const tensor of Object.values(outputs)) {
|
|
35192
|
+
if (tensor.location === "gpu-buffer" && !cachedTensors.has(tensor)) {
|
|
35193
|
+
tensor.dispose();
|
|
35194
|
+
}
|
|
35195
|
+
}
|
|
35196
|
+
const keepCacheAlive = "past_key_values" in kwargs || generation_config.return_dict_in_generate;
|
|
35197
|
+
if (!keepCacheAlive) {
|
|
35198
|
+
await past_key_values.dispose();
|
|
35199
|
+
}
|
|
35098
35200
|
if (generation_config.return_dict_in_generate) {
|
|
35099
35201
|
return {
|
|
35100
35202
|
sequences,
|
|
@@ -35105,84 +35207,8 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
35105
35207
|
// scores,
|
|
35106
35208
|
// logits,
|
|
35107
35209
|
};
|
|
35108
|
-
} else {
|
|
35109
|
-
for (const tensor of Object.values(outputs)) {
|
|
35110
|
-
if (tensor.location === "gpu-buffer") {
|
|
35111
|
-
tensor.dispose();
|
|
35112
|
-
}
|
|
35113
|
-
}
|
|
35114
|
-
return sequences;
|
|
35115
|
-
}
|
|
35116
|
-
}
|
|
35117
|
-
/**
|
|
35118
|
-
* Returns a DynamicCache containing past key values from the given decoder results object.
|
|
35119
|
-
*
|
|
35120
|
-
* @param {Object} decoderResults The decoder results object.
|
|
35121
|
-
* @param {DynamicCache} pastKeyValues The previous past key values.
|
|
35122
|
-
* @param {boolean} [disposeEncoderPKVs=false] Whether to dispose encoder past key values.
|
|
35123
|
-
* @returns {DynamicCache} A new DynamicCache containing the updated past key values.
|
|
35124
|
-
*/
|
|
35125
|
-
getPastKeyValues(decoderResults, pastKeyValues, disposeEncoderPKVs = false) {
|
|
35126
|
-
const pkvs = /* @__PURE__ */ Object.create(null);
|
|
35127
|
-
for (const name in decoderResults) {
|
|
35128
|
-
if (name.startsWith("present")) {
|
|
35129
|
-
const newName = name.replace("present_ssm", "past_ssm").replace("present_conv", "past_conv").replace("present_recurrent", "past_recurrent").replace("present", "past_key_values");
|
|
35130
|
-
const is_encoder_pkv = name.includes("encoder");
|
|
35131
|
-
if (is_encoder_pkv && pastKeyValues) {
|
|
35132
|
-
pkvs[newName] = pastKeyValues[newName];
|
|
35133
|
-
} else {
|
|
35134
|
-
pkvs[newName] = decoderResults[name];
|
|
35135
|
-
}
|
|
35136
|
-
if (pastKeyValues && (!is_encoder_pkv || disposeEncoderPKVs)) {
|
|
35137
|
-
const t = pastKeyValues[newName];
|
|
35138
|
-
if (t.location === "gpu-buffer") {
|
|
35139
|
-
t.dispose();
|
|
35140
|
-
}
|
|
35141
|
-
}
|
|
35142
|
-
}
|
|
35143
|
-
}
|
|
35144
|
-
return new DynamicCache(pkvs);
|
|
35145
|
-
}
|
|
35146
|
-
/**
|
|
35147
|
-
* Returns an object containing attentions from the given model output object.
|
|
35148
|
-
*
|
|
35149
|
-
* @param {Object} model_output The output of the model.
|
|
35150
|
-
* @returns {{cross_attentions?: Tensor[]}} An object containing attentions.
|
|
35151
|
-
*/
|
|
35152
|
-
getAttentions(model_output) {
|
|
35153
|
-
const attentions = {};
|
|
35154
|
-
for (const attnName of ["cross_attentions", "encoder_attentions", "decoder_attentions"]) {
|
|
35155
|
-
for (const name in model_output) {
|
|
35156
|
-
if (name.startsWith(attnName)) {
|
|
35157
|
-
if (!(attnName in attentions)) {
|
|
35158
|
-
attentions[attnName] = [];
|
|
35159
|
-
}
|
|
35160
|
-
attentions[attnName].push(model_output[name]);
|
|
35161
|
-
}
|
|
35162
|
-
}
|
|
35163
|
-
}
|
|
35164
|
-
return attentions;
|
|
35165
|
-
}
|
|
35166
|
-
/**
|
|
35167
|
-
* Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.
|
|
35168
|
-
*
|
|
35169
|
-
* @param {Record<string, any>} decoderFeeds The decoder feeds object to add past key values to.
|
|
35170
|
-
* @param {DynamicCache|null} pastKeyValues The cache containing past key values.
|
|
35171
|
-
*/
|
|
35172
|
-
addPastKeyValues(decoderFeeds, pastKeyValues) {
|
|
35173
|
-
if (pastKeyValues) {
|
|
35174
|
-
Object.assign(decoderFeeds, pastKeyValues);
|
|
35175
|
-
} else {
|
|
35176
|
-
const session = this.sessions["decoder_model_merged"] ?? this.sessions["model"];
|
|
35177
|
-
const batch_size = (decoderFeeds[this.main_input_name] ?? decoderFeeds.attention_mask)?.dims?.[0] ?? 1;
|
|
35178
|
-
const dtype = session?.config?.kv_cache_dtype ?? "float32";
|
|
35179
|
-
const cls = dtype === "float16" ? DataTypeMap.float16 : DataTypeMap.float32;
|
|
35180
|
-
const shapes = getCacheShapes(this.config, { batch_size });
|
|
35181
|
-
for (const name in shapes) {
|
|
35182
|
-
const size = shapes[name].reduce((a, b) => a * b, 1);
|
|
35183
|
-
decoderFeeds[name] = new Tensor22(dtype, new cls(size), shapes[name]);
|
|
35184
|
-
}
|
|
35185
35210
|
}
|
|
35211
|
+
return sequences;
|
|
35186
35212
|
}
|
|
35187
35213
|
/**
|
|
35188
35214
|
* Helper function to select valid inputs and run through the appropriate encoder (vision, text, audio) based on the input type.
|
|
@@ -35727,6 +35753,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
35727
35753
|
SmolLM3ForCausalLM: () => SmolLM3ForCausalLM,
|
|
35728
35754
|
SmolLM3Model: () => SmolLM3Model,
|
|
35729
35755
|
SmolLM3PreTrainedModel: () => SmolLM3PreTrainedModel,
|
|
35756
|
+
SmolVLMForConditionalGeneration: () => SmolVLMForConditionalGeneration,
|
|
35730
35757
|
SnacDecoderModel: () => SnacDecoderModel,
|
|
35731
35758
|
SnacEncoderModel: () => SnacEncoderModel,
|
|
35732
35759
|
SnacModel: () => SnacModel,
|
|
@@ -36195,6 +36222,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
36195
36222
|
})
|
|
36196
36223
|
);
|
|
36197
36224
|
const new_tokens = sequences.slice(null, [
|
|
36225
|
+
/** @type {Tensor} */
|
|
36198
36226
|
params.input_ids.dims[1],
|
|
36199
36227
|
// Exclude start of speech token
|
|
36200
36228
|
-1
|
|
@@ -38319,7 +38347,10 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
38319
38347
|
*/
|
|
38320
38348
|
async generate_images(options) {
|
|
38321
38349
|
this._generation_mode = "image";
|
|
38322
|
-
const start_num_tokens = (
|
|
38350
|
+
const start_num_tokens = (
|
|
38351
|
+
/** @type {Tensor} */
|
|
38352
|
+
(options.inputs ?? options[this.main_input_name]).dims[1]
|
|
38353
|
+
);
|
|
38323
38354
|
const all_tokens = await super.generate(options);
|
|
38324
38355
|
const generated_tokens = (
|
|
38325
38356
|
/** @type {Tensor} */
|
|
@@ -39026,6 +39057,8 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
39026
39057
|
};
|
|
39027
39058
|
SmolLM3ForCausalLM = class extends SmolLM3PreTrainedModel {
|
|
39028
39059
|
};
|
|
39060
|
+
SmolVLMForConditionalGeneration = class extends Idefics3ForConditionalGeneration {
|
|
39061
|
+
};
|
|
39029
39062
|
SnacPreTrainedModel = class extends PreTrainedModel {
|
|
39030
39063
|
main_input_name = "input_values";
|
|
39031
39064
|
forward_params = ["input_values"];
|
|
@@ -39137,9 +39170,9 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
39137
39170
|
speaker_embeddings,
|
|
39138
39171
|
encoder_hidden_states: encoder_outputs
|
|
39139
39172
|
};
|
|
39140
|
-
|
|
39173
|
+
addPastKeyValues(this, decoderFeeds, past_key_values);
|
|
39141
39174
|
decoder_outputs = await sessionRun(this.sessions["decoder_model_merged"], decoderFeeds);
|
|
39142
|
-
past_key_values =
|
|
39175
|
+
past_key_values = getPastKeyValues(decoder_outputs, past_key_values);
|
|
39143
39176
|
const { prob, spectrum } = decoder_outputs;
|
|
39144
39177
|
spectrogramParts.push(spectrum);
|
|
39145
39178
|
if (idx >= minlen && // Finished when stop token or maximum length is reached.
|
|
@@ -39510,7 +39543,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
39510
39543
|
addAudioEmbeddings(enc, inputs_embeds, current_len);
|
|
39511
39544
|
}
|
|
39512
39545
|
const decoder_feeds = { inputs_embeds, ...kwargs };
|
|
39513
|
-
|
|
39546
|
+
addPastKeyValues(this, decoder_feeds, past_key_values);
|
|
39514
39547
|
const session = this.sessions["decoder_model_merged"];
|
|
39515
39548
|
const fixed = pick(decoder_feeds, session.inputNames);
|
|
39516
39549
|
return await sessionRun(session, fixed);
|
|
@@ -39756,7 +39789,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
39756
39789
|
...kwargs
|
|
39757
39790
|
}) {
|
|
39758
39791
|
generation_config = this._prepare_generation_config(generation_config, kwargs);
|
|
39759
|
-
const init_tokens = kwargs.decoder_input_ids ?? this._retrieve_init_tokens(generation_config);
|
|
39792
|
+
const init_tokens = kwargs.decoder_input_ids instanceof Tensor22 ? prepareTensorForDecode(kwargs.decoder_input_ids) : kwargs.decoder_input_ids ?? this._retrieve_init_tokens(generation_config);
|
|
39760
39793
|
if (generation_config.return_timestamps) {
|
|
39761
39794
|
logits_processor ??= new LogitsProcessorList();
|
|
39762
39795
|
logits_processor.push(new WhisperTimeStampLogitsProcessor(generation_config, init_tokens));
|
|
@@ -41158,6 +41191,11 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41158
41191
|
};
|
|
41159
41192
|
Text2TextGenerationPipeline = class extends /** @type {new (options: TextPipelineConstructorArgs) => Text2TextGenerationPipelineType} */
|
|
41160
41193
|
Pipeline {
|
|
41194
|
+
_default_generation_config = {
|
|
41195
|
+
max_new_tokens: 256
|
|
41196
|
+
// do_sample: true,
|
|
41197
|
+
// temperature: 0.7,
|
|
41198
|
+
};
|
|
41161
41199
|
/** @type {'generated_text'} */
|
|
41162
41200
|
_key = "generated_text";
|
|
41163
41201
|
/** @type {Text2TextGenerationPipelineCallback} */
|
|
@@ -41185,7 +41223,11 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41185
41223
|
} else {
|
|
41186
41224
|
inputs = tokenizer(texts, tokenizer_options);
|
|
41187
41225
|
}
|
|
41188
|
-
const outputTokenIds = await this.model.generate({
|
|
41226
|
+
const outputTokenIds = await this.model.generate({
|
|
41227
|
+
...inputs,
|
|
41228
|
+
...this._default_generation_config,
|
|
41229
|
+
...generate_kwargs
|
|
41230
|
+
});
|
|
41189
41231
|
return tokenizer.batch_decode(
|
|
41190
41232
|
/** @type {Tensor} */
|
|
41191
41233
|
outputTokenIds,
|
|
@@ -41209,6 +41251,11 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41209
41251
|
};
|
|
41210
41252
|
TextGenerationPipeline = class extends /** @type {new (options: TextPipelineConstructorArgs) => TextGenerationPipelineType} */
|
|
41211
41253
|
Pipeline {
|
|
41254
|
+
_default_generation_config = {
|
|
41255
|
+
max_new_tokens: 256
|
|
41256
|
+
// do_sample: true,
|
|
41257
|
+
// temperature: 0.7,
|
|
41258
|
+
};
|
|
41212
41259
|
/**
|
|
41213
41260
|
* @param {string | string[] | import('../tokenization_utils.js').Message[] | import('../tokenization_utils.js').Message[][]} texts
|
|
41214
41261
|
* @param {Partial<TextGenerationConfig>} generate_kwargs
|
|
@@ -41240,11 +41287,15 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41240
41287
|
inputs = /** @type {string[]} */
|
|
41241
41288
|
/** @type {Chat[]} */
|
|
41242
41289
|
texts.map(
|
|
41243
|
-
(x) =>
|
|
41244
|
-
|
|
41245
|
-
|
|
41246
|
-
|
|
41247
|
-
|
|
41290
|
+
(x) => (
|
|
41291
|
+
/** @type {string} */
|
|
41292
|
+
/** @type {unknown} */
|
|
41293
|
+
this.tokenizer.apply_chat_template(x, {
|
|
41294
|
+
tokenize: false,
|
|
41295
|
+
add_generation_prompt: true,
|
|
41296
|
+
...tokenizer_kwargs
|
|
41297
|
+
})
|
|
41298
|
+
)
|
|
41248
41299
|
);
|
|
41249
41300
|
add_special_tokens = false;
|
|
41250
41301
|
tokenizer_kwargs = void 0;
|
|
@@ -41261,6 +41312,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41261
41312
|
/** @type {Tensor} */
|
|
41262
41313
|
await this.model.generate({
|
|
41263
41314
|
...text_inputs,
|
|
41315
|
+
...this._default_generation_config,
|
|
41264
41316
|
...generate_kwargs
|
|
41265
41317
|
})
|
|
41266
41318
|
);
|
|
@@ -41421,7 +41473,16 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41421
41473
|
};
|
|
41422
41474
|
AutomaticSpeechRecognitionPipeline = class extends /** @type {new (options: TextAudioPipelineConstructorArgs) => AutomaticSpeechRecognitionPipelineType} */
|
|
41423
41475
|
Pipeline {
|
|
41476
|
+
_default_generation_config = {
|
|
41477
|
+
// TODO: figure out good defaults for ASR generation parameters
|
|
41478
|
+
// max_new_tokens: 256,
|
|
41479
|
+
// num_beams: 5,
|
|
41480
|
+
};
|
|
41424
41481
|
async _call(audio, kwargs = {}) {
|
|
41482
|
+
kwargs = {
|
|
41483
|
+
...this._default_generation_config,
|
|
41484
|
+
...kwargs
|
|
41485
|
+
};
|
|
41425
41486
|
switch (this.model.config.model_type) {
|
|
41426
41487
|
case "whisper":
|
|
41427
41488
|
case "lite-whisper":
|
|
@@ -41995,6 +42056,9 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
41995
42056
|
};
|
|
41996
42057
|
DocumentQuestionAnsweringPipeline = class extends /** @type {new (options: TextImagePipelineConstructorArgs) => DocumentQuestionAnsweringPipelineType} */
|
|
41997
42058
|
Pipeline {
|
|
42059
|
+
_default_generation_config = {
|
|
42060
|
+
max_new_tokens: 256
|
|
42061
|
+
};
|
|
41998
42062
|
async _call(image, question, generate_kwargs = {}) {
|
|
41999
42063
|
if (Array.isArray(image)) {
|
|
42000
42064
|
if (image.length !== 1) {
|
|
@@ -42015,6 +42079,7 @@ ${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(audio_
|
|
|
42015
42079
|
// @ts-expect-error Ts2339
|
|
42016
42080
|
max_length: this.model.config.decoder.max_position_embeddings,
|
|
42017
42081
|
decoder_input_ids,
|
|
42082
|
+
...this._default_generation_config,
|
|
42018
42083
|
...generate_kwargs
|
|
42019
42084
|
});
|
|
42020
42085
|
const decoded = this.tokenizer.batch_decode(
|
|
@@ -45784,6 +45849,7 @@ var LLMReranker = class {
|
|
|
45784
45849
|
};
|
|
45785
45850
|
|
|
45786
45851
|
// src/ai/index.ts
|
|
45852
|
+
var pick2 = (v, fallback) => typeof v === "string" && v.trim() ? v : fallback;
|
|
45787
45853
|
var OPENAI_COMPAT_DEFAULTS = {
|
|
45788
45854
|
openai: {
|
|
45789
45855
|
baseUrl: "https://api.openai.com/v1",
|
|
@@ -45835,10 +45901,10 @@ var OPENAI_COMPAT_DEFAULTS = {
|
|
|
45835
45901
|
},
|
|
45836
45902
|
xai: {
|
|
45837
45903
|
baseUrl: "https://api.x.ai/v1",
|
|
45838
|
-
embeddingModel: "grok-
|
|
45904
|
+
embeddingModel: "grok-4",
|
|
45839
45905
|
embeddingDimensions: 1536,
|
|
45840
|
-
inferenceModel: "grok-
|
|
45841
|
-
fastModel: "grok-
|
|
45906
|
+
inferenceModel: "grok-4",
|
|
45907
|
+
fastModel: "grok-4",
|
|
45842
45908
|
envKey: "XAI_API_KEY"
|
|
45843
45909
|
}
|
|
45844
45910
|
};
|
|
@@ -45952,26 +46018,51 @@ var TrackedAIProvider = class {
|
|
|
45952
46018
|
function wrapWithTracking(provider, name, url2) {
|
|
45953
46019
|
return new TrackedAIProvider(provider, name, url2);
|
|
45954
46020
|
}
|
|
46021
|
+
var GatedAIProvider = class {
|
|
46022
|
+
constructor(inner, features) {
|
|
46023
|
+
this.inner = inner;
|
|
46024
|
+
this.features = features;
|
|
46025
|
+
}
|
|
46026
|
+
inner;
|
|
46027
|
+
features;
|
|
46028
|
+
fallback = new FallbackProvider();
|
|
46029
|
+
isAvailable() {
|
|
46030
|
+
return this.inner.isAvailable();
|
|
46031
|
+
}
|
|
46032
|
+
embedding() {
|
|
46033
|
+
return this.features.embedding ? this.inner.embedding() : this.fallback.embedding();
|
|
46034
|
+
}
|
|
46035
|
+
inference() {
|
|
46036
|
+
return this.features.inference ? this.inner.inference() : this.fallback.inference();
|
|
46037
|
+
}
|
|
46038
|
+
fastInference() {
|
|
46039
|
+
return this.features.fast_inference ? this.inner.fastInference() : this.fallback.fastInference();
|
|
46040
|
+
}
|
|
46041
|
+
};
|
|
45955
46042
|
function createAIProvider(config) {
|
|
45956
46043
|
if (!config.ai?.enabled) {
|
|
45957
46044
|
return new FallbackProvider();
|
|
45958
46045
|
}
|
|
46046
|
+
const features = config.ai.features ?? { embedding: true, inference: true, fast_inference: true };
|
|
46047
|
+
if (!features.embedding && !features.inference && !features.fast_inference) {
|
|
46048
|
+
return new FallbackProvider();
|
|
46049
|
+
}
|
|
45959
46050
|
const provider = config.ai.provider;
|
|
45960
46051
|
if (provider === "onnx") {
|
|
45961
|
-
return wrapWithTracking(new OnnxProvider({
|
|
46052
|
+
return new GatedAIProvider(wrapWithTracking(new OnnxProvider({
|
|
45962
46053
|
model: config.ai.embedding_model,
|
|
45963
46054
|
dimensions: config.ai.embedding_dimensions
|
|
45964
|
-
}), "onnx", "local");
|
|
46055
|
+
}), "onnx", "local"), features);
|
|
45965
46056
|
}
|
|
45966
46057
|
if (provider === "ollama") {
|
|
45967
|
-
const url2 = config.ai.base_url
|
|
45968
|
-
return wrapWithTracking(new OllamaProvider({
|
|
46058
|
+
const url2 = pick2(config.ai.base_url, "http://localhost:11434");
|
|
46059
|
+
return new GatedAIProvider(wrapWithTracking(new OllamaProvider({
|
|
45969
46060
|
baseUrl: url2,
|
|
45970
|
-
embeddingModel: config.ai.embedding_model
|
|
45971
|
-
inferenceModel: config.ai.inference_model
|
|
45972
|
-
fastModel: config.ai.fast_model
|
|
46061
|
+
embeddingModel: pick2(config.ai.embedding_model, "nomic-embed-text"),
|
|
46062
|
+
inferenceModel: pick2(config.ai.inference_model, "llama3.2"),
|
|
46063
|
+
fastModel: pick2(config.ai.fast_model, "llama3.2"),
|
|
45973
46064
|
embeddingDimensions: config.ai.embedding_dimensions
|
|
45974
|
-
}), "ollama", url2);
|
|
46065
|
+
}), "ollama", url2), features);
|
|
45975
46066
|
}
|
|
45976
46067
|
if (provider === "gemini") {
|
|
45977
46068
|
const apiKey = config.ai.api_key ?? process.env.GEMINI_API_KEY ?? "";
|
|
@@ -45979,13 +46070,13 @@ function createAIProvider(config) {
|
|
|
45979
46070
|
logger.warn("Gemini provider selected but no api_key configured \u2014 falling back");
|
|
45980
46071
|
return new FallbackProvider();
|
|
45981
46072
|
}
|
|
45982
|
-
return wrapWithTracking(new GeminiProvider({
|
|
46073
|
+
return new GatedAIProvider(wrapWithTracking(new GeminiProvider({
|
|
45983
46074
|
apiKey,
|
|
45984
|
-
embeddingModel: config.ai.embedding_model
|
|
46075
|
+
embeddingModel: pick2(config.ai.embedding_model, "text-embedding-004"),
|
|
45985
46076
|
embeddingDimensions: config.ai.embedding_dimensions ?? 768,
|
|
45986
|
-
inferenceModel: config.ai.inference_model
|
|
45987
|
-
fastModel: config.ai.fast_model
|
|
45988
|
-
}), "gemini", "https://generativelanguage.googleapis.com");
|
|
46077
|
+
inferenceModel: pick2(config.ai.inference_model, "gemini-2.5-flash"),
|
|
46078
|
+
fastModel: pick2(config.ai.fast_model, "gemini-2.5-flash")
|
|
46079
|
+
}), "gemini", "https://generativelanguage.googleapis.com"), features);
|
|
45989
46080
|
}
|
|
45990
46081
|
if (provider === "anthropic") {
|
|
45991
46082
|
const apiKey = config.ai.api_key ?? process.env.ANTHROPIC_API_KEY ?? "";
|
|
@@ -45993,11 +46084,11 @@ function createAIProvider(config) {
|
|
|
45993
46084
|
logger.warn("Anthropic provider selected but no api_key configured \u2014 falling back");
|
|
45994
46085
|
return new FallbackProvider();
|
|
45995
46086
|
}
|
|
45996
|
-
return wrapWithTracking(new AnthropicProvider({
|
|
46087
|
+
return new GatedAIProvider(wrapWithTracking(new AnthropicProvider({
|
|
45997
46088
|
apiKey,
|
|
45998
|
-
inferenceModel: config.ai.inference_model
|
|
45999
|
-
fastModel: config.ai.fast_model
|
|
46000
|
-
}), "anthropic", "https://api.anthropic.com");
|
|
46089
|
+
inferenceModel: pick2(config.ai.inference_model, "claude-sonnet-4-6"),
|
|
46090
|
+
fastModel: pick2(config.ai.fast_model, "claude-haiku-4-5-20251001")
|
|
46091
|
+
}), "anthropic", "https://api.anthropic.com"), features);
|
|
46001
46092
|
}
|
|
46002
46093
|
const defaults = OPENAI_COMPAT_DEFAULTS[provider];
|
|
46003
46094
|
if (defaults) {
|
|
@@ -46006,15 +46097,15 @@ function createAIProvider(config) {
|
|
|
46006
46097
|
logger.warn(`${provider} provider selected but no api_key configured \u2014 falling back`);
|
|
46007
46098
|
return new FallbackProvider();
|
|
46008
46099
|
}
|
|
46009
|
-
const url2 = config.ai.base_url
|
|
46010
|
-
return wrapWithTracking(new OpenAIProvider({
|
|
46100
|
+
const url2 = pick2(config.ai.base_url, defaults.baseUrl);
|
|
46101
|
+
return new GatedAIProvider(wrapWithTracking(new OpenAIProvider({
|
|
46011
46102
|
apiKey,
|
|
46012
46103
|
baseUrl: url2,
|
|
46013
|
-
embeddingModel: config.ai.embedding_model
|
|
46104
|
+
embeddingModel: pick2(config.ai.embedding_model, defaults.embeddingModel),
|
|
46014
46105
|
embeddingDimensions: config.ai.embedding_dimensions ?? defaults.embeddingDimensions,
|
|
46015
|
-
inferenceModel: config.ai.inference_model
|
|
46016
|
-
fastModel: config.ai.fast_model
|
|
46017
|
-
}), provider, url2);
|
|
46106
|
+
inferenceModel: pick2(config.ai.inference_model, defaults.inferenceModel),
|
|
46107
|
+
fastModel: pick2(config.ai.fast_model, defaults.fastModel)
|
|
46108
|
+
}), provider, url2), features);
|
|
46018
46109
|
}
|
|
46019
46110
|
return new FallbackProvider();
|
|
46020
46111
|
}
|
|
@@ -47310,8 +47401,8 @@ function getSessionResume(projectRoot, maxSessions = 5) {
|
|
|
47310
47401
|
const hotFiles = [...fileCounts.entries()].filter(([, count2]) => count2 >= 2).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([file, sessions]) => ({ file, sessions }));
|
|
47311
47402
|
const deadEndCounts = /* @__PURE__ */ new Map();
|
|
47312
47403
|
for (const session of allSessions.slice(-10)) {
|
|
47313
|
-
for (const
|
|
47314
|
-
deadEndCounts.set(
|
|
47404
|
+
for (const de of session.dead_ends) {
|
|
47405
|
+
deadEndCounts.set(de, (deadEndCounts.get(de) ?? 0) + 1);
|
|
47315
47406
|
}
|
|
47316
47407
|
}
|
|
47317
47408
|
const persistentDeadEnds = [...deadEndCounts.entries()].filter(([, count2]) => count2 >= 2).map(([pattern]) => pattern);
|
|
@@ -47750,8 +47841,8 @@ function buildProjectContext(rootPath) {
|
|
|
47750
47841
|
if (gemfileRaw) {
|
|
47751
47842
|
const gemDeps = [];
|
|
47752
47843
|
const gemLines = gemfileRaw.matchAll(/^\s*gem\s+['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]*)['"]\s*)?/gm);
|
|
47753
|
-
for (const
|
|
47754
|
-
gemDeps.push({ name:
|
|
47844
|
+
for (const gl2 of gemLines) {
|
|
47845
|
+
gemDeps.push({ name: gl2[1], version: gl2[2] || void 0 });
|
|
47755
47846
|
}
|
|
47756
47847
|
gemfile = { deps: gemDeps };
|
|
47757
47848
|
allDependencies.push(...gemDeps);
|
|
@@ -53471,8 +53562,8 @@ function resolveClassByName(name, fileSymbols, fileImports, nameIndex, symbolsBy
|
|
|
53471
53562
|
const classes = cands.filter((s) => s.kind === "class");
|
|
53472
53563
|
if (classes.length === 0) return null;
|
|
53473
53564
|
if (sourceWorkspace !== void 0) {
|
|
53474
|
-
const
|
|
53475
|
-
if (
|
|
53565
|
+
const pick3 = pickSameWs(classes, sourceWorkspace);
|
|
53566
|
+
if (pick3) return pick3;
|
|
53476
53567
|
return null;
|
|
53477
53568
|
}
|
|
53478
53569
|
if (classes.length === 1) return classes[0];
|
|
@@ -66276,8 +66367,8 @@ function generatePrTemplate(input, affected, risk) {
|
|
|
66276
66367
|
lines.push("");
|
|
66277
66368
|
if (input.breakingChanges?.length) {
|
|
66278
66369
|
lines.push("### Breaking Changes");
|
|
66279
|
-
for (const
|
|
66280
|
-
lines.push(`- ${
|
|
66370
|
+
for (const bc of input.breakingChanges) {
|
|
66371
|
+
lines.push(`- ${bc}`);
|
|
66281
66372
|
}
|
|
66282
66373
|
lines.push("");
|
|
66283
66374
|
}
|
|
@@ -71255,7 +71346,15 @@ var FileRepository = class {
|
|
|
71255
71346
|
this._stmts = {
|
|
71256
71347
|
insertFile: db.prepare(
|
|
71257
71348
|
`INSERT INTO files (path, language, content_hash, byte_length, indexed_at, workspace, mtime_ms)
|
|
71258
|
-
VALUES (?, ?, ?, ?, datetime('now'), ?, ?)
|
|
71349
|
+
VALUES (?, ?, ?, ?, datetime('now'), ?, ?)
|
|
71350
|
+
ON CONFLICT(path) DO UPDATE SET
|
|
71351
|
+
language = COALESCE(excluded.language, files.language),
|
|
71352
|
+
content_hash = COALESCE(excluded.content_hash, files.content_hash),
|
|
71353
|
+
byte_length = COALESCE(excluded.byte_length, files.byte_length),
|
|
71354
|
+
indexed_at = datetime('now'),
|
|
71355
|
+
workspace = COALESCE(excluded.workspace, files.workspace),
|
|
71356
|
+
mtime_ms = COALESCE(excluded.mtime_ms, files.mtime_ms)
|
|
71357
|
+
RETURNING id`
|
|
71259
71358
|
),
|
|
71260
71359
|
getFile: db.prepare("SELECT * FROM files WHERE path = ?"),
|
|
71261
71360
|
getFileById: db.prepare("SELECT * FROM files WHERE id = ?"),
|
|
@@ -71273,8 +71372,8 @@ var FileRepository = class {
|
|
|
71273
71372
|
db;
|
|
71274
71373
|
_stmts;
|
|
71275
71374
|
insertFile(path67, language, contentHash, byteLength, workspace, mtimeMs, createNode) {
|
|
71276
|
-
const
|
|
71277
|
-
const fileId =
|
|
71375
|
+
const row = this._stmts.insertFile.get(path67, language, contentHash, byteLength, workspace, mtimeMs);
|
|
71376
|
+
const fileId = row.id;
|
|
71278
71377
|
createNode("file", fileId);
|
|
71279
71378
|
return fileId;
|
|
71280
71379
|
}
|
|
@@ -76092,12 +76191,12 @@ function leidenDetect(graph, resolution = 1, maxIterations = 20) {
|
|
|
76092
76191
|
const c = community[j3];
|
|
76093
76192
|
commDegrees.set(c, (commDegrees.get(c) ?? 0) + nodeDegree[j3]);
|
|
76094
76193
|
}
|
|
76095
|
-
for (const [c,
|
|
76194
|
+
for (const [c, wc2] of commWeights) {
|
|
76096
76195
|
if (c === currentComm) continue;
|
|
76097
76196
|
const sumC = commDegrees.get(c) ?? 0;
|
|
76098
76197
|
const sumCurrent = commDegrees.get(currentComm) ?? 0;
|
|
76099
76198
|
const ki = nodeDegree[i];
|
|
76100
|
-
const gain = (
|
|
76199
|
+
const gain = (wc2 - wCurrent) / m2 - resolution * ki * (sumC - sumCurrent + ki) / (m2 * m2);
|
|
76101
76200
|
if (gain > bestGain) {
|
|
76102
76201
|
bestGain = gain;
|
|
76103
76202
|
bestComm = c;
|
|
@@ -77628,7 +77727,7 @@ function scanSourceForSecurityCalls(body, filePath, startLine, results) {
|
|
|
77628
77727
|
results.push({ function: "process.env", file: filePath, line: lineOffset, category: "env_read" });
|
|
77629
77728
|
}
|
|
77630
77729
|
}
|
|
77631
|
-
var PKG_VERSION = true ? "1.
|
|
77730
|
+
var PKG_VERSION = true ? "1.26.0" : "0.0.0-dev";
|
|
77632
77731
|
function exportSecurityContext(store, projectRoot, opts = {}) {
|
|
77633
77732
|
const depth = Math.min(opts.depth ?? 3, 5);
|
|
77634
77733
|
const warnings = [];
|
|
@@ -84433,7 +84532,7 @@ var DecisionStore = class {
|
|
|
84433
84532
|
};
|
|
84434
84533
|
|
|
84435
84534
|
// src/server/server.ts
|
|
84436
|
-
var PKG_VERSION2 = true ? "1.
|
|
84535
|
+
var PKG_VERSION2 = true ? "1.26.0" : "0.0.0-dev";
|
|
84437
84536
|
function j2(value) {
|
|
84438
84537
|
return JSON.stringify(value, (_key, val) => val === null || val === void 0 ? void 0 : val);
|
|
84439
84538
|
}
|
|
@@ -84904,6 +85003,13 @@ var FrameworkConfigSchema = z15.object({
|
|
|
84904
85003
|
var AiConfigSchema = z15.object({
|
|
84905
85004
|
enabled: z15.boolean().default(false),
|
|
84906
85005
|
provider: z15.enum(["onnx", "ollama", "openai", "anthropic", "lmstudio", "gemini", "mistral", "deepseek", "groq", "together", "xai"]).default("onnx"),
|
|
85006
|
+
/** Per-capability enable flags. Lets users disable inference while keeping embeddings (or vice versa)
|
|
85007
|
+
* without switching provider. Disabled capabilities return fallback services (empty results). */
|
|
85008
|
+
features: z15.object({
|
|
85009
|
+
embedding: z15.boolean().default(true),
|
|
85010
|
+
inference: z15.boolean().default(true),
|
|
85011
|
+
fast_inference: z15.boolean().default(true)
|
|
85012
|
+
}).default({}),
|
|
84907
85013
|
base_url: z15.string().optional(),
|
|
84908
85014
|
api_key: z15.string().optional(),
|
|
84909
85015
|
inference_model: z15.string().optional(),
|
|
@@ -85270,7 +85376,7 @@ sharp/lib/index.js:
|
|
|
85270
85376
|
|
|
85271
85377
|
onnxruntime-web/dist/ort.webgpu.bundle.min.mjs:
|
|
85272
85378
|
(*!
|
|
85273
|
-
* ONNX Runtime Web v1.
|
|
85379
|
+
* ONNX Runtime Web v1.26.0-dev.20260410-5e55544225
|
|
85274
85380
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
85275
85381
|
* Licensed under the MIT License.
|
|
85276
85382
|
*)
|