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B,EACpB,GAAoB,iBAAVA,GAAsBA,EAAO,CACtC,GAAW,EAAPwsB,GAAaxsB,EAAM+8H,WAAY,OAAO/8H,EAC1C,GAAW,GAAPwsB,GAAoC,mBAAfxsB,EAAMopB,KAAqB,OAAOppB,CAC5D,CACA,IAAI6jC,EAAKtnC,OAAOkiD,OAAO,MACvBi+E,EAAoB39G,EAAE8kB,GACtB,IAAIm5F,EAAM,CAAC,EACX5gI,EAAiBA,GAAkB,CAAC,KAAMC,EAAS,CAAC,GAAIA,EAAS,IAAKA,EAASA,IAC/E,IAAI,IAAI+I,EAAiB,EAAPonB,GAAYxsB,EAAyB,iBAAXoF,KAAyBhJ,EAAe8S,QAAQ9J,GAAUA,EAAU/I,EAAS+I,GACxH7I,OAAOiV,oBAAoBpM,GAAS8tB,SAASjuB,GAAS+3H,EAAI/3H,GAAO,IAAOjF,EAAMiF,KAI/E,OAFA+3H,EAAa,QAAI,IAAM,EACvBN,EAAoB75G,EAAEghB,EAAIm5F,GACnBn5F,CACR,E0CxBA64F,EAAoB75G,EAAI,CAAChE,EAASo+G,KACjC,IAAI,IAAIh4H,KAAOg4H,EACXP,EAAoBt9G,EAAE69G,EAAYh4H,KAASy3H,EAAoBt9G,EAAEP,EAAS5Z,IAC5E1I,OAAOkU,eAAeoO,EAAS5Z,EAAK,CAAEyL,YAAY,EAAM5O,IAAKm7H,EAAWh4H,IAE1E,ECNDy3H,EAAoBt9G,EAAI,CAAC43C,EAAKyL,IAAUlmE,OAAOkiB,UAAU5M,eAAeC,KAAKklD,EAAKyL,GCClFi6D,EAAoB39G,EAAKF,IACH,oBAAX87C,QAA0BA,OAAOuiE,aAC1C3gI,OAAOkU,eAAeoO,EAAS87C,OAAOuiE,YAAa,CAAEl9H,MAAO,WAE7DzD,OAAOkU,eAAeoO,EAAS,aAAc,CAAE7e,OAAO,GAAO,E","sources":["webpack://@xenova/transformers/webpack/runtime/create fake namespace object","webpack://@xenova/transformers/./node_modules/@huggingface/jinja/dist/index.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/backend-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/env-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/env.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/inference-session-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/inference-session.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/tensor-conversion-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/tensor-factory-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/tensor-impl-type-mapping.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/tensor-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/tensor-utils-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/tensor.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/trace.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/training-session-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/training-session.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/esm/version.js","webpack://@xenova/transformers/./node_modules/onnxruntime-web/dist/esm/ort.webgpu.min.js","webpack://@xenova/transformers/./src/backends/onnx.js","webpack://@xenova/transformers/./src/configs.js","webpack://@xenova/transformers/./src/env.js","webpack://@xenova/transformers/./src/generation/configuration_utils.js","webpack://@xenova/transformers/./src/generation/logits_process.js","webpack://@xenova/transformers/./src/generation/logits_sampler.js","webpack://@xenova/transformers/./src/generation/stopping_criteria.js","webpack://@xenova/transformers/./src/generation/streamers.js","webpack://@xenova/transformers/./src/models.js","webpack://@xenova/transformers/./src/ops/registry.js","webpack://@xenova/transformers/./src/pipelines.js","webpack://@xenova/transformers/./src/processors.js","webpack://@xenova/transformers/./src/tokenizers.js","webpack://@xenova/transformers/./src/utils/audio.js","webpack://@xenova/transformers/./src/utils/core.js","webpack://@xenova/transformers/./src/utils/data-structures.js","webpack://@xenova/transformers/./src/utils/devices.js","webpack://@xenova/transformers/./src/utils/dtypes.js","webpack://@xenova/transformers/./src/utils/generic.js","webpack://@xenova/transformers/./src/utils/hub.js","webpack://@xenova/transformers/./src/utils/image.js","webpack://@xenova/transformers/./src/utils/maths.js","webpack://@xenova/transformers/./src/utils/tensor.js","webpack://@xenova/transformers/webpack/bootstrap","webpack://@xenova/transformers/webpack/runtime/define property getters","webpack://@xenova/transformers/webpack/runtime/hasOwnProperty shorthand","webpack://@xenova/transformers/webpack/runtime/make namespace object"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// src/lexer.ts\nvar TOKEN_TYPES = Object.freeze({\n Text: \"Text\",\n // The text between Jinja statements or expressions\n NumericLiteral: \"NumericLiteral\",\n // e.g., 123\n BooleanLiteral: \"BooleanLiteral\",\n // true or false\n StringLiteral: \"StringLiteral\",\n // 'string'\n Identifier: \"Identifier\",\n // Variables, functions, etc.\n Equals: \"Equals\",\n // =\n OpenParen: \"OpenParen\",\n // (\n CloseParen: \"CloseParen\",\n // )\n OpenStatement: \"OpenStatement\",\n // {%\n CloseStatement: \"CloseStatement\",\n // %}\n OpenExpression: \"OpenExpression\",\n // {{\n CloseExpression: \"CloseExpression\",\n // }}\n OpenSquareBracket: \"OpenSquareBracket\",\n // [\n CloseSquareBracket: \"CloseSquareBracket\",\n // ]\n OpenCurlyBracket: \"OpenCurlyBracket\",\n // {\n CloseCurlyBracket: \"CloseCurlyBracket\",\n // }\n Comma: \"Comma\",\n // ,\n Dot: \"Dot\",\n // .\n Colon: \"Colon\",\n // :\n Pipe: \"Pipe\",\n // |\n CallOperator: \"CallOperator\",\n // ()\n AdditiveBinaryOperator: \"AdditiveBinaryOperator\",\n // + -\n MultiplicativeBinaryOperator: \"MultiplicativeBinaryOperator\",\n // * / %\n ComparisonBinaryOperator: \"ComparisonBinaryOperator\",\n // < > <= >= == !=\n UnaryOperator: \"UnaryOperator\",\n // ! - +\n // Keywords\n Set: \"Set\",\n If: \"If\",\n For: \"For\",\n In: \"In\",\n Is: \"Is\",\n NotIn: \"NotIn\",\n Else: \"Else\",\n EndIf: \"EndIf\",\n ElseIf: \"ElseIf\",\n EndFor: \"EndFor\",\n And: \"And\",\n Or: \"Or\",\n Not: \"UnaryOperator\"\n});\nvar KEYWORDS = Object.freeze({\n set: TOKEN_TYPES.Set,\n for: TOKEN_TYPES.For,\n in: TOKEN_TYPES.In,\n is: TOKEN_TYPES.Is,\n if: TOKEN_TYPES.If,\n else: TOKEN_TYPES.Else,\n endif: TOKEN_TYPES.EndIf,\n elif: TOKEN_TYPES.ElseIf,\n endfor: TOKEN_TYPES.EndFor,\n and: TOKEN_TYPES.And,\n or: TOKEN_TYPES.Or,\n not: TOKEN_TYPES.Not,\n \"not in\": TOKEN_TYPES.NotIn,\n // Literals\n true: TOKEN_TYPES.BooleanLiteral,\n false: TOKEN_TYPES.BooleanLiteral\n});\nvar Token = class {\n /**\n * Constructs a new Token.\n * @param {string} value The raw value as seen inside the source code.\n * @param {TokenType} type The type of token.\n */\n constructor(value, type) {\n this.value = value;\n this.type = type;\n }\n};\nfunction isWord(char) {\n return /\\w/.test(char);\n}\nfunction isInteger(char) {\n return /[0-9]/.test(char);\n}\nvar ORDERED_MAPPING_TABLE = [\n // Control sequences\n [\"{%\", TOKEN_TYPES.OpenStatement],\n [\"%}\", TOKEN_TYPES.CloseStatement],\n [\"{{\", TOKEN_TYPES.OpenExpression],\n [\"}}\", TOKEN_TYPES.CloseExpression],\n // Single character tokens\n [\"(\", TOKEN_TYPES.OpenParen],\n [\")\", TOKEN_TYPES.CloseParen],\n [\"{\", TOKEN_TYPES.OpenCurlyBracket],\n [\"}\", TOKEN_TYPES.CloseCurlyBracket],\n [\"[\", TOKEN_TYPES.OpenSquareBracket],\n [\"]\", TOKEN_TYPES.CloseSquareBracket],\n [\",\", TOKEN_TYPES.Comma],\n [\".\", TOKEN_TYPES.Dot],\n [\":\", TOKEN_TYPES.Colon],\n [\"|\", TOKEN_TYPES.Pipe],\n // Comparison operators\n [\"<=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\">=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"==\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"!=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"<\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\">\", TOKEN_TYPES.ComparisonBinaryOperator],\n // Arithmetic operators\n [\"+\", TOKEN_TYPES.AdditiveBinaryOperator],\n [\"-\", TOKEN_TYPES.AdditiveBinaryOperator],\n [\"*\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n [\"/\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n [\"%\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n // Assignment operator\n [\"=\", TOKEN_TYPES.Equals]\n];\nvar ESCAPE_CHARACTERS = /* @__PURE__ */ new Map([\n [\"n\", \"\\n\"],\n // New line\n [\"t\", \"\t\"],\n // Horizontal tab\n [\"r\", \"\\r\"],\n // Carriage return\n [\"b\", \"\\b\"],\n // Backspace\n [\"f\", \"\\f\"],\n // Form feed\n [\"v\", \"\\v\"],\n // Vertical tab\n [\"'\", \"'\"],\n // Single quote\n ['\"', '\"'],\n // Double quote\n [\"\\\\\", \"\\\\\"]\n // Backslash\n]);\nfunction preprocess(template, options = {}) {\n if (template.endsWith(\"\\n\")) {\n template = template.slice(0, -1);\n }\n template = template.replace(/{#.*?#}/gs, \"{##}\");\n if (options.lstrip_blocks) {\n template = template.replace(/^[ \\t]*({[#%])/gm, \"$1\");\n }\n if (options.trim_blocks) {\n template = template.replace(/([#%]})\\n/g, \"$1\");\n }\n return template.replace(/{##}/g, \"\").replace(/-%}\\s*/g, \"%}\").replace(/\\s*{%-/g, \"{%\").replace(/-}}\\s*/g, \"}}\").replace(/\\s*{{-/g, \"{{\");\n}\nfunction tokenize(source, options = {}) {\n const tokens = [];\n const src = preprocess(source, options);\n let cursorPosition = 0;\n const consumeWhile = (predicate) => {\n let str = \"\";\n while (predicate(src[cursorPosition])) {\n if (src[cursorPosition] === \"\\\\\") {\n ++cursorPosition;\n if (cursorPosition >= src.length)\n throw new SyntaxError(\"Unexpected end of input\");\n const escaped = src[cursorPosition++];\n const unescaped = ESCAPE_CHARACTERS.get(escaped);\n if (unescaped === void 0) {\n throw new SyntaxError(`Unexpected escaped character: ${escaped}`);\n }\n str += unescaped;\n continue;\n }\n str += src[cursorPosition++];\n if (cursorPosition >= src.length)\n throw new SyntaxError(\"Unexpected end of input\");\n }\n return str;\n };\n main:\n while (cursorPosition < src.length) {\n const lastTokenType = tokens.at(-1)?.type;\n if (lastTokenType === void 0 || lastTokenType === TOKEN_TYPES.CloseStatement || lastTokenType === TOKEN_TYPES.CloseExpression) {\n let text = \"\";\n while (cursorPosition < src.length && // Keep going until we hit the next Jinja statement or expression\n !(src[cursorPosition] === \"{\" && (src[cursorPosition + 1] === \"%\" || src[cursorPosition + 1] === \"{\"))) {\n text += src[cursorPosition++];\n }\n if (text.length > 0) {\n tokens.push(new Token(text, TOKEN_TYPES.Text));\n continue;\n }\n }\n consumeWhile((char2) => /\\s/.test(char2));\n const char = src[cursorPosition];\n if (char === \"-\" || char === \"+\") {\n const lastTokenType2 = tokens.at(-1)?.type;\n if (lastTokenType2 === TOKEN_TYPES.Text || lastTokenType2 === void 0) {\n throw new SyntaxError(`Unexpected character: ${char}`);\n }\n switch (lastTokenType2) {\n case TOKEN_TYPES.Identifier:\n case TOKEN_TYPES.NumericLiteral:\n case TOKEN_TYPES.BooleanLiteral:\n case TOKEN_TYPES.StringLiteral:\n case TOKEN_TYPES.CloseParen:\n case TOKEN_TYPES.CloseSquareBracket:\n break;\n default: {\n ++cursorPosition;\n const num = consumeWhile(isInteger);\n tokens.push(\n new Token(`${char}${num}`, num.length > 0 ? TOKEN_TYPES.NumericLiteral : TOKEN_TYPES.UnaryOperator)\n );\n continue;\n }\n }\n }\n for (const [char2, token] of ORDERED_MAPPING_TABLE) {\n const slice2 = src.slice(cursorPosition, cursorPosition + char2.length);\n if (slice2 === char2) {\n tokens.push(new Token(char2, token));\n cursorPosition += char2.length;\n continue main;\n }\n }\n if (char === \"'\" || char === '\"') {\n ++cursorPosition;\n const str = consumeWhile((c) => c !== char);\n tokens.push(new Token(str, TOKEN_TYPES.StringLiteral));\n ++cursorPosition;\n continue;\n }\n if (isInteger(char)) {\n const num = consumeWhile(isInteger);\n tokens.push(new Token(num, TOKEN_TYPES.NumericLiteral));\n continue;\n }\n if (isWord(char)) {\n const word = consumeWhile(isWord);\n const type = Object.hasOwn(KEYWORDS, word) ? KEYWORDS[word] : TOKEN_TYPES.Identifier;\n if (type === TOKEN_TYPES.In && tokens.at(-1)?.type === TOKEN_TYPES.Not) {\n tokens.pop();\n tokens.push(new Token(\"not in\", TOKEN_TYPES.NotIn));\n } else {\n tokens.push(new Token(word, type));\n }\n continue;\n }\n throw new SyntaxError(`Unexpected character: ${char}`);\n }\n return tokens;\n}\n\n// src/ast.ts\nvar Statement = class {\n type = \"Statement\";\n};\nvar Program = class extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n type = \"Program\";\n};\nvar If = class extends Statement {\n constructor(test, body, alternate) {\n super();\n this.test = test;\n this.body = body;\n this.alternate = alternate;\n }\n type = \"If\";\n};\nvar For = class extends Statement {\n constructor(loopvar, iterable, body) {\n super();\n this.loopvar = loopvar;\n this.iterable = iterable;\n this.body = body;\n }\n type = \"For\";\n};\nvar SetStatement = class extends Statement {\n constructor(assignee, value) {\n super();\n this.assignee = assignee;\n this.value = value;\n }\n type = \"Set\";\n};\nvar Expression = class extends Statement {\n type = \"Expression\";\n};\nvar MemberExpression = class extends Expression {\n constructor(object, property, computed) {\n super();\n this.object = object;\n this.property = property;\n this.computed = computed;\n }\n type = \"MemberExpression\";\n};\nvar CallExpression = class extends Expression {\n constructor(callee, args) {\n super();\n this.callee = callee;\n this.args = args;\n }\n type = \"CallExpression\";\n};\nvar Identifier = class extends Expression {\n /**\n * @param {string} value The name of the identifier\n */\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Identifier\";\n};\nvar Literal = class extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Literal\";\n};\nvar NumericLiteral = class extends Literal {\n type = \"NumericLiteral\";\n};\nvar StringLiteral = class extends Literal {\n type = \"StringLiteral\";\n};\nvar BooleanLiteral = class extends Literal {\n type = \"BooleanLiteral\";\n};\nvar ArrayLiteral = class extends Literal {\n type = \"ArrayLiteral\";\n};\nvar TupleLiteral = class extends Literal {\n type = \"TupleLiteral\";\n};\nvar ObjectLiteral = class extends Literal {\n type = \"ObjectLiteral\";\n};\nvar BinaryExpression = class extends Expression {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n type = \"BinaryExpression\";\n};\nvar FilterExpression = class extends Expression {\n constructor(operand, filter) {\n super();\n this.operand = operand;\n this.filter = filter;\n }\n type = \"FilterExpression\";\n};\nvar TestExpression = class extends Expression {\n constructor(operand, negate, test) {\n super();\n this.operand = operand;\n this.negate = negate;\n this.test = test;\n }\n type = \"TestExpression\";\n};\nvar UnaryExpression = class extends Expression {\n constructor(operator, argument) {\n super();\n this.operator = operator;\n this.argument = argument;\n }\n type = \"UnaryExpression\";\n};\nvar SliceExpression = class extends Expression {\n constructor(start = void 0, stop = void 0, step = void 0) {\n super();\n this.start = start;\n this.stop = stop;\n this.step = step;\n }\n type = \"SliceExpression\";\n};\nvar KeywordArgumentExpression = class extends Expression {\n constructor(key, value) {\n super();\n this.key = key;\n this.value = value;\n }\n type = \"KeywordArgumentExpression\";\n};\n\n// src/parser.ts\nfunction parse(tokens) {\n const program = new Program([]);\n let current = 0;\n function expect(type, error) {\n const prev = tokens[current++];\n if (!prev || prev.type !== type) {\n throw new Error(`Parser Error: ${error}. ${prev.type} !== ${type}.`);\n }\n return prev;\n }\n function parseAny() {\n switch (tokens[current].type) {\n case TOKEN_TYPES.Text:\n return parseText();\n case TOKEN_TYPES.OpenStatement:\n return parseJinjaStatement();\n case TOKEN_TYPES.OpenExpression:\n return parseJinjaExpression();\n default:\n throw new SyntaxError(`Unexpected token type: ${tokens[current].type}`);\n }\n }\n function not(...types) {\n return current + types.length <= tokens.length && types.some((type, i) => type !== tokens[current + i].type);\n }\n function is(...types) {\n return current + types.length <= tokens.length && types.every((type, i) => type === tokens[current + i].type);\n }\n function parseText() {\n return new StringLiteral(expect(TOKEN_TYPES.Text, \"Expected text token\").value);\n }\n function parseJinjaStatement() {\n expect(TOKEN_TYPES.OpenStatement, \"Expected opening statement token\");\n let result;\n switch (tokens[current].type) {\n case TOKEN_TYPES.Set:\n ++current;\n result = parseSetStatement();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n break;\n case TOKEN_TYPES.If:\n ++current;\n result = parseIfStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expect(TOKEN_TYPES.EndIf, \"Expected endif token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n case TOKEN_TYPES.For:\n ++current;\n result = parseForStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expect(TOKEN_TYPES.EndFor, \"Expected endfor token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n default:\n throw new SyntaxError(`Unknown statement type: ${tokens[current].type}`);\n }\n return result;\n }\n function parseJinjaExpression() {\n expect(TOKEN_TYPES.OpenExpression, \"Expected opening expression token\");\n const result = parseExpression();\n expect(TOKEN_TYPES.CloseExpression, \"Expected closing expression token\");\n return result;\n }\n function parseSetStatement() {\n const left = parseExpression();\n if (is(TOKEN_TYPES.Equals)) {\n ++current;\n const value = parseSetStatement();\n return new SetStatement(left, value);\n }\n return left;\n }\n function parseIfStatement() {\n const test = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n const alternate = [];\n while (!(tokens[current]?.type === TOKEN_TYPES.OpenStatement && (tokens[current + 1]?.type === TOKEN_TYPES.ElseIf || tokens[current + 1]?.type === TOKEN_TYPES.Else || tokens[current + 1]?.type === TOKEN_TYPES.EndIf))) {\n body.push(parseAny());\n }\n if (tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type !== TOKEN_TYPES.EndIf) {\n ++current;\n if (is(TOKEN_TYPES.ElseIf)) {\n expect(TOKEN_TYPES.ElseIf, \"Expected elseif token\");\n alternate.push(parseIfStatement());\n } else {\n expect(TOKEN_TYPES.Else, \"Expected else token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n while (!(tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type === TOKEN_TYPES.EndIf)) {\n alternate.push(parseAny());\n }\n }\n }\n return new If(test, body, alternate);\n }\n function parseExpressionSequence(primary = false) {\n const fn = primary ? parsePrimaryExpression : parseExpression;\n const expressions = [fn()];\n const isTuple = is(TOKEN_TYPES.Comma);\n while (isTuple) {\n ++current;\n expressions.push(fn());\n if (!is(TOKEN_TYPES.Comma)) {\n break;\n }\n }\n return isTuple ? new TupleLiteral(expressions) : expressions[0];\n }\n function parseForStatement() {\n const loopVariable = parseExpressionSequence(true);\n if (!(loopVariable instanceof Identifier || loopVariable instanceof TupleLiteral)) {\n throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${loopVariable.type} instead`);\n }\n expect(TOKEN_TYPES.In, \"Expected `in` keyword following loop variable\");\n const iterable = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n while (not(TOKEN_TYPES.OpenStatement, TOKEN_TYPES.EndFor)) {\n body.push(parseAny());\n }\n return new For(loopVariable, iterable, body);\n }\n function parseExpression() {\n return parseTernaryExpression();\n }\n function parseTernaryExpression() {\n const a = parseLogicalOrExpression();\n if (is(TOKEN_TYPES.If)) {\n ++current;\n const predicate = parseLogicalOrExpression();\n expect(TOKEN_TYPES.Else, \"Expected else token\");\n const b = parseLogicalOrExpression();\n return new If(predicate, [a], [b]);\n }\n return a;\n }\n function parseLogicalOrExpression() {\n let left = parseLogicalAndExpression();\n while (is(TOKEN_TYPES.Or)) {\n const operator = tokens[current];\n ++current;\n const right = parseLogicalAndExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseLogicalAndExpression() {\n let left = parseLogicalNegationExpression();\n while (is(TOKEN_TYPES.And)) {\n const operator = tokens[current];\n ++current;\n const right = parseLogicalNegationExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseLogicalNegationExpression() {\n let right;\n while (is(TOKEN_TYPES.Not)) {\n const operator = tokens[current];\n ++current;\n const arg = parseLogicalNegationExpression();\n right = new UnaryExpression(operator, arg);\n }\n return right ?? parseComparisonExpression();\n }\n function parseComparisonExpression() {\n let left = parseAdditiveExpression();\n while (is(TOKEN_TYPES.ComparisonBinaryOperator) || is(TOKEN_TYPES.In) || is(TOKEN_TYPES.NotIn)) {\n const operator = tokens[current];\n ++current;\n const right = parseAdditiveExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseAdditiveExpression() {\n let left = parseMultiplicativeExpression();\n while (is(TOKEN_TYPES.AdditiveBinaryOperator)) {\n const operator = tokens[current];\n ++current;\n const right = parseMultiplicativeExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseCallMemberExpression() {\n const member = parseMemberExpression();\n if (is(TOKEN_TYPES.OpenParen)) {\n return parseCallExpression(member);\n }\n return member;\n }\n function parseCallExpression(callee) {\n let callExpression = new CallExpression(callee, parseArgs());\n if (is(TOKEN_TYPES.OpenParen)) {\n callExpression = parseCallExpression(callExpression);\n }\n return callExpression;\n }\n function parseArgs() {\n expect(TOKEN_TYPES.OpenParen, \"Expected opening parenthesis for arguments list\");\n const args = parseArgumentsList();\n expect(TOKEN_TYPES.CloseParen, \"Expected closing parenthesis for arguments list\");\n return args;\n }\n function parseArgumentsList() {\n const args = [];\n while (!is(TOKEN_TYPES.CloseParen)) {\n let argument = parseExpression();\n if (is(TOKEN_TYPES.Equals)) {\n ++current;\n if (!(argument instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for keyword argument`);\n }\n const value = parseExpression();\n argument = new KeywordArgumentExpression(argument, value);\n }\n args.push(argument);\n if (is(TOKEN_TYPES.Comma)) {\n ++current;\n }\n }\n return args;\n }\n function parseMemberExpressionArgumentsList() {\n const slices = [];\n let isSlice = false;\n while (!is(TOKEN_TYPES.CloseSquareBracket)) {\n if (is(TOKEN_TYPES.Colon)) {\n slices.push(void 0);\n ++current;\n isSlice = true;\n } else {\n slices.push(parseExpression());\n if (is(TOKEN_TYPES.Colon)) {\n ++current;\n isSlice = true;\n }\n }\n }\n if (slices.length === 0) {\n throw new SyntaxError(`Expected at least one argument for member/slice expression`);\n }\n if (isSlice) {\n if (slices.length > 3) {\n throw new SyntaxError(`Expected 0-3 arguments for slice expression`);\n }\n return new SliceExpression(...slices);\n }\n return slices[0];\n }\n function parseMemberExpression() {\n let object = parsePrimaryExpression();\n while (is(TOKEN_TYPES.Dot) || is(TOKEN_TYPES.OpenSquareBracket)) {\n const operator = tokens[current];\n ++current;\n let property;\n const computed = operator.type !== TOKEN_TYPES.Dot;\n if (computed) {\n property = parseMemberExpressionArgumentsList();\n expect(TOKEN_TYPES.CloseSquareBracket, \"Expected closing square bracket\");\n } else {\n property = parsePrimaryExpression();\n if (property.type !== \"Identifier\") {\n throw new SyntaxError(`Expected identifier following dot operator`);\n }\n }\n object = new MemberExpression(object, property, computed);\n }\n return object;\n }\n function parseMultiplicativeExpression() {\n let left = parseTestExpression();\n while (is(TOKEN_TYPES.MultiplicativeBinaryOperator)) {\n const operator = tokens[current];\n ++current;\n const right = parseTestExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseTestExpression() {\n let operand = parseFilterExpression();\n while (is(TOKEN_TYPES.Is)) {\n ++current;\n const negate = is(TOKEN_TYPES.Not);\n if (negate) {\n ++current;\n }\n let filter = parsePrimaryExpression();\n if (filter instanceof BooleanLiteral) {\n filter = new Identifier(filter.value.toString());\n }\n if (!(filter instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for the test`);\n }\n operand = new TestExpression(operand, negate, filter);\n }\n return operand;\n }\n function parseFilterExpression() {\n let operand = parseCallMemberExpression();\n while (is(TOKEN_TYPES.Pipe)) {\n ++current;\n let filter = parsePrimaryExpression();\n if (!(filter instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for the filter`);\n }\n if (is(TOKEN_TYPES.OpenParen)) {\n filter = parseCallExpression(filter);\n }\n operand = new FilterExpression(operand, filter);\n }\n return operand;\n }\n function parsePrimaryExpression() {\n const token = tokens[current];\n switch (token.type) {\n case TOKEN_TYPES.NumericLiteral:\n ++current;\n return new NumericLiteral(Number(token.value));\n case TOKEN_TYPES.StringLiteral:\n ++current;\n return new StringLiteral(token.value);\n case TOKEN_TYPES.BooleanLiteral:\n ++current;\n return new BooleanLiteral(token.value === \"true\");\n case TOKEN_TYPES.Identifier:\n ++current;\n return new Identifier(token.value);\n case TOKEN_TYPES.OpenParen: {\n ++current;\n const expression = parseExpressionSequence();\n if (tokens[current].type !== TOKEN_TYPES.CloseParen) {\n throw new SyntaxError(`Expected closing parenthesis, got ${tokens[current].type} instead`);\n }\n ++current;\n return expression;\n }\n case TOKEN_TYPES.OpenSquareBracket: {\n ++current;\n const values = [];\n while (!is(TOKEN_TYPES.CloseSquareBracket)) {\n values.push(parseExpression());\n if (is(TOKEN_TYPES.Comma)) {\n ++current;\n }\n }\n ++current;\n return new ArrayLiteral(values);\n }\n case TOKEN_TYPES.OpenCurlyBracket: {\n ++current;\n const values = /* @__PURE__ */ new Map();\n while (!is(TOKEN_TYPES.CloseCurlyBracket)) {\n const key = parseExpression();\n expect(TOKEN_TYPES.Colon, \"Expected colon between key and value in object literal\");\n const value = parseExpression();\n values.set(key, value);\n if (is(TOKEN_TYPES.Comma)) {\n ++current;\n }\n }\n ++current;\n return new ObjectLiteral(values);\n }\n default:\n throw new SyntaxError(`Unexpected token: ${token.type}`);\n }\n }\n while (current < tokens.length) {\n program.body.push(parseAny());\n }\n return program;\n}\n\n// src/utils.ts\nfunction range(start, stop, step = 1) {\n if (stop === void 0) {\n stop = start;\n start = 0;\n }\n const result = [];\n for (let i = start; i < stop; i += step) {\n result.push(i);\n }\n return result;\n}\nfunction slice(array, start, stop, step = 1) {\n const direction = Math.sign(step);\n if (direction >= 0) {\n start = (start ??= 0) < 0 ? Math.max(array.length + start, 0) : Math.min(start, array.length);\n stop = (stop ??= array.length) < 0 ? Math.max(array.length + stop, 0) : Math.min(stop, array.length);\n } else {\n start = (start ??= array.length - 1) < 0 ? Math.max(array.length + start, -1) : Math.min(start, array.length - 1);\n stop = (stop ??= -1) < -1 ? Math.max(array.length + stop, -1) : Math.min(stop, array.length - 1);\n }\n const result = [];\n for (let i = start; direction * i < direction * stop; i += step) {\n result.push(array[i]);\n }\n return result;\n}\nfunction titleCase(value) {\n return value.replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\n// src/runtime.ts\nvar RuntimeValue = class {\n type = \"RuntimeValue\";\n value;\n /**\n * A collection of built-in functions for this type.\n */\n builtins = /* @__PURE__ */ new Map();\n /**\n * Creates a new RuntimeValue.\n */\n constructor(value = void 0) {\n this.value = value;\n }\n /**\n * Determines truthiness or falsiness of the runtime value.\n * This function should be overridden by subclasses if it has custom truthiness criteria.\n * @returns {BooleanValue} BooleanValue(true) if the value is truthy, BooleanValue(false) otherwise.\n */\n __bool__() {\n return new BooleanValue(!!this.value);\n }\n};\nvar NumericValue = class extends RuntimeValue {\n type = \"NumericValue\";\n};\nvar StringValue = class extends RuntimeValue {\n type = \"StringValue\";\n builtins = /* @__PURE__ */ new Map([\n [\n \"upper\",\n new FunctionValue(() => {\n return new StringValue(this.value.toUpperCase());\n })\n ],\n [\n \"lower\",\n new FunctionValue(() => {\n return new StringValue(this.value.toLowerCase());\n })\n ],\n [\n \"strip\",\n new FunctionValue(() => {\n return new StringValue(this.value.trim());\n })\n ],\n [\n \"title\",\n new FunctionValue(() => {\n return new StringValue(titleCase(this.value));\n })\n ],\n [\"length\", new NumericValue(this.value.length)]\n ]);\n};\nvar BooleanValue = class extends RuntimeValue {\n type = \"BooleanValue\";\n};\nvar ObjectValue = class extends RuntimeValue {\n type = \"ObjectValue\";\n /**\n * NOTE: necessary to override since all JavaScript arrays are considered truthy,\n * while only non-empty Python arrays are consider truthy.\n *\n * e.g.,\n * - JavaScript: {} && 5 -> 5\n * - Python: {} and 5 -> {}\n */\n __bool__() {\n return new BooleanValue(this.value.size > 0);\n }\n builtins = /* @__PURE__ */ new Map([\n [\n \"get\",\n new FunctionValue(([key, defaultValue]) => {\n if (!(key instanceof StringValue)) {\n throw new Error(`Object key must be a string: got ${key.type}`);\n }\n return this.value.get(key.value) ?? defaultValue ?? new NullValue();\n })\n ],\n [\n \"items\",\n new FunctionValue(() => {\n return new ArrayValue(\n Array.from(this.value.entries()).map(([key, value]) => new ArrayValue([new StringValue(key), value]))\n );\n })\n ]\n ]);\n};\nvar ArrayValue = class extends RuntimeValue {\n type = \"ArrayValue\";\n builtins = /* @__PURE__ */ new Map([[\"length\", new NumericValue(this.value.length)]]);\n /**\n * NOTE: necessary to override since all JavaScript arrays are considered truthy,\n * while only non-empty Python arrays are consider truthy.\n *\n * e.g.,\n * - JavaScript: [] && 5 -> 5\n * - Python: [] and 5 -> []\n */\n __bool__() {\n return new BooleanValue(this.value.length > 0);\n }\n};\nvar TupleValue = class extends ArrayValue {\n type = \"TupleValue\";\n};\nvar FunctionValue = class extends RuntimeValue {\n type = \"FunctionValue\";\n};\nvar NullValue = class extends RuntimeValue {\n type = \"NullValue\";\n};\nvar UndefinedValue = class extends RuntimeValue {\n type = \"UndefinedValue\";\n};\nvar Environment = class {\n constructor(parent) {\n this.parent = parent;\n }\n /**\n * The variables declared in this environment.\n */\n variables = /* @__PURE__ */ new Map([\n [\n \"namespace\",\n new FunctionValue((args) => {\n if (args.length === 0) {\n return new ObjectValue(/* @__PURE__ */ new Map());\n }\n if (args.length !== 1 || !(args[0] instanceof ObjectValue)) {\n throw new Error(\"`namespace` expects either zero arguments or a single object argument\");\n }\n return args[0];\n })\n ]\n ]);\n /**\n * The tests available in this environment.\n */\n tests = /* @__PURE__ */ new Map([\n [\"boolean\", (operand) => operand.type === \"BooleanValue\"],\n [\"callable\", (operand) => operand instanceof FunctionValue],\n [\n \"odd\",\n (operand) => {\n if (operand.type !== \"NumericValue\") {\n throw new Error(`Cannot apply test \"odd\" to type: ${operand.type}`);\n }\n return operand.value % 2 !== 0;\n }\n ],\n [\n \"even\",\n (operand) => {\n if (operand.type !== \"NumericValue\") {\n throw new Error(`Cannot apply test \"even\" to type: ${operand.type}`);\n }\n return operand.value % 2 === 0;\n }\n ],\n [\"false\", (operand) => operand.type === \"BooleanValue\" && !operand.value],\n [\"true\", (operand) => operand.type === \"BooleanValue\" && operand.value],\n [\"number\", (operand) => operand.type === \"NumericValue\"],\n [\"integer\", (operand) => operand.type === \"NumericValue\" && Number.isInteger(operand.value)],\n [\"iterable\", (operand) => operand instanceof ArrayValue || operand instanceof StringValue],\n [\n \"lower\",\n (operand) => {\n const str = operand.value;\n return operand.type === \"StringValue\" && str === str.toLowerCase();\n }\n ],\n [\n \"upper\",\n (operand) => {\n const str = operand.value;\n return operand.type === \"StringValue\" && str === str.toUpperCase();\n }\n ],\n [\"none\", (operand) => operand.type === \"NullValue\"],\n [\"defined\", (operand) => operand.type !== \"UndefinedValue\"],\n [\"undefined\", (operand) => operand.type === \"UndefinedValue\"],\n [\"equalto\", (a, b) => a.value === b.value]\n ]);\n /**\n * Set the value of a variable in the current environment.\n */\n set(name, value) {\n return this.declareVariable(name, convertToRuntimeValues(value));\n }\n declareVariable(name, value) {\n if (this.variables.has(name)) {\n throw new SyntaxError(`Variable already declared: ${name}`);\n }\n this.variables.set(name, value);\n return value;\n }\n // private assignVariable(name: string, value: AnyRuntimeValue): AnyRuntimeValue {\n // \tconst env = this.resolve(name);\n // \tenv.variables.set(name, value);\n // \treturn value;\n // }\n /**\n * Set variable in the current scope.\n * See https://jinja.palletsprojects.com/en/3.0.x/templates/#assignments for more information.\n */\n setVariable(name, value) {\n this.variables.set(name, value);\n return value;\n }\n /**\n * Resolve the environment in which the variable is declared.\n * @param {string} name The name of the variable.\n * @returns {Environment} The environment in which the variable is declared.\n */\n resolve(name) {\n if (this.variables.has(name)) {\n return this;\n }\n if (this.parent) {\n return this.parent.resolve(name);\n }\n throw new Error(`Unknown variable: ${name}`);\n }\n lookupVariable(name) {\n try {\n return this.resolve(name).variables.get(name) ?? new UndefinedValue();\n } catch {\n return new UndefinedValue();\n }\n }\n};\nvar Interpreter = class {\n global;\n constructor(env) {\n this.global = env ?? new Environment();\n }\n /**\n * Run the program.\n */\n run(program) {\n return this.evaluate(program, this.global);\n }\n /**\n * Evaluates expressions following the binary operation type.\n */\n evaluateBinaryExpression(node, environment) {\n const left = this.evaluate(node.left, environment);\n switch (node.operator.value) {\n case \"and\":\n return left.__bool__().value ? this.evaluate(node.right, environment) : left;\n case \"or\":\n return left.__bool__().value ? left : this.evaluate(node.right, environment);\n }\n const right = this.evaluate(node.right, environment);\n switch (node.operator.value) {\n case \"==\":\n return new BooleanValue(left.value == right.value);\n case \"!=\":\n return new BooleanValue(left.value != right.value);\n }\n if (left instanceof UndefinedValue || right instanceof UndefinedValue) {\n throw new Error(\"Cannot perform operation on undefined values\");\n } else if (left instanceof NullValue || right instanceof NullValue) {\n throw new Error(\"Cannot perform operation on null values\");\n } else if (left instanceof NumericValue && right instanceof NumericValue) {\n switch (node.operator.value) {\n case \"+\":\n return new NumericValue(left.value + right.value);\n case \"-\":\n return new NumericValue(left.value - right.value);\n case \"*\":\n return new NumericValue(left.value * right.value);\n case \"/\":\n return new NumericValue(left.value / right.value);\n case \"%\":\n return new NumericValue(left.value % right.value);\n case \"<\":\n return new BooleanValue(left.value < right.value);\n case \">\":\n return new BooleanValue(left.value > right.value);\n case \">=\":\n return new BooleanValue(left.value >= right.value);\n case \"<=\":\n return new BooleanValue(left.value <= right.value);\n }\n } else if (left instanceof ArrayValue && right instanceof ArrayValue) {\n switch (node.operator.value) {\n case \"+\":\n return new ArrayValue(left.value.concat(right.value));\n }\n } else if (right instanceof ArrayValue) {\n const member = right.value.find((x) => x.value === left.value) !== void 0;\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(member);\n case \"not in\":\n return new BooleanValue(!member);\n }\n }\n if (left instanceof StringValue || right instanceof StringValue) {\n switch (node.operator.value) {\n case \"+\":\n return new StringValue(left.value.toString() + right.value.toString());\n }\n }\n if (left instanceof StringValue && right instanceof StringValue) {\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(right.value.includes(left.value));\n case \"not in\":\n return new BooleanValue(!right.value.includes(left.value));\n }\n }\n if (left instanceof StringValue && right instanceof ObjectValue) {\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(right.value.has(left.value));\n case \"not in\":\n return new BooleanValue(!right.value.has(left.value));\n }\n }\n throw new SyntaxError(`Unknown operator \"${node.operator.value}\" between ${left.type} and ${right.type}`);\n }\n /**\n * Evaluates expressions following the filter operation type.\n */\n evaluateFilterExpression(node, environment) {\n const operand = this.evaluate(node.operand, environment);\n if (node.filter.type === \"Identifier\") {\n const filter = node.filter;\n if (operand instanceof ArrayValue) {\n switch (filter.value) {\n case \"list\":\n return operand;\n case \"first\":\n return operand.value[0];\n case \"last\":\n return operand.value[operand.value.length - 1];\n case \"length\":\n return new NumericValue(operand.value.length);\n case \"reverse\":\n return new ArrayValue(operand.value.reverse());\n case \"sort\":\n return new ArrayValue(\n operand.value.sort((a, b) => {\n if (a.type !== b.type) {\n throw new Error(`Cannot compare different types: ${a.type} and ${b.type}`);\n }\n switch (a.type) {\n case \"NumericValue\":\n return a.value - b.value;\n case \"StringValue\":\n return a.value.localeCompare(b.value);\n default:\n throw new Error(`Cannot compare type: ${a.type}`);\n }\n })\n );\n default:\n throw new Error(`Unknown ArrayValue filter: ${filter.value}`);\n }\n } else if (operand instanceof StringValue) {\n switch (filter.value) {\n case \"length\":\n return new NumericValue(operand.value.length);\n case \"upper\":\n return new StringValue(operand.value.toUpperCase());\n case \"lower\":\n return new StringValue(operand.value.toLowerCase());\n case \"title\":\n return new StringValue(titleCase(operand.value));\n case \"capitalize\":\n return new StringValue(operand.value.charAt(0).toUpperCase() + operand.value.slice(1));\n case \"trim\":\n return new StringValue(operand.value.trim());\n default:\n throw new Error(`Unknown StringValue filter: ${filter.value}`);\n }\n } else if (operand instanceof NumericValue) {\n switch (filter.value) {\n case \"abs\":\n return new NumericValue(Math.abs(operand.value));\n default:\n throw new Error(`Unknown NumericValue filter: ${filter.value}`);\n }\n } else if (operand instanceof ObjectValue) {\n switch (filter.value) {\n case \"items\":\n return new ArrayValue(\n Array.from(operand.value.entries()).map(([key, value]) => new ArrayValue([new StringValue(key), value]))\n );\n case \"length\":\n return new NumericValue(operand.value.size);\n default:\n throw new Error(`Unknown ObjectValue filter: ${filter.value}`);\n }\n }\n throw new Error(`Cannot apply filter \"${filter.value}\" to type: ${operand.type}`);\n } else if (node.filter.type === \"CallExpression\") {\n const filter = node.filter;\n if (filter.callee.type !== \"Identifier\") {\n throw new Error(`Unknown filter: ${filter.callee.type}`);\n }\n const filterName = filter.callee.value;\n if (operand instanceof ArrayValue) {\n switch (filterName) {\n case \"selectattr\": {\n if (operand.value.some((x) => !(x instanceof ObjectValue))) {\n throw new Error(\"`selectattr` can only be applied to array of objects\");\n }\n if (filter.args.some((x) => x.type !== \"StringLiteral\")) {\n throw new Error(\"arguments of `selectattr` must be strings\");\n }\n const [attr, testName, value] = filter.args.map((x) => this.evaluate(x, environment));\n let testFunction;\n if (testName) {\n const test = environment.tests.get(testName.value);\n if (!test) {\n throw new Error(`Unknown test: ${testName.value}`);\n }\n testFunction = test;\n } else {\n testFunction = (...x) => x[0].__bool__().value;\n }\n const filtered = operand.value.filter((item) => {\n const a = item.value.get(attr.value);\n if (a) {\n return testFunction(a, value);\n }\n return false;\n });\n return new ArrayValue(filtered);\n }\n }\n throw new Error(`Unknown ArrayValue filter: ${filterName}`);\n } else {\n throw new Error(`Cannot apply filter \"${filterName}\" to type: ${operand.type}`);\n }\n }\n throw new Error(`Unknown filter: ${node.filter.type}`);\n }\n /**\n * Evaluates expressions following the test operation type.\n */\n evaluateTestExpression(node, environment) {\n const operand = this.evaluate(node.operand, environment);\n const test = environment.tests.get(node.test.value);\n if (!test) {\n throw new Error(`Unknown test: ${node.test.value}`);\n }\n const result = test(operand);\n return new BooleanValue(node.negate ? !result : result);\n }\n /**\n * Evaluates expressions following the unary operation type.\n */\n evaluateUnaryExpression(node, environment) {\n const argument = this.evaluate(node.argument, environment);\n switch (node.operator.value) {\n case \"not\":\n return new BooleanValue(!argument.value);\n default:\n throw new SyntaxError(`Unknown operator: ${node.operator.value}`);\n }\n }\n evalProgram(program, environment) {\n return this.evaluateBlock(program.body, environment);\n }\n evaluateBlock(statements, environment) {\n let result = \"\";\n for (const statement of statements) {\n const lastEvaluated = this.evaluate(statement, environment);\n if (lastEvaluated.type !== \"NullValue\" && lastEvaluated.type !== \"UndefinedValue\") {\n result += lastEvaluated.value;\n }\n }\n return new StringValue(result);\n }\n evaluateIdentifier(node, environment) {\n return environment.lookupVariable(node.value);\n }\n evaluateCallExpression(expr, environment) {\n const args = [];\n const kwargs = /* @__PURE__ */ new Map();\n for (const argument of expr.args) {\n if (argument.type === \"KeywordArgumentExpression\") {\n const kwarg = argument;\n kwargs.set(kwarg.key.value, this.evaluate(kwarg.value, environment));\n } else {\n args.push(this.evaluate(argument, environment));\n }\n }\n if (kwargs.size > 0) {\n args.push(new ObjectValue(kwargs));\n }\n const fn = this.evaluate(expr.callee, environment);\n if (fn.type !== \"FunctionValue\") {\n throw new Error(`Cannot call something that is not a function: got ${fn.type}`);\n }\n return fn.value(args, environment);\n }\n evaluateSliceExpression(object, expr, environment) {\n if (!(object instanceof ArrayValue || object instanceof StringValue)) {\n throw new Error(\"Slice object must be an array or string\");\n }\n const start = this.evaluate(expr.start, environment);\n const stop = this.evaluate(expr.stop, environment);\n const step = this.evaluate(expr.step, environment);\n if (!(start instanceof NumericValue || start instanceof UndefinedValue)) {\n throw new Error(\"Slice start must be numeric or undefined\");\n }\n if (!(stop instanceof NumericValue || stop instanceof UndefinedValue)) {\n throw new Error(\"Slice stop must be numeric or undefined\");\n }\n if (!(step instanceof NumericValue || step instanceof UndefinedValue)) {\n throw new Error(\"Slice step must be numeric or undefined\");\n }\n if (object instanceof ArrayValue) {\n return new ArrayValue(slice(object.value, start.value, stop.value, step.value));\n } else {\n return new StringValue(slice(Array.from(object.value), start.value, stop.value, step.value).join(\"\"));\n }\n }\n evaluateMemberExpression(expr, environment) {\n const object = this.evaluate(expr.object, environment);\n let property;\n if (expr.computed) {\n if (expr.property.type === \"SliceExpression\") {\n return this.evaluateSliceExpression(object, expr.property, environment);\n } else {\n property = this.evaluate(expr.property, environment);\n }\n } else {\n property = new StringValue(expr.property.value);\n }\n let value;\n if (object instanceof ObjectValue) {\n if (!(property instanceof StringValue)) {\n throw new Error(`Cannot access property with non-string: got ${property.type}`);\n }\n value = object.value.get(property.value) ?? object.builtins.get(property.value);\n } else if (object instanceof ArrayValue || object instanceof StringValue) {\n if (property instanceof NumericValue) {\n value = object.value.at(property.value);\n if (object instanceof StringValue) {\n value = new StringValue(object.value.at(property.value));\n }\n } else if (property instanceof StringValue) {\n value = object.builtins.get(property.value);\n } else {\n throw new Error(`Cannot access property with non-string/non-number: got ${property.type}`);\n }\n } else {\n if (!(property instanceof StringValue)) {\n throw new Error(`Cannot access property with non-string: got ${property.type}`);\n }\n value = object.builtins.get(property.value);\n }\n return value instanceof RuntimeValue ? value : new UndefinedValue();\n }\n evaluateSet(node, environment) {\n const rhs = this.evaluate(node.value, environment);\n if (node.assignee.type === \"Identifier\") {\n const variableName = node.assignee.value;\n environment.setVariable(variableName, rhs);\n } else if (node.assignee.type === \"MemberExpression\") {\n const member = node.assignee;\n const object = this.evaluate(member.object, environment);\n if (!(object instanceof ObjectValue)) {\n throw new Error(\"Cannot assign to member of non-object\");\n }\n if (member.property.type !== \"Identifier\") {\n throw new Error(\"Cannot assign to member with non-identifier property\");\n }\n object.value.set(member.property.value, rhs);\n } else {\n throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(node.assignee)}`);\n }\n return new NullValue();\n }\n evaluateIf(node, environment) {\n const test = this.evaluate(node.test, environment);\n return this.evaluateBlock(test.__bool__().value ? node.body : node.alternate, environment);\n }\n evaluateFor(node, environment) {\n const scope = new Environment(environment);\n const iterable = this.evaluate(node.iterable, scope);\n if (!(iterable instanceof ArrayValue)) {\n throw new Error(`Expected iterable type in for loop: got ${iterable.type}`);\n }\n let result = \"\";\n for (let i = 0; i < iterable.value.length; ++i) {\n const loop = /* @__PURE__ */ new Map([\n [\"index\", new NumericValue(i + 1)],\n [\"index0\", new NumericValue(i)],\n [\"revindex\", new NumericValue(iterable.value.length - i)],\n [\"revindex0\", new NumericValue(iterable.value.length - i - 1)],\n [\"first\", new BooleanValue(i === 0)],\n [\"last\", new BooleanValue(i === iterable.value.length - 1)],\n [\"length\", new NumericValue(iterable.value.length)],\n [\"previtem\", i > 0 ? iterable.value[i - 1] : new UndefinedValue()],\n [\"nextitem\", i < iterable.value.length - 1 ? iterable.value[i + 1] : new UndefinedValue()]\n ]);\n scope.setVariable(\"loop\", new ObjectValue(loop));\n const current = iterable.value[i];\n if (node.loopvar.type === \"Identifier\") {\n scope.setVariable(node.loopvar.value, current);\n } else if (node.loopvar.type === \"TupleLiteral\") {\n const loopvar = node.loopvar;\n if (current.type !== \"ArrayValue\") {\n throw new Error(`Cannot unpack non-iterable type: ${current.type}`);\n }\n const c = current;\n if (loopvar.value.length !== c.value.length) {\n throw new Error(`Too ${loopvar.value.length > c.value.length ? \"few\" : \"many\"} items to unpack`);\n }\n for (let j = 0; j < loopvar.value.length; ++j) {\n if (loopvar.value[j].type !== \"Identifier\") {\n throw new Error(`Cannot unpack non-identifier type: ${loopvar.value[j].type}`);\n }\n scope.setVariable(loopvar.value[j].value, c.value[j]);\n }\n }\n const evaluated = this.evaluateBlock(node.body, scope);\n result += evaluated.value;\n }\n return new StringValue(result);\n }\n evaluate(statement, environment) {\n if (statement === void 0)\n return new UndefinedValue();\n switch (statement.type) {\n case \"Program\":\n return this.evalProgram(statement, environment);\n case \"Set\":\n return this.evaluateSet(statement, environment);\n case \"If\":\n return this.evaluateIf(statement, environment);\n case \"For\":\n return this.evaluateFor(statement, environment);\n case \"NumericLiteral\":\n return new NumericValue(Number(statement.value));\n case \"StringLiteral\":\n return new StringValue(statement.value);\n case \"BooleanLiteral\":\n return new BooleanValue(statement.value);\n case \"ArrayLiteral\":\n return new ArrayValue(statement.value.map((x) => this.evaluate(x, environment)));\n case \"TupleLiteral\":\n return new TupleValue(statement.value.map((x) => this.evaluate(x, environment)));\n case \"ObjectLiteral\": {\n const mapping = /* @__PURE__ */ new Map();\n for (const [key, value] of statement.value) {\n const evaluatedKey = this.evaluate(key, environment);\n if (!(evaluatedKey instanceof StringValue)) {\n throw new Error(`Object keys must be strings: got ${evaluatedKey.type}`);\n }\n mapping.set(evaluatedKey.value, this.evaluate(value, environment));\n }\n return new ObjectValue(mapping);\n }\n case \"Identifier\":\n return this.evaluateIdentifier(statement, environment);\n case \"CallExpression\":\n return this.evaluateCallExpression(statement, environment);\n case \"MemberExpression\":\n return this.evaluateMemberExpression(statement, environment);\n case \"UnaryExpression\":\n return this.evaluateUnaryExpression(statement, environment);\n case \"BinaryExpression\":\n return this.evaluateBinaryExpression(statement, environment);\n case \"FilterExpression\":\n return this.evaluateFilterExpression(statement, environment);\n case \"TestExpression\":\n return this.evaluateTestExpression(statement, environment);\n default:\n throw new SyntaxError(`Unknown node type: ${statement.type}`);\n }\n }\n};\nfunction convertToRuntimeValues(input) {\n switch (typeof input) {\n case \"number\":\n return new NumericValue(input);\n case \"string\":\n return new StringValue(input);\n case \"boolean\":\n return new BooleanValue(input);\n case \"object\":\n if (input === null) {\n return new NullValue();\n } else if (Array.isArray(input)) {\n return new ArrayValue(input.map(convertToRuntimeValues));\n } else {\n return new ObjectValue(\n new Map(Object.entries(input).map(([key, value]) => [key, convertToRuntimeValues(value)]))\n );\n }\n case \"function\":\n return new FunctionValue((args, _scope) => {\n const result = input(...args.map((x) => x.value)) ?? null;\n return convertToRuntimeValues(result);\n });\n default:\n throw new Error(`Cannot convert to runtime value: ${input}`);\n }\n}\n\n// src/index.ts\nvar Template = class {\n parsed;\n /**\n * @param {string} template The template string\n */\n constructor(template) {\n const tokens = tokenize(template, {\n lstrip_blocks: true,\n trim_blocks: true\n });\n this.parsed = parse(tokens);\n }\n render(items) {\n const env = new Environment();\n env.set(\"false\", false);\n env.set(\"true\", true);\n env.set(\"raise_exception\", (args) => {\n throw new Error(args);\n });\n env.set(\"range\", range);\n for (const [key, value] of Object.entries(items)) {\n env.set(key, value);\n }\n const interpreter = new Interpreter(env);\n const result = interpreter.run(this.parsed);\n return result.value;\n }\n};\nexport {\n Environment,\n Interpreter,\n Template,\n parse,\n tokenize\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nconst backends = new Map();\nconst backendsSortedByPriority = [];\n/**\n * Register a backend.\n *\n * @param name - the name as a key to lookup as an execution provider.\n * @param backend - the backend object.\n * @param priority - an integer indicating the priority of the backend. Higher number means higher priority. if priority\n * < 0, it will be considered as a 'beta' version and will not be used as a fallback backend by default.\n *\n * @ignore\n */\nexport const registerBackend = (name, backend, priority) => {\n if (backend && typeof backend.init === 'function' && typeof backend.createInferenceSessionHandler === 'function') {\n const currentBackend = backends.get(name);\n if (currentBackend === undefined) {\n backends.set(name, { backend, priority });\n }\n else if (currentBackend.priority > priority) {\n // same name is already registered with a higher priority. skip registeration.\n return;\n }\n else if (currentBackend.priority === priority) {\n if (currentBackend.backend !== backend) {\n throw new Error(`cannot register backend \"${name}\" using priority ${priority}`);\n }\n }\n if (priority >= 0) {\n const i = backendsSortedByPriority.indexOf(name);\n if (i !== -1) {\n backendsSortedByPriority.splice(i, 1);\n }\n for (let i = 0; i < backendsSortedByPriority.length; i++) {\n if (backends.get(backendsSortedByPriority[i]).priority <= priority) {\n backendsSortedByPriority.splice(i, 0, name);\n return;\n }\n }\n backendsSortedByPriority.push(name);\n }\n return;\n }\n throw new TypeError('not a valid backend');\n};\n/**\n * Resolve backend by specified hints.\n *\n * @param backendHints - a list of execution provider names to lookup. If omitted use registered backends as list.\n * @returns a promise that resolves to the backend.\n *\n * @ignore\n */\nexport const resolveBackend = async (backendHints) => {\n const backendNames = backendHints.length === 0 ? backendsSortedByPriority : backendHints;\n const errors = [];\n for (const backendName of backendNames) {\n const backendInfo = backends.get(backendName);\n if (backendInfo) {\n if (backendInfo.initialized) {\n return backendInfo.backend;\n }\n else if (backendInfo.aborted) {\n continue; // current backend is unavailable; try next\n }\n const isInitializing = !!backendInfo.initPromise;\n try {\n if (!isInitializing) {\n backendInfo.initPromise = backendInfo.backend.init(backendName);\n }\n await backendInfo.initPromise;\n backendInfo.initialized = true;\n return backendInfo.backend;\n }\n catch (e) {\n if (!isInitializing) {\n errors.push({ name: backendName, err: e });\n }\n backendInfo.aborted = true;\n }\n finally {\n delete backendInfo.initPromise;\n }\n }\n }\n throw new Error(`no available backend found. ERR: ${errors.map(e => `[${e.name}] ${e.err}`).join(', ')}`);\n};\n//# sourceMappingURL=backend-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { version } from './version.js';\nlet logLevelValue = 'warning';\nexport const env = {\n wasm: {},\n webgl: {},\n webgpu: {},\n versions: { common: version },\n set logLevel(value) {\n if (value === undefined) {\n return;\n }\n if (typeof value !== 'string' || ['verbose', 'info', 'warning', 'error', 'fatal'].indexOf(value) === -1) {\n throw new Error(`Unsupported logging level: ${value}`);\n }\n logLevelValue = value;\n },\n get logLevel() {\n return logLevelValue;\n },\n};\n// set property 'logLevel' so that they can be correctly transferred to worker by `postMessage()`.\nObject.defineProperty(env, 'logLevel', { enumerable: true });\n//# sourceMappingURL=env-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { env as envImpl } from './env-impl.js';\n/**\n * Represent a set of flags as a global singleton.\n */\nexport const env = envImpl;\n//# sourceMappingURL=env.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { resolveBackend } from './backend-impl.js';\nimport { Tensor } from './tensor.js';\nimport { TRACE_FUNC_BEGIN, TRACE_FUNC_END } from './trace.js';\nexport class InferenceSession {\n constructor(handler) {\n this.handler = handler;\n }\n async run(feeds, arg1, arg2) {\n TRACE_FUNC_BEGIN();\n const fetches = {};\n let options = {};\n // check inputs\n if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n throw new TypeError('\\'feeds\\' must be an object that use input names as keys and OnnxValue as corresponding values.');\n }\n let isFetchesEmpty = true;\n // determine which override is being used\n if (typeof arg1 === 'object') {\n if (arg1 === null) {\n throw new TypeError('Unexpected argument[1]: cannot be null.');\n }\n if (arg1 instanceof Tensor) {\n throw new TypeError('\\'fetches\\' cannot be a Tensor');\n }\n if (Array.isArray(arg1)) {\n if (arg1.length === 0) {\n throw new TypeError('\\'fetches\\' cannot be an empty array.');\n }\n isFetchesEmpty = false;\n // output names\n for (const name of arg1) {\n if (typeof name !== 'string') {\n throw new TypeError('\\'fetches\\' must be a string array or an object.');\n }\n if (this.outputNames.indexOf(name) === -1) {\n throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n }\n fetches[name] = null;\n }\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n // decide whether arg1 is fetches or options\n // if any output name is present and its value is valid OnnxValue, we consider it fetches\n let isFetches = false;\n const arg1Keys = Object.getOwnPropertyNames(arg1);\n for (const name of this.outputNames) {\n if (arg1Keys.indexOf(name) !== -1) {\n const v = arg1[name];\n if (v === null || v instanceof Tensor) {\n isFetches = true;\n isFetchesEmpty = false;\n fetches[name] = v;\n }\n }\n }\n if (isFetches) {\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n options = arg1;\n }\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('Unexpected argument[1]: must be \\'fetches\\' or \\'options\\'.');\n }\n // check if all inputs are in feed\n for (const name of this.inputNames) {\n if (typeof feeds[name] === 'undefined') {\n throw new Error(`input '${name}' is missing in 'feeds'.`);\n }\n }\n // if no fetches is specified, we use the full output names list\n if (isFetchesEmpty) {\n for (const name of this.outputNames) {\n fetches[name] = null;\n }\n }\n // feeds, fetches and options are prepared\n const results = await this.handler.run(feeds, fetches, options);\n const returnValue = {};\n for (const key in results) {\n if (Object.hasOwnProperty.call(results, key)) {\n const result = results[key];\n if (result instanceof Tensor) {\n returnValue[key] = result;\n }\n else {\n returnValue[key] = new Tensor(result.type, result.data, result.dims);\n }\n }\n }\n TRACE_FUNC_END();\n return returnValue;\n }\n async release() {\n return this.handler.dispose();\n }\n static async create(arg0, arg1, arg2, arg3) {\n TRACE_FUNC_BEGIN();\n // either load from a file or buffer\n let filePathOrUint8Array;\n let options = {};\n if (typeof arg0 === 'string') {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (arg0 instanceof Uint8Array) {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (arg0 instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && arg0 instanceof SharedArrayBuffer)) {\n const buffer = arg0;\n let byteOffset = 0;\n let byteLength = arg0.byteLength;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 === 'number') {\n byteOffset = arg1;\n if (!Number.isSafeInteger(byteOffset)) {\n throw new RangeError('\\'byteOffset\\' must be an integer.');\n }\n if (byteOffset < 0 || byteOffset >= buffer.byteLength) {\n throw new RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`);\n }\n byteLength = arg0.byteLength - byteOffset;\n if (typeof arg2 === 'number') {\n byteLength = arg2;\n if (!Number.isSafeInteger(byteLength)) {\n throw new RangeError('\\'byteLength\\' must be an integer.');\n }\n if (byteLength <= 0 || byteOffset + byteLength > buffer.byteLength) {\n throw new RangeError(`'byteLength' is out of range (0, ${buffer.byteLength - byteOffset}].`);\n }\n if (typeof arg3 === 'object' && arg3 !== null) {\n options = arg3;\n }\n else if (typeof arg3 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'byteLength\\' must be a number.');\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n filePathOrUint8Array = new Uint8Array(buffer, byteOffset, byteLength);\n }\n else {\n throw new TypeError('Unexpected argument[0]: must be \\'path\\' or \\'buffer\\'.');\n }\n // get backend hints\n const eps = options.executionProviders || [];\n const backendHints = eps.map(i => typeof i === 'string' ? i : i.name);\n const backend = await resolveBackend(backendHints);\n const handler = await backend.createInferenceSessionHandler(filePathOrUint8Array, options);\n TRACE_FUNC_END();\n return new InferenceSession(handler);\n }\n startProfiling() {\n this.handler.startProfiling();\n }\n endProfiling() {\n this.handler.endProfiling();\n }\n get inputNames() {\n return this.handler.inputNames;\n }\n get outputNames() {\n return this.handler.outputNames;\n }\n}\n//# sourceMappingURL=inference-session-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { InferenceSession as InferenceSessionImpl } from './inference-session-impl.js';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const InferenceSession = InferenceSessionImpl;\n//# sourceMappingURL=inference-session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n/**\n * implementation of Tensor.toDataURL()\n */\nexport const tensorToDataURL = (tensor, options) => {\n const canvas = typeof document !== 'undefined' ? document.createElement('canvas') : (new OffscreenCanvas(1, 1));\n canvas.width = tensor.dims[3];\n canvas.height = tensor.dims[2];\n const pixels2DContext = canvas.getContext('2d');\n if (pixels2DContext != null) {\n // Default values for height and width & format\n let width;\n let height;\n if (options?.tensorLayout !== undefined && options.tensorLayout === 'NHWC') {\n width = tensor.dims[2];\n height = tensor.dims[3];\n }\n else { // Default layout is NCWH\n width = tensor.dims[3];\n height = tensor.dims[2];\n }\n const inputformat = options?.format !== undefined ? options.format : 'RGB';\n const norm = options?.norm;\n let normMean;\n let normBias;\n if (norm === undefined || norm.mean === undefined) {\n normMean = [255, 255, 255, 255];\n }\n else {\n if (typeof (norm.mean) === 'number') {\n normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n }\n else {\n normMean = [norm.mean[0], norm.mean[1], norm.mean[2], 0];\n if (norm.mean[3] !== undefined) {\n normMean[3] = norm.mean[3];\n }\n }\n }\n if (norm === undefined || norm.bias === undefined) {\n normBias = [0, 0, 0, 0];\n }\n else {\n if (typeof (norm.bias) === 'number') {\n normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n }\n else {\n normBias = [norm.bias[0], norm.bias[1], norm.bias[2], 0];\n if (norm.bias[3] !== undefined) {\n normBias[3] = norm.bias[3];\n }\n }\n }\n const stride = height * width;\n // Default pointer assignments\n let rTensorPointer = 0, gTensorPointer = stride, bTensorPointer = stride * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGBA') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n aTensorPointer = stride * 3;\n }\n else if (inputformat === 'RGB') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n }\n else if (inputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = stride;\n gTensorPointer = stride * 2;\n }\n for (let i = 0; i < height; i++) {\n for (let j = 0; j < width; j++) {\n const R = (tensor.data[rTensorPointer++] - normBias[0]) * normMean[0]; // R value\n const G = (tensor.data[gTensorPointer++] - normBias[1]) * normMean[1]; // G value\n const B = (tensor.data[bTensorPointer++] - normBias[2]) * normMean[2]; // B value\n const A = aTensorPointer === -1 ?\n 255 :\n (tensor.data[aTensorPointer++] - normBias[3]) * normMean[3]; // A value\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n pixels2DContext.fillStyle = 'rgba(' + R + ',' + G + ',' + B + ',' + A + ')';\n pixels2DContext.fillRect(j, i, 1, 1);\n }\n }\n if ('toDataURL' in canvas) {\n return canvas.toDataURL();\n }\n else {\n throw new Error('toDataURL is not supported');\n }\n }\n else {\n throw new Error('Can not access image data');\n }\n};\n/**\n * implementation of Tensor.toImageData()\n */\nexport const tensorToImageData = (tensor, options) => {\n const pixels2DContext = typeof document !== 'undefined' ?\n document.createElement('canvas').getContext('2d') :\n new OffscreenCanvas(1, 1).getContext('2d');\n let image;\n if (pixels2DContext != null) {\n // Default values for height and width & format\n let width;\n let height;\n let channels;\n if (options?.tensorLayout !== undefined && options.tensorLayout === 'NHWC') {\n width = tensor.dims[2];\n height = tensor.dims[1];\n channels = tensor.dims[3];\n }\n else { // Default layout is NCWH\n width = tensor.dims[3];\n height = tensor.dims[2];\n channels = tensor.dims[1];\n }\n const inputformat = options !== undefined ? (options.format !== undefined ? options.format : 'RGB') : 'RGB';\n const norm = options?.norm;\n let normMean;\n let normBias;\n if (norm === undefined || norm.mean === undefined) {\n normMean = [255, 255, 255, 255];\n }\n else {\n if (typeof (norm.mean) === 'number') {\n normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n }\n else {\n normMean = [norm.mean[0], norm.mean[1], norm.mean[2], 255];\n if (norm.mean[3] !== undefined) {\n normMean[3] = norm.mean[3];\n }\n }\n }\n if (norm === undefined || norm.bias === undefined) {\n normBias = [0, 0, 0, 0];\n }\n else {\n if (typeof (norm.bias) === 'number') {\n normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n }\n else {\n normBias = [norm.bias[0], norm.bias[1], norm.bias[2], 0];\n if (norm.bias[3] !== undefined) {\n normBias[3] = norm.bias[3];\n }\n }\n }\n const stride = height * width;\n if (options !== undefined) {\n if (options.format !== undefined && (channels === 4 && options.format !== 'RGBA') ||\n (channels === 3 && (options.format !== 'RGB' && options.format !== 'BGR'))) {\n throw new Error('Tensor format doesn\\'t match input tensor dims');\n }\n }\n // Default pointer assignments\n const step = 4;\n let rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = stride, bTensorPointer = stride * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGBA') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n aTensorPointer = stride * 3;\n }\n else if (inputformat === 'RGB') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n }\n else if (inputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = stride;\n gTensorPointer = stride * 2;\n }\n image = pixels2DContext.createImageData(width, height);\n for (let i = 0; i < height * width; rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++) {\n image.data[rImagePointer] = (tensor.data[rTensorPointer++] - normBias[0]) * normMean[0]; // R value\n image.data[gImagePointer] = (tensor.data[gTensorPointer++] - normBias[1]) * normMean[1]; // G value\n image.data[bImagePointer] = (tensor.data[bTensorPointer++] - normBias[2]) * normMean[2]; // B value\n image.data[aImagePointer] = aTensorPointer === -1 ?\n 255 :\n (tensor.data[aTensorPointer++] - normBias[3]) * normMean[3]; // A value\n }\n }\n else {\n throw new Error('Can not access image data');\n }\n return image;\n};\n//# sourceMappingURL=tensor-conversion-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { Tensor } from './tensor-impl.js';\n/**\n * Create a new tensor object from image object\n *\n * @param buffer - Extracted image buffer data - assuming RGBA format\n * @param imageFormat - input image configuration - required configurations height, width, format\n * @param tensorFormat - output tensor configuration - Default is RGB format\n */\nexport const bufferToTensor = (buffer, options) => {\n if (buffer === undefined) {\n throw new Error('Image buffer must be defined');\n }\n if (options.height === undefined || options.width === undefined) {\n throw new Error('Image height and width must be defined');\n }\n if (options.tensorLayout === 'NHWC') {\n throw new Error('NHWC Tensor layout is not supported yet');\n }\n const { height, width } = options;\n const norm = options.norm ?? { mean: 255, bias: 0 };\n let normMean;\n let normBias;\n if (typeof (norm.mean) === 'number') {\n normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n }\n else {\n normMean = [norm.mean[0], norm.mean[1], norm.mean[2], norm.mean[3] ?? 255];\n }\n if (typeof (norm.bias) === 'number') {\n normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n }\n else {\n normBias = [norm.bias[0], norm.bias[1], norm.bias[2], norm.bias[3] ?? 0];\n }\n const inputformat = options.format !== undefined ? options.format : 'RGBA';\n // default value is RGBA since imagedata and HTMLImageElement uses it\n const outputformat = options.tensorFormat !== undefined ? (options.tensorFormat !== undefined ? options.tensorFormat : 'RGB') : 'RGB';\n const stride = height * width;\n const float32Data = outputformat === 'RGBA' ? new Float32Array(stride * 4) : new Float32Array(stride * 3);\n // Default pointer assignments\n let step = 4, rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = stride, bTensorPointer = stride * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGB') {\n step = 3;\n rImagePointer = 0;\n gImagePointer = 1;\n bImagePointer = 2;\n aImagePointer = -1;\n }\n // Updating the pointer assignments based on the output tensor format\n if (outputformat === 'RGBA') {\n aTensorPointer = stride * 3;\n }\n else if (outputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = stride;\n gTensorPointer = stride * 2;\n }\n else if (outputformat === 'BGR') {\n bTensorPointer = 0;\n gTensorPointer = stride;\n rTensorPointer = stride * 2;\n }\n for (let i = 0; i < stride; i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step) {\n float32Data[rTensorPointer++] = (buffer[rImagePointer] + normBias[0]) / normMean[0];\n float32Data[gTensorPointer++] = (buffer[gImagePointer] + normBias[1]) / normMean[1];\n float32Data[bTensorPointer++] = (buffer[bImagePointer] + normBias[2]) / normMean[2];\n if (aTensorPointer !== -1 && aImagePointer !== -1) {\n float32Data[aTensorPointer++] = (buffer[aImagePointer] + normBias[3]) / normMean[3];\n }\n }\n // Float32Array -> ort.Tensor\n const outputTensor = outputformat === 'RGBA' ? new Tensor('float32', float32Data, [1, 4, height, width]) :\n new Tensor('float32', float32Data, [1, 3, height, width]);\n return outputTensor;\n};\n/**\n * implementation of Tensor.fromImage().\n */\nexport const tensorFromImage = async (image, options) => {\n // checking the type of image object\n const isHTMLImageEle = typeof (HTMLImageElement) !== 'undefined' && image instanceof HTMLImageElement;\n const isImageDataEle = typeof (ImageData) !== 'undefined' && image instanceof ImageData;\n const isImageBitmap = typeof (ImageBitmap) !== 'undefined' && image instanceof ImageBitmap;\n const isString = typeof image === 'string';\n let data;\n let bufferToTensorOptions = options ?? {};\n const createCanvas = () => {\n if (typeof document !== 'undefined') {\n return document.createElement('canvas');\n }\n else if (typeof OffscreenCanvas !== 'undefined') {\n return new OffscreenCanvas(1, 1);\n }\n else {\n throw new Error('Canvas is not supported');\n }\n };\n const createCanvasContext = (canvas) => {\n if (canvas instanceof HTMLCanvasElement) {\n return canvas.getContext('2d');\n }\n else if (canvas instanceof OffscreenCanvas) {\n return canvas.getContext('2d');\n }\n else {\n return null;\n }\n };\n // filling and checking image configuration options\n if (isHTMLImageEle) {\n // HTMLImageElement - image object - format is RGBA by default\n const canvas = createCanvas();\n canvas.width = image.width;\n canvas.height = image.height;\n const pixels2DContext = createCanvasContext(canvas);\n if (pixels2DContext != null) {\n let height = image.height;\n let width = image.width;\n if (options !== undefined && options.resizedHeight !== undefined && options.resizedWidth !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n if (options !== undefined) {\n bufferToTensorOptions = options;\n if (options.tensorFormat !== undefined) {\n throw new Error('Image input config format must be RGBA for HTMLImageElement');\n }\n else {\n bufferToTensorOptions.tensorFormat = 'RGBA';\n }\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n }\n else {\n bufferToTensorOptions.tensorFormat = 'RGBA';\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n }\n pixels2DContext.drawImage(image, 0, 0);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else if (isImageDataEle) {\n let height;\n let width;\n if (options !== undefined && options.resizedWidth !== undefined && options.resizedHeight !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n else {\n height = image.height;\n width = image.width;\n }\n if (options !== undefined) {\n bufferToTensorOptions = options;\n }\n bufferToTensorOptions.format = 'RGBA';\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n if (options !== undefined) {\n const tempCanvas = createCanvas();\n tempCanvas.width = width;\n tempCanvas.height = height;\n const pixels2DContext = createCanvasContext(tempCanvas);\n if (pixels2DContext != null) {\n pixels2DContext.putImageData(image, 0, 0);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else {\n data = image.data;\n }\n }\n else if (isImageBitmap) {\n // ImageBitmap - image object - format must be provided by user\n if (options === undefined) {\n throw new Error('Please provide image config with format for Imagebitmap');\n }\n const canvas = createCanvas();\n canvas.width = image.width;\n canvas.height = image.height;\n const pixels2DContext = createCanvasContext(canvas);\n if (pixels2DContext != null) {\n const height = image.height;\n const width = image.width;\n pixels2DContext.drawImage(image, 0, 0, width, height);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n return bufferToTensor(data, bufferToTensorOptions);\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else if (isString) {\n return new Promise((resolve, reject) => {\n const canvas = createCanvas();\n const context = createCanvasContext(canvas);\n if (!image || !context) {\n return reject();\n }\n const newImage = new Image();\n newImage.crossOrigin = 'Anonymous';\n newImage.src = image;\n newImage.onload = () => {\n canvas.width = newImage.width;\n canvas.height = newImage.height;\n context.drawImage(newImage, 0, 0, canvas.width, canvas.height);\n const img = context.getImageData(0, 0, canvas.width, canvas.height);\n bufferToTensorOptions.height = canvas.height;\n bufferToTensorOptions.width = canvas.width;\n resolve(bufferToTensor(img.data, bufferToTensorOptions));\n };\n });\n }\n else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n if (data !== undefined) {\n return bufferToTensor(data, bufferToTensorOptions);\n }\n else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n};\n/**\n * implementation of Tensor.fromTexture().\n */\nexport const tensorFromTexture = (texture, options) => {\n const { width, height, download, dispose } = options;\n // Always assume RGBAF32. TODO: support different texture format\n const dims = [1, height, width, 4];\n return new Tensor({ location: 'texture', type: 'float32', texture, dims, download, dispose });\n};\n/**\n * implementation of Tensor.fromGpuBuffer().\n */\nexport const tensorFromGpuBuffer = (gpuBuffer, options) => {\n const { dataType, dims, download, dispose } = options;\n return new Tensor({ location: 'gpu-buffer', type: dataType ?? 'float32', gpuBuffer, dims, download, dispose });\n};\n/**\n * implementation of Tensor.fromPinnedBuffer().\n */\nexport const tensorFromPinnedBuffer = (type, buffer, dims) => new Tensor({ location: 'cpu-pinned', type, data: buffer, dims: dims ?? [buffer.length] });\n//# sourceMappingURL=tensor-factory-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nexport const NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP = new Map([\n ['float32', Float32Array],\n ['uint8', Uint8Array],\n ['int8', Int8Array],\n ['uint16', Uint16Array],\n ['float16', Uint16Array],\n ['int16', Int16Array],\n ['int32', Int32Array],\n ['bool', Uint8Array],\n ['float64', Float64Array],\n ['uint32', Uint32Array],\n]);\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nexport const NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP = new Map([\n [Float32Array, 'float32'],\n [Uint8Array, 'uint8'],\n [Int8Array, 'int8'],\n [Uint16Array, 'uint16'],\n [Int16Array, 'int16'],\n [Int32Array, 'int32'],\n [Float64Array, 'float64'],\n [Uint32Array, 'uint32'],\n]);\n// the following code allows delaying execution of BigInt checking. This allows lazy initialization for\n// NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP and NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP, which allows BigInt polyfill\n// if available.\nlet isBigIntChecked = false;\nexport const checkBigInt = () => {\n if (!isBigIntChecked) {\n isBigIntChecked = true;\n const isBigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined' && typeof BigInt64Array.from === 'function';\n const isBigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined' && typeof BigUint64Array.from === 'function';\n if (isBigInt64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('int64', BigInt64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array, 'int64');\n }\n if (isBigUint64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('uint64', BigUint64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array, 'uint64');\n }\n }\n};\n//# sourceMappingURL=tensor-impl-type-mapping.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { tensorToDataURL, tensorToImageData } from './tensor-conversion-impl.js';\nimport { tensorFromGpuBuffer, tensorFromImage, tensorFromPinnedBuffer, tensorFromTexture } from './tensor-factory-impl.js';\nimport { checkBigInt, NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP, NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP } from './tensor-impl-type-mapping.js';\nimport { calculateSize, tensorReshape } from './tensor-utils-impl.js';\n/**\n * the implementation of Tensor interface.\n *\n * @ignore\n */\nexport class Tensor {\n /**\n * implementation.\n */\n constructor(arg0, arg1, arg2) {\n // perform one-time check for BigInt support\n checkBigInt();\n let type;\n let dims;\n if (typeof arg0 === 'object' && 'location' in arg0) {\n //\n // constructing tensor from specific location\n //\n this.dataLocation = arg0.location;\n type = arg0.type;\n dims = arg0.dims;\n switch (arg0.location) {\n case 'cpu-pinned': {\n const expectedTypedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(type);\n if (!expectedTypedArrayConstructor) {\n throw new TypeError(`unsupported type \"${type}\" to create tensor from pinned buffer`);\n }\n if (!(arg0.data instanceof expectedTypedArrayConstructor)) {\n throw new TypeError(`buffer should be of type ${expectedTypedArrayConstructor.name}`);\n }\n this.cpuData = arg0.data;\n break;\n }\n case 'texture': {\n if (type !== 'float32') {\n throw new TypeError(`unsupported type \"${type}\" to create tensor from texture`);\n }\n this.gpuTextureData = arg0.texture;\n this.downloader = arg0.download;\n this.disposer = arg0.dispose;\n break;\n }\n case 'gpu-buffer': {\n if ((type !== 'float32' && type !== 'float16' && type !== 'int32' && type !== 'int64' && type !== 'uint32' &&\n type !== 'bool')) {\n throw new TypeError(`unsupported type \"${type}\" to create tensor from gpu buffer`);\n }\n this.gpuBufferData = arg0.gpuBuffer;\n this.downloader = arg0.download;\n this.disposer = arg0.dispose;\n break;\n }\n default:\n throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`);\n }\n }\n else {\n //\n // constructing tensor of location 'cpu'\n //\n let data;\n let maybeDims;\n // check whether arg0 is type or data\n if (typeof arg0 === 'string') {\n //\n // Override: constructor(type, data, ...)\n //\n type = arg0;\n maybeDims = arg2;\n if (arg0 === 'string') {\n // string tensor\n if (!Array.isArray(arg1)) {\n throw new TypeError('A string tensor\\'s data must be a string array.');\n }\n // we don't check whether every element in the array is string; this is too slow. we assume it's correct and\n // error will be populated at inference\n data = arg1;\n }\n else {\n // numeric tensor\n const typedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(arg0);\n if (typedArrayConstructor === undefined) {\n throw new TypeError(`Unsupported tensor type: ${arg0}.`);\n }\n if (Array.isArray(arg1)) {\n if (arg0 === 'float16') {\n // Throw error here because when user try to use number array as data,\n // e.g. new Tensor('float16', [1, 2, 3, 4], dims)), it will actually call\n // Uint16Array.from(arg1) which generates wrong data.\n throw new TypeError('Creating a float16 tensor from number array is not supported. Please use Uint16Array as data.');\n }\n else if (arg0 === 'uint64' || arg0 === 'int64') {\n // use 'as any' here because:\n // 1. TypeScript's check on type of 'Array.isArray()' does not work with readonly arrays.\n // see https://github.com/microsoft/TypeScript/issues/17002\n // 2. TypeScript's check on union type of '(BigInt64ArrayConstructor|BigUint64ArrayConstructor).from()'\n // does not accept parameter mapFn.\n // 3. parameters of 'SupportedTypedArrayConstructors.from()' does not match the requirement of the union\n // type.\n // assume 'arg1' is of type \"readonly number[]|readonly bigint[]\" here.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = typedArrayConstructor.from(arg1, BigInt);\n }\n else {\n // assume 'arg1' is of type \"readonly number[]\" here.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = typedArrayConstructor.from(arg1);\n }\n }\n else if (arg1 instanceof typedArrayConstructor) {\n data = arg1;\n }\n else {\n throw new TypeError(`A ${type} tensor's data must be type of ${typedArrayConstructor}`);\n }\n }\n }\n else {\n //\n // Override: constructor(data, ...)\n //\n maybeDims = arg1;\n if (Array.isArray(arg0)) {\n // only boolean[] and string[] is supported\n if (arg0.length === 0) {\n throw new TypeError('Tensor type cannot be inferred from an empty array.');\n }\n const firstElementType = typeof arg0[0];\n if (firstElementType === 'string') {\n type = 'string';\n data = arg0;\n }\n else if (firstElementType === 'boolean') {\n type = 'bool';\n // 'arg0' is of type 'boolean[]'. Uint8Array.from(boolean[]) actually works, but typescript thinks this is\n // wrong type. We use 'as any' to make it happy.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = Uint8Array.from(arg0);\n }\n else {\n throw new TypeError(`Invalid element type of data array: ${firstElementType}.`);\n }\n }\n else {\n // get tensor type from TypedArray\n const mappedType = NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(arg0.constructor);\n if (mappedType === undefined) {\n throw new TypeError(`Unsupported type for tensor data: ${arg0.constructor}.`);\n }\n type = mappedType;\n data = arg0;\n }\n }\n // type and data is processed, now processing dims\n if (maybeDims === undefined) {\n // assume 1-D tensor if dims omitted\n maybeDims = [data.length];\n }\n else if (!Array.isArray(maybeDims)) {\n throw new TypeError('A tensor\\'s dims must be a number array');\n }\n dims = maybeDims;\n this.cpuData = data;\n this.dataLocation = 'cpu';\n }\n // perform check on dims\n const size = calculateSize(dims);\n // if data is on CPU, check whether data length matches tensor size\n if (this.cpuData && size !== this.cpuData.length) {\n throw new Error(`Tensor's size(${size}) does not match data length(${this.cpuData.length}).`);\n }\n this.type = type;\n this.dims = dims;\n this.size = size;\n }\n // #endregion\n // #region factory\n static async fromImage(image, options) {\n return tensorFromImage(image, options);\n }\n static fromTexture(texture, options) {\n return tensorFromTexture(texture, options);\n }\n static fromGpuBuffer(gpuBuffer, options) {\n return tensorFromGpuBuffer(gpuBuffer, options);\n }\n static fromPinnedBuffer(type, buffer, dims) {\n return tensorFromPinnedBuffer(type, buffer, dims);\n }\n // #endregion\n // #region conversions\n toDataURL(options) {\n return tensorToDataURL(this, options);\n }\n toImageData(options) {\n return tensorToImageData(this, options);\n }\n // #endregion\n // #region properties\n get data() {\n this.ensureValid();\n if (!this.cpuData) {\n throw new Error('The data is not on CPU. Use `getData()` to download GPU data to CPU, ' +\n 'or use `texture` or `gpuBuffer` property to access the GPU data directly.');\n }\n return this.cpuData;\n }\n get location() {\n return this.dataLocation;\n }\n get texture() {\n this.ensureValid();\n if (!this.gpuTextureData) {\n throw new Error('The data is not stored as a WebGL texture.');\n }\n return this.gpuTextureData;\n }\n get gpuBuffer() {\n this.ensureValid();\n if (!this.gpuBufferData) {\n throw new Error('The data is not stored as a WebGPU buffer.');\n }\n return this.gpuBufferData;\n }\n // #endregion\n // #region methods\n async getData(releaseData) {\n this.ensureValid();\n switch (this.dataLocation) {\n case 'cpu':\n case 'cpu-pinned':\n return this.data;\n case 'texture':\n case 'gpu-buffer': {\n if (!this.downloader) {\n throw new Error('The current tensor is not created with a specified data downloader.');\n }\n if (this.isDownloading) {\n throw new Error('The current tensor is being downloaded.');\n }\n try {\n this.isDownloading = true;\n const data = await this.downloader();\n this.downloader = undefined;\n this.dataLocation = 'cpu';\n this.cpuData = data;\n if (releaseData && this.disposer) {\n this.disposer();\n this.disposer = undefined;\n }\n return data;\n }\n finally {\n this.isDownloading = false;\n }\n }\n default:\n throw new Error(`cannot get data from location: ${this.dataLocation}`);\n }\n }\n dispose() {\n if (this.isDownloading) {\n throw new Error('The current tensor is being downloaded.');\n }\n if (this.disposer) {\n this.disposer();\n this.disposer = undefined;\n }\n this.cpuData = undefined;\n this.gpuTextureData = undefined;\n this.gpuBufferData = undefined;\n this.downloader = undefined;\n this.isDownloading = undefined;\n this.dataLocation = 'none';\n }\n // #endregion\n // #region tensor utilities\n ensureValid() {\n if (this.dataLocation === 'none') {\n throw new Error('The tensor is disposed.');\n }\n }\n reshape(dims) {\n this.ensureValid();\n if (this.downloader || this.disposer) {\n throw new Error('Cannot reshape a tensor that owns GPU resource.');\n }\n return tensorReshape(this, dims);\n }\n}\n//# sourceMappingURL=tensor-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { Tensor } from './tensor-impl.js';\n/**\n * calculate size from dims.\n *\n * @param dims the dims array. May be an illegal input.\n */\nexport const calculateSize = (dims) => {\n let size = 1;\n for (let i = 0; i < dims.length; i++) {\n const dim = dims[i];\n if (typeof dim !== 'number' || !Number.isSafeInteger(dim)) {\n throw new TypeError(`dims[${i}] must be an integer, got: ${dim}`);\n }\n if (dim < 0) {\n throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${dim}`);\n }\n size *= dim;\n }\n return size;\n};\n/**\n * implementation of Tensor.reshape()\n */\nexport const tensorReshape = (tensor, dims) => {\n switch (tensor.location) {\n case 'cpu':\n return new Tensor(tensor.type, tensor.data, dims);\n case 'cpu-pinned':\n return new Tensor({\n location: 'cpu-pinned',\n data: tensor.data,\n type: tensor.type,\n dims,\n });\n case 'texture':\n return new Tensor({\n location: 'texture',\n texture: tensor.texture,\n type: tensor.type,\n dims,\n });\n case 'gpu-buffer':\n return new Tensor({\n location: 'gpu-buffer',\n gpuBuffer: tensor.gpuBuffer,\n type: tensor.type,\n dims,\n });\n default:\n throw new Error(`tensorReshape: tensor location ${tensor.location} is not supported`);\n }\n};\n//# sourceMappingURL=tensor-utils-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { Tensor as TensorImpl } from './tensor-impl.js';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Tensor = TensorImpl;\n//# sourceMappingURL=tensor.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { env } from './env-impl.js';\nexport const TRACE = (deviceType, label) => {\n if (!env.wasm.trace) {\n return;\n }\n // eslint-disable-next-line no-console\n console.timeStamp(`${deviceType}::ORT::${label}`);\n};\nconst TRACE_FUNC = (msg, extraMsg) => {\n const stack = new Error().stack?.split(/\\r\\n|\\r|\\n/g) || [];\n let hasTraceFunc = false;\n for (let i = 0; i < stack.length; i++) {\n if (hasTraceFunc && !stack[i].includes('TRACE_FUNC')) {\n let label = `FUNC_${msg}::${stack[i].trim().split(' ')[1]}`;\n if (extraMsg) {\n label += `::${extraMsg}`;\n }\n TRACE('CPU', label);\n return;\n }\n if (stack[i].includes('TRACE_FUNC')) {\n hasTraceFunc = true;\n }\n }\n};\nexport const TRACE_FUNC_BEGIN = (extraMsg) => {\n if (!env.wasm.trace) {\n return;\n }\n TRACE_FUNC('BEGIN', extraMsg);\n};\nexport const TRACE_FUNC_END = (extraMsg) => {\n if (!env.wasm.trace) {\n return;\n }\n TRACE_FUNC('END', extraMsg);\n};\n//# sourceMappingURL=trace.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { resolveBackend } from './backend-impl.js';\nimport { Tensor } from './tensor.js';\nconst noBackendErrMsg = 'Training backend could not be resolved. ' +\n 'Make sure you\\'re using the correct configuration & WebAssembly files.';\nexport class TrainingSession {\n constructor(handler, hasOptimizerModel, hasEvalModel) {\n this.handler = handler;\n this.hasOptimizerModel = hasOptimizerModel;\n this.hasEvalModel = hasEvalModel;\n }\n get trainingInputNames() {\n return this.handler.inputNames;\n }\n get trainingOutputNames() {\n return this.handler.outputNames;\n }\n get evalInputNames() {\n if (this.hasEvalModel) {\n return this.handler.evalInputNames;\n }\n else {\n throw new Error('This training session has no evalModel loaded.');\n }\n }\n get evalOutputNames() {\n if (this.hasEvalModel) {\n return this.handler.evalOutputNames;\n }\n else {\n throw new Error('This training session has no evalModel loaded.');\n }\n }\n static async create(trainingOptions, sessionOptions) {\n const evalModel = trainingOptions.evalModel || '';\n const optimizerModel = trainingOptions.optimizerModel || '';\n const options = sessionOptions || {};\n // get backend hints\n const eps = options.executionProviders || [];\n const backendHints = eps.map(i => typeof i === 'string' ? i : i.name);\n const backend = await resolveBackend(backendHints);\n if (backend.createTrainingSessionHandler) {\n const handler = await backend.createTrainingSessionHandler(trainingOptions.checkpointState, trainingOptions.trainModel, evalModel, optimizerModel, options);\n return new TrainingSession(handler, !!trainingOptions.optimizerModel, !!trainingOptions.evalModel);\n }\n else {\n throw new Error(noBackendErrMsg);\n }\n }\n /**\n * Helper function for runTrainStep and future runStep methods that handles the type-narrowing conversion from\n * the given parameters to SessionHandler.FetchesType and RunOptions.\n *\n * @param inputNames the feeds object is checked that they contain all input names in the provided list of input\n * names.\n * @param outputNames the fetches object is checked that their keys match up with valid names in the list of output\n * names.\n * @param feeds the required input\n * @param arg1 narrowed & converted into the SessionHandler.FetchesType or RunOptions object\n * @param arg2 optional RunOptions object.\n * @returns\n */\n typeNarrowingForRunStep(inputNames, outputNames, feeds, arg1, arg2) {\n const fetches = {};\n let options = {};\n // check inputs\n if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n throw new TypeError('\\'feeds\\' must be an object that use input names as keys and OnnxValue as corresponding values.');\n }\n let isFetchesEmpty = true;\n // determine which override is being used\n if (typeof arg1 === 'object') {\n if (arg1 === null) {\n throw new TypeError('Unexpected argument[1]: cannot be null.');\n }\n if (arg1 instanceof Tensor) {\n throw new TypeError('\\'fetches\\' cannot be a Tensor');\n }\n if (Array.isArray(arg1)) {\n if (arg1.length === 0) {\n throw new TypeError('\\'fetches\\' cannot be an empty array.');\n }\n isFetchesEmpty = false;\n // output names\n for (const name of arg1) {\n if (typeof name !== 'string') {\n throw new TypeError('\\'fetches\\' must be a string array or an object.');\n }\n if (outputNames.indexOf(name) === -1) {\n throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n }\n fetches[name] = null;\n }\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n // decide whether arg1 is fetches or options\n // if any output name is present and its value is valid OnnxValue, we consider it fetches\n let isFetches = false;\n const arg1Keys = Object.getOwnPropertyNames(arg1);\n for (const name of outputNames) {\n if (arg1Keys.indexOf(name) !== -1) {\n const v = arg1[name];\n if (v === null || v instanceof Tensor) {\n isFetches = true;\n isFetchesEmpty = false;\n fetches[name] = v;\n }\n }\n }\n if (isFetches) {\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n options = arg1;\n }\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('Unexpected argument[1]: must be \\'fetches\\' or \\'options\\'.');\n }\n // check if all inputs are in feed\n for (const name of inputNames) {\n if (typeof feeds[name] === 'undefined') {\n throw new Error(`input '${name}' is missing in 'feeds'.`);\n }\n }\n // if no fetches is specified, we use the full output names list\n if (isFetchesEmpty) {\n for (const name of outputNames) {\n fetches[name] = null;\n }\n }\n return [fetches, options];\n }\n /**\n * Helper method for runTrainStep and any other runStep methods. Takes the ReturnType result from the SessionHandler\n * and changes it into a map of Tensors.\n *\n * @param results\n * @returns\n */\n convertHandlerReturnTypeToMapOfTensors(results) {\n const returnValue = {};\n for (const key in results) {\n if (Object.hasOwnProperty.call(results, key)) {\n const result = results[key];\n if (result instanceof Tensor) {\n returnValue[key] = result;\n }\n else {\n returnValue[key] = new Tensor(result.type, result.data, result.dims);\n }\n }\n }\n return returnValue;\n }\n async lazyResetGrad() {\n await this.handler.lazyResetGrad();\n }\n async runTrainStep(feeds, arg1, arg2) {\n const [fetches, options] = this.typeNarrowingForRunStep(this.trainingInputNames, this.trainingOutputNames, feeds, arg1, arg2);\n const results = await this.handler.runTrainStep(feeds, fetches, options);\n return this.convertHandlerReturnTypeToMapOfTensors(results);\n }\n async runOptimizerStep(options) {\n if (this.hasOptimizerModel) {\n await this.handler.runOptimizerStep(options || {});\n }\n else {\n throw new Error('This TrainingSession has no OptimizerModel loaded.');\n }\n }\n async runEvalStep(feeds, arg1, arg2) {\n if (this.hasEvalModel) {\n const [fetches, options] = this.typeNarrowingForRunStep(this.evalInputNames, this.evalOutputNames, feeds, arg1, arg2);\n const results = await this.handler.runEvalStep(feeds, fetches, options);\n return this.convertHandlerReturnTypeToMapOfTensors(results);\n }\n else {\n throw new Error('This TrainingSession has no EvalModel loaded.');\n }\n }\n async getParametersSize(trainableOnly = true) {\n return this.handler.getParametersSize(trainableOnly);\n }\n async loadParametersBuffer(array, trainableOnly = true) {\n const paramsSize = await this.getParametersSize(trainableOnly);\n // checking that the size of the Uint8Array is equivalent to the byte length of a Float32Array of the number\n // of parameters\n if (array.length !== 4 * paramsSize) {\n throw new Error('Size of the buffer passed into loadParametersBuffer must match the number of parameters in ' +\n 'the model. Please use getParametersSize method to check.');\n }\n return this.handler.loadParametersBuffer(array, trainableOnly);\n }\n async getContiguousParameters(trainableOnly = true) {\n return this.handler.getContiguousParameters(trainableOnly);\n }\n async release() {\n return this.handler.dispose();\n }\n}\n//# sourceMappingURL=training-session-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { TrainingSession as TrainingSessionImpl } from './training-session-impl.js';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const TrainingSession = TrainingSessionImpl;\n//# sourceMappingURL=training-session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n// This file is generated by /js/scripts/update-version.ts\n// Do not modify file content manually.\nexport const version = '1.17.0';\n//# sourceMappingURL=version.js.map","/*!\n * ONNX Runtime Web v1.17.3\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nvar Fn=Object.defineProperty;var ld=Object.getOwnPropertyDescriptor;var dd=Object.getOwnPropertyNames;var cd=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var tr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rr=(e,t)=>{for(var r in t)Fn(e,r,{get:t[r],enumerable:!0})},pd=(e,t,r,a)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of dd(t))!cd.call(e,n)&&n!==r&&Fn(e,n,{get:()=>t[n],enumerable:!(a=ld(t,n))||a.enumerable});return e};var Gt=e=>pd(Fn({},\"__esModule\",{value:!0}),e);var Zr,Ht,Lt,fd,Xr,Qr=F(()=>{\"use strict\";Zr=new Map,Ht=[],Lt=(e,t,r)=>{if(t&&typeof t.init==\"function\"&&typeof t.createInferenceSessionHandler==\"function\"){let a=Zr.get(e);if(a===void 0)Zr.set(e,{backend:t,priority:r});else{if(a.priority>r)return;if(a.priority===r&&a.backend!==t)throw new Error(`cannot register backend \"${e}\" using priority ${r}`)}if(r>=0){let n=Ht.indexOf(e);n!==-1&&Ht.splice(n,1);for(let o=0;o{let t=Zr.get(e);if(!t)return\"backend not found.\";if(t.initialized)return t.backend;if(t.aborted)return t.error;{let r=!!t.initPromise;try{return r||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(a){return r||(t.error=`${a}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},Xr=async e=>{let t=e.executionProviders||[],r=t.map(i=>typeof i==\"string\"?i:i.name),a=r.length===0?Ht:r,n,o=[],s=new Set;for(let i of a){let c=await fd(i);typeof c==\"string\"?o.push({name:i,err:c}):(n||(n=c),n===c&&s.add(i))}if(!n)throw new Error(`no available backend found. ERR: ${o.map(i=>`[${i.name}] ${i.err}`).join(\", \")}`);for(let{name:i,err:c}of o)r.includes(i)&&console.warn(`removing requested execution provider \"${i}\" from session options because it is not available: ${c}`);let l=t.filter(i=>s.has(typeof i==\"string\"?i:i.name));return[n,new Proxy(e,{get:(i,c)=>c===\"executionProviders\"?l:Reflect.get(i,c)})]}});var ii=F(()=>{\"use strict\";Qr()});var oi,si=F(()=>{\"use strict\";oi=\"1.17.3\"});var ui,ot,qn=F(()=>{\"use strict\";si();ui=\"warning\",ot={wasm:{},webgl:{},webgpu:{},versions:{common:oi},set logLevel(e){if(e!==void 0){if(typeof e!=\"string\"||[\"verbose\",\"info\",\"warning\",\"error\",\"fatal\"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);ui=e}},get logLevel(){return ui}};Object.defineProperty(ot,\"logLevel\",{enumerable:!0})});var Ae,li=F(()=>{\"use strict\";qn();Ae=ot});var di,ci,pi=F(()=>{\"use strict\";di=(e,t)=>{let r=typeof document<\"u\"?document.createElement(\"canvas\"):new OffscreenCanvas(1,1);r.width=e.dims[3],r.height=e.dims[2];let a=r.getContext(\"2d\");if(a!=null){let n,o;t?.tensorLayout!==void 0&&t.tensorLayout===\"NHWC\"?(n=e.dims[2],o=e.dims[3]):(n=e.dims[3],o=e.dims[2]);let s=t?.format!==void 0?t.format:\"RGB\",l=t?.norm,i,c;l===void 0||l.mean===void 0?i=[255,255,255,255]:typeof l.mean==\"number\"?i=[l.mean,l.mean,l.mean,l.mean]:(i=[l.mean[0],l.mean[1],l.mean[2],0],l.mean[3]!==void 0&&(i[3]=l.mean[3])),l===void 0||l.bias===void 0?c=[0,0,0,0]:typeof l.bias==\"number\"?c=[l.bias,l.bias,l.bias,l.bias]:(c=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(c[3]=l.bias[3]));let f=o*n,m=0,h=f,w=f*2,b=-1;s===\"RGBA\"?(m=0,h=f,w=f*2,b=f*3):s===\"RGB\"?(m=0,h=f,w=f*2):s===\"RBG\"&&(m=0,w=f,h=f*2);for(let $=0;${let r=typeof document<\"u\"?document.createElement(\"canvas\").getContext(\"2d\"):new OffscreenCanvas(1,1).getContext(\"2d\"),a;if(r!=null){let n,o,s;t?.tensorLayout!==void 0&&t.tensorLayout===\"NHWC\"?(n=e.dims[2],o=e.dims[1],s=e.dims[3]):(n=e.dims[3],o=e.dims[2],s=e.dims[1]);let l=t!==void 0&&t.format!==void 0?t.format:\"RGB\",i=t?.norm,c,f;i===void 0||i.mean===void 0?c=[255,255,255,255]:typeof i.mean==\"number\"?c=[i.mean,i.mean,i.mean,i.mean]:(c=[i.mean[0],i.mean[1],i.mean[2],255],i.mean[3]!==void 0&&(c[3]=i.mean[3])),i===void 0||i.bias===void 0?f=[0,0,0,0]:typeof i.bias==\"number\"?f=[i.bias,i.bias,i.bias,i.bias]:(f=[i.bias[0],i.bias[1],i.bias[2],0],i.bias[3]!==void 0&&(f[3]=i.bias[3]));let m=o*n;if(t!==void 0&&(t.format!==void 0&&s===4&&t.format!==\"RGBA\"||s===3&&t.format!==\"RGB\"&&t.format!==\"BGR\"))throw new Error(\"Tensor format doesn't match input tensor dims\");let h=4,w=0,b=1,$=2,I=3,S=0,v=m,E=m*2,A=-1;l===\"RGBA\"?(S=0,v=m,E=m*2,A=m*3):l===\"RGB\"?(S=0,v=m,E=m*2):l===\"RBG\"&&(S=0,E=m,v=m*2),a=r.createImageData(n,o);for(let k=0;k{\"use strict\";Jr();jn=(e,t)=>{if(e===void 0)throw new Error(\"Image buffer must be defined\");if(t.height===void 0||t.width===void 0)throw new Error(\"Image height and width must be defined\");if(t.tensorLayout===\"NHWC\")throw new Error(\"NHWC Tensor layout is not supported yet\");let{height:r,width:a}=t,n=t.norm??{mean:255,bias:0},o,s;typeof n.mean==\"number\"?o=[n.mean,n.mean,n.mean,n.mean]:o=[n.mean[0],n.mean[1],n.mean[2],n.mean[3]??255],typeof n.bias==\"number\"?s=[n.bias,n.bias,n.bias,n.bias]:s=[n.bias[0],n.bias[1],n.bias[2],n.bias[3]??0];let l=t.format!==void 0?t.format:\"RGBA\",i=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:\"RGB\",c=r*a,f=i===\"RGBA\"?new Float32Array(c*4):new Float32Array(c*3),m=4,h=0,w=1,b=2,$=3,I=0,S=c,v=c*2,E=-1;l===\"RGB\"&&(m=3,h=0,w=1,b=2,$=-1),i===\"RGBA\"?E=c*3:i===\"RBG\"?(I=0,v=c,S=c*2):i===\"BGR\"&&(v=0,S=c,I=c*2);for(let k=0;k{let r=typeof HTMLImageElement<\"u\"&&e instanceof HTMLImageElement,a=typeof ImageData<\"u\"&&e instanceof ImageData,n=typeof ImageBitmap<\"u\"&&e instanceof ImageBitmap,o=typeof e==\"string\",s,l=t??{},i=()=>{if(typeof document<\"u\")return document.createElement(\"canvas\");if(typeof OffscreenCanvas<\"u\")return new OffscreenCanvas(1,1);throw new Error(\"Canvas is not supported\")},c=f=>f instanceof HTMLCanvasElement||f instanceof OffscreenCanvas?f.getContext(\"2d\"):null;if(r){let f=i();f.width=e.width,f.height=e.height;let m=c(f);if(m!=null){let h=e.height,w=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(h=t.resizedHeight,w=t.resizedWidth),t!==void 0){if(l=t,t.tensorFormat!==void 0)throw new Error(\"Image input config format must be RGBA for HTMLImageElement\");l.tensorFormat=\"RGBA\",l.height=h,l.width=w}else l.tensorFormat=\"RGBA\",l.height=h,l.width=w;m.drawImage(e,0,0),s=m.getImageData(0,0,w,h).data}else throw new Error(\"Can not access image data\")}else if(a){let f,m;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(f=t.resizedHeight,m=t.resizedWidth):(f=e.height,m=e.width),t!==void 0&&(l=t),l.format=\"RGBA\",l.height=f,l.width=m,t!==void 0){let h=i();h.width=m,h.height=f;let w=c(h);if(w!=null)w.putImageData(e,0,0),s=w.getImageData(0,0,m,f).data;else throw new Error(\"Can not access image data\")}else s=e.data}else if(n){if(t===void 0)throw new Error(\"Please provide image config with format for Imagebitmap\");let f=i();f.width=e.width,f.height=e.height;let m=c(f);if(m!=null){let h=e.height,w=e.width;return m.drawImage(e,0,0,w,h),s=m.getImageData(0,0,w,h).data,l.height=h,l.width=w,jn(s,l)}else throw new Error(\"Can not access image data\")}else{if(o)return new Promise((f,m)=>{let h=i(),w=c(h);if(!e||!w)return m();let b=new Image;b.crossOrigin=\"Anonymous\",b.src=e,b.onload=()=>{h.width=b.width,h.height=b.height,w.drawImage(b,0,0,h.width,h.height);let $=w.getImageData(0,0,h.width,h.height);l.height=h.height,l.width=h.width,f(jn($.data,l))}});throw new Error(\"Input data provided is not supported - aborted tensor creation\")}if(s!==void 0)return jn(s,l);throw new Error(\"Input data provided is not supported - aborted tensor creation\")},mi=(e,t)=>{let{width:r,height:a,download:n,dispose:o}=t,s=[1,a,r,4];return new rt({location:\"texture\",type:\"float32\",texture:e,dims:s,download:n,dispose:o})},hi=(e,t)=>{let{dataType:r,dims:a,download:n,dispose:o}=t;return new rt({location:\"gpu-buffer\",type:r??\"float32\",gpuBuffer:e,dims:a,download:n,dispose:o})},gi=(e,t,r)=>new rt({location:\"cpu-pinned\",type:e,data:t,dims:r??[t.length]})});var Ft,Sr,bi,wi,vi=F(()=>{\"use strict\";Ft=new Map([[\"float32\",Float32Array],[\"uint8\",Uint8Array],[\"int8\",Int8Array],[\"uint16\",Uint16Array],[\"int16\",Int16Array],[\"int32\",Int32Array],[\"bool\",Uint8Array],[\"float64\",Float64Array],[\"uint32\",Uint32Array]]),Sr=new Map([[Float32Array,\"float32\"],[Uint8Array,\"uint8\"],[Int8Array,\"int8\"],[Uint16Array,\"uint16\"],[Int16Array,\"int16\"],[Int32Array,\"int32\"],[Float64Array,\"float64\"],[Uint32Array,\"uint32\"]]),bi=!1,wi=()=>{if(!bi){bi=!0;let e=typeof BigInt64Array<\"u\"&&BigInt64Array.from,t=typeof BigUint64Array<\"u\"&&BigUint64Array.from,r=typeof Float16Array<\"u\"&&Float16Array.from;e&&(Ft.set(\"int64\",BigInt64Array),Sr.set(BigInt64Array,\"int64\")),t&&(Ft.set(\"uint64\",BigUint64Array),Sr.set(BigUint64Array,\"uint64\")),r?(Ft.set(\"float16\",Float16Array),Sr.set(Float16Array,\"float16\")):Ft.set(\"float16\",Uint16Array)}}});var $i,_i,xi=F(()=>{\"use strict\";Jr();$i=e=>{let t=1;for(let r=0;r{switch(e.location){case\"cpu\":return new rt(e.type,e.data,t);case\"cpu-pinned\":return new rt({location:\"cpu-pinned\",data:e.data,type:e.type,dims:t});case\"texture\":return new rt({location:\"texture\",texture:e.texture,type:e.type,dims:t});case\"gpu-buffer\":return new rt({location:\"gpu-buffer\",gpuBuffer:e.gpuBuffer,type:e.type,dims:t});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}});var rt,Jr=F(()=>{\"use strict\";pi();yi();vi();xi();rt=class{constructor(t,r,a){wi();let n,o;if(typeof t==\"object\"&&\"location\"in t)switch(this.dataLocation=t.location,n=t.type,o=t.dims,t.location){case\"cpu-pinned\":{let l=Ft.get(n);if(!l)throw new TypeError(`unsupported type \"${n}\" to create tensor from pinned buffer`);if(!(t.data instanceof l))throw new TypeError(`buffer should be of type ${l.name}`);this.cpuData=t.data;break}case\"texture\":{if(n!==\"float32\")throw new TypeError(`unsupported type \"${n}\" to create tensor from texture`);this.gpuTextureData=t.texture,this.downloader=t.download,this.disposer=t.dispose;break}case\"gpu-buffer\":{if(n!==\"float32\"&&n!==\"float16\"&&n!==\"int32\"&&n!==\"int64\"&&n!==\"uint32\"&&n!==\"uint8\"&&n!==\"bool\")throw new TypeError(`unsupported type \"${n}\" to create tensor from gpu buffer`);this.gpuBufferData=t.gpuBuffer,this.downloader=t.download,this.disposer=t.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let l,i;if(typeof t==\"string\")if(n=t,i=a,t===\"string\"){if(!Array.isArray(r))throw new TypeError(\"A string tensor's data must be a string array.\");l=r}else{let c=Ft.get(t);if(c===void 0)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(r)){if(t===\"float16\"&&c===Uint16Array)throw new TypeError(\"Creating a float16 tensor from number array is not supported. Please use Uint16Array as data.\");t===\"uint64\"||t===\"int64\"?l=c.from(r,BigInt):l=c.from(r)}else if(r instanceof c)l=r;else throw new TypeError(`A ${n} tensor's data must be type of ${c}`)}else if(i=r,Array.isArray(t)){if(t.length===0)throw new TypeError(\"Tensor type cannot be inferred from an empty array.\");let c=typeof t[0];if(c===\"string\")n=\"string\",l=t;else if(c===\"boolean\")n=\"bool\",l=Uint8Array.from(t);else throw new TypeError(`Invalid element type of data array: ${c}.`)}else{let c=Sr.get(t.constructor);if(c===void 0)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);n=c,l=t}if(i===void 0)i=[l.length];else if(!Array.isArray(i))throw new TypeError(\"A tensor's dims must be a number array\");o=i,this.cpuData=l,this.dataLocation=\"cpu\"}let s=$i(o);if(this.cpuData&&s!==this.cpuData.length)throw new Error(`Tensor's size(${s}) does not match data length(${this.cpuData.length}).`);this.type=n,this.dims=o,this.size=s}static async fromImage(t,r){return fi(t,r)}static fromTexture(t,r){return mi(t,r)}static fromGpuBuffer(t,r){return hi(t,r)}static fromPinnedBuffer(t,r,a){return gi(t,r,a)}toDataURL(t){return di(this,t)}toImageData(t){return ci(this,t)}get data(){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.\");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error(\"The data is not stored as a WebGL texture.\");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error(\"The data is not stored as a WebGPU buffer.\");return this.gpuBufferData}async getData(t){switch(this.ensureValid(),this.dataLocation){case\"cpu\":case\"cpu-pinned\":return this.data;case\"texture\":case\"gpu-buffer\":{if(!this.downloader)throw new Error(\"The current tensor is not created with a specified data downloader.\");if(this.isDownloading)throw new Error(\"The current tensor is being downloaded.\");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation=\"cpu\",this.cpuData=r,t&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error(\"The current tensor is being downloaded.\");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=\"none\"}ensureValid(){if(this.dataLocation===\"none\")throw new Error(\"The tensor is disposed.\")}reshape(t){if(this.ensureValid(),this.downloader||this.disposer)throw new Error(\"Cannot reshape a tensor that owns GPU resource.\");return _i(this,t)}}});var Ze,en=F(()=>{\"use strict\";Jr();Ze=rt});var tn,Si,st,nt,Kn=F(()=>{\"use strict\";qn();tn=(e,t)=>{(typeof ot.trace>\"u\"?!ot.wasm.trace:!ot.trace)||console.timeStamp(`${e}::ORT::${t}`)},Si=(e,t)=>{let r=new Error().stack?.split(/\\r\\n|\\r|\\n/g)||[],a=!1;for(let n=0;n{(typeof ot.trace>\"u\"?!ot.wasm.trace:!ot.trace)||Si(\"BEGIN\",e)},nt=e=>{(typeof ot.trace>\"u\"?!ot.wasm.trace:!ot.trace)||Si(\"END\",e)}});var rn,Ci=F(()=>{\"use strict\";Qr();en();Kn();rn=class e{constructor(t){this.handler=t}async run(t,r,a){st();let n={},o={};if(typeof t!=\"object\"||t===null||t instanceof Ze||Array.isArray(t))throw new TypeError(\"'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.\");let s=!0;if(typeof r==\"object\"){if(r===null)throw new TypeError(\"Unexpected argument[1]: cannot be null.\");if(r instanceof Ze)throw new TypeError(\"'fetches' cannot be a Tensor\");if(Array.isArray(r)){if(r.length===0)throw new TypeError(\"'fetches' cannot be an empty array.\");s=!1;for(let c of r){if(typeof c!=\"string\")throw new TypeError(\"'fetches' must be a string array or an object.\");if(this.outputNames.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);n[c]=null}if(typeof a==\"object\"&&a!==null)o=a;else if(typeof a<\"u\")throw new TypeError(\"'options' must be an object.\")}else{let c=!1,f=Object.getOwnPropertyNames(r);for(let m of this.outputNames)if(f.indexOf(m)!==-1){let h=r[m];(h===null||h instanceof Ze)&&(c=!0,s=!1,n[m]=h)}if(c){if(typeof a==\"object\"&&a!==null)o=a;else if(typeof a<\"u\")throw new TypeError(\"'options' must be an object.\")}else o=r}}else if(typeof r<\"u\")throw new TypeError(\"Unexpected argument[1]: must be 'fetches' or 'options'.\");for(let c of this.inputNames)if(typeof t[c]>\"u\")throw new Error(`input '${c}' is missing in 'feeds'.`);if(s)for(let c of this.outputNames)n[c]=null;let l=await this.handler.run(t,n,o),i={};for(let c in l)if(Object.hasOwnProperty.call(l,c)){let f=l[c];f instanceof Ze?i[c]=f:i[c]=new Ze(f.type,f.data,f.dims)}return nt(),i}async release(){return this.handler.dispose()}static async create(t,r,a,n){st();let o,s={};if(typeof t==\"string\"){if(o=t,typeof r==\"object\"&&r!==null)s=r;else if(typeof r<\"u\")throw new TypeError(\"'options' must be an object.\")}else if(t instanceof Uint8Array){if(o=t,typeof r==\"object\"&&r!==null)s=r;else if(typeof r<\"u\")throw new TypeError(\"'options' must be an object.\")}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<\"u\"&&t instanceof SharedArrayBuffer){let f=t,m=0,h=t.byteLength;if(typeof r==\"object\"&&r!==null)s=r;else if(typeof r==\"number\"){if(m=r,!Number.isSafeInteger(m))throw new RangeError(\"'byteOffset' must be an integer.\");if(m<0||m>=f.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${f.byteLength}).`);if(h=t.byteLength-m,typeof a==\"number\"){if(h=a,!Number.isSafeInteger(h))throw new RangeError(\"'byteLength' must be an integer.\");if(h<=0||m+h>f.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${f.byteLength-m}].`);if(typeof n==\"object\"&&n!==null)s=n;else if(typeof n<\"u\")throw new TypeError(\"'options' must be an object.\")}else if(typeof a<\"u\")throw new TypeError(\"'byteLength' must be a number.\")}else if(typeof r<\"u\")throw new TypeError(\"'options' must be an object.\");o=new Uint8Array(f,m,h)}else throw new TypeError(\"Unexpected argument[0]: must be 'path' or 'buffer'.\");let[l,i]=await Xr(s),c=await l.createInferenceSessionHandler(o,i);return nt(),new e(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}});var md,Ii=F(()=>{\"use strict\";Ci();md=rn});var Ei=F(()=>{\"use strict\"});var Ai=F(()=>{\"use strict\"});var Ti=F(()=>{\"use strict\"});var Oi=F(()=>{\"use strict\"});var hd,nn,ki=F(()=>{\"use strict\";Qr();en();hd=\"Training backend could not be resolved. Make sure you're using the correct configuration & WebAssembly files.\",nn=class e{constructor(t,r,a){this.handler=t,this.hasOptimizerModel=r,this.hasEvalModel=a}get trainingInputNames(){return this.handler.inputNames}get trainingOutputNames(){return this.handler.outputNames}get evalInputNames(){if(this.hasEvalModel)return this.handler.evalInputNames;throw new Error(\"This training session has no evalModel loaded.\")}get evalOutputNames(){if(this.hasEvalModel)return this.handler.evalOutputNames;throw new Error(\"This training session has no evalModel loaded.\")}static async create(t,r){let a=t.evalModel||\"\",n=t.optimizerModel||\"\",o=r||{},[s,l]=await Xr(o);if(s.createTrainingSessionHandler){let i=await s.createTrainingSessionHandler(t.checkpointState,t.trainModel,a,n,l);return new e(i,!!t.optimizerModel,!!t.evalModel)}else throw new Error(hd)}typeNarrowingForRunStep(t,r,a,n,o){let s={},l={};if(typeof a!=\"object\"||a===null||a instanceof Ze||Array.isArray(a))throw new TypeError(\"'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.\");let i=!0;if(typeof n==\"object\"){if(n===null)throw new TypeError(\"Unexpected argument[1]: cannot be null.\");if(n instanceof Ze)throw new TypeError(\"'fetches' cannot be a Tensor\");if(Array.isArray(n)){if(n.length===0)throw new TypeError(\"'fetches' cannot be an empty array.\");i=!1;for(let c of n){if(typeof c!=\"string\")throw new TypeError(\"'fetches' must be a string array or an object.\");if(r.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);s[c]=null}if(typeof o==\"object\"&&o!==null)l=o;else if(typeof o<\"u\")throw new TypeError(\"'options' must be an object.\")}else{let c=!1,f=Object.getOwnPropertyNames(n);for(let m of r)if(f.indexOf(m)!==-1){let h=n[m];(h===null||h instanceof Ze)&&(c=!0,i=!1,s[m]=h)}if(c){if(typeof o==\"object\"&&o!==null)l=o;else if(typeof o<\"u\")throw new TypeError(\"'options' must be an object.\")}else l=n}}else if(typeof n<\"u\")throw new TypeError(\"Unexpected argument[1]: must be 'fetches' or 'options'.\");for(let c of t)if(typeof a[c]>\"u\")throw new Error(`input '${c}' is missing in 'feeds'.`);if(i)for(let c of r)s[c]=null;return[s,l]}convertHandlerReturnTypeToMapOfTensors(t){let r={};for(let a in t)if(Object.hasOwnProperty.call(t,a)){let n=t[a];n instanceof Ze?r[a]=n:r[a]=new Ze(n.type,n.data,n.dims)}return r}async lazyResetGrad(){await this.handler.lazyResetGrad()}async runTrainStep(t,r,a){let[n,o]=this.typeNarrowingForRunStep(this.trainingInputNames,this.trainingOutputNames,t,r,a),s=await this.handler.runTrainStep(t,n,o);return this.convertHandlerReturnTypeToMapOfTensors(s)}async runOptimizerStep(t){if(this.hasOptimizerModel)await this.handler.runOptimizerStep(t||{});else throw new Error(\"This TrainingSession has no OptimizerModel loaded.\")}async runEvalStep(t,r,a){if(this.hasEvalModel){let[n,o]=this.typeNarrowingForRunStep(this.evalInputNames,this.evalOutputNames,t,r,a),s=await this.handler.runEvalStep(t,n,o);return this.convertHandlerReturnTypeToMapOfTensors(s)}else throw new Error(\"This TrainingSession has no EvalModel loaded.\")}async getParametersSize(t=!0){return this.handler.getParametersSize(t)}async loadParametersBuffer(t,r=!0){let a=await this.getParametersSize(r);if(t.length!==4*a)throw new Error(\"Size of the buffer passed into loadParametersBuffer must match the number of parameters in the model. Please use getParametersSize method to check.\");return this.handler.loadParametersBuffer(t,r)}async getContiguousParameters(t=!0){return this.handler.getContiguousParameters(t)}async release(){return this.handler.dispose()}}});var gd,Pi=F(()=>{\"use strict\";ki();gd=nn});var Yn={};rr(Yn,{InferenceSession:()=>md,TRACE:()=>tn,TRACE_FUNC_BEGIN:()=>st,TRACE_FUNC_END:()=>nt,Tensor:()=>Ze,TrainingSession:()=>gd,env:()=>Ae,registerBackend:()=>Lt});var lt=F(()=>{\"use strict\";ii();li();Ii();en();Ei();Ai();Kn();Ti();Oi();Pi()});var Zn={};rr(Zn,{createReadStream:()=>zi,readFile:()=>yd,readFileSync:()=>bd});var yd,bd,zi,Xn=F(()=>{yd=void 0,bd=void 0,zi=void 0});var Qn={};rr(Qn,{join:()=>wd});var wd,Jn=F(()=>{wd=void 0});var Mi=tr((Di,ea)=>{\"use strict\";var Bi=(()=>{var e=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(e=e||__filename),function(t={}){var r=t,a,n;r.ready=new Promise((d,g)=>{a=d,n=g}),r.mountExternalData=(d,g)=>{(r.Fa||(r.Fa=new Map)).set(d,g)},r.unmountExternalData=()=>{delete r.Fa};let o=()=>{let d=(_,C,O)=>(...W)=>{let j=ut,Q=C?.();W=_(...W);let oe=C?.();return Q!==oe&&(_=oe,O(Q),C=O=null),ut!=j?Nr():W},g=_=>async(...C)=>{try{if(r.Ea)throw Error(\"Session already started\");let O=r.Ea={Za:C[0],errors:[]},W=await _(...C);if(r.Ea!==O)throw Error(\"Session mismatch\");r.La?.flush();let j=O.errors;if(0oe),0r._OrtCreateSession,_=>r._OrtCreateSession=_),r._OrtRun=g(d(r._OrtRun,()=>r._OrtRun,_=>r._OrtRun=_)),r._OrtRunWithBinding=g(d(r._OrtRunWithBinding,()=>r._OrtRunWithBinding,_=>r._OrtRunWithBinding=_)),r._OrtBindInput=d(r._OrtBindInput,()=>r._OrtBindInput,_=>r._OrtBindInput=_),o=void 0};r.jsepInit=(d,g)=>{if(o?.(),d===\"webgpu\"){[r.La,r.Ra,r.Va,r.Ma,r.Ua,r.sa,r.Wa,r.Ya,r.Sa,r.Ta,r.Xa]=g;let _=r.La;r.jsepRegisterBuffer=(C,O,W,j)=>_.registerBuffer(C,O,W,j),r.jsepGetBuffer=C=>_.getBuffer(C),r.jsepCreateDownloader=(C,O,W)=>_.createDownloader(C,O,W),r.jsepOnReleaseSession=C=>{_.onReleaseSession(C)},r.jsepOnRunStart=C=>_.onRunStart(C)}};var s=Object.assign({},r),l=\"./this.program\",i=(d,g)=>{throw g},c=typeof window==\"object\",f=typeof importScripts==\"function\",m=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",h=\"\",w,b,$;if(m){var I=(Xn(),Gt(Zn)),S=(Jn(),Gt(Qn));h=f?S.dirname(h)+\"/\":__dirname+\"/\",w=(d,g)=>(d=Ee(d)?new URL(d):S.normalize(d),I.readFileSync(d,g?void 0:\"utf8\")),$=d=>(d=w(d,!0),d.buffer||(d=new Uint8Array(d)),d),b=(d,g,_,C=!0)=>{d=Ee(d)?new URL(d):S.normalize(d),I.readFile(d,C?void 0:\"utf8\",(O,W)=>{O?_(O):g(C?W.buffer:W)})},!r.thisProgram&&1{throw process.exitCode=d,g},r.inspect=()=>\"[Emscripten Module object]\"}else(c||f)&&(f?h=self.location.href:typeof document<\"u\"&&document.currentScript&&(h=document.currentScript.src),e&&(h=e),h.indexOf(\"blob:\")!==0?h=h.substr(0,h.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):h=\"\",w=d=>{var g=new XMLHttpRequest;return g.open(\"GET\",d,!1),g.send(null),g.responseText},f&&($=d=>{var g=new XMLHttpRequest;return g.open(\"GET\",d,!1),g.responseType=\"arraybuffer\",g.send(null),new Uint8Array(g.response)}),b=(d,g,_)=>{var C=new XMLHttpRequest;C.open(\"GET\",d,!0),C.responseType=\"arraybuffer\",C.onload=()=>{C.status==200||C.status==0&&C.response?g(C.response):_()},C.onerror=_,C.send(null)});var v=console.log.bind(console),E=console.error.bind(console);Object.assign(r,s),s=null,typeof WebAssembly!=\"object\"&&se(\"no native wasm support detected\");var A,k=!1,U,N,H,z,L,pe,Ie;function we(){var d=A.buffer;r.HEAP8=N=new Int8Array(d),r.HEAP16=new Int16Array(d),r.HEAPU8=H=new Uint8Array(d),r.HEAPU16=new Uint16Array(d),r.HEAP32=z=new Int32Array(d),r.HEAPU32=L=new Uint32Array(d),r.HEAPF32=pe=new Float32Array(d),r.HEAPF64=Ie=new Float64Array(d)}var ne=[],Ue=[],X=[],xe=0,fe=null,ue=null;function se(d){throw d=\"Aborted(\"+d+\")\",E(d),k=!0,U=1,d=new WebAssembly.RuntimeError(d+\". Build with -sASSERTIONS for more info.\"),n(d),d}var he=d=>d.startsWith(\"data:application/octet-stream;base64,\"),Ee=d=>d.startsWith(\"file://\"),Le;if(Le=\"ort-wasm-simd.wasm\",!he(Le)){var G=Le;Le=r.locateFile?r.locateFile(G,h):h+G}function J(d){if($)return $(d);throw\"both async and sync fetching of the wasm failed\"}function Se(d){if(c||f){if(typeof fetch==\"function\"&&!Ee(d))return fetch(d,{credentials:\"same-origin\"}).then(g=>{if(!g.ok)throw\"failed to load wasm binary file at '\"+d+\"'\";return g.arrayBuffer()}).catch(()=>J(d));if(b)return new Promise((g,_)=>{b(d,C=>g(new Uint8Array(C)),_)})}return Promise.resolve().then(()=>J(d))}function Je(d,g,_){return Se(d).then(C=>WebAssembly.instantiate(C,g)).then(C=>C).then(_,C=>{E(`failed to asynchronously prepare wasm: ${C}`),se(C)})}function et(d,g){var _=Le;return typeof WebAssembly.instantiateStreaming!=\"function\"||he(_)||Ee(_)||m||typeof fetch!=\"function\"?Je(_,d,g):fetch(_,{credentials:\"same-origin\"}).then(C=>WebAssembly.instantiateStreaming(C,d).then(g,function(O){return E(`wasm streaming compile failed: ${O}`),E(\"falling back to ArrayBuffer instantiation\"),Je(_,d,g)}))}var Fe,It={931760:(d,g,_,C)=>{if(typeof r>\"u\"||!r.Fa)return 1;if(d=je(d>>>0),d.startsWith(\"./\")&&(d=d.substring(2)),d=r.Fa.get(d),!d)return 2;if(g>>>=0,_>>>=0,g+_>d.byteLength)return 3;try{return H.set(d.subarray(g,g+_),C>>>0>>>0),0}catch{return 4}},932261:()=>{r.Sa()},932292:()=>{r.Ta()},932321:()=>{r.Xa()},932346:d=>r.Ra(d),932379:d=>r.Va(d),932411:(d,g,_)=>{r.Ma(d,g,_,!0)},932450:(d,g,_)=>{r.Ma(d,g,_)},932483:d=>{r.sa(\"Abs\",d,void 0)},932534:d=>{r.sa(\"Neg\",d,void 0)},932585:d=>{r.sa(\"Floor\",d,void 0)},932638:d=>{r.sa(\"Ceil\",d,void 0)},932690:d=>{r.sa(\"Reciprocal\",d,void 0)},932748:d=>{r.sa(\"Sqrt\",d,void 0)},932800:d=>{r.sa(\"Exp\",d,void 0)},932851:d=>{r.sa(\"Erf\",d,void 0)},932902:d=>{r.sa(\"Sigmoid\",d,void 0)},932957:(d,g,_)=>{r.sa(\"HardSigmoid\",d,{alpha:g,beta:_})},933036:d=>{r.sa(\"Log\",d,void 0)},933087:d=>{r.sa(\"Sin\",d,void 0)},933138:d=>{r.sa(\"Cos\",d,void 0)},933189:d=>{r.sa(\"Tan\",d,void 0)},933240:d=>{r.sa(\"Asin\",d,void 0)},933292:d=>{r.sa(\"Acos\",d,void 0)},933344:d=>{r.sa(\"Atan\",d,void 0)},933396:d=>{r.sa(\"Sinh\",d,void 0)},933448:d=>{r.sa(\"Cosh\",d,void 0)},933500:d=>{r.sa(\"Asinh\",d,void 0)},933553:d=>{r.sa(\"Acosh\",d,void 0)},933606:d=>{r.sa(\"Atanh\",d,void 0)},933659:d=>{r.sa(\"Tanh\",d,void 0)},933711:d=>{r.sa(\"Not\",d,void 0)},933762:(d,g,_)=>{r.sa(\"Clip\",d,{min:g,max:_})},933831:d=>{r.sa(\"Clip\",d,void 0)},933883:(d,g)=>{r.sa(\"Elu\",d,{alpha:g})},933941:d=>{r.sa(\"Relu\",d,void 0)},933993:(d,g)=>{r.sa(\"LeakyRelu\",d,{alpha:g})},934057:(d,g)=>{r.sa(\"ThresholdedRelu\",d,{alpha:g})},934127:(d,g)=>{r.sa(\"Cast\",d,{to:g})},934185:d=>{r.sa(\"Add\",d,void 0)},934236:d=>{r.sa(\"Sub\",d,void 0)},934287:d=>{r.sa(\"Mul\",d,void 0)},934338:d=>{r.sa(\"Div\",d,void 0)},934389:d=>{r.sa(\"Pow\",d,void 0)},934440:d=>{r.sa(\"Equal\",d,void 0)},934493:d=>{r.sa(\"Greater\",d,void 0)},934548:d=>{r.sa(\"GreaterOrEqual\",d,void 0)},934610:d=>{r.sa(\"Less\",d,void 0)},934662:d=>{r.sa(\"LessOrEqual\",d,void 0)},934721:(d,g,_,C,O)=>{r.sa(\"ReduceMean\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},934880:(d,g,_,C,O)=>{r.sa(\"ReduceMax\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935038:(d,g,_,C,O)=>{r.sa(\"ReduceMin\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935196:(d,g,_,C,O)=>{r.sa(\"ReduceProd\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935355:(d,g,_,C,O)=>{r.sa(\"ReduceSum\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935513:(d,g,_,C,O)=>{r.sa(\"ReduceL1\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935670:(d,g,_,C,O)=>{r.sa(\"ReduceL2\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935827:(d,g,_,C,O)=>{r.sa(\"ReduceLogSum\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},935988:(d,g,_,C,O)=>{r.sa(\"ReduceSumSquare\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},936152:(d,g,_,C,O)=>{r.sa(\"ReduceLogSumExp\",d,{keepDims:!!g,noopWithEmptyAxes:!!_,axes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},936316:d=>{r.sa(\"Where\",d,void 0)},936369:(d,g,_)=>{r.sa(\"Transpose\",d,{perm:g?Array.from(z.subarray(g>>>0,_>>>0)):[]})},936477:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae)=>{r.sa(\"ConvTranspose\",d,{format:oe?\"NHWC\":\"NCHW\",autoPad:g,dilations:[_],group:C,kernel_shape:[O],pads:[W,j],strides:[Q],wIsConst:()=>!!N[le>>>0],outputPadding:me?Array.from(z.subarray(me>>>0,Pe>>>0)):[],outputShape:ze?Array.from(z.subarray(ze>>>0,P>>>0)):[],activation:je(ae)})},936879:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P)=>{r.sa(\"ConvTranspose\",d,{format:Q?\"NHWC\":\"NCHW\",autoPad:g,dilations:Array.from(z.subarray(_>>>0,(_>>>0)+2>>>0)),group:C,kernelShape:Array.from(z.subarray(O>>>0,(O>>>0)+2>>>0)),pads:Array.from(z.subarray(W>>>0,(W>>>0)+4>>>0)),strides:Array.from(z.subarray(j>>>0,(j>>>0)+2>>>0)),wIsConst:()=>!!N[oe>>>0],outputPadding:le?Array.from(z.subarray(le>>>0,me>>>0)):[],outputShape:Pe?Array.from(z.subarray(Pe>>>0,ze>>>0)):[],activation:je(P)})},937444:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae)=>{r.sa(\"ConvTranspose\",d,{format:oe?\"NHWC\":\"NCHW\",autoPad:g,dilations:[_],group:C,kernel_shape:[O],pads:[W,j],strides:[Q],wIsConst:()=>!!N[le>>>0],outputPadding:me?Array.from(z.subarray(me>>>0,Pe>>>0)):[],outputShape:ze?Array.from(z.subarray(ze>>>0,P>>>0)):[],activation:je(ae)})},937846:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P)=>{r.sa(\"ConvTranspose\",d,{format:Q?\"NHWC\":\"NCHW\",autoPad:g,dilations:Array.from(z.subarray(_>>>0,(_>>>0)+2>>>0)),group:C,kernelShape:Array.from(z.subarray(O>>>0,(O>>>0)+2>>>0)),pads:Array.from(z.subarray(W>>>0,(W>>>0)+4>>>0)),strides:Array.from(z.subarray(j>>>0,(j>>>0)+2>>>0)),wIsConst:()=>!!N[oe>>>0],outputPadding:le?Array.from(z.subarray(le>>>0,me>>>0)):[],outputShape:Pe?Array.from(z.subarray(Pe>>>0,ze>>>0)):[],activation:je(P)})},938411:(d,g)=>{r.sa(\"GlobalAveragePool\",d,{format:g?\"NHWC\":\"NCHW\"})},938502:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae,Ce)=>{r.sa(\"AveragePool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:g,ceil_mode:_,count_include_pad:C,storage_order:O,dilations:[W,j],kernel_shape:[Q,oe],pads:[le,me,Pe,ze],strides:[P,ae]})},938786:(d,g)=>{r.sa(\"GlobalAveragePool\",d,{format:g?\"NHWC\":\"NCHW\"})},938877:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae,Ce)=>{r.sa(\"AveragePool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:g,ceil_mode:_,count_include_pad:C,storage_order:O,dilations:[W,j],kernel_shape:[Q,oe],pads:[le,me,Pe,ze],strides:[P,ae]})},939161:(d,g)=>{r.sa(\"GlobalMaxPool\",d,{format:g?\"NHWC\":\"NCHW\"})},939248:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae,Ce)=>{r.sa(\"MaxPool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:g,ceil_mode:_,count_include_pad:C,storage_order:O,dilations:[W,j],kernel_shape:[Q,oe],pads:[le,me,Pe,ze],strides:[P,ae]})},939528:(d,g)=>{r.sa(\"GlobalMaxPool\",d,{format:g?\"NHWC\":\"NCHW\"})},939615:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae,Ce)=>{r.sa(\"MaxPool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:g,ceil_mode:_,count_include_pad:C,storage_order:O,dilations:[W,j],kernel_shape:[Q,oe],pads:[le,me,Pe,ze],strides:[P,ae]})},939895:(d,g,_,C,O)=>{r.sa(\"Gemm\",d,{alpha:g,beta:_,transA:C,transB:O})},939999:d=>{r.sa(\"MatMul\",d,void 0)},940053:(d,g,_,C)=>{r.sa(\"ArgMax\",d,{keepDims:!!g,selectLastIndex:!!_,axis:C})},940161:(d,g,_,C)=>{r.sa(\"ArgMin\",d,{keepDims:!!g,selectLastIndex:!!_,axis:C})},940269:(d,g)=>{r.sa(\"Softmax\",d,{axis:g})},940332:(d,g)=>{r.sa(\"Concat\",d,{axis:g})},940392:(d,g,_,C,O)=>{r.sa(\"Split\",d,{axis:g,numOutputs:_,splitSizes:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},940532:d=>{r.sa(\"Expand\",d,void 0)},940586:(d,g)=>{r.sa(\"Gather\",d,{axis:Number(g)})},940657:(d,g)=>{r.sa(\"GatherElements\",d,{axis:Number(g)})},940736:(d,g,_,C,O,W,j,Q,oe,le,me)=>{r.sa(\"Resize\",d,{antialias:g,axes:_?Array.from(z.subarray(_>>>0,C>>>0)):[],coordinateTransformMode:je(O),cubicCoeffA:W,excludeOutside:j,extrapolationValue:Q,keepAspectRatioPolicy:je(oe),mode:je(le),nearestMode:je(me)})},941082:(d,g,_,C,O,W,j)=>{r.sa(\"Slice\",d,{starts:g?Array.from(z.subarray(g>>>0,_>>>0)):[],ends:C?Array.from(z.subarray(C>>>0,O>>>0)):[],axes:W?Array.from(z.subarray(W>>>0,j>>>0)):[]})},941298:d=>{r.sa(\"Tile\",d,void 0)},941350:(d,g,_)=>{r.sa(\"LayerNormalization\",d,{axis:Number(g),epsilon:Number(_)})},941457:(d,g,_)=>{r.sa(\"InstanceNormalization\",d,{epsilon:g,format:_?\"NHWC\":\"NCHW\"})},941571:(d,g,_)=>{r.sa(\"InstanceNormalization\",d,{epsilon:g,format:_?\"NHWC\":\"NCHW\"})},941685:d=>{r.sa(\"Range\",d,void 0)},941738:(d,g)=>{r.sa(\"Einsum\",d,{equation:je(g)})},941819:(d,g,_,C,O)=>{r.sa(\"Pad\",d,{mode:g,value:_,pads:C?Array.from(z.subarray(C>>>0,O>>>0)):[]})},941946:(d,g,_,C,O,W)=>{r.sa(\"BatchNormalization\",d,{epsilon:g,momentum:_,spatial:!!O,trainingMode:!!C,format:W?\"NHWC\":\"NCHW\"})},942115:(d,g,_,C,O,W)=>{r.sa(\"BatchNormalization\",d,{epsilon:g,momentum:_,spatial:!!O,trainingMode:!!C,format:W?\"NHWC\":\"NCHW\"})},942284:(d,g,_)=>{r.sa(\"CumSum\",d,{exclusive:Number(g),reverse:Number(_)})},942381:(d,g,_,C,O,W,j,Q,oe)=>{r.sa(\"Attention\",d,{numHeads:g,isUnidirectional:_,maskFilterValue:C,scale:O,doRotary:W,qkvHiddenSizes:j?Array.from(z.subarray(Number(Q)>>>0,Number(Q)+j>>>0)):[],pastPresentShareBuffer:!!oe})},942653:d=>{r.sa(\"BiasAdd\",d,void 0)},942708:d=>{r.sa(\"BiasSplitGelu\",d,void 0)},942769:d=>{r.sa(\"FastGelu\",d,void 0)},942825:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze)=>{r.sa(\"Conv\",d,{format:oe?\"NHWC\":\"NCHW\",auto_pad:g,dilations:[_],group:C,kernel_shape:[O],pads:W?Array.from(z.subarray(W>>>0,j>>>0)):[],strides:[Q],w_is_const:()=>!!N[le>>>0],activation:je(me),activation_params:Pe?Array.from(pe.subarray(Pe>>>0,ze>>>0)):[]})},943195:(d,g,_,C,O,W,j,Q,oe,le,me,Pe,ze,P,ae,Ce)=>{r.sa(\"Conv\",d,{format:Pe?\"NHWC\":\"NCHW\",auto_pad:g,dilations:[_,C],group:O,kernel_shape:[W,j],pads:Q?Array.from(z.subarray(Q>>>0,oe>>>0)):[],strides:[le,me],w_is_const:()=>!!N[ze>>>0],activation:je(P),activation_params:ae?Array.from(pe.subarray(ae>>>0,Ce>>>0)):[]})},943586:d=>{r.sa(\"Gelu\",d,void 0)},943638:(d,g,_,C,O,W)=>{r.sa(\"MatMulNBits\",d,{k:g,n:_,accuracyLevel:C,bits:O,blockSize:W})},943765:(d,g,_,C,O,W)=>{r.sa(\"MultiHeadAttention\",d,{numHeads:g,isUnidirectional:_,maskFilterValue:C,scale:O,doRotary:W})},943924:(d,g)=>{r.sa(\"SkipLayerNormalization\",d,{epsilon:g})},944005:d=>{r.Wa(d)},944039:(d,g)=>r.Ya(d,g,r.Ea.Za,r.Ea.errors)};function Ve(d){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${d})`,this.status=d}function qe(d){this.Ja=d-24,this.Pa=function(g){L[this.Ja+4>>>2>>>0]=g},this.Oa=function(g){L[this.Ja+8>>>2>>>0]=g},this.eb=function(g,_){this.Na(),this.Pa(g),this.Oa(_)},this.Na=function(){L[this.Ja+16>>>2>>>0]=0}}var tt=0,Ut=0,Et=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,Ot=(d,g,_)=>{g>>>=0;var C=g+_;for(_=g;d[_]&&!(_>=C);)++_;if(16<_-g&&d.buffer&&Et)return Et.decode(d.subarray(g,_));for(C=\"\";g<_;){var O=d[g++];if(O&128){var W=d[g++]&63;if((O&224)==192)C+=String.fromCharCode((O&31)<<6|W);else{var j=d[g++]&63;O=(O&240)==224?(O&15)<<12|W<<6|j:(O&7)<<18|W<<12|j<<6|d[g++]&63,65536>O?C+=String.fromCharCode(O):(O-=65536,C+=String.fromCharCode(55296|O>>10,56320|O&1023))}}else C+=String.fromCharCode(O)}return C},je=(d,g)=>(d>>>=0)?Ot(H,d,g):\"\",ur=d=>{for(var g=0,_=0;_=C?g++:2047>=C?g+=2:55296<=C&&57343>=C?(g+=4,++_):g+=3}return g},Yt=(d,g,_,C)=>{if(_>>>=0,!(0=j){var Q=d.charCodeAt(++W);j=65536+((j&1023)<<10)|Q&1023}if(127>=j){if(_>=C)break;g[_++>>>0]=j}else{if(2047>=j){if(_+1>=C)break;g[_++>>>0]=192|j>>6}else{if(65535>=j){if(_+2>=C)break;g[_++>>>0]=224|j>>12}else{if(_+3>=C)break;g[_++>>>0]=240|j>>18,g[_++>>>0]=128|j>>12&63}g[_++>>>0]=128|j>>6&63}g[_++>>>0]=128|j&63}}return g[_>>>0]=0,_-O},kt=d=>d%4===0&&(d%100!==0||d%400===0),At=[0,31,60,91,121,152,182,213,244,274,305,335],Zt=[0,31,59,90,120,151,181,212,243,273,304,334],Xt=d=>{var g=ur(d)+1,_=er(g);return _&&Yt(d,H,_,g),_},Nt=[],lr=(d,g)=>{Nt.length=0;for(var _;_=H[d++>>>0];){var C=_!=105;C&=_!=112,g+=C&&g%8?4:0,Nt.push(_==112?L[g>>>2>>>0]:_==105?z[g>>>2>>>0]:Ie[g>>>3>>>0]),g+=C?8:4}return Nt},pt={},dr=()=>{if(!Qt){var d={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:l||\"./this.program\"},g;for(g in pt)pt[g]===void 0?delete d[g]:d[g]=pt[g];var _=[];for(g in d)_.push(`${g}=${d[g]}`);Qt=_}return Qt},Qt,Ke=[null,[],[]],zr=[31,29,31,30,31,30,31,31,30,31,30,31],Re=[31,28,31,30,31,30,31,31,30,31,30,31];function Br(d){var g=Array(ur(d)+1);return Yt(d,g,0,g.length),g}function Jt(d,g,_,C){function O(P,ae,Ce){for(P=typeof P==\"number\"?P.toString():P||\"\";P.lengthLr?-1:0bt-P.getDate())ae-=bt-P.getDate()+1,P.setDate(1),11>Ce?P.setMonth(Ce+1):(P.setMonth(0),P.setFullYear(P.getFullYear()+1));else{P.setDate(P.getDate()+ae);break}}return Ce=new Date(P.getFullYear()+1,0,4),ae=Q(new Date(P.getFullYear(),0,4)),Ce=Q(Ce),0>=j(ae,P)?0>=j(Ce,P)?P.getFullYear()+1:P.getFullYear():P.getFullYear()-1}d>>>=0,g>>>=0,_>>>=0,C>>>=0;var le=L[C+40>>>2>>>0];C={bb:z[C>>>2>>>0],ab:z[C+4>>>2>>>0],Ga:z[C+8>>>2>>>0],Ka:z[C+12>>>2>>>0],Ha:z[C+16>>>2>>>0],Da:z[C+20>>>2>>>0],xa:z[C+24>>>2>>>0],Ca:z[C+28>>>2>>>0],fb:z[C+32>>>2>>>0],$a:z[C+36>>>2>>>0],cb:le?je(le):\"\"},_=je(_),le={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var me in le)_=_.replace(new RegExp(me,\"g\"),le[me]);var Pe=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),ze=\"January February March April May June July August September October November December\".split(\" \");le={\"%a\":P=>Pe[P.xa].substring(0,3),\"%A\":P=>Pe[P.xa],\"%b\":P=>ze[P.Ha].substring(0,3),\"%B\":P=>ze[P.Ha],\"%C\":P=>W((P.Da+1900)/100|0,2),\"%d\":P=>W(P.Ka,2),\"%e\":P=>O(P.Ka,2,\" \"),\"%g\":P=>oe(P).toString().substring(2),\"%G\":P=>oe(P),\"%H\":P=>W(P.Ga,2),\"%I\":P=>(P=P.Ga,P==0?P=12:12{for(var ae=0,Ce=0;Ce<=P.Ha-1;ae+=(kt(P.Da+1900)?zr:Re)[Ce++]);return W(P.Ka+ae,3)},\"%m\":P=>W(P.Ha+1,2),\"%M\":P=>W(P.ab,2),\"%n\":()=>`\n`,\"%p\":P=>0<=P.Ga&&12>P.Ga?\"AM\":\"PM\",\"%S\":P=>W(P.bb,2),\"%t\":()=>\"\t\",\"%u\":P=>P.xa||7,\"%U\":P=>W(Math.floor((P.Ca+7-P.xa)/7),2),\"%V\":P=>{var ae=Math.floor((P.Ca+7-(P.xa+6)%7)/7);if(2>=(P.xa+371-P.Ca-2)%7&&ae++,ae)ae==53&&(Ce=(P.xa+371-P.Ca)%7,Ce==4||Ce==3&&kt(P.Da)||(ae=1));else{ae=52;var Ce=(P.xa+7-P.Ca-1)%7;(Ce==4||Ce==5&&kt(P.Da%400-1))&&ae++}return W(ae,2)},\"%w\":P=>P.xa,\"%W\":P=>W(Math.floor((P.Ca+7-(P.xa+6)%7)/7),2),\"%y\":P=>(P.Da+1900).toString().substring(2),\"%Y\":P=>P.Da+1900,\"%z\":P=>{P=P.$a;var ae=0<=P;return P=Math.abs(P)/60,(ae?\"+\":\"-\")+(\"0000\"+(P/60*100+P%60)).slice(-4)},\"%Z\":P=>P.cb,\"%%\":()=>\"%\"},_=_.replace(/%%/g,\"\\0\\0\");for(me in le)_.includes(me)&&(_=_.replace(new RegExp(me,\"g\"),le[me](C)));return _=_.replace(/\\0\\0/g,\"%\"),me=Br(_),me.length>g?0:(N.set(me,d>>>0),me.length-1)}var Pt=d=>{try{d()}catch(g){se(g)}};function Un(){var d=ee,g={};for(let[_,C]of Object.entries(d))g[_]=typeof C==\"function\"?function(){Tt.push(_);try{return C.apply(null,arguments)}finally{k||(Tt.pop(),ut&&ft===1&&Tt.length===0&&(ft=0,Pt($r),typeof Fibers<\"u\"&&Fibers.gb()))}}:C;return g}var ft=0,ut=null,te=0,Tt=[],cr={},Dr={},Mr=0,pr=null,Ur=[];function Nr(){return new Promise((d,g)=>{pr={resolve:d,reject:g}})}function Wr(){var d=er(65548),g=d+12;L[d>>>2>>>0]=g,L[d+4>>>2>>>0]=g+65536,g=Tt[0];var _=cr[g];return _===void 0&&(_=Mr++,cr[g]=_,Dr[_]=g),z[d+8>>>2>>>0]=_,d}function Vr(d){if(!k){if(ft===0){var g=!1,_=!1;d((C=0)=>{if(!k&&(te=C,g=!0,_)){ft=2,Pt(()=>_r(ut)),typeof Browser<\"u\"&&Browser.Ia.Qa&&Browser.Ia.resume(),C=!1;try{var O=(0,ee[Dr[z[ut+8>>>2>>>0]]])()}catch(Q){O=Q,C=!0}var W=!1;if(!ut){var j=pr;j&&(pr=null,(C?j.reject:j.resolve)(O),W=!0)}if(C&&!W)throw O}}),_=!0,g||(ft=1,ut=Wr(),typeof Browser<\"u\"&&Browser.Ia.Qa&&Browser.Ia.pause(),Pt(()=>vr(ut)))}else ft===2?(ft=0,Pt(xr),hr(ut),ut=null,Ur.forEach(C=>{if(!k)try{C();try{U=U=C=U,r.onExit?.(C),k=!0,i(C,new Ve(C))}catch(O){O instanceof Ve||O==\"unwind\"||i(1,O)}}catch(O){O instanceof Ve||O==\"unwind\"||i(1,O)}})):se(`invalid state: ${ft}`);return te}}function fr(d){return Vr(g=>{d().then(g)})}var Gr={n:function(d,g,_){return fr(async()=>{await r.Ua(d,g,_)})},a:function(d,g,_){throw d>>>=0,new qe(d).eb(g>>>0,_>>>0),tt=d,Ut++,tt},g:function(){return 0},J:function(){},A:function(){},C:function(){},L:function(){return 0},H:function(){},D:function(){},G:function(){},l:function(){},B:function(){},y:function(){},I:function(){},z:function(){},m:()=>1,q:function(d,g,_){d=g+2097152>>>0<4194305-!!d?(d>>>0)+4294967296*g:NaN,_>>>=0,d=new Date(1e3*d),z[_>>>2>>>0]=d.getUTCSeconds(),z[_+4>>>2>>>0]=d.getUTCMinutes(),z[_+8>>>2>>>0]=d.getUTCHours(),z[_+12>>>2>>>0]=d.getUTCDate(),z[_+16>>>2>>>0]=d.getUTCMonth(),z[_+20>>>2>>>0]=d.getUTCFullYear()-1900,z[_+24>>>2>>>0]=d.getUTCDay(),z[_+28>>>2>>>0]=(d.getTime()-Date.UTC(d.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},r:function(d,g,_){d=g+2097152>>>0<4194305-!!d?(d>>>0)+4294967296*g:NaN,_>>>=0,d=new Date(1e3*d),z[_>>>2>>>0]=d.getSeconds(),z[_+4>>>2>>>0]=d.getMinutes(),z[_+8>>>2>>>0]=d.getHours(),z[_+12>>>2>>>0]=d.getDate(),z[_+16>>>2>>>0]=d.getMonth(),z[_+20>>>2>>>0]=d.getFullYear()-1900,z[_+24>>>2>>>0]=d.getDay(),z[_+28>>>2>>>0]=(kt(d.getFullYear())?At:Zt)[d.getMonth()]+d.getDate()-1|0,z[_+36>>>2>>>0]=-(60*d.getTimezoneOffset()),g=new Date(d.getFullYear(),6,1).getTimezoneOffset();var C=new Date(d.getFullYear(),0,1).getTimezoneOffset();z[_+32>>>2>>>0]=(g!=C&&d.getTimezoneOffset()==Math.min(C,g))|0},s:function(d){d>>>=0;var g=new Date(z[d+20>>>2>>>0]+1900,z[d+16>>>2>>>0],z[d+12>>>2>>>0],z[d+8>>>2>>>0],z[d+4>>>2>>>0],z[d>>>2>>>0],0),_=z[d+32>>>2>>>0],C=g.getTimezoneOffset(),O=new Date(g.getFullYear(),6,1).getTimezoneOffset(),W=new Date(g.getFullYear(),0,1).getTimezoneOffset(),j=Math.min(W,O);return 0>_?z[d+32>>>2>>>0]=+(O!=W&&j==C):0<_!=(j==C)&&(O=Math.max(W,O),g.setTime(g.getTime()+6e4*((0<_?j:O)-C))),z[d+24>>>2>>>0]=g.getDay(),z[d+28>>>2>>>0]=(kt(g.getFullYear())?At:Zt)[g.getMonth()]+g.getDate()-1|0,z[d>>>2>>>0]=g.getSeconds(),z[d+4>>>2>>>0]=g.getMinutes(),z[d+8>>>2>>>0]=g.getHours(),z[d+12>>>2>>>0]=g.getDate(),z[d+16>>>2>>>0]=g.getMonth(),z[d+20>>>2>>>0]=g.getYear(),d=g.getTime(),isNaN(d)?(z[mr()>>>2>>>0]=61,d=-1):d/=1e3,gr((Fe=d,1<=+Math.abs(Fe)?0>>0:~~+Math.ceil((Fe-+(~~Fe>>>0))/4294967296)>>>0:0)),d>>>0},o:function(){return-52},p:function(){},w:function(d,g,_){function C(oe){return(oe=oe.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?oe[1]:\"GMT\"}_>>>=0;var O=new Date().getFullYear(),W=new Date(O,0,1),j=new Date(O,6,1);O=W.getTimezoneOffset();var Q=j.getTimezoneOffset();L[d>>>0>>>2>>>0]=60*Math.max(O,Q),z[g>>>0>>>2>>>0]=+(O!=Q),d=C(W),g=C(j),d=Xt(d),g=Xt(g),Q>>2>>>0]=d,L[_+4>>>2>>>0]=g):(L[_>>>2>>>0]=g,L[_+4>>>2>>>0]=d)},e:()=>{se(\"\")},b:function(d,g,_){return d>>>=0,g=lr(g>>>0,_>>>0),It[d].apply(null,g)},i:function(d,g,_){return d>>>=0,g=lr(g>>>0,_>>>0),It[d].apply(null,g)},h:()=>Date.now(),x:function(){return 4294901760},c:()=>performance.now(),K:function(d,g,_){return g>>>=0,H.copyWithin(d>>>0>>>0,g>>>0,g+(_>>>0)>>>0)},u:function(d){d>>>=0;var g=H.length;if(4294901760=_;_*=2){var C=g*(1+.2/_);C=Math.min(C,d+100663296);var O=Math;C=Math.max(d,C);e:{O=(O.min.call(O,4294901760,C+(65536-C%65536)%65536)-A.buffer.byteLength+65535)/65536;try{A.grow(O),we();var W=1;break e}catch{}W=void 0}if(W)return!0}return!1},E:function(d,g){d>>>=0,g>>>=0;var _=0;return dr().forEach((C,O)=>{var W=g+_;for(O=L[d+4*O>>>2>>>0]=W,W=0;W>>0>>>0]=C.charCodeAt(W);N[O>>>0>>>0]=0,_+=C.length+1}),0},F:function(d,g){d>>>=0,g>>>=0;var _=dr();L[d>>>2>>>0]=_.length;var C=0;return _.forEach(O=>C+=O.length+1),L[g>>>2>>>0]=C,0},f:()=>52,k:function(){return 52},t:function(){return 70},j:function(d,g,_,C){g>>>=0,_>>>=0,C>>>=0;for(var O=0,W=0;W<_;W++){var j=L[g>>>2>>>0],Q=L[g+4>>>2>>>0];g+=8;for(var oe=0;oe>>0],me=Ke[d];le===0||le===10?((d===1?v:E)(Ot(me,0)),me.length=0):me.push(le)}O+=Q}return L[C>>>2>>>0]=O,0},v:Jt,d:function(d,g,_,C){return Jt(d>>>0,g>>>0,_>>>0,C>>>0)}},ee=function(){function d(_){return ee=_.exports,ee=Un(),ee=Hr(),A=ee.M,we(),Ue.unshift(ee.N),xe--,xe==0&&(fe!==null&&(clearInterval(fe),fe=null),ue&&(_=ue,ue=null,_())),ee}var g={a:Gr};if(xe++,r.instantiateWasm)try{return r.instantiateWasm(g,d)}catch(_){E(`Module.instantiateWasm callback failed with error: ${_}`),n(_)}return et(g,function(_){d(_.instance)}).catch(n),{}}();r._OrtInit=(d,g)=>(r._OrtInit=ee.O)(d,g),r._OrtGetLastError=(d,g)=>(r._OrtGetLastError=ee.P)(d,g),r._OrtCreateSessionOptions=(d,g,_,C,O,W,j,Q,oe,le)=>(r._OrtCreateSessionOptions=ee.Q)(d,g,_,C,O,W,j,Q,oe,le),r._OrtAppendExecutionProvider=(d,g)=>(r._OrtAppendExecutionProvider=ee.R)(d,g),r._OrtAddFreeDimensionOverride=(d,g,_)=>(r._OrtAddFreeDimensionOverride=ee.S)(d,g,_),r._OrtAddSessionConfigEntry=(d,g,_)=>(r._OrtAddSessionConfigEntry=ee.T)(d,g,_),r._OrtReleaseSessionOptions=d=>(r._OrtReleaseSessionOptions=ee.U)(d),r._OrtCreateSession=(d,g,_)=>(r._OrtCreateSession=ee.V)(d,g,_),r._OrtReleaseSession=d=>(r._OrtReleaseSession=ee.W)(d),r._OrtGetInputOutputCount=(d,g,_)=>(r._OrtGetInputOutputCount=ee.X)(d,g,_),r._OrtGetInputName=(d,g)=>(r._OrtGetInputName=ee.Y)(d,g),r._OrtGetOutputName=(d,g)=>(r._OrtGetOutputName=ee.Z)(d,g),r._OrtFree=d=>(r._OrtFree=ee._)(d),r._OrtCreateTensor=(d,g,_,C,O,W)=>(r._OrtCreateTensor=ee.$)(d,g,_,C,O,W),r._OrtGetTensorData=(d,g,_,C,O)=>(r._OrtGetTensorData=ee.aa)(d,g,_,C,O),r._OrtReleaseTensor=d=>(r._OrtReleaseTensor=ee.ba)(d),r._OrtCreateRunOptions=(d,g,_,C)=>(r._OrtCreateRunOptions=ee.ca)(d,g,_,C),r._OrtAddRunConfigEntry=(d,g,_)=>(r._OrtAddRunConfigEntry=ee.da)(d,g,_),r._OrtReleaseRunOptions=d=>(r._OrtReleaseRunOptions=ee.ea)(d),r._OrtCreateBinding=d=>(r._OrtCreateBinding=ee.fa)(d),r._OrtBindInput=(d,g,_)=>(r._OrtBindInput=ee.ga)(d,g,_),r._OrtBindOutput=(d,g,_,C)=>(r._OrtBindOutput=ee.ha)(d,g,_,C),r._OrtClearBoundOutputs=d=>(r._OrtClearBoundOutputs=ee.ia)(d),r._OrtReleaseBinding=d=>(r._OrtReleaseBinding=ee.ja)(d),r._OrtRunWithBinding=(d,g,_,C,O)=>(r._OrtRunWithBinding=ee.ka)(d,g,_,C,O),r._OrtRun=(d,g,_,C,O,W,j,Q)=>(r._OrtRun=ee.la)(d,g,_,C,O,W,j,Q),r._OrtEndProfiling=d=>(r._OrtEndProfiling=ee.ma)(d),r._JsepOutput=(d,g,_)=>(r._JsepOutput=ee.na)(d,g,_),r._JsepGetNodeName=d=>(r._JsepGetNodeName=ee.oa)(d);var mr=()=>(mr=ee.pa)(),er=r._malloc=d=>(er=r._malloc=ee.qa)(d),hr=r._free=d=>(hr=r._free=ee.ra)(d),gr=d=>(gr=ee.ta)(d),yr=()=>(yr=ee.ua)(),br=d=>(br=ee.va)(d),wr=d=>(wr=ee.wa)(d),vr=d=>(vr=ee.ya)(d),$r=()=>($r=ee.za)(),_r=d=>(_r=ee.Aa)(d),xr=()=>(xr=ee.Ba)();r.___start_em_js=944151,r.___stop_em_js=944312;function Hr(){var d=ee;d=Object.assign({},d);var g=C=>()=>C()>>>0,_=C=>O=>C(O)>>>0;return d.pa=g(d.pa),d.qa=_(d.qa),d.ua=g(d.ua),d.wa=_(d.wa),d}r.stackAlloc=wr,r.stackSave=yr,r.stackRestore=br,r.UTF8ToString=je,r.stringToUTF8=(d,g,_)=>Yt(d,H,g,_),r.lengthBytesUTF8=ur;var Rt;ue=function d(){Rt||Wt(),Rt||(ue=d)};function Wt(){if(!(0Bi)});var Ui=tr(()=>{});var Ni=tr(()=>{});var Wi={};rr(Wi,{cpus:()=>vd});var vd,Vi=F(()=>{vd=void 0});var Li=tr((Hi,ta)=>{\"use strict\";var Gi=(()=>{var e=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(e=e||__filename),function(t={}){function r(){return ne.buffer!=fe.buffer&&G(),fe}function a(){return ne.buffer!=fe.buffer&&G(),ue}function n(){return ne.buffer!=fe.buffer&&G(),se}function o(){return ne.buffer!=fe.buffer&&G(),he}function s(){return ne.buffer!=fe.buffer&&G(),Ee}function l(){return ne.buffer!=fe.buffer&&G(),Le}var i=t,c,f;i.ready=new Promise((u,p)=>{c=u,f=p}),i.mountExternalData=(u,p)=>{(i.cb||(i.cb=new Map)).set(u,p)},i.unmountExternalData=()=>{delete i.cb};let m=()=>{let u=(y,x,T)=>(...R)=>{let V=wt,Z=x?.();R=y(...R);let ge=x?.();return Z!==ge&&(y=ge,T(Z),x=T=null),wt!=V?td():R},p=y=>async(...x)=>{try{if(i.bb)throw Error(\"Session already started\");let T=i.bb={Gb:x[0],errors:[]},R=await y(...x);if(i.bb!==T)throw Error(\"Session mismatch\");i.kb?.flush();let V=T.errors;if(0ge),0i._OrtCreateSession,y=>i._OrtCreateSession=y),i._OrtRun=p(u(i._OrtRun,()=>i._OrtRun,y=>i._OrtRun=y)),i._OrtRunWithBinding=p(u(i._OrtRunWithBinding,()=>i._OrtRunWithBinding,y=>i._OrtRunWithBinding=y)),i._OrtBindInput=u(i._OrtBindInput,()=>i._OrtBindInput,y=>i._OrtBindInput=y),m=void 0};i.jsepInit=(u,p)=>{if(m?.(),u===\"webgpu\"){[i.kb,i.xb,i.Bb,i.lb,i.Ab,i.Ea,i.Cb,i.Eb,i.yb,i.zb,i.Db]=p;let y=i.kb;i.jsepRegisterBuffer=(x,T,R,V)=>y.registerBuffer(x,T,R,V),i.jsepGetBuffer=x=>y.getBuffer(x),i.jsepCreateDownloader=(x,T,R)=>y.createDownloader(x,T,R),i.jsepOnReleaseSession=x=>{y.onReleaseSession(x)},i.jsepOnRunStart=x=>y.onRunStart(x)}};var h=Object.assign({},i),w=\"./this.program\",b=(u,p)=>{throw p},$=typeof window==\"object\",I=typeof importScripts==\"function\",S=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",v=i.ENVIRONMENT_IS_PTHREAD||!1,E=\"\";function A(u){return i.locateFile?i.locateFile(u,E):E+u}var k,U,N;if(S){var H=(Xn(),Gt(Zn)),z=(Jn(),Gt(Qn));E=I?z.dirname(E)+\"/\":__dirname+\"/\",k=(p,y)=>(p=Et(p)?new URL(p):z.normalize(p),H.readFileSync(p,y?void 0:\"utf8\")),N=p=>(p=k(p,!0),p.buffer||(p=new Uint8Array(p)),p),U=(p,y,x,T=!0)=>{p=Et(p)?new URL(p):z.normalize(p),H.readFile(p,T?void 0:\"utf8\",(R,V)=>{R?x(R):y(T?V.buffer:V)})},!i.thisProgram&&1{throw process.exitCode=p,y},i.inspect=()=>\"[Emscripten Module object]\";let u;try{u=Ui()}catch(p){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),p}global.Worker=u.Worker}else($||I)&&(I?E=self.location.href:typeof document<\"u\"&&document.currentScript&&(E=document.currentScript.src),typeof e<\"u\"&&e&&(E=e),E.indexOf(\"blob:\")!==0?E=E.substr(0,E.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):E=\"\",S||(k=u=>{var p=new XMLHttpRequest;return p.open(\"GET\",u,!1),p.send(null),p.responseText},I&&(N=u=>{var p=new XMLHttpRequest;return p.open(\"GET\",u,!1),p.responseType=\"arraybuffer\",p.send(null),new Uint8Array(p.response)}),U=(u,p,y)=>{var x=new XMLHttpRequest;x.open(\"GET\",u,!0),x.responseType=\"arraybuffer\",x.onload=()=>{x.status==200||x.status==0&&x.response?p(x.response):y()},x.onerror=y,x.send(null)}));S&&typeof performance>\"u\"&&(global.performance=Ni().performance);var L=console.log.bind(console),pe=console.error.bind(console);S&&(L=(...u)=>H.writeSync(1,u.join(\" \")+`\n`),pe=(...u)=>H.writeSync(2,u.join(\" \")+`\n`));var Ie=L,we=pe;Object.assign(i,h),h=null,typeof WebAssembly!=\"object\"&&tt(\"no native wasm support detected\");var ne,Ue,X=!1,xe,fe,ue,se,he,Ee,Le;function G(){var u=ne.buffer;i.HEAP8=fe=new Int8Array(u),i.HEAP16=new Int16Array(u),i.HEAPU8=ue=new Uint8Array(u),i.HEAPU16=new Uint16Array(u),i.HEAP32=se=new Int32Array(u),i.HEAPU32=he=new Uint32Array(u),i.HEAPF32=Ee=new Float32Array(u),i.HEAPF64=Le=new Float64Array(u)}var J=16777216;if(v)ne=i.wasmMemory;else if(i.wasmMemory)ne=i.wasmMemory;else if(ne=new WebAssembly.Memory({initial:J/65536,maximum:65536,shared:!0}),!(ne.buffer instanceof SharedArrayBuffer))throw we(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),S&&we(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");G(),J=ne.buffer.byteLength;var Se=[],Je=[],et=[],Fe=0,It=null,Ve=null;function qe(){if(Fe--,Fe==0&&(It!==null&&(clearInterval(It),It=null),Ve)){var u=Ve;Ve=null,u()}}function tt(u){throw u=\"Aborted(\"+u+\")\",we(u),X=!0,xe=1,u=new WebAssembly.RuntimeError(u+\". Build with -sASSERTIONS for more info.\"),f(u),u}var Ut=u=>u.startsWith(\"data:application/octet-stream;base64,\"),Et=u=>u.startsWith(\"file://\"),Ot;Ot=\"ort-wasm-simd-threaded.wasm\",Ut(Ot)||(Ot=A(Ot));function je(u){if(N)return N(u);throw\"both async and sync fetching of the wasm failed\"}function ur(u){if($||I){if(typeof fetch==\"function\"&&!Et(u))return fetch(u,{credentials:\"same-origin\"}).then(p=>{if(!p.ok)throw\"failed to load wasm binary file at '\"+u+\"'\";return p.arrayBuffer()}).catch(()=>je(u));if(U)return new Promise((p,y)=>{U(u,x=>p(new Uint8Array(x)),y)})}return Promise.resolve().then(()=>je(u))}function Yt(u,p,y){return ur(u).then(x=>WebAssembly.instantiate(x,p)).then(x=>x).then(y,x=>{we(`failed to asynchronously prepare wasm: ${x}`),tt(x)})}function kt(u,p){var y=Ot;return typeof WebAssembly.instantiateStreaming!=\"function\"||Ut(y)||Et(y)||S||typeof fetch!=\"function\"?Yt(y,u,p):fetch(y,{credentials:\"same-origin\"}).then(x=>WebAssembly.instantiateStreaming(x,u).then(p,function(T){return we(`wasm streaming compile failed: ${T}`),we(\"falling back to ArrayBuffer instantiation\"),Yt(y,u,p)}))}var At,Zt={933148:(u,p,y,x)=>{if(typeof i>\"u\"||!i.cb)return 1;if(u=Ke(u>>>0),u.startsWith(\"./\")&&(u=u.substring(2)),u=i.cb.get(u),!u)return 2;if(p>>>=0,y>>>=0,x>>>=0,p+y>u.byteLength)return 3;try{return a().set(u.subarray(p,p+y),x>>>0),0}catch{return 4}},933649:()=>{i.yb()},933680:()=>{i.zb()},933709:()=>{i.Db()},933734:u=>i.xb(u),933767:u=>i.Bb(u),933799:(u,p,y)=>{i.lb(u,p,y,!0)},933838:(u,p,y)=>{i.lb(u,p,y)},933871:u=>{i.Ea(\"Abs\",u,void 0)},933922:u=>{i.Ea(\"Neg\",u,void 0)},933973:u=>{i.Ea(\"Floor\",u,void 0)},934026:u=>{i.Ea(\"Ceil\",u,void 0)},934078:u=>{i.Ea(\"Reciprocal\",u,void 0)},934136:u=>{i.Ea(\"Sqrt\",u,void 0)},934188:u=>{i.Ea(\"Exp\",u,void 0)},934239:u=>{i.Ea(\"Erf\",u,void 0)},934290:u=>{i.Ea(\"Sigmoid\",u,void 0)},934345:(u,p,y)=>{i.Ea(\"HardSigmoid\",u,{alpha:p,beta:y})},934424:u=>{i.Ea(\"Log\",u,void 0)},934475:u=>{i.Ea(\"Sin\",u,void 0)},934526:u=>{i.Ea(\"Cos\",u,void 0)},934577:u=>{i.Ea(\"Tan\",u,void 0)},934628:u=>{i.Ea(\"Asin\",u,void 0)},934680:u=>{i.Ea(\"Acos\",u,void 0)},934732:u=>{i.Ea(\"Atan\",u,void 0)},934784:u=>{i.Ea(\"Sinh\",u,void 0)},934836:u=>{i.Ea(\"Cosh\",u,void 0)},934888:u=>{i.Ea(\"Asinh\",u,void 0)},934941:u=>{i.Ea(\"Acosh\",u,void 0)},934994:u=>{i.Ea(\"Atanh\",u,void 0)},935047:u=>{i.Ea(\"Tanh\",u,void 0)},935099:u=>{i.Ea(\"Not\",u,void 0)},935150:(u,p,y)=>{i.Ea(\"Clip\",u,{min:p,max:y})},935219:u=>{i.Ea(\"Clip\",u,void 0)},935271:(u,p)=>{i.Ea(\"Elu\",u,{alpha:p})},935329:u=>{i.Ea(\"Relu\",u,void 0)},935381:(u,p)=>{i.Ea(\"LeakyRelu\",u,{alpha:p})},935445:(u,p)=>{i.Ea(\"ThresholdedRelu\",u,{alpha:p})},935515:(u,p)=>{i.Ea(\"Cast\",u,{to:p})},935573:u=>{i.Ea(\"Add\",u,void 0)},935624:u=>{i.Ea(\"Sub\",u,void 0)},935675:u=>{i.Ea(\"Mul\",u,void 0)},935726:u=>{i.Ea(\"Div\",u,void 0)},935777:u=>{i.Ea(\"Pow\",u,void 0)},935828:u=>{i.Ea(\"Equal\",u,void 0)},935881:u=>{i.Ea(\"Greater\",u,void 0)},935936:u=>{i.Ea(\"GreaterOrEqual\",u,void 0)},935998:u=>{i.Ea(\"Less\",u,void 0)},936050:u=>{i.Ea(\"LessOrEqual\",u,void 0)},936109:(u,p,y,x,T)=>{i.Ea(\"ReduceMean\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},936268:(u,p,y,x,T)=>{i.Ea(\"ReduceMax\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},936426:(u,p,y,x,T)=>{i.Ea(\"ReduceMin\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},936584:(u,p,y,x,T)=>{i.Ea(\"ReduceProd\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},936743:(u,p,y,x,T)=>{i.Ea(\"ReduceSum\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},936901:(u,p,y,x,T)=>{i.Ea(\"ReduceL1\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},937058:(u,p,y,x,T)=>{i.Ea(\"ReduceL2\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},937215:(u,p,y,x,T)=>{i.Ea(\"ReduceLogSum\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},937376:(u,p,y,x,T)=>{i.Ea(\"ReduceSumSquare\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},937540:(u,p,y,x,T)=>{i.Ea(\"ReduceLogSumExp\",u,{keepDims:!!p,noopWithEmptyAxes:!!y,axes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},937704:u=>{i.Ea(\"Where\",u,void 0)},937757:(u,p,y)=>{i.Ea(\"Transpose\",u,{perm:p?Array.from(n().subarray(p>>>0,y>>>0)):[]})},937865:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce)=>{i.Ea(\"ConvTranspose\",u,{format:ge?\"NHWC\":\"NCHW\",autoPad:p,dilations:[y],group:x,kernel_shape:[T],pads:[R,V],strides:[Z],wIsConst:()=>!!r()[de>>>0],outputPadding:ve?Array.from(n().subarray(ve>>>0,Ne>>>0)):[],outputShape:We?Array.from(n().subarray(We>>>0,B>>>0)):[],activation:Ke(ce)})},938267:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B)=>{i.Ea(\"ConvTranspose\",u,{format:Z?\"NHWC\":\"NCHW\",autoPad:p,dilations:Array.from(n().subarray(y>>>0,(y>>>0)+2>>>0)),group:x,kernelShape:Array.from(n().subarray(T>>>0,(T>>>0)+2>>>0)),pads:Array.from(n().subarray(R>>>0,(R>>>0)+4>>>0)),strides:Array.from(n().subarray(V>>>0,(V>>>0)+2>>>0)),wIsConst:()=>!!r()[ge>>>0],outputPadding:de?Array.from(n().subarray(de>>>0,ve>>>0)):[],outputShape:Ne?Array.from(n().subarray(Ne>>>0,We>>>0)):[],activation:Ke(B)})},938832:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce)=>{i.Ea(\"ConvTranspose\",u,{format:ge?\"NHWC\":\"NCHW\",autoPad:p,dilations:[y],group:x,kernel_shape:[T],pads:[R,V],strides:[Z],wIsConst:()=>!!r()[de>>>0],outputPadding:ve?Array.from(n().subarray(ve>>>0,Ne>>>0)):[],outputShape:We?Array.from(n().subarray(We>>>0,B>>>0)):[],activation:Ke(ce)})},939234:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B)=>{i.Ea(\"ConvTranspose\",u,{format:Z?\"NHWC\":\"NCHW\",autoPad:p,dilations:Array.from(n().subarray(y>>>0,(y>>>0)+2>>>0)),group:x,kernelShape:Array.from(n().subarray(T>>>0,(T>>>0)+2>>>0)),pads:Array.from(n().subarray(R>>>0,(R>>>0)+4>>>0)),strides:Array.from(n().subarray(V>>>0,(V>>>0)+2>>>0)),wIsConst:()=>!!r()[ge>>>0],outputPadding:de?Array.from(n().subarray(de>>>0,ve>>>0)):[],outputShape:Ne?Array.from(n().subarray(Ne>>>0,We>>>0)):[],activation:Ke(B)})},939799:(u,p)=>{i.Ea(\"GlobalAveragePool\",u,{format:p?\"NHWC\":\"NCHW\"})},939890:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce,Te)=>{i.Ea(\"AveragePool\",u,{format:Te?\"NHWC\":\"NCHW\",auto_pad:p,ceil_mode:y,count_include_pad:x,storage_order:T,dilations:[R,V],kernel_shape:[Z,ge],pads:[de,ve,Ne,We],strides:[B,ce]})},940174:(u,p)=>{i.Ea(\"GlobalAveragePool\",u,{format:p?\"NHWC\":\"NCHW\"})},940265:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce,Te)=>{i.Ea(\"AveragePool\",u,{format:Te?\"NHWC\":\"NCHW\",auto_pad:p,ceil_mode:y,count_include_pad:x,storage_order:T,dilations:[R,V],kernel_shape:[Z,ge],pads:[de,ve,Ne,We],strides:[B,ce]})},940549:(u,p)=>{i.Ea(\"GlobalMaxPool\",u,{format:p?\"NHWC\":\"NCHW\"})},940636:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce,Te)=>{i.Ea(\"MaxPool\",u,{format:Te?\"NHWC\":\"NCHW\",auto_pad:p,ceil_mode:y,count_include_pad:x,storage_order:T,dilations:[R,V],kernel_shape:[Z,ge],pads:[de,ve,Ne,We],strides:[B,ce]})},940916:(u,p)=>{i.Ea(\"GlobalMaxPool\",u,{format:p?\"NHWC\":\"NCHW\"})},941003:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce,Te)=>{i.Ea(\"MaxPool\",u,{format:Te?\"NHWC\":\"NCHW\",auto_pad:p,ceil_mode:y,count_include_pad:x,storage_order:T,dilations:[R,V],kernel_shape:[Z,ge],pads:[de,ve,Ne,We],strides:[B,ce]})},941283:(u,p,y,x,T)=>{i.Ea(\"Gemm\",u,{alpha:p,beta:y,transA:x,transB:T})},941387:u=>{i.Ea(\"MatMul\",u,void 0)},941441:(u,p,y,x)=>{i.Ea(\"ArgMax\",u,{keepDims:!!p,selectLastIndex:!!y,axis:x})},941549:(u,p,y,x)=>{i.Ea(\"ArgMin\",u,{keepDims:!!p,selectLastIndex:!!y,axis:x})},941657:(u,p)=>{i.Ea(\"Softmax\",u,{axis:p})},941720:(u,p)=>{i.Ea(\"Concat\",u,{axis:p})},941780:(u,p,y,x,T)=>{i.Ea(\"Split\",u,{axis:p,numOutputs:y,splitSizes:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},941920:u=>{i.Ea(\"Expand\",u,void 0)},941974:(u,p)=>{i.Ea(\"Gather\",u,{axis:Number(p)})},942045:(u,p)=>{i.Ea(\"GatherElements\",u,{axis:Number(p)})},942124:(u,p,y,x,T,R,V,Z,ge,de,ve)=>{i.Ea(\"Resize\",u,{antialias:p,axes:y?Array.from(n().subarray(y>>>0,x>>>0)):[],coordinateTransformMode:Ke(T),cubicCoeffA:R,excludeOutside:V,extrapolationValue:Z,keepAspectRatioPolicy:Ke(ge),mode:Ke(de),nearestMode:Ke(ve)})},942470:(u,p,y,x,T,R,V)=>{i.Ea(\"Slice\",u,{starts:p?Array.from(n().subarray(p>>>0,y>>>0)):[],ends:x?Array.from(n().subarray(x>>>0,T>>>0)):[],axes:R?Array.from(n().subarray(R>>>0,V>>>0)):[]})},942686:u=>{i.Ea(\"Tile\",u,void 0)},942738:(u,p,y)=>{i.Ea(\"LayerNormalization\",u,{axis:Number(p),epsilon:Number(y)})},942845:(u,p,y)=>{i.Ea(\"InstanceNormalization\",u,{epsilon:p,format:y?\"NHWC\":\"NCHW\"})},942959:(u,p,y)=>{i.Ea(\"InstanceNormalization\",u,{epsilon:p,format:y?\"NHWC\":\"NCHW\"})},943073:u=>{i.Ea(\"Range\",u,void 0)},943126:(u,p)=>{i.Ea(\"Einsum\",u,{equation:Ke(p)})},943207:(u,p,y,x,T)=>{i.Ea(\"Pad\",u,{mode:p,value:y,pads:x?Array.from(n().subarray(x>>>0,T>>>0)):[]})},943334:(u,p,y,x,T,R)=>{i.Ea(\"BatchNormalization\",u,{epsilon:p,momentum:y,spatial:!!T,trainingMode:!!x,format:R?\"NHWC\":\"NCHW\"})},943503:(u,p,y,x,T,R)=>{i.Ea(\"BatchNormalization\",u,{epsilon:p,momentum:y,spatial:!!T,trainingMode:!!x,format:R?\"NHWC\":\"NCHW\"})},943672:(u,p,y)=>{i.Ea(\"CumSum\",u,{exclusive:Number(p),reverse:Number(y)})},943769:(u,p,y,x,T,R,V,Z,ge)=>{i.Ea(\"Attention\",u,{numHeads:p,isUnidirectional:y,maskFilterValue:x,scale:T,doRotary:R,qkvHiddenSizes:V?Array.from(n().subarray(Number(Z)>>>0,Number(Z)+V>>>0)):[],pastPresentShareBuffer:!!ge})},944041:u=>{i.Ea(\"BiasAdd\",u,void 0)},944096:u=>{i.Ea(\"BiasSplitGelu\",u,void 0)},944157:u=>{i.Ea(\"FastGelu\",u,void 0)},944213:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We)=>{i.Ea(\"Conv\",u,{format:ge?\"NHWC\":\"NCHW\",auto_pad:p,dilations:[y],group:x,kernel_shape:[T],pads:R?Array.from(n().subarray(R>>>0,V>>>0)):[],strides:[Z],w_is_const:()=>!!r()[de>>>0],activation:Ke(ve),activation_params:Ne?Array.from(s().subarray(Ne>>>0,We>>>0)):[]})},944583:(u,p,y,x,T,R,V,Z,ge,de,ve,Ne,We,B,ce,Te)=>{i.Ea(\"Conv\",u,{format:Ne?\"NHWC\":\"NCHW\",auto_pad:p,dilations:[y,x],group:T,kernel_shape:[R,V],pads:Z?Array.from(n().subarray(Z>>>0,ge>>>0)):[],strides:[de,ve],w_is_const:()=>!!r()[We>>>0],activation:Ke(B),activation_params:ce?Array.from(s().subarray(ce>>>0,Te>>>0)):[]})},944974:u=>{i.Ea(\"Gelu\",u,void 0)},945026:(u,p,y,x,T,R)=>{i.Ea(\"MatMulNBits\",u,{k:p,n:y,accuracyLevel:x,bits:T,blockSize:R})},945153:(u,p,y,x,T,R)=>{i.Ea(\"MultiHeadAttention\",u,{numHeads:p,isUnidirectional:y,maskFilterValue:x,scale:T,doRotary:R})},945312:(u,p)=>{i.Ea(\"SkipLayerNormalization\",u,{epsilon:p})},945393:u=>{i.Cb(u)},945427:(u,p)=>i.Eb(u,p,i.bb.Gb,i.bb.errors)};function Xt(u){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${u})`,this.status=u}var Nt=u=>{u.terminate(),u.onmessage=()=>{}},lr=u=>{te.Ya.length==0&&(ft(),te.mb(te.Ya[0]));var p=te.Ya.pop();if(!p)return 6;te.Za.push(p),te.Qa[u.Xa]=p,p.Xa=u.Xa;var y={cmd:\"run\",start_routine:u.Hb,arg:u.ub,pthread_ptr:u.Xa};return S&&p.unref(),p.postMessage(y,u.Nb),0},pt=0,dr=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,Qt=(u,p,y)=>{p>>>=0;var x=p+y;for(y=p;u[y]&&!(y>=x);)++y;if(16T?x+=String.fromCharCode(T):(T-=65536,x+=String.fromCharCode(55296|T>>10,56320|T&1023))}}else x+=String.fromCharCode(T)}return x},Ke=(u,p)=>(u>>>=0)?Qt(a(),u,p):\"\",zr=u=>{var p=Hn();return u=u(),Kr(p),u};function Re(u,p){var y=arguments.length-2,x=arguments;return zr(()=>{for(var T=Ln(8*y),R=T>>>3,V=0;V>>0]=Z}return Ka(u,y,T,p)})}function Br(u){if(v)return Re(0,1,u);xe=u,0{if(xe=u,v)throw cr(u),\"unwind\";Br(u)},Pt=u=>{u instanceof Xt||u==\"unwind\"||b(1,u)};function Un(){for(var u=i.numThreads;u--;)ft();Se.unshift(()=>{Fe++,ut(()=>qe())})}function ft(){var u=A(\"ort-wasm-simd-threaded.worker.js\");u=new Worker(u),te.Ya.push(u)}function ut(u){v?u():Promise.all(te.Ya.map(te.mb)).then(u)}var te={Ya:[],Za:[],qb:[],Qa:{},hb(){v?(te.receiveObjectTransfer=te.Fb,te.threadInitTLS=te.pb,te.setExitStatus=te.ob):Un()},ob:u=>xe=u,Qb:[\"$terminateWorker\"],Ib:()=>{for(var u of te.Za)Nt(u);for(u of te.Ya)Nt(u);te.Ya=[],te.Za=[],te.Qa=[]},nb:u=>{var p=u.Xa;delete te.Qa[p],te.Ya.push(u),te.Za.splice(te.Za.indexOf(u),1),u.Xa=0,Vn(p)},Fb(){},pb(){te.qb.forEach(u=>u())},mb:u=>new Promise(p=>{u.onmessage=R=>{R=R.data;var V=R.cmd;if(R.targetThread&&R.targetThread!=jr()){var Z=te.Qa[R.targetThread];Z?Z.postMessage(R,R.transferList):we(`Internal error! Worker sent a message \"${V}\" to target pthread ${R.targetThread}, but that thread no longer exists!`)}else V===\"checkMailbox\"?Wt():V===\"spawnThread\"?lr(R):V===\"cleanupThread\"?te.nb(te.Qa[R.thread]):V===\"killThread\"?(R=R.thread,V=te.Qa[R],delete te.Qa[R],Nt(V),Vn(R),te.Za.splice(te.Za.indexOf(V),1),V.Xa=0):V===\"cancelThread\"?te.Qa[R.thread].postMessage({cmd:\"cancel\"}):V===\"loaded\"?(u.loaded=!0,S&&!u.Xa&&u.unref(),p(u)):V===\"alert\"?alert(`Thread ${R.threadId}: ${R.text}`):R.target===\"setimmediate\"?u.postMessage(R):V===\"callHandler\"?i[R.handler](...R.args):V&&we(`worker sent an unknown command ${V}`)},u.onerror=R=>{throw we(`worker sent an error! ${R.filename}:${R.lineno}: ${R.message}`),R},S&&(u.on(\"message\",R=>u.onmessage({data:R})),u.on(\"error\",R=>u.onerror(R)));var y=[],x=[\"onExit\"],T;for(T of x)i.hasOwnProperty(T)&&y.push(T);u.postMessage({cmd:\"load\",handlers:y,urlOrBlob:i.mainScriptUrlOrBlob||e,wasmMemory:ne,wasmModule:Ue})})};i.PThread=te;var Tt=u=>{for(;0{var u=jr(),p=o()[u+52>>>2>>>0];u=o()[u+56>>>2>>>0],Xa(p,p-u),Kr(p)};function cr(u){if(v)return Re(1,0,u);Jt(u)}i.invokeEntryPoint=(u,p)=>{u=Qa.apply(null,[u,p]),0>>2>>>0]=p},this.sb=function(p){o()[this.gb+8>>>2>>>0]=p},this.hb=function(p,y){this.rb(),this.tb(p),this.sb(y)},this.rb=function(){o()[this.gb+16>>>2>>>0]=0}}var Mr=0,pr=0;function Ur(u,p,y,x){return v?Re(2,1,u,p,y,x):Nr(u,p,y,x)}function Nr(u,p,y,x){if(u>>>=0,p>>>=0,y>>>=0,x>>>=0,typeof SharedArrayBuffer>\"u\")return we(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var T=[];return v&&T.length===0?Ur(u,p,y,x):(u={Hb:y,Xa:u,ub:x,Nb:T},v?(u.Pb=\"spawnThread\",postMessage(u,T),0):lr(u))}function Wr(u,p,y){return v?Re(3,1,u,p,y):0}function Vr(u,p){if(v)return Re(4,1,u,p)}var fr=u=>{for(var p=0,y=0;y=x?p++:2047>=x?p+=2:55296<=x&&57343>=x?(p+=4,++y):p+=3}return p},Gr=(u,p,y,x)=>{if(y>>>=0,!(0=V){var Z=u.charCodeAt(++R);V=65536+((V&1023)<<10)|Z&1023}if(127>=V){if(y>=x)break;p[y++>>>0]=V}else{if(2047>=V){if(y+1>=x)break;p[y++>>>0]=192|V>>6}else{if(65535>=V){if(y+2>=x)break;p[y++>>>0]=224|V>>12}else{if(y+3>=x)break;p[y++>>>0]=240|V>>18,p[y++>>>0]=128|V>>12&63}p[y++>>>0]=128|V>>6&63}p[y++>>>0]=128|V&63}}return p[y>>>0]=0,y-T},ee=(u,p,y)=>Gr(u,a(),p,y);function mr(u,p){if(v)return Re(5,1,u,p)}function er(u,p,y){if(v)return Re(6,1,u,p,y)}function hr(u,p,y){return v?Re(7,1,u,p,y):0}function gr(u,p){if(v)return Re(8,1,u,p)}function yr(u,p,y){if(v)return Re(9,1,u,p,y)}function br(u,p,y,x){if(v)return Re(10,1,u,p,y,x)}function wr(u,p,y,x){if(v)return Re(11,1,u,p,y,x)}function vr(u,p,y,x){if(v)return Re(12,1,u,p,y,x)}function $r(u){if(v)return Re(13,1,u)}function _r(u,p){if(v)return Re(14,1,u,p)}function xr(u,p,y){if(v)return Re(15,1,u,p,y)}var Hr=()=>{if(!(0>>=0,typeof Atomics.Ob==\"function\"&&(Atomics.Ob(n(),u>>>2,u).value.then(Wt),u+=128,Atomics.store(n(),u>>>2,1))}i.__emscripten_thread_mailbox_await=Rt;var Wt=()=>{var u=jr();if(u&&(Rt(u),!X))try{Ya(),Hr()}catch(p){Pt(p)}};i.checkMailbox=Wt;var d=[],g=u=>u%4===0&&(u%100!==0||u%400===0),_=[0,31,60,91,121,152,182,213,244,274,305,335],C=[0,31,59,90,120,151,181,212,243,273,304,334];function O(u,p,y,x,T,R,V,Z){return v?Re(16,1,u,p,y,x,T,R,V,Z):-52}function W(u,p,y,x,T,R,V){if(v)return Re(17,1,u,p,y,x,T,R,V)}var j=u=>{var p=fr(u)+1,y=Wn(p);return y&&ee(u,y,p),y},Q=[],oe=(u,p)=>{Q.length=0;for(var y;y=a()[u++>>>0];){var x=y!=105;x&=y!=112,p+=x&&p%8?4:0,Q.push(y==112?o()[p>>>2>>>0]:y==105?n()[p>>>2>>>0]:l()[p>>>3>>>0]),p+=x?8:4}return Q},le={},me=()=>{if(!Pe){var u={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:w||\"./this.program\"},p;for(p in le)le[p]===void 0?delete u[p]:u[p]=le[p];var y=[];for(p in u)y.push(`${p}=${u[p]}`);Pe=y}return Pe},Pe;function ze(u,p){if(v)return Re(18,1,u,p);u>>>=0,p>>>=0;var y=0;return me().forEach((x,T)=>{var R=p+y;for(T=o()[u+4*T>>>2>>>0]=R,R=0;R>>0>>>0]=x.charCodeAt(R);r()[T>>>0>>>0]=0,y+=x.length+1}),0}function P(u,p){if(v)return Re(19,1,u,p);u>>>=0,p>>>=0;var y=me();o()[u>>>2>>>0]=y.length;var x=0;return y.forEach(T=>x+=T.length+1),o()[p>>>2>>>0]=x,0}function ae(u){return v?Re(20,1,u):52}function Ce(u,p,y,x){return v?Re(21,1,u,p,y,x):52}function bt(u,p,y,x,T){return v?Re(22,1,u,p,y,x,T):70}var Lr=[null,[],[]];function Ua(u,p,y,x){if(v)return Re(23,1,u,p,y,x);p>>>=0,y>>>=0,x>>>=0;for(var T=0,R=0;R>>2>>>0],Z=o()[p+4>>>2>>>0];p+=8;for(var ge=0;ge>>0],ve=Lr[u];de===0||de===10?((u===1?Ie:we)(Qt(ve,0)),ve.length=0):ve.push(de)}T+=Z}return o()[x>>>2>>>0]=T,0}var Na=[31,29,31,30,31,30,31,31,30,31,30,31],Wa=[31,28,31,30,31,30,31,31,30,31,30,31];function Zl(u){var p=Array(fr(u)+1);return Gr(u,p,0,p.length),p}var Xl=(u,p)=>{r().set(u,p>>>0)};function Va(u,p,y,x){function T(B,ce,Te){for(B=typeof B==\"number\"?B.toString():B||\"\";B.lengthai?-1:0Vt-B.getDate())ce-=Vt-B.getDate()+1,B.setDate(1),11>Te?B.setMonth(Te+1):(B.setMonth(0),B.setFullYear(B.getFullYear()+1));else{B.setDate(B.getDate()+ce);break}}return Te=new Date(B.getFullYear()+1,0,4),ce=Z(new Date(B.getFullYear(),0,4)),Te=Z(Te),0>=V(ce,B)?0>=V(Te,B)?B.getFullYear()+1:B.getFullYear():B.getFullYear()-1}u>>>=0,p>>>=0,y>>>=0,x>>>=0;var de=o()[x+40>>>2>>>0];x={Lb:n()[x>>>2>>>0],Kb:n()[x+4>>>2>>>0],eb:n()[x+8>>>2>>>0],jb:n()[x+12>>>2>>>0],fb:n()[x+16>>>2>>>0],ab:n()[x+20>>>2>>>0],Wa:n()[x+24>>>2>>>0],$a:n()[x+28>>>2>>>0],Rb:n()[x+32>>>2>>>0],Jb:n()[x+36>>>2>>>0],Mb:de?Ke(de):\"\"},y=Ke(y),de={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var ve in de)y=y.replace(new RegExp(ve,\"g\"),de[ve]);var Ne=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),We=\"January February March April May June July August September October November December\".split(\" \");de={\"%a\":B=>Ne[B.Wa].substring(0,3),\"%A\":B=>Ne[B.Wa],\"%b\":B=>We[B.fb].substring(0,3),\"%B\":B=>We[B.fb],\"%C\":B=>R((B.ab+1900)/100|0,2),\"%d\":B=>R(B.jb,2),\"%e\":B=>T(B.jb,2,\" \"),\"%g\":B=>ge(B).toString().substring(2),\"%G\":B=>ge(B),\"%H\":B=>R(B.eb,2),\"%I\":B=>(B=B.eb,B==0?B=12:12{for(var ce=0,Te=0;Te<=B.fb-1;ce+=(g(B.ab+1900)?Na:Wa)[Te++]);return R(B.jb+ce,3)},\"%m\":B=>R(B.fb+1,2),\"%M\":B=>R(B.Kb,2),\"%n\":()=>`\n`,\"%p\":B=>0<=B.eb&&12>B.eb?\"AM\":\"PM\",\"%S\":B=>R(B.Lb,2),\"%t\":()=>\"\t\",\"%u\":B=>B.Wa||7,\"%U\":B=>R(Math.floor((B.$a+7-B.Wa)/7),2),\"%V\":B=>{var ce=Math.floor((B.$a+7-(B.Wa+6)%7)/7);if(2>=(B.Wa+371-B.$a-2)%7&&ce++,ce)ce==53&&(Te=(B.Wa+371-B.$a)%7,Te==4||Te==3&&g(B.ab)||(ce=1));else{ce=52;var Te=(B.Wa+7-B.$a-1)%7;(Te==4||Te==5&&g(B.ab%400-1))&&ce++}return R(ce,2)},\"%w\":B=>B.Wa,\"%W\":B=>R(Math.floor((B.$a+7-(B.Wa+6)%7)/7),2),\"%y\":B=>(B.ab+1900).toString().substring(2),\"%Y\":B=>B.ab+1900,\"%z\":B=>{B=B.Jb;var ce=0<=B;return B=Math.abs(B)/60,(ce?\"+\":\"-\")+(\"0000\"+(B/60*100+B%60)).slice(-4)},\"%Z\":B=>B.Mb,\"%%\":()=>\"%\"},y=y.replace(/%%/g,\"\\0\\0\");for(ve in de)y.includes(ve)&&(y=y.replace(new RegExp(ve,\"g\"),de[ve](x)));return y=y.replace(/\\0\\0/g,\"%\"),ve=Zl(y),ve.length>p?0:(Xl(ve,u),ve.length-1)}var Fr=u=>{try{u()}catch(p){tt(p)}};function Ql(){var u=Y,p={};for(let[y,x]of Object.entries(u))p[y]=typeof x==\"function\"?function(){qr.push(y);try{return x.apply(null,arguments)}finally{X||(qr.pop(),wt&&zt===1&&qr.length===0&&(zt=0,pt+=1,Fr(ei),typeof Fibers<\"u\"&&Fibers.Sb()))}}:x;return p}var zt=0,wt=null,Ga=0,qr=[],Ha={},La={},Jl=0,Nn=null,ed=[];function td(){return new Promise((u,p)=>{Nn={resolve:u,reject:p}})}function rd(){var u=Wn(65548),p=u+12;o()[u>>>2>>>0]=p,o()[u+4>>>2>>>0]=p+65536,p=qr[0];var y=Ha[p];return y===void 0&&(y=Jl++,Ha[p]=y,La[y]=p),p=y,n()[u+8>>>2>>>0]=p,u}function nd(){var u=n()[wt+8>>>2>>>0];return u=Y[La[u]],--pt,u()}function ad(u){if(!X){if(zt===0){var p=!1,y=!1;u((x=0)=>{if(!X&&(Ga=x,p=!0,y)){zt=2,Fr(()=>ti(wt)),typeof Browser<\"u\"&&Browser.ib.wb&&Browser.ib.resume(),x=!1;try{var T=nd()}catch(Z){T=Z,x=!0}var R=!1;if(!wt){var V=Nn;V&&(Nn=null,(x?V.reject:V.resolve)(T),R=!0)}if(x&&!R)throw T}}),y=!0,p||(zt=1,wt=rd(),typeof Browser<\"u\"&&Browser.ib.wb&&Browser.ib.pause(),Fr(()=>Ja(wt)))}else zt===2?(zt=0,Fr(ri),qa(wt),wt=null,ed.forEach(x=>{if(!X)try{x(),Hr()}catch(T){Pt(T)}})):tt(`invalid state: ${zt}`);return Ga}}function id(u){return ad(p=>{u().then(p)})}te.hb();var od=[Br,cr,Ur,Wr,Vr,mr,er,hr,gr,yr,br,wr,vr,$r,_r,xr,O,W,ze,P,ae,Ce,bt,Ua],sd={r:function(u,p,y){return id(async()=>{await i.Ab(u,p,y)})},b:function(u,p,y){throw u>>>=0,new Dr(u).hb(p>>>0,y>>>0),Mr=u,pr++,Mr},N:function(u){ja(u>>>0,!I,1,!$,131072,!1),te.pb()},l:function(u){u>>>=0,v?postMessage({cmd:\"cleanupThread\",thread:u}):te.nb(te.Qa[u])},J:Nr,i:Wr,T:Vr,F:mr,H:er,U:hr,R:gr,L:yr,Q:br,p:wr,G:vr,D:$r,S:_r,E:xr,q:()=>1,B:function(u,p){u>>>=0,u==p>>>0?setTimeout(()=>Wt()):v?postMessage({targetThread:u,cmd:\"checkMailbox\"}):(u=te.Qa[u])&&u.postMessage({cmd:\"checkMailbox\"})},K:function(u,p,y,x){p>>>=0,d.length=y,x=x>>>0>>>3;for(var T=0;T>>0];return u=0>u?Zt[-u-1]:od[u],te.vb=p,p=u.apply(null,d),te.vb=0,p},M:Rt,W:function(u){S&&te.Qa[u>>>0].ref()},u:function(u,p,y){u=p+2097152>>>0<4194305-!!u?(u>>>0)+4294967296*p:NaN,y>>>=0,u=new Date(1e3*u),n()[y>>>2>>>0]=u.getUTCSeconds(),n()[y+4>>>2>>>0]=u.getUTCMinutes(),n()[y+8>>>2>>>0]=u.getUTCHours(),n()[y+12>>>2>>>0]=u.getUTCDate(),n()[y+16>>>2>>>0]=u.getUTCMonth(),n()[y+20>>>2>>>0]=u.getUTCFullYear()-1900,n()[y+24>>>2>>>0]=u.getUTCDay(),u=(u.getTime()-Date.UTC(u.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,n()[y+28>>>2>>>0]=u},v:function(u,p,y){u=p+2097152>>>0<4194305-!!u?(u>>>0)+4294967296*p:NaN,y>>>=0,u=new Date(1e3*u),n()[y>>>2>>>0]=u.getSeconds(),n()[y+4>>>2>>>0]=u.getMinutes(),n()[y+8>>>2>>>0]=u.getHours(),n()[y+12>>>2>>>0]=u.getDate(),n()[y+16>>>2>>>0]=u.getMonth(),n()[y+20>>>2>>>0]=u.getFullYear()-1900,n()[y+24>>>2>>>0]=u.getDay(),p=(g(u.getFullYear())?_:C)[u.getMonth()]+u.getDate()-1|0,n()[y+28>>>2>>>0]=p,n()[y+36>>>2>>>0]=-(60*u.getTimezoneOffset()),p=new Date(u.getFullYear(),6,1).getTimezoneOffset();var x=new Date(u.getFullYear(),0,1).getTimezoneOffset();u=(p!=x&&u.getTimezoneOffset()==Math.min(x,p))|0,n()[y+32>>>2>>>0]=u},w:function(u){u>>>=0;var p=new Date(n()[u+20>>>2>>>0]+1900,n()[u+16>>>2>>>0],n()[u+12>>>2>>>0],n()[u+8>>>2>>>0],n()[u+4>>>2>>>0],n()[u>>>2>>>0],0),y=n()[u+32>>>2>>>0],x=p.getTimezoneOffset(),T=new Date(p.getFullYear(),6,1).getTimezoneOffset(),R=new Date(p.getFullYear(),0,1).getTimezoneOffset(),V=Math.min(R,T);return 0>y?n()[u+32>>>2>>>0]=+(T!=R&&V==x):0>>2>>>0]=p.getDay(),y=(g(p.getFullYear())?_:C)[p.getMonth()]+p.getDate()-1|0,n()[u+28>>>2>>>0]=y,n()[u>>>2>>>0]=p.getSeconds(),n()[u+4>>>2>>>0]=p.getMinutes(),n()[u+8>>>2>>>0]=p.getHours(),n()[u+12>>>2>>>0]=p.getDate(),n()[u+16>>>2>>>0]=p.getMonth(),n()[u+20>>>2>>>0]=p.getYear(),u=p.getTime(),isNaN(u)?(n()[Fa()>>>2>>>0]=61,u=-1):u/=1e3,Za((At=u,1<=+Math.abs(At)?0>>0:~~+Math.ceil((At-+(~~At>>>0))/4294967296)>>>0:0)),u>>>0},s:O,t:W,A:function(u,p,y){function x(de){return(de=de.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?de[1]:\"GMT\"}u>>>=0,p>>>=0,y>>>=0;var T=new Date().getFullYear(),R=new Date(T,0,1),V=new Date(T,6,1);T=R.getTimezoneOffset();var Z=V.getTimezoneOffset(),ge=Math.max(T,Z);o()[u>>>2>>>0]=60*ge,n()[p>>>2>>>0]=+(T!=Z),u=x(R),p=x(V),u=j(u),p=j(p),Z>>2>>>0]=u,o()[y+4>>>2>>>0]=p):(o()[y>>>2>>>0]=p,o()[y+4>>>2>>>0]=u)},d:()=>{tt(\"\")},c:function(u,p,y){return u>>>=0,p=oe(p>>>0,y>>>0),Zt[u].apply(null,p)},k:function(u,p,y){return u>>>=0,p=oe(p>>>0,y>>>0),Zt[u].apply(null,p)},m:()=>{},j:()=>Date.now(),V:()=>{throw pt+=1,\"unwind\"},C:function(){return 4294901760},f:()=>performance.timeOrigin+performance.now(),g:()=>S?(Vi(),Gt(Wi)).cpus().length:navigator.hardwareConcurrency,y:function(u){u>>>=0;var p=a().length;if(u<=p||4294901760=y;y*=2){var x=p*(1+.2/y);x=Math.min(x,u+100663296);var T=Math;x=Math.max(u,x);e:{T=(T.min.call(T,4294901760,x+(65536-x%65536)%65536)-ne.buffer.byteLength+65535)/65536;try{ne.grow(T),G();var R=1;break e}catch{}R=void 0}if(R)return!0}return!1},O:ze,P,I:Jt,h:ae,o:Ce,x:bt,n:Ua,a:ne||i.wasmMemory,z:Va,e:function(u,p,y,x){return Va(u>>>0,p>>>0,y>>>0,x>>>0)}},Y=function(){function u(y,x){return Y=y.exports,Y=Ql(),Y=ud(),te.qb.push(Y.Da),Je.unshift(Y.X),Ue=x,qe(),Y}var p={a:sd};if(Fe++,i.instantiateWasm)try{return i.instantiateWasm(p,u)}catch(y){we(`Module.instantiateWasm callback failed with error: ${y}`),f(y)}return kt(p,function(y){u(y.instance,y.module)}).catch(f),{}}();i._OrtInit=(u,p)=>(i._OrtInit=Y.Y)(u,p),i._OrtGetLastError=(u,p)=>(i._OrtGetLastError=Y.Z)(u,p),i._OrtCreateSessionOptions=(u,p,y,x,T,R,V,Z,ge,de)=>(i._OrtCreateSessionOptions=Y._)(u,p,y,x,T,R,V,Z,ge,de),i._OrtAppendExecutionProvider=(u,p)=>(i._OrtAppendExecutionProvider=Y.$)(u,p),i._OrtAddFreeDimensionOverride=(u,p,y)=>(i._OrtAddFreeDimensionOverride=Y.aa)(u,p,y),i._OrtAddSessionConfigEntry=(u,p,y)=>(i._OrtAddSessionConfigEntry=Y.ba)(u,p,y),i._OrtReleaseSessionOptions=u=>(i._OrtReleaseSessionOptions=Y.ca)(u),i._OrtCreateSession=(u,p,y)=>(i._OrtCreateSession=Y.da)(u,p,y),i._OrtReleaseSession=u=>(i._OrtReleaseSession=Y.ea)(u),i._OrtGetInputOutputCount=(u,p,y)=>(i._OrtGetInputOutputCount=Y.fa)(u,p,y),i._OrtGetInputName=(u,p)=>(i._OrtGetInputName=Y.ga)(u,p),i._OrtGetOutputName=(u,p)=>(i._OrtGetOutputName=Y.ha)(u,p),i._OrtFree=u=>(i._OrtFree=Y.ia)(u),i._OrtCreateTensor=(u,p,y,x,T,R)=>(i._OrtCreateTensor=Y.ja)(u,p,y,x,T,R),i._OrtGetTensorData=(u,p,y,x,T)=>(i._OrtGetTensorData=Y.ka)(u,p,y,x,T),i._OrtReleaseTensor=u=>(i._OrtReleaseTensor=Y.la)(u),i._OrtCreateRunOptions=(u,p,y,x)=>(i._OrtCreateRunOptions=Y.ma)(u,p,y,x),i._OrtAddRunConfigEntry=(u,p,y)=>(i._OrtAddRunConfigEntry=Y.na)(u,p,y),i._OrtReleaseRunOptions=u=>(i._OrtReleaseRunOptions=Y.oa)(u),i._OrtCreateBinding=u=>(i._OrtCreateBinding=Y.pa)(u),i._OrtBindInput=(u,p,y)=>(i._OrtBindInput=Y.qa)(u,p,y),i._OrtBindOutput=(u,p,y,x)=>(i._OrtBindOutput=Y.ra)(u,p,y,x),i._OrtClearBoundOutputs=u=>(i._OrtClearBoundOutputs=Y.sa)(u),i._OrtReleaseBinding=u=>(i._OrtReleaseBinding=Y.ta)(u),i._OrtRunWithBinding=(u,p,y,x,T)=>(i._OrtRunWithBinding=Y.ua)(u,p,y,x,T),i._OrtRun=(u,p,y,x,T,R,V,Z)=>(i._OrtRun=Y.va)(u,p,y,x,T,R,V,Z),i._OrtEndProfiling=u=>(i._OrtEndProfiling=Y.wa)(u),i._JsepOutput=(u,p,y)=>(i._JsepOutput=Y.xa)(u,p,y),i._JsepGetNodeName=u=>(i._JsepGetNodeName=Y.ya)(u);var Fa=()=>(Fa=Y.za)(),jr=i._pthread_self=()=>(jr=i._pthread_self=Y.Aa)(),Wn=i._malloc=u=>(Wn=i._malloc=Y.Ba)(u),qa=i._free=u=>(qa=i._free=Y.Ca)(u);i.__emscripten_tls_init=()=>(i.__emscripten_tls_init=Y.Da)();var ja=i.__emscripten_thread_init=(u,p,y,x,T,R)=>(ja=i.__emscripten_thread_init=Y.Fa)(u,p,y,x,T,R);i.__emscripten_thread_crashed=()=>(i.__emscripten_thread_crashed=Y.Ga)();var Ka=(u,p,y,x)=>(Ka=Y.Ha)(u,p,y,x),Vn=u=>(Vn=Y.Ia)(u),Gn=i.__emscripten_thread_exit=u=>(Gn=i.__emscripten_thread_exit=Y.Ja)(u),Ya=()=>(Ya=Y.Ka)(),Za=u=>(Za=Y.La)(u),Xa=(u,p)=>(Xa=Y.Ma)(u,p),Hn=()=>(Hn=Y.Na)(),Kr=u=>(Kr=Y.Oa)(u),Ln=u=>(Ln=Y.Pa)(u),Qa=i.dynCall_ii=(u,p)=>(Qa=i.dynCall_ii=Y.Ra)(u,p),Ja=u=>(Ja=Y.Sa)(u),ei=()=>(ei=Y.Ta)(),ti=u=>(ti=Y.Ua)(u),ri=()=>(ri=Y.Va)();i.___start_em_js=945539,i.___stop_em_js=945700;function ud(){var u=Y;u=Object.assign({},u);var p=x=>()=>x()>>>0,y=x=>T=>x(T)>>>0;return u.za=p(u.za),u.Aa=p(u.Aa),u.Ba=y(u.Ba),u.emscripten_main_runtime_thread_id=p(u.emscripten_main_runtime_thread_id),u.Na=p(u.Na),u.Pa=y(u.Pa),u}i.wasmMemory=ne,i.stackAlloc=Ln,i.stackSave=Hn,i.stackRestore=Kr,i.keepRuntimeAlive=()=>0Gi)});var Fi=tr((fm,$d)=>{$d.exports='\"use strict\";var Module={},ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\"),parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",e=>onmessage({data:e}));var fs=require(\"fs\"),vm=require(\"vm\");Object.assign(global,{self:global,require,Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:e=>vm.runInThisContext(fs.readFileSync(e,\"utf8\"),{filename:e}),postMessage:e=>parentPort.postMessage(e),performance:global.performance||{now:Date.now}})}var initializedJS=!1;function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,e+`\\n`);return}console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:e,threadId:Module._pthread_self()})}var err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(e,t)=>{var a=Module.wasmModule;Module.wasmModule=null;var r=new WebAssembly.Instance(a,e);return t(r)},self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{if(e.data.cmd===\"load\"){let a=[];self.onmessage=r=>a.push(r),self.startWorker=r=>{Module=r,postMessage({cmd:\"loaded\"});for(let s of a)handleMessage(s);self.onmessage=handleMessage},Module.wasmModule=e.data.wasmModule;for(const r of e.data.handlers)Module[r]=(...s)=>{postMessage({cmd:\"callHandler\",handler:r,args:s})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,typeof e.data.urlOrBlob==\"string\")importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}ortWasmThreaded(Module)}else if(e.data.cmd===\"run\"){Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.__emscripten_thread_mailbox_await(e.data.pthread_ptr),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(a){if(a!=\"unwind\")throw a}}else e.data.cmd===\"cancel\"?Module._pthread_self()&&Module.__emscripten_thread_exit(-1):e.data.target===\"setimmediate\"||(e.data.cmd===\"checkMailbox\"?initializedJS&&Module.checkMailbox():e.data.cmd&&(err(`worker.js received unknown command ${e.data.cmd}`),err(e.data)))}catch(a){throw Module.__emscripten_thread_crashed?.(),a}}self.onmessage=handleMessage;\\n'});var ji,_d,ra,na,an,qi,xd,Sd,Cd,Ki,Ge,nr=F(()=>{\"use strict\";ji=Mi();_d=Li(),na=!1,an=!1,qi=!1,xd=e=>{if(e===1)return!1;if(typeof SharedArrayBuffer>\"u\")return typeof self<\"u\"&&!self.crossOriginIsolated&&console.warn(\"env.wasm.numThreads is set to \"+e+\", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.\"),!1;typeof process<\"u\"&&process.versions&&process.versions.node&&console.warn(\"env.wasm.numThreads is set to \"+e+\", however, currently onnxruntime-web does not support multi-threads in Node.js. Please consider using onnxruntime-node for performance critical scenarios.\");try{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]))}catch{return!1}},Sd=()=>{try{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]))}catch{return!1}},Cd=(e,t)=>e?t?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-simd.wasm\":t?\"ort-wasm-threaded.wasm\":\"ort-wasm.wasm\",Ki=async e=>{if(na)return Promise.resolve();if(an)throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");if(qi)throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");an=!0;let t=e.initTimeout,r=e.numThreads,a=e.simd,n=xd(r),o=a&&Sd(),s=e.wasmPaths,l=typeof s==\"string\"?s:void 0,i=Cd(o,n),c=typeof s==\"object\"?s[i]:void 0,f=!1,m=[];if(t>0&&m.push(new Promise(h=>{setTimeout(()=>{f=!0,h()},t)})),m.push(new Promise((h,w)=>{let b=n?_d:ji,$={locateFile:(I,S)=>{if(n&&I.endsWith(\".worker.js\")&&typeof Blob<\"u\")return URL.createObjectURL(new Blob([Fi()],{type:\"text/javascript\"}));if(I.endsWith(\".wasm\")){if(c)return c;let v=l??S;return i===\"ort-wasm-simd.wasm\"?v+\"ort-wasm-simd.jsep.wasm\":i===\"ort-wasm-simd-threaded.wasm\"?v+\"ort-wasm-simd-threaded.jsep.wasm\":v+i}return S+I}};if(n)if($.numThreads=r,typeof Blob>\"u\")$.mainScriptUrlOrBlob=(void 0)(__dirname,\"ort-wasm-threaded.js\");else{let I=`var ortWasmThreaded=${b.toString()};`;$.mainScriptUrlOrBlob=new Blob([I],{type:\"text/javascript\"})}b($).then(I=>{an=!1,na=!0,ra=I,h()},I=>{an=!1,qi=!0,w(I)})})),await Promise.race(m),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},Ge=()=>{if(na&&ra)return ra;throw new Error(\"WebAssembly is not initialized yet.\")}});var He,Cr,Be,on=F(()=>{\"use strict\";nr();He=(e,t)=>{let r=Ge(),a=r.lengthBytesUTF8(e)+1,n=r._malloc(a);return r.stringToUTF8(e,n,a),t.push(n),n},Cr=(e,t,r,a)=>{if(typeof e==\"object\"&&e!==null){if(r.has(e))throw new Error(\"Circular reference in options\");r.add(e)}Object.entries(e).forEach(([n,o])=>{let s=t?t+n:n;if(typeof o==\"object\")Cr(o,s+\".\",r,a);else if(typeof o==\"string\"||typeof o==\"number\")a(s,o.toString());else if(typeof o==\"boolean\")a(s,o?\"1\":\"0\");else throw new Error(`Can't handle extra config type: ${typeof o}`)})},Be=e=>{let t=Ge(),r=t.stackSave();try{let a=t.stackAlloc(8);t._OrtGetLastError(a,a+4);let n=t.HEAP32[a/4],o=t.HEAPU32[a/4+1],s=o?t.UTF8ToString(o):\"\";throw new Error(`${e} ERROR_CODE: ${n}, ERROR_MESSAGE: ${s}`)}finally{t.stackRestore(r)}}});var Yi,Zi=F(()=>{\"use strict\";nr();on();Yi=e=>{let t=Ge(),r=0,a=[],n=e||{};try{if(e?.logSeverityLevel===void 0)n.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=\"number\"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)n.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=\"number\"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(n.terminate=!1);let o=0;return e?.tag!==void 0&&(o=He(e.tag,a)),r=t._OrtCreateRunOptions(n.logSeverityLevel,n.logVerbosityLevel,!!n.terminate,o),r===0&&Be(\"Can't create run options.\"),e?.extra!==void 0&&Cr(e.extra,\"\",new WeakSet,(s,l)=>{let i=He(s,a),c=He(l,a);t._OrtAddRunConfigEntry(r,i,c)!==0&&Be(`Can't set a run config entry: ${s} - ${l}.`)}),[r,a]}catch(o){throw r!==0&&t._OrtReleaseRunOptions(r),a.forEach(s=>t._free(s)),o}}});var Id,Ed,Ad,Td,Xi,Qi=F(()=>{\"use strict\";nr();on();Id=e=>{switch(e){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},Ed=e=>{switch(e){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},Ad=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly=\"1\"),e.executionProviders&&e.executionProviders.some(r=>(typeof r==\"string\"?r:r.name)===\"webgpu\")&&(e.enableMemPattern=!1)},Td=(e,t,r)=>{for(let a of t){let n=typeof a==\"string\"?a:a.name;switch(n){case\"webnn\":if(n=\"WEBNN\",typeof a!=\"string\"){let s=a;if(s?.deviceType){let l=He(\"deviceType\",r),i=He(s.deviceType,r);Ge()._OrtAddSessionConfigEntry(e,l,i)!==0&&Be(`Can't set a session config entry: 'deviceType' - ${s.deviceType}.`)}if(s?.numThreads){let l=s.numThreads;(typeof l!=\"number\"||!Number.isInteger(l)||l<0)&&(l=0);let i=He(\"numThreads\",r),c=He(l.toString(),r);Ge()._OrtAddSessionConfigEntry(e,i,c)!==0&&Be(`Can't set a session config entry: 'numThreads' - ${s.numThreads}.`)}if(s?.powerPreference){let l=He(\"powerPreference\",r),i=He(s.powerPreference,r);Ge()._OrtAddSessionConfigEntry(e,l,i)!==0&&Be(`Can't set a session config entry: 'powerPreference' - ${s.powerPreference}.`)}}break;case\"webgpu\":if(n=\"JS\",typeof a!=\"string\"){let s=a;if(s?.preferredLayout){if(s.preferredLayout!==\"NCHW\"&&s.preferredLayout!==\"NHWC\")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${s.preferredLayout}`);let l=He(\"preferredLayout\",r),i=He(s.preferredLayout,r);Ge()._OrtAddSessionConfigEntry(e,l,i)!==0&&Be(`Can't set a session config entry: 'preferredLayout' - ${s.preferredLayout}.`)}}break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported execution provider: ${n}`)}let o=He(n,r);Ge()._OrtAppendExecutionProvider(e,o)!==0&&Be(`Can't append execution provider: ${n}.`)}},Xi=e=>{let t=Ge(),r=0,a=[],n=e||{};Ad(n);try{let o=Id(n.graphOptimizationLevel??\"all\"),s=Ed(n.executionMode??\"sequential\"),l=typeof n.logId==\"string\"?He(n.logId,a):0,i=n.logSeverityLevel??2;if(!Number.isInteger(i)||i<0||i>4)throw new Error(`log serverity level is not valid: ${i}`);let c=n.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log verbosity level is not valid: ${c}`);let f=typeof n.optimizedModelFilePath==\"string\"?He(n.optimizedModelFilePath,a):0;if(r=t._OrtCreateSessionOptions(o,!!n.enableCpuMemArena,!!n.enableMemPattern,s,!!n.enableProfiling,0,l,i,c,f),r===0&&Be(\"Can't create session options.\"),n.executionProviders&&Td(r,n.executionProviders,a),n.enableGraphCapture!==void 0){if(typeof n.enableGraphCapture!=\"boolean\")throw new Error(`enableGraphCapture must be a boolean value: ${n.enableGraphCapture}`);let m=He(\"enableGraphCapture\",a),h=He(n.enableGraphCapture.toString(),a);t._OrtAddSessionConfigEntry(r,m,h)!==0&&Be(`Can't set a session config entry: 'enableGraphCapture' - ${n.enableGraphCapture}.`)}if(n.freeDimensionOverrides)for(let[m,h]of Object.entries(n.freeDimensionOverrides)){if(typeof m!=\"string\")throw new Error(`free dimension override name must be a string: ${m}`);if(typeof h!=\"number\"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let w=He(m,a);t._OrtAddFreeDimensionOverride(r,w,h)!==0&&Be(`Can't set a free dimension override: ${m} - ${h}.`)}return n.extra!==void 0&&Cr(n.extra,\"\",new WeakSet,(m,h)=>{let w=He(m,a),b=He(h,a);t._OrtAddSessionConfigEntry(r,w,b)!==0&&Be(`Can't set a session config entry: ${m} - ${h}.`)}),[r,a]}catch(o){throw r!==0&&t._OrtReleaseSessionOptions(r),a.forEach(s=>t._free(s)),o}}});var aa,Bt,Ir,sn,Er,un,ia,ie=F(()=>{\"use strict\";aa=e=>{switch(e){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float16\":return 10;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${e}`)}},Bt=e=>{switch(e){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 10:return\"float16\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${e}`)}},Ir=e=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][e],sn=e=>{switch(e){case\"float16\":return typeof Float16Array<\"u\"&&Float16Array.from?Float16Array:Uint16Array;case\"float32\":return Float32Array;case\"uint8\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"bool\":return Uint8Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},Er=e=>{switch(e){case\"verbose\":return 0;case\"info\":return 1;case\"warning\":return 2;case\"error\":return 3;case\"fatal\":return 4;default:throw new Error(`unsupported logging level: ${e}`)}},un=e=>e===\"float32\"||e===\"float16\"||e===\"int32\"||e===\"int64\"||e===\"uint32\"||e===\"uint8\"||e===\"bool\",ia=e=>{switch(e){case\"none\":return 0;case\"cpu\":return 1;case\"cpu-pinned\":return 2;case\"texture\":return 3;case\"gpu-buffer\":return 4;default:throw new Error(`unsupported data location: ${e}`)}}});var Ar,oa=F(()=>{\"use strict\";Ar=async e=>{if(typeof e==\"string\")if(typeof process<\"u\"&&process.versions&&process.versions.node)try{return new Uint8Array(await(void 0)(e))}catch(t){if(t.code===\"ERR_FS_FILE_TOO_LARGE\"){let r=(void 0)(e),a=[];for await(let n of r)a.push(n);return new Uint8Array(Buffer.concat(a))}throw t}else{let t=await fetch(e);if(!t.ok)throw new Error(`failed to load external data file: ${e}`);let r=t.headers.get(\"Content-Length\"),a=r?parseInt(r,10):0;if(a<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),o;try{o=new ArrayBuffer(a)}catch(l){if(l instanceof RangeError){let i=Math.ceil(a/65536);o=new WebAssembly.Memory({initial:i,maximum:i}).buffer}else throw l}let s=0;for(;;){let{done:l,value:i}=await n.read();if(l)break;let c=i.byteLength;new Uint8Array(o,s,c).set(i),s+=c}return new Uint8Array(o,0,a)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}});var Od,kd,Ji,eo,to,Pd,De,Dt=F(()=>{\"use strict\";ie();Od=[\"V\",\"I\",\"W\",\"E\",\"F\"],kd=(e,t)=>{console.log(`[${Od[e]},${new Date().toISOString()}]${t}`)},to=(e,t)=>{Ji=e,eo=t},Pd=(e,t)=>{let r=Er(e),a=Er(Ji);r>=a&&kd(r,typeof t==\"function\"?t():t)},De=(...e)=>{eo&&Pd(...e)}});var ro,no=F(()=>{\"use strict\";ie();ro=(e,t)=>new(sn(t))(e)});var ln=F(()=>{\"use strict\"});var dn,Rd,ao,ua,sa,oo,so=F(()=>{\"use strict\";Dt();ln();dn=e=>Math.ceil(e/16)*16,Rd=1,ao=()=>Rd++,ua=async(e,t,r,a)=>{let n=dn(r),o=e.device.createBuffer({size:n,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let s=e.getCommandEncoder();e.endComputePass(),s.copyBufferToBuffer(t,0,o,0,n),e.flush(),await o.mapAsync(GPUMapMode.READ);let l=o.getMappedRange();if(a){let i=a();return i.set(new Uint8Array(l,0,r)),i}else return new Uint8Array(l.slice(0,r))}finally{o.destroy()}},sa=class{constructor(t){this.backend=t;this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersForUploadingPending=[],this.buffersPending=[],this.externalBuffers=new Map,this.capturedPendingBuffers=new Map}upload(t,r){let a=r.buffer,n=r.byteOffset,o=r.byteLength,s=dn(o),l=this.storageCache.get(t);if(!l)throw new Error(\"gpu data for uploading does not exist\");if(l.originalSize!==o)throw new Error(`inconsistent data size. gpu data size=${l.originalSize}, data size=${o}`);let i=this.backend.device.createBuffer({mappedAtCreation:!0,size:s,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=i.getMappedRange();new Uint8Array(c).set(new Uint8Array(a,n,o)),i.unmap();let f=this.backend.getCommandEncoder();this.backend.endComputePass(),f.copyBufferToBuffer(i,0,l.gpuData.buffer,0,s),De(\"verbose\",()=>`[WebGPU] GpuDataManager.upload(id=${t})`),this.buffersForUploadingPending.push(i)}memcpy(t,r){let a=this.storageCache.get(t);if(!a)throw new Error(\"source gpu data for memcpy does not exist\");let n=this.storageCache.get(r);if(!n)throw new Error(\"destination gpu data for memcpy does not exist\");if(a.originalSize!==n.originalSize)throw new Error(\"inconsistent source and destination gpu data size\");let o=dn(a.originalSize),s=this.backend.getCommandEncoder();this.backend.endComputePass(),s.copyBufferToBuffer(a.gpuData.buffer,0,n.gpuData.buffer,0,o)}registerExternalBuffer(t,r,a){let n;if(a){if(n=this.externalBuffers.get(a),n===void 0)throw new Error(\"previous buffer is not registered\");if(t===a)return De(\"verbose\",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${n}, buffer is the same, skip.`),n;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet.\n Please use the previous external buffer!`);this.externalBuffers.delete(a)}else n=ao();return this.storageCache.set(n,{gpuData:{id:n,type:0,buffer:t},originalSize:r}),this.externalBuffers.set(t,n),De(\"verbose\",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${n}, registered.`),n}unregisterExternalBuffer(t){let r=this.externalBuffers.get(t);r!==void 0&&(this.storageCache.delete(r),this.externalBuffers.delete(t),De(\"verbose\",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${r}`))}create(t,r=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let a=dn(t),n,o=(r&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,s=(r&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(o||s){let i=o?this.freeBuffers:this.freeUniformBuffers,c=i.get(a);c||(c=[],i.set(a,c)),c.length>0?n=c.pop():n=this.backend.device.createBuffer({size:a,usage:r})}else n=this.backend.device.createBuffer({size:a,usage:r});let l={id:ao(),type:0,buffer:n};return this.storageCache.set(l.id,{gpuData:l,originalSize:t}),De(\"verbose\",()=>`[WebGPU] GpuDataManager.create(size=${t}) => id=${l.id}`),l}get(t){return this.storageCache.get(t)?.gpuData}release(t){let r=this.storageCache.get(t);if(!r)throw new Error(\"releasing data does not exist\");return De(\"verbose\",()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${r.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(r.gpuData.buffer),r.originalSize}async download(t,r){let a=this.storageCache.get(t);if(!a)throw new Error(\"data does not exist\");await ua(this.backend,a.gpuData.buffer,a.originalSize,r)}refreshPendingBuffers(){for(let t of this.buffersForUploadingPending)t.destroy();if(this.buffersForUploadingPending=[],this.buffersPending.length!==0)if(this.backend.sessionStatus===\"default\"){for(let t of this.buffersPending)(t.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE?this.freeBuffers.get(t.size).push(t):(t.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM?this.freeUniformBuffers.get(t.size).push(t):t.destroy();this.buffersPending=[]}else{let t=this.capturedPendingBuffers.get(this.backend.currentSessionId);t||(t=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,t));for(let r of this.buffersPending)t.push(r);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(t=>{t.forEach(r=>{r.destroy()})}),this.freeUniformBuffers.forEach(t=>{t.forEach(r=>{r.destroy()})}),this.storageCache.forEach(t=>{t.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(t=>{t.forEach(r=>{r.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onReleaseSession(t){let r=this.capturedPendingBuffers.get(t);r&&(r.forEach(a=>{a.destroy()}),this.capturedPendingBuffers.delete(t))}},oo=(...e)=>new sa(...e)});var la,$e,Ye=F(()=>{\"use strict\";la=class{constructor(t){Object.assign(this,t)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(t=>`${this[t]}`).join(\";\")),this.key}},$e=e=>new la(e)});var da,vt,M,qt,cn,pn,fn,_e=F(()=>{\"use strict\";da=class{static calcMatMulShape(t,r){return t[1]!==r[0]?void 0:[t[0],r[1]]}},vt=class{static calcShape(t,r,a=!1){let n=t.length,o=r.length;if(n===0)return r;if(o===0)return t;let s=Math.max(t.length,r.length),l=new Array(s);if(a){if(n<2||o<2)return;let i=da.calcMatMulShape([t[n-2],t[n-1]],[r[o-2],r[o-1]]);if(i===void 0)return;[l[s-2],l[s-1]]=i}for(let i=a?3:1;i<=s;i++){let c=n-i<0?1:t[n-i],f=o-i<0?1:r[o-i];if(c!==f&&c>1&&f>1)return;let m=Math.max(c,f);if(c&&f)l[s-i]=Math.max(c,f);else{if(m>1)return;l[s-i]=0}}return l}static isValidBroadcast(t,r){let a=t.length,n=r.length;if(a>n)return!1;for(let o=1;o<=a;o++)if(t[a-o]!==1&&t[a-o]!==r[n-o])return!1;return!0}},M=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(t,r=4){let a=t.length;if(a===0)return[];let n=new Array(a),o=a-1;for(;o>=0;){if(t[o]%r===0){n[o]=t[o]/r;break}if(r%t[o]!==0)throw new Error(\"cannot convert shape\");n[o]=1,r/=t[o],o--}for(o--;o>=0;o--)n[o]=t[o];return n}static sizeFromDimension(t,r){if(r<0||r>t.length)throw new Error(`invalid dimension of ${r} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,r,t.length)}static sizeToDimension(t,r){if(r<0||r>t.length)throw new Error(`invalid dimension of ${r} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,r)}static getSizeFromDimensionRange(t,r,a){let n=1;for(let o=r;o=0;--n)a[n]=a[n+1]*t[n+1];return a}static normalizeAxis(t,r){if(t<-r&&t>=r)throw new Error(\"unsupported axis for this operation.\");return t<0?t+r:t}static normalizeAxes(t,r){return t.map(a=>this.normalizeAxis(a,r??t.length))}static sortBasedOnPerm(t,r){return r?r.map(a=>t[a]):t.slice().reverse()}static padShape(t,r){let a=t.length;return t.map((n,o)=>n+r[o]+r[o+a])}static areEqual(t,r){return t.length!==r.length?!1:t.every((a,n)=>a===r[n])}},qt=class e{static adjustPoolAttributes(t,r,a,n,o,s){if(!t&&a.length!==r.length-2)throw new Error(\"length of specified kernel shapes should be 2 less than length of input dimensions\");if(t)for(let l=0;l=a.length?a.push(r[l+2]):a[l]=r[l+2];for(let l=0;l=a[l]||s[l+a.length]>=a[l])throw new Error(\"pads should be smaller than kernel\")}}static adjustPadsBasedOnAutoPad(t,r,a,n,o,s,l){if(l){if(o.length!==2*(t.length-2))throw new Error(\"length of pads should be twice the length of data dimensions\");if(r.length!==t.length-2)throw new Error(\"length of strides should be the length of data dimensions\");if(n.length!==t.length-2)throw new Error(\"length of kernel shapes should be the length of data dimensions\");for(let i=0;i{\"use strict\";ie();_e();mn=64,pa=(e,t)=>{if(t===3)throw new Error(\"vec3 has same alignment as vec4, use vec4 instead\");switch(e){case 10:return t>1?`vec${t}`:\"f16\";case 1:return t>1?`vec${t}`:\"f32\";case 6:return t>1?`vec${t}`:\"i32\";case 12:return t>1?`vec${t}`:\"u32\";case 7:if(t>1)throw new Error(\"currently not supported vecX of uint64 yet\");return[\"vec2\",\"i32\"];case 13:if(t>1)throw new Error(\"currently not supported vecX of uint64 yet\");return[\"vec2\",\"u32\"];case 9:if(t!==4)throw new Error(\"bool must be vec4\");return[\"u32\",\"vec4\"];default:throw new Error(`Unknown data type: ${e}`)}},ke=(e,t=1)=>{let r=pa(e,t);return typeof r==\"string\"?r:r[0]},at=(e,t=1)=>{let r=pa(e,t);return typeof r==\"string\"?r:r[1]},K=(...e)=>{let t=[];return e.forEach(r=>{r.length!==0&&t.push({type:12,data:r},{type:12,data:M.computeStrides(r)})}),t},Me=e=>e%4===0?4:e%2===0?2:1,Xe=(e=\"f32\",t,r=\"0\")=>!t||t===1?`${e}(${r})`:`vec${t}<${e}>(${r})`,mt=(e,t,r)=>e===\"f32\"?r:t===1?`f32(${r})`:`vec${t}f(${r})`,it=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,re=(e,t,r,a)=>e.startsWith(\"uniforms.\")&&r>4?typeof t==\"string\"?a===\"f16\"?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:a===\"f16\"?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:r>1?`${e}[${t}]`:e,fa=(e,t,r,a,n)=>{let o=typeof r==\"number\",s=o?r:r.length,l=[...new Array(s).keys()],i=s<2?\"u32\":s<=4?`vec${s}`:`array`,c=pa(t,n),f=typeof c==\"string\"?c:c[1],m=typeof c==\"string\"?c:c[0],h={indices:i,value:f,storage:m,tensor:t},w=G=>typeof G==\"string\"?G:`${G}u`,b={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},$=o?\"uniforms.\":\"\",I=`${$}${e}_shape`,S=`${$}${e}_strides`,v=\"\";for(let G=0;G ${h.indices} {\n var indices: ${h.indices};\n var current = offset;\n ${v}\n return indices;\n }`,A=G=>(b.offsetToIndices=!0,s<2?G:`o2i_${e}(${G})`),k=[];if(s>=2)for(let G=s-1;G>=0;G--)k.push(`${re(S,G,s)} * (indices[${G}])`);let U=s<2?\"\":`\n fn i2o_${e}(indices: ${h.indices}) -> u32 {\n return ${k.join(\"+\")};\n }`,N=G=>(b.indicesToOffset=!0,s<2?G:`i2o_${e}(${G})`),H=(...G)=>s===0?\"0u\":`${h.indices}(${G.map(w).join(\",\")})`,z=(G,J)=>s<2?`${G}`:`${re(G,J,s)}`,L=(G,J,Se)=>s<2?`${G}=${Se};`:`${re(G,J,s)}=${Se};`,pe={},Ie=(G,J)=>{b.broadcastedIndicesToOffset=!0;let Se=`${J.name}broadcastedIndicesTo${e}Offset`;if(Se in pe)return`${Se}(${G})`;let Je=[];for(let et=s-1;et>=0;et--){let Fe=J.indicesGet(\"outputIndices\",et+J.rank-s);Je.push(`${z(S,et)} * (${Fe} % ${z(I,et)})`)}return pe[Se]=`fn ${Se}(outputIndices: ${J.type.indices}) -> u32 {\n return ${Je.length>0?Je.join(\"+\"):\"0u\"};\n }`,`${Se}(${G})`},we=(G,J)=>(()=>{if(h.storage===h.value)return`${e}[${G}]=${J};`;if(h.storage===\"vec2\"&&h.value===\"i32\")return`${e}[${G}]=vec2(u32(${J}), select(0u, 0xFFFFFFFFu, ${J} < 0));`;if(h.storage===\"vec2\"&&h.value===\"u32\")return`${e}[${G}]=vec2(u32(${J}), 0u);`;if(h.storage===\"u32\"&&h.value===\"vec4\")return`${e}[${G}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${J}));`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),ne=G=>(()=>{if(h.storage===h.value)return`${e}[${G}]`;if(h.storage===\"vec2\"&&h.value===\"i32\")return`i32(${e}[${G}].x)`;if(h.storage===\"vec2\"&&h.value===\"u32\")return`u32(${e}[${G}].x)`;if(h.storage===\"u32\"&&h.value===\"vec4\")return`vec4(bool(${e}[${G}] & 0xFFu), bool(${e}[${G}] & 0xFF00u), bool(${e}[${G}] & 0xFF0000u), bool(${e}[${G}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),Ue=s<2?\"\":`\n fn get_${e}ByIndices(indices: ${h.indices}) -> ${f} {\n return ${ne(`i2o_${e}(indices)`)};\n }`,X=s<2?\"\":(()=>{let G=l.map(Se=>`d${Se}: u32`).join(\", \"),J=l.map(Se=>`d${Se}`).join(\", \");return`\n fn get_${e}(${G}) -> ${f} {\n return get_${e}ByIndices(${H(J)});\n }`})(),xe=(...G)=>{if(G.length!==s)throw new Error(`indices length must be ${s}`);let J=G.map(w).join(\",\");return s===0?ne(\"0u\"):s===1?ne(J[0]):(b.get=!0,b.getByIndices=!0,b.indicesToOffset=!0,`get_${e}(${J})`)},fe=G=>s<2?ne(G):(b.getByIndices=!0,b.indicesToOffset=!0,`get_${e}ByIndices(${G})`),ue=s<2?\"\":`\n fn set_${e}ByIndices(indices: ${h.indices}, value: ${f}) {\n ${we(`i2o_${e}(indices)`,\"value\")}\n }`,se=s<2?\"\":(()=>{let G=l.map(Se=>`d${Se}: u32`).join(\", \"),J=l.map(Se=>`d${Se}`).join(\", \");return`\n fn set_${e}(${G}, value: ${f}) {\n set_${e}ByIndices(${H(J)}, value);\n }`})();return{impl:()=>{let G=[],J=!1;return b.offsetToIndices&&(G.push(E),J=!0),b.indicesToOffset&&(G.push(U),J=!0),b.broadcastedIndicesToOffset&&(Object.values(pe).forEach(Se=>G.push(Se)),J=!0),b.set&&(G.push(se),J=!0),b.setByIndices&&(G.push(ue),J=!0),b.get&&(G.push(X),J=!0),b.getByIndices&&(G.push(Ue),J=!0),!o&&J&&G.unshift(`const ${I} = ${h.indices}(${r.join(\",\")});`,`const ${S} = ${h.indices}(${M.computeStrides(r).join(\",\")});`),G.join(`\n`)},type:h,offsetToIndices:A,indicesToOffset:N,broadcastedIndicesToOffset:Ie,indices:H,indicesGet:z,indicesSet:L,set:(...G)=>{if(G.length!==s+1)throw new Error(`indices length must be ${s}`);let J=G[s];if(typeof J!=\"string\")throw new Error(\"value must be string\");let Se=G.slice(0,s).map(w).join(\",\");return s===0?we(\"0u\",J):s===1?we(Se[0],J):(b.set=!0,b.setByIndices=!0,b.indicesToOffset=!0,`set_${e}(${Se}, ${J})`)},setByOffset:we,setByIndices:(G,J)=>s<2?we(G,J):(b.setByIndices=!0,b.indicesToOffset=!0,`set_${e}ByIndices(${G}, ${J});`),get:xe,getByOffset:ne,getByIndices:fe,usage:a,name:e,strides:S,shape:I,rank:s}},D=(e,t,r,a=1)=>fa(e,t,r,\"input\",a),q=(e,t,r,a=1)=>fa(e,t,r,\"output\",a),hn=(e,t,r,a=1)=>fa(e,t,r,\"internal\",a),ca=class{constructor(t){this.normalizedDispatchGroup=t;this.internalVariables=[];this.variables=[];this.uniforms=[];this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(t){return`if (global_idx >= ${typeof t==\"number\"?`${t}u`:t}) { return; }`}mainStart(t=mn){let r=typeof t==\"number\"?t:t[0],a=typeof t==\"number\"?1:t[1],n=typeof t==\"number\"?1:t[2],o=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,s=o?`@builtin(global_invocation_id) global_id : vec3,\n @builtin(workgroup_id) workgroup_id : vec3,\n @builtin(local_invocation_id) local_id : vec3`:`@builtin(local_invocation_id) local_id : vec3,\n @builtin(local_invocation_index) local_idx : u32,\n @builtin(workgroup_id) workgroup_id : vec3,\n @builtin(num_workgroups) num_workgroups : vec3`,l=o?\"let global_idx = global_id.x; let local_idx = local_id.x;\":`let global_idx = (workgroup_id.z * num_workgroups[0] * num_workgroups[1] +\n workgroup_id.y * num_workgroups[0] + workgroup_id.x) * ${r*a*n}u + local_idx;`;return`@compute @workgroup_size(${r}, ${a}, ${n})\n fn main(${s}) {\n ${l}\n `}appendVariableUniforms(t){t.rank!==0&&(t.shape.startsWith(\"uniforms.\")&&this.uniforms.push({name:t.shape.replace(\"uniforms.\",\"\"),type:\"u32\",length:t.rank}),t.strides.startsWith(\"uniforms.\")&&this.uniforms.push({name:t.strides.replace(\"uniforms.\",\"\"),type:\"u32\",length:t.rank}))}declareVariable(t,r){if(t.usage===\"internal\")throw new Error(\"cannot use internal variable with declareVariable(). use registerInternalVariables() instead.\");this.variables.push(t),this.appendVariableUniforms(t);let a=t.usage===\"input\"?\"read\":\"read_write\",n=t.type.storage;return`@group(0) @binding(${r}) var ${t.name}: array<${n}>;`}declareVariables(...t){return t.map(r=>this.declareVariable(r,this.variableIndex++)).join(`\n`)}registerInternalVariable(t){if(t.usage!==\"internal\")throw new Error(\"cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.\");this.internalVariables.push(t),this.appendVariableUniforms(t)}registerInternalVariables(...t){return t.forEach(r=>this.registerInternalVariable(r)),this}registerUniform(t,r,a=1){return this.uniforms.push({name:t,type:r,length:a}),this}registerUniforms(t){return this.uniforms=this.uniforms.concat(t),this}uniformDeclaration(){if(this.uniforms.length===0)return\"\";let t=[];for(let{name:r,type:a,length:n}of this.uniforms)if(n&&n>4)a===\"f16\"?t.push(`@align(16) ${r}:array, ${Math.ceil(n/8)}>`):t.push(`${r}:array, ${Math.ceil(n/4)}>`);else{let o=n==null||n===1?a:`vec${n}<${a}>`;t.push(`${r}:${o}`)}return`\n struct Uniforms { ${t.join(\", \")} };\n @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(t=>t.impl()).join(`\n`)+this.internalVariables.map(t=>t.impl()).join(`\n`)}},uo=e=>new ca(e),ar=(e,t)=>{let r=e.length,a=[];for(let n=0;n1&&s===1&&a.unshift(o)}return a}});var zd,lo,Bd,Dd,dt,co,po,ir=F(()=>{\"use strict\";ie();_e();Ye();be();zd=e=>{if(!e||e.length!==1)throw new Error(\"Transpose requires 1 input.\")},lo=(e,t)=>t&&t.length!==e?[...new Array(e).keys()].reverse():t,Bd=(e,t)=>M.sortBasedOnPerm(e,lo(e.length,t)),Dd=(e,t,r,a)=>{let n=[];n.push(`fn perm(i: ${a.type.indices}) -> ${r.type.indices} {\n var a: ${r.type.indices};`);for(let o=0;o{let r=e.dataType,a=e.dims.length,n=lo(a,t),o=Bd(e.dims,n),s=q(\"output\",r,o.length),l=D(\"a\",r,a),i=c=>`\n ${c.registerUniform(\"output_size\",\"u32\").declareVariables(l,s)}\n\n ${Dd(n,a,l,s)}\n\n ${c.mainStart()}\n ${c.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let indices = ${s.offsetToIndices(\"global_idx\")};\n let aIndices = perm(indices);\n\n ${s.setByOffset(\"global_idx\",l.getByIndices(\"aIndices\"))}\n }`;return{name:\"Transpose\",shaderCache:{hint:`${t}`,inputDependencies:[\"rank\"]},getRunData:c=>{let f=M.size(o);return{outputs:[{dims:o,dataType:c[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...K(c[0].dims,o)]}},getShaderSource:i}},co=(e,t)=>{zd(e.inputs),e.compute(dt(e.inputs[0],t.perm))},po=e=>$e({perm:e.perm})});var Md,Ud,Nd,Wd,Vd,Gd,Hd,Ld,Fd,qd,$t,fo,mo,ho,go,yo,bo,wo,vo,$o,_o,xo=F(()=>{\"use strict\";ie();_e();be();gn();ir();Md={max:\"select(bestValue, candidate, candidate > bestValue)\",min:\"select(bestValue, candidate, candidate < bestValue)\",mean:\"bestValue + candidate\",sum:\"bestValue + candidate\",prod:\"bestValue * candidate\",sumSquare:\"bestValue + candidate * candidate\",logSumExp:\"bestValue + exp(candidate)\",l1:\"bestValue + abs(candidate)\",l2:\"bestValue + candidate * candidate\",logSum:\"bestValue + candidate\"},Ud={max:\"select(bestValue, candidate, candidate > bestValue)\",min:\"select(bestValue, candidate, candidate < bestValue)\",mean:\"bestValue + candidate\",sum:\"bestValue + candidate\",prod:\"bestValue * candidate\",sumSquare:\"bestValue + candidate\",logSumExp:\"bestValue + candidate\",l1:\"bestValue + candidate\",l2:\"bestValue + candidate\",logSum:\"bestValue + candidate\"},Nd={max:\"_A[offset]\",min:\"_A[offset]\",mean:\"0\",sum:\"0\",prod:\"1\",sumSquare:\"0\",logSumExp:\"0\",l1:\"0\",l2:\"0\",logSum:\"0\"},Wd={max:\"bestValue\",min:\"bestValue\",sum:\"bestValue\",prod:\"bestValue\",sumSquare:\"bestValue\",logSumExp:\"log(bestValue)\",l1:\"bestValue\",l2:\"sqrt(bestValue)\",logSum:\"log(bestValue)\"},Vd=(e,t)=>{let r=[];for(let a=t-e;a{let r=[],a=e.length;for(let o=0;oe[o]);return[r,n]},Hd=(e,t)=>{let r=e.length+t.length,a=[],n=0;for(let o=0;o{for(let r=0;r{let r=[];if(!Ld(e,t)){for(let a=0;ar.push(a))}return r},qd=(e,t,r,a,n,o,s)=>{let l=r[0].dims,i=M.size(o),c=M.size(s),f=D(\"_A\",r[0].dataType,l),m=q(\"output\",n,o),h=32,w=`\n var aBestValues : array;\n `;return{name:e,shaderCache:t,getShaderSource:$=>`\n ${$.registerUniform(\"reduceSize\",\"u32\").declareVariables(f,m)}\n ${w}\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\n return ((a - 1u) / b + 1u);\n }\n ${$.mainStart(h)}\n\n let outputIndex = global_idx / ${h};\n let offset = outputIndex * uniforms.reduceSize;\n\n var bestValue = f32(${Nd[a]});\n let Length = uniforms.reduceSize;\n for (var k = local_idx; k < Length; k = k + ${h}) {\n let candidate = f32(${f.getByOffset(\"offset + k\")});\n bestValue = ${Md[a]};\n }\n aBestValues[local_idx] = bestValue;\n workgroupBarrier();\n\n var reduceSize = min(Length, ${h}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (local_idx < currentSize) {\n let candidate = aBestValues[local_idx + interval];\n bestValue = ${Ud[a]};\n aBestValues[local_idx] = bestValue;\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (local_idx == 0u) {\n ${m.setByOffset(\"outputIndex\",`${a===\"mean\"?`${m.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${m.type.storage}(${Wd[a]})`}`)};\n }\n }`,getRunData:()=>({outputs:[{dims:o,dataType:n}],dispatchGroup:{x:i},programUniforms:[{type:12,data:c}]})}},$t=(e,t,r,a)=>{let n=e.inputs.length===1?r:ma(e.inputs,r),o=n.axes;o.length===0&&!n.noopWithEmptyAxes&&(o=e.inputs[0].dims.map((w,b)=>b));let s=M.normalizeAxes(o,e.inputs[0].dims.length),l=s,i=e.inputs[0],c=Fd(l,e.inputs[0].dims.length);c.length>0&&(i=e.compute(dt(e.inputs[0],c),{inputs:[0],outputs:[-1]})[0],l=Vd(l.length,i.dims.length));let[f,m]=Gd(i.dims,l),h=f;n.keepDims&&(h=Hd(f,s)),e.compute(qd(t,{hint:n.cacheKey,inputDependencies:[\"type\"]},[i],a,e.inputs[0].dataType,h,m),{inputs:[i]})},fo=(e,t)=>{$t(e,\"ReduceMeanShared\",t,\"mean\")},mo=(e,t)=>{$t(e,\"ReduceL1Shared\",t,\"l1\")},ho=(e,t)=>{$t(e,\"ReduceL2Shared\",t,\"l2\")},go=(e,t)=>{$t(e,\"ReduceLogSumExpShared\",t,\"logSumExp\")},yo=(e,t)=>{$t(e,\"ReduceMaxShared\",t,\"max\")},bo=(e,t)=>{$t(e,\"ReduceMinShared\",t,\"min\")},wo=(e,t)=>{$t(e,\"ReduceProdShared\",t,\"prod\")},vo=(e,t)=>{$t(e,\"ReduceSumShared\",t,\"sum\")},$o=(e,t)=>{$t(e,\"ReduceSumSquareShared\",t,\"sumSquare\")},_o=(e,t)=>{$t(e,\"ReduceLogSumShared\",t,\"logSum\")}});var _t,jd,yn,ma,xt,Kd,Yd,Zd,Xd,Qd,Jd,ec,tc,rc,nc,St,So,Co,Io,Eo,Ao,To,Oo,ko,Po,Ro,gn=F(()=>{\"use strict\";ie();_e();Ye();be();xo();_t=e=>{if(!e||e.length===0||e.length>2)throw new Error(\"Reduce op requires 1 or 2 inputs.\");if(e.length===2&&e[1].dims.length!==1)throw new Error(\"Invalid axes input dims.\")},jd=e=>[\"\",\"\",`var value = ${e.getByIndices(\"input_indices\")};`,\"\"],yn=(e,t,r,a,n,o,s=!1,l=!1)=>{let i=[],c=r[0].dims,f=c.length,m=M.normalizeAxes(n,f),h=!l&&m.length===0;c.forEach((I,S)=>{h||m.indexOf(S)>=0?s&&i.push(1):i.push(I)});let w=i.length,b=M.size(i);return{name:e,shaderCache:t,getShaderSource:I=>{let S=[],v=D(\"_A\",r[0].dataType,f),E=q(\"output\",o,w),A=a(v,E,m),k=A[2];for(let U=0,N=0;U=0?(s&&N++,k=`for(var j${U}: u32 = 0; j${U} < ${c[U]}; j${U}++) {\n ${A[2].includes(\"last_index\")?`let last_index = j${U};`:\"\"}\n ${v.indicesSet(\"input_indices\",U,`j${U}`)}\n ${k}\n }`):(S.push(`${v.indicesSet(\"input_indices\",U,E.indicesGet(\"output_indices\",N))};`),N++);return`\n\n ${I.registerUniform(\"output_size\",\"u32\").declareVariables(v,E)}\n\n ${I.mainStart()}\n ${I.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n var input_indices: ${v.type.indices};\n let output_indices = ${E.offsetToIndices(\"global_idx\")};\n\n ${S.join(`\n`)}\n ${A[0]} // init ops for reduce max/min\n ${A[1]}\n ${k}\n ${A[3]}\n ${A.length===4?E.setByOffset(\"global_idx\",\"value\"):A.slice(4).join(`\n`)}\n }`},getRunData:()=>({outputs:[{dims:i,dataType:o}],dispatchGroup:{x:Math.ceil(b/64)},programUniforms:[{type:12,data:b},...K(c,i)]})}},ma=(e,t)=>{let r=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(a=>r.push(Number(a))),$e({axes:r,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},xt=(e,t,r,a)=>{let n=e.inputs,o=n.length===1?r:ma(n,r);e.compute(yn(t,{hint:o.cacheKey,inputDependencies:[\"rank\"]},[n[0]],o.noopWithEmptyAxes&&o.axes.length===0?jd:a,o.axes,n[0].dataType,o.keepDims,o.noopWithEmptyAxes),{inputs:[0]})},Kd=(e,t)=>{_t(e.inputs),xt(e,\"ReduceLogSum\",t,(a,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += ${a.getByIndices(\"input_indices\")};`,\"value = log(value);\"])},Yd=(e,t)=>{_t(e.inputs),xt(e,\"ReduceL1\",t,(a,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += abs(${a.getByIndices(\"input_indices\")});`,\"\"])},Zd=(e,t)=>{_t(e.inputs),xt(e,\"ReduceL2\",t,(a,n)=>[`var t = ${n.type.value}(0); var value = ${n.type.value}(0);`,\"\",`t = ${a.getByIndices(\"input_indices\")}; value += (t * t);`,\"value = sqrt(value);\"])},Xd=(e,t)=>{_t(e.inputs),xt(e,\"ReduceLogSumExp\",t,(a,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += exp(${a.getByIndices(\"input_indices\")});`,\"value = log(value);\"])},Qd=(e,t)=>{_t(e.inputs),xt(e,\"ReduceMax\",t,(a,n,o)=>{let s=[];for(let l=0;l=0||o.length===0)&&s.push(a.indicesSet(\"input_indices\",l,0));return[`${s.join(`\n`)}`,`var value = ${a.getByIndices(\"input_indices\")};`,`value = max(value, ${a.getByIndices(\"input_indices\")});`,\"\"]})},Jd=(e,t)=>{_t(e.inputs),xt(e,\"ReduceMean\",t,(a,n,o)=>{let s=1;for(let l=0;l=0||o.length===0)&&(s*=e.inputs[0].dims[l]);return[\"var sum = f32(0);\",\"\",`sum += f32(${a.getByIndices(\"input_indices\")});`,`let value = ${n.type.value}(sum / ${s});`]})},ec=(e,t)=>{_t(e.inputs),xt(e,\"ReduceMin\",t,(a,n,o)=>{let s=[];for(let l=0;l=0||o.length===0)&&s.push(`input_indices[${l}] = 0;`);return[`${s.join(`\n`)}`,`var value = ${a.getByIndices(\"input_indices\")};`,`value = min(value, ${a.getByIndices(\"input_indices\")});`,\"\"]})},tc=(e,t)=>{_t(e.inputs),xt(e,\"ReduceProd\",t,(a,n)=>[`var value = ${n.type.storage}(1);`,\"\",`value *= ${a.getByIndices(\"input_indices\")};`,\"\"])},rc=(e,t)=>{_t(e.inputs),xt(e,\"ReduceSum\",t,(a,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += ${a.getByIndices(\"input_indices\")};`,\"\"])},nc=(e,t)=>{_t(e.inputs),xt(e,\"ReduceSumSquare\",t,(a,n)=>[`var t = ${n.type.value}(0); var value = ${n.type.value}(0);`,\"\",`t = ${a.getByIndices(\"input_indices\")}; value += t * t;`,\"\"])},St=(e,t,r)=>{if(t.length===0)return r;let a=1,n=1;for(let o=0;o1024},So=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jd(e,t):fo(e,t)},Co=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yd(e,t):mo(e,t)},Io=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zd(e,t):ho(e,t)},Eo=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xd(e,t):go(e,t)},Ao=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qd(e,t):yo(e,t)},To=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ec(e,t):bo(e,t)},Oo=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?tc(e,t):wo(e,t)},ko=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?rc(e,t):vo(e,t)},Po=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?nc(e,t):$o(e,t)},Ro=(e,t)=>{St(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Kd(e,t):_o(e,t)}});var zo,Bo,Do,ha,Mo=F(()=>{\"use strict\";ie();Ye();gn();zo=e=>{if(!e||e.length===0||e.length>2)throw new Error(\"ArgMinMaxOp op requires 1 or 2 inputs.\");if(e[0].dataType!==1)throw new Error(\"Invalid input type.\")},Bo=(e,t)=>{zo(e.inputs);let r=(a,n,o)=>{let s=[];for(let l=0;l=0||o.length===0)&&s.push(`input_indices[${l}] = 0;`);return[`${s.join(`\n`)}`,`var value = ${a.getByIndices(\"input_indices\")};\nvar best_index : i32 = 0;`,`if (${a.getByIndices(\"input_indices\")} ${t.selectLastIndex>0?\"<=\":\"<\"} value) {\n value = ${a.getByIndices(\"input_indices\")};\n best_index = i32(last_index);\n }`,\"\",n.setByOffset(\"global_idx\",\"best_index\")]};e.compute(yn(\"ArgMin\",{hint:t.cacheKey,inputDependencies:[\"rank\"]},[e.inputs[0]],r,[t.axis],7,t.keepDims),{inputs:[0]})},Do=(e,t)=>{zo(e.inputs);let r=(a,n,o)=>{let s=[];for(let l=0;l=0||o.length===0)&&s.push(`input_indices[${l}] = 0;`);return[`${s.join(`\n`)}`,`var value = ${a.getByIndices(\"input_indices\")};\nvar best_index : i32 = 0;`,`if (${a.getByIndices(\"input_indices\")} ${t.selectLastIndex>0?\">=\":\">\"} value) {\n value = ${a.getByIndices(\"input_indices\")};\n best_index = i32(last_index);\n }`,\"\",n.setByOffset(\"global_idx\",\"best_index\")]};e.compute(yn(\"argMax\",{hint:t.cacheKey,inputDependencies:[\"rank\"]},[e.inputs[0]],r,[t.axis],7,t.keepDims),{inputs:[0]})},ha=e=>$e(e)});var ac,ic,oc,sc,bn,uc,Uo,ga=F(()=>{\"use strict\";ie();ln();be();ac=(e,t)=>{let r=e[0],a=e[1],n=e[2],o=e[3],s=e[4],l=e[5];if(s&&l)throw new Error(\"Attention cannot have both past and relative_position_bias\");if(r.dims.length!==3)throw new Error('Input \"input\" must have 3 dimensions');let i=r.dims[0],c=r.dims[1],f=r.dims[2];if(n.dims.length!==1)throw new Error('Input \"bias\" is expected to have 1 dimensions');if(a.dims.length!==2)throw new Error('Input \"weights\" is expected to have 2 dimensions');if(a.dims[0]!==f)throw new Error(\"Input 1 dimension 0 should have same length as dimension 2 of input 0\");if(n.dims[0]!==a.dims[1])throw new Error('Input \"bias\" dimension 0 should have same length as dimension 1 of input \"weights\"');let m=n.dims[0]/3,h=m,w=h;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw new Error(\"qkv_hidden_sizes attribute should have 3 elements\");for(let E of t.qkvHiddenSizes)if(E%t.numHeads!==0)throw new Error(\"qkv_hidden_sizes should be divisible by num_heads\");m=t.qkvHiddenSizes[0],h=t.qkvHiddenSizes[1],w=t.qkvHiddenSizes[2]}let b=c;if(m!==h)throw new Error(\"qkv_hidden_sizes first element should be same as the second\");if(n.dims[0]!==m+h+w)throw new Error('Input \"bias\" dimension 0 should have same length as sum of Q/K/V hidden sizes');let $=0;if(s){if(h!==w)throw new Error('Input \"past\" expect k_hidden_size == v_hidden_size');if(s.dims.length!==5)throw new Error('Input \"past\" must have 5 dimensions');if(s.dims[0]!==2)throw new Error('Input \"past\" first dimension must be 2');if(s.dims[1]!==i)throw new Error('Input \"past\" second dimension must be batch_size');if(s.dims[2]!==t.numHeads)throw new Error('Input \"past\" third dimension must be num_heads');if(s.dims[4]!==h/t.numHeads)throw new Error('Input \"past\" fifth dimension must be k_hidden_size / num_heads');t.pastPresentShareBuffer||($=s.dims[3])}let I=b+$,S=-1,v=0;if(o)throw new Error(\"Mask not supported\");if(s)throw new Error(\"past is not supported\");if(l)throw new Error(\"relativePositionBias is not supported\");return{batchSize:i,sequenceLength:c,pastSequenceLength:$,kvSequenceLength:b,totalSequenceLength:I,maxSequenceLength:S,inputHiddenSize:f,hiddenSize:m,vHiddenSize:w,headSize:Math.floor(m/t.numHeads),vHeadSize:Math.floor(w/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},ic=(e,t,r,a)=>{let n=Me(a),o=64,s=a/n;s{let h=q(\"x\",t.dataType,t.dims,n),w=\"thread_max_vector\";n===2?w=\"max(thread_max_vector.x, thread_max_vector.y)\":n===4&&(w=\"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))\");let b=at(t.dataType),$=[{name:\"d_inv\",type:b},{name:\"d_comp\",type:\"u32\"},{name:\"elements_per_wg\",type:\"u32\"}];return`\n var wgMax: array;\n var wgSum: array;\n ${m.registerUniforms($).declareVariables(h)}\n ${m.mainStart([o,1,1])}\n let localOffset = local_idx * uniforms.elements_per_wg;\n let offset: u32 = workgroup_id.x * uniforms.d_comp + localOffset;\n\n var thread_max_vector = ${Xe(\"f32\",n,\"-3.402823e+38f\")};\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\n thread_max_vector = max(${mt(b,n,\"x[offset + i]\")}, thread_max_vector);\n }\n wgMax[local_idx] = ${w};\n workgroupBarrier();\n\n var maxValue = -3.402823e+38f;\n for (var i = 0u; i < ${o}; i++) {\n maxValue = max(wgMax[i], maxValue);\n }\n\n var sumVector = ${Xe(\"f32\",n,\"0\")};\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\n sumVector += exp(${mt(b,n,\"x[offset + i]\")} - maxValue);\n }\n wgSum[local_idx] = ${it(\"sumVector\",n)};\n workgroupBarrier();\n\n var sum: f32 = 0;\n for (var i = 0u; i < ${o}; i++) {\n sum += wgSum[i];\n }\n\n if (sum == 0) {\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\n x[offset + i] = ${Xe(b,n,\"uniforms.d_inv\")};\n }\n } else {\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\n let f32input = ${mt(b,n,\"x[offset + i]\")};\n x[offset + i] = ${h.type.value}(exp(f32input - maxValue) / sum);\n }\n }\n }`};e.compute({name:\"AttentionProbsSoftmax\",shaderCache:{hint:`${o};${c};${n}`},getShaderSource:f,getRunData:()=>({outputs:[],dispatchGroup:{x:r},programUniforms:i})},{inputs:[t],outputs:[]})},oc=(e,t,r,a,n,o)=>{let s=[n.batchSize,n.numHeads,n.sequenceLength,n.kvSequenceLength+n.pastSequenceLength],l=o.scale===0?1/Math.sqrt(n.headSize):o.scale,i=Me(n.headSize),c=n.headSize/i,f=12,m={x:Math.ceil(n.totalSequenceLength/f),y:Math.ceil(n.sequenceLength/f),z:n.batchSize*n.numHeads},h=[{type:12,data:n.sequenceLength},{type:12,data:c},{type:12,data:n.totalSequenceLength},{type:12,data:n.kvSequenceLength},{type:t.dataType,data:l}],w=[t,r],b=I=>{let S=D(\"q\",t.dataType,t.dims,i),v=D(\"key\",r.dataType,r.dims,i),E=q(\"output\",t.dataType,s),A=ke(t.dataType),k=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"kv_sequence_length\",type:\"u32\"},{name:\"alpha\",type:A}];return`\n const beta: ${A} = 1.0;\n const TILE_SIZE = ${f}u;\n\n var tileQ: array<${S.type.storage}, ${f*f}>;\n var tileK: array<${S.type.storage}, ${f*f}>;\n ${I.registerUniforms(k).declareVariables(S,v,E)}\n ${I.mainStart([f,f,1])}\n // x holds the N and y holds the M\n let headIdx = workgroup_id.z;\n let m = workgroup_id.y * TILE_SIZE;\n let n = workgroup_id.x * TILE_SIZE;\n let lm = m + local_id.y;\n let ln = n + local_id.x;\n\n let qOffset = uniforms.M * uniforms.K * headIdx + m * uniforms.K;\n let kOffset = uniforms.kv_sequence_length * uniforms.K * headIdx + n * uniforms.K;\n\n var value = ${Xe(A,i)};\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m + local_id.y < uniforms.M && w + local_id.x < uniforms.K) {\n tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x];\n }\n if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) {\n tileK[TILE_SIZE * local_id.y + local_id.x] = key[kOffset + local_id.y * uniforms.K + w + local_id.x];\n }\n workgroupBarrier();\n\n for (var k: u32 = 0u; k({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:m,programUniforms:h}),getShaderSource:b},{inputs:w,outputs:[-1]})[0];return ic(e,$,n.batchSize*n.numHeads*n.sequenceLength,n.totalSequenceLength),$},sc=(e,t,r,a)=>{let n=[a.batchSize,a.sequenceLength,a.vHiddenSize],o=12,s={x:Math.ceil(a.vHeadSize/o),y:Math.ceil(a.sequenceLength/o),z:a.batchSize*a.numHeads},l=[{type:12,data:a.sequenceLength},{type:12,data:a.totalSequenceLength},{type:12,data:a.vHeadSize},{type:12,data:a.numHeads},{type:12,data:a.vHiddenSize}],i=c=>{let f=D(\"probs\",t.dataType,t.dims),m=D(\"v\",r.dataType,r.dims),h=q(\"output\",t.dataType,n),w=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"v_hidden_size\",type:\"u32\"}];return`\n const TILE_SIZE = ${o}u;\n var tileQ: array<${f.type.value}, ${o*o}>;\n var tileK: array<${f.type.value}, ${o*o}>;\n ${c.registerUniforms(w).declareVariables(f,m,h)}\n ${c.mainStart([o,o,1])}\n let headIdx = workgroup_id.z;\n let m = workgroup_id.y * TILE_SIZE + local_id.y;\n let n = workgroup_id.x * TILE_SIZE + local_id.x;\n\n let offsetA = headIdx * (uniforms.M * uniforms.K) + m * uniforms.K;\n let offsetB = headIdx * (uniforms.N * uniforms.K) + n;\n\n var value = ${f.type.storage}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\n tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x];\n }\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\n tileK[TILE_SIZE * local_id.y + local_id.x] = v[offsetB + (w + local_id.y) * uniforms.N];\n }\n workgroupBarrier();\n for (var k: u32 = 0u; k({outputs:[{dims:n,dataType:t.dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:i},{inputs:[t,r],outputs:[0]})[0]},bn=(e,t,r,a,n,o,s,l,i,c,f)=>{let m=oc(e,t,r,i,c,f);sc(e,m,a,c)},uc=(e,t)=>{let r=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],a=t.sequenceLength,n=t.inputHiddenSize,o=t.headSize,s=12,l={x:Math.ceil(t.headSize/s),y:Math.ceil(t.sequenceLength/s),z:t.batchSize*t.numHeads},i=[e.inputs[0],e.inputs[1],e.inputs[2]],c=[{type:12,data:a},{type:12,data:n},{type:12,data:o},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],f=m=>{let h=q(\"output_q\",i[0].dataType,r),w=q(\"output_k\",i[0].dataType,r),b=q(\"output_v\",i[0].dataType,r),$=D(\"input\",i[0].dataType,i[0].dims),I=D(\"weight\",i[1].dataType,i[1].dims),S=D(\"bias\",i[2].dataType,i[2].dims),v=$.type.storage,E=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"head_size\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"},{name:\"ldb\",type:\"u32\"}];return`\n const TILE_SIZE = ${s}u;\n var tileInput: array<${v}, ${s*s}>;\n var tileWeightQ: array<${v}, ${s*s}>;\n var tileWeightK: array<${v}, ${s*s}>;\n var tileWeightV: array<${v}, ${s*s}>;\n ${m.registerUniforms(E).declareVariables($,I,S,h,w,b)}\n ${m.mainStart([s,s,1])}\n let batchIndex = workgroup_id.z / uniforms.num_heads;\n let headNumber = workgroup_id.z % uniforms.num_heads;\n let m = workgroup_id.y * TILE_SIZE + local_id.y;\n let n = workgroup_id.x * TILE_SIZE + local_id.x;\n\n let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K;\n let biasOffsetQ = headNumber * uniforms.head_size;\n let biasOffsetK = uniforms.hidden_size + biasOffsetQ;\n let biasOffsetV = uniforms.hidden_size + biasOffsetK;\n\n var valueQ = ${v}(0);\n var valueK = ${v}(0);\n var valueV = ${v}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\n tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x];\n }\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\n let offset = n + (w + local_id.y) * uniforms.ldb;\n tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset];\n tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset];\n tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset];\n }\n workgroupBarrier();\n for (var k: u32 = 0u; k({outputs:[{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:l,programUniforms:c}),getShaderSource:f},{inputs:i,outputs:[-1,-1,-1]})},Uo=(e,t)=>{let r=ac(e.inputs,t),[a,n,o]=uc(e,r);return bn(e,a,n,o,e.inputs[4],void 0,void 0,void 0,e.inputs[5],r,t)}});var lc,dc,cc,No,Wo=F(()=>{\"use strict\";lt();ie();_e();Ye();be();lc=(e,t)=>{if(!e||e.length!==5)throw new Error(\"BatchNormalization requires 5 inputs\");let r=(a,n,o)=>{let s=n.length;if(s!==a.length)throw new Error(`${o}: num dimensions != ${s}`);n.forEach((l,i)=>{if(l!==a[i])throw new Error(`${o}: dim[${i}] do not match`)})};if(e[0].dims.length>1){let a=t.format===\"NHWC\"?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);r(e[1].dims,a,\"Invalid input scale\"),r(e[2].dims,a,\"Invalid input B\"),r(e[3].dims,a,\"Invalid input mean\"),r(e[4].dims,a,\"Invalid input var\")}else r(e[1].dims,[1],\"Invalid input scale\"),r(e[2].dims,[1],\"Invalid input B\"),r(e[3].dims,[1],\"Invalid input mean\"),r(e[4].dims,[1],\"Invalid input var\")},dc=(e,t)=>{let{epsilon:r,spatial:a,format:n}=t,o=e[0].dims,s=a?Me(o[o.length-1]):1,l=n===\"NHWC\"&&o.length>1?s:1,i=M.size(o)/s,c=a,f=c?o.length:o,m=D(\"x\",e[0].dataType,e[0].dims,s),h=D(\"scale\",e[1].dataType,e[1].dims,l),w=D(\"bias\",e[2].dataType,e[2].dims,l),b=D(\"inputMean\",e[3].dataType,e[3].dims,l),$=D(\"inputVar\",e[4].dataType,e[4].dims,l),I=q(\"y\",e[0].dataType,f,s),S=()=>{let E=\"\";if(a)E=`let cOffset = ${o.length===1?\"0u\":n===\"NHWC\"?`outputIndices[${o.length-1}] / ${s}`:\"outputIndices[1]\"};`;else if(n===\"NCHW\")E=`\n ${I.indicesSet(\"outputIndices\",\"0\",\"0\")}\n let cOffset = ${I.indicesToOffset(\"outputIndices\")};`;else{E=`var cIndices = ${h.type.indices}(0);\n cIndices[0] = outputIndices[${o.length-1}];`;for(let A=1;A`\n const epsilon = ${r};\n ${E.registerUniform(\"outputSize\",\"u32\").declareVariables(m,h,w,b,$,I)}\n ${E.mainStart()}\n ${E.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n var outputIndices = ${I.offsetToIndices(`global_idx * ${s}`)};\n ${S()}\n let scale = ${h.getByOffset(\"cOffset\")};\n let bias = ${w.getByOffset(\"cOffset\")};\n let inputMean = ${b.getByOffset(\"cOffset\")};\n let inputVar = ${$.getByOffset(\"cOffset\")};\n let x = ${m.getByOffset(\"global_idx\")};\n let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias;\n ${I.setByOffset(\"global_idx\",\"value\")}\n }`;return{name:\"BatchNormalization\",shaderCache:{hint:`${t.epsilon}_${t.format}_${a}_${s}`,inputDependencies:c?[\"rank\",\"type\",\"type\",\"type\",\"type\"]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:c?[{type:12,data:i},...K(o)]:[{type:12,data:i}]})}},cc=e=>$e(e),No=(e,t)=>{let{inputs:r,outputCount:a}=e,n=cc({...t,outputCount:a});if(Ae.webgpu.validateInputContent&&lc(r,n),t.trainingMode)throw new Error(\"BatchNormalization trainingMode is not supported yet.\");e.compute(dc(r,n))}});var pc,fc,Vo,Go=F(()=>{\"use strict\";_e();be();pc=e=>{if(e[0].dims.length!==3)throw new Error(\"input should have 3 dimensions\");if(![320,640,1280].includes(e[0].dims[2]))throw new Error(\"number of channels should be 320, 640 or 1280\");if(e[1].dims.length!==1)throw new Error(\"bias is expected to have 1 dimensions\");if(e[0].dims[2]!==e[1].dims[0])throw new Error(\"last dimension of input and bias are not the same\")},fc=e=>{let t=e[0].dims,r=e[0].dims[2],a=M.size(t)/4,n=e[0].dataType,o=D(\"input\",n,t,4),s=D(\"bias\",n,[r],4),l=D(\"residual\",n,t,4),i=q(\"output\",n,t,4);return{name:\"BiasAdd\",getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:f=>`\n const channels = ${r}u / 4;\n ${f.declareVariables(o,s,l,i)}\n\n ${f.mainStart()}\n ${f.guardAgainstOutOfBoundsWorkgroupSizes(a)}\n let value = ${o.getByOffset(\"global_idx\")}\n + ${s.getByOffset(\"global_idx % channels\")} + ${l.getByOffset(\"global_idx\")};\n ${i.setByOffset(\"global_idx\",\"value\")}\n }`}},Vo=e=>{pc(e.inputs),e.compute(fc(e.inputs))}});var mc,Oe,Ho,Lo,Fo,qo,jo,Ko,Yo,Zo,Xo,hc,Qo,Jo,es,ts,wn,rs,vn,ns,as,is,os,ss,us,ls,ds,cs,ps,fs,ms,hs,gs,ys,bs,ws,vs,ya,ba,$s,_s,xs,$n=F(()=>{\"use strict\";ie();_e();Ye();be();mc=(e,t,r,a,n,o)=>{let s=Math.ceil(t/4),l=\"\";typeof n==\"string\"?l=`${n}(a)`:l=n(\"a\");let i=D(\"inputData\",r,[s],4),c=q(\"outputData\",a,[s],4);return`\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(i,c)}\n\n ${o??\"\"}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n\n let a = ${i.getByOffset(\"global_idx\")};\n ${c.setByOffset(\"global_idx\",l)}\n }`},Oe=(e,t,r,a,n,o=e.dataType)=>({name:t,shaderCache:{hint:n,inputDependencies:[\"type\"]},getShaderSource:s=>mc(s,M.size(e.dims),e.dataType,o,r,a),getRunData:s=>({outputs:[{dims:e.dims,dataType:o}],dispatchGroup:{x:Math.ceil(M.size(s[0].dims)/64/4)},programUniforms:[{type:12,data:Math.ceil(M.size(e.dims)/4)}]})}),Ho=e=>{e.compute(Oe(e.inputs[0],\"Abs\",\"abs\"))},Lo=e=>{e.compute(Oe(e.inputs[0],\"Acos\",\"acos\"))},Fo=e=>{e.compute(Oe(e.inputs[0],\"Acosh\",\"acosh\"))},qo=e=>{e.compute(Oe(e.inputs[0],\"Asin\",\"asin\"))},jo=e=>{e.compute(Oe(e.inputs[0],\"Asinh\",\"asinh\"))},Ko=e=>{e.compute(Oe(e.inputs[0],\"Atan\",\"atan\"))},Yo=e=>{e.compute(Oe(e.inputs[0],\"Atanh\",\"atanh\"))},Zo=e=>$e(e),Xo=(e,t)=>{let r;switch(t.to){case 10:r=\"vec4\";break;case 1:r=\"vec4\";break;case 12:r=\"vec4\";break;case 6:r=\"vec4\";break;case 9:r=\"vec4\";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(Oe(e.inputs[0],\"Cast\",r,void 0,t.cacheKey,t.to))},hc=e=>{let t=e.length>=2&&e[1].data!==0?e[1].getFloat32Array()[0]:pn,r=e.length>=3&&e[2].data!==0?e[2].getFloat32Array()[0]:fn;return $e({min:t,max:r})},Qo=(e,t)=>{let r=e.inputs.length===1?t:hc(e.inputs),a=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"Clip\",n=>`clamp(${n}, clip_min_, clip_max_)`,`\n const clip_min_: vec4<${a}> = vec4(${a}(${r.min}));\n const clip_max_: vec4<${a}> = vec4(${a}(${r.max}));\n`,r.cacheKey),{inputs:[0]})},Jo=e=>{e.compute(Oe(e.inputs[0],\"Ceil\",\"ceil\"))},es=e=>{e.compute(Oe(e.inputs[0],\"Cos\",\"cos\"))},ts=e=>{e.compute(Oe(e.inputs[0],\"Cosh\",\"cosh\"))},wn=e=>$e(e),rs=(e,t)=>{let r=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"Elu\",a=>`elu_vf32(${a})`,`\n const elu_alpha_ = ${r}(${t.alpha});\n\n fn elu_f32(a: ${r}) -> ${r} {\n return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0);\n }\n\n fn elu_vf32(v: vec4<${r}>) -> vec4<${r}> {\n return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w));\n }`,t.cacheKey))},vn=(e=\"f32\")=>`\nconst r0: ${e} = 0.3275911;\nconst r1: ${e} = 0.254829592;\nconst r2: ${e} = -0.284496736;\nconst r3: ${e} = 1.421413741;\nconst r4: ${e} = -1.453152027;\nconst r5: ${e} = 1.061405429;\n\nfn erf_vf32(v: vec4<${e}>) -> vec4<${e}> {\n let absv = abs(v);\n let x = 1.0 / (1.0 + r0 * absv);\n return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv));\n}`,ns=e=>{let t=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"Erf\",r=>`erf_vf32(${r})`,vn(t)))},as=e=>{e.compute(Oe(e.inputs[0],\"Exp\",\"exp\"))},is=e=>{e.compute(Oe(e.inputs[0],\"Floor\",\"floor\"))},os=e=>{let t=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"Gelu\",r=>`0.5 * ${r} * (1.0 + erf_vf32(${r} * 0.7071067811865475))`,vn(t)))},ss=(e,t)=>{let r=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"LeakyRelu\",a=>`select(leaky_relu_alpha_ * ${a}, ${a}, ${a} >= vec4<${r}>(0.0))`,`const leaky_relu_alpha_ = ${r}(${t.alpha});`,t.cacheKey))},us=e=>{e.compute(Oe(e.inputs[0],\"Not\",t=>`!${t}`))},ls=e=>{e.compute(Oe(e.inputs[0],\"Neg\",t=>`-${t}`))},ds=e=>{e.compute(Oe(e.inputs[0],\"Reciprocal\",t=>`1.0/${t}`))},cs=e=>{let t=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"Relu\",r=>`select(vec4<${t}>(0.0), ${r}, ${r} > vec4<${t}>(0.0))`))},ps=e=>{e.compute(Oe(e.inputs[0],\"Sigmoid\",t=>`(1.0 / (1.0 + exp(-${t})))`))},fs=e=>$e(e),ms=(e,t)=>{let r=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"HardSigmoid\",a=>`max(vec4<${r}>(0.0), min(vec4<${r}>(1.0), ${t.alpha} * ${a} + vec4<${r}>(${t.beta})))`,void 0,t.cacheKey))},hs=e=>{e.compute(Oe(e.inputs[0],\"Sin\",\"sin\"))},gs=e=>{e.compute(Oe(e.inputs[0],\"Sinh\",\"sinh\"))},ys=e=>{e.compute(Oe(e.inputs[0],\"Sqrt\",\"sqrt\"))},bs=e=>{e.compute(Oe(e.inputs[0],\"Tan\",\"tan\"))},ws=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,vs=e=>{e.compute(Oe(e.inputs[0],\"Tanh\",ws))},ya=(e=\"f32\")=>`\nconst fast_gelu_a: ${e} = 0.5;\nconst fast_gelu_b: ${e} = 0.7978845608028654;\nconst fast_gelu_c: ${e} = 0.035677408136300125;\n\nfn tanh_v(v: vec4<${e}>) -> vec4<${e}> {\n return ${ws(\"v\")};\n}\n`,ba=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,$s=e=>{let t=at(e.inputs[0].dataType);e.compute(Oe(e.inputs[0],\"FastGelu\",ba,ya(t),void 0,e.inputs[0].dataType))},_s=(e,t)=>{let r=at(e.inputs[0].dataType);return e.compute(Oe(e.inputs[0],\"ThresholdedRelu\",a=>`select(vec4<${r}>(0.0), ${a}, ${a} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${r}>(${t.alpha});`,t.cacheKey)),0},xs=e=>{e.compute(Oe(e.inputs[0],\"Log\",\"log\"))}});var gc,yc,Cs,Is=F(()=>{\"use strict\";_e();be();$n();gc=e=>{if(e[0].dims.length!==3)throw new Error(\"input should have 3 dimensions\");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error(\"hidden state should be 2560, 5120 or 10240\");if(e[1].dims.length!==1)throw new Error(\"bias is expected to have 1 dimensions\");if(e[0].dims[2]!==e[1].dims[0])throw new Error(\"last dimension of input and bias are not the same\")},yc=e=>{let t=e[0].dims.slice();t[2]=t[2]/2;let r=D(\"input\",e[0].dataType,e[0].dims,4),a=D(\"bias\",e[0].dataType,[e[0].dims[2]],4),n=q(\"output\",e[0].dataType,t,4),o=M.size(t)/4,s=ke(e[0].dataType);return{name:\"BiasSplitGelu\",getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)}}),getShaderSource:i=>`\n const M_SQRT2 = sqrt(2.0);\n const halfChannels = ${e[0].dims[2]/4/2}u;\n\n ${i.declareVariables(r,a,n)}\n\n ${vn(s)}\n\n ${i.mainStart()}\n ${i.guardAgainstOutOfBoundsWorkgroupSizes(o)}\n let biasIdx = global_idx % halfChannels;\n let batchIndex = global_idx / halfChannels;\n let inputOffset = biasIdx + batchIndex * halfChannels * 2;\n let valueLeft = input[inputOffset] + bias[biasIdx];\n let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels];\n let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1);\n\n ${n.setByOffset(\"global_idx\",\"valueLeft * geluRight\")}\n }`}},Cs=e=>{gc(e.inputs),e.compute(yc(e.inputs))}});var bc,wc,Ct,Es,As,Ts,Os,ks,Ps,Rs,zs,Bs,Ds,Ms=F(()=>{\"use strict\";ie();_e();be();bc=(e,t,r,a,n,o,s,l,i,c,f,m)=>{let h,w;typeof l==\"string\"?h=w=(v,E)=>`${l}((${v}),(${E}))`:typeof l==\"function\"?h=w=l:(h=l.scalar,w=l.vector);let b=q(\"outputData\",f,a.length,4),$=D(\"aData\",i,t.length,4),I=D(\"bData\",c,r.length,4),S;if(n)if(o){let v=M.size(t)===1,E=M.size(r)===1,A=t.length>0&&t[t.length-1]%4===0,k=r.length>0&&r[r.length-1]%4===0;v||E?S=b.setByOffset(\"global_idx\",w(v?`${$.type.value}(${$.getByOffset(\"0\")}.x)`:$.getByOffset(\"global_idx\"),E?`${I.type.value}(${I.getByOffset(\"0\")}.x)`:I.getByOffset(\"global_idx\"))):S=`\n let outputIndices = ${b.offsetToIndices(\"global_idx * 4u\")};\n let offsetA = ${$.broadcastedIndicesToOffset(\"outputIndices\",b)};\n let offsetB = ${I.broadcastedIndicesToOffset(\"outputIndices\",b)};\n ${b.setByOffset(\"global_idx\",w(s||A?$.getByOffset(\"offsetA / 4u\"):`${$.type.value}(${$.getByOffset(\"offsetA / 4u\")}[offsetA % 4u])`,s||k?I.getByOffset(\"offsetB / 4u\"):`${I.type.value}(${I.getByOffset(\"offsetB / 4u\")}[offsetB % 4u])`))}\n `}else S=b.setByOffset(\"global_idx\",w($.getByOffset(\"global_idx\"),I.getByOffset(\"global_idx\")));else{if(!o)throw new Error(\"no necessary to use scalar implementation for element-wise binary op implementation.\");let v=(E,A,k=\"\")=>{let U=`aData[indexA${A}][componentA${A}]`,N=`bData[indexB${A}][componentB${A}]`;return`\n let outputIndices${A} = ${b.offsetToIndices(`global_idx * 4u + ${A}u`)};\n let offsetA${A} = ${$.broadcastedIndicesToOffset(`outputIndices${A}`,b)};\n let offsetB${A} = ${I.broadcastedIndicesToOffset(`outputIndices${A}`,b)};\n let indexA${A} = offsetA${A} / 4u;\n let indexB${A} = offsetB${A} / 4u;\n let componentA${A} = offsetA${A} % 4u;\n let componentB${A} = offsetB${A} % 4u;\n ${E}[${A}] = ${k}(${h(U,N)});\n `};f===9?S=`\n var data = vec4(0);\n ${v(\"data\",0,\"u32\")}\n ${v(\"data\",1,\"u32\")}\n ${v(\"data\",2,\"u32\")}\n ${v(\"data\",3,\"u32\")}\n outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:S=`\n ${v(\"outputData[global_idx]\",0)}\n ${v(\"outputData[global_idx]\",1)}\n ${v(\"outputData[global_idx]\",2)}\n ${v(\"outputData[global_idx]\",3)}\n `}return`\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables($,I,b)}\n\n ${m??\"\"}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n ${S}\n }`},wc=(e,t,r,a,n,o,s=r.dataType)=>{let l=!M.areEqual(r.dims,a.dims),i=r.dims,c=M.size(r.dims),f=!1,m=!1,h=[l];if(l){let w=vt.calcShape(r.dims,a.dims,!1);if(!w)throw new Error(\"Can't perform binary op on the given tensors\");i=w,c=M.size(i);let b=M.size(r.dims)===1,$=M.size(a.dims)===1,I=r.dims.length>0&&r.dims[r.dims.length-1]%4===0,S=a.dims.length>0&&a.dims[a.dims.length-1]%4===0;h.push(b),h.push($),h.push(I),h.push(S);let v=1;for(let E=1;Ew.toString()).join(\"_\"),inputDependencies:[\"rank\",\"rank\"]},getShaderSource:w=>bc(w,r.dims,a.dims,i,f,l,m,n,r.dataType,a.dataType,s,o),getRunData:()=>({outputs:[{dims:i,dataType:s}],dispatchGroup:{x:Math.ceil(c/64/4)},programUniforms:[{type:12,data:Math.ceil(M.size(i)/4)},...K(r.dims,a.dims,i)]})}},Ct=(e,t,r,a,n,o)=>{e.compute(wc(t,n??\"\",e.inputs[0],e.inputs[1],r,a,o))},Es=e=>{Ct(e,\"Add\",(t,r)=>`${t}+${r}`)},As=e=>{Ct(e,\"Div\",(t,r)=>`${t}/${r}`)},Ts=e=>{Ct(e,\"Equal\",{scalar:(t,r)=>`u32(${t}==${r})`,vector:(t,r)=>`vec4(${t}==${r})`},void 0,void 0,9)},Os=e=>{Ct(e,\"Mul\",(t,r)=>`${t}*${r}`)},ks=e=>{let t=D(\"input\",e.inputs[0].dataType,e.inputs[0].dims).type.value;Ct(e,\"Pow\",{scalar:(a,n)=>`pow_custom(${a},${n})`,vector:(a,n)=>`pow_vector_custom(${a},${n})`},`\n fn pow_custom(a : ${t}, b : ${t}) -> ${t} {\n if (b == ${t}(0.0)) {\n return ${t}(1.0);\n } else if (a < ${t}(0.0) && f32(b) != floor(f32(b))) {\n return ${t}(pow(f32(a), f32(b))); // NaN\n }\n return select(sign(a), ${t}(1.0), round(f32(abs(b) % ${t}(2.0))) != 1.0) * ${t}(${t===\"i32\"?\"round\":\"\"}(pow(f32(abs(a)), f32(b))));\n }\n fn pow_vector_custom(a : vec4<${t}>, b : vec4<${t}>) -> vec4<${t}> {\n // TODO: implement vectorized pow\n return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w));\n }\n `)},Ps=e=>{Ct(e,\"Sub\",(t,r)=>`${t}-${r}`)},Rs=e=>{Ct(e,\"Greater\",{scalar:(t,r)=>`u32(${t}>${r})`,vector:(t,r)=>`vec4(${t}>${r})`},void 0,void 0,9)},zs=e=>{Ct(e,\"Less\",{scalar:(t,r)=>`u32(${t}<${r})`,vector:(t,r)=>`vec4(${t}<${r})`},void 0,void 0,9)},Bs=e=>{Ct(e,\"GreaterOrEqual\",{scalar:(t,r)=>`u32(${t}>=${r})`,vector:(t,r)=>`vec4(${t}>=${r})`},void 0,void 0,9)},Ds=e=>{Ct(e,\"LessOrEqual\",{scalar:(t,r)=>`u32(${t}<=${r})`,vector:(t,r)=>`vec4(${t}<=${r})`},void 0,void 0,9)}});var $c,_c,xc,Sc,Us,Ns,Ws=F(()=>{\"use strict\";ie();_e();Ye();be();$c=(e,t)=>{if(!e||e.length<1)throw new Error(\"too few inputs\");let r=0,a=e[r],n=a.dataType,o=a.dims.length;e.forEach((s,l)=>{if(l!==r){if(s.dataType!==n)throw new Error(\"input tensors should be one type\");if(s.dims.length!==o)throw new Error(\"input tensors should have the same shape\");s.dims.forEach((i,c)=>{if(c!==t&&i!==a.dims[c])throw new Error(\"non concat dimensions must match\")})}})},_c=(e,t)=>`\n fn calculateInputIndex(index: u32) -> u32 {\n let sizeInConcatAxis = array(${t});\n for (var i: u32 = 0u; i < ${e}; i += 1u ) {\n if (index < sizeInConcatAxis[i]) {\n return i;\n }\n }\n return ${e}u;\n }`,xc=(e,t)=>{let r=e.length,a=[];for(let n=0;n{let n=M.size(r),o=new Array(e.length),s=new Array(e.length),l=0,i=[],c=[],f=[{type:12,data:n}];for(let $=0;$`uniforms.sizeInConcatAxis${$}`).join(\",\"),b=$=>`\n\n ${(()=>{$.registerUniform(\"outputSize\",\"u32\");for(let I=0;I(${w});\n ${h} -= sizeInConcatAxis[inputIndex - 1u];\n }\n\n ${xc(s,m)}\n }`;return{name:\"Concat\",shaderCache:{hint:`${t}`,inputDependencies:i},getRunData:()=>({outputs:[{dims:r,dataType:a}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:f}),getShaderSource:b}},Us=(e,t)=>{let r=e.inputs,a=r[0].dims,n=M.normalizeAxis(t.axis,a.length);$c(r,n);let o=a.slice();o[n]=r.reduce((l,i)=>l+(i.dims.length>n?i.dims[n]:0),0);let s=r.filter(l=>M.size(l.dims)>0);e.compute(Sc(s,n,o,r[0].dataType),{inputs:s})},Ns=e=>$e({axis:e.axis})});var ht,gt,yt,_n,Mt=F(()=>{\"use strict\";ie();_e();ht=(e,t,r=\"f32\")=>{switch(e.activation){case\"Relu\":return`value = max(value, ${t}(0.0));`;case\"Sigmoid\":return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case\"Clip\":return`value = clamp(value, ${t}(${r}(uniforms.clip_min)), ${t}(${r}(uniforms.clip_max)));`;case\"HardSigmoid\":return`value = max(${t}(0.0), min(${t}(1.0), ${r}(uniforms.alpha) * value + ${r}(uniforms.beta)));`;case\"LeakyRelu\":return`value = select(${r}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case\"\":return\"\";default:throw new Error(`Unsupported activation ${e.activation}`)}},gt=(e,t)=>{e.activation===\"Clip\"?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===\"HardSigmoid\"?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===\"LeakyRelu\"&&t.push({type:1,data:e.alpha})},yt=(e,t)=>{e.activation===\"Clip\"?t.push({name:\"clip_max\",type:\"f32\"},{name:\"clip_min\",type:\"f32\"}):e.activation===\"HardSigmoid\"?t.push({name:\"alpha\",type:\"f32\"},{name:\"beta\",type:\"f32\"}):e.activation===\"LeakyRelu\"&&t.push({name:\"alpha\",type:\"f32\"})},_n=e=>{let t=e?.activation||\"\";if(t===\"HardSigmoid\"){let[r,a]=e?.activation_params||[.2,.5];return{activation:t,alpha:r,beta:a}}else if(t===\"Clip\"){let[r,a]=e?.activation_params||[pn,fn];return{activation:t,clipMax:a,clipMin:r}}else if(t===\"LeakyRelu\"){let[r]=e?.activation_params||[.01];return{activation:t,alpha:r}}return{activation:t}}});var Qe,xn,Sn=F(()=>{\"use strict\";Qe=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${e}-component is not supported.`)}},xn=e=>`\n ${e?\"value = value + getBiasByOutputCoords(coords);\":\"\"}\n `});var Cn,wa=F(()=>{\"use strict\";Cn=e=>`\nfn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\n return dot(coords, vec4(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n}\nfn getOutputIndexFromCoords(coords : vec4) -> i32 {\n return dot(coords, vec4(\n i32(${e}.x), i32(${e}.y), i32(${e}.z), 1));\n}\n`});var Cc,Ic,Tr,Vs,Ec,Or,Ac,In,kr=F(()=>{\"use strict\";ie();_e();be();Mt();Sn();Cc=(e,t)=>e?`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart / innerElementSize + inputCol${t?\", batchIndices\":\"\"});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRow + innerRow,\n kStart / innerElementSize + inputCol${t?\", batchIndices\":\"\"});\n `,Ic=(e,t)=>e?`\n let ACached0 = mm_Asub[k * innerElementSize][localRow];\n let ACached1 = mm_Asub[k * innerElementSize + 1][localRow];\n let ACached2 = mm_Asub[k * innerElementSize + 2][localRow];\n ${t===3?\"\":\"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];\"}\n for (var i = 0; i < rowPerThread; i = i + 1) {\n acc[i] = BCached0 * ACached0[i] + acc[i];\n acc[i] = BCached1 * ACached1[i] + acc[i];\n acc[i] = BCached2 * ACached2[i] + acc[i];\n ${t===3?\"\":\"acc[i] = BCached3 * ACached3[i] + acc[i];\"}\n }`:`\n for (var i = 0; i < rowPerThread; i = i + 1) {\n let ACached = mm_Asub[tileRow + i][k];\n acc[i] = BCached0 * ACached.x + acc[i];\n acc[i] = BCached1 * ACached.y + acc[i];\n acc[i] = BCached2 * ACached.z + acc[i];\n ${t===3?\"\":\"acc[i] = BCached3 * ACached.w + acc[i];\"}\n }`,Tr=(e,t,r=\"f32\",a,n=!1,o=32,s=!1,l=32)=>{let i=t[1]*e[1],c=t[0]*e[0],f=n?i:o,m=n?o:i,h=f/t[0],w=o/t[1];if(!((n&&h===4&&e[1]===4||!n&&(h===3||h===4))&&f%t[0]===0&&o%t[1]===0&&e[0]===4))throw new Error(`If transposeA ${n} is true, innerElementSize ${h} and workPerThread[1] ${e[1]} must be 4.\n Otherwise, innerElementSize ${h} must be 3 or 4.\n tileAWidth ${f} must be divisible by workgroupSize[0]${t[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return`\nvar mm_Asub: array, ${f/h}>, ${m}>;\nvar mm_Bsub: array, ${c/e[0]}>, ${o}>;\n\nconst rowPerThread = ${e[1]};\nconst colPerThread = ${e[0]};\nconst innerElementSize = ${h};\nconst tileInner = ${o};\n\n@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})\nfn main(@builtin(local_invocation_id) localId : vec3,\n @builtin(global_invocation_id) globalId : vec3,\n @builtin(workgroup_id) workgroupId : vec3) {\n let localRow = i32(localId.y);\n let tileRow = localRow * rowPerThread;\n let tileCol = i32(localId.x);\n\n let globalRow =i32(globalId.y) * rowPerThread;\n let globalCol = i32(globalId.x);\n let batch = ${s?\"0\":\"i32(globalId.z)\"};\n ${a?`let batchIndices = ${a.offsetToIndices(\"u32(batch)\")};`:\"\"}\n let globalRowStart = i32(workgroupId.y) * ${i};\n\n let num_tiles = ${s?`${Math.ceil(l/o)}`:\"(uniforms.dim_inner - 1) / tileInner + 1\"};\n var kStart = ${s?`i32(globalId.z) * ${l}`:\"0\"};\n\n var acc: array, rowPerThread>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${w};\n for (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${Cc(n,a)}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${w}; innerRow = innerRow + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${a?\", batchIndices\":\"\"});\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < tileInner / innerElementSize; k = k + 1) {\n let BCached0 = mm_Bsub[k * innerElementSize][tileCol];\n let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol];\n let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol];\n ${h===3?\"\":\"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];\"}\n\n ${Ic(n,h)}\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n}`},Vs=(e,t)=>e?`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart + inputCol${t?\", batchIndices\":\"\"});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRowStart + inputRow,\n kStart + inputCol${t?\", batchIndices\":\"\"});\n `,Ec=e=>e?\"let ACached = mm_Asub[k][tileRow + innerRow];\":\"let ACached = mm_Asub[tileRow + innerRow][k];\",Or=(e,t,r=\"f32\",a,n=!1,o=32,s=!1,l=32,i=!1)=>{let c=e[1]*t[1],f=e[0]*t[0],m=n?c:o,h=n?o:c;if(!(h%t[1]===0&&m%t[0]===0&&o%t[1]===0))throw new Error(`tileAHight ${h} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${m} must be divisible by workgroupSize[0]${t[0]}, tileInner ${o} must be divisible by workgroupSize[1]${t[1]}`);let w=h/t[1],b=m/t[0],$=o/t[1],I=i?`\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${c};\n let globalColStart = i32(workgroupId.x) * ${f};\n\n // Loop over shared dimension.\n for (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${h}; inputRow = inputRow + ${t[1]}) {\n for (var inputCol = localCol; inputCol < ${m}; inputCol = inputCol + ${t[0]}) {\n ${Vs(n,a)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${t[1]}) {\n for (var inputCol = localCol; inputCol < ${f}; inputCol = inputCol + ${t[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalColStart + inputCol${a?\", batchIndices\":\"\"});\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<${r}, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}];\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let ACached = ${n?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] +\n ACached * BCached[innerCol];\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let gRow = globalRowStart + localRow + innerRow * ${t[1]};\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let gCol = globalColStart + localCol + innerCol * ${t[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n `:`\nlet tileRow = i32(localId.y) * rowPerThread;\nlet tileCol = i32(localId.x) * colPerThread;\n\nlet globalRow = i32(globalId.y) * rowPerThread;\nlet globalCol = i32(globalId.x) * colPerThread;\nlet globalRowStart = i32(workgroupId.y) * ${c};\n\nlet tileRowA = i32(localId.y) * ${w};\nlet tileColA = i32(localId.x) * ${b};\nlet tileRowB = i32(localId.y) * ${$};\n// Loop over shared dimension.\nfor (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${w}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < ${b}; innerCol = innerCol + 1) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${Vs(n,a)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${$}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalCol + innerCol${a?\", batchIndices\":\"\"});\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<${r}, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n ${Ec(n)}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol];\n }\n }\n }\n\n workgroupBarrier();\n}\n\nfor (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n}\n`;return`\n var mm_Asub : array, ${h}>;\n var mm_Bsub : array, ${o}>;\n const rowPerThread = ${e[1]};\n const colPerThread = ${e[0]};\n const tileInner = ${o};\n\n@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})\nfn main(@builtin(local_invocation_id) localId : vec3,\n @builtin(global_invocation_id) globalId : vec3,\n @builtin(workgroup_id) workgroupId : vec3) {\n let batch = ${s?\"0\":\"i32(globalId.z)\"};\n ${a?`let batchIndices = ${a.offsetToIndices(\"u32(batch)\")};`:\"\"}\n let num_tiles = ${s?`${Math.ceil(l/o)}`:\"(uniforms.dim_inner - 1) / tileInner + 1\"};\n var kStart = ${s?`i32(globalId.z) * ${l}`:\"0\"};\n\n var acc : array, rowPerThread>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${I}\n }\n`},Ac=(e,t,r,a,n,o=!1)=>{let[s,l,i]=n,[c,f,m,h]=a,w=ar(s,i),b=ar(l,i),$=ke(a[0].type.tensor),I=()=>{let E=f.rank,A=c.rank,k=`var aIndices: ${f.type.indices};`;for(let U=E-2-1,N=A-1;U>=0;U--,N--)k+=`\naIndices[${U}] = ${A>1?`batchIndices[${N}]`:\"batchIndices\"};`;return w.forEach(U=>{k+=`\naIndices[${U}] = 0;`}),k+=`\naIndices[${E-2}] = u32(row);\n aIndices[${E-1}] = u32(colIn);`,k},S=()=>{let E=m.rank,A=c.rank,k=`var bIndices: ${m.type.indices};`;for(let U=E-2-1,N=A-1;U>=0;U--,N--)k+=`\nbIndices[${U}] = ${A>1?`batchIndices[${N}]`:\"batchIndices\"};`;return b.forEach(U=>{k+=`\nbIndices[${U}] = 0;`}),k+=`\nbIndices[${E-2}] = u32(row);\n bIndices[${E-1}] = u32(colIn);`,k};return`\n fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${c.type.indices}) -> ${Qe(e,$)} {\n var value = ${Qe(e,$)}(0.0);\n let col = colIn * ${e};\n if(row < uniforms.dim_a_outer && col < uniforms.dim_inner)\n {\n ${I()}\n value = ${f.getByIndices(\"aIndices\")};\n }\n return value;\n }\n\n fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${c.type.indices}) -> ${Qe(e,$)} {\n var value = ${Qe(e,$)}(0.0);\n let col = colIn * ${e};\n if(row < uniforms.dim_inner && col < uniforms.dim_b_outer)\n {\n ${S()}\n value = ${m.getByIndices(\"bIndices\")};\n }\n return value;\n }\n\n fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${Qe(e,$)}) {\n let col = colIn * ${e};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\n var value = valueIn;\n let coords = vec3(batch, row, colIn);\n ${t?`value = value + ${o?\"bias[colIn]\":`${Qe(e,$)}(bias[row])`};`:\"\"}\n ${r}\n ${h.setByIndices(\"vec3(coords)\",\"value\")}\n }\n }\n `},In=(e,t,r,a,n=!1)=>{let o=e[0].dims,s=e[1].dims,l=o.slice(0,-2),i=s.slice(0,-2),c=a?a.slice(0,-2):r.slice(0,-2),f=M.size(c),m=o[o.length-2],h=o[o.length-1],w=s[s.length-1],b=h%4===0&&w%4===0,$=m<=8?[4,1,1]:[4,4,1],I=[8,8,1],S=[Math.ceil(w/I[0]/$[0]),Math.ceil(m/I[1]/$[1]),Math.ceil(f/I[2]/$[2])],v=b?4:1,E=[...l,m,h/v],A=E.length,k=[...i,h,w/v],U=k.length,N=[f,m,w/v],H=[{type:6,data:m},{type:6,data:w},{type:6,data:h}];gt(t,H),H.push(...K(c,E,k));let z=[\"rank\",\"rank\"],L=e.length>2;L&&(H.push(...K(e[2].dims)),z.push(\"rank\")),H.push(...K(N));let pe=Ie=>{let we=c.length,ne=hn(\"batchDims\",e[0].dataType,we,1),Ue=ke(e[0].dataType),X=D(\"a\",e[0].dataType,A,v),xe=D(\"b\",e[1].dataType,U,v),fe=q(\"result\",e[0].dataType,N.length,v),ue=[X,xe];if(L){let G=n?v:1;ue.push(D(\"bias\",e[2].dataType,e[2].dims.length,G))}let se=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"}];yt(t,se);let he=ke(fe.type.tensor),Ee=ht(t,fe.type.value,he),Le=Ac(v,L,Ee,[ne,X,xe,fe],[l,i,c],n);return`\n ${Ie.registerUniforms(se).registerInternalVariables(ne).declareVariables(...ue,fe)}\n ${Le}\n ${b?Tr($,I,Ue,ne):Or($,I,Ue,ne)}\n `};return{name:\"MatMul\",shaderCache:{hint:`${$};${t.activation};${b};${n}`,inputDependencies:z},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:S[0],y:S[1],z:S[2]},programUniforms:H}),getShaderSource:pe}}});var Tc,Gs,Hs=F(()=>{\"use strict\";ie();Dt();be();Mt();Sn();wa();kr();Tc=(e,t,r,a,n=!1,o,s=4,l=4,i=4,c=\"f32\")=>{let f=L=>{switch(L){case 1:return\"resData = x[xIndex];\";case 3:return`resData = vec3<${c}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return\"resData = x[xIndex / 4];\";default:throw new Error(`innerElementSize ${L} is not supported.`)}},m=L=>{switch(L){case 1:return\"return w[row * i32(uniforms.w_shape[3]) + colIn];\";case 4:return\"return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];\";default:throw new Error(`innerElementSize ${L} is not supported.`)}},h=e?`\n let coord = vec4(batch, xRow, xCol, xCh);\n `:`\n let coord = vec4(batch, xCh, xRow, xCol);\n `,w=e?`\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n `:`\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `,b=e?\"i32(uniforms.x_shape[1])\":\"i32(uniforms.x_shape[2])\",$=e?\"i32(uniforms.x_shape[2])\":\"i32(uniforms.x_shape[3])\",I=e?\"row\":\"col\",S=e?\"col\":\"row\",v=`\n let inChannels = i32(uniforms.w_shape[2]);\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n let outRow = ${I} / outWidth;\n let outCol = ${I} % outWidth;\n\n let WRow = ${S} / (i32(uniforms.w_shape[1]) * inChannels);\n let WCol = ${S} / inChannels % i32(uniforms.w_shape[1]);\n let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0];\n let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1];\n let xCh = ${S} % inChannels;\n var resData = ${Qe(s,c)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${b} && xCol >= 0 && xCol < ${$}) {\n ${h}\n let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape));\n ${f(s)}\n }\n return resData;`,E=e?t&&a?`\n let col = colIn * ${s};\n ${v}`:`\n let col = colIn * ${s};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\n ${v}\n }\n return ${Qe(s,c)}(0.0);`:a&&r?`\n let col = colIn * ${s};\n ${v}`:`\n let col = colIn * ${s};\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\n ${v}\n }\n return ${Qe(s,c)}(0.0);`,A=`${m(l)}`,k=Qe(i,c),U=e?Qe(s,c):Qe(l,c),N=e?Qe(l,c):Qe(s,c),H=ht(o,k,c);return`\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${U} {\n ${e?E:A}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${N} {\n ${e?A:E}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${k}) {\n let col = colIn * ${i};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer)\n {\n var value = valueIn;\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n ${w}\n ${xn(n)}\n ${H}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`},Gs=(e,t,r,a,n,o,s,l)=>{let i=t.format===\"NHWC\",c=i?e[0].dims[3]:e[0].dims[1],f=r[0],m=i?r[2]:r[3],h=i?r[1]:r[2],w=i?r[3]:r[1],b=i&&(c%4===0||c%3===0)&&w%4===0,$=i?w:m*h,I=i?m*h:w,S=[8,8,1],v=a<=8?[4,1,1]:[4,4,1],E=[Math.ceil($/S[0]/v[0]),Math.ceil(I/S[1]/v[1]),Math.ceil(f/S[2]/v[2])];De(\"verbose\",()=>`[conv2d_mm_webgpu] dispatch = ${E}`);let A=b?i&&c%4!==0?3:4:1,k=S[1]*v[1],U=S[0]*v[0],N=Math.max(S[0]*A,S[1]),H=a%k===0,z=n%U===0,L=o%N===0,pe=b?[A,4,4]:[1,1,1],Ie=[{type:6,data:a},{type:6,data:n},{type:6,data:o},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];gt(t,Ie),Ie.push(...K(e[0].dims,e[1].dims));let we=[\"rank\",\"rank\"];s&&(Ie.push(...K(e[2].dims)),we.push(\"rank\")),Ie.push(...K(r));let ne=Ue=>{let X=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"},{name:\"pad\",type:\"i32\",length:2},{name:\"stride\",type:\"i32\",length:2},{name:\"dilation\",type:\"i32\",length:2}];yt(t,X);let xe=b?4:1,fe=ke(e[0].dataType),ue=`\n fn setOutputAtIndex(flatIndex : i32, value : ${b?`vec4<${fe}>`:fe}) {\n result[flatIndex] = ${b?`vec4<${fe}>`:fe}(value);\n }\n fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${b?`vec4<${fe}>`:fe}) {\n let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3));\n setOutputAtIndex(flatIndex ${b?\"/ 4\":\"\"}, value);\n }`,se=D(\"x\",e[0].dataType,e[0].dims.length,A===3?1:A),he=D(\"w\",e[1].dataType,e[1].dims.length,xe),Ee=[se,he],Le=q(\"result\",e[0].dataType,r.length,xe);if(s){let G=D(\"bias\",e[2].dataType,e[2].dims.length,xe);Ee.push(G),ue+=`\n fn getBiasByOutputCoords(coords : vec4) -> ${b?`vec4<${fe}>`:fe} {\n return bias[coords.${i?\"w\":\"y\"}${b?\"/ 4\":\"\"}];\n }`}return`\n ${Cn(\"uniforms.result_strides\")}\n //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4,\n // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2,\n // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 };\n ${Ue.registerUniforms(X).declareVariables(...Ee,Le)}\n ${ue}\n ${Tc(i,H,z,L,s,t,pe[0],pe[1],pe[2],fe)}\n ${b?Tr(v,S,fe,void 0,!i,N):Or(v,S,fe,void 0,!i,N,!1,void 0,l)}`};return{name:\"Conv2DMatMul\",shaderCache:{hint:`${t.cacheKey};${A};${b};${H};${z};${L};${k};${U};${N}`,inputDependencies:we},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:E[0],y:E[1],z:E[2]},programUniforms:Ie}),getShaderSource:ne}}});var va,Ls,Fs=F(()=>{\"use strict\";ie();_e();be();$a();Mt();va=(e,t,r)=>{let a=e.length>2,n=a?\"value += b[output_channel];\":\"\",o=e[0].dims,s=e[1].dims,l=s[0]/t.group,i=t.format===\"NHWC\",c=En(o,s,t.dilations,t.pads,t.strides,i),f=M.size(c),m=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:l}];gt(t,m),m.push(...K(o,s,c));let h=[\"rank\",\"rank\"];a&&(m.push(...K(e[2].dims)),h.push(\"rank\")),m.push(...K(c));let w=b=>{let $=q(\"output\",e[0].dataType,c.length),I=ke($.type.tensor),S=ht(t,$.type.value,I),v=D(\"x\",e[0].dataType,o.length),E=D(\"w\",e[1].dataType,s.length),A=[v,E];a&&A.push(D(\"b\",e[2].dataType,e[2].dims));let k=[{name:\"output_size\",type:\"u32\"},{name:\"dilations\",type:\"u32\",length:t.dilations.length},{name:\"strides\",type:\"u32\",length:2},{name:\"pads\",type:\"u32\",length:2},{name:\"output_channels_per_group\",type:\"u32\"}];return yt(t,k),`\n ${b.registerUniforms(k).declareVariables(...A,$)}\n\n ${b.mainStart()}\n ${b.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let outputIndices = ${$.offsetToIndices(\"global_idx\")};\n let batch: u32 = outputIndices[0];\n let output_channel: u32 = outputIndices[${i?3:1}];\n let xRCCorner: vec2 = vec2(outputIndices[${i?1:2}], outputIndices[${i?2:3}]) * uniforms.strides - uniforms.pads;\n let group_id: u32 = output_channel / uniforms.output_channels_per_group;\n\n var value: ${$.type.value} = ${$.type.value}(0);\n for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) {\n let input_channel = group_id * uniforms.w_shape[1] + wInChannel;\n for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) {\n let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0];\n\n if (xHeight < 0u || xHeight >= uniforms.x_shape[${i?1:2}]) {\n continue;\n }\n\n for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) {\n let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1];\n if (xWidth < 0u || xWidth >= uniforms.x_shape[${i?2:3}]) {\n continue;\n }\n\n let xVal = ${i?v.get(\"batch\",\"xHeight\",\"xWidth\",\"input_channel\"):v.get(\"batch\",\"input_channel\",\"xHeight\",\"xWidth\")};\n let wVal = ${E.get(\"output_channel\",\"wInChannel\",\"wHeight\",\"wWidth\")};\n value += xVal*wVal;\n }\n }\n }\n ${n}\n ${S}\n ${$.setByOffset(\"global_idx\",\"value\")}\n }`};return{name:\"GroupedConv\",shaderCache:{hint:t.cacheKey,inputDependencies:h},getRunData:()=>({outputs:[{dims:r?r(c):c,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:m}),getShaderSource:w}},Ls=(e,t,r)=>{let a=e.length>2,n=Me(r[3]),o=Me(r[2]),s=M.size(r)/n/o,l=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/n],i=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/n],c=[r[0],r[1],r[2],r[3]/n],f=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];gt(t,f),f.push(...K(l,i,c));let m=(o-1)*t.strides[1]+i[1],h=w=>{let b=q(\"output\",e[0].dataType,c.length,n),$=ke(b.type.tensor),I=ht(t,b.type.value,$),S=D(\"x\",e[0].dataType,l.length,n),v=D(\"w\",e[1].dataType,i.length,n),E=[S,v];a&&E.push(D(\"b\",e[2].dataType,e[2].dims,n));let A=a?\"value += b[output_channel];\":\"\",k=[{name:\"output_size\",type:\"u32\"},{name:\"strides\",type:\"i32\",length:2},{name:\"pads\",type:\"i32\",length:2}];return yt(t,k),`\n ${w.registerUniforms(k).declareVariables(...E,b)}\n ${w.mainStart()}\n ${w.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n let width0 = uniforms.output_shape[3];\n let output_channel = global_idx % width0;\n var index1 = global_idx / width0;\n let width1 = uniforms.output_shape[2] / ${o}u;\n let col = (index1 % width1) * ${o}u;\n index1 = index1 / width1;\n let row = index1 % uniforms.output_shape[1];\n let batch = index1 / uniforms.output_shape[1];\n\n let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads;\n\n var x_vals: array<${S.type.value}, ${m}>;\n var values: array<${b.type.value}, ${o}>;\n let input_channel = output_channel;\n // Use constant instead of uniform can give better performance for w's height/width.\n for (var w_height: u32 = 0u; w_height < ${i[0]}; w_height++) {\n let x_height = x_corner.x + i32(w_height);\n if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) {\n for (var i = 0; i < ${m}; i++) {\n let x_width = x_corner.y + i;\n if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) {\n x_vals[i] = ${S.get(\"batch\",\"u32(x_height)\",\"u32(x_width)\",\"input_channel\")};\n } else {\n x_vals[i] = ${S.type.value}(0);\n }\n }\n for (var w_width: u32 = 0u; w_width < ${i[1]}; w_width++) {\n let w_val = ${v.get(\"w_height\",\"w_width\",\"0\",\"output_channel\")};\n for (var i = 0u; i < ${o}u; i++) {\n values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]);\n }\n }\n }\n }\n\n for (var i = 0u; i < ${o}u; i++) {\n var value = values[i];\n ${A}\n ${I}\n ${b.set(\"batch\",\"row\",\"col + i\",\"output_channel\",\"value\")};\n }\n }`};return{name:\"GroupedConv-Vectorize\",shaderCache:{hint:`${t.cacheKey};${n};${o};${m};${i[0]};${i[1]}`,inputDependencies:a?[\"rank\",\"rank\",\"type\"]:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:f}),getShaderSource:h}}});var _a,Oc,qs,xa=F(()=>{\"use strict\";ie();_e();kr();be();Mt();_a=(e,t,r,a,n=!1)=>{let o=e[0].dims,s=e[1].dims,l=o[o.length-2],i=s[s.length-1],c=o[o.length-1],f=Me(i),m=Me(c),h=Me(l),w=M.size(r)/f/h,b=e.length>2,$=a?a.slice(0,-2):r.slice(0,-2),S=[M.size($),l,i],v=[{type:12,data:w},{type:12,data:l},{type:12,data:i},{type:12,data:c}];gt(t,v),v.push(...K($,o,s)),b&&v.push(...K(e[2].dims)),v.push(...K(S));let E=A=>{let k=hn(\"batch_dims\",e[0].dataType,$.length),U=D(\"a\",e[0].dataType,o.length,m),N=D(\"b\",e[1].dataType,s.length,f),H=q(\"output\",e[0].dataType,S.length,f),z=ke(H.type.tensor),L=ht(t,H.type.value,z),pe=[U,N],Ie=\"\";if(b){let se=n?f:1;pe.push(D(\"bias\",e[2].dataType,e[2].dims.length,se)),Ie=`${n?`value += bias[col / ${se}];`:`value += ${H.type.value}(bias[row + i]);`}`}let we=o.slice(0,-2),ne=s.slice(0,-2),Ue=ar(we,$),X=ar(ne,$),xe=[{name:\"output_size\",type:\"u32\"},{name:\"M\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"K\",type:\"u32\"}];yt(t,xe);let fe=(se,he)=>{let Ee=se.rank,Le=se.name;if(Ee===2)return`var ${Le}_indices = ${se.type.indices}(0u, 0u);`;let G=k.rank,J=`var ${Le}_indices: ${se.type.indices};`;for(let Se=Ee-2-1,Je=G-1;Se>=0;Se--,Je--)J+=`\n${Le}_indices[${Se}] = ${G>1?`batch_indices[${Je}]`:\"batch_indices\"};`;return he.forEach(Se=>{J+=`\n${Le}_indices[${Se}] = 0;`}),J+=`${Le}_indices[${Ee-2}] = 0u;\n ${Le}_indices[${Ee-1}] = 0u;`,J},ue=()=>{let se=`var a_data: ${U.type.value};`;for(let he=0;he;\n for (var k: u32 = 0u; k < uniforms.K; k = k + ${m}) {\n ${ue()}\n }\n for (var i = 0u; i < ${h}u; i++) {\n var value = values[i];\n ${Ie}\n ${L}\n let cur_indices = ${H.type.indices}(batch, row + i, col);\n let offset = ${H.indicesToOffset(\"cur_indices\")};\n ${H.setByOffset(`offset / ${f}`,\"value\")};\n }\n }\n `};return{name:\"MatMulNaive\",shaderCache:{hint:`${t.activation};${f};${m};${h};${n}`,inputDependencies:b?[\"rank\",\"rank\",\"rank\"]:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(w/64)},programUniforms:v}),getShaderSource:E}},Oc=e=>{if(!e||e.length!==2)throw new Error(\"MatMul requires 2 inputs.\");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error(\"shared dimension does not match.\")},qs=e=>{Oc(e.inputs);let t=vt.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw new Error(\"Can't use matmul on the given tensors\");let r=t[t.length-1],a=e.inputs[0].dims[e.inputs[0].dims.length-1];r<8&&a<8?e.compute(_a(e.inputs,{activation:\"\"},t)):e.compute(In(e.inputs,{activation:\"\"},t))}});var En,Sa,kc,js,Ca,Pc,Rc,Ia,$a=F(()=>{\"use strict\";_e();Hs();kr();Fs();Mt();xa();ir();En=(e,t,r,a,n,o)=>{let s=e[0],l=e.slice(o?1:2,o?3:4),i=l.length,c=t[0],m=t.slice(2).map((b,$)=>b+(b-1)*(r[$]-1)),w=l.map((b,$)=>b+a[$]+a[$+i]).map((b,$)=>Math.floor((b-m[$]+n[$])/n[$]));return w.splice(0,0,s),w.splice(o?3:1,0,c),w},Sa=[2,3,1,0],kc=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw new Error(\"Conv requires 2 or 3 inputs\");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error(\"currently only support conv 1D and 2D\");if(e[0].dims.length!==e[1].dims.length)throw new Error(\"filter does not have same dimension as input\");let r=e[0].dims[t.format===\"NHWC\"?e[0].dims.length-1:1],a=e[1].dims[1]*t.group;if(r!==a)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error(\"invalid bias\");let n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==n*2)throw new Error(`pads should be ${n*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw new Error(\"invalid kernel shape\")},js=(e,t)=>{let r=e.kernelShape.slice();for(let o=2;o{let t=_n(e),r=e.format,a=[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][e.auto_pad],n=e.dilations,o=e.group,s=e.kernel_shape,l=e.pads,i=e.strides,c=e.w_is_const();return{autoPad:a,format:r,dilations:n,group:o,kernelShape:s,pads:l,strides:i,wIsConst:c,...t,cacheKey:`${e.format};${t.activation};`}},Pc=(e,t,r)=>{let a=js(r,t),n=r.format===\"NHWC\";if(r.group!==1){if(!e.adapterInfo.isArchitecture(\"ampere\")&&n&&t[1].dims[0]===r.group&&t[1].dims[1]===1&&r.dilations[0]===1&&r.dilations[1]===1){let N=En(t[0].dims,t[1].dims,r.dilations,a.pads,r.strides,n),H=e.kernelCustomData.wT??e.compute(dt(t[1],Sa),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=H);let z=[t[0],H];t.length===3&&z.push(t[2]),e.compute(Ls(z,a,N),{inputs:z})}else e.compute(va(t,a));return}let o=t.length===3,s=t[0].dims[n?1:2],l=t[0].dims[n?2:3],i=t[0].dims[n?3:1],c=t[1].dims[2],f=t[1].dims[3],m=En(t[0].dims,t[1].dims,r.dilations,a.pads,r.strides,n),h=m[n?1:2],w=m[n?2:3],b=m[n?3:1],$=n&&c===s&&f===l&&r.pads[0]===0&&r.pads[1]===0;if($||c===1&&f===1&&r.dilations[0]===1&&r.dilations[1]===1&&r.strides[0]===1&&r.strides[1]===1&&r.pads[0]===0&&r.pads[1]===0){let U=m[0],N,H,z,L=[];if(n){let we=e.kernelCustomData.wT??e.compute(dt(t[1],Sa),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];if(r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=we),$){let ne=s*l*i;N=t[0].reshape([1,U,ne]),H=we.reshape([1,ne,b]),z=[1,U,b]}else N=t[0].reshape([U,s*l,i]),H=we.reshape([1,i,b]),z=[U,h*w,b];L.push(N),L.push(H)}else N=t[0].reshape([U,i,s*l]),H=t[1].reshape([1,b,i]),z=[U,b,h*w],L.push(H),L.push(N);o&&L.push(t[2]);let pe=z[2],Ie=L[0].dims[L[0].dims.length-1];pe<8&&Ie<8?e.compute(_a(L,a,m,z,n),{inputs:L}):e.compute(In(L,a,m,z,n),{inputs:L});return}let I=!0,S=e.kernelCustomData.wT??e.compute(dt(t[1],Sa),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=S);let v=[t[0],S];o&&v.push(t[2]);let E=n?h*w:b,A=n?b:h*w,k=c*f*i;e.compute(Gs(v,a,m,E,A,k,o,I),{inputs:v})},Rc=(e,t)=>{let r=t.format===\"NHWC\",a=[e.inputs[0].reshape(r?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&a.push(e.inputs[2]);let n=[0,t.pads[0],0,t.pads[1]],o=[1].concat(t.strides),s=[1].concat(t.dilations),l=[1].concat(t.kernelShape),i=js({...t,pads:n,strides:o,dilations:s,kernelShape:l},a);e.compute(va(a,i,c=>r?[c[0],c[2],c[3]]:[]))},Ia=(e,t)=>{kc(e.inputs,t),e.inputs[0].dims.length===3?Rc(e,t):Pc(e,e.inputs,t)}});var zc,Ks,Ys=F(()=>{\"use strict\";ie();Dt();be();Mt();Sn();wa();kr();zc=(e,t=!1,r,a,n=4)=>{let o=S=>{switch(S){case 1:return\"return w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\";case 4:return`\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\n let v0 = w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\n let v1 = w[getIndexFromCoords4D(coord1, vec4(uniforms.w_shape))];\n let v2 = w[getIndexFromCoords4D(coord2, vec4(uniforms.w_shape))];\n let v3 = w[getIndexFromCoords4D(coord3, vec4(uniforms.w_shape))];\n return ${a}(v0, v1, v2, v3);\n `;default:throw new Error(`innerElementSize ${S} is not supported.`)}},s=e?`\n let coord = vec4(batch, iXR, iXC, xCh);\n `:`\n let coord = vec4(batch, xCh, iXR, iXC);\n `,l=e?`\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n `:`\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `,i=e?\"i32(uniforms.x_shape[1])\":\"i32(uniforms.x_shape[2])\",c=e?\"i32(uniforms.x_shape[2])\":\"i32(uniforms.x_shape[3])\",f=e?\"row\":\"col\",m=e?\"col\":\"row\",h=`\n let inChannels = ${e?\"i32(uniforms.x_shape[3])\":\"i32(uniforms.x_shape[1])\"};\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n let outRow = ${f} / outWidth;\n let outCol = ${f} % outWidth;\n\n let WRow = ${m} / (uniforms.filter_dims[1] * inChannels);\n let WCol = ${m} / inChannels % uniforms.filter_dims[1];\n let xR = f32(outRow - uniforms.pads[0] + uniforms.dilations[0] * WRow) / f32(uniforms.strides[0]);\n let xC = f32(outCol - uniforms.pads[1] + uniforms.dilations[1] * WCol) / f32(uniforms.strides[1]);\n if (xR < 0.0 || xR >= f32(${i}) || fract(xR) > 0.0) {\n return ${a}(0.0);\n }\n if (xC < 0.0 || xC >= f32(${c}) || fract(xC) > 0.0) {\n return ${a}(0.0);\n }\n let iXR = i32(xR);\n let iXC = i32(xC);\n let xCh = ${m} % inChannels;\n ${s}\n return x[getIndexFromCoords4D(coord, vec4(uniforms.x_shape))/${n}];`,w=e?`\n let col = colIn * ${n};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\n ${h}\n }\n return ${a}(0.0);`:`\n let col = colIn * ${n};\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\n ${h}\n }\n return ${a}(0.0);`,b=`\n let col = colIn * ${n};\n let inChannels = ${e?\"i32(uniforms.x_shape[3])\":\"i32(uniforms.x_shape[1])\"};\n let coordX = uniforms.filter_dims[0] - 1 - row / (uniforms.filter_dims[1] * inChannels);\n let coordY = uniforms.filter_dims[1] - 1 - (row / inChannels) % uniforms.filter_dims[1];\n if (${e?\"row < uniforms.dim_inner && col < uniforms.dim_b_outer\":\"row < uniforms.dim_inner && col < uniforms.dim_a_outer\"} && coordX >= 0 && coordY >= 0) {\n let rowInner = row % inChannels;\n let coord = vec4(coordX, coordY, col, rowInner);\n ${o(n)}\n }\n return ${a}(0.0);\n `,$=ht(r,a);return`\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${a} {\n ${e?w:b}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${a} {\n ${e?b:w}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueInput : ${a}) {\n let col = colIn * ${n};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\n var value = valueInput;\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n ${l}\n ${xn(t)}\n ${$}\n result[getIndexFromCoords4D(coords, vec4(uniforms.result_shape))/${n}] = value;\n }\n }`},Ks=(e,t,r,a,n,o,s,l)=>{let i=t.format===\"NHWC\",c=i?e[0].dims[3]:e[0].dims[1],f=r[0],m=i?r[2]:r[3],h=i?r[1]:r[2],w=i?r[3]:r[1],b=i?c%4===0&&w%4===0:m%4===0&&w%4===0,$=i?w:m*h,I=i?m*h:w,S=b?[8,8,1]:[$<=4||I<=4?4:16,$>4&&I<=4?4:16,1],v=b?[4,4,1]:[$<=4?1:4,$>4&&I<=4?1:4,1],E=[Math.ceil($/S[0]/v[0]),Math.ceil(I/S[1]/v[1]),Math.ceil(f/S[2]/v[2])];De(\"verbose\",()=>`[conv_backprop_mm_webgpu] dispatch = ${E}`);let A=b?4:1,k=Math.max(S[0]*A,S[1]),U=b?4:1,N=[t.kernelShape[i?1:2],t.kernelShape[i?2:3]],H=[N[0]+(t.dilations[0]<=1?0:(N[0]-1)*(t.dilations[0]-1)),N[1]+(t.dilations[1]<=1?0:(N[1]-1)*(t.dilations[1]-1))],z=[H[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),H[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],L=[{type:6,data:a},{type:6,data:n},{type:6,data:o},{type:6,data:t.strides},{type:6,data:t.dilations},{type:6,data:N},{type:6,data:z}];gt(t,L),L.push(...K(e[0].dims,e[1].dims));let pe=[\"rank\",\"rank\"];s&&(L.push(...K(e[2].dims)),pe.push(\"rank\")),L.push(...K(r));let Ie=we=>{let ne=D(\"x\",e[0].dataType,e[0].dims.length,U),Ue=D(\"w\",e[1].dataType,e[1].dims.length,1),X=q(\"result\",e[0].dataType,r.length,U),xe=[ne,Ue],fe=\"\";if(s){let he=D(\"bias\",e[2].dataType,e[2].dims.length,U);xe.push(he),fe+=`\n fn getBiasByOutputCoords(coords : vec4) -> ${he.type.value} {\n return bias[coords.${i?\"w\":\"y\"}${b?\"/ 4\":\"\"}];\n }`}let ue=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"},{name:\"strides\",type:\"i32\",length:2},{name:\"dilations\",type:\"i32\",length:2},{name:\"filter_dims\",type:\"i32\",length:N.length},{name:\"pads\",type:\"i32\",length:z.length}];yt(t,ue);let se=ke(e[0].dataType,1);if(se!==\"f16\"&&se!==\"f32\")throw new Error(`elemType ${se} is not supported.`);return`\n ${Cn(\"uniforms.result_strides\")}\n ${we.registerUniforms(ue).declareVariables(...xe,X)};\n ${fe}\n ${zc(i,s,t,ne.type.value,A)}\n ${b?Tr(v,S,se,void 0,!i,k):Or(v,S,se,void 0,!i,k,!1,void 0,l)}`};return{name:\"Conv2DTransposeMatMul\",shaderCache:{hint:`${t.cacheKey};${v};${S};${b}`,inputDependencies:pe},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:E[0],y:E[1],z:E[2]},programUniforms:L}),getShaderSource:Ie}}});var Bc,Ea,Zs=F(()=>{\"use strict\";ie();Dt();_e();be();Bc=(e,t,r,a,n,o=!1,s,l,i=!1)=>{let c=i?1:2,f=i?2:3,m=i?3:1,h=o?2:1,w=`\n fn setOutputAtIndex(flatIndex : u32, value : ${o?`vec4<${s}>`:s}) {\n result[flatIndex] = ${o?`vec4<${s}>`:s}(value);\n }`;a&&(w+=`\n fn getBiasByOutputCoords(coords : vec4) -> ${o?`vec4<${s}>`:s} {\n return bias[coords.${i?\"w\":\"y\"}${o?\"/ 4\":\"\"}];\n }`);let b=o?4:1,$=D(\"W\",t[1].dataType,t[1].dims.length,b),I=D(\"Dy\",t[0].dataType,t[0].dims.length,b),S=[I,$];a&&S.push(D(\"bias\",t[2].dataType,[r[m]].length,b));let v=q(\"result\",t[0].dataType,r.length,b),E=`{\n let batch: u32 = ${n?\"global_id.z\":\"workgroup_id.z\"} / uniforms.result_shape[1];\n let r = ${n?\"global_id.z\":\"workgroup_id.z\"} % uniforms.result_shape[1];\n let c = ${n?\"global_id.y\":\"workgroup_id.y\"} * ${h};\n let d1: u32 = ${n?\"global_id.x\":\"workgroup_id.x\"} * 4;\n\n let dyCorner = vec2(i32(r), i32(c)) - vec2(uniforms.pads);\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd: array, ${h}>;\n for (var i = 0; i < ${h}; i++) {\n dotProd[i] = vec4<${s}>(0.0);\n }\n for (var wR: u32 = 0; wR < uniforms.filter_dims[0]; wR = wR + 1) {\n var dyR = (${s}(dyCorner.x) + ${s}(wR)) / ${s}(uniforms.strides.x);\n let wRPerm = uniforms.filter_dims[0] - 1 - wR;\n if (dyR < 0.0 || dyR >= ${s}(uniforms.Dy_shape[1]) ||\n fract(dyR) > 0.0 || wRPerm < 0) {\n continue;\n }\n let idyR: u32 = u32(dyR);\n\n for (var wC: u32 = 0; wC < uniforms.filter_dims[1]; wC = wC + 1) {\n let dyC = (${s}(dyCorner.y) + ${s}(wC)) / ${s}(uniforms.strides.y);\n let dyC2 = (${s}(dyCorner.y) + 1.0 + ${s}(wC)) / ${s}(uniforms.strides.y);\n let wCPerm = uniforms.filter_dims[1] - 1 - wC;\n if (wCPerm < 0) {\n continue;\n }\n var bDyCVal = true;\n var bDyCVal2 = true;\n if (dyC < 0.0 || dyC >= ${s}(uniforms.Dy_shape[2]) ||\n fract(dyC) > 0.0) {\n bDyCVal = false;\n }\n if (dyC2 < 0.0 || dyC2 >= ${s}(uniforms.Dy_shape[2]) ||\n fract(dyC2) > 0.0) {\n bDyCVal2 = false;\n }\n\n let idyC: u32 = u32(dyC);\n let idyC2: u32 = u32(dyC2);\n if (bDyCVal && bDyCVal2) {\n let d2Length = uniforms.Dy_shape[3];\n for (var d2 :u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\n let wValue1 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\n let wValue2 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\n let wValue3 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\n\n var xValue = ${I.get(\"batch\",\"idyR\",\"idyC\",\"d2\")};\n let tmpval = vec4<${s}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n\n xValue = ${I.get(\"batch\",\"idyR\",\"idyC2\",\"d2\")};\n\n dotProd[1] = dotProd[1] + vec4<${s}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n }\n } else if (bDyCVal) {\n let d2Length = uniforms.Dy_shape[${m}];\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\n let wValue1 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\n let wValue2 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\n let wValue3 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\n\n var xValue = ${I.get(\"batch\",\"idyR\",\"idyC\",\"d2\")};\n let tmpval = vec4<${s}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n }\n } else if (bDyCVal2) {\n let d2Length = uniforms.Dy_shape[3];\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\n let wValue1 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\n let wValue2 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\n let wValue3 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\n\n var xValue = ${I.get(\"batch\",\"idyR\",\"idyC2\",\"d2\")};\n let tmpval = vec4<${s}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[1] = dotProd[1] + tmpval;\n }\n }\n }\n }\n\n for (var i: u32 = 0; i < ${h}; i = i + 1) {\n let value = dotProd[i] + ${a?\"bias[c+i]\":`vec4<${s}>(0.0)`};\n ${v.set(\"batch\",\"r\",\"c + i\",\"d1\",\"value\")};\n }\n }`,A=`\n let outputIndices = ${v.offsetToIndices(\"global_idx\")};\n let batch = ${v.indicesGet(\"outputIndices\",0)};\n let d1 = ${v.indicesGet(\"outputIndices\",m)};\n let r = ${v.indicesGet(\"outputIndices\",c)};\n let c = ${v.indicesGet(\"outputIndices\",f)};\n let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n let groupId = d1 / uniforms.output_channels_per_group;\n let wOutChannel = d1 - groupId * uniforms.output_channels_per_group;\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = ${s}(0.0);\n for (var wR: u32 = 0; wR < uniforms.effective_filter_dims.x; wR = wR + 1) {\n if (wR % uniforms.dilations.x != 0) {\n continue;\n }\n let dyR = (${s}(dyRCorner) + ${s}(wR)) / ${s}(uniforms.strides[0]);\n let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x;\n if (dyR < 0.0 || dyR >= ${s}(uniforms.Dy_shape[${c}]) || fract(dyR) > 0.0 ||\n wRPerm < 0) {\n continue;\n }\n let idyR: u32 = u32(dyR);\n\n for (var wC: u32 = 0; wC < uniforms.effective_filter_dims.y; wC = wC + 1) {\n if (wC % uniforms.dilations.y != 0) {\n continue;\n }\n let dyC = (${s}(dyCCorner) + ${s}(wC)) / ${s}(uniforms.strides.y);\n let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y;\n if (dyC < 0.0 || dyC >= ${s}(uniforms.Dy_shape[${f}]) ||\n fract(dyC) > 0.0 || wCPerm < 0) {\n continue;\n }\n let idyC: u32 = u32(dyC);\n var inputChannel = groupId * uniforms.input_channels_per_group;\n for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group; d2 = d2 + 1) {\n let xValue = ${i?I.get(\"batch\",\"idyR\",\"idyC\",\"inputChannel\"):I.get(\"batch\",\"inputChannel\",\"idyR\",\"idyC\")};\n let wValue = ${$.get(\"inputChannel\",\"wOutChannel\",\"u32(wRPerm)\",\"u32(wCPerm)\")};\n dotProd = dotProd + xValue * wValue;\n inputChannel = inputChannel + 1;\n }\n }\n }\n let value = dotProd + ${a?\"bias[d1]\":`${s}(0.0)`};\n ${v.setByOffset(\"global_idx\",\"value\")};\n `;return`\n ${e.registerUniforms(l).declareVariables(...S,v)}\n ${w}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")};\n ${o?E:A}}`},Ea=(e,t,r)=>{let a=e.length>2,n=t.outputShape,o=M.size(n),s=[Math.ceil(o/64),1,1];De(\"verbose\",()=>`[conv2d_backprop_webgpu] dispatch = ${s}`);let l=t.format===\"NHWC\",i=[\"rank\",\"rank\"],c=[t.strides[0],t.strides[1]],f=[t.kernelShape[l?1:2],t.kernelShape[l?2:3]],m=[t.dilations[0],t.dilations[1]],h=[f[0]+(t.dilations[0]<=1?0:(t.kernelShape[l?1:2]-1)*(t.dilations[0]-1)),f[1]+(t.dilations[1]<=1?0:(t.kernelShape[l?2:3]-1)*(t.dilations[1]-1))],w=[h[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),h[1]-1-Math.floor(t.pads[1]+t.pads[3])/2],b=!1,$=t.group,I=e[1].dims,S=I[0]/$,v=I[1],E=[{type:6,data:o},{type:12,data:c},{type:12,data:f},{type:12,data:m},{type:12,data:h},{type:6,data:w},{type:12,data:S},{type:12,data:v},...K(e[0].dims,e[1].dims)];a&&(E.push(...K(e[2].dims)),i.push(\"rank\")),E.push(...K(n));let A=s[1]===1&&s[2]===1,k=U=>{let N=[{name:\"output_size\",type:\"u32\"},{name:\"strides\",type:\"u32\",length:c.length},{name:\"filter_dims\",type:\"u32\",length:f.length},{name:\"dilations\",type:\"u32\",length:f.length},{name:\"effective_filter_dims\",type:\"u32\",length:h.length},{name:\"pads\",type:\"i32\",length:w.length},{name:\"input_channels_per_group\",type:\"u32\"},{name:\"output_channels_per_group\",type:\"u32\"}],H=ke(e[0].dataType);return`${Bc(U,e,n,a,A,b,H,N,l)}`};return{name:\"ConvTranspose2D\",shaderCache:{hint:`${t.cacheKey};`,inputDependencies:i},getRunData:()=>({dispatchGroup:{x:s[0],y:s[1],z:s[2]},outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],programUniforms:E}),getShaderSource:k}}});var Dc,Mc,Uc,Xs,Qs,Nc,Wc,Vc,Gc,Js,eu=F(()=>{\"use strict\";Ys();Zs();Mt();ir();Dc=(e,t,r,a,n,o)=>(e-1)*t+r+(a-1)*n+1-o,Mc=(e,t,r,a,n)=>{let o=Math.floor(e/2);t===\"SAME_UPPER\"?(r[a]=o,r[n]=e-o):t===\"SAME_LOWER\"&&(r[a]=e-o,r[n]=o)},Uc=(e,t,r,a,n,o,s,l,i,c)=>{let f=e.length-2,m=c.length===0;if(i.length===0)for(let b=0;b{let r=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((m,h)=>m*h,1)===0){r.length=0;for(let m=2;mm+h,0)===0){let m=t[0].dims.length-2;i=new Array(m).fill(1)}let c=e.strides.slice();if(c.reduce((m,h)=>m+h,0)===0){let m=t[0].dims.length-2;c=new Array(m).fill(1)}Uc(l,r,i,e.autoPad,e.group,n,c,a,s,o);let f=Object.assign({},e);return Object.assign(f,{kernelShape:r,pads:n,outputPadding:s,outputShape:o,dilations:i,strides:c}),f},Qs=e=>{let t=_n(e),r=e.format,a=[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][typeof e.autoPad>\"u\"?0:e.autoPad],n=e.dilations,o=e.group,s=e.kernelShape,l=e.pads,i=e.strides,c=e.wIsConst(),f=e.outputPadding,m=e.outputShape;return{autoPad:a,format:r,dilations:n,group:o,kernelShape:s,outputPadding:f,outputShape:m,pads:l,strides:i,wIsConst:c,...t,cacheKey:`${e.format};${t.activation};`}},Nc=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw new Error(\"Conv requires 2 or 3 inputs\");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error(\"currently only support 2-dimensional conv\");if(e[0].dims.length!==e[1].dims.length)throw new Error(\"filter does not have same dimension as input\");let r=e[0].dims[t.format===\"NHWC\"?e[0].dims.length-1:1],a=e[1].dims[0];if(r!==a)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");let n=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==n))throw new Error(\"invalid bias\");let o=e[0].dims.length-2;if(t.dilations.reduce((f,m)=>f+m,0)>0&&t.dilations.length!==o)throw new Error(`dilations should be ${o}D`);if(t.strides.reduce((f,m)=>f+m,0)>0&&t.strides.length!==o)throw new Error(`strides should be ${o}D`);if(t.pads.reduce((f,m)=>f+m,0)>0&&t.pads.length!==o*2)throw new Error(`pads should be ${o*2}D`);if(t.outputPadding.length!==o&&t.outputPadding.length!==0)throw new Error(`output_padding should be ${o}D`);if(t.kernelShape.reduce((f,m)=>f+m,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw new Error(\"invalid output shape\")},Wc=[2,3,1,0],Vc=(e,t,r)=>{let a=Xs(r,t),n=r.format===\"NHWC\",o=a.outputShape,s=o[n?3:1],l=t[0].dims[n?3:1];if(a.group!==1||s===1&&l===1){e.compute(Ea(t,a));return}let i=o[n?1:2],c=o[n?2:3],f=t[1].dims[2],m=t[1].dims[3],h=n?i*c:s,w=n?s:i*c,b=f*m*l,$=!0,I=e.kernelCustomData.wT??e.compute(dt(t[1],Wc),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=I);let S=[t[0],I],v=t.length===3;v&&(!n&&t[2].dims.length===1?S.push(t[2].reshape([t[2].dims[0],1,1])):S.push(t[2])),e.compute(Ks(S,a,o,h,w,b,v,$),{inputs:S})},Gc=(e,t)=>{let r=t.format===\"NHWC\",a=[e.inputs[0].reshape(r?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];a.length===3&&a.push(e.inputs[2]);let n=t.kernelShape;(n.length===0||n[0]===0)&&(n=[e.inputs[1].dims[2]]);let o=t.dilations;(o.length===0||o[0]===0)&&(o=[1]);let s=t.strides;(s.length===0||s[0]===0)&&(s=[1]);let l=t.pads;l.length===0&&(l=[0,0]),l=[0,l[0],0,l[1]],s=[1].concat(s),o=[1].concat(o),n=[1].concat(n);let i=Xs({...t,pads:l,strides:s,dilations:o,kernelShape:n},a);e.compute(Ea(a,i,c=>r?[c[0],c[2],c[3]]:[c[0],c[1],c[3]]))},Js=(e,t)=>{Nc(e.inputs,t),e.inputs[0].dims.length===3?Gc(e,t):Vc(e,e.inputs,t)}});var Hc,tu,ru,nu=F(()=>{\"use strict\";ie();_e();Ye();be();Hc=(e,t,r,a)=>{let n=M.size(t),o=t.length,s=D(\"input\",e,o),l=q(\"output\",e,o),i=r.dataType===6?r.getInt32Array()[0]:Number(r.getBigInt64Array()[0]),c=M.normalizeAxis(i,o),f=m=>{let h=` i32(${s.indicesGet(\"inputIndices\",\"uniforms.axis\")}) `,w=re(\"uniforms.input_shape\",\"uniforms.axis\",o),b=a.reverse?h+(a.exclusive?\" + 1\":\"\"):\"0\",$=a.reverse?w:h+(a.exclusive?\"\":\" + 1\");return`\n ${m.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axis\",\"u32\").declareVariables(s,l)}\n ${m.mainStart()}\n ${m.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n var inputIndices = ${l.offsetToIndices(\"global_idx\")};\n var sum = ${l.type.value}(0);\n let first : i32 = ${b};\n let last : i32 = ${$};\n for (var i : i32 = first; i < last; i++) {\n ${s.indicesSet(\"inputIndices\",\"uniforms.axis\",\"u32(i)\")};\n sum = sum + ${s.getByIndices(\"inputIndices\")};\n }\n ${l.setByOffset(\"global_idx\",\"sum\")};\n }`};return{name:\"CumSum\",shaderCache:{hint:a.cacheKey,inputDependencies:[\"rank\"]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},{type:6,data:c},...K(t,t)]}),getShaderSource:f}},tu=(e,t)=>{let r=e.inputs[0].dims,a=e.inputs[0].dataType,n=e.inputs[1];e.compute(Hc(a,r,n,t),{inputs:[0]})},ru=e=>{let t=e.exclusive===1,r=e.reverse===1;return $e({exclusive:t,reverse:r})}});var Aa,An,au,Lc,Fc,Ta,Oa,iu,qc,ou,su,uu=F(()=>{\"use strict\";ie();_e();Ye();be();Aa=\"[a-zA-Z]|\\\\.\\\\.\\\\.\",An=\"(\"+Aa+\")+\",au=\"^\"+An+\"$\",Lc=\"(\"+An+\",)*\"+An,Fc=\"^\"+Lc+\"$\",Ta=class{constructor(t=-1){this.symbolToIndices=new Map,this.inputIndex=t}addSymbol(t,r){let a=this.symbolToIndices.get(t);a===void 0?a=[r]:a.push(r),this.symbolToIndices.set(t,a)}},Oa=class{constructor(t,r){this.equation=r;this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[a,n]=r.includes(\"->\")?r.split(\"->\",2):[r,\"\"];if(!a.match(RegExp(Fc)))throw new Error(\"Invalid LHS term\");if(a.split(\",\").forEach((l,i)=>{let c=t[i].dims.slice();if(!l.match(RegExp(au)))throw new Error(\"Invalid LHS term\");let f=this.processTerm(l,!0,c,i);this.lhs.push(f)}),n===\"\")n+=[...this.symbolToInfo.entries()].filter(([l,i])=>i.count===1||l===\"...\").map(([l])=>l).join(\"\");else if(!n.match(RegExp(An)))throw new Error(\"Invalid RHS\");n.match(RegExp(Aa,\"g\"))?.forEach(l=>{if(l===\"...\")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let i=this.symbolToInfo.get(l);if(i===void 0)throw new Error(\"Invalid RHS symbol\");this.outputDims.push(i.dimValue)}}),this.rhs=this.processTerm(n,!1,this.outputDims)}addSymbol(t,r,a){let n=this.symbolToInfo.get(t);if(n!==void 0){if(n.dimValue!==r&&n.count!==1)throw new Error(\"Dimension mismatch\");n.count++,n.inputIndices.push(a)}else n={count:1,dimValue:r,inputIndices:[a]};this.symbolToInfo.set(t,n)}processTerm(t,r,a,n=-1){let o=a.length,s=!1,l=[],i=0;if(!t.match(RegExp(au))&&!r&&t!==\"\")throw new Error(\"Invalid LHS term\");let c=t.match(RegExp(Aa,\"g\")),f=new Ta(n);return c?.forEach((m,h)=>{if(m===\"...\"){if(s)throw new Error(\"Only one ellipsis is allowed per input term\");s=!0;let w=o-c.length+1;if(w<0)throw new Error(\"Ellipsis out of bounds\");if(l=a.slice(i,i+w),this.hasEllipsis){if(this.ellipsisDims.length!==l.length||this.ellipsisDims.toString()!==l.toString())throw new Error(\"Ellipsis dimensions mismatch\")}else if(r)this.hasEllipsis=!0,this.ellipsisDims=l;else throw new Error(\"Ellipsis must be specified in the LHS\");for(let b=0;be+\"_max\",qc=(e,t,r,a)=>{let o=e.map(f=>f.length).map((f,m)=>D(`input${m}`,t,f)),s=M.size(a),l=q(\"output\",t,a.length),i=[...r.symbolToInfo.keys()].filter(f=>!r.rhs.symbolToIndices.has(f)),c=f=>{let m=[],h=\"var prod = 1.0;\",w=\"var sum = 0.0;\",b=\"sum += prod;\",$=[],I=[],S=[],v=[],E=r.symbolToInfo.size===r.rhs.symbolToIndices.size;r.symbolToInfo.forEach((k,U)=>{if(r.rhs.symbolToIndices.has(U)){let N=r.rhs.symbolToIndices.get(U)?.[0];N!==void 0&&r.lhs.forEach((H,z)=>{if(k.inputIndices.includes(z)){let L=H.symbolToIndices.get(U);if(L===void 0)throw new Error(\"Invalid symbol error\");L.forEach(pe=>{m.push(`${o[z].indicesSet(`input${z}Indices`,pe,l.indicesGet(\"outputIndices\",N))}`)})}})}else r.lhs.forEach((N,H)=>{if(k.inputIndices.includes(H)){let z=N.symbolToIndices.get(U);if(z===void 0)throw new Error(\"Invalid symbol error\");z.forEach(L=>{$.push(`${o[H].indicesSet(`input${H}Indices`,L,`${U}`)}`)}),v.push(`prod *= ${o[H].getByIndices(`input${H}Indices`)};`)}}),I.push(`for(var ${U}: u32 = 0; ${U} < uniforms.${iu(U)}; ${U}++) {`),S.push(\"}\")});let A=E?[...m,`let sum = ${o.map((k,U)=>k.getByIndices(`input${U}Indices`)).join(\" * \")};`]:[...m,w,...I,...$,h,...v,b,...S];return`\n ${f.registerUniforms(i.map(k=>({name:`${iu(k)}`,type:\"u32\"}))).registerUniform(\"outputSize\",\"u32\").declareVariables(...o,l)}\n\n ${f.mainStart()}\n ${f.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n var outputIndices = ${l.offsetToIndices(\"global_idx\")};\n ${o.map((k,U)=>`var input${U}Indices: ${o[U].type.indices};`).join(`\n`)}\n ${A.join(`\n`)};\n ${l.setByOffset(\"global_idx\",\"sum\")};\n }`};return{name:\"Einsum\",shaderCache:{hint:r.equation,inputDependencies:e.map(()=>\"rank\")},getRunData:()=>{let f=i.filter(h=>r.symbolToInfo.has(h)).map(h=>({type:12,data:r.symbolToInfo.get(h)?.dimValue||0}));f.push({type:12,data:s});let m=e.map((h,w)=>[...K(h)]).reduce((h,w)=>h.concat(w),f);return m.push(...K(a)),{outputs:[{dims:a,dataType:t}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:m}},getShaderSource:c}},ou=(e,t)=>{let r=new Oa(e.inputs,t.equation),a=r.outputDims,n=e.inputs.map((o,s)=>o.dims);e.compute(qc(n,e.inputs[0].dataType,r,a))},su=e=>{let t=e.equation.replace(/\\s+/g,\"\");return $e({equation:t})}});var jc,lu,Kc,Yc,du,cu=F(()=>{\"use strict\";ie();_e();be();jc=e=>{if(!e||e.length!==2)throw new Error(\"Expand requires 2 input.\");let t=e[0].dims,r=Array.from(e[1].getBigInt64Array(),Number),a=r.length{let r=e.length-t.length,a=[];for(let n=0;ne.length>t.length?lu(e,t):lu(t,e),Yc=e=>{let t=e[0].dims,r=Array.from(e[1].getBigInt64Array(),Number),a=Kc(t,r),n=e[0].dataType,o=n===9?4:1,s=Math.ceil(M.size(a)/o),l=c=>{let f=D(\"input\",n,t.length,o),m=q(\"output\",n,a.length,o),h;if(n===9){let w=(b,$,I=\"\")=>`\n let outputIndices${$} = ${m.offsetToIndices(`outputOffset + ${$}u`)};\n let offset${$} = ${f.broadcastedIndicesToOffset(`outputIndices${$}`,m)};\n let index${$} = offset${$} / 4u;\n let component${$} = offset${$} % 4u;\n ${b}[${$}] = ${I}(${f.getByOffset(`index${$}`)}[component${$}]);\n `;h=`\n let outputOffset = global_idx * ${o};\n var data = vec4(0);\n ${w(\"data\",0,\"u32\")}\n ${w(\"data\",1,\"u32\")}\n ${w(\"data\",2,\"u32\")}\n ${w(\"data\",3,\"u32\")}\n ${m.setByOffset(\"global_idx\",\"data\")}\n }`}else h=`\n let outputIndices = ${m.offsetToIndices(\"global_idx\")};\n let inputOffset = ${f.broadcastedIndicesToOffset(\"outputIndices\",m)};\n ${m.setByOffset(\"global_idx\",f.getByOffset(\"inputOffset\"))}\n }`;return`\n ${c.registerUniform(\"vec_size\",\"u32\").declareVariables(f,m)}\n ${c.mainStart()}\n ${c.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n ${h}`},i=[{type:12,data:s},...K(t,a)];return{name:\"Expand\",shaderCache:{hint:`${a.length}`,inputDependencies:[\"rank\"]},getShaderSource:l,getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:i})}},du=e=>{jc(e.inputs),e.compute(Yc(e.inputs),{inputs:[0]})}});var Zc,pu,fu=F(()=>{\"use strict\";ie();_e();be();$n();Zc=e=>{let t=e[0].dataType,r=M.size(e[0].dims),a=M.size(e[1].dims),n=a%4===0,o=s=>{let l=D(\"x\",t,[1],4),i=D(\"bias\",t,[1],4),c=q(\"y\",t,[1],4),f=[{name:\"output_vec_size\",type:\"u32\"},{name:\"bias_size\",type:\"u32\"}],m=w=>`\n let bias${w}_offset: u32 = (global_idx * 4 + ${w}) % uniforms.bias_size;\n let bias${w} = ${i.getByOffset(`bias${w}_offset / 4`)}[bias${w}_offset % 4];`,h=n?`\n let bias = ${i.getByOffset(\"global_idx % (uniforms.bias_size / 4)\")};`:`${m(0)}${m(1)}${m(2)}${m(3)}\n let bias = ${l.type.value}(bias0, bias1, bias2, bias3);`;return`${s.registerUniforms(f).declareVariables(l,i,c)}\n\n ${ya(at(t))}\n\n ${s.mainStart(mn)}\n ${s.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_vec_size\")}\n\n let x = ${l.getByOffset(\"global_idx\")};\n ${h}\n let x_in = x + bias;\n ${c.setByOffset(\"global_idx\",ba(\"x_in\"))}\n }`};return{name:\"FastGeluWithBias\",shaderCache:{hint:`${n}`,inputDependencies:[\"type\",\"type\"]},getShaderSource:o,getRunData:s=>({outputs:[{dims:s[0].dims,dataType:s[0].dataType}],programUniforms:[{type:12,data:Math.ceil(r/4)},{type:12,data:a}],dispatchGroup:{x:Math.ceil(r/mn/4)}})}},pu=e=>{e.inputs.length<2||M.size(e.inputs[1].dims)===0?$s(e):e.compute(Zc(e.inputs))}});var Xc,Qc,mu,hu,gu=F(()=>{\"use strict\";ie();_e();Ye();be();Xc=e=>{if(!e||e.length!==2)throw new Error(\"Gather requires 2 inputs.\")},Qc=(e,t)=>{let r=e[0].dims,a=e[1].dims,n=r.length,o=M.normalizeAxis(t.axis,n),s=r.slice(0);s.splice(o,1,...a);let l=r[o],i=e[0].dataType===9?4:1,c=Math.ceil(M.size(s)/i),f=[{type:12,data:c},{type:6,data:l},{type:12,data:o},...K(e[0].dims,e[1].dims,s)],m=h=>{let w=D(\"data\",e[0].dataType,e[0].dims.length,i),b=D(\"inputIndices\",e[1].dataType,e[1].dims.length),$=q(\"output\",e[0].dataType,s.length,i),I=v=>{let E=a.length,A=`var indicesIndices${v} = ${b.type.indices}(0);`;for(let k=0;k1?`indicesIndices${v}[${k}]`:`indicesIndices${v}`} = ${s.length>1?`outputIndices${v}[uniforms.axis + ${k}]`:`outputIndices${v}`};`;A+=`\n var idx${v} = ${b.getByIndices(`indicesIndices${v}`)};\n if (idx${v} < 0) {\n idx${v} = idx${v} + uniforms.axisDimLimit;\n }\n var dataIndices${v} : ${w.type.indices};\n `;for(let k=0,U=0;k1?`dataIndices${v}[${k}]`:`dataIndices${v}`} = u32(idx${v});`,U+=E):(A+=`${n>1?`dataIndices${v}[${k}]`:`dataIndices${v}`} = ${s.length>1?`outputIndices${v}[${U}]`:`outputIndices${v}`};`,U++);return A},S;if(e[0].dataType===9){let v=(E,A,k=\"\")=>`\n let outputIndices${A} = ${$.offsetToIndices(`outputOffset + ${A}u`)};\n ${I(A)};\n let offset${A} = ${w.indicesToOffset(`dataIndices${A}`)};\n let index${A} = offset${A} / 4u;\n let component${A} = offset${A} % 4u;\n ${E}[${A}] = ${k}(${w.getByOffset(`index${A}`)}[component${A}]);\n `;S=`\n let outputOffset = global_idx * ${i};\n var value = vec4(0);\n ${v(\"value\",0,\"u32\")}\n ${v(\"value\",1,\"u32\")}\n ${v(\"value\",2,\"u32\")}\n ${v(\"value\",3,\"u32\")}\n ${$.setByOffset(\"global_idx\",\"value\")}\n `}else S=`\n let outputIndices = ${$.offsetToIndices(\"global_idx\")};\n ${I(\"\")};\n let value = ${w.getByIndices(\"dataIndices\")};\n ${$.setByOffset(\"global_idx\",\"value\")};\n `;return`\n ${h.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axisDimLimit\",\"i32\").registerUniform(\"axis\",\"u32\").declareVariables(w,b,$)}\n ${h.mainStart()}\n ${h.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n ${S}\n }`};return{name:\"Gather\",shaderCache:{hint:t.cacheKey,inputDependencies:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:f}),getShaderSource:m}},mu=e=>$e({axis:e.axis}),hu=(e,t)=>{let r=e.inputs;Xc(r),e.compute(Qc(e.inputs,t))}});var Jc,ep,yu,bu,wu=F(()=>{\"use strict\";ie();_e();Ye();be();Jc=e=>{if(!e||e.length!==2)throw new Error(\"GatherElements requires 2 inputs.\");if(e[0].dims.length<1)throw new Error(\"GatherElements requires that the data input be rank >= 1.\");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and\n indices input tensors be of same rank.`)},ep=(e,t)=>{let r=e[0].dims,a=e[0].dataType,n=r.length,o=e[1].dims,s=e[1].dataType,l=M.normalizeAxis(t.axis,n),i=r[l],c=o.slice(0),f=M.size(c),m=D(\"input\",a,n),h=D(\"indicesInput\",s,o.length),w=q(\"output\",a,c.length),b=[{type:12,data:f},{type:6,data:i},{type:12,data:l}];return b.push(...K(r,o,c)),{name:\"GatherElements\",shaderCache:{inputDependencies:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:c,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:b}),getShaderSource:S=>`\n ${S.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axisDimLimit\",\"i32\").registerUniform(\"axis\",\"u32\").declareVariables(m,h,w)}\n ${S.mainStart()}\n ${S.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n\n let outputIndices = ${w.offsetToIndices(\"global_idx\")};\n\n var idx = ${h.getByOffset(\"global_idx\")};\n if (idx < 0) {\n idx = idx + uniforms.axisDimLimit;\n }\n var inputIndices = ${m.type.indices}(outputIndices);\n ${m.indicesSet(\"inputIndices\",\"uniforms.axis\",\"u32(idx)\")};\n let value = ${m.getByIndices(\"inputIndices\")};\n\n ${w.setByOffset(\"global_idx\",\"value\")};\n }`}},yu=e=>$e({axis:e.axis}),bu=(e,t)=>{let r=e.inputs;Jc(r),e.compute(ep(e.inputs,t))}});var tp,rp,vu,$u,_u=F(()=>{\"use strict\";ie();_e();be();tp=e=>{if(!e)throw new Error(\"Input is missing\");if(e.length<2||e.length>3)throw new Error(\"Invaid input number.\");if(e.length===3&&e[2].dims.length>2)throw new Error(\"Invalid input shape of C\");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error(\"Input types are mismatched\")},rp=(e,t)=>{let r=e[0].dims.slice(),a=e[1].dims.slice(),[n,o,s]=cn.getShapeOfGemmResult(r,t.transA,a,t.transB,e.length===3?e[2].dims:void 0),l=[n,o];if(!l)throw new Error(\"Can't use gemm on the given tensors\");let i=M.size(l),c=[{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:1,data:t.alpha},{type:1,data:t.beta}],f=[\"type\",\"type\"];e.length===3&&(c.push(...K(e[2].dims)),f.push(\"rank\")),c.push(...K(l));let m=h=>{let w=\"\";t.transA&&t.transB?w=\"value += a[k * uniforms.M + m] * b[n * uniforms.K + k];\":t.transA&&!t.transB?w=\"value += a[k * uniforms.M + m] * b[k * uniforms.N + n];\":!t.transA&&t.transB?w=\"value += a[m * uniforms.K + k] * b[n * uniforms.K + k];\":!t.transA&&!t.transB&&(w=\"value += a[m * uniforms.K + k] * b[k * uniforms.N + n];\");let b=t.alpha===1?\"\":\"value *= uniforms.alpha;\",$=D(\"a\",e[0].dataType,e[0].dims),I=D(\"b\",e[1].dataType,e[1].dims),S=$.type.value,v=null,E=[$,I];e.length===3&&(v=D(\"c\",e[2].dataType,e[2].dims.length),E.push(v));let A=q(\"output\",e[0].dataType,l.length);E.push(A);let k=[{name:\"output_size\",type:\"u32\"},{name:\"M\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"alpha\",type:\"f32\"},{name:\"beta\",type:\"f32\"}];return`\n ${h.registerUniforms(k).declareVariables(...E)}\n\n ${h.mainStart()}\n ${h.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let m = global_idx / uniforms.N;\n let n = global_idx % uniforms.N;\n\n var value = ${S}(0);\n for (var k: u32 = 0u; k < uniforms.K; k++) {\n ${w}\n }\n\n ${b}\n ${(()=>v!=null?`let cOffset = ${v.broadcastedIndicesToOffset(\"vec2(m, n)\",A)}; value += ${S}(uniforms.beta) * ${v.getByOffset(\"cOffset\")};`:\"\")()}\n output[global_idx] = value;\n }`};return{name:\"Gemm\",shaderCache:{hint:`${t.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:c}),getShaderSource:m}},vu=e=>{let t=e.transA,r=e.transB,a=e.alpha,n=e.beta;return{transA:t,transB:r,alpha:a,beta:n,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},$u=(e,t)=>{tp(e.inputs),e.compute(rp(e.inputs,t))}});var np,ap,ip,xu,Su=F(()=>{\"use strict\";ie();_e();be();np=(e,t)=>{let r=e[0].dims,a=r,n=2,o=M.sizeToDimension(r,n),s=M.sizeFromDimension(r,n),l=Me(s),i=s/l,c=[r[0],r[1],i],f=[\"rank\",\"type\",\"type\"],m=[{type:12,data:s},{type:12,data:i}];m.push(...K(c,c));let h=w=>{let b=D(\"x\",e[0].dataType,c.length,l),$=D(\"scale\",e[1].dataType,e[1].dims),I=D(\"bias\",e[2].dataType,e[2].dims),S=q(\"output\",e[0].dataType,c.length,l),v=[b,$,I,S],E=b.type.value,A=l===1?\"f32\":`vec${l}`,k=64,U=[{name:\"normSize\",type:\"u32\"},{name:\"normPackedSize\",type:\"u32\"}];return`\n var meanShared : f32;\n var squaredNormShared : f32;\n var workgroupShared : array<${A}, ${k}>;\n const workgroupSize = ${k}u;\n ${w.registerUniforms(U).declareVariables(...v)}\n ${w.mainStart(k)}\n let norm = global_idx / workgroupSize;\n let batch = norm / uniforms.x_shape[1];\n let channel = norm % uniforms.x_shape[1];\n let localIndex = local_id.x;\n\n // initialize workgroup memory\n var initial = ${A}(0);\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n initial = initial + ${A}(${b.get(\"batch\",\"channel\",\"h\")});\n }\n workgroupShared[localIndex] = initial;\n workgroupBarrier();\n\n // Calculate the mean of current channel data.\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (localIndex < currSize) {\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\n }\n workgroupBarrier();\n }\n if (localIndex == 0) {\n meanShared = ${it(\"workgroupShared[0]\",l)} / f32(uniforms.normSize);\n }\n workgroupBarrier();\n\n // reinitialize workgroup memory.\n initial = ${A}(0);\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n let deviation = ${A}(${b.get(\"batch\",\"channel\",\"h\")}) - ${A}(meanShared);\n initial = initial + deviation * deviation;\n }\n workgroupShared[localIndex] = initial;\n workgroupBarrier();\n\n // Calculate the sum of square of deviation of current channel data.\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (localIndex < currSize) {\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\n }\n workgroupBarrier();\n }\n if (localIndex == 0) {\n squaredNormShared = ${it(\"workgroupShared[0]\",l)};\n }\n workgroupBarrier();\n\n let invStdDev = inverseSqrt(squaredNormShared / f32(uniforms.normSize) + f32(${t.epsilon}));\n let channelScale = invStdDev * f32(${$.getByOffset(\"channel\")});\n let channelShift = f32(${I.getByOffset(\"channel\")}) - meanShared * channelScale;\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n let value = ${b.get(\"batch\",\"channel\",\"h\")} * ${E}(${A}(channelScale)) + ${E}(${A}(channelShift));\n ${S.set(\"batch\",\"channel\",\"h\",\"value\")};\n }\n }`};return{name:\"InstanceNormalization\",shaderCache:{hint:`${t.epsilon};${l}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:o},programUniforms:m}),getShaderSource:h}},ap=(e,t,r,a,n,o,s,l)=>{let i=Me(s),c=64,f=i===1?\"vec2f\":`mat2x${i}f`,m=i===1?\"f32\":`vec${i}f`,h=(U,N)=>`${f}(${U}, ${N})`,w=n*s/i,b=Math.ceil(o/c),$=[\"type\"],I=[{type:12,data:b},{type:12,data:o},{type:12,data:Math.floor(s/i)},{type:12,data:Math.floor(o*s/i)}],S=U=>{let N=D(\"input\",t.dataType,t.dims,i);return`\n ${U.declareVariables(N)}\n @group(0) @binding(1) var output : array<${f}>;\n struct Uniforms {wg_size:u32, H:u32, C:u32, image_size:u32};\n @group(0) @binding(2) var uniforms: Uniforms;\n\n ${U.mainStart(c)}\n let currentImageNumber = global_idx / ${c} / uniforms.C;\n let currentChannelNumber = (global_idx / ${c}) % uniforms.C;\n let wgId = global_idx % ${c};\n let wgOffset = wgId * uniforms.wg_size;\n if (wgOffset >= uniforms.H) {\n return;\n }\n let wgMax = min(wgOffset + uniforms.wg_size, uniforms.H);\n\n let offset = currentImageNumber * uniforms.image_size + currentChannelNumber;\n var sum = ${Xe(\"f32\",i)};\n var squaredSum = ${Xe(\"f32\",i)};\n for (var i: u32 = wgOffset; i < wgMax; i++) {\n let value = ${m}(input[offset + i * uniforms.C]);\n sum += value;\n squaredSum += value * value;\n }\n output[global_idx] = ${h(\"sum\",\"squaredSum\")};\n }`},v=e.compute({name:\"InstanceNormComputeMean\",shaderCache:{hint:`${i}`,inputDependencies:$},getRunData:()=>({outputs:[{dims:[n,s,c,2],dataType:1}],dispatchGroup:{x:n*s/i},programUniforms:I}),getShaderSource:S},{inputs:[t],outputs:[-1]})[0],E=[{type:12,data:w},{type:12,data:o},{type:12,data:Math.floor(s/i)},{type:12,data:Math.floor(c*s/i)}],A=[\"type\",\"type\",\"type\"],k=U=>{let N=D(\"scale\",r.dataType,r.dims,i),H=D(\"bias\",a.dataType,a.dims,i);return`\n @group(0) @binding(0) var input : array<${f}>;\n @group(0) @binding(1) var scale : array<${N.type.storage}>;\n @group(0) @binding(2) var bias : array<${H.type.storage}>;\n @group(0) @binding(3) var output : array<${f}>;\n struct Uniforms {units_of_work : u32, H: u32, C : u32, image_size : u32};\n @group(0) @binding(4) var uniforms: Uniforms;\n\n ${U.mainStart()}\n ${U.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.units_of_work\")}\n let currentImageNumber = global_idx / uniforms.C;\n let currentChannelNumber = global_idx % uniforms.C;\n\n let offset = currentImageNumber * uniforms.image_size;\n var sum = ${Xe(\"f32\",i)};\n var squaredSum = ${Xe(\"f32\",i)};\n for (var i: u32 = 0; i < min(${c}, uniforms.H); i++) {\n let value = input[offset + i + currentChannelNumber * ${c}];\n sum += value[0];\n squaredSum += value[1];\n }\n sum = sum / f32(uniforms.H);\n squaredSum = squaredSum / f32(uniforms.H);\n let invStdDev = inverseSqrt(squaredSum - sum * sum + f32(${l}));\n let channelScale = invStdDev * ${m}(scale[currentChannelNumber]);\n let channelShift = ${m}(bias[currentChannelNumber]) - sum * channelScale;\n\n output[global_idx] = ${h(\"channelScale\",\"channelShift\")};\n }`};return e.compute({name:\"InstanceNormComputeChannelScaleShift\",shaderCache:{hint:`${i};${l}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:[n,s,2],dataType:1}],dispatchGroup:{x:Math.ceil(w/64)},programUniforms:E}),getShaderSource:k},{inputs:[v,r,a],outputs:[-1]})[0]},ip=(e,t,r)=>{let a=t[0].dims,n=a,o=a[0],s=a[a.length-1],l=M.sizeFromDimension(a,1)/s,i=Me(s),c=M.size(n)/i,f=[{type:12,data:l},{type:12,data:Math.floor(s/i)}],m=[\"type\",\"type\"],h=ap(e,t[0],t[1],t[2],o,l,s,r.epsilon),w=b=>{let $=ke(t[0].dataType),I=i===1?\"vec2f\":`mat2x${i}f`,S=i===1?$:`vec${i}<${$}>`,v=D(\"input\",t[0].dataType,t[0].dims,i),E=q(\"output\",t[0].dataType,n,i);return`\n @group(0) @binding(0) var input : array<${v.type.storage}>;\n @group(0) @binding(1) var scaleInput : array<${I}>;\n @group(0) @binding(2) var output : array<${E.type.storage}>;\n struct Uniforms {H: u32, C : u32};\n @group(0) @binding(3) var uniforms: Uniforms;\n\n ${b.mainStart()}\n let currentImageNumber = global_idx / (uniforms.C * uniforms.H);\n let currentChannelNumber = global_idx % uniforms.C;\n\n let scaleOffset = currentImageNumber * uniforms.C + currentChannelNumber;\n let scale = scaleInput[scaleOffset];\n output[global_idx] = fma(input[global_idx], ${S}(scale[0]), ${S}(scale[1]));\n }`};e.compute({name:\"InstanceNormalizationNHWC\",shaderCache:{hint:`${i}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:n,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:f}),getShaderSource:w},{inputs:[t[0],h]})},xu=(e,t)=>{t.format===\"NHWC\"?ip(e,e.inputs,t):e.compute(np(e.inputs,t))}});var op,sp,Cu,Iu=F(()=>{\"use strict\";ie();_e();be();op=e=>{if(!e||e.length<2)throw new Error(\"layerNorm requires at least 2 inputs.\")},sp=(e,t,r)=>{let a=e[0].dims,n=e[1],o=e[2],s=a,l=M.normalizeAxis(t.axis,a.length),i=M.sizeToDimension(a,l),c=M.sizeFromDimension(a,l),f=M.size(n.dims),m=o?M.size(o.dims):0;if(f!==c||o&&m!==c)throw new Error(`Size of X.shape()[axis:] == ${c}.\n Size of scale and bias (if provided) must match this.\n Got scale size of ${f} and bias size of ${m}`);let h=[];for(let A=0;A1,S=r>2,v=A=>{let k=ke(e[0].dataType),U=[D(\"x\",e[0].dataType,e[0].dims,w),D(\"scale\",n.dataType,n.dims,w)];o&&U.push(D(\"bias\",o.dataType,o.dims,w)),U.push(q(\"output\",e[0].dataType,s,w)),I&&U.push(q(\"mean_data_output\",1,h)),S&&U.push(q(\"inv_std_output\",1,h));let N=[{name:\"norm_count\",type:\"u32\"},{name:\"norm_size\",type:\"f32\"},{name:\"norm_size_vectorized\",type:\"u32\"},{name:\"epsilon\",type:\"f32\"}];return`\n ${A.registerUniforms(N).declareVariables(...U)}\n ${A.mainStart()}\n ${A.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.norm_count\")}\n let offset = global_idx * uniforms.norm_size_vectorized;\n var mean_vector = ${Xe(\"f32\",w)};\n var mean_square_vector = ${Xe(\"f32\",w)};\n\n for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) {\n let value = ${mt(k,w,\"x[h + offset]\")};\n mean_vector += value;\n mean_square_vector += value * value;\n }\n let mean = ${it(\"mean_vector\",w)} / uniforms.norm_size;\n let inv_std_dev = inverseSqrt(${it(\"mean_square_vector\",w)} / uniforms.norm_size - mean * mean + uniforms.epsilon);\n\n for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) {\n let f32input = ${mt(k,w,\"x[j + offset]\")};\n let f32scale = ${mt(k,w,\"scale[j]\")};\n output[j + offset] = ${U[0].type.value}((f32input - mean) * inv_std_dev * f32scale\n ${o?`+ ${mt(k,w,\"bias[j]\")}`:\"\"}\n );\n }\n\n ${I?\"mean_data_output[global_idx] = mean\":\"\"};\n ${S?\"inv_std_output[global_idx] = inv_std_dev\":\"\"};\n }`},E=[{dims:s,dataType:e[0].dataType}];return I&&E.push({dims:h,dataType:1}),S&&E.push({dims:h,dataType:1}),{name:\"LayerNormalization\",shaderCache:{hint:`${w};${r}`,inputDependencies:b},getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(i/64)},programUniforms:$}),getShaderSource:v}},Cu=(e,t)=>{op(e.inputs),e.compute(sp(e.inputs,t,e.outputCount))}});var up,lp,Eu,Au,Tu=F(()=>{\"use strict\";ie();_e();Ye();be();up=(e,t)=>{if(e.length<3||e.length>4)throw new Error(\"MatMulNBits requires 3 or 4 inputs\");let r=e[0],a=r.dims.length;if(r.dims[a-1]!==t.k)throw new Error(\"The last dim of input shape does not match the k value\");let n=Math.floor((t.k+t.blockSize-1)/t.blockSize),o=t.blockSize/8*t.bits,s=e[1];if(!M.areEqual(s.dims,[t.n,n,o]))throw new Error(\"The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize\");let i=e[2].dims;if(M.size(i)!==t.n*n)throw new Error(\"scales input size error.\");if(e.length===4){let f=e[3].dims,m=t.bits>4?t.n*n:t.n*Math.floor((n+1)/2);if(M.size(f)!==m)throw new Error(\"zeroPoints input size error.\")}},lp=(e,t)=>{let r=e[0].dims,a=r.length,n=r.slice(0,a-1).concat(t.n),o=r[a-2],l=t.blockSize/8*t.bits/4,i=Me(o),c=Me(t.n),f=Me(t.k),m=Me(l),h=M.size(n)/c/i,w=[{type:12,data:h},{type:12,data:t.k},{type:12,data:t.n},{type:12,data:t.accuracyLevel},{type:12,data:t.bits},{type:12,data:t.blockSize}],b=r.slice();b.splice(-1,1,t.k/f);let $=M.convertShape(e[1].dims).slice();$.splice(-1,1,l/m),w.push(...K(b)),w.push(...K($)),w.push(...K(e[2].dims)),e.length===4&&w.push(...K(M.convertShape(e[3].dims)));let I=n.slice();I.splice(-1,1,t.n/c),w.push(...K(I));let S=v=>{let E=D(\"a\",e[0].dataType,b.length,f),A=D(\"b\",12,$.length,m),k=D(\"scales\",e[2].dataType,e[2].dims.length),U=[E,A,k],N=e.length===4?D(\"zero_points\",12,e[3].dims.length):void 0;N&&U.push(N);let H=q(\"output\",e[0].dataType,n.length,c),z=[{name:\"output_size\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"accuracy_level\",type:\"u32\"},{name:\"bits\",type:\"u32\"},{name:\"block_size\",type:\"u32\"}],L=Math.floor((t.k+t.blockSize-1)/t.blockSize),pe=ke(e[0].dataType),Ie=(()=>{switch(f){case 1:return`array<${pe}, 8>`;case 2:return`mat4x2<${pe}>`;case 4:return`mat2x4<${pe}>`;default:throw new Error(`${f}-component is not supported.`)}})(),we=`\n fn dequantize(quantized: ${Ie}, zero_point: ${pe}, scale: ${pe}) -> ${Ie} {\n ${(()=>f===1?`var dequantized = ${Ie}(${Array.from({length:8},(X,xe)=>`(quantized[${xe}] - zero_point) * scale`).join(\", \")});\n return dequantized;`:`var zero_points: ${Ie} = ${Ie}(${Array(8).fill(\"zero_point\").join(\",\")});\n return (quantized - zero_points) * scale;`)()}\n }`,ne=`\n fn ortUnpack8x4snorm(value: u32) -> ${Ie} {\n var quantized: ${Ie};\n var offset: u32 = 0;\n let count: u32 = 4;\n for (var i: u32 = 0; i < 8u; i++) {\n var result = ${pe}(extractBits(value, offset, count));\n ${(()=>{switch(f){case 1:return\"quantized[i] = result;\";case 2:return\"quantized[i / 2][i % 2] = result;\";case 4:return\"quantized[i / 4][i % 4] = result;\";default:throw new Error(`${f}-component is not supported.`)}})()}\n offset += count;\n }\n return quantized;\n }`,Ue=N?`\n zero_point_offset += 4;\n if (zero_point_offset == 32) {\n zero_point_offset = 0;\n zero_point_index++;\n zero_point_word = ${N.getByOffset(\"zero_point_index\")};\n }`:\"\";return`\n ${we};\n ${ne};\n ${v.registerUniforms(z).declareVariables(...U,H)}\n ${v.mainStart()}\n ${v.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n var output_values: array<${H.type.value}, ${i}>;\n var output_indices = ${H.offsetToIndices(\"global_idx\")};\n var n = ${H.indicesGet(\"output_indices\",a-1)};\n var m = ${H.indicesGet(\"output_indices\",a-2)};\n var a_indices: ${E.type.indices} = output_indices;\n // Two zero points are packed into one byte because uniforms.bits <= 4.\n // zero_point_offset is either 0 or 4. It is bit offset within one byte.\n // TODO support zero_point_offset for bits > 4\n ${N?`\n var zero_point_index: u32 = n * ${c} * ((${L} + 1) / 2) / 4;\n var zero_point_word: u32 = ${N.getByOffset(\"zero_point_index\")};\n var zero_point_offset: u32 = 0;`:\"\"}\n var scale_index = n * ${L*c};\n var b_indices: ${A.type.indices};\n for (var c: u32 = 0; c < ${c}; c++) {\n ${A.indicesSet(\"b_indices\",\"0\",`n * ${c} + c`)};\n var block_offset: u32 = 0;\n for (var block: u32 = 0; block < ${L}; block++) {\n // The scale and zero points are computed per block.\n let scale = ${k.getByOffset(\"scale_index\")};\n // The default zero point is 8 for unsigned 4-bit quantization.\n let zero_point = ${pe}(${N?\"extractBits(zero_point_word, zero_point_offset, 4)\":8});\n ${A.indicesSet(\"b_indices\",\"1\",\"block\")};\n var word_offset: u32 = block_offset;\n for (var word: u32 = 0; word < ${l}; word += ${m}) {\n ${A.indicesSet(\"b_indices\",\"2\",\"word\")};\n let b_data = ${A.getByIndices(\"b_indices\")};\n for (var i: u32 = 0; i < ${m}; i++) {\n let b_value = ${m===1?\"b_data\":\"b_data[word + i]\"};\n let b_quantized_values: ${Ie} = ortUnpack8x4snorm(b_value);\n let b_dequantized_values = dequantize(b_quantized_values, zero_point, scale);\n // Number of B elements per 32-bit word is 32/bits = 32/4 = 8\n var offset: u32 = word_offset;\n for (var j: u32 = 0; j < 8/${f}; j++) {\n ${E.indicesSet(\"a_indices\",a-1,`offset/${f}`)};\n for (var k: u32 = 0; k < ${i}u; k++) {\n ${E.indicesSet(\"a_indices\",a-2,`m * ${i} + k`)};\n let a_data = ${E.getByIndices(\"a_indices\")};\n output_values[k]${c>1?\"[c]\":\"\"} += ${f===1?\"a_data * b_dequantized_values[j]\":\"dot(a_data, b_dequantized_values[j])\"};\n }\n offset += ${f};\n }\n word_offset += 8;\n }\n }\n scale_index++;\n ${Ue}\n block_offset += uniforms.block_size;\n }\n // Drop the trailing 4 bits if the zero_poit_offset is not a byte boundary to align with the next byte.\n ${N?`if (zero_point_offset % 8 > 0) {\n ${Ue}\n }`:\"\"}\n }\n for (var k: u32 = 0u; k < ${i}u; k++) {\n ${H.indicesSet(\"output_indices\",a-2,`${i+\" * m + k\"}`)};\n ${H.setByIndices(\"output_indices\",\"output_values[k]\")}\n }\n }`};return{name:\"MatMulNBits\",shaderCache:{hint:`${t.cacheKey};${e.length}`,inputDependencies:Array(e.length).fill(\"rank\")},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:w}),getShaderSource:S}},Eu=(e,t)=>{up(e.inputs,t),e.compute(lp(e.inputs,t))},Au=e=>$e(e)});var dp,ku,Ou,cp,ka,Pu,Ru=F(()=>{\"use strict\";ie();_e();Ye();ln();ga();be();ir();dp=(e,t)=>{let r=e[0],a=e[1],n=e[2],o=e[3],s=e[4],l=e[5],i=e[6],c=e[7];if(r.dims.length!==3&&r.dims.length!==5)throw new Error(\"Input query is expected to have 3 or 5 dimensions\");let f=!1,m=r.dims[0],h=r.dims[1],w=r.dims.length===3?f?r.dims[2]/3:r.dims[2]:t.numHeads*r.dims[4],b=h,$=0,I=0,S=Math.floor(w/t.numHeads);if(i&&c){if(i.dims.length!==4)throw new Error('Input \"past_key\" is expected to have 4 dimensions');if(c.dims.length!==4)throw new Error('Input \"past_value\" is expected to have 4 dimensions');$=i.dims[2],I=i.dims[2]}else if(i||c)throw new Error('Input \"past_key\" and \"past_value\" shall be both present or both absent');let v;if(a){if(r.dims.length!==3)throw new Error('Input \"query\" is expected to have 3 dimensions when key is given');if(a.dims.length<3||a.dims.length>5)throw new Error('Input \"key\" is expected to have 3, 4, or 5 dimensions');if(r.dims[0]!==a.dims[0])throw new Error('Input \"query\" and \"key\" shall have same dim 0 (batch size)');if(a.dims.length===3){if(a.dims[2]!==r.dims[2])throw new Error('Input \"query\" and \"key\" shall have same dim 2 (hidden_size)');v=2,b=a.dims[1]}else if(a.dims.length===5){if(a.dims[2]!==t.numHeads||a.dims[3]!==2||a.dims[4]!==S)throw new Error('Expect \"key\" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(n)throw new Error('Expect \"value\" be none when \"key\" has packed kv format.');v=5,b=a.dims[1]}else{if(a.dims[1]!==t.numHeads||a.dims[3]!==S)throw new Error('Expect \"key\" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');v=0,b=a.dims[2]}}else{if(r.dims.length!==3&&r.dims.length!==5)throw new Error('Input \"query\" is expected to have 3 or 5 dimensions when key is empty');if(r.dims.length===5&&(r.dims[2]!==t.numHeads||r.dims[3]!==3))throw new Error('Expect \"query\" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');v=3}if(o){if(o.dims.length!==1)throw new Error('Input \"bias\" is expected to have 1 dimension');if(n&&r.dims.length===5&&r.dims[3]===2)throw new Error(\"bias is not allowed for packed kv.\")}let E=0;if(s){E=8;let H=s.dims;throw H.length===1?H[0]===m?E=1:H[0]===3*m+2&&(E=3):H.length===2&&H[0]===m&&H[1]===b&&(E=5),E===8?new Error('Input \"key_padding_mask\" shape shall be (batch_size) or (batch_size, kv_sequence_length)'):new Error(\"Mask not supported\")}let A=!1,k=w;if(n){if(n.dims.length!==3&&n.dims.length!==4)throw new Error('Input \"value\" is expected to have 3 or 4 dimensions');if(r.dims[0]!==n.dims[0])throw new Error('Input \"query\" and \"value\" shall have same dim 0 (batch_size)');if(n.dims.length===3){if(b!==n.dims[1])throw new Error('Input \"key\" and \"value\" shall have the same dim 1 (kv_sequence_length)');k=n.dims[2]}else{if(b!==n.dims[2])throw new Error('Input \"past_key\" and \"past_value\" shall have the same dim 2 (kv_sequence_length)');k=n.dims[1]*n.dims[3],A=!0}}let U=$+b,N=!1;if(s)throw new Error(\"Key padding mask is not supported\");if(l)throw new Error(\"extraAddQk is not supported\");if(i)throw new Error(\"pastKey is not supported\");if(c)throw new Error(\"pastValue is not supported\");return{batchSize:m,sequenceLength:h,pastSequenceLength:$,kvSequenceLength:b,totalSequenceLength:U,maxSequenceLength:I,inputHiddenSize:0,hiddenSize:w,vHiddenSize:k,headSize:S,vHeadSize:Math.floor(k/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:E,scale:t.scale,broadcastResPosBias:N,passPastInKv:A,qkvFormat:v}},ku=e=>$e({...e}),Ou=$e({perm:[0,2,1,3]}),cp=(e,t,r,a,n,o,s)=>{let l=[a,n,o],i=M.size(l),c=[{type:12,data:i},{type:12,data:s},{type:12,data:o}],f=m=>{let h=q(\"qkv_with_bias\",t.dataType,l),w=D(\"qkv\",t.dataType,l),b=D(\"bias\",r.dataType,l),$=[{name:\"output_size\",type:\"u32\"},{name:\"bias_offset\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"}];return`\n ${m.registerUniforms($).declareVariables(w,b,h)}\n ${m.mainStart()}\n ${m.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset;\n\n qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx];\n }`};return e.compute({name:\"MultiHeadAttentionAddBias\",shaderCache:{inputDependencies:[\"type\",\"type\"]},getRunData:()=>({outputs:[{dims:l,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:c}),getShaderSource:f},{inputs:[t,r],outputs:[-1]})[0]},ka=(e,t,r,a,n,o,s,l)=>{let i=o;if(s){if(a===1)throw new Error(\"AddBiasReshape is not implemented. Please export your model with packed QKV or KV\");return i=cp(e,o,s,t,a,r*n,l),i=i.reshape([t,a,r,n]),e.compute(dt(i,Ou.perm),{inputs:[i],outputs:[-1]})[0]}else return o.dims.length===3&&(i=o.reshape([t,a,r,n])),e.compute(dt(i,Ou.perm),{inputs:[i],outputs:[-1]})[0]},Pu=(e,t)=>{let r=dp(e.inputs,t);if(e.inputs[0].dims.length===5)throw new Error(\"Packed QKV is not implemented\");if(e.inputs[1]?.dims.length===5)throw new Error(\"Packed KV is not implemented\");let a=e.inputs[1]&&e.inputs[2]&&e.inputs[1].dims.length===4&&e.inputs[2].dims.length===4,n=ka(e,r.batchSize,r.numHeads,r.sequenceLength,r.headSize,e.inputs[0],e.inputs[3],0);if(a)return bn(e,n,e.inputs[1],e.inputs[2],e.inputs[4],void 0,void 0,void 0,e.inputs[5],r,t);let o=ka(e,r.batchSize,r.numHeads,r.kvSequenceLength,r.headSize,e.inputs[1],e.inputs[3],r.hiddenSize),s=ka(e,r.batchSize,r.numHeads,r.kvSequenceLength,r.vHeadSize,e.inputs[2],e.inputs[3],2*r.hiddenSize);bn(e,n,o,s,e.inputs[4],void 0,e.inputs[6],e.inputs[7],e.inputs[5],r,t)}});var pp,fp,mp,hp,gp,yp,bp,wp,zu,Bu=F(()=>{\"use strict\";ie();_e();be();pp=e=>{if(!e||e.length<1)throw new Error(\"Too few inputs\");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error(\"Input type must be float or float16.\");if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw new Error(\"The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].\")}},fp=(e,t,r)=>{let a=\"\";for(let n=t-1;n>=0;--n)a+=`\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\n if (k < 0) {\n break;\n }\n if (k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\n break;\n }\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\n `;return`\n value = ${e.type.value}(uniforms.constant_value);\n for (var i = 0; i < 1; i++) {\n var offset = 0;\n var k = 0;\n ${a}\n value = x[offset];\n }\n `},mp=(e,t,r)=>{let a=\"\";for(let n=t-1;n>=0;--n)a+=`\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\n if (k < 0) {\n k = -k;\n }\n {\n let _2n_1 = 2 * (i32(${re(\"uniforms.x_shape\",n,t)}) - 1);\n k = k % _2n_1;\n if(k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\n k = _2n_1 - k;\n }\n }\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\n `;return`\n var offset = 0;\n var k = 0;\n ${a}\n value = x[offset];\n `},hp=(e,t,r)=>{let a=\"\";for(let n=t-1;n>=0;--n)a+=`\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\n if (k < 0) {\n k = 0;\n }\n if (k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\n k = i32(${re(\"uniforms.x_shape\",n,t)}) - 1;\n }\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\n `;return`\n var offset = 0;\n var k = 0;\n ${a}\n value = x[offset];\n `},gp=(e,t,r)=>{let a=\"\";for(let n=t-1;n>=0;--n)a+=`\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\n if (k < 0) {\n k += i32(${re(\"uniforms.x_shape\",n,t)}]);\n }\n if (k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\n k -= i32(${re(\"uniforms.x_shape\",n,t)});\n }\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\n `;return`\n var offset = 0;\n var k = 0;\n ${a}\n value = x[offset];\n `},yp=(e,t,r)=>{switch(r.mode){case 0:return fp(e,t,r.pads.length);case 1:return mp(e,t,r.pads.length);case 2:return hp(e,t,r.pads.length);case 3:return gp(e,t,r.pads.length);default:throw new Error(\"Invalid mode\")}},bp=(e,t)=>{let r=M.padShape(e[0].dims.slice(),t.pads),a=e[0].dims,n=M.size(r),o=[{type:12,data:n},{type:12,data:t.pads}];t.mode===0&&o.push({type:e[0].dataType,data:t.value}),o.push(...K(e[0].dims,r));let s=[\"rank\"],l=i=>{let c=q(\"output\",e[0].dataType,r.length),f=D(\"x\",e[0].dataType,a.length),m=f.type.value,h=yp(c,a.length,t),w=[{name:\"output_size\",type:\"u32\"},{name:\"pads\",type:\"i32\",length:t.pads.length}];return t.mode===0&&w.push({name:\"constant_value\",type:m}),`\n ${i.registerUniforms(w).declareVariables(f,c)}\n ${i.mainStart()}\n ${i.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let indices = ${c.offsetToIndices(\"global_idx\")};\n\n var value = ${m}(0);\n ${h}\n output[global_idx] = value;\n }`};return{name:\"Pad\",shaderCache:{hint:`${t.mode}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(M.size(r)/64)},programUniforms:o}),getShaderSource:l}},wp=(e,t)=>{if(e.length>1){let r=e[1].getBigInt64Array(),a=e.length>=3&&e[2].data?e[2].getFloat32Array()[0]:0,n=e[0].dims.length,o=new Int32Array(2*n).fill(0);if(e.length>=4){let l=e[3].getBigInt64Array();for(let i=0;io[Number(i)]=Number(l));let s=[];return o.forEach(l=>s.push(l)),{mode:t.mode,value:a,pads:s}}else return t},zu=(e,t)=>{pp(e.inputs);let r=wp(e.inputs,t);e.compute(bp(e.inputs,r),{inputs:[0]})}});var Tn,Du,Mu,Uu,Nu,vp,$p,Wu,Vu,Gu,Hu,Lu,Fu,qu,ju,Ku,Yu,Zu,Xu,Qu=F(()=>{\"use strict\";lt();ie();_e();be();Tn=e=>{if(Ae.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error(\"Pool ops requires 1 input.\")},Du=(e,t,r)=>{let a=t.format===\"NHWC\",n=e.dims.slice();a&&n.splice(1,0,n.pop());let o=Object.hasOwnProperty.call(t,\"dilations\"),s=t.kernelShape.slice(),l=t.strides.slice(),i=o?t.dilations.slice():[],c=t.pads.slice();qt.adjustPoolAttributes(r,n,s,l,i,c);let f=qt.computePoolOutputShape(r,n,l,i,s,c,t.autoPad),m=Object.assign({},t);o?Object.assign(m,{kernelShape:s,strides:l,pads:c,dilations:i,cacheKey:t.cacheKey}):Object.assign(m,{kernelShape:s,strides:l,pads:c,cacheKey:t.cacheKey});let h=f.slice();return h.push(h.splice(1,1)[0]),[m,a?h:f]},Mu=(e,t)=>{let r=t.format===\"NHWC\",a=M.size(e),n=M.size(t.kernelShape),o=[{type:12,data:a},{type:12,data:n}],s=[{name:\"outputSize\",type:\"u32\"},{name:\"kernelSize\",type:\"u32\"}];if(t.kernelShape.length<=2){let l=t.kernelShape[t.kernelShape.length-1],i=t.strides[t.strides.length-1],c=t.pads[t.pads.length/2-1],f=t.pads[t.pads.length-1],m=!!(c+f);o.push({type:12,data:l},{type:12,data:i},{type:12,data:c},{type:12,data:f}),s.push({name:\"kw\",type:\"u32\"},{name:\"sw\",type:\"u32\"},{name:\"pwStart\",type:\"u32\"},{name:\"pwEnd\",type:\"u32\"});let h=!1;if(t.kernelShape.length===2){let w=t.kernelShape[t.kernelShape.length-2],b=t.strides[t.strides.length-2],$=t.pads[t.pads.length/2-2],I=t.pads[t.pads.length-2];h=!!($+I),o.push({type:12,data:w},{type:12,data:b},{type:12,data:$},{type:12,data:I}),s.push({name:\"kh\",type:\"u32\"},{name:\"sh\",type:\"u32\"},{name:\"phStart\",type:\"u32\"},{name:\"phEnd\",type:\"u32\"})}return[o,s,!0,m,h]}else{if(r)throw new Error(\"Pooling with kernelShape.length > 2 is not supported for NHWC format.\");let l=M.computeStrides(t.kernelShape);o.push({type:12,data:l},{type:12,data:t.pads},{type:12,data:t.strides}),s.push({name:\"kernelStrides\",type:\"u32\",length:l.length},{name:\"pads\",type:\"u32\",length:t.pads.length},{name:\"strides\",type:\"u32\",length:t.strides.length});let i=t.pads.reduce((c,f)=>c+f);return[o,s,!!i,!1,!1]}},Uu=(e,t,r,a,n,o,s,l,i,c,f,m)=>{let h=n.format===\"NHWC\",w=t.type.value,b=q(\"output\",t.type.tensor,a);if(n.kernelShape.length<=2){let $=\"\",I=\"\",S=\"\",v=r-(h?2:1);if(f?$=`\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\n xIndices[${v}] = indices[${v}] * uniforms.sw - uniforms.pwStart + i;\n if (xIndices[${v}] < 0 || xIndices[${v}]\n >= uniforms.x_shape[${v}]) {\n pad++;\n continue;\n }\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\n ${o}\n }`:$=`\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\n xIndices[${v}] = indices[${v}] * uniforms.sw - uniforms.pwStart + i;\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\n ${o}\n }`,n.kernelShape.length===2){let A=r-(h?3:2);m?I=`\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\n xIndices[${A}] = indices[${A}] * uniforms.sh - uniforms.phStart + j;\n if (xIndices[${A}] < 0 || xIndices[${A}] >= uniforms.x_shape[${A}]) {\n pad += i32(uniforms.kw);\n continue;\n }\n `:I=`\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\n xIndices[${A}] = indices[${A}] * uniforms.sh - uniforms.phStart + j;\n `,S=`\n }\n `}return`\n ${e.registerUniforms(i).declareVariables(t,b)}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n\n let indices = ${b.offsetToIndices(\"global_idx\")};\n var xIndices = ${b.offsetToIndices(\"global_idx\")};\n\n var value = ${w}(${l});\n var pad = 0;\n ${I}\n ${$}\n ${S}\n ${s}\n\n output[global_idx] = value;\n }`}else{if(h)throw new Error(\"Pooling with kernelShape.length > 2 is not supported for NHWC format.\");let $=n.kernelShape.length,I=n.pads.length,S=\"\";return c?S=`\n if (xIndices[j] >= uniforms.x_shape[j]) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\n ${o}\n }`:S=`\n }\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\n ${o}\n `,`\n ${e.registerUniforms(i).declareVariables(t,b)}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n let indices = ${b.offsetToIndices(\"global_idx\")};\n var xIndices = ${b.offsetToIndices(\"global_idx\")};\n\n var offsets: array;\n\n var value = ${w}(${l});\n var pad = 0;\n var isPad = false;\n\n for (var i: u32 = 0u; i < uniforms.kernelSize; i++) {\n var offset = i;\n for (var j = 0u; j < ${$-1}u; j++) {\n offsets[j] = offset / ${re(\"uniforms.kernelStrides\",\"j\",$)};\n offset -= offsets[j] * ${re(\"uniforms.kernelStrides\",\"j\",$)};\n }\n offsets[${$-1}] = offset;\n\n isPad = false;\n for (var j = ${r-$}u; j < ${r}u; j++) {\n xIndices[j] = indices[j] * ${re(\"uniforms.strides\",`j - ${r-$}u`,$)}\n + offsets[j - ${r-$}u] - ${re(\"uniforms.pads\",\"j - 2u\",I)};\n ${S}\n }\n ${s}\n\n output[global_idx] = value;\n }`}},Nu=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,vp=e=>`${Nu(e)};${e.countIncludePad}`,$p=e=>`${Nu(e)};${e.storageOrder};${e.dilations}`,Wu=e=>({format:e.format,autoPad:[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),Vu=(e,t,r,a)=>{let[n,o]=Du(t,a,r),s=D(\"x\",t.dataType,t.dims.length),l=s.type.value,i=\"value += x_val;\",c=\"\";n.countIncludePad?c+=`value /= ${l}(uniforms.kernelSize);`:c+=`value /= ${l}(i32(uniforms.kernelSize) - pad);`;let[f,m,h,w,b]=Mu(o,n);f.push(...K(t.dims,o));let $=[\"rank\"];return{name:e,shaderCache:{hint:`${a.cacheKey};${h};${w};${b}`,inputDependencies:$},getRunData:()=>({outputs:[{dims:o,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(M.size(o)/64)},programUniforms:f}),getShaderSource:I=>Uu(I,s,t.dims.length,o.length,n,i,c,0,m,h,w,b)}},Gu=e=>{let t=e.count_include_pad!==0,r=Wu(e);if(r.ceilMode!==0)throw new Error(\"using ceil() in shape computation is not yet supported for AveragePool\");let a={countIncludePad:t,...r,cacheKey:\"\"};return{...a,cacheKey:vp(a)}},Hu=(e,t)=>{Tn(e.inputs),e.compute(Vu(\"AveragePool\",e.inputs[0],!1,t))},Lu={autoPad:\"\",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Fu=e=>{let t=e.format;return{format:t,...Lu,cacheKey:t}},qu=(e,t)=>{Tn(e.inputs),e.compute(Vu(\"GlobalAveragePool\",e.inputs[0],!0,t))},ju=(e,t,r,a)=>{let[n,o]=Du(t,a,r),s=`\n value = max(x_val, value);\n `,l=\"\",i=D(\"x\",t.dataType,t.dims.length),c=[\"rank\"],[f,m,h,w,b]=Mu(o,n);return f.push(...K(t.dims,o)),{name:e,shaderCache:{hint:`${a.cacheKey};${h};${w};${b}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:o,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(M.size(o)/64)},programUniforms:f}),getShaderSource:$=>Uu($,i,t.dims.length,o.length,n,s,l,t.dataType===10?-65504:-1e5,m,h,w,b)}},Ku=(e,t)=>{Tn(e.inputs),e.compute(ju(\"MaxPool\",e.inputs[0],!1,t))},Yu=e=>{let t=e.storage_order,r=e.dilations,a=Wu(e);if(t!==0)throw new Error(\"column major storage order is not yet supported for MaxPool\");if(a.ceilMode!==0)throw new Error(\"using ceil() in shape computation is not yet supported for MaxPool\");let n={storageOrder:t,dilations:r,...a,cacheKey:\"\"};return{...n,cacheKey:$p(n)}},Zu=e=>{let t=e.format;return{format:t,...Lu,cacheKey:t}},Xu=(e,t)=>{Tn(e.inputs),e.compute(ju(\"GlobalMaxPool\",e.inputs[0],!0,t))}});var xp,Sp,Ju,el=F(()=>{\"use strict\";lt();ie();be();xp=(e,t,r)=>{let a=e===t,n=et&&r>0;if(a||n||o)throw new Error(\"Range these inputs' contents are invalid.\")},Sp=(e,t,r,a)=>{let n=Math.abs(Math.ceil((t-e)/r)),o=[n],s=n,l=[{type:12,data:s},{type:a,data:e},{type:a,data:r},...K(o)],i=c=>{let f=q(\"output\",a,o.length),m=f.type.value,h=[{name:\"outputSize\",type:\"u32\"},{name:\"start\",type:m},{name:\"delta\",type:m}];return`\n ${c.registerUniforms(h).declareVariables(f)}\n ${c.mainStart()}\n ${c.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n output[global_idx] = uniforms.start + ${m}(global_idx) * uniforms.delta;\n }`};return{name:\"Range\",shaderCache:{hint:`${a}`},getShaderSource:i,getRunData:()=>({outputs:[{dims:o,dataType:a}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:l})}},Ju=e=>{let t=0,r=0,a=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],r=e.inputs[1].getInt32Array()[0],a=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],r=e.inputs[1].getFloat32Array()[0],a=e.inputs[2].getFloat32Array()[0]),Ae.webgpu.validateInputContent&&xp(t,r,a),e.compute(Sp(t,r,a,e.inputs[0].dataType),{inputs:[]})}});var Cp,Ip,Ep,Ap,Tp,Op,kp,Pp,Rp,zp,Bp,tl,Dp,Mp,Up,Np,Wp,rl,nl,al=F(()=>{\"use strict\";ie();_e();Ye();be();Cp=(e,t)=>{if(e.every(r=>r>0||(()=>{throw new Error(\"Resize requires scales input values to be positive\")})),e.length>0){if(t.mode===\"linear\"){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw new Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and\n one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===\"cubic\"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error(\"Resize requires scales input size to be 2 or 4 for cubic mode\")}},Ip=(e,t,r)=>{t.every(n=>n>=0&&n{throw new Error(\"Resize requires axes input values to be positive and less than rank\")}));let a=new Array(r).fill(1);return t.forEach((n,o)=>a[n]=e[o]),a},Ep=(e,t,r,a,n,o)=>{let[s,l,i]=r>10?[1,2,3]:[-1,e.length>1?1:-1,-1],c=e[0].dims.length;if(s>0&&e.length>s&&e[s].dims.length>0)e[s].getFloat32Array().forEach(f=>o.push(f));else if(t.coordinateTransformMode===\"tf_crop_and_resize\")throw new Error(\"Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize\");if(l>0&&e.length>l&&e[l].dims.length>0){if(e[l].getFloat32Array().forEach(f=>a.push(f)),a.length!==0&&a.length!==c&&r>=18&&a.length!==t.axes.length)throw new Error(\"Resize requires scales input size to be same as input rank or axes size for opset 18 and up\");Cp(a,t),t.axes.length>0&&Ip(a,t.axes,c).forEach((f,m)=>a[m]=f)}if(i>0&&e.length>i&&(e[i].getBigInt64Array().forEach(f=>n.push(Number(f))),n.length!==c||r>=18&&n.length===t.axes.length))throw new Error(\"Resize requires sizes input size to be same as input rank or axes size for opset 18 and up\");if(t.axes.length>0){if(a.length!==t.axes.length)throw new Error('Resize requires \"scales\" input size to be of axes rank when axes attributes is specified');if(n.length!==t.axes.length)throw new Error('Resize requires \"sizes\" input size to be of rank axes rank when axes attributes is specified')}if(typeof a<\"u\"&&typeof n<\"u\"&&a.length>0&&n.length>c)throw new Error(\"Resize requires only of scales or sizes to be specified\")},Ap=(e,t)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32,\n lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${t} { `+(()=>{switch(e){case\"asymmetric\":return`return ${t}(xResized) / ${t}(xScale);`;case\"pytorch_half_pixel\":return`if (lengthResized > 1) {\n return (${t}(xResized) + 0.5) / ${t}(xScale) - 0.5;\n } else {\n return 0.0;\n }`;case\"tf_half_pixel_for_nn\":return`return (${t}(xResized) + 0.5) / ${t}(xScale);`;case\"align_corners\":return`if (lengthResized == 1) {\n return 0.0;\n } else {\n // The whole part and the fractional part are calculated separately due to inaccuracy of floating\n // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an\n // offset-by-one error later in floor().\n let whole = ${t}(xResized * (lengthOriginal - 1) / (lengthResized - 1));\n let fract =\n ${t}(xResized * (lengthOriginal - 1) % (lengthResized - 1)) / ${t}(lengthResized - 1);\n return whole + fract;\n }`;case\"tf_crop_and_resize\":return`if (lengthResized > 1) {\n return ${t}(roiStart) * ${t}(lengthOriginal - 1) +\n (${t}(xResized) * ${t}(roiEnd - roiStart) * ${t}(lengthOriginal - 1)) /\n ${t}(lengthResized - 1);\n } else {\n return 0.5 * ${t}(roiStart + roiEnd) * ${t}(lengthOriginal - 1);\n }`;case\"half_pixel_symmetric\":return`const outputWidth = ${t}xScale * ${t}(lengthResized);\n const adjustment = ${t}(lengthResized) / outputWidth;\n const center = ${t}(lengthOriginal) / 2;\n const offset = center * (1 - adjustment);\n return offset + ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;case\"half_pixel\":return`return ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+\"}\",Tp=(e,t,r)=>`fn getNearestPixelFromOriginal(xOriginal: ${r}, isDownSample: bool) -> ${r} {`+(()=>{switch(e){case\"round_prefer_ceil\":return\"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }\";case\"floor\":return\"return floor(xOriginal);\";case\"ceil\":return\"return ceil(xOriginal);\";case\"round_prefer_floor\":return\"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }\";case\"simple\":default:if(t<11)return\"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }\";throw new Error(`Nearest mode ${e} is not supported`)}})()+\"}\",Op=(e,t,r)=>{let a=new Array(r).fill(0).concat(new Array(r).fill(1)),n=e.length===0?a:e.slice();return t.length>0?(t.forEach((o,s)=>{a[o]=n[s],a[s+r]=n[t.length+s]}),a):n},kp=(e,t,r,a)=>{let n=[];if(r.length>0)if(a.length>0){if(e.forEach(o=>n.push(o)),Math.max(...a)>e.length)throw new Error(\"axes is out of bound\");a.forEach((o,s)=>n[o]=r[s])}else r.forEach(o=>n.push(o));else{if(t.length===0)throw new Error(\"Resize requires either scales or sizes.\");n=e.map((o,s)=>Math.round(o*t[s]))}return n},Pp=(e,t,r)=>{let a=(()=>{switch(r.keepAspectRatioPolicy){case\"not_larger\":return r.axes.length>0?Math.min(...r.axes.map(o=>t[o]),Number.MAX_VALUE):Math.min(...t,Number.MAX_VALUE);case\"not_smaller\":return r.axes.length>0?Math.max(...r.axes.map(o=>t[o]),Number.MIN_VALUE):Math.max(...t,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${r.keepAspectRatioPolicy} is not supported`)}})();t.fill(1,0,t.length);let n=e.slice();return r.axes.length>0?(r.axes.forEach(o=>t[o]=a),r.axes.forEach(o=>n[o]=Math.round(e[o]*t[o]))):(t.fill(a,0,t.length),n.forEach((o,s)=>n[s]=Math.round(o*t[s]))),n},Rp=(e,t,r,a,n)=>`\n fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${r.length}> {\n var original_indices: array<${e.type.value}, ${r.length}>;\n for (var i:u32 = 0; i < ${r.length}; i++) {\n var output_index = ${e.indicesGet(\"output_indices\",\"i\")};\n var scale = ${re(\"uniforms.scales\",\"i\",a)};\n var roi_low = ${re(\"uniforms.roi\",\"i\",n)};\n var roi_hi = ${re(\"uniforms.roi\",`i + ${t.length}`,n)};\n if (scale == 1.0) {\n original_indices[i] = ${e.type.value}(output_index);\n } else {\n var input_shape_i = ${re(\"uniforms.input_shape\",\"i\",t.length)};\n var output_shape_i = ${re(\"uniforms.output_shape\",\"i\",r.length)};\n original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\n input_shape_i, roi_low, roi_hi);\n }\n }\n return original_indices;\n }`,zp=(e,t,r,a,n,o,s)=>`\n fn calculateInputIndicesFromOutputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} {\n var input_indices: ${e.type.indices};\n for (var i:u32 = 0; i < ${a.length}; i++) {\n var output_index = ${t.indicesGet(\"output_indices\",\"i\")};\n var input_index: u32;\n var scale = ${re(\"uniforms.scales\",\"i\",n)};\n if (scale == 1.0) {\n input_index = output_index;\n } else {\n var roi_low = ${re(\"uniforms.roi\",\"i\",o)};\n var roi_hi = ${re(\"uniforms.roi\",`i + ${r.length}`,o)};\n var input_shape_i = ${re(\"uniforms.input_shape\",\"i\",r.length)};\n var output_shape_i = ${re(\"uniforms.output_shape\",\"i\",a.length)};\n var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\n input_shape_i, roi_low, roi_hi);\n if (!${s} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) {\n if (original_idx < 0) {\n input_index = 0;\n } else if (original_idx > ${t.type.value}(input_shape_i - 1)) {\n input_index = input_shape_i - 1;\n } else {\n input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1));\n }\n } else {\n input_index = u32(original_idx);\n }\n }\n ${e.indicesSet(\"input_indices\",\"i\",\" input_index\")}\n }\n return input_indices;\n }`,Bp=(e,t)=>`\n fn checkInputIndices(input_indices: ${e.type.indices}) -> bool {\n for (var i:u32 = 0; i < ${t.length}; i++) {\n var input_index = ${e.indicesGet(\"input_indices\",\"i\")};\n if (input_index < 0 || input_index >= ${re(\"uniforms.input_shape\",\"i\",t.length)}) {\n return false;\n }\n }\n return true;\n }`,tl=(e,t,r,a)=>e.rank>a?`\n ${e.indicesSet(\"input_indices\",t,\"channel\")};\n ${e.indicesSet(\"input_indices\",r,\"batch\")};\n`:\"\",Dp=(e,t,r,a,n)=>{let[s,l,i,c]=r.length===2?[-1,0,1,-1]:[0,2,3,1],f=e.type.value;return`\n fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${f} {\n var input_indices: ${e.type.indices};\n ${e.indicesSet(\"input_indices\",l,`max(0, min(row, ${r[l]} - 1))`)};\n ${e.indicesSet(\"input_indices\",i,`max(0, min(col, ${r[i]} - 1))`)};\n ${tl(e,c,s,2)}\n return ${e.getByIndices(\"input_indices\")};\n }\n\n fn bilinearInterpolation(output_indices: ${t.type.indices}) -> ${f} {\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\n var row:${f} = originalIndices[${l}];\n var col:${f} = originalIndices[${i}];\n ${a?`if (row < 0 || row > (${r[l]} - 1) || col < 0 || col > (${r[i]} - 1)) {\n return ${n};\n }`:\"\"};\n row = max(0, min(row, ${r[l]} - 1));\n col = max(0, min(col, ${r[i]} - 1));\n var row1: u32 = u32(row);\n var col1: u32 = u32(col);\n var row2: u32 = u32(row + 1);\n var col2: u32 = u32(col + 1);\n var channel: u32 = ${r.length>2?`u32(originalIndices[${c}])`:\"0\"};\n var batch: u32 = ${r.length>2?`u32(originalIndices[${s}])`:\"0\"};\n var x11: ${f} = getInputValue(batch, channel, row1, col1);\n var x12: ${f} = getInputValue(batch, channel, row1, col2);\n var x21: ${f} = getInputValue(batch, channel, row2, col1);\n var x22: ${f} = getInputValue(batch, channel, row2, col2);\n var dx1: ${f} = abs(row - ${f}(row1));\n var dx2: ${f} = abs(${f}(row2) - row);\n var dy1: ${f} = abs(col - ${f}(col1));\n var dy2: ${f} = abs(${f}(col2) - col);\n if (row1 == row2) {\n dx1 = 0.5;\n dx2 = 0.5;\n }\n if (col1 == col2) {\n dy1 = 0.5;\n dy2 = 0.5;\n }\n return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1);\n }`},Mp=(e,t,r,a,n,o,s,l,i,c)=>{let f=r.length===2,m=!0,[h,w]=f?[0,1]:m?[2,3]:[1,2],b=e.type.value,$=I=>{let S=I===h?\"row\":\"col\";return`\n fn ${S}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${t.type.indices}) -> ${b} {\n var output_index = ${t.indicesGet(\"output_indices\",I)};\n var originalIdx: ${b} = getOriginalCoordinateFromResizedCoordinate(output_index, ${n[I]},\n ${a[I]}, ${r[I]}, ${o[I]}, ${o[I]} + ${r.length});\n var fractOriginalIdx: ${b} = originalIdx - floor(originalIdx);\n var coefs = getCubicInterpolationCoefs(fractOriginalIdx);\n\n if (${l} && (originalIdx < 0 || originalIdx > (${r[I]} - 1))) {\n return ${i};\n }\n var data: array<${b}, 4> = array<${b}, 4>(0.0, 0.0, 0.0, 0.0);\n for (var i: i32 = -1; i < 3; i++) {\n var ${S}: ${b} = originalIdx + ${b}(i);\n if (${S} < 0 || ${S} >= ${r[I]}) {\n ${(()=>c?`coefs[i + 1] = 0.0;\n continue;`:l?`return ${i};`:`${S} = max(0, min(${S}, ${r[I]} - 1));`)()};\n }\n var input_indices_copy: ${e.type.indices} = input_indices;\n ${e.indicesSet(\"input_indices_copy\",I,`u32(${S})`)};\n data[i + 1] = ${I===h?e.getByIndices(\"input_indices_copy\"):\"rowCubicInterpolation(input_indices_copy, output_indices)\"};\n }\n return cubicInterpolation1D(data, coefs);\n }`};return`\n ${$(h)};\n ${$(w)};\n fn getCubicInterpolationCoefs(s: ${b}) -> array<${b}, 4> {\n var absS = abs(s);\n var coeffs: array<${b}, 4> = array<${b}, 4>(0.0, 0.0, 0.0, 0.0);\n var oneMinusAbsS: ${b} = 1.0 - absS;\n var twoMinusAbsS: ${b} = 2.0 - absS;\n var onePlusAbsS: ${b} = 1.0 + absS;\n coeffs[0] = ((${s} * onePlusAbsS - 5 * ${s}) * onePlusAbsS + 8 * ${s}) * onePlusAbsS - 4 * ${s};\n coeffs[1] = ((${s} + 2) * absS - (${s} + 3)) * absS * absS + 1;\n coeffs[2] = ((${s} + 2) * oneMinusAbsS - (${s} + 3)) * oneMinusAbsS * oneMinusAbsS + 1;\n coeffs[3] = ((${s} * twoMinusAbsS - 5 * ${s}) * twoMinusAbsS + 8 * ${s}) * twoMinusAbsS - 4 * ${s};\n return coeffs;\n }\n\n fn cubicInterpolation1D(x: array<${b}, 4>, coefs: array<${b}, 4>) -> ${b} {\n var coefsSum: ${b} = coefs[0] + coefs[1] + coefs[2] + coefs[3];\n return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum;\n }\n\n fn bicubicInterpolation(output_indices: ${t.type.indices}) -> ${b} {\n var input_indices: ${e.type.indices} = output_indices;\n return colCubicInterpolation(input_indices, output_indices);\n }\n `},Up=(e,t,r,a,n)=>{let[s,l,i,c,f]=r.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],m=e.type.value;return`\n fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${m} {\n var input_indices: ${e.type.indices};\n ${e.indicesSet(\"input_indices\",l,`max(0, min(depth, ${r[l]} - 1))`)};\n ${e.indicesSet(\"input_indices\",i,`max(0, min(height, ${r[i]} - 1))`)};\n ${e.indicesSet(\"input_indices\",c,`max(0, min(width, ${r[c]} - 1))`)};\n ${tl(e,f,s,3)}\n return ${e.getByIndices(\"input_indices\")};\n }\n\n fn trilinearInterpolation(output_indices: ${t.type.indices}) -> ${m} {\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\n var depth:${m} = originalIndices[${l}];\n var height:${m} = originalIndices[${i}];\n var width:${m} = originalIndices[${c}];\n ${a?`if (depth < 0 || depth > (${r[l]} - 1) || height < 0 || height > (${r[i]} - 1) || width < 0 || (width > ${r[c]} - 1)) {\n return ${n};\n }`:\"\"};\n\n depth = max(0, min(depth, ${r[l]} - 1));\n height = max(0, min(height, ${r[i]} - 1));\n width = max(0, min(width, ${r[c]} - 1));\n var depth1: u32 = u32(depth);\n var height1: u32 = u32(height);\n var width1: u32 = u32(width);\n var depth2: u32 = u32(depth + 1);\n var height2: u32 = u32(height + 1);\n var width2: u32 = u32(width + 1);\n var channel: u32 = ${r.length>3?`u32(originalIndices[${f}])`:\"0\"};\n var batch: u32 = ${r.length>3?`u32(originalIndices[${s}])`:\"0\"};\n\n var x111: ${m} = getInputValue(batch, channel, depth1, height1, width1);\n var x112: ${m} = getInputValue(batch, channel, depth1, height1, width2);\n var x121: ${m} = getInputValue(batch, channel, depth1, height2, width1);\n var x122: ${m} = getInputValue(batch, channel, depth1, height2, width2);\n var x211: ${m} = getInputValue(batch, channel, depth2, height1, width1);\n var x212: ${m} = getInputValue(batch, channel, depth2, height1, width2);\n var x221: ${m} = getInputValue(batch, channel, depth2, height2, width1);\n var x222: ${m} = getInputValue(batch, channel, depth2, height2, width2);\n var dx1: ${m} = abs(depth - ${m}(depth1));\n var dx2: ${m} = abs(${m}(depth2) - depth);\n var dy1: ${m} = abs(height - ${m}(height1));\n var dy2: ${m} = abs(${m}(height2) - height);\n var dz1: ${m} = abs(width - ${m}(width1));\n var dz2: ${m} = abs(${m}(width2) - width);\n if (depth1 == depth2) {\n dx1 = 0.5;\n dx2 = 0.5;\n }\n if (height1 == height2) {\n dy1 = 0.5;\n dy2 = 0.5;\n }\n if (width1 == width2) {\n dz1 = 0.5;\n dz2 = 0.5;\n }\n return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 +\n x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1);\n }`},Np=(e,t,r,a,n,o)=>{let s=e.dims,l=Op(o,t.axes,s.length),i=kp(s,a,n,t.axes),c=a.slice();a.length===0&&(c=s.map((v,E)=>v===0?1:i[E]/v),t.keepAspectRatioPolicy!==\"stretch\"&&(i=Pp(s,c,t)));let f=q(\"output\",e.dataType,i.length),m=D(\"input\",e.dataType,s.length),h=M.size(i),w=s.length===i.length&&s.every((v,E)=>v===i[E]),b=t.coordinateTransformMode===\"tf_crop_and_resize\",$=t.extrapolationValue,I=m.type.value,S=v=>`\n ${w?\"\":`\n ${Ap(t.coordinateTransformMode,I)};\n ${(()=>{switch(t.mode){case\"nearest\":return`\n ${Bp(m,s)};\n ${Tp(t.nearestMode,r,I)};\n ${zp(m,f,s,i,c.length,l.length,b)};\n `;case\"linear\":return`\n ${Rp(f,s,i,c.length,l.length)};\n ${(()=>{if(s.length===2||s.length===4)return`${Dp(m,f,s,b,$)}`;if(s.length===3||s.length===5)return`${Up(m,f,s,b,$)}`;throw Error(\"Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.\")})()};\n `;case\"cubic\":return`\n ${(()=>{if(s.length===2||s.length===4)return`${Mp(m,f,s,i,c,l,t.cubicCoeffA,b,t.extrapolationValue,t.excludeOutside)}`;throw Error(\"Cubic mode only supports input dims 2 and 4 are supported in linear mode.\")})()};\n `;default:throw Error(\"Invalid resize mode\")}})()};\n `}\n ${v.registerUniform(\"output_size\",\"u32\").registerUniform(\"scales\",\"f32\",c.length).registerUniform(\"roi\",\"f32\",l.length).declareVariables(m,f)}\n ${v.mainStart()}\n ${v.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n ${w?\"output[global_idx] = input[global_idx];\":`\n let output_indices = ${f.offsetToIndices(\"global_idx\")};\n var input_indices: ${m.type.indices};\n ${(()=>{switch(t.mode){case\"nearest\":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices);\n if (checkInputIndices(input_indices)) {\n output[global_idx] = ${m.getByIndices(\"input_indices\")};\n } else {\n output[global_idx] = ${t.extrapolationValue};\n }`;case\"linear\":return`output[global_idx] = ${s.length===2||s.length===4?\"bilinearInterpolation\":\"trilinearInterpolation\"}(output_indices);`;case\"cubic\":return\"output[global_idx] = bicubicInterpolation(output_indices);\";default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()};\n`}\n }`;return{name:\"Resize\",shaderCache:{hint:`${t.cacheKey}|${r}|${c.length>0?c:\"\"}|${n.length>0?n:\"\"}|${l.length>0?l:\"\"}|${w}|${s}`,inputDependencies:[\"rank\"]},getShaderSource:S,getRunData:()=>({outputs:[{dims:i,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:[{type:12,data:h},{type:1,data:c},{type:1,data:l},...K(s,i)]})}},Wp=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},rl=(e,t)=>{let r=[],a=[],n=[],o=Wp(e);if(t.antialias!==0)throw Error(\"Only default value (0) for Antialias attribute is supported\");Ep(e.inputs,t,o,r,a,n),e.compute(Np(e.inputs[0],t,o,r,a,n),{inputs:[0]})},nl=e=>{let t=e.antialias,r=e.axes,a=e.coordinateTransformMode,n=e.cubicCoeffA,o=e.excludeOutside!==0,s=e.extrapolationValue,l=e.keepAspectRatioPolicy,i=e.mode,c=e.nearestMode===\"\"?\"simple\":e.nearestMode;return $e({antialias:t,axes:r,coordinateTransformMode:a,cubicCoeffA:n,excludeOutside:o,extrapolationValue:s,keepAspectRatioPolicy:l,mode:i,nearestMode:c})}});var Vp,Gp,il,ol=F(()=>{\"use strict\";ie();_e();be();Vp=e=>{if(!e||e.length<3)throw new Error(\"layerNorm requires at least 3 inputs.\");let t=e[0],r=e[1],a=e[2];if(t.dataType!==r.dataType||t.dataType!==a.dataType)throw new Error(\"All inputs must have the same data type\");if(t.dims.length!==3&&t.dims.length!==2)throw new Error(\"Input must be 2D or 3D\");if(r.dims.length!==3&&r.dims.length!==2)throw new Error(\"Skip must be 2D or 3D\");let n=t.dims[t.dims.length-1],o=t.dims[t.dims.length-2];if(r.dims[r.dims.length-1]!==n)throw new Error(\"Skip must have the same hidden size as input\");if(r.dims[r.dims.length-2]!==o)throw new Error(\"Skip must have the same sequence length as input\");if(a.dims.length!==1)throw new Error(\"Gamma must be 1D\");if(a.dims[a.dims.length-1]!==n)throw new Error(\"Gamma must have the same hidden size as input\");if(e.length>3){let s=e[3];if(s.dims.length!==1)throw new Error(\"Beta must be 1D\");if(s.dims[s.dims.length-1]!==n)throw new Error(\"Beta must have the same hidden size as input\")}if(e.length>4){let s=e[4];if(s.dims.length!==1)throw new Error(\"Bias must be 1D\");if(s.dims[s.dims.length-1]!==n)throw new Error(\"Bias must have the same hidden size as input\")}},Gp=(e,t,r,a)=>{let n=e[0].dims,o=M.size(n),s=n,l=o,i=n.slice(-1)[0],c=a?n.slice(0,-1).concat(1):[],f=e.length>3,m=e.length>4,h=a&&r>1,w=a&&r>2,b=r>3,$=Me(i),I=[{type:12,data:l},{type:12,data:$},{type:12,data:i},{type:1,data:t.epsilon}],S=E=>{let A=[{name:\"output_size\",type:\"u32\"},{name:\"components\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"},{name:\"epsilon\",type:\"f32\"}],k=[D(\"x\",e[0].dataType,e[0].dims,$),D(\"skip\",e[1].dataType,e[1].dims,$),D(\"gamma\",e[2].dataType,e[2].dims,$)];f&&k.push(D(\"beta\",e[3].dataType,e[3].dims,$)),m&&k.push(D(\"bias\",e[4].dataType,e[4].dims,$)),k.push(q(\"output\",e[0].dataType,s,$)),h&&k.push(q(\"mean_output\",1,c)),w&&k.push(q(\"inv_std_output\",1,c)),b&&k.push(q(\"input_skip_bias_sum\",e[0].dataType,s,$));let U=ke(e[0].dataType);return`\n\n ${E.registerUniforms(A).declareVariables(...k)}\n\n ${E.mainStart()}\n ${E.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size / uniforms.hidden_size\")}\n let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components;\n let offset = global_idx * hidden_size_vectorized;\n var sum = ${Xe(\"f32\",$)};\n var squareSum = ${Xe(\"f32\",$)};\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\n let skip_value = skip[offset + i];\n let bias_value = ${m?\"bias[i]\":\"0.0\"};\n let input_value = x[offset + i];\n let value = input_value + skip_value + bias_value;\n ${b?\"input_skip_bias_sum[offset + i] = value;\":\"\"}\n output[offset + i] = value;\n let f32_value = ${mt(U,$,\"value\")};\n sum += f32_value;\n squareSum += f32_value * f32_value;\n }\n let mean = ${it(\"sum\",$)} / f32(uniforms.hidden_size);\n let inv_std_dev = inverseSqrt(${it(\"squareSum\",$)} / f32(uniforms.hidden_size) - mean * mean + uniforms.epsilon);\n ${h?\"mean_output[global_idx] = mean;\":\"\"}\n ${w?\"inv_std_output[global_idx] = inv_std_dev;\":\"\"}\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\n output[offset + i] = (output[offset + i] - ${U}(mean)) * ${U}(inv_std_dev) * gamma[i] + ${f?\"beta[i]\":\"0.0\"};\n }\n }`},v=[{dims:s,dataType:e[0].dataType}];return r>1&&v.push({dims:c,dataType:1}),r>2&&v.push({dims:c,dataType:1}),r>3&&v.push({dims:n,dataType:e[0].dataType}),{name:\"SkipLayerNormalization\",shaderCache:{hint:`${$};${h};${w};${b}`,inputDependencies:e.map((E,A)=>\"type\")},getShaderSource:S,getRunData:()=>({outputs:v,dispatchGroup:{x:Math.ceil(l/i/64)},programUniforms:I})}},il=(e,t)=>{Vp(e.inputs);let a=[0];e.outputCount>1&&a.push(-3),e.outputCount>2&&a.push(-3),e.outputCount>3&&a.push(3),e.compute(Gp(e.inputs,t,e.outputCount,!1),{outputs:a})}});var Hp,On,Lp,sl,Fp,qp,ul,ll,dl=F(()=>{\"use strict\";ie();_e();Ye();be();Hp=(e,t)=>{if(!e||e.length<1)throw new Error(\"too few inputs\");if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw new Error(\"axes, starts and ends must have the same length\")}else if(t.starts.length!==t.ends.length)throw new Error(\"starts and ends must have the same length\");e.slice(1).forEach((r,a)=>{if(e[a+1].dataType!==6&&e[a+1].dataType!==7)throw new Error(`Input ${a} must be an array of int32 or int64`)})},On=(e,t)=>{let r=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(a=>r.push(Number(a)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(a=>r.push(Number(a)));else throw new Error(`Input ${t} must be an array of int32 or int64`);return r},Lp=(e,t)=>{if(e.length>1){let r=On(e,1),a=On(e,2),n=On(e,3);return n.length===0&&(n=[...Array(e[0].dims.length).keys()]),$e({starts:r,ends:a,axes:n})}else return t},sl=(e,t,r,a,n)=>{let o=e;return e<0&&(o+=r[a[t]]),n[t]<0?Math.max(0,Math.min(o,r[a[t]]-1)):Math.max(0,Math.min(o,r[a[t]]))},Fp=(e,t,r)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} {\n var input_indices: ${e.type.indices};\n var carry = 0u;\n for (var i = ${r.length}; i >= 0; i--) {\n let input_shape_i = ${re(\"uniforms.input_shape\",\"i\",r.length)};\n let steps_i = ${re(\"uniforms.steps\",\"i\",r.length)};\n let signs_i = ${re(\"uniforms.signs\",\"i\",r.length)};\n let starts_i = ${re(\"uniforms.starts\",\"i\",r.length)};\n var output_index = ${t.indicesGet(\"output_indices\",\"i\")};\n var input_index = output_index * steps_i + starts_i + carry;\n carry = input_index / input_shape_i;\n input_index = input_index % input_shape_i;\n if (signs_i < 0) {\n input_index = input_shape_i - input_index - 1u + starts_i;\n }\n ${e.indicesSet(\"input_indices\",\"i\",\"input_index\")};\n }\n return input_indices;\n }`,qp=(e,t)=>{let r=e[0].dims,a=M.size(r),n=t.axes.length>0?M.normalizeAxes(t.axes,r.length):[...Array(r.length).keys()],o=On(e,4);o.forEach(S=>S!==0||(()=>{throw new Error(\"step cannot be 0\")})),o.length===0&&(o=Array(n.length).fill(1));let s=t.starts.map((S,v)=>sl(S,v,r,n,o)),l=t.ends.map((S,v)=>sl(S,v,r,n,o));if(n.length!==s.length||n.length!==l.length)throw new Error(\"start, ends and axes should have the same number of elements\");if(n.length!==r.length)for(let S=0;SMath.sign(S));o.forEach((S,v,E)=>{if(S<0){let A=(l[v]-s[v])/S,k=s[v],U=k+A*o[v];s[v]=U,l[v]=k,E[v]=-S}});let c=r.slice(0);n.forEach((S,v)=>{c[S]=Math.ceil((l[S]-s[S])/o[S])});let f={dims:c,dataType:e[0].dataType},m=q(\"output\",e[0].dataType,c.length),h=D(\"input\",e[0].dataType,e[0].dims.length),w=M.size(c),b=[{name:\"outputSize\",type:\"u32\"},{name:\"starts\",type:\"u32\",length:s.length},{name:\"signs\",type:\"i32\",length:i.length},{name:\"steps\",type:\"u32\",length:o.length}],$=[{type:12,data:w},{type:12,data:s},{type:6,data:i},{type:12,data:o},...K(e[0].dims,c)],I=S=>`\n ${S.registerUniforms(b).declareVariables(h,m)}\n ${Fp(h,m,r)}\n ${S.mainStart()}\n ${S.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n let output_indices = ${m.offsetToIndices(\"global_idx\")};\n let input_indices = calculateInputIndices(output_indices);\n ${m.setByOffset(\"global_idx\",h.getByIndices(\"input_indices\"))}\n }`;return{name:\"Slice\",shaderCache:{hint:`${i.length}_${s.length}_${o.length}`,inputDependencies:[\"rank\"]},getShaderSource:I,getRunData:()=>({outputs:[f],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:$})}},ul=(e,t)=>{Hp(e.inputs,t);let r=Lp(e.inputs,t);e.compute(qp(e.inputs,r),{inputs:[0]})},ll=e=>{let t=e.starts,r=e.ends,a=e.axes;return $e({starts:t,ends:r,axes:a})}});var jp,Kp,cl,pl,fl=F(()=>{\"use strict\";ie();_e();Ye();be();jp=e=>{if(!e||e.length!==1)throw new Error(\"Softmax op requires 1 input.\")},Kp=(e,t)=>{let r=e.dims,a=M.size(r),n=64,o=t.axis;if(o<0&&(o=r.length+o),oS===4?`max(max(${I}.x, ${I}.y), max(${I}.z, ${I}.w))`:S===2?`max(${I}.x, ${I}.y)`:S===3?`max(max(${I}.x, ${I}.y), ${I}.z)`:I,m=D(\"x\",e.dataType,e.dims,i),h=q(\"result\",e.dataType,e.dims,i),w=m.type.value,b=ke(e.dataType)===\"f32\"?`var threadMax = ${w}(-3.402823e+38f);`:`var threadMax = ${w}(-65504.0h);`,$=I=>`\n var rowMaxShared : ${w};\n var rowSumShared : ${w};\n var threadShared : array<${w}, ${n}>;\n\n fn getValue(row: i32, col: i32, row_stride: i32) -> ${w} {\n let index = row * row_stride + col;\n return x[index];\n }\n\n fn setValue(row: i32, col: i32, row_stride: i32, value: ${w}) {\n let index = row * row_stride + col;\n result[index] = value;\n }\n ${I.registerUniform(\"packedCols\",\"i32\").declareVariables(m,h)}\n ${I.mainStart()}\n let gindex = i32(global_idx);\n let lindex = i32(local_idx);\n const wg = ${n};\n let row = gindex / wg;\n let cols = uniforms.packedCols;\n let row_stride : i32 = uniforms.packedCols;\n\n // find the rows max\n ${b}\n for (var col = lindex; col < cols; col += wg) {\n let value = getValue(row, col, row_stride);\n threadMax = max(threadMax, value);\n }\n if (lindex < cols) {\n threadShared[lindex] = threadMax;\n }\n workgroupBarrier();\n\n var reduceSize = min(cols, wg);\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\n reduceSize = currSize + (reduceSize & 1);\n if (lindex < currSize) {\n threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]);\n }\n workgroupBarrier();\n }\n if (lindex == 0) {\n rowMaxShared = ${w}(${f(\"threadShared[0]\",i)});\n }\n workgroupBarrier();\n\n // find the rows sum\n var threadSum = ${w}(0.0);\n for (var col = lindex; col < cols; col += wg) {\n let subExp = exp(getValue(row, col, row_stride) - rowMaxShared);\n threadSum += subExp;\n }\n threadShared[lindex] = threadSum;\n workgroupBarrier();\n\n for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) {\n if (lindex < currSize) {\n threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize];\n }\n workgroupBarrier();\n }\n if (lindex == 0) {\n rowSumShared = ${w}(${it(\"threadShared[0]\",i)});\n }\n workgroupBarrier();\n\n // calculate final value for each element in the row\n for (var col = lindex; col < cols; col += wg) {\n let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared;\n setValue(row, col, row_stride, value);\n }\n }`;return{name:\"Softmax\",shaderCache:{hint:`${i}`,inputDependencies:[\"type\"]},getRunData:()=>({outputs:[{dims:r,dataType:e.dataType}],dispatchGroup:{x:l},programUniforms:[{type:12,data:c}]}),getShaderSource:$}},cl=(e,t)=>{jp(e.inputs),e.compute(Kp(e.inputs[0],t))},pl=e=>$e({axis:e.axis})});var Yp,Zp,Xp,Qp,Jp,ml,hl,gl=F(()=>{\"use strict\";ie();_e();Ye();be();Yp=e=>{if(!e||e.length<1)throw new Error(\"too few inputs\")},Zp=(e,t)=>{let r=[],a=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(n=>r.push(Number(n))),a=r.length),$e({numOutputs:a,axis:t.axis,splitSizes:r})},Xp=e=>`\nfn calculateOutputIndex(index: u32) -> u32 {\n for (var i: u32 = 0u; i < ${e}u; i += 1u ) {\n if (index < ${re(\"uniforms.size_in_split_axis\",\"i\",e)}) {\n return i;\n }\n }\n return ${e}u;\n}`,Qp=e=>{let t=e.length,r=[];for(let a=0;a{let r=e[0].dims,a=M.size(r),n=e[0].dataType,o=M.normalizeAxis(t.axis,r.length),s=new Array(t.numOutputs),l=D(\"input\",n,r.length),i=new Array(t.numOutputs),c=[],f=[],m=0,h=[{type:12,data:a}];for(let b=0;b`\n ${b.registerUniform(\"input_size\",\"u32\").registerUniform(\"size_in_split_axis\",\"u32\",i.length).declareVariables(l,...s)}\n ${Xp(i.length)}\n ${Qp(s)}\n\n ${b.mainStart()}\n ${b.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.input_size\")}\n\n var indices = ${l.offsetToIndices(\"global_idx\")};\n var index = ${l.indicesGet(\"indices\",o)};\n let output_number = calculateOutputIndex(index);\n if (output_number != 0) {\n index -= ${re(\"uniforms.size_in_split_axis\",\"output_number - 1u\",i.length)};\n ${l.indicesSet(\"indices\",o,\"index\")};\n }\n writeBufferData(output_number, indices, global_idx);\n }`;return{name:\"Split\",shaderCache:{hint:t.cacheKey,inputDependencies:[\"rank\"]},getShaderSource:w,getRunData:()=>({outputs:c,dispatchGroup:{x:Math.ceil(a/64)},programUniforms:h})}},ml=(e,t)=>{Yp(e.inputs);let r=e.inputs.length===1?t:Zp(e.inputs,t);e.compute(Jp(e.inputs,r),{inputs:[0]})},hl=e=>{let t=e.axis,r=e.splitSizes,a=e.numOutputs<0?r.length:e.numOutputs;if(a!==r.length)throw new Error(\"numOutputs and splitSizes lengh must be equal\");return $e({axis:t,numOutputs:a,splitSizes:r})}});var yl,ef,tf,rf,bl,wl=F(()=>{\"use strict\";ie();_e();be();yl=e=>Array.from(e.getBigInt64Array(),Number),ef=e=>{if(!e||e.length!==2)throw new Error(\"Tile requires 2 inputs.\");if(e[0].dataType!==1&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error(\"Tile only support float, int32, and uint32 data types\");if(e[1].dataType!==7)throw new Error(\"Tile `repeats` input should be of int64 data type\");if(e[1].dims.length!==1)throw new Error(\"Tile `repeats` input should be 1-D\");if(yl(e[1]).length!==e[0].dims.length)throw new Error(\"Tile `repeats` input should have same number of elements as rank of input data tensor\")},tf=(e,t)=>{let r=[];for(let a=0;a{let t=e[0].dims,r=yl(e[1]),a=tf(t,r),n=M.size(a),o=e[0].dataType,s=D(\"input\",o,t.length),l=q(\"output\",o,a.length),i=c=>`\n const inputShape = ${s.indices(...t)};\n ${c.registerUniform(\"output_size\",\"u32\").declareVariables(s,l)}\n ${c.mainStart()}\n ${c.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n let output_indices = ${l.offsetToIndices(\"global_idx\")};\n var input_indices: ${s.type.indices};\n for (var i = 0; i < ${t.length}; i++) {\n let input_dim_i = ${s.indicesGet(\"uniforms.input_shape\",\"i\")};\n let input_dim_value = ${l.indicesGet(\"output_indices\",\"i\")} % input_dim_i;\n\n ${s.indicesSet(\"input_indices\",\"i\",\"input_dim_value\")}\n }\n ${l.setByOffset(\"global_idx\",s.getByIndices(\"input_indices\"))}\n }`;return{name:\"Tile\",shaderCache:{hint:`${r}`,inputDependencies:[\"rank\"]},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},...K(e[0].dims,a)]}),getShaderSource:i}},bl=e=>{ef(e.inputs),e.compute(rf(e.inputs),{inputs:[0]})}});var nf,af,vl,$l=F(()=>{\"use strict\";ie();_e();be();nf=(e,t,r,a,n)=>{let o=q(\"output_data\",n,r.length,4),s=D(\"a_data\",t[1].dataType,t[1].dims.length,4),l=D(\"b_data\",t[2].dataType,t[2].dims.length,4),i=D(\"c_data\",t[0].dataType,t[0].dims.length,4),c,f=(m,h,w)=>`select(${h}, ${m}, ${w})`;if(!a)c=o.setByOffset(\"global_idx\",f(s.getByOffset(\"global_idx\"),l.getByOffset(\"global_idx\"),i.getByOffset(\"global_idx\")));else{let m=(h,w,b=\"\")=>{let $=`a_data[index_a${w}][component_a${w}]`,I=`b_data[index_b${w}][component_b${w}]`,S=`bool(c_data[index_c${w}] & (0xffu << (component_c${w} * 8)))`;return`\n let output_indices${w} = ${o.offsetToIndices(`global_idx * 4u + ${w}u`)};\n let offset_a${w} = ${s.broadcastedIndicesToOffset(`output_indices${w}`,o)};\n let offset_b${w} = ${l.broadcastedIndicesToOffset(`output_indices${w}`,o)};\n let offset_c${w} = ${i.broadcastedIndicesToOffset(`output_indices${w}`,o)};\n let index_a${w} = offset_a${w} / 4u;\n let index_b${w} = offset_b${w} / 4u;\n let index_c${w} = offset_c${w} / 4u;\n let component_a${w} = offset_a${w} % 4u;\n let component_b${w} = offset_b${w} % 4u;\n let component_c${w} = offset_c${w} % 4u;\n ${h}[${w}] = ${b}(${f($,I,S)});\n `};n===9?c=`\n var data = vec4(0);\n ${m(\"data\",0,\"u32\")}\n ${m(\"data\",1,\"u32\")}\n ${m(\"data\",2,\"u32\")}\n ${m(\"data\",3,\"u32\")}\n output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:c=`\n ${m(\"output_data[global_idx]\",0)}\n ${m(\"output_data[global_idx]\",1)}\n ${m(\"output_data[global_idx]\",2)}\n ${m(\"output_data[global_idx]\",3)}\n `}return`\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(i,s,l,o)}\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n ${c}\n }`},af=e=>{let t=e[1].dims,r=e[2].dims,a=e[0].dims,n=e[1].dataType,o=!(M.areEqual(t,r)&&M.areEqual(r,a)),s=t,l=M.size(t);if(o){let c=vt.calcShape(vt.calcShape(t,r,!1),a,!1);if(!c)throw new Error(\"Can't perform where op on the given tensors\");s=c,l=M.size(s)}let i=Math.ceil(l/4);return{name:\"Where\",shaderCache:{inputDependencies:[\"rank\",\"rank\",\"rank\"]},getShaderSource:c=>nf(c,e,s,o,n),getRunData:()=>({outputs:[{dims:s,dataType:n}],dispatchGroup:{x:Math.ceil(l/64/4)},programUniforms:[{type:12,data:i},...K(a,t,r,s)]})}},vl=e=>{e.compute(af(e.inputs))}});var _l,xl=F(()=>{\"use strict\";Mo();ga();Wo();Go();Is();Ms();Ws();$a();eu();nu();uu();cu();fu();gu();wu();_u();Su();Iu();xa();Tu();Ru();Bu();Qu();el();gn();al();ol();dl();fl();gl();wl();ir();$n();$l();_l=new Map([[\"Abs\",[Ho]],[\"Acos\",[Lo]],[\"Acosh\",[Fo]],[\"Add\",[Es]],[\"ArgMax\",[Do,ha]],[\"ArgMin\",[Bo,ha]],[\"Asin\",[qo]],[\"Asinh\",[jo]],[\"Atan\",[Ko]],[\"Atanh\",[Yo]],[\"Attention\",[Uo]],[\"AveragePool\",[Hu,Gu]],[\"BatchNormalization\",[No]],[\"BiasAdd\",[Vo]],[\"BiasSplitGelu\",[Cs]],[\"Cast\",[Xo,Zo]],[\"Ceil\",[Jo]],[\"Clip\",[Qo]],[\"Concat\",[Us,Ns]],[\"Conv\",[Ia,Ca]],[\"ConvTranspose\",[Js,Qs]],[\"Cos\",[es]],[\"Cosh\",[ts]],[\"CumSum\",[tu,ru]],[\"Div\",[As]],[\"Einsum\",[ou,su]],[\"Elu\",[rs,wn]],[\"Equal\",[Ts]],[\"Erf\",[ns]],[\"Exp\",[as]],[\"Expand\",[du]],[\"FastGelu\",[pu]],[\"Floor\",[is]],[\"FusedConv\",[Ia,Ca]],[\"Gather\",[hu,mu]],[\"GatherElements\",[bu,yu]],[\"Gelu\",[os]],[\"Gemm\",[$u,vu]],[\"GlobalAveragePool\",[qu,Fu]],[\"GlobalMaxPool\",[Xu,Zu]],[\"Greater\",[Rs]],[\"GreaterOrEqual\",[Bs]],[\"HardSigmoid\",[ms,fs]],[\"InstanceNormalization\",[xu]],[\"LayerNormalization\",[Cu]],[\"LeakyRelu\",[ss,wn]],[\"Less\",[zs]],[\"LessOrEqual\",[Ds]],[\"Log\",[xs]],[\"MatMul\",[qs]],[\"MatMulNBits\",[Eu,Au]],[\"MaxPool\",[Ku,Yu]],[\"Mul\",[Os]],[\"MultiHeadAttention\",[Pu,ku]],[\"Neg\",[ls]],[\"Not\",[us]],[\"Pad\",[zu]],[\"Pow\",[ks]],[\"Range\",[Ju]],[\"Reciprocal\",[ds]],[\"ReduceMin\",[To]],[\"ReduceMean\",[So]],[\"ReduceMax\",[Ao]],[\"ReduceSum\",[ko]],[\"ReduceProd\",[Oo]],[\"ReduceL1\",[Co]],[\"ReduceL2\",[Io]],[\"ReduceLogSum\",[Ro]],[\"ReduceLogSumExp\",[Eo]],[\"ReduceSumSquare\",[Po]],[\"Relu\",[cs]],[\"Resize\",[rl,nl]],[\"Sigmoid\",[ps]],[\"Sin\",[hs]],[\"Sinh\",[gs]],[\"Slice\",[ul,ll]],[\"SkipLayerNormalization\",[il]],[\"Split\",[ml,hl]],[\"Sqrt\",[ys]],[\"Softmax\",[cl,pl]],[\"Sub\",[Ps]],[\"Tan\",[bs]],[\"Tanh\",[vs]],[\"ThresholdedRelu\",[_s,wn]],[\"Tile\",[bl]],[\"Transpose\",[co,po]],[\"Where\",[vl]]])});var kn,Sl=F(()=>{\"use strict\";lt();Dt();be();kn=class{constructor(t){this.backend=t;this.repo=new Map,this.attributesBound=!1}getArtifact(t){return this.repo.get(t)}setArtifact(t,r){this.repo.set(t,r)}run(t,r,a,n,o){st(t.programInfo.name);let s=this.backend.device,l=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let i=[];for(let f of r)i.push({binding:i.length,resource:{buffer:f.buffer}});for(let f of a)i.push({binding:i.length,resource:{buffer:f.buffer}});o&&i.push({binding:i.length,resource:o});let c=s.createBindGroup({layout:t.computePipeline.getBindGroupLayout(0),entries:i,label:t.programInfo.name});if(this.backend.sessionStatus===\"capturing\"){let f={kernelId:this.backend.currentKernelId,computePipeline:t.computePipeline,bindGroup:c,dispatchGroup:n};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(f)}l.setPipeline(t.computePipeline),l.setBindGroup(0,c),l.dispatchWorkgroups(...n),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===\"at-passes\")&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),nt(t.programInfo.name)}dispose(){}build(t,r){st(t.name);let a=this.backend.device,n=[];a.features.has(\"shader-f16\")&&n.push(\"enable f16;\");let o=uo(r),s=t.getShaderSource(o),l=`${n.join(`\n`)}\n${o.additionalImplementations}\n${s}`,i=a.createShaderModule({code:l,label:t.name});De(\"verbose\",()=>`[WebGPU] ${t.name} shader code: ${l}`);let c=a.createComputePipeline({compute:{module:i,entryPoint:\"main\"},layout:\"auto\",label:t.name});return nt(t.name),{programInfo:t,computePipeline:c}}normalizeDispatchGroupSize(t){let r=typeof t==\"number\"?t:t.x,a=typeof t==\"number\"?1:t.y||1,n=typeof t==\"number\"?1:t.z||1,o=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(r<=o&&a<=o&&n<=o)return[r,a,n];let s=r*a*n,l=Math.ceil(Math.sqrt(s));if(l>o){if(l=Math.ceil(Math.cbrt(s)),l>o)throw new Error(\"Total dispatch size exceeds WebGPU maximum.\");return[l,l,l]}else return[l,l,1]}}});var of,sf,Pa,Pn,Cl=F(()=>{\"use strict\";lt();ie();Dt();no();so();xl();Sl();of=(e,t)=>{if(t.length!==e.length)throw new Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let r=[];for(let a=0;a{let a=e.name;return e.shaderCache?.hint&&(a+=\"[\"+e.shaderCache.hint+\"]\"),a+=\":\"+r+`:${of(t,e.shaderCache?.inputDependencies??new Array(t.length).fill(\"dims\"))}`,a},Pa=class{constructor(t){t&&(this.architecture=t.architecture,this.vendor=t.vendor)}isArchitecture(t){return this.architecture===t}isVendor(t){return this.vendor===t}},Pn=class{constructor(){this.currentSessionId=null;this.currentKernelId=null;this.commandEncoder=null;this.computePassEncoder=null;this.maxDispatchNumber=16;this.pendingDispatchNumber=0;this.pendingKernels=[];this.pendingQueries=new Map;this.sessionStatus=\"default\";this.capturedCommandList=new Map;this.capturedPendingKernels=new Map;this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw new Error(\"currentKernelCustomData(): currentKernelId is null. (should not happen)\");let t=this.kernelCustomData.get(this.currentKernelId);return t||(t={},this.kernelCustomData.set(this.currentKernelId,t)),t}async initialize(t,r){this.env=t;let a=[],n={requiredLimits:{maxComputeWorkgroupStorageSize:r.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.limits.maxStorageBufferBindingSize,maxBufferSize:r.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:r.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:r.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:r.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:r.limits.maxComputeWorkgroupSizeZ},requiredFeatures:a};r.features.has(\"chromium-experimental-timestamp-query-inside-passes\")?a.push(\"chromium-experimental-timestamp-query-inside-passes\"):r.features.has(\"timestamp-query\")&&a.push(\"timestamp-query\"),r.features.has(\"shader-f16\")&&a.push(\"shader-f16\"),this.device=await r.requestDevice(n),this.adapterInfo=new Pa(await r.requestAdapterInfo()),this.gpuDataManager=oo(this),this.programManager=new kn(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,to(t.logLevel,!!t.debug),this.device.onuncapturederror=o=>{o.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${o.error.message}`)},Object.defineProperty(this.env.webgpu,\"device\",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,\"adapter\",{value:r,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<\"u\"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let t=this.getCommandEncoder(),r={};this.queryType===\"at-passes\"&&(r.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=t.beginComputePass(r)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;st(),this.endComputePass();let t;this.queryType!==\"none\"&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),t=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(t,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==\"none\"&&t.mapAsync(GPUMapMode.READ).then(()=>{let r=new BigUint64Array(t.getMappedRange()),a=this.pendingQueries.get(t);for(let n=0;n\"u\"&&(this.queryTimeBase=w);let $=Number(w-this.queryTimeBase),I=Number(b-this.queryTimeBase);if(!Number.isSafeInteger($)||!Number.isSafeInteger(I))throw new RangeError(\"incorrect timestamp range\");if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:m.map(S=>({dims:S.dims,dataType:Bt(S.dataType)})),outputsMetadata:h.map(S=>({dims:S.dims,dataType:Bt(S.dataType)})),kernelId:s,kernelType:i,kernelName:c,programName:f,startTime:$,endTime:I});else{let S=\"\";m.forEach((E,A)=>{S+=`input[${A}]: [${E.dims}] | ${Bt(E.dataType)}, `});let v=\"\";h.forEach((E,A)=>{v+=`output[${A}]: [${E.dims}] | ${Bt(E.dataType)}, `}),console.log(`[profiling] kernel \"${s}|${i}|${c}|${f}\" ${S}${v}execution time: ${I-$} ns`)}tn(\"GPU\",`${f}::${w}::${b}`)}t.unmap(),this.pendingQueries.delete(t)}),nt()}run(t,r,a,n,o){st(t.name);let s=[];for(let v=0;vE):a;if(f.length!==l.length)throw new Error(`Output size ${f.length} must be equal to ${l.length}.`);let m=[],h=[];for(let v=0;v=l.length)throw new Error(`Invalid output index: ${f[v]}`);if(f[v]===-3)continue;let E=f[v]===-1,A=f[v]===-2,k=E||A?o(l[v].dataType,l[v].dims):n(f[v],l[v].dataType,l[v].dims);if(m.push(k),k.data===0)continue;let U=this.gpuDataManager.get(k.data);if(!U)throw new Error(`no GPU data for output: ${k.data}`);if(E&&this.temporaryData.push(U),A){let N=this.kernelPersistentData.get(this.currentKernelId);N||(N=[],this.kernelPersistentData.set(this.currentKernelId,N)),N.push(U)}h.push(U)}if(s.length!==r.length||h.length!==m.length){if(h.length===0)return nt(t.name),m;throw new Error(`Program ${t.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let w;if(c){let v=0,E=[];c.forEach(N=>{let H=typeof N.data==\"number\"?[N.data]:N.data;if(H.length===0)return;let z=N.type===10?2:4,L,pe;N.type===10?(pe=H.length>4?16:H.length>2?8:H.length*z,L=H.length>4?16:z*H.length):(pe=H.length<=2?H.length*z:16,L=16),v=Math.ceil(v/pe)*pe,E.push(v);let Ie=N.type===10?8:4;v+=H.length>4?Math.ceil(H.length/Ie)*L:H.length*z});let A=16;v=Math.ceil(v/A)*A;let k=new ArrayBuffer(v);c.forEach((N,H)=>{let z=E[H],L=typeof N.data==\"number\"?[N.data]:N.data;if(N.type===6)new Int32Array(k,z,L.length).set(L);else if(N.type===12)new Uint32Array(k,z,L.length).set(L);else if(N.type===10)new Uint16Array(k,z,L.length).set(L);else if(N.type===1)new Float32Array(k,z,L.length).set(L);else throw new Error(`Unsupported uniform type: ${Bt(N.type)}`)});let U=this.gpuDataManager.create(v,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(U.buffer,0,k,0,v),this.gpuDataManager.release(U.id),w={offset:0,size:v,buffer:U.buffer}}let b=this.programManager.normalizeDispatchGroupSize(i),$=b[1]===1&&b[2]===1,I=sf(t,r,$),S=this.programManager.getArtifact(I);if(S||(S=this.programManager.build(t,b),this.programManager.setArtifact(I,S),De(\"info\",()=>`[artifact] key: ${I}, programName: ${t.name}`)),De(\"info\",()=>`[ProgramManager] run \"${t.name}\" (key=${I}) with ${b[0]}x${b[1]}x${b[2]}`),this.queryType!==\"none\"||this.sessionStatus===\"capturing\"){let v={kernelId:this.currentKernelId,programName:S.programInfo.name,inputTensorViews:r,outputTensorViews:m};this.pendingKernels.push(v),this.sessionStatus===\"capturing\"&&this.capturedPendingKernels.get(this.currentSessionId).push(v)}return this.programManager.run(S,s,h,b,w),nt(t.name),m}upload(t,r){this.gpuDataManager.upload(t,r)}memcpy(t,r){this.gpuDataManager.memcpy(t,r)}async download(t,r){await this.gpuDataManager.download(t,r)}alloc(t){return this.gpuDataManager.create(t).id}free(t){return this.gpuDataManager.release(t)}createKernel(t,r,a,n){let o=_l.get(t);if(!o)throw new Error(`kernel not implemented: ${t}`);let s={kernelType:t,kernelName:n,kernelEntry:o[0],attributes:[o[1],a]};this.kernels.set(r,s)}releaseKernel(t){let r=this.kernelPersistentData.get(t);if(r){for(let a of r)this.gpuDataManager.release(a.id);this.kernelPersistentData.delete(t)}this.kernelCustomData.delete(t),this.kernels.delete(t)}computeKernel(t,r,a){let n=this.kernels.get(t);if(!n)throw new Error(`kernel not created: ${t}`);let o=n.kernelType,s=n.kernelName,l=n.kernelEntry,i=n.attributes;if(this.currentKernelId!==null)throw new Error(`kernel \"[${o}] ${s}\" is not allowed to be called recursively`);this.currentKernelId=t,i[0]&&(i[1]=i[0](i[1]),i[0]=void 0),De(\"info\",()=>`[WebGPU] Start to run kernel \"[${o}] ${s}\"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(\"validation\"),l(r,i[1]),0}catch(f){return a.push(Promise.resolve(`[WebGPU] Kernel \"[${o}] ${s}\" failed. ${f}`)),1}finally{c&&a.push(this.device.popErrorScope().then(f=>f?`GPU validation error for kernel \"[${o}] ${s}\": ${f.message}`:null));for(let f of this.temporaryData)this.gpuDataManager.release(f.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(t,r,a,n){let o=this.sessionExternalDataMapping.get(t);o||(o=new Map,this.sessionExternalDataMapping.set(t,o));let s=o.get(r),l=this.gpuDataManager.registerExternalBuffer(a,n,s?.[1]);return o.set(r,[l,a]),l}unregisterBuffers(t){let r=this.sessionExternalDataMapping.get(t);r&&(r.forEach(a=>this.gpuDataManager.unregisterExternalBuffer(a[1])),this.sessionExternalDataMapping.delete(t))}getBuffer(t){let r=this.gpuDataManager.get(t);if(!r)throw new Error(`no GPU data for buffer: ${t}`);return r.buffer}createDownloader(t,r,a){return async()=>{let n=await ua(this,t,r);return ro(n.buffer,a)}}writeTimestamp(t){this.queryType===\"inside-passes\"&&this.computePassEncoder.writeTimestamp(this.querySet,t)}setQueryType(){this.queryType=\"none\",(this.env.webgpu.profiling?.mode===\"default\"||(typeof this.env.trace>\"u\"?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(\"chromium-experimental-timestamp-query-inside-passes\")?this.queryType=\"inside-passes\":this.device.features.has(\"timestamp-query\")&&(this.queryType=\"at-passes\"),this.queryType!==\"none\"&&typeof this.querySet>\"u\"&&(this.querySet=this.device.createQuerySet({type:\"timestamp\",count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){De(\"info\",\"captureBegin\"),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=\"capturing\"}captureEnd(){De(\"info\",\"captureEnd\"),this.flush(),this.sessionStatus=\"default\"}replay(){De(\"info\",\"replay\"),this.sessionStatus=\"replaying\";let t=this.capturedCommandList.get(this.currentSessionId),r=this.capturedPendingKernels.get(this.currentSessionId),a=t.length;this.pendingKernels=[];for(let n=0;n=this.maxDispatchNumber||this.queryType===\"at-passes\")&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=\"default\"}onReleaseSession(t){this.unregisterBuffers(t),this.capturedCommandList.has(t)&&this.capturedCommandList.delete(t),this.capturedPendingKernels.has(t)&&this.capturedPendingKernels.delete(t),this.gpuDataManager.onReleaseSession(t)}onRunStart(t){this.currentSessionId=t,this.setQueryType()}}});var Il={};rr(Il,{init:()=>uf});var Pr,Ra,uf,El=F(()=>{\"use strict\";ie();Cl();Dt();_e();Pr=class e{constructor(t,r,a,n){this.module=t;this.dataType=r;this.data=a;this.dims=n}getFloat32Array(){if(this.dataType!==1)throw new Error(\"Invalid data type\");let t=M.size(this.dims);return t===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,t)}getBigInt64Array(){if(this.dataType!==7)throw new Error(\"Invalid data type\");let t=M.size(this.dims);return t===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,t)}getInt32Array(){if(this.dataType!==6)throw new Error(\"Invalid data type\");let t=M.size(this.dims);return t===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,t)}reshape(t){if(M.size(t)!==M.size(this.dims))throw new Error(\"Invalid new shape\");return new e(this.module,this.dataType,this.data,t)}},Ra=class{constructor(t,r,a){this.module=t;this.backend=r;this.customDataOffset=0;this.customDataSize=0;this.adapterInfo=r.adapterInfo;let n=t.HEAPU32,o=a>>>2;this.opKernelContext=n[o++];let s=n[o++];this.outputCount=n[o++],this.customDataOffset=n[o++],this.customDataSize=n[o++];let l=[];for(let i=0;itypeof l==\"number\"?this.inputs[l]:l)??this.inputs,n=r?.outputs??[],o=(l,i,c)=>new Pr(this.module,i,this.output(l,c),c),s=(l,i)=>{let c=Ir(l);if(!c)throw new Error(`Unsupported data type: ${l}`);let f=c*M.size(i),m=f>0?this.backend.gpuDataManager.create(f).id:0;return new Pr(this.module,l,m,i)};return this.backend.run(t,a,n,o,s)}output(t,r){let a=this.module.stackSave();try{let n=this.module.stackAlloc((1+r.length)*4),o=n>>2;this.module.HEAPU32[o++]=r.length;for(let s=0;s{let n=t.jsepInit;if(!n)throw new Error(\"Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.\");if(e===\"webgpu\"){let o=new Pn;await o.initialize(r,a),n(\"webgpu\",[o,s=>o.alloc(s),s=>o.free(s),(s,l,i,c=!1)=>{if(c)De(\"verbose\",()=>`[WebGPU] jsepCopyGpuToGpu: src=${s}, dst=${l}, size=${i}`),o.memcpy(s,l);else{De(\"verbose\",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${s}, gpuDataId=${l}, size=${i}`);let f=t.HEAPU8.subarray(s>>>0,(s>>>0)+i);o.upload(l,f)}},async(s,l,i)=>{De(\"verbose\",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${s}, dataOffset=${l}, size=${i}`),await o.download(s,()=>t.HEAPU8.subarray(l>>>0,(l>>>0)+i))},(s,l,i)=>o.createKernel(s,l,i,t.UTF8ToString(t._JsepGetNodeName(l))),s=>o.releaseKernel(s),(s,l,i,c)=>{De(\"verbose\",()=>`[WebGPU] jsepRun: sessionHandle=${i}, kernel=${s}, contextDataOffset=${l}`);let f=new Ra(t,o,l);return o.computeKernel(s,f,c)},()=>o.captureBegin(),()=>o.captureEnd(),()=>o.replay()])}else n(\"webnn\")}});var lf,Tl,Ol,jt,df,za,kl,Pl,Al,Rl,zl,Bl,Dl=F(()=>{\"use strict\";Zi();Qi();ie();nr();on();oa();lf=(e,t)=>{Ge()._OrtInit(e,t)!==0&&Be(\"Can't initialize onnxruntime.\")},Tl=async e=>{lf(e.wasm.numThreads,Er(e.logLevel))},Ol=async(e,t)=>{{let r=(El(),Gt(Il)).init;if(t===\"webgpu\"){if(typeof navigator>\"u\"||!navigator.gpu)throw new Error(\"WebGPU is not supported in current environment\");let a=e.webgpu.adapter;if(a){if(typeof a.limits!=\"object\"||typeof a.features!=\"object\"||typeof a.requestDevice!=\"function\")throw new Error(\"Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.\")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==\"low-power\"&&n!==\"high-performance\")throw new Error(`Invalid powerPreference setting: \"${n}\"`);let o=e.webgpu.forceFallbackAdapter;if(o!==void 0&&typeof o!=\"boolean\")throw new Error(`Invalid forceFallbackAdapter setting: \"${o}\"`);if(a=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:o}),!a)throw new Error('Failed to get GPU adapter. You may need to enable flag \"--enable-unsafe-webgpu\" if you are using Chrome.')}if(!e.wasm.simd)throw new Error(\"Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using `webgpu` EP\");await r(\"webgpu\",Ge(),e,a)}if(t===\"webnn\"){if(typeof navigator>\"u\"||!navigator.ml)throw new Error(\"WebNN is not supported in current environment\");await r(\"webnn\",Ge(),e)}}},jt=new Map,df=e=>{let t=Ge(),r=t.stackSave();try{let a=t.stackAlloc(8);return t._OrtGetInputOutputCount(e,a,a+4)!==0&&Be(\"Can't get session input/output count.\"),[t.HEAP32[a/4],t.HEAP32[a/4+1]]}finally{t.stackRestore(r)}},za=e=>{let t=Ge(),r=t._malloc(e.byteLength);if(r===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,r),[r,e.byteLength]},kl=async(e,t)=>{let r,a,n=Ge();Array.isArray(e)?[r,a]=e:e.buffer===n.HEAPU8.buffer?[r,a]=[e.byteOffset,e.byteLength]:[r,a]=za(e);let o=0,s=0,l=0,i=[],c=[],f=[];try{if([s,i]=Xi(t),t?.externalData&&n.mountExternalData){let v=[];for(let E of t.externalData){let A=typeof E==\"string\"?E:E.path;v.push(Ar(typeof E==\"string\"?E:E.data).then(k=>{n.mountExternalData(A,k)}))}await Promise.all(v)}o=await n._OrtCreateSession(r,a,s),o===0&&Be(\"Can't create a session.\");let[m,h]=df(o),w=!!t?.enableGraphCapture,b=[],$=[],I=[];for(let v=0;vv===\"gpu-buffer\")&&(l=n._OrtCreateBinding(o),l===0&&Be(\"Can't create IO binding.\"),S={handle:l,outputPreferredLocations:I,outputPreferredLocationsEncoded:I.map(v=>ia(v))}),jt.set(o,[o,c,f,S,w,!1]),[o,b,$]}catch(m){throw c.forEach(h=>n._OrtFree(h)),f.forEach(h=>n._OrtFree(h)),l!==0&&n._OrtReleaseBinding(l),o!==0&&n._OrtReleaseSession(o),m}finally{n._free(r),s!==0&&n._OrtReleaseSessionOptions(s),i.forEach(m=>n._free(m)),n.unmountExternalData?.()}},Pl=e=>{let t=Ge(),r=jt.get(e);if(!r)throw new Error(`cannot release session. invalid session id: ${e}`);let[a,n,o,s,l]=r;s&&(l&&t._OrtClearBoundOutputs(s.handle),t._OrtReleaseBinding(s.handle)),t.jsepOnReleaseSession?.(e),n.forEach(i=>t._OrtFree(i)),o.forEach(i=>t._OrtFree(i)),t._OrtReleaseSession(a),jt.delete(e)},Al=(e,t,r,a,n,o=!1)=>{if(!e){t.push(0);return}let s=Ge(),l=e[0],i=e[1],c=e[3],f,m;if(l===\"string\"&&c===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");if(o&&c!==\"gpu-buffer\")throw new Error(`External buffer must be provided for input/output index ${n} when enableGraphCapture is true.`);if(c===\"gpu-buffer\"){let b=e[2].gpuBuffer,$=Ir(aa(l));m=i.reduce((S,v)=>S*v,1)*$;let I=s.jsepRegisterBuffer;if(!I)throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');f=I(a,n,b,m)}else{let b=e[2];if(Array.isArray(b)){m=4*b.length,f=s._malloc(m),r.push(f);let $=f/4;for(let I=0;Is.HEAP32[b++]=I);let $=s._OrtCreateTensor(aa(l),f,m,w,i.length,ia(c));$===0&&Be(`Can't create tensor for input/output. session=${a}, index=${n}.`),t.push($)}finally{s.stackRestore(h)}},Rl=async(e,t,r,a,n,o)=>{let s=Ge(),l=jt.get(e);if(!l)throw new Error(`cannot run inference. invalid session id: ${e}`);let i=l[0],c=l[1],f=l[2],m=l[3],h=l[4],w=l[5],b=t.length,$=a.length,I=0,S=[],v=[],E=[],A=[],k=s.stackSave(),U=s.stackAlloc(b*4),N=s.stackAlloc(b*4),H=s.stackAlloc($*4),z=s.stackAlloc($*4);try{[I,S]=Yi(o);for(let X=0;XVe*qe,1);he=Bt(J);let It=m?.outputPreferredLocations[a[X]];if(he===\"string\"){if(It===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");let Ve=[],qe=Ee/4;for(let tt=0;tt0){let Ve=s.jsepGetBuffer;if(!Ve)throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');let qe=Ve(Ee),tt=Ir(J);if(tt===void 0||!un(he))throw new Error(`Unsupported data type: ${he}`);se=!0,Ue.push([he,et,{gpuBuffer:qe,download:s.jsepCreateDownloader(qe,Fe*tt,he),dispose:()=>{s._OrtReleaseTensor(xe)}},\"gpu-buffer\"])}else{let Ve=sn(he),qe=new Ve(Fe);new Uint8Array(qe.buffer,qe.byteOffset,qe.byteLength).set(s.HEAPU8.subarray(Ee,Ee+qe.byteLength)),Ue.push([he,et,qe,\"cpu\"])}}finally{s.stackRestore(fe),he===\"string\"&&Ee&&s._free(Ee),se||s._OrtReleaseTensor(xe)}}return m&&!h&&(s._OrtClearBoundOutputs(m.handle),jt.set(e,[i,c,f,m,h,!1])),Ue}finally{s.stackRestore(k),v.forEach(L=>s._OrtReleaseTensor(L)),E.forEach(L=>s._OrtReleaseTensor(L)),A.forEach(L=>s._free(L)),I!==0&&s._OrtReleaseRunOptions(I),S.forEach(L=>s._free(L))}},zl=e=>{let t=Ge(),r=jt.get(e);if(!r)throw new Error(\"invalid session id\");let a=r[0],n=t._OrtEndProfiling(a);n===0&&Be(\"Can't get an profile file name.\"),t._OrtFree(n)},Bl=e=>{let t=[];for(let r of e){let a=r[2];!Array.isArray(a)&&\"buffer\"in a&&t.push(a.buffer)}return t}});var Ml=tr((Iv,pf)=>{pf.exports='/*!\\n * ONNX Runtime Web v1.17.3\\n * Copyright (c) Microsoft Corporation. All rights reserved.\\n * Licensed under the MIT License.\\n */\\n\"use strict\";(()=>{var vn=Object.defineProperty;var dd=Object.getOwnPropertyDescriptor;var ld=Object.getOwnPropertyNames;var cd=Object.prototype.hasOwnProperty;var q=(e,t)=>()=>(e&&(t=e(e=0)),t);var pr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mr=(e,t)=>{for(var r in t)vn(e,r,{get:t[r],enumerable:!0})},pd=(e,t,r,o)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of ld(t))!cd.call(e,n)&&n!==r&&vn(e,n,{get:()=>t[n],enumerable:!(o=dd(t,n))||o.enumerable});return e};var Ft=e=>pd(vn({},\"__esModule\",{value:!0}),e);var $n={};Mr($n,{createReadStream:()=>Po,readFile:()=>md,readFileSync:()=>fd});var md,fd,Po,_n=q(()=>{md=void 0,fd=void 0,Po=void 0});var xn={};Mr(xn,{join:()=>hd});var hd,Sn=q(()=>{hd=void 0});var Ro=pr((ko,Cn)=>{\"use strict\";var Oo=(()=>{var e=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(e=e||__filename),function(t={}){var r=t,o,n;r.ready=new Promise((d,h)=>{o=d,n=h}),r.mountExternalData=(d,h)=>{(r.Fa||(r.Fa=new Map)).set(d,h)},r.unmountExternalData=()=>{delete r.Fa};let s=()=>{let d=(w,S,P)=>(...N)=>{let K=nt,X=S?.();N=w(...N);let ae=S?.();return X!==ae&&(w=ae,P(X),S=P=null),nt!=K?Cr():N},h=w=>async(...S)=>{try{if(r.Ea)throw Error(\"Session already started\");let P=r.Ea={Za:S[0],errors:[]},N=await w(...S);if(r.Ea!==P)throw Error(\"Session mismatch\");r.La?.flush();let K=P.errors;if(0ae),0r._OrtCreateSession,w=>r._OrtCreateSession=w),r._OrtRun=h(d(r._OrtRun,()=>r._OrtRun,w=>r._OrtRun=w)),r._OrtRunWithBinding=h(d(r._OrtRunWithBinding,()=>r._OrtRunWithBinding,w=>r._OrtRunWithBinding=w)),r._OrtBindInput=d(r._OrtBindInput,()=>r._OrtBindInput,w=>r._OrtBindInput=w),s=void 0};r.jsepInit=(d,h)=>{if(s?.(),d===\"webgpu\"){[r.La,r.Ra,r.Va,r.Ma,r.Ua,r.sa,r.Wa,r.Ya,r.Sa,r.Ta,r.Xa]=h;let w=r.La;r.jsepRegisterBuffer=(S,P,N,K)=>w.registerBuffer(S,P,N,K),r.jsepGetBuffer=S=>w.getBuffer(S),r.jsepCreateDownloader=(S,P,N)=>w.createDownloader(S,P,N),r.jsepOnReleaseSession=S=>{w.onReleaseSession(S)},r.jsepOnRunStart=S=>w.onRunStart(S)}};var u=Object.assign({},r),l=\"./this.program\",a=(d,h)=>{throw h},p=typeof window==\"object\",m=typeof importScripts==\"function\",f=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",b=\"\",_,y,$;if(f){var I=(_n(),Ft($n)),C=(Sn(),Ft(xn));b=m?C.dirname(b)+\"/\":__dirname+\"/\",_=(d,h)=>(d=Ae(d)?new URL(d):C.normalize(d),I.readFileSync(d,h?void 0:\"utf8\")),$=d=>(d=_(d,!0),d.buffer||(d=new Uint8Array(d)),d),y=(d,h,w,S=!0)=>{d=Ae(d)?new URL(d):C.normalize(d),I.readFile(d,S?void 0:\"utf8\",(P,N)=>{P?w(P):h(S?N.buffer:N)})},!r.thisProgram&&1{throw process.exitCode=d,h},r.inspect=()=>\"[Emscripten Module object]\"}else(p||m)&&(m?b=self.location.href:typeof document<\"u\"&&document.currentScript&&(b=document.currentScript.src),e&&(b=e),b.indexOf(\"blob:\")!==0?b=b.substr(0,b.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):b=\"\",_=d=>{var h=new XMLHttpRequest;return h.open(\"GET\",d,!1),h.send(null),h.responseText},m&&($=d=>{var h=new XMLHttpRequest;return h.open(\"GET\",d,!1),h.responseType=\"arraybuffer\",h.send(null),new Uint8Array(h.response)}),y=(d,h,w)=>{var S=new XMLHttpRequest;S.open(\"GET\",d,!0),S.responseType=\"arraybuffer\",S.onload=()=>{S.status==200||S.status==0&&S.response?h(S.response):w()},S.onerror=w,S.send(null)});var v=console.log.bind(console),A=console.error.bind(console);Object.assign(r,u),u=null,typeof WebAssembly!=\"object\"&&se(\"no native wasm support detected\");var T,D=!1,U,V,H,R,L,pe,Ie;function we(){var d=T.buffer;r.HEAP8=V=new Int8Array(d),r.HEAP16=new Int16Array(d),r.HEAPU8=H=new Uint8Array(d),r.HEAPU16=new Uint16Array(d),r.HEAP32=R=new Int32Array(d),r.HEAPU32=L=new Uint32Array(d),r.HEAPF32=pe=new Float32Array(d),r.HEAPF64=Ie=new Float64Array(d)}var ne=[],ze=[],Q=[],xe=0,me=null,ue=null;function se(d){throw d=\"Aborted(\"+d+\")\",A(d),D=!0,U=1,d=new WebAssembly.RuntimeError(d+\". Build with -sASSERTIONS for more info.\"),n(d),d}var he=d=>d.startsWith(\"data:application/octet-stream;base64,\"),Ae=d=>d.startsWith(\"file://\"),He;if(He=\"ort-wasm-simd.wasm\",!he(He)){var G=He;He=r.locateFile?r.locateFile(G,b):b+G}function J(d){if($)return $(d);throw\"both async and sync fetching of the wasm failed\"}function Se(d){if(p||m){if(typeof fetch==\"function\"&&!Ae(d))return fetch(d,{credentials:\"same-origin\"}).then(h=>{if(!h.ok)throw\"failed to load wasm binary file at \\'\"+d+\"\\'\";return h.arrayBuffer()}).catch(()=>J(d));if(y)return new Promise((h,w)=>{y(d,S=>h(new Uint8Array(S)),w)})}return Promise.resolve().then(()=>J(d))}function Qe(d,h,w){return Se(d).then(S=>WebAssembly.instantiate(S,h)).then(S=>S).then(w,S=>{A(`failed to asynchronously prepare wasm: ${S}`),se(S)})}function Xe(d,h){var w=He;return typeof WebAssembly.instantiateStreaming!=\"function\"||he(w)||Ae(w)||f||typeof fetch!=\"function\"?Qe(w,d,h):fetch(w,{credentials:\"same-origin\"}).then(S=>WebAssembly.instantiateStreaming(S,d).then(h,function(P){return A(`wasm streaming compile failed: ${P}`),A(\"falling back to ArrayBuffer instantiation\"),Qe(w,d,h)}))}var Le,wt={931760:(d,h,w,S)=>{if(typeof r>\"u\"||!r.Fa)return 1;if(d=qe(d>>>0),d.startsWith(\"./\")&&(d=d.substring(2)),d=r.Fa.get(d),!d)return 2;if(h>>>=0,w>>>=0,h+w>d.byteLength)return 3;try{return H.set(d.subarray(h,h+w),S>>>0>>>0),0}catch{return 4}},932261:()=>{r.Sa()},932292:()=>{r.Ta()},932321:()=>{r.Xa()},932346:d=>r.Ra(d),932379:d=>r.Va(d),932411:(d,h,w)=>{r.Ma(d,h,w,!0)},932450:(d,h,w)=>{r.Ma(d,h,w)},932483:d=>{r.sa(\"Abs\",d,void 0)},932534:d=>{r.sa(\"Neg\",d,void 0)},932585:d=>{r.sa(\"Floor\",d,void 0)},932638:d=>{r.sa(\"Ceil\",d,void 0)},932690:d=>{r.sa(\"Reciprocal\",d,void 0)},932748:d=>{r.sa(\"Sqrt\",d,void 0)},932800:d=>{r.sa(\"Exp\",d,void 0)},932851:d=>{r.sa(\"Erf\",d,void 0)},932902:d=>{r.sa(\"Sigmoid\",d,void 0)},932957:(d,h,w)=>{r.sa(\"HardSigmoid\",d,{alpha:h,beta:w})},933036:d=>{r.sa(\"Log\",d,void 0)},933087:d=>{r.sa(\"Sin\",d,void 0)},933138:d=>{r.sa(\"Cos\",d,void 0)},933189:d=>{r.sa(\"Tan\",d,void 0)},933240:d=>{r.sa(\"Asin\",d,void 0)},933292:d=>{r.sa(\"Acos\",d,void 0)},933344:d=>{r.sa(\"Atan\",d,void 0)},933396:d=>{r.sa(\"Sinh\",d,void 0)},933448:d=>{r.sa(\"Cosh\",d,void 0)},933500:d=>{r.sa(\"Asinh\",d,void 0)},933553:d=>{r.sa(\"Acosh\",d,void 0)},933606:d=>{r.sa(\"Atanh\",d,void 0)},933659:d=>{r.sa(\"Tanh\",d,void 0)},933711:d=>{r.sa(\"Not\",d,void 0)},933762:(d,h,w)=>{r.sa(\"Clip\",d,{min:h,max:w})},933831:d=>{r.sa(\"Clip\",d,void 0)},933883:(d,h)=>{r.sa(\"Elu\",d,{alpha:h})},933941:d=>{r.sa(\"Relu\",d,void 0)},933993:(d,h)=>{r.sa(\"LeakyRelu\",d,{alpha:h})},934057:(d,h)=>{r.sa(\"ThresholdedRelu\",d,{alpha:h})},934127:(d,h)=>{r.sa(\"Cast\",d,{to:h})},934185:d=>{r.sa(\"Add\",d,void 0)},934236:d=>{r.sa(\"Sub\",d,void 0)},934287:d=>{r.sa(\"Mul\",d,void 0)},934338:d=>{r.sa(\"Div\",d,void 0)},934389:d=>{r.sa(\"Pow\",d,void 0)},934440:d=>{r.sa(\"Equal\",d,void 0)},934493:d=>{r.sa(\"Greater\",d,void 0)},934548:d=>{r.sa(\"GreaterOrEqual\",d,void 0)},934610:d=>{r.sa(\"Less\",d,void 0)},934662:d=>{r.sa(\"LessOrEqual\",d,void 0)},934721:(d,h,w,S,P)=>{r.sa(\"ReduceMean\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},934880:(d,h,w,S,P)=>{r.sa(\"ReduceMax\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935038:(d,h,w,S,P)=>{r.sa(\"ReduceMin\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935196:(d,h,w,S,P)=>{r.sa(\"ReduceProd\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935355:(d,h,w,S,P)=>{r.sa(\"ReduceSum\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935513:(d,h,w,S,P)=>{r.sa(\"ReduceL1\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935670:(d,h,w,S,P)=>{r.sa(\"ReduceL2\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935827:(d,h,w,S,P)=>{r.sa(\"ReduceLogSum\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},935988:(d,h,w,S,P)=>{r.sa(\"ReduceSumSquare\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},936152:(d,h,w,S,P)=>{r.sa(\"ReduceLogSumExp\",d,{keepDims:!!h,noopWithEmptyAxes:!!w,axes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},936316:d=>{r.sa(\"Where\",d,void 0)},936369:(d,h,w)=>{r.sa(\"Transpose\",d,{perm:h?Array.from(R.subarray(h>>>0,w>>>0)):[]})},936477:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe)=>{r.sa(\"ConvTranspose\",d,{format:ae?\"NHWC\":\"NCHW\",autoPad:h,dilations:[w],group:S,kernel_shape:[P],pads:[N,K],strides:[X],wIsConst:()=>!!V[de>>>0],outputPadding:fe?Array.from(R.subarray(fe>>>0,Oe>>>0)):[],outputShape:Re?Array.from(R.subarray(Re>>>0,O>>>0)):[],activation:qe(oe)})},936879:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O)=>{r.sa(\"ConvTranspose\",d,{format:X?\"NHWC\":\"NCHW\",autoPad:h,dilations:Array.from(R.subarray(w>>>0,(w>>>0)+2>>>0)),group:S,kernelShape:Array.from(R.subarray(P>>>0,(P>>>0)+2>>>0)),pads:Array.from(R.subarray(N>>>0,(N>>>0)+4>>>0)),strides:Array.from(R.subarray(K>>>0,(K>>>0)+2>>>0)),wIsConst:()=>!!V[ae>>>0],outputPadding:de?Array.from(R.subarray(de>>>0,fe>>>0)):[],outputShape:Oe?Array.from(R.subarray(Oe>>>0,Re>>>0)):[],activation:qe(O)})},937444:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe)=>{r.sa(\"ConvTranspose\",d,{format:ae?\"NHWC\":\"NCHW\",autoPad:h,dilations:[w],group:S,kernel_shape:[P],pads:[N,K],strides:[X],wIsConst:()=>!!V[de>>>0],outputPadding:fe?Array.from(R.subarray(fe>>>0,Oe>>>0)):[],outputShape:Re?Array.from(R.subarray(Re>>>0,O>>>0)):[],activation:qe(oe)})},937846:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O)=>{r.sa(\"ConvTranspose\",d,{format:X?\"NHWC\":\"NCHW\",autoPad:h,dilations:Array.from(R.subarray(w>>>0,(w>>>0)+2>>>0)),group:S,kernelShape:Array.from(R.subarray(P>>>0,(P>>>0)+2>>>0)),pads:Array.from(R.subarray(N>>>0,(N>>>0)+4>>>0)),strides:Array.from(R.subarray(K>>>0,(K>>>0)+2>>>0)),wIsConst:()=>!!V[ae>>>0],outputPadding:de?Array.from(R.subarray(de>>>0,fe>>>0)):[],outputShape:Oe?Array.from(R.subarray(Oe>>>0,Re>>>0)):[],activation:qe(O)})},938411:(d,h)=>{r.sa(\"GlobalAveragePool\",d,{format:h?\"NHWC\":\"NCHW\"})},938502:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe,Ce)=>{r.sa(\"AveragePool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:h,ceil_mode:w,count_include_pad:S,storage_order:P,dilations:[N,K],kernel_shape:[X,ae],pads:[de,fe,Oe,Re],strides:[O,oe]})},938786:(d,h)=>{r.sa(\"GlobalAveragePool\",d,{format:h?\"NHWC\":\"NCHW\"})},938877:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe,Ce)=>{r.sa(\"AveragePool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:h,ceil_mode:w,count_include_pad:S,storage_order:P,dilations:[N,K],kernel_shape:[X,ae],pads:[de,fe,Oe,Re],strides:[O,oe]})},939161:(d,h)=>{r.sa(\"GlobalMaxPool\",d,{format:h?\"NHWC\":\"NCHW\"})},939248:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe,Ce)=>{r.sa(\"MaxPool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:h,ceil_mode:w,count_include_pad:S,storage_order:P,dilations:[N,K],kernel_shape:[X,ae],pads:[de,fe,Oe,Re],strides:[O,oe]})},939528:(d,h)=>{r.sa(\"GlobalMaxPool\",d,{format:h?\"NHWC\":\"NCHW\"})},939615:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe,Ce)=>{r.sa(\"MaxPool\",d,{format:Ce?\"NHWC\":\"NCHW\",auto_pad:h,ceil_mode:w,count_include_pad:S,storage_order:P,dilations:[N,K],kernel_shape:[X,ae],pads:[de,fe,Oe,Re],strides:[O,oe]})},939895:(d,h,w,S,P)=>{r.sa(\"Gemm\",d,{alpha:h,beta:w,transA:S,transB:P})},939999:d=>{r.sa(\"MatMul\",d,void 0)},940053:(d,h,w,S)=>{r.sa(\"ArgMax\",d,{keepDims:!!h,selectLastIndex:!!w,axis:S})},940161:(d,h,w,S)=>{r.sa(\"ArgMin\",d,{keepDims:!!h,selectLastIndex:!!w,axis:S})},940269:(d,h)=>{r.sa(\"Softmax\",d,{axis:h})},940332:(d,h)=>{r.sa(\"Concat\",d,{axis:h})},940392:(d,h,w,S,P)=>{r.sa(\"Split\",d,{axis:h,numOutputs:w,splitSizes:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},940532:d=>{r.sa(\"Expand\",d,void 0)},940586:(d,h)=>{r.sa(\"Gather\",d,{axis:Number(h)})},940657:(d,h)=>{r.sa(\"GatherElements\",d,{axis:Number(h)})},940736:(d,h,w,S,P,N,K,X,ae,de,fe)=>{r.sa(\"Resize\",d,{antialias:h,axes:w?Array.from(R.subarray(w>>>0,S>>>0)):[],coordinateTransformMode:qe(P),cubicCoeffA:N,excludeOutside:K,extrapolationValue:X,keepAspectRatioPolicy:qe(ae),mode:qe(de),nearestMode:qe(fe)})},941082:(d,h,w,S,P,N,K)=>{r.sa(\"Slice\",d,{starts:h?Array.from(R.subarray(h>>>0,w>>>0)):[],ends:S?Array.from(R.subarray(S>>>0,P>>>0)):[],axes:N?Array.from(R.subarray(N>>>0,K>>>0)):[]})},941298:d=>{r.sa(\"Tile\",d,void 0)},941350:(d,h,w)=>{r.sa(\"LayerNormalization\",d,{axis:Number(h),epsilon:Number(w)})},941457:(d,h,w)=>{r.sa(\"InstanceNormalization\",d,{epsilon:h,format:w?\"NHWC\":\"NCHW\"})},941571:(d,h,w)=>{r.sa(\"InstanceNormalization\",d,{epsilon:h,format:w?\"NHWC\":\"NCHW\"})},941685:d=>{r.sa(\"Range\",d,void 0)},941738:(d,h)=>{r.sa(\"Einsum\",d,{equation:qe(h)})},941819:(d,h,w,S,P)=>{r.sa(\"Pad\",d,{mode:h,value:w,pads:S?Array.from(R.subarray(S>>>0,P>>>0)):[]})},941946:(d,h,w,S,P,N)=>{r.sa(\"BatchNormalization\",d,{epsilon:h,momentum:w,spatial:!!P,trainingMode:!!S,format:N?\"NHWC\":\"NCHW\"})},942115:(d,h,w,S,P,N)=>{r.sa(\"BatchNormalization\",d,{epsilon:h,momentum:w,spatial:!!P,trainingMode:!!S,format:N?\"NHWC\":\"NCHW\"})},942284:(d,h,w)=>{r.sa(\"CumSum\",d,{exclusive:Number(h),reverse:Number(w)})},942381:(d,h,w,S,P,N,K,X,ae)=>{r.sa(\"Attention\",d,{numHeads:h,isUnidirectional:w,maskFilterValue:S,scale:P,doRotary:N,qkvHiddenSizes:K?Array.from(R.subarray(Number(X)>>>0,Number(X)+K>>>0)):[],pastPresentShareBuffer:!!ae})},942653:d=>{r.sa(\"BiasAdd\",d,void 0)},942708:d=>{r.sa(\"BiasSplitGelu\",d,void 0)},942769:d=>{r.sa(\"FastGelu\",d,void 0)},942825:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re)=>{r.sa(\"Conv\",d,{format:ae?\"NHWC\":\"NCHW\",auto_pad:h,dilations:[w],group:S,kernel_shape:[P],pads:N?Array.from(R.subarray(N>>>0,K>>>0)):[],strides:[X],w_is_const:()=>!!V[de>>>0],activation:qe(fe),activation_params:Oe?Array.from(pe.subarray(Oe>>>0,Re>>>0)):[]})},943195:(d,h,w,S,P,N,K,X,ae,de,fe,Oe,Re,O,oe,Ce)=>{r.sa(\"Conv\",d,{format:Oe?\"NHWC\":\"NCHW\",auto_pad:h,dilations:[w,S],group:P,kernel_shape:[N,K],pads:X?Array.from(R.subarray(X>>>0,ae>>>0)):[],strides:[de,fe],w_is_const:()=>!!V[Re>>>0],activation:qe(O),activation_params:oe?Array.from(pe.subarray(oe>>>0,Ce>>>0)):[]})},943586:d=>{r.sa(\"Gelu\",d,void 0)},943638:(d,h,w,S,P,N)=>{r.sa(\"MatMulNBits\",d,{k:h,n:w,accuracyLevel:S,bits:P,blockSize:N})},943765:(d,h,w,S,P,N)=>{r.sa(\"MultiHeadAttention\",d,{numHeads:h,isUnidirectional:w,maskFilterValue:S,scale:P,doRotary:N})},943924:(d,h)=>{r.sa(\"SkipLayerNormalization\",d,{epsilon:h})},944005:d=>{r.Wa(d)},944039:(d,h)=>r.Ya(d,h,r.Ea.Za,r.Ea.errors)};function Ne(d){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${d})`,this.status=d}function Fe(d){this.Ja=d-24,this.Pa=function(h){L[this.Ja+4>>>2>>>0]=h},this.Oa=function(h){L[this.Ja+8>>>2>>>0]=h},this.eb=function(h,w){this.Na(),this.Pa(h),this.Oa(w)},this.Na=function(){L[this.Ja+16>>>2>>>0]=0}}var Je=0,kt=0,vt=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,xt=(d,h,w)=>{h>>>=0;var S=h+w;for(w=h;d[w]&&!(w>=S);)++w;if(16P?S+=String.fromCharCode(P):(P-=65536,S+=String.fromCharCode(55296|P>>10,56320|P&1023))}}else S+=String.fromCharCode(P)}return S},qe=(d,h)=>(d>>>=0)?xt(H,d,h):\"\",Zt=d=>{for(var h=0,w=0;w=S?h++:2047>=S?h+=2:55296<=S&&57343>=S?(h+=4,++w):h+=3}return h},Vt=(d,h,w,S)=>{if(w>>>=0,!(0=K){var X=d.charCodeAt(++N);K=65536+((K&1023)<<10)|X&1023}if(127>=K){if(w>=S)break;h[w++>>>0]=K}else{if(2047>=K){if(w+1>=S)break;h[w++>>>0]=192|K>>6}else{if(65535>=K){if(w+2>=S)break;h[w++>>>0]=224|K>>12}else{if(w+3>=S)break;h[w++>>>0]=240|K>>18,h[w++>>>0]=128|K>>12&63}h[w++>>>0]=128|K>>6&63}h[w++>>>0]=128|K&63}}return h[w>>>0]=0,w-P},St=d=>d%4===0&&(d%100!==0||d%400===0),$t=[0,31,60,91,121,152,182,213,244,274,305,335],Nt=[0,31,59,90,120,151,181,212,243,273,304,334],Wt=d=>{var h=Zt(d)+1,w=Lt(h);return w&&Vt(d,H,w,h),w},Rt=[],Qt=(d,h)=>{Rt.length=0;for(var w;w=H[d++>>>0];){var S=w!=105;S&=w!=112,h+=S&&h%8?4:0,Rt.push(w==112?L[h>>>2>>>0]:w==105?R[h>>>2>>>0]:Ie[h>>>3>>>0]),h+=S?8:4}return Rt},at={},Xt=()=>{if(!Gt){var d={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:l||\"./this.program\"},h;for(h in at)at[h]===void 0?delete d[h]:d[h]=at[h];var w=[];for(h in d)w.push(`${h}=${d[h]}`);Gt=w}return Gt},Gt,Ke=[null,[],[]],vr=[31,29,31,30,31,30,31,31,30,31,30,31],ke=[31,28,31,30,31,30,31,31,30,31,30,31];function $r(d){var h=Array(Zt(d)+1);return Vt(d,h,0,h.length),h}function Ht(d,h,w,S){function P(O,oe,Ce){for(O=typeof O==\"number\"?O.toString():O||\"\";O.lengthPr?-1:0ct-O.getDate())oe-=ct-O.getDate()+1,O.setDate(1),11>Ce?O.setMonth(Ce+1):(O.setMonth(0),O.setFullYear(O.getFullYear()+1));else{O.setDate(O.getDate()+oe);break}}return Ce=new Date(O.getFullYear()+1,0,4),oe=X(new Date(O.getFullYear(),0,4)),Ce=X(Ce),0>=K(oe,O)?0>=K(Ce,O)?O.getFullYear()+1:O.getFullYear():O.getFullYear()-1}d>>>=0,h>>>=0,w>>>=0,S>>>=0;var de=L[S+40>>>2>>>0];S={bb:R[S>>>2>>>0],ab:R[S+4>>>2>>>0],Ga:R[S+8>>>2>>>0],Ka:R[S+12>>>2>>>0],Ha:R[S+16>>>2>>>0],Da:R[S+20>>>2>>>0],xa:R[S+24>>>2>>>0],Ca:R[S+28>>>2>>>0],fb:R[S+32>>>2>>>0],$a:R[S+36>>>2>>>0],cb:de?qe(de):\"\"},w=qe(w),de={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var fe in de)w=w.replace(new RegExp(fe,\"g\"),de[fe]);var Oe=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),Re=\"January February March April May June July August September October November December\".split(\" \");de={\"%a\":O=>Oe[O.xa].substring(0,3),\"%A\":O=>Oe[O.xa],\"%b\":O=>Re[O.Ha].substring(0,3),\"%B\":O=>Re[O.Ha],\"%C\":O=>N((O.Da+1900)/100|0,2),\"%d\":O=>N(O.Ka,2),\"%e\":O=>P(O.Ka,2,\" \"),\"%g\":O=>ae(O).toString().substring(2),\"%G\":O=>ae(O),\"%H\":O=>N(O.Ga,2),\"%I\":O=>(O=O.Ga,O==0?O=12:12{for(var oe=0,Ce=0;Ce<=O.Ha-1;oe+=(St(O.Da+1900)?vr:ke)[Ce++]);return N(O.Ka+oe,3)},\"%m\":O=>N(O.Ha+1,2),\"%M\":O=>N(O.ab,2),\"%n\":()=>`\\n`,\"%p\":O=>0<=O.Ga&&12>O.Ga?\"AM\":\"PM\",\"%S\":O=>N(O.bb,2),\"%t\":()=>\"\t\",\"%u\":O=>O.xa||7,\"%U\":O=>N(Math.floor((O.Ca+7-O.xa)/7),2),\"%V\":O=>{var oe=Math.floor((O.Ca+7-(O.xa+6)%7)/7);if(2>=(O.xa+371-O.Ca-2)%7&&oe++,oe)oe==53&&(Ce=(O.xa+371-O.Ca)%7,Ce==4||Ce==3&&St(O.Da)||(oe=1));else{oe=52;var Ce=(O.xa+7-O.Ca-1)%7;(Ce==4||Ce==5&&St(O.Da%400-1))&&oe++}return N(oe,2)},\"%w\":O=>O.xa,\"%W\":O=>N(Math.floor((O.Ca+7-(O.xa+6)%7)/7),2),\"%y\":O=>(O.Da+1900).toString().substring(2),\"%Y\":O=>O.Da+1900,\"%z\":O=>{O=O.$a;var oe=0<=O;return O=Math.abs(O)/60,(oe?\"+\":\"-\")+(\"0000\"+(O/60*100+O%60)).slice(-4)},\"%Z\":O=>O.cb,\"%%\":()=>\"%\"},w=w.replace(/%%/g,\"\\\\0\\\\0\");for(fe in de)w.includes(fe)&&(w=w.replace(new RegExp(fe,\"g\"),de[fe](S)));return w=w.replace(/\\\\0\\\\0/g,\"%\"),fe=$r(w),fe.length>h?0:(V.set(fe,d>>>0),fe.length-1)}var Ct=d=>{try{d()}catch(h){se(h)}};function mn(){var d=ee,h={};for(let[w,S]of Object.entries(d))h[w]=typeof S==\"function\"?function(){_t.push(w);try{return S.apply(null,arguments)}finally{D||(_t.pop(),nt&&it===1&&_t.length===0&&(it=0,Ct(dr),typeof Fibers<\"u\"&&Fibers.gb()))}}:S;return h}var it=0,nt=null,te=0,_t=[],Jt={},_r={},xr=0,er=null,Sr=[];function Cr(){return new Promise((d,h)=>{er={resolve:d,reject:h}})}function Ir(){var d=Lt(65548),h=d+12;L[d>>>2>>>0]=h,L[d+4>>>2>>>0]=h+65536,h=_t[0];var w=Jt[h];return w===void 0&&(w=xr++,Jt[h]=w,_r[w]=h),R[d+8>>>2>>>0]=w,d}function Ar(d){if(!D){if(it===0){var h=!1,w=!1;d((S=0)=>{if(!D&&(te=S,h=!0,w)){it=2,Ct(()=>lr(nt)),typeof Browser<\"u\"&&Browser.Ia.Qa&&Browser.Ia.resume(),S=!1;try{var P=(0,ee[_r[R[nt+8>>>2>>>0]]])()}catch(X){P=X,S=!0}var N=!1;if(!nt){var K=er;K&&(er=null,(S?K.reject:K.resolve)(P),N=!0)}if(S&&!N)throw P}}),w=!0,h||(it=1,nt=Ir(),typeof Browser<\"u\"&&Browser.Ia.Qa&&Browser.Ia.pause(),Ct(()=>ur(nt)))}else it===2?(it=0,Ct(cr),nr(nt),nt=null,Sr.forEach(S=>{if(!D)try{S();try{U=U=S=U,r.onExit?.(S),D=!0,a(S,new Ne(S))}catch(P){P instanceof Ne||P==\"unwind\"||a(1,P)}}catch(P){P instanceof Ne||P==\"unwind\"||a(1,P)}})):se(`invalid state: ${it}`);return te}}function tr(d){return Ar(h=>{d().then(h)})}var Tr={n:function(d,h,w){return tr(async()=>{await r.Ua(d,h,w)})},a:function(d,h,w){throw d>>>=0,new Fe(d).eb(h>>>0,w>>>0),Je=d,kt++,Je},g:function(){return 0},J:function(){},A:function(){},C:function(){},L:function(){return 0},H:function(){},D:function(){},G:function(){},l:function(){},B:function(){},y:function(){},I:function(){},z:function(){},m:()=>1,q:function(d,h,w){d=h+2097152>>>0<4194305-!!d?(d>>>0)+4294967296*h:NaN,w>>>=0,d=new Date(1e3*d),R[w>>>2>>>0]=d.getUTCSeconds(),R[w+4>>>2>>>0]=d.getUTCMinutes(),R[w+8>>>2>>>0]=d.getUTCHours(),R[w+12>>>2>>>0]=d.getUTCDate(),R[w+16>>>2>>>0]=d.getUTCMonth(),R[w+20>>>2>>>0]=d.getUTCFullYear()-1900,R[w+24>>>2>>>0]=d.getUTCDay(),R[w+28>>>2>>>0]=(d.getTime()-Date.UTC(d.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},r:function(d,h,w){d=h+2097152>>>0<4194305-!!d?(d>>>0)+4294967296*h:NaN,w>>>=0,d=new Date(1e3*d),R[w>>>2>>>0]=d.getSeconds(),R[w+4>>>2>>>0]=d.getMinutes(),R[w+8>>>2>>>0]=d.getHours(),R[w+12>>>2>>>0]=d.getDate(),R[w+16>>>2>>>0]=d.getMonth(),R[w+20>>>2>>>0]=d.getFullYear()-1900,R[w+24>>>2>>>0]=d.getDay(),R[w+28>>>2>>>0]=(St(d.getFullYear())?$t:Nt)[d.getMonth()]+d.getDate()-1|0,R[w+36>>>2>>>0]=-(60*d.getTimezoneOffset()),h=new Date(d.getFullYear(),6,1).getTimezoneOffset();var S=new Date(d.getFullYear(),0,1).getTimezoneOffset();R[w+32>>>2>>>0]=(h!=S&&d.getTimezoneOffset()==Math.min(S,h))|0},s:function(d){d>>>=0;var h=new Date(R[d+20>>>2>>>0]+1900,R[d+16>>>2>>>0],R[d+12>>>2>>>0],R[d+8>>>2>>>0],R[d+4>>>2>>>0],R[d>>>2>>>0],0),w=R[d+32>>>2>>>0],S=h.getTimezoneOffset(),P=new Date(h.getFullYear(),6,1).getTimezoneOffset(),N=new Date(h.getFullYear(),0,1).getTimezoneOffset(),K=Math.min(N,P);return 0>w?R[d+32>>>2>>>0]=+(P!=N&&K==S):0>>2>>>0]=h.getDay(),R[d+28>>>2>>>0]=(St(h.getFullYear())?$t:Nt)[h.getMonth()]+h.getDate()-1|0,R[d>>>2>>>0]=h.getSeconds(),R[d+4>>>2>>>0]=h.getMinutes(),R[d+8>>>2>>>0]=h.getHours(),R[d+12>>>2>>>0]=h.getDate(),R[d+16>>>2>>>0]=h.getMonth(),R[d+20>>>2>>>0]=h.getYear(),d=h.getTime(),isNaN(d)?(R[rr()>>>2>>>0]=61,d=-1):d/=1e3,or((Le=d,1<=+Math.abs(Le)?0>>0:~~+Math.ceil((Le-+(~~Le>>>0))/4294967296)>>>0:0)),d>>>0},o:function(){return-52},p:function(){},w:function(d,h,w){function S(ae){return(ae=ae.toTimeString().match(/\\\\(([A-Za-z ]+)\\\\)$/))?ae[1]:\"GMT\"}w>>>=0;var P=new Date().getFullYear(),N=new Date(P,0,1),K=new Date(P,6,1);P=N.getTimezoneOffset();var X=K.getTimezoneOffset();L[d>>>0>>>2>>>0]=60*Math.max(P,X),R[h>>>0>>>2>>>0]=+(P!=X),d=S(N),h=S(K),d=Wt(d),h=Wt(h),X>>2>>>0]=d,L[w+4>>>2>>>0]=h):(L[w>>>2>>>0]=h,L[w+4>>>2>>>0]=d)},e:()=>{se(\"\")},b:function(d,h,w){return d>>>=0,h=Qt(h>>>0,w>>>0),wt[d].apply(null,h)},i:function(d,h,w){return d>>>=0,h=Qt(h>>>0,w>>>0),wt[d].apply(null,h)},h:()=>Date.now(),x:function(){return 4294901760},c:()=>performance.now(),K:function(d,h,w){return h>>>=0,H.copyWithin(d>>>0>>>0,h>>>0,h+(w>>>0)>>>0)},u:function(d){d>>>=0;var h=H.length;if(4294901760=w;w*=2){var S=h*(1+.2/w);S=Math.min(S,d+100663296);var P=Math;S=Math.max(d,S);e:{P=(P.min.call(P,4294901760,S+(65536-S%65536)%65536)-T.buffer.byteLength+65535)/65536;try{T.grow(P),we();var N=1;break e}catch{}N=void 0}if(N)return!0}return!1},E:function(d,h){d>>>=0,h>>>=0;var w=0;return Xt().forEach((S,P)=>{var N=h+w;for(P=L[d+4*P>>>2>>>0]=N,N=0;N>>0>>>0]=S.charCodeAt(N);V[P>>>0>>>0]=0,w+=S.length+1}),0},F:function(d,h){d>>>=0,h>>>=0;var w=Xt();L[d>>>2>>>0]=w.length;var S=0;return w.forEach(P=>S+=P.length+1),L[h>>>2>>>0]=S,0},f:()=>52,k:function(){return 52},t:function(){return 70},j:function(d,h,w,S){h>>>=0,w>>>=0,S>>>=0;for(var P=0,N=0;N>>2>>>0],X=L[h+4>>>2>>>0];h+=8;for(var ae=0;ae>>0],fe=Ke[d];de===0||de===10?((d===1?v:A)(xt(fe,0)),fe.length=0):fe.push(de)}P+=X}return L[S>>>2>>>0]=P,0},v:Ht,d:function(d,h,w,S){return Ht(d>>>0,h>>>0,w>>>0,S>>>0)}},ee=function(){function d(w){return ee=w.exports,ee=mn(),ee=Er(),T=ee.M,we(),ze.unshift(ee.N),xe--,xe==0&&(me!==null&&(clearInterval(me),me=null),ue&&(w=ue,ue=null,w())),ee}var h={a:Tr};if(xe++,r.instantiateWasm)try{return r.instantiateWasm(h,d)}catch(w){A(`Module.instantiateWasm callback failed with error: ${w}`),n(w)}return Xe(h,function(w){d(w.instance)}).catch(n),{}}();r._OrtInit=(d,h)=>(r._OrtInit=ee.O)(d,h),r._OrtGetLastError=(d,h)=>(r._OrtGetLastError=ee.P)(d,h),r._OrtCreateSessionOptions=(d,h,w,S,P,N,K,X,ae,de)=>(r._OrtCreateSessionOptions=ee.Q)(d,h,w,S,P,N,K,X,ae,de),r._OrtAppendExecutionProvider=(d,h)=>(r._OrtAppendExecutionProvider=ee.R)(d,h),r._OrtAddFreeDimensionOverride=(d,h,w)=>(r._OrtAddFreeDimensionOverride=ee.S)(d,h,w),r._OrtAddSessionConfigEntry=(d,h,w)=>(r._OrtAddSessionConfigEntry=ee.T)(d,h,w),r._OrtReleaseSessionOptions=d=>(r._OrtReleaseSessionOptions=ee.U)(d),r._OrtCreateSession=(d,h,w)=>(r._OrtCreateSession=ee.V)(d,h,w),r._OrtReleaseSession=d=>(r._OrtReleaseSession=ee.W)(d),r._OrtGetInputOutputCount=(d,h,w)=>(r._OrtGetInputOutputCount=ee.X)(d,h,w),r._OrtGetInputName=(d,h)=>(r._OrtGetInputName=ee.Y)(d,h),r._OrtGetOutputName=(d,h)=>(r._OrtGetOutputName=ee.Z)(d,h),r._OrtFree=d=>(r._OrtFree=ee._)(d),r._OrtCreateTensor=(d,h,w,S,P,N)=>(r._OrtCreateTensor=ee.$)(d,h,w,S,P,N),r._OrtGetTensorData=(d,h,w,S,P)=>(r._OrtGetTensorData=ee.aa)(d,h,w,S,P),r._OrtReleaseTensor=d=>(r._OrtReleaseTensor=ee.ba)(d),r._OrtCreateRunOptions=(d,h,w,S)=>(r._OrtCreateRunOptions=ee.ca)(d,h,w,S),r._OrtAddRunConfigEntry=(d,h,w)=>(r._OrtAddRunConfigEntry=ee.da)(d,h,w),r._OrtReleaseRunOptions=d=>(r._OrtReleaseRunOptions=ee.ea)(d),r._OrtCreateBinding=d=>(r._OrtCreateBinding=ee.fa)(d),r._OrtBindInput=(d,h,w)=>(r._OrtBindInput=ee.ga)(d,h,w),r._OrtBindOutput=(d,h,w,S)=>(r._OrtBindOutput=ee.ha)(d,h,w,S),r._OrtClearBoundOutputs=d=>(r._OrtClearBoundOutputs=ee.ia)(d),r._OrtReleaseBinding=d=>(r._OrtReleaseBinding=ee.ja)(d),r._OrtRunWithBinding=(d,h,w,S,P)=>(r._OrtRunWithBinding=ee.ka)(d,h,w,S,P),r._OrtRun=(d,h,w,S,P,N,K,X)=>(r._OrtRun=ee.la)(d,h,w,S,P,N,K,X),r._OrtEndProfiling=d=>(r._OrtEndProfiling=ee.ma)(d),r._JsepOutput=(d,h,w)=>(r._JsepOutput=ee.na)(d,h,w),r._JsepGetNodeName=d=>(r._JsepGetNodeName=ee.oa)(d);var rr=()=>(rr=ee.pa)(),Lt=r._malloc=d=>(Lt=r._malloc=ee.qa)(d),nr=r._free=d=>(nr=r._free=ee.ra)(d),or=d=>(or=ee.ta)(d),ar=()=>(ar=ee.ua)(),ir=d=>(ir=ee.va)(d),sr=d=>(sr=ee.wa)(d),ur=d=>(ur=ee.ya)(d),dr=()=>(dr=ee.za)(),lr=d=>(lr=ee.Aa)(d),cr=()=>(cr=ee.Ba)();r.___start_em_js=944151,r.___stop_em_js=944312;function Er(){var d=ee;d=Object.assign({},d);var h=S=>()=>S()>>>0,w=S=>P=>S(P)>>>0;return d.pa=h(d.pa),d.qa=w(d.qa),d.ua=h(d.ua),d.wa=w(d.wa),d}r.stackAlloc=sr,r.stackSave=ar,r.stackRestore=ir,r.UTF8ToString=qe,r.stringToUTF8=(d,h,w)=>Vt(d,H,h,w),r.lengthBytesUTF8=Zt;var It;ue=function d(){It||Bt(),It||(ue=d)};function Bt(){if(!(0Oo)});var Bo=pr(()=>{});var Do=pr(()=>{});var Mo={};Mr(Mo,{cpus:()=>gd});var gd,zo=q(()=>{gd=void 0});var No=pr((Vo,In)=>{\"use strict\";var Uo=(()=>{var e=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(e=e||__filename),function(t={}){function r(){return ne.buffer!=me.buffer&&G(),me}function o(){return ne.buffer!=me.buffer&&G(),ue}function n(){return ne.buffer!=me.buffer&&G(),se}function s(){return ne.buffer!=me.buffer&&G(),he}function u(){return ne.buffer!=me.buffer&&G(),Ae}function l(){return ne.buffer!=me.buffer&&G(),He}var a=t,p,m;a.ready=new Promise((i,c)=>{p=i,m=c}),a.mountExternalData=(i,c)=>{(a.cb||(a.cb=new Map)).set(i,c)},a.unmountExternalData=()=>{delete a.cb};let f=()=>{let i=(g,x,E)=>(...k)=>{let W=pt,Z=x?.();k=g(...k);let ge=x?.();return Z!==ge&&(g=ge,E(Z),x=E=null),pt!=W?td():k},c=g=>async(...x)=>{try{if(a.bb)throw Error(\"Session already started\");let E=a.bb={Gb:x[0],errors:[]},k=await g(...x);if(a.bb!==E)throw Error(\"Session mismatch\");a.kb?.flush();let W=E.errors;if(0ge),0a._OrtCreateSession,g=>a._OrtCreateSession=g),a._OrtRun=c(i(a._OrtRun,()=>a._OrtRun,g=>a._OrtRun=g)),a._OrtRunWithBinding=c(i(a._OrtRunWithBinding,()=>a._OrtRunWithBinding,g=>a._OrtRunWithBinding=g)),a._OrtBindInput=i(a._OrtBindInput,()=>a._OrtBindInput,g=>a._OrtBindInput=g),f=void 0};a.jsepInit=(i,c)=>{if(f?.(),i===\"webgpu\"){[a.kb,a.xb,a.Bb,a.lb,a.Ab,a.Ea,a.Cb,a.Eb,a.yb,a.zb,a.Db]=c;let g=a.kb;a.jsepRegisterBuffer=(x,E,k,W)=>g.registerBuffer(x,E,k,W),a.jsepGetBuffer=x=>g.getBuffer(x),a.jsepCreateDownloader=(x,E,k)=>g.createDownloader(x,E,k),a.jsepOnReleaseSession=x=>{g.onReleaseSession(x)},a.jsepOnRunStart=x=>g.onRunStart(x)}};var b=Object.assign({},a),_=\"./this.program\",y=(i,c)=>{throw c},$=typeof window==\"object\",I=typeof importScripts==\"function\",C=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",v=a.ENVIRONMENT_IS_PTHREAD||!1,A=\"\";function T(i){return a.locateFile?a.locateFile(i,A):A+i}var D,U,V;if(C){var H=(_n(),Ft($n)),R=(Sn(),Ft(xn));A=I?R.dirname(A)+\"/\":__dirname+\"/\",D=(c,g)=>(c=vt(c)?new URL(c):R.normalize(c),H.readFileSync(c,g?void 0:\"utf8\")),V=c=>(c=D(c,!0),c.buffer||(c=new Uint8Array(c)),c),U=(c,g,x,E=!0)=>{c=vt(c)?new URL(c):R.normalize(c),H.readFile(c,E?void 0:\"utf8\",(k,W)=>{k?x(k):g(E?W.buffer:W)})},!a.thisProgram&&1{throw process.exitCode=c,g},a.inspect=()=>\"[Emscripten Module object]\";let i;try{i=Bo()}catch(c){throw console.error(\\'The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?\\'),c}global.Worker=i.Worker}else($||I)&&(I?A=self.location.href:typeof document<\"u\"&&document.currentScript&&(A=document.currentScript.src),typeof e<\"u\"&&e&&(A=e),A.indexOf(\"blob:\")!==0?A=A.substr(0,A.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):A=\"\",C||(D=i=>{var c=new XMLHttpRequest;return c.open(\"GET\",i,!1),c.send(null),c.responseText},I&&(V=i=>{var c=new XMLHttpRequest;return c.open(\"GET\",i,!1),c.responseType=\"arraybuffer\",c.send(null),new Uint8Array(c.response)}),U=(i,c,g)=>{var x=new XMLHttpRequest;x.open(\"GET\",i,!0),x.responseType=\"arraybuffer\",x.onload=()=>{x.status==200||x.status==0&&x.response?c(x.response):g()},x.onerror=g,x.send(null)}));C&&typeof performance>\"u\"&&(global.performance=Do().performance);var L=console.log.bind(console),pe=console.error.bind(console);C&&(L=(...i)=>H.writeSync(1,i.join(\" \")+`\\n`),pe=(...i)=>H.writeSync(2,i.join(\" \")+`\\n`));var Ie=L,we=pe;Object.assign(a,b),b=null,typeof WebAssembly!=\"object\"&&Je(\"no native wasm support detected\");var ne,ze,Q=!1,xe,me,ue,se,he,Ae,He;function G(){var i=ne.buffer;a.HEAP8=me=new Int8Array(i),a.HEAP16=new Int16Array(i),a.HEAPU8=ue=new Uint8Array(i),a.HEAPU16=new Uint16Array(i),a.HEAP32=se=new Int32Array(i),a.HEAPU32=he=new Uint32Array(i),a.HEAPF32=Ae=new Float32Array(i),a.HEAPF64=He=new Float64Array(i)}var J=16777216;if(v)ne=a.wasmMemory;else if(a.wasmMemory)ne=a.wasmMemory;else if(ne=new WebAssembly.Memory({initial:J/65536,maximum:65536,shared:!0}),!(ne.buffer instanceof SharedArrayBuffer))throw we(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),C&&we(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");G(),J=ne.buffer.byteLength;var Se=[],Qe=[],Xe=[],Le=0,wt=null,Ne=null;function Fe(){if(Le--,Le==0&&(wt!==null&&(clearInterval(wt),wt=null),Ne)){var i=Ne;Ne=null,i()}}function Je(i){throw i=\"Aborted(\"+i+\")\",we(i),Q=!0,xe=1,i=new WebAssembly.RuntimeError(i+\". Build with -sASSERTIONS for more info.\"),m(i),i}var kt=i=>i.startsWith(\"data:application/octet-stream;base64,\"),vt=i=>i.startsWith(\"file://\"),xt;xt=\"ort-wasm-simd-threaded.wasm\",kt(xt)||(xt=T(xt));function qe(i){if(V)return V(i);throw\"both async and sync fetching of the wasm failed\"}function Zt(i){if($||I){if(typeof fetch==\"function\"&&!vt(i))return fetch(i,{credentials:\"same-origin\"}).then(c=>{if(!c.ok)throw\"failed to load wasm binary file at \\'\"+i+\"\\'\";return c.arrayBuffer()}).catch(()=>qe(i));if(U)return new Promise((c,g)=>{U(i,x=>c(new Uint8Array(x)),g)})}return Promise.resolve().then(()=>qe(i))}function Vt(i,c,g){return Zt(i).then(x=>WebAssembly.instantiate(x,c)).then(x=>x).then(g,x=>{we(`failed to asynchronously prepare wasm: ${x}`),Je(x)})}function St(i,c){var g=xt;return typeof WebAssembly.instantiateStreaming!=\"function\"||kt(g)||vt(g)||C||typeof fetch!=\"function\"?Vt(g,i,c):fetch(g,{credentials:\"same-origin\"}).then(x=>WebAssembly.instantiateStreaming(x,i).then(c,function(E){return we(`wasm streaming compile failed: ${E}`),we(\"falling back to ArrayBuffer instantiation\"),Vt(g,i,c)}))}var $t,Nt={933148:(i,c,g,x)=>{if(typeof a>\"u\"||!a.cb)return 1;if(i=Ke(i>>>0),i.startsWith(\"./\")&&(i=i.substring(2)),i=a.cb.get(i),!i)return 2;if(c>>>=0,g>>>=0,x>>>=0,c+g>i.byteLength)return 3;try{return o().set(i.subarray(c,c+g),x>>>0),0}catch{return 4}},933649:()=>{a.yb()},933680:()=>{a.zb()},933709:()=>{a.Db()},933734:i=>a.xb(i),933767:i=>a.Bb(i),933799:(i,c,g)=>{a.lb(i,c,g,!0)},933838:(i,c,g)=>{a.lb(i,c,g)},933871:i=>{a.Ea(\"Abs\",i,void 0)},933922:i=>{a.Ea(\"Neg\",i,void 0)},933973:i=>{a.Ea(\"Floor\",i,void 0)},934026:i=>{a.Ea(\"Ceil\",i,void 0)},934078:i=>{a.Ea(\"Reciprocal\",i,void 0)},934136:i=>{a.Ea(\"Sqrt\",i,void 0)},934188:i=>{a.Ea(\"Exp\",i,void 0)},934239:i=>{a.Ea(\"Erf\",i,void 0)},934290:i=>{a.Ea(\"Sigmoid\",i,void 0)},934345:(i,c,g)=>{a.Ea(\"HardSigmoid\",i,{alpha:c,beta:g})},934424:i=>{a.Ea(\"Log\",i,void 0)},934475:i=>{a.Ea(\"Sin\",i,void 0)},934526:i=>{a.Ea(\"Cos\",i,void 0)},934577:i=>{a.Ea(\"Tan\",i,void 0)},934628:i=>{a.Ea(\"Asin\",i,void 0)},934680:i=>{a.Ea(\"Acos\",i,void 0)},934732:i=>{a.Ea(\"Atan\",i,void 0)},934784:i=>{a.Ea(\"Sinh\",i,void 0)},934836:i=>{a.Ea(\"Cosh\",i,void 0)},934888:i=>{a.Ea(\"Asinh\",i,void 0)},934941:i=>{a.Ea(\"Acosh\",i,void 0)},934994:i=>{a.Ea(\"Atanh\",i,void 0)},935047:i=>{a.Ea(\"Tanh\",i,void 0)},935099:i=>{a.Ea(\"Not\",i,void 0)},935150:(i,c,g)=>{a.Ea(\"Clip\",i,{min:c,max:g})},935219:i=>{a.Ea(\"Clip\",i,void 0)},935271:(i,c)=>{a.Ea(\"Elu\",i,{alpha:c})},935329:i=>{a.Ea(\"Relu\",i,void 0)},935381:(i,c)=>{a.Ea(\"LeakyRelu\",i,{alpha:c})},935445:(i,c)=>{a.Ea(\"ThresholdedRelu\",i,{alpha:c})},935515:(i,c)=>{a.Ea(\"Cast\",i,{to:c})},935573:i=>{a.Ea(\"Add\",i,void 0)},935624:i=>{a.Ea(\"Sub\",i,void 0)},935675:i=>{a.Ea(\"Mul\",i,void 0)},935726:i=>{a.Ea(\"Div\",i,void 0)},935777:i=>{a.Ea(\"Pow\",i,void 0)},935828:i=>{a.Ea(\"Equal\",i,void 0)},935881:i=>{a.Ea(\"Greater\",i,void 0)},935936:i=>{a.Ea(\"GreaterOrEqual\",i,void 0)},935998:i=>{a.Ea(\"Less\",i,void 0)},936050:i=>{a.Ea(\"LessOrEqual\",i,void 0)},936109:(i,c,g,x,E)=>{a.Ea(\"ReduceMean\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},936268:(i,c,g,x,E)=>{a.Ea(\"ReduceMax\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},936426:(i,c,g,x,E)=>{a.Ea(\"ReduceMin\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},936584:(i,c,g,x,E)=>{a.Ea(\"ReduceProd\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},936743:(i,c,g,x,E)=>{a.Ea(\"ReduceSum\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},936901:(i,c,g,x,E)=>{a.Ea(\"ReduceL1\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},937058:(i,c,g,x,E)=>{a.Ea(\"ReduceL2\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},937215:(i,c,g,x,E)=>{a.Ea(\"ReduceLogSum\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},937376:(i,c,g,x,E)=>{a.Ea(\"ReduceSumSquare\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},937540:(i,c,g,x,E)=>{a.Ea(\"ReduceLogSumExp\",i,{keepDims:!!c,noopWithEmptyAxes:!!g,axes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},937704:i=>{a.Ea(\"Where\",i,void 0)},937757:(i,c,g)=>{a.Ea(\"Transpose\",i,{perm:c?Array.from(n().subarray(c>>>0,g>>>0)):[]})},937865:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce)=>{a.Ea(\"ConvTranspose\",i,{format:ge?\"NHWC\":\"NCHW\",autoPad:c,dilations:[g],group:x,kernel_shape:[E],pads:[k,W],strides:[Z],wIsConst:()=>!!r()[le>>>0],outputPadding:ve?Array.from(n().subarray(ve>>>0,Ue>>>0)):[],outputShape:Ve?Array.from(n().subarray(Ve>>>0,B>>>0)):[],activation:Ke(ce)})},938267:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B)=>{a.Ea(\"ConvTranspose\",i,{format:Z?\"NHWC\":\"NCHW\",autoPad:c,dilations:Array.from(n().subarray(g>>>0,(g>>>0)+2>>>0)),group:x,kernelShape:Array.from(n().subarray(E>>>0,(E>>>0)+2>>>0)),pads:Array.from(n().subarray(k>>>0,(k>>>0)+4>>>0)),strides:Array.from(n().subarray(W>>>0,(W>>>0)+2>>>0)),wIsConst:()=>!!r()[ge>>>0],outputPadding:le?Array.from(n().subarray(le>>>0,ve>>>0)):[],outputShape:Ue?Array.from(n().subarray(Ue>>>0,Ve>>>0)):[],activation:Ke(B)})},938832:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce)=>{a.Ea(\"ConvTranspose\",i,{format:ge?\"NHWC\":\"NCHW\",autoPad:c,dilations:[g],group:x,kernel_shape:[E],pads:[k,W],strides:[Z],wIsConst:()=>!!r()[le>>>0],outputPadding:ve?Array.from(n().subarray(ve>>>0,Ue>>>0)):[],outputShape:Ve?Array.from(n().subarray(Ve>>>0,B>>>0)):[],activation:Ke(ce)})},939234:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B)=>{a.Ea(\"ConvTranspose\",i,{format:Z?\"NHWC\":\"NCHW\",autoPad:c,dilations:Array.from(n().subarray(g>>>0,(g>>>0)+2>>>0)),group:x,kernelShape:Array.from(n().subarray(E>>>0,(E>>>0)+2>>>0)),pads:Array.from(n().subarray(k>>>0,(k>>>0)+4>>>0)),strides:Array.from(n().subarray(W>>>0,(W>>>0)+2>>>0)),wIsConst:()=>!!r()[ge>>>0],outputPadding:le?Array.from(n().subarray(le>>>0,ve>>>0)):[],outputShape:Ue?Array.from(n().subarray(Ue>>>0,Ve>>>0)):[],activation:Ke(B)})},939799:(i,c)=>{a.Ea(\"GlobalAveragePool\",i,{format:c?\"NHWC\":\"NCHW\"})},939890:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce,Te)=>{a.Ea(\"AveragePool\",i,{format:Te?\"NHWC\":\"NCHW\",auto_pad:c,ceil_mode:g,count_include_pad:x,storage_order:E,dilations:[k,W],kernel_shape:[Z,ge],pads:[le,ve,Ue,Ve],strides:[B,ce]})},940174:(i,c)=>{a.Ea(\"GlobalAveragePool\",i,{format:c?\"NHWC\":\"NCHW\"})},940265:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce,Te)=>{a.Ea(\"AveragePool\",i,{format:Te?\"NHWC\":\"NCHW\",auto_pad:c,ceil_mode:g,count_include_pad:x,storage_order:E,dilations:[k,W],kernel_shape:[Z,ge],pads:[le,ve,Ue,Ve],strides:[B,ce]})},940549:(i,c)=>{a.Ea(\"GlobalMaxPool\",i,{format:c?\"NHWC\":\"NCHW\"})},940636:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce,Te)=>{a.Ea(\"MaxPool\",i,{format:Te?\"NHWC\":\"NCHW\",auto_pad:c,ceil_mode:g,count_include_pad:x,storage_order:E,dilations:[k,W],kernel_shape:[Z,ge],pads:[le,ve,Ue,Ve],strides:[B,ce]})},940916:(i,c)=>{a.Ea(\"GlobalMaxPool\",i,{format:c?\"NHWC\":\"NCHW\"})},941003:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce,Te)=>{a.Ea(\"MaxPool\",i,{format:Te?\"NHWC\":\"NCHW\",auto_pad:c,ceil_mode:g,count_include_pad:x,storage_order:E,dilations:[k,W],kernel_shape:[Z,ge],pads:[le,ve,Ue,Ve],strides:[B,ce]})},941283:(i,c,g,x,E)=>{a.Ea(\"Gemm\",i,{alpha:c,beta:g,transA:x,transB:E})},941387:i=>{a.Ea(\"MatMul\",i,void 0)},941441:(i,c,g,x)=>{a.Ea(\"ArgMax\",i,{keepDims:!!c,selectLastIndex:!!g,axis:x})},941549:(i,c,g,x)=>{a.Ea(\"ArgMin\",i,{keepDims:!!c,selectLastIndex:!!g,axis:x})},941657:(i,c)=>{a.Ea(\"Softmax\",i,{axis:c})},941720:(i,c)=>{a.Ea(\"Concat\",i,{axis:c})},941780:(i,c,g,x,E)=>{a.Ea(\"Split\",i,{axis:c,numOutputs:g,splitSizes:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},941920:i=>{a.Ea(\"Expand\",i,void 0)},941974:(i,c)=>{a.Ea(\"Gather\",i,{axis:Number(c)})},942045:(i,c)=>{a.Ea(\"GatherElements\",i,{axis:Number(c)})},942124:(i,c,g,x,E,k,W,Z,ge,le,ve)=>{a.Ea(\"Resize\",i,{antialias:c,axes:g?Array.from(n().subarray(g>>>0,x>>>0)):[],coordinateTransformMode:Ke(E),cubicCoeffA:k,excludeOutside:W,extrapolationValue:Z,keepAspectRatioPolicy:Ke(ge),mode:Ke(le),nearestMode:Ke(ve)})},942470:(i,c,g,x,E,k,W)=>{a.Ea(\"Slice\",i,{starts:c?Array.from(n().subarray(c>>>0,g>>>0)):[],ends:x?Array.from(n().subarray(x>>>0,E>>>0)):[],axes:k?Array.from(n().subarray(k>>>0,W>>>0)):[]})},942686:i=>{a.Ea(\"Tile\",i,void 0)},942738:(i,c,g)=>{a.Ea(\"LayerNormalization\",i,{axis:Number(c),epsilon:Number(g)})},942845:(i,c,g)=>{a.Ea(\"InstanceNormalization\",i,{epsilon:c,format:g?\"NHWC\":\"NCHW\"})},942959:(i,c,g)=>{a.Ea(\"InstanceNormalization\",i,{epsilon:c,format:g?\"NHWC\":\"NCHW\"})},943073:i=>{a.Ea(\"Range\",i,void 0)},943126:(i,c)=>{a.Ea(\"Einsum\",i,{equation:Ke(c)})},943207:(i,c,g,x,E)=>{a.Ea(\"Pad\",i,{mode:c,value:g,pads:x?Array.from(n().subarray(x>>>0,E>>>0)):[]})},943334:(i,c,g,x,E,k)=>{a.Ea(\"BatchNormalization\",i,{epsilon:c,momentum:g,spatial:!!E,trainingMode:!!x,format:k?\"NHWC\":\"NCHW\"})},943503:(i,c,g,x,E,k)=>{a.Ea(\"BatchNormalization\",i,{epsilon:c,momentum:g,spatial:!!E,trainingMode:!!x,format:k?\"NHWC\":\"NCHW\"})},943672:(i,c,g)=>{a.Ea(\"CumSum\",i,{exclusive:Number(c),reverse:Number(g)})},943769:(i,c,g,x,E,k,W,Z,ge)=>{a.Ea(\"Attention\",i,{numHeads:c,isUnidirectional:g,maskFilterValue:x,scale:E,doRotary:k,qkvHiddenSizes:W?Array.from(n().subarray(Number(Z)>>>0,Number(Z)+W>>>0)):[],pastPresentShareBuffer:!!ge})},944041:i=>{a.Ea(\"BiasAdd\",i,void 0)},944096:i=>{a.Ea(\"BiasSplitGelu\",i,void 0)},944157:i=>{a.Ea(\"FastGelu\",i,void 0)},944213:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve)=>{a.Ea(\"Conv\",i,{format:ge?\"NHWC\":\"NCHW\",auto_pad:c,dilations:[g],group:x,kernel_shape:[E],pads:k?Array.from(n().subarray(k>>>0,W>>>0)):[],strides:[Z],w_is_const:()=>!!r()[le>>>0],activation:Ke(ve),activation_params:Ue?Array.from(u().subarray(Ue>>>0,Ve>>>0)):[]})},944583:(i,c,g,x,E,k,W,Z,ge,le,ve,Ue,Ve,B,ce,Te)=>{a.Ea(\"Conv\",i,{format:Ue?\"NHWC\":\"NCHW\",auto_pad:c,dilations:[g,x],group:E,kernel_shape:[k,W],pads:Z?Array.from(n().subarray(Z>>>0,ge>>>0)):[],strides:[le,ve],w_is_const:()=>!!r()[Ve>>>0],activation:Ke(B),activation_params:ce?Array.from(u().subarray(ce>>>0,Te>>>0)):[]})},944974:i=>{a.Ea(\"Gelu\",i,void 0)},945026:(i,c,g,x,E,k)=>{a.Ea(\"MatMulNBits\",i,{k:c,n:g,accuracyLevel:x,bits:E,blockSize:k})},945153:(i,c,g,x,E,k)=>{a.Ea(\"MultiHeadAttention\",i,{numHeads:c,isUnidirectional:g,maskFilterValue:x,scale:E,doRotary:k})},945312:(i,c)=>{a.Ea(\"SkipLayerNormalization\",i,{epsilon:c})},945393:i=>{a.Cb(i)},945427:(i,c)=>a.Eb(i,c,a.bb.Gb,a.bb.errors)};function Wt(i){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${i})`,this.status=i}var Rt=i=>{i.terminate(),i.onmessage=()=>{}},Qt=i=>{te.Ya.length==0&&(it(),te.mb(te.Ya[0]));var c=te.Ya.pop();if(!c)return 6;te.Za.push(c),te.Qa[i.Xa]=c,c.Xa=i.Xa;var g={cmd:\"run\",start_routine:i.Hb,arg:i.ub,pthread_ptr:i.Xa};return C&&c.unref(),c.postMessage(g,i.Nb),0},at=0,Xt=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,Gt=(i,c,g)=>{c>>>=0;var x=c+g;for(g=c;i[g]&&!(g>=x);)++g;if(16E?x+=String.fromCharCode(E):(E-=65536,x+=String.fromCharCode(55296|E>>10,56320|E&1023))}}else x+=String.fromCharCode(E)}return x},Ke=(i,c)=>(i>>>=0)?Gt(o(),i,c):\"\",vr=i=>{var c=bn();return i=i(),Br(c),i};function ke(i,c){var g=arguments.length-2,x=arguments;return vr(()=>{for(var E=wn(8*g),k=E>>>3,W=0;W>>0]=Z}return wo(i,g,E,c)})}function $r(i){if(v)return ke(0,1,i);xe=i,0{if(xe=i,v)throw Jt(i),\"unwind\";$r(i)},Ct=i=>{i instanceof Wt||i==\"unwind\"||y(1,i)};function mn(){for(var i=a.numThreads;i--;)it();Se.unshift(()=>{Le++,nt(()=>Fe())})}function it(){var i=T(\"ort-wasm-simd-threaded.worker.js\");i=new Worker(i),te.Ya.push(i)}function nt(i){v?i():Promise.all(te.Ya.map(te.mb)).then(i)}var te={Ya:[],Za:[],qb:[],Qa:{},hb(){v?(te.receiveObjectTransfer=te.Fb,te.threadInitTLS=te.pb,te.setExitStatus=te.ob):mn()},ob:i=>xe=i,Qb:[\"$terminateWorker\"],Ib:()=>{for(var i of te.Za)Rt(i);for(i of te.Ya)Rt(i);te.Ya=[],te.Za=[],te.Qa=[]},nb:i=>{var c=i.Xa;delete te.Qa[c],te.Ya.push(i),te.Za.splice(te.Za.indexOf(i),1),i.Xa=0,gn(c)},Fb(){},pb(){te.qb.forEach(i=>i())},mb:i=>new Promise(c=>{i.onmessage=k=>{k=k.data;var W=k.cmd;if(k.targetThread&&k.targetThread!=Rr()){var Z=te.Qa[k.targetThread];Z?Z.postMessage(k,k.transferList):we(`Internal error! Worker sent a message \"${W}\" to target pthread ${k.targetThread}, but that thread no longer exists!`)}else W===\"checkMailbox\"?Bt():W===\"spawnThread\"?Qt(k):W===\"cleanupThread\"?te.nb(te.Qa[k.thread]):W===\"killThread\"?(k=k.thread,W=te.Qa[k],delete te.Qa[k],Rt(W),gn(k),te.Za.splice(te.Za.indexOf(W),1),W.Xa=0):W===\"cancelThread\"?te.Qa[k.thread].postMessage({cmd:\"cancel\"}):W===\"loaded\"?(i.loaded=!0,C&&!i.Xa&&i.unref(),c(i)):W===\"alert\"?alert(`Thread ${k.threadId}: ${k.text}`):k.target===\"setimmediate\"?i.postMessage(k):W===\"callHandler\"?a[k.handler](...k.args):W&&we(`worker sent an unknown command ${W}`)},i.onerror=k=>{throw we(`worker sent an error! ${k.filename}:${k.lineno}: ${k.message}`),k},C&&(i.on(\"message\",k=>i.onmessage({data:k})),i.on(\"error\",k=>i.onerror(k)));var g=[],x=[\"onExit\"],E;for(E of x)a.hasOwnProperty(E)&&g.push(E);i.postMessage({cmd:\"load\",handlers:g,urlOrBlob:a.mainScriptUrlOrBlob||e,wasmMemory:ne,wasmModule:ze})})};a.PThread=te;var _t=i=>{for(;0{var i=Rr(),c=s()[i+52>>>2>>>0];i=s()[i+56>>>2>>>0],_o(c,c-i),Br(c)};function Jt(i){if(v)return ke(1,0,i);Ht(i)}a.invokeEntryPoint=(i,c)=>{i=xo.apply(null,[i,c]),0>>2>>>0]=c},this.sb=function(c){s()[this.gb+8>>>2>>>0]=c},this.hb=function(c,g){this.rb(),this.tb(c),this.sb(g)},this.rb=function(){s()[this.gb+16>>>2>>>0]=0}}var xr=0,er=0;function Sr(i,c,g,x){return v?ke(2,1,i,c,g,x):Cr(i,c,g,x)}function Cr(i,c,g,x){if(i>>>=0,c>>>=0,g>>>=0,x>>>=0,typeof SharedArrayBuffer>\"u\")return we(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var E=[];return v&&E.length===0?Sr(i,c,g,x):(i={Hb:g,Xa:i,ub:x,Nb:E},v?(i.Pb=\"spawnThread\",postMessage(i,E),0):Qt(i))}function Ir(i,c,g){return v?ke(3,1,i,c,g):0}function Ar(i,c){if(v)return ke(4,1,i,c)}var tr=i=>{for(var c=0,g=0;g=x?c++:2047>=x?c+=2:55296<=x&&57343>=x?(c+=4,++g):c+=3}return c},Tr=(i,c,g,x)=>{if(g>>>=0,!(0=W){var Z=i.charCodeAt(++k);W=65536+((W&1023)<<10)|Z&1023}if(127>=W){if(g>=x)break;c[g++>>>0]=W}else{if(2047>=W){if(g+1>=x)break;c[g++>>>0]=192|W>>6}else{if(65535>=W){if(g+2>=x)break;c[g++>>>0]=224|W>>12}else{if(g+3>=x)break;c[g++>>>0]=240|W>>18,c[g++>>>0]=128|W>>12&63}c[g++>>>0]=128|W>>6&63}c[g++>>>0]=128|W&63}}return c[g>>>0]=0,g-E},ee=(i,c,g)=>Tr(i,o(),c,g);function rr(i,c){if(v)return ke(5,1,i,c)}function Lt(i,c,g){if(v)return ke(6,1,i,c,g)}function nr(i,c,g){return v?ke(7,1,i,c,g):0}function or(i,c){if(v)return ke(8,1,i,c)}function ar(i,c,g){if(v)return ke(9,1,i,c,g)}function ir(i,c,g,x){if(v)return ke(10,1,i,c,g,x)}function sr(i,c,g,x){if(v)return ke(11,1,i,c,g,x)}function ur(i,c,g,x){if(v)return ke(12,1,i,c,g,x)}function dr(i){if(v)return ke(13,1,i)}function lr(i,c){if(v)return ke(14,1,i,c)}function cr(i,c,g){if(v)return ke(15,1,i,c,g)}var Er=()=>{if(!(0>>=0,typeof Atomics.Ob==\"function\"&&(Atomics.Ob(n(),i>>>2,i).value.then(Bt),i+=128,Atomics.store(n(),i>>>2,1))}a.__emscripten_thread_mailbox_await=It;var Bt=()=>{var i=Rr();if(i&&(It(i),!Q))try{vo(),Er()}catch(c){Ct(c)}};a.checkMailbox=Bt;var d=[],h=i=>i%4===0&&(i%100!==0||i%400===0),w=[0,31,60,91,121,152,182,213,244,274,305,335],S=[0,31,59,90,120,151,181,212,243,273,304,334];function P(i,c,g,x,E,k,W,Z){return v?ke(16,1,i,c,g,x,E,k,W,Z):-52}function N(i,c,g,x,E,k,W){if(v)return ke(17,1,i,c,g,x,E,k,W)}var K=i=>{var c=tr(i)+1,g=hn(c);return g&&ee(i,g,c),g},X=[],ae=(i,c)=>{X.length=0;for(var g;g=o()[i++>>>0];){var x=g!=105;x&=g!=112,c+=x&&c%8?4:0,X.push(g==112?s()[c>>>2>>>0]:g==105?n()[c>>>2>>>0]:l()[c>>>3>>>0]),c+=x?8:4}return X},de={},fe=()=>{if(!Oe){var i={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:_||\"./this.program\"},c;for(c in de)de[c]===void 0?delete i[c]:i[c]=de[c];var g=[];for(c in i)g.push(`${c}=${i[c]}`);Oe=g}return Oe},Oe;function Re(i,c){if(v)return ke(18,1,i,c);i>>>=0,c>>>=0;var g=0;return fe().forEach((x,E)=>{var k=c+g;for(E=s()[i+4*E>>>2>>>0]=k,k=0;k>>0>>>0]=x.charCodeAt(k);r()[E>>>0>>>0]=0,g+=x.length+1}),0}function O(i,c){if(v)return ke(19,1,i,c);i>>>=0,c>>>=0;var g=fe();s()[i>>>2>>>0]=g.length;var x=0;return g.forEach(E=>x+=E.length+1),s()[c>>>2>>>0]=x,0}function oe(i){return v?ke(20,1,i):52}function Ce(i,c,g,x){return v?ke(21,1,i,c,g,x):52}function ct(i,c,g,x,E){return v?ke(22,1,i,c,g,x,E):70}var Pr=[null,[],[]];function uo(i,c,g,x){if(v)return ke(23,1,i,c,g,x);c>>>=0,g>>>=0,x>>>=0;for(var E=0,k=0;k>>2>>>0],Z=s()[c+4>>>2>>>0];c+=8;for(var ge=0;ge>>0],ve=Pr[i];le===0||le===10?((i===1?Ie:we)(Gt(ve,0)),ve.length=0):ve.push(le)}E+=Z}return s()[x>>>2>>>0]=E,0}var lo=[31,29,31,30,31,30,31,31,30,31,30,31],co=[31,28,31,30,31,30,31,31,30,31,30,31];function Zu(i){var c=Array(tr(i)+1);return Tr(i,c,0,c.length),c}var Qu=(i,c)=>{r().set(i,c>>>0)};function po(i,c,g,x){function E(B,ce,Te){for(B=typeof B==\"number\"?B.toString():B||\"\";B.lengthEo?-1:0Dt-B.getDate())ce-=Dt-B.getDate()+1,B.setDate(1),11>Te?B.setMonth(Te+1):(B.setMonth(0),B.setFullYear(B.getFullYear()+1));else{B.setDate(B.getDate()+ce);break}}return Te=new Date(B.getFullYear()+1,0,4),ce=Z(new Date(B.getFullYear(),0,4)),Te=Z(Te),0>=W(ce,B)?0>=W(Te,B)?B.getFullYear()+1:B.getFullYear():B.getFullYear()-1}i>>>=0,c>>>=0,g>>>=0,x>>>=0;var le=s()[x+40>>>2>>>0];x={Lb:n()[x>>>2>>>0],Kb:n()[x+4>>>2>>>0],eb:n()[x+8>>>2>>>0],jb:n()[x+12>>>2>>>0],fb:n()[x+16>>>2>>>0],ab:n()[x+20>>>2>>>0],Wa:n()[x+24>>>2>>>0],$a:n()[x+28>>>2>>>0],Rb:n()[x+32>>>2>>>0],Jb:n()[x+36>>>2>>>0],Mb:le?Ke(le):\"\"},g=Ke(g),le={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var ve in le)g=g.replace(new RegExp(ve,\"g\"),le[ve]);var Ue=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),Ve=\"January February March April May June July August September October November December\".split(\" \");le={\"%a\":B=>Ue[B.Wa].substring(0,3),\"%A\":B=>Ue[B.Wa],\"%b\":B=>Ve[B.fb].substring(0,3),\"%B\":B=>Ve[B.fb],\"%C\":B=>k((B.ab+1900)/100|0,2),\"%d\":B=>k(B.jb,2),\"%e\":B=>E(B.jb,2,\" \"),\"%g\":B=>ge(B).toString().substring(2),\"%G\":B=>ge(B),\"%H\":B=>k(B.eb,2),\"%I\":B=>(B=B.eb,B==0?B=12:12{for(var ce=0,Te=0;Te<=B.fb-1;ce+=(h(B.ab+1900)?lo:co)[Te++]);return k(B.jb+ce,3)},\"%m\":B=>k(B.fb+1,2),\"%M\":B=>k(B.Kb,2),\"%n\":()=>`\\n`,\"%p\":B=>0<=B.eb&&12>B.eb?\"AM\":\"PM\",\"%S\":B=>k(B.Lb,2),\"%t\":()=>\"\t\",\"%u\":B=>B.Wa||7,\"%U\":B=>k(Math.floor((B.$a+7-B.Wa)/7),2),\"%V\":B=>{var ce=Math.floor((B.$a+7-(B.Wa+6)%7)/7);if(2>=(B.Wa+371-B.$a-2)%7&&ce++,ce)ce==53&&(Te=(B.Wa+371-B.$a)%7,Te==4||Te==3&&h(B.ab)||(ce=1));else{ce=52;var Te=(B.Wa+7-B.$a-1)%7;(Te==4||Te==5&&h(B.ab%400-1))&&ce++}return k(ce,2)},\"%w\":B=>B.Wa,\"%W\":B=>k(Math.floor((B.$a+7-(B.Wa+6)%7)/7),2),\"%y\":B=>(B.ab+1900).toString().substring(2),\"%Y\":B=>B.ab+1900,\"%z\":B=>{B=B.Jb;var ce=0<=B;return B=Math.abs(B)/60,(ce?\"+\":\"-\")+(\"0000\"+(B/60*100+B%60)).slice(-4)},\"%Z\":B=>B.Mb,\"%%\":()=>\"%\"},g=g.replace(/%%/g,\"\\\\0\\\\0\");for(ve in le)g.includes(ve)&&(g=g.replace(new RegExp(ve,\"g\"),le[ve](x)));return g=g.replace(/\\\\0\\\\0/g,\"%\"),ve=Zu(g),ve.length>c?0:(Qu(ve,i),ve.length-1)}var Or=i=>{try{i()}catch(c){Je(c)}};function Xu(){var i=Y,c={};for(let[g,x]of Object.entries(i))c[g]=typeof x==\"function\"?function(){kr.push(g);try{return x.apply(null,arguments)}finally{Q||(kr.pop(),pt&&At===1&&kr.length===0&&(At=0,at+=1,Or(Co),typeof Fibers<\"u\"&&Fibers.Sb()))}}:x;return c}var At=0,pt=null,mo=0,kr=[],fo={},ho={},Ju=0,fn=null,ed=[];function td(){return new Promise((i,c)=>{fn={resolve:i,reject:c}})}function rd(){var i=hn(65548),c=i+12;s()[i>>>2>>>0]=c,s()[i+4>>>2>>>0]=c+65536,c=kr[0];var g=fo[c];return g===void 0&&(g=Ju++,fo[c]=g,ho[g]=c),c=g,n()[i+8>>>2>>>0]=c,i}function nd(){var i=n()[pt+8>>>2>>>0];return i=Y[ho[i]],--at,i()}function od(i){if(!Q){if(At===0){var c=!1,g=!1;i((x=0)=>{if(!Q&&(mo=x,c=!0,g)){At=2,Or(()=>Io(pt)),typeof Browser<\"u\"&&Browser.ib.wb&&Browser.ib.resume(),x=!1;try{var E=nd()}catch(Z){E=Z,x=!0}var k=!1;if(!pt){var W=fn;W&&(fn=null,(x?W.reject:W.resolve)(E),k=!0)}if(x&&!k)throw E}}),g=!0,c||(At=1,pt=rd(),typeof Browser<\"u\"&&Browser.ib.wb&&Browser.ib.pause(),Or(()=>So(pt)))}else At===2?(At=0,Or(Ao),yo(pt),pt=null,ed.forEach(x=>{if(!Q)try{x(),Er()}catch(E){Ct(E)}})):Je(`invalid state: ${At}`);return mo}}function ad(i){return od(c=>{i().then(c)})}te.hb();var id=[$r,Jt,Sr,Ir,Ar,rr,Lt,nr,or,ar,ir,sr,ur,dr,lr,cr,P,N,Re,O,oe,Ce,ct,uo],sd={r:function(i,c,g){return ad(async()=>{await a.Ab(i,c,g)})},b:function(i,c,g){throw i>>>=0,new _r(i).hb(c>>>0,g>>>0),xr=i,er++,xr},N:function(i){bo(i>>>0,!I,1,!$,131072,!1),te.pb()},l:function(i){i>>>=0,v?postMessage({cmd:\"cleanupThread\",thread:i}):te.nb(te.Qa[i])},J:Cr,i:Ir,T:Ar,F:rr,H:Lt,U:nr,R:or,L:ar,Q:ir,p:sr,G:ur,D:dr,S:lr,E:cr,q:()=>1,B:function(i,c){i>>>=0,i==c>>>0?setTimeout(()=>Bt()):v?postMessage({targetThread:i,cmd:\"checkMailbox\"}):(i=te.Qa[i])&&i.postMessage({cmd:\"checkMailbox\"})},K:function(i,c,g,x){c>>>=0,d.length=g,x=x>>>0>>>3;for(var E=0;E>>0];return i=0>i?Nt[-i-1]:id[i],te.vb=c,c=i.apply(null,d),te.vb=0,c},M:It,W:function(i){C&&te.Qa[i>>>0].ref()},u:function(i,c,g){i=c+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*c:NaN,g>>>=0,i=new Date(1e3*i),n()[g>>>2>>>0]=i.getUTCSeconds(),n()[g+4>>>2>>>0]=i.getUTCMinutes(),n()[g+8>>>2>>>0]=i.getUTCHours(),n()[g+12>>>2>>>0]=i.getUTCDate(),n()[g+16>>>2>>>0]=i.getUTCMonth(),n()[g+20>>>2>>>0]=i.getUTCFullYear()-1900,n()[g+24>>>2>>>0]=i.getUTCDay(),i=(i.getTime()-Date.UTC(i.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,n()[g+28>>>2>>>0]=i},v:function(i,c,g){i=c+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*c:NaN,g>>>=0,i=new Date(1e3*i),n()[g>>>2>>>0]=i.getSeconds(),n()[g+4>>>2>>>0]=i.getMinutes(),n()[g+8>>>2>>>0]=i.getHours(),n()[g+12>>>2>>>0]=i.getDate(),n()[g+16>>>2>>>0]=i.getMonth(),n()[g+20>>>2>>>0]=i.getFullYear()-1900,n()[g+24>>>2>>>0]=i.getDay(),c=(h(i.getFullYear())?w:S)[i.getMonth()]+i.getDate()-1|0,n()[g+28>>>2>>>0]=c,n()[g+36>>>2>>>0]=-(60*i.getTimezoneOffset()),c=new Date(i.getFullYear(),6,1).getTimezoneOffset();var x=new Date(i.getFullYear(),0,1).getTimezoneOffset();i=(c!=x&&i.getTimezoneOffset()==Math.min(x,c))|0,n()[g+32>>>2>>>0]=i},w:function(i){i>>>=0;var c=new Date(n()[i+20>>>2>>>0]+1900,n()[i+16>>>2>>>0],n()[i+12>>>2>>>0],n()[i+8>>>2>>>0],n()[i+4>>>2>>>0],n()[i>>>2>>>0],0),g=n()[i+32>>>2>>>0],x=c.getTimezoneOffset(),E=new Date(c.getFullYear(),6,1).getTimezoneOffset(),k=new Date(c.getFullYear(),0,1).getTimezoneOffset(),W=Math.min(k,E);return 0>g?n()[i+32>>>2>>>0]=+(E!=k&&W==x):0>>2>>>0]=c.getDay(),g=(h(c.getFullYear())?w:S)[c.getMonth()]+c.getDate()-1|0,n()[i+28>>>2>>>0]=g,n()[i>>>2>>>0]=c.getSeconds(),n()[i+4>>>2>>>0]=c.getMinutes(),n()[i+8>>>2>>>0]=c.getHours(),n()[i+12>>>2>>>0]=c.getDate(),n()[i+16>>>2>>>0]=c.getMonth(),n()[i+20>>>2>>>0]=c.getYear(),i=c.getTime(),isNaN(i)?(n()[go()>>>2>>>0]=61,i=-1):i/=1e3,$o(($t=i,1<=+Math.abs($t)?0<$t?+Math.floor($t/4294967296)>>>0:~~+Math.ceil(($t-+(~~$t>>>0))/4294967296)>>>0:0)),i>>>0},s:P,t:N,A:function(i,c,g){function x(le){return(le=le.toTimeString().match(/\\\\(([A-Za-z ]+)\\\\)$/))?le[1]:\"GMT\"}i>>>=0,c>>>=0,g>>>=0;var E=new Date().getFullYear(),k=new Date(E,0,1),W=new Date(E,6,1);E=k.getTimezoneOffset();var Z=W.getTimezoneOffset(),ge=Math.max(E,Z);s()[i>>>2>>>0]=60*ge,n()[c>>>2>>>0]=+(E!=Z),i=x(k),c=x(W),i=K(i),c=K(c),Z>>2>>>0]=i,s()[g+4>>>2>>>0]=c):(s()[g>>>2>>>0]=c,s()[g+4>>>2>>>0]=i)},d:()=>{Je(\"\")},c:function(i,c,g){return i>>>=0,c=ae(c>>>0,g>>>0),Nt[i].apply(null,c)},k:function(i,c,g){return i>>>=0,c=ae(c>>>0,g>>>0),Nt[i].apply(null,c)},m:()=>{},j:()=>Date.now(),V:()=>{throw at+=1,\"unwind\"},C:function(){return 4294901760},f:()=>performance.timeOrigin+performance.now(),g:()=>C?(zo(),Ft(Mo)).cpus().length:navigator.hardwareConcurrency,y:function(i){i>>>=0;var c=o().length;if(i<=c||4294901760=g;g*=2){var x=c*(1+.2/g);x=Math.min(x,i+100663296);var E=Math;x=Math.max(i,x);e:{E=(E.min.call(E,4294901760,x+(65536-x%65536)%65536)-ne.buffer.byteLength+65535)/65536;try{ne.grow(E),G();var k=1;break e}catch{}k=void 0}if(k)return!0}return!1},O:Re,P:O,I:Ht,h:oe,o:Ce,x:ct,n:uo,a:ne||a.wasmMemory,z:po,e:function(i,c,g,x){return po(i>>>0,c>>>0,g>>>0,x>>>0)}},Y=function(){function i(g,x){return Y=g.exports,Y=Xu(),Y=ud(),te.qb.push(Y.Da),Qe.unshift(Y.X),ze=x,Fe(),Y}var c={a:sd};if(Le++,a.instantiateWasm)try{return a.instantiateWasm(c,i)}catch(g){we(`Module.instantiateWasm callback failed with error: ${g}`),m(g)}return St(c,function(g){i(g.instance,g.module)}).catch(m),{}}();a._OrtInit=(i,c)=>(a._OrtInit=Y.Y)(i,c),a._OrtGetLastError=(i,c)=>(a._OrtGetLastError=Y.Z)(i,c),a._OrtCreateSessionOptions=(i,c,g,x,E,k,W,Z,ge,le)=>(a._OrtCreateSessionOptions=Y._)(i,c,g,x,E,k,W,Z,ge,le),a._OrtAppendExecutionProvider=(i,c)=>(a._OrtAppendExecutionProvider=Y.$)(i,c),a._OrtAddFreeDimensionOverride=(i,c,g)=>(a._OrtAddFreeDimensionOverride=Y.aa)(i,c,g),a._OrtAddSessionConfigEntry=(i,c,g)=>(a._OrtAddSessionConfigEntry=Y.ba)(i,c,g),a._OrtReleaseSessionOptions=i=>(a._OrtReleaseSessionOptions=Y.ca)(i),a._OrtCreateSession=(i,c,g)=>(a._OrtCreateSession=Y.da)(i,c,g),a._OrtReleaseSession=i=>(a._OrtReleaseSession=Y.ea)(i),a._OrtGetInputOutputCount=(i,c,g)=>(a._OrtGetInputOutputCount=Y.fa)(i,c,g),a._OrtGetInputName=(i,c)=>(a._OrtGetInputName=Y.ga)(i,c),a._OrtGetOutputName=(i,c)=>(a._OrtGetOutputName=Y.ha)(i,c),a._OrtFree=i=>(a._OrtFree=Y.ia)(i),a._OrtCreateTensor=(i,c,g,x,E,k)=>(a._OrtCreateTensor=Y.ja)(i,c,g,x,E,k),a._OrtGetTensorData=(i,c,g,x,E)=>(a._OrtGetTensorData=Y.ka)(i,c,g,x,E),a._OrtReleaseTensor=i=>(a._OrtReleaseTensor=Y.la)(i),a._OrtCreateRunOptions=(i,c,g,x)=>(a._OrtCreateRunOptions=Y.ma)(i,c,g,x),a._OrtAddRunConfigEntry=(i,c,g)=>(a._OrtAddRunConfigEntry=Y.na)(i,c,g),a._OrtReleaseRunOptions=i=>(a._OrtReleaseRunOptions=Y.oa)(i),a._OrtCreateBinding=i=>(a._OrtCreateBinding=Y.pa)(i),a._OrtBindInput=(i,c,g)=>(a._OrtBindInput=Y.qa)(i,c,g),a._OrtBindOutput=(i,c,g,x)=>(a._OrtBindOutput=Y.ra)(i,c,g,x),a._OrtClearBoundOutputs=i=>(a._OrtClearBoundOutputs=Y.sa)(i),a._OrtReleaseBinding=i=>(a._OrtReleaseBinding=Y.ta)(i),a._OrtRunWithBinding=(i,c,g,x,E)=>(a._OrtRunWithBinding=Y.ua)(i,c,g,x,E),a._OrtRun=(i,c,g,x,E,k,W,Z)=>(a._OrtRun=Y.va)(i,c,g,x,E,k,W,Z),a._OrtEndProfiling=i=>(a._OrtEndProfiling=Y.wa)(i),a._JsepOutput=(i,c,g)=>(a._JsepOutput=Y.xa)(i,c,g),a._JsepGetNodeName=i=>(a._JsepGetNodeName=Y.ya)(i);var go=()=>(go=Y.za)(),Rr=a._pthread_self=()=>(Rr=a._pthread_self=Y.Aa)(),hn=a._malloc=i=>(hn=a._malloc=Y.Ba)(i),yo=a._free=i=>(yo=a._free=Y.Ca)(i);a.__emscripten_tls_init=()=>(a.__emscripten_tls_init=Y.Da)();var bo=a.__emscripten_thread_init=(i,c,g,x,E,k)=>(bo=a.__emscripten_thread_init=Y.Fa)(i,c,g,x,E,k);a.__emscripten_thread_crashed=()=>(a.__emscripten_thread_crashed=Y.Ga)();var wo=(i,c,g,x)=>(wo=Y.Ha)(i,c,g,x),gn=i=>(gn=Y.Ia)(i),yn=a.__emscripten_thread_exit=i=>(yn=a.__emscripten_thread_exit=Y.Ja)(i),vo=()=>(vo=Y.Ka)(),$o=i=>($o=Y.La)(i),_o=(i,c)=>(_o=Y.Ma)(i,c),bn=()=>(bn=Y.Na)(),Br=i=>(Br=Y.Oa)(i),wn=i=>(wn=Y.Pa)(i),xo=a.dynCall_ii=(i,c)=>(xo=a.dynCall_ii=Y.Ra)(i,c),So=i=>(So=Y.Sa)(i),Co=()=>(Co=Y.Ta)(),Io=i=>(Io=Y.Ua)(i),Ao=()=>(Ao=Y.Va)();a.___start_em_js=945539,a.___stop_em_js=945700;function ud(){var i=Y;i=Object.assign({},i);var c=x=>()=>x()>>>0,g=x=>E=>x(E)>>>0;return i.za=c(i.za),i.Aa=c(i.Aa),i.Ba=g(i.Ba),i.emscripten_main_runtime_thread_id=c(i.emscripten_main_runtime_thread_id),i.Na=c(i.Na),i.Pa=g(i.Pa),i}a.wasmMemory=ne,a.stackAlloc=wn,a.stackSave=bn,a.stackRestore=Br,a.keepRuntimeAlive=()=>0Uo)});var Wo=pr((mp,yd)=>{yd.exports=\\'\"use strict\";var Module={},ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\"),parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",e=>onmessage({data:e}));var fs=require(\"fs\"),vm=require(\"vm\");Object.assign(global,{self:global,require,Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:e=>vm.runInThisContext(fs.readFileSync(e,\"utf8\"),{filename:e}),postMessage:e=>parentPort.postMessage(e),performance:global.performance||{now:Date.now}})}var initializedJS=!1;function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,e+`\\\\n`);return}console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:e,threadId:Module._pthread_self()})}var err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(e,t)=>{var a=Module.wasmModule;Module.wasmModule=null;var r=new WebAssembly.Instance(a,e);return t(r)},self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{if(e.data.cmd===\"load\"){let a=[];self.onmessage=r=>a.push(r),self.startWorker=r=>{Module=r,postMessage({cmd:\"loaded\"});for(let s of a)handleMessage(s);self.onmessage=handleMessage},Module.wasmModule=e.data.wasmModule;for(const r of e.data.handlers)Module[r]=(...s)=>{postMessage({cmd:\"callHandler\",handler:r,args:s})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,typeof e.data.urlOrBlob==\"string\")importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}ortWasmThreaded(Module)}else if(e.data.cmd===\"run\"){Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.__emscripten_thread_mailbox_await(e.data.pthread_ptr),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(a){if(a!=\"unwind\")throw a}}else e.data.cmd===\"cancel\"?Module._pthread_self()&&Module.__emscripten_thread_exit(-1):e.data.target===\"setimmediate\"||(e.data.cmd===\"checkMailbox\"?initializedJS&&Module.checkMailbox():e.data.cmd&&(err(`worker.js received unknown command ${e.data.cmd}`),err(e.data)))}catch(a){throw Module.__emscripten_thread_crashed?.(),a}}self.onmessage=handleMessage;\\\\n\\'});var En,Tt,fr,Ur,hr,Ko,Pn,ie=q(()=>{\"use strict\";En=e=>{switch(e){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float16\":return 10;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${e}`)}},Tt=e=>{switch(e){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 10:return\"float16\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${e}`)}},fr=e=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][e],Ur=e=>{switch(e){case\"float16\":return typeof Float16Array<\"u\"&&Float16Array.from?Float16Array:Uint16Array;case\"float32\":return Float32Array;case\"uint8\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"bool\":return Uint8Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},hr=e=>{switch(e){case\"verbose\":return 0;case\"info\":return 1;case\"warning\":return 2;case\"error\":return 3;case\"fatal\":return 4;default:throw new Error(`unsupported logging level: ${e}`)}},Ko=e=>e===\"float32\"||e===\"float16\"||e===\"int32\"||e===\"int64\"||e===\"uint32\"||e===\"uint8\"||e===\"bool\",Pn=e=>{switch(e){case\"none\":return 0;case\"cpu\":return 1;case\"cpu-pinned\":return 2;case\"texture\":return 3;case\"gpu-buffer\":return 4;default:throw new Error(`unsupported data location: ${e}`)}}});var Vr=q(()=>{\"use strict\"});var Yo=q(()=>{\"use strict\";Vr()});var Zo,Qo=q(()=>{\"use strict\";Zo=\"1.17.3\"});var Xo,rt,On=q(()=>{\"use strict\";Qo();Xo=\"warning\",rt={wasm:{},webgl:{},webgpu:{},versions:{common:Zo},set logLevel(e){if(e!==void 0){if(typeof e!=\"string\"||[\"verbose\",\"info\",\"warning\",\"error\",\"fatal\"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);Xo=e}},get logLevel(){return Xo}};Object.defineProperty(rt,\"logLevel\",{enumerable:!0})});var qt,Jo=q(()=>{\"use strict\";On();qt=rt});var ea=q(()=>{\"use strict\"});var ta=q(()=>{\"use strict\";Nr()});var na=q(()=>{\"use strict\"});var oa=q(()=>{\"use strict\";Nr()});var Nr=q(()=>{\"use strict\";ea();ta();na();oa()});var Wr=q(()=>{\"use strict\";Nr()});var kn,aa,Mt,Et,Rn=q(()=>{\"use strict\";On();kn=(e,t)=>{(typeof rt.trace>\"u\"?!rt.wasm.trace:!rt.trace)||console.timeStamp(`${e}::ORT::${t}`)},aa=(e,t)=>{let r=new Error().stack?.split(/\\\\r\\\\n|\\\\r|\\\\n/g)||[],o=!1;for(let n=0;n{(typeof rt.trace>\"u\"?!rt.wasm.trace:!rt.trace)||aa(\"BEGIN\",e)},Et=e=>{(typeof rt.trace>\"u\"?!rt.wasm.trace:!rt.trace)||aa(\"END\",e)}});var ia=q(()=>{\"use strict\";Vr();Wr();Rn()});var sa=q(()=>{\"use strict\";ia()});var ua=q(()=>{\"use strict\"});var da=q(()=>{\"use strict\"});var la=q(()=>{\"use strict\"});var ca=q(()=>{\"use strict\"});var pa=q(()=>{\"use strict\";Vr();Wr()});var ma=q(()=>{\"use strict\";pa()});var Kt=q(()=>{\"use strict\";Yo();Jo();sa();Wr();ua();da();Rn();la();ca();ma()});var Td,Ed,fa,ha,ga,Pd,De,Pt=q(()=>{\"use strict\";ie();Td=[\"V\",\"I\",\"W\",\"E\",\"F\"],Ed=(e,t)=>{console.log(`[${Td[e]},${new Date().toISOString()}]${t}`)},ga=(e,t)=>{fa=e,ha=t},Pd=(e,t)=>{let r=hr(e),o=hr(fa);r>=o&&Ed(r,typeof t==\"function\"?t():t)},De=(...e)=>{ha&&Pd(...e)}});var ya,ba=q(()=>{\"use strict\";ie();ya=(e,t)=>new(Ur(t))(e)});var Gr=q(()=>{\"use strict\"});var Hr,Od,wa,Dn,Bn,$a,_a=q(()=>{\"use strict\";Pt();Gr();Hr=e=>Math.ceil(e/16)*16,Od=1,wa=()=>Od++,Dn=async(e,t,r,o)=>{let n=Hr(r),s=e.device.createBuffer({size:n,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let u=e.getCommandEncoder();e.endComputePass(),u.copyBufferToBuffer(t,0,s,0,n),e.flush(),await s.mapAsync(GPUMapMode.READ);let l=s.getMappedRange();if(o){let a=o();return a.set(new Uint8Array(l,0,r)),a}else return new Uint8Array(l.slice(0,r))}finally{s.destroy()}},Bn=class{constructor(t){this.backend=t;this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersForUploadingPending=[],this.buffersPending=[],this.externalBuffers=new Map,this.capturedPendingBuffers=new Map}upload(t,r){let o=r.buffer,n=r.byteOffset,s=r.byteLength,u=Hr(s),l=this.storageCache.get(t);if(!l)throw new Error(\"gpu data for uploading does not exist\");if(l.originalSize!==s)throw new Error(`inconsistent data size. gpu data size=${l.originalSize}, data size=${s}`);let a=this.backend.device.createBuffer({mappedAtCreation:!0,size:u,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),p=a.getMappedRange();new Uint8Array(p).set(new Uint8Array(o,n,s)),a.unmap();let m=this.backend.getCommandEncoder();this.backend.endComputePass(),m.copyBufferToBuffer(a,0,l.gpuData.buffer,0,u),De(\"verbose\",()=>`[WebGPU] GpuDataManager.upload(id=${t})`),this.buffersForUploadingPending.push(a)}memcpy(t,r){let o=this.storageCache.get(t);if(!o)throw new Error(\"source gpu data for memcpy does not exist\");let n=this.storageCache.get(r);if(!n)throw new Error(\"destination gpu data for memcpy does not exist\");if(o.originalSize!==n.originalSize)throw new Error(\"inconsistent source and destination gpu data size\");let s=Hr(o.originalSize),u=this.backend.getCommandEncoder();this.backend.endComputePass(),u.copyBufferToBuffer(o.gpuData.buffer,0,n.gpuData.buffer,0,s)}registerExternalBuffer(t,r,o){let n;if(o){if(n=this.externalBuffers.get(o),n===void 0)throw new Error(\"previous buffer is not registered\");if(t===o)return De(\"verbose\",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${n}, buffer is the same, skip.`),n;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet.\\n Please use the previous external buffer!`);this.externalBuffers.delete(o)}else n=wa();return this.storageCache.set(n,{gpuData:{id:n,type:0,buffer:t},originalSize:r}),this.externalBuffers.set(t,n),De(\"verbose\",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${n}, registered.`),n}unregisterExternalBuffer(t){let r=this.externalBuffers.get(t);r!==void 0&&(this.storageCache.delete(r),this.externalBuffers.delete(t),De(\"verbose\",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${r}`))}create(t,r=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let o=Hr(t),n,s=(r&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,u=(r&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(s||u){let a=s?this.freeBuffers:this.freeUniformBuffers,p=a.get(o);p||(p=[],a.set(o,p)),p.length>0?n=p.pop():n=this.backend.device.createBuffer({size:o,usage:r})}else n=this.backend.device.createBuffer({size:o,usage:r});let l={id:wa(),type:0,buffer:n};return this.storageCache.set(l.id,{gpuData:l,originalSize:t}),De(\"verbose\",()=>`[WebGPU] GpuDataManager.create(size=${t}) => id=${l.id}`),l}get(t){return this.storageCache.get(t)?.gpuData}release(t){let r=this.storageCache.get(t);if(!r)throw new Error(\"releasing data does not exist\");return De(\"verbose\",()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${r.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(r.gpuData.buffer),r.originalSize}async download(t,r){let o=this.storageCache.get(t);if(!o)throw new Error(\"data does not exist\");await Dn(this.backend,o.gpuData.buffer,o.originalSize,r)}refreshPendingBuffers(){for(let t of this.buffersForUploadingPending)t.destroy();if(this.buffersForUploadingPending=[],this.buffersPending.length!==0)if(this.backend.sessionStatus===\"default\"){for(let t of this.buffersPending)(t.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE?this.freeBuffers.get(t.size).push(t):(t.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM?this.freeUniformBuffers.get(t.size).push(t):t.destroy();this.buffersPending=[]}else{let t=this.capturedPendingBuffers.get(this.backend.currentSessionId);t||(t=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,t));for(let r of this.buffersPending)t.push(r);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(t=>{t.forEach(r=>{r.destroy()})}),this.freeUniformBuffers.forEach(t=>{t.forEach(r=>{r.destroy()})}),this.storageCache.forEach(t=>{t.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(t=>{t.forEach(r=>{r.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onReleaseSession(t){let r=this.capturedPendingBuffers.get(t);r&&(r.forEach(o=>{o.destroy()}),this.capturedPendingBuffers.delete(t))}},$a=(...e)=>new Bn(...e)});var Mn,$e,je=q(()=>{\"use strict\";Mn=class{constructor(t){Object.assign(this,t)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(t=>`${this[t]}`).join(\";\")),this.key}},$e=e=>new Mn(e)});var zn,mt,z,zt,Lr,Fr,qr,_e=q(()=>{\"use strict\";zn=class{static calcMatMulShape(t,r){return t[1]!==r[0]?void 0:[t[0],r[1]]}},mt=class{static calcShape(t,r,o=!1){let n=t.length,s=r.length;if(n===0)return r;if(s===0)return t;let u=Math.max(t.length,r.length),l=new Array(u);if(o){if(n<2||s<2)return;let a=zn.calcMatMulShape([t[n-2],t[n-1]],[r[s-2],r[s-1]]);if(a===void 0)return;[l[u-2],l[u-1]]=a}for(let a=o?3:1;a<=u;a++){let p=n-a<0?1:t[n-a],m=s-a<0?1:r[s-a];if(p!==m&&p>1&&m>1)return;let f=Math.max(p,m);if(p&&m)l[u-a]=Math.max(p,m);else{if(f>1)return;l[u-a]=0}}return l}static isValidBroadcast(t,r){let o=t.length,n=r.length;if(o>n)return!1;for(let s=1;s<=o;s++)if(t[o-s]!==1&&t[o-s]!==r[n-s])return!1;return!0}},z=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(t,r=4){let o=t.length;if(o===0)return[];let n=new Array(o),s=o-1;for(;s>=0;){if(t[s]%r===0){n[s]=t[s]/r;break}if(r%t[s]!==0)throw new Error(\"cannot convert shape\");n[s]=1,r/=t[s],s--}for(s--;s>=0;s--)n[s]=t[s];return n}static sizeFromDimension(t,r){if(r<0||r>t.length)throw new Error(`invalid dimension of ${r} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,r,t.length)}static sizeToDimension(t,r){if(r<0||r>t.length)throw new Error(`invalid dimension of ${r} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,r)}static getSizeFromDimensionRange(t,r,o){let n=1;for(let s=r;s=0;--n)o[n]=o[n+1]*t[n+1];return o}static normalizeAxis(t,r){if(t<-r&&t>=r)throw new Error(\"unsupported axis for this operation.\");return t<0?t+r:t}static normalizeAxes(t,r){return t.map(o=>this.normalizeAxis(o,r??t.length))}static sortBasedOnPerm(t,r){return r?r.map(o=>t[o]):t.slice().reverse()}static padShape(t,r){let o=t.length;return t.map((n,s)=>n+r[s]+r[s+o])}static areEqual(t,r){return t.length!==r.length?!1:t.every((o,n)=>o===r[n])}},zt=class e{static adjustPoolAttributes(t,r,o,n,s,u){if(!t&&o.length!==r.length-2)throw new Error(\"length of specified kernel shapes should be 2 less than length of input dimensions\");if(t)for(let l=0;l=o.length?o.push(r[l+2]):o[l]=r[l+2];for(let l=0;l=o[l]||u[l+o.length]>=o[l])throw new Error(\"pads should be smaller than kernel\")}}static adjustPadsBasedOnAutoPad(t,r,o,n,s,u,l){if(l){if(s.length!==2*(t.length-2))throw new Error(\"length of pads should be twice the length of data dimensions\");if(r.length!==t.length-2)throw new Error(\"length of strides should be the length of data dimensions\");if(n.length!==t.length-2)throw new Error(\"length of kernel shapes should be the length of data dimensions\");for(let a=0;a{\"use strict\";ie();_e();Kr=64,Vn=(e,t)=>{if(t===3)throw new Error(\"vec3 has same alignment as vec4, use vec4 instead\");switch(e){case 10:return t>1?`vec${t}`:\"f16\";case 1:return t>1?`vec${t}`:\"f32\";case 6:return t>1?`vec${t}`:\"i32\";case 12:return t>1?`vec${t}`:\"u32\";case 7:if(t>1)throw new Error(\"currently not supported vecX of uint64 yet\");return[\"vec2\",\"i32\"];case 13:if(t>1)throw new Error(\"currently not supported vecX of uint64 yet\");return[\"vec2\",\"u32\"];case 9:if(t!==4)throw new Error(\"bool must be vec4\");return[\"u32\",\"vec4\"];default:throw new Error(`Unknown data type: ${e}`)}},Pe=(e,t=1)=>{let r=Vn(e,t);return typeof r==\"string\"?r:r[0]},et=(e,t=1)=>{let r=Vn(e,t);return typeof r==\"string\"?r:r[1]},j=(...e)=>{let t=[];return e.forEach(r=>{r.length!==0&&t.push({type:12,data:r},{type:12,data:z.computeStrides(r)})}),t},Me=e=>e%4===0?4:e%2===0?2:1,Ye=(e=\"f32\",t,r=\"0\")=>!t||t===1?`${e}(${r})`:`vec${t}<${e}>(${r})`,st=(e,t,r)=>e===\"f32\"?r:t===1?`f32(${r})`:`vec${t}f(${r})`,tt=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,re=(e,t,r,o)=>e.startsWith(\"uniforms.\")&&r>4?typeof t==\"string\"?o===\"f16\"?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:o===\"f16\"?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:r>1?`${e}[${t}]`:e,Nn=(e,t,r,o,n)=>{let s=typeof r==\"number\",u=s?r:r.length,l=[...new Array(u).keys()],a=u<2?\"u32\":u<=4?`vec${u}`:`array`,p=Vn(t,n),m=typeof p==\"string\"?p:p[1],f=typeof p==\"string\"?p:p[0],b={indices:a,value:m,storage:f,tensor:t},_=G=>typeof G==\"string\"?G:`${G}u`,y={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},$=s?\"uniforms.\":\"\",I=`${$}${e}_shape`,C=`${$}${e}_strides`,v=\"\";for(let G=0;G ${b.indices} {\\n var indices: ${b.indices};\\n var current = offset;\\n ${v}\\n return indices;\\n }`,T=G=>(y.offsetToIndices=!0,u<2?G:`o2i_${e}(${G})`),D=[];if(u>=2)for(let G=u-1;G>=0;G--)D.push(`${re(C,G,u)} * (indices[${G}])`);let U=u<2?\"\":`\\n fn i2o_${e}(indices: ${b.indices}) -> u32 {\\n return ${D.join(\"+\")};\\n }`,V=G=>(y.indicesToOffset=!0,u<2?G:`i2o_${e}(${G})`),H=(...G)=>u===0?\"0u\":`${b.indices}(${G.map(_).join(\",\")})`,R=(G,J)=>u<2?`${G}`:`${re(G,J,u)}`,L=(G,J,Se)=>u<2?`${G}=${Se};`:`${re(G,J,u)}=${Se};`,pe={},Ie=(G,J)=>{y.broadcastedIndicesToOffset=!0;let Se=`${J.name}broadcastedIndicesTo${e}Offset`;if(Se in pe)return`${Se}(${G})`;let Qe=[];for(let Xe=u-1;Xe>=0;Xe--){let Le=J.indicesGet(\"outputIndices\",Xe+J.rank-u);Qe.push(`${R(C,Xe)} * (${Le} % ${R(I,Xe)})`)}return pe[Se]=`fn ${Se}(outputIndices: ${J.type.indices}) -> u32 {\\n return ${Qe.length>0?Qe.join(\"+\"):\"0u\"};\\n }`,`${Se}(${G})`},we=(G,J)=>(()=>{if(b.storage===b.value)return`${e}[${G}]=${J};`;if(b.storage===\"vec2\"&&b.value===\"i32\")return`${e}[${G}]=vec2(u32(${J}), select(0u, 0xFFFFFFFFu, ${J} < 0));`;if(b.storage===\"vec2\"&&b.value===\"u32\")return`${e}[${G}]=vec2(u32(${J}), 0u);`;if(b.storage===\"u32\"&&b.value===\"vec4\")return`${e}[${G}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${J}));`;throw new Error(`not supported combination of storage type ${b.storage} and value type ${b.value} yet`)})(),ne=G=>(()=>{if(b.storage===b.value)return`${e}[${G}]`;if(b.storage===\"vec2\"&&b.value===\"i32\")return`i32(${e}[${G}].x)`;if(b.storage===\"vec2\"&&b.value===\"u32\")return`u32(${e}[${G}].x)`;if(b.storage===\"u32\"&&b.value===\"vec4\")return`vec4(bool(${e}[${G}] & 0xFFu), bool(${e}[${G}] & 0xFF00u), bool(${e}[${G}] & 0xFF0000u), bool(${e}[${G}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${b.storage} and value type ${b.value} yet`)})(),ze=u<2?\"\":`\\n fn get_${e}ByIndices(indices: ${b.indices}) -> ${m} {\\n return ${ne(`i2o_${e}(indices)`)};\\n }`,Q=u<2?\"\":(()=>{let G=l.map(Se=>`d${Se}: u32`).join(\", \"),J=l.map(Se=>`d${Se}`).join(\", \");return`\\n fn get_${e}(${G}) -> ${m} {\\n return get_${e}ByIndices(${H(J)});\\n }`})(),xe=(...G)=>{if(G.length!==u)throw new Error(`indices length must be ${u}`);let J=G.map(_).join(\",\");return u===0?ne(\"0u\"):u===1?ne(J[0]):(y.get=!0,y.getByIndices=!0,y.indicesToOffset=!0,`get_${e}(${J})`)},me=G=>u<2?ne(G):(y.getByIndices=!0,y.indicesToOffset=!0,`get_${e}ByIndices(${G})`),ue=u<2?\"\":`\\n fn set_${e}ByIndices(indices: ${b.indices}, value: ${m}) {\\n ${we(`i2o_${e}(indices)`,\"value\")}\\n }`,se=u<2?\"\":(()=>{let G=l.map(Se=>`d${Se}: u32`).join(\", \"),J=l.map(Se=>`d${Se}`).join(\", \");return`\\n fn set_${e}(${G}, value: ${m}) {\\n set_${e}ByIndices(${H(J)}, value);\\n }`})();return{impl:()=>{let G=[],J=!1;return y.offsetToIndices&&(G.push(A),J=!0),y.indicesToOffset&&(G.push(U),J=!0),y.broadcastedIndicesToOffset&&(Object.values(pe).forEach(Se=>G.push(Se)),J=!0),y.set&&(G.push(se),J=!0),y.setByIndices&&(G.push(ue),J=!0),y.get&&(G.push(Q),J=!0),y.getByIndices&&(G.push(ze),J=!0),!s&&J&&G.unshift(`const ${I} = ${b.indices}(${r.join(\",\")});`,`const ${C} = ${b.indices}(${z.computeStrides(r).join(\",\")});`),G.join(`\\n`)},type:b,offsetToIndices:T,indicesToOffset:V,broadcastedIndicesToOffset:Ie,indices:H,indicesGet:R,indicesSet:L,set:(...G)=>{if(G.length!==u+1)throw new Error(`indices length must be ${u}`);let J=G[u];if(typeof J!=\"string\")throw new Error(\"value must be string\");let Se=G.slice(0,u).map(_).join(\",\");return u===0?we(\"0u\",J):u===1?we(Se[0],J):(y.set=!0,y.setByIndices=!0,y.indicesToOffset=!0,`set_${e}(${Se}, ${J})`)},setByOffset:we,setByIndices:(G,J)=>u<2?we(G,J):(y.setByIndices=!0,y.indicesToOffset=!0,`set_${e}ByIndices(${G}, ${J});`),get:xe,getByOffset:ne,getByIndices:me,usage:o,name:e,strides:C,shape:I,rank:u}},M=(e,t,r,o=1)=>Nn(e,t,r,\"input\",o),F=(e,t,r,o=1)=>Nn(e,t,r,\"output\",o),jr=(e,t,r,o=1)=>Nn(e,t,r,\"internal\",o),Un=class{constructor(t){this.normalizedDispatchGroup=t;this.internalVariables=[];this.variables=[];this.uniforms=[];this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(t){return`if (global_idx >= ${typeof t==\"number\"?`${t}u`:t}) { return; }`}mainStart(t=Kr){let r=typeof t==\"number\"?t:t[0],o=typeof t==\"number\"?1:t[1],n=typeof t==\"number\"?1:t[2],s=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,u=s?`@builtin(global_invocation_id) global_id : vec3,\\n @builtin(workgroup_id) workgroup_id : vec3,\\n @builtin(local_invocation_id) local_id : vec3`:`@builtin(local_invocation_id) local_id : vec3,\\n @builtin(local_invocation_index) local_idx : u32,\\n @builtin(workgroup_id) workgroup_id : vec3,\\n @builtin(num_workgroups) num_workgroups : vec3`,l=s?\"let global_idx = global_id.x; let local_idx = local_id.x;\":`let global_idx = (workgroup_id.z * num_workgroups[0] * num_workgroups[1] +\\n workgroup_id.y * num_workgroups[0] + workgroup_id.x) * ${r*o*n}u + local_idx;`;return`@compute @workgroup_size(${r}, ${o}, ${n})\\n fn main(${u}) {\\n ${l}\\n `}appendVariableUniforms(t){t.rank!==0&&(t.shape.startsWith(\"uniforms.\")&&this.uniforms.push({name:t.shape.replace(\"uniforms.\",\"\"),type:\"u32\",length:t.rank}),t.strides.startsWith(\"uniforms.\")&&this.uniforms.push({name:t.strides.replace(\"uniforms.\",\"\"),type:\"u32\",length:t.rank}))}declareVariable(t,r){if(t.usage===\"internal\")throw new Error(\"cannot use internal variable with declareVariable(). use registerInternalVariables() instead.\");this.variables.push(t),this.appendVariableUniforms(t);let o=t.usage===\"input\"?\"read\":\"read_write\",n=t.type.storage;return`@group(0) @binding(${r}) var ${t.name}: array<${n}>;`}declareVariables(...t){return t.map(r=>this.declareVariable(r,this.variableIndex++)).join(`\\n`)}registerInternalVariable(t){if(t.usage!==\"internal\")throw new Error(\"cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.\");this.internalVariables.push(t),this.appendVariableUniforms(t)}registerInternalVariables(...t){return t.forEach(r=>this.registerInternalVariable(r)),this}registerUniform(t,r,o=1){return this.uniforms.push({name:t,type:r,length:o}),this}registerUniforms(t){return this.uniforms=this.uniforms.concat(t),this}uniformDeclaration(){if(this.uniforms.length===0)return\"\";let t=[];for(let{name:r,type:o,length:n}of this.uniforms)if(n&&n>4)o===\"f16\"?t.push(`@align(16) ${r}:array, ${Math.ceil(n/8)}>`):t.push(`${r}:array, ${Math.ceil(n/4)}>`);else{let s=n==null||n===1?o:`vec${n}<${o}>`;t.push(`${r}:${s}`)}return`\\n struct Uniforms { ${t.join(\", \")} };\\n @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(t=>t.impl()).join(`\\n`)+this.internalVariables.map(t=>t.impl()).join(`\\n`)}},xa=e=>new Un(e),jt=(e,t)=>{let r=e.length,o=[];for(let n=0;n1&&u===1&&o.unshift(s)}return o}});var kd,Sa,Rd,Bd,ot,Ca,Ia,Yt=q(()=>{\"use strict\";ie();_e();je();be();kd=e=>{if(!e||e.length!==1)throw new Error(\"Transpose requires 1 input.\")},Sa=(e,t)=>t&&t.length!==e?[...new Array(e).keys()].reverse():t,Rd=(e,t)=>z.sortBasedOnPerm(e,Sa(e.length,t)),Bd=(e,t,r,o)=>{let n=[];n.push(`fn perm(i: ${o.type.indices}) -> ${r.type.indices} {\\n var a: ${r.type.indices};`);for(let s=0;s{let r=e.dataType,o=e.dims.length,n=Sa(o,t),s=Rd(e.dims,n),u=F(\"output\",r,s.length),l=M(\"a\",r,o),a=p=>`\\n ${p.registerUniform(\"output_size\",\"u32\").declareVariables(l,u)}\\n\\n ${Bd(n,o,l,u)}\\n\\n ${p.mainStart()}\\n ${p.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n\\n let indices = ${u.offsetToIndices(\"global_idx\")};\\n let aIndices = perm(indices);\\n\\n ${u.setByOffset(\"global_idx\",l.getByIndices(\"aIndices\"))}\\n }`;return{name:\"Transpose\",shaderCache:{hint:`${t}`,inputDependencies:[\"rank\"]},getRunData:p=>{let m=z.size(s);return{outputs:[{dims:s,dataType:p[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...j(p[0].dims,s)]}},getShaderSource:a}},Ca=(e,t)=>{kd(e.inputs),e.compute(ot(e.inputs[0],t.perm))},Ia=e=>$e({perm:e.perm})});var Dd,Md,zd,Ud,Vd,Nd,Wd,Gd,Hd,Ld,ft,Aa,Ta,Ea,Pa,Oa,ka,Ra,Ba,Da,Ma,za=q(()=>{\"use strict\";ie();_e();be();Yr();Yt();Dd={max:\"select(bestValue, candidate, candidate > bestValue)\",min:\"select(bestValue, candidate, candidate < bestValue)\",mean:\"bestValue + candidate\",sum:\"bestValue + candidate\",prod:\"bestValue * candidate\",sumSquare:\"bestValue + candidate * candidate\",logSumExp:\"bestValue + exp(candidate)\",l1:\"bestValue + abs(candidate)\",l2:\"bestValue + candidate * candidate\",logSum:\"bestValue + candidate\"},Md={max:\"select(bestValue, candidate, candidate > bestValue)\",min:\"select(bestValue, candidate, candidate < bestValue)\",mean:\"bestValue + candidate\",sum:\"bestValue + candidate\",prod:\"bestValue * candidate\",sumSquare:\"bestValue + candidate\",logSumExp:\"bestValue + candidate\",l1:\"bestValue + candidate\",l2:\"bestValue + candidate\",logSum:\"bestValue + candidate\"},zd={max:\"_A[offset]\",min:\"_A[offset]\",mean:\"0\",sum:\"0\",prod:\"1\",sumSquare:\"0\",logSumExp:\"0\",l1:\"0\",l2:\"0\",logSum:\"0\"},Ud={max:\"bestValue\",min:\"bestValue\",sum:\"bestValue\",prod:\"bestValue\",sumSquare:\"bestValue\",logSumExp:\"log(bestValue)\",l1:\"bestValue\",l2:\"sqrt(bestValue)\",logSum:\"log(bestValue)\"},Vd=(e,t)=>{let r=[];for(let o=t-e;o{let r=[],o=e.length;for(let s=0;se[s]);return[r,n]},Wd=(e,t)=>{let r=e.length+t.length,o=[],n=0;for(let s=0;s{for(let r=0;r{let r=[];if(!Gd(e,t)){for(let o=0;or.push(o))}return r},Ld=(e,t,r,o,n,s,u)=>{let l=r[0].dims,a=z.size(s),p=z.size(u),m=M(\"_A\",r[0].dataType,l),f=F(\"output\",n,s),b=32,_=`\\n var aBestValues : array;\\n `;return{name:e,shaderCache:t,getShaderSource:$=>`\\n ${$.registerUniform(\"reduceSize\",\"u32\").declareVariables(m,f)}\\n ${_}\\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\\n return ((a - 1u) / b + 1u);\\n }\\n ${$.mainStart(b)}\\n\\n let outputIndex = global_idx / ${b};\\n let offset = outputIndex * uniforms.reduceSize;\\n\\n var bestValue = f32(${zd[o]});\\n let Length = uniforms.reduceSize;\\n for (var k = local_idx; k < Length; k = k + ${b}) {\\n let candidate = f32(${m.getByOffset(\"offset + k\")});\\n bestValue = ${Dd[o]};\\n }\\n aBestValues[local_idx] = bestValue;\\n workgroupBarrier();\\n\\n var reduceSize = min(Length, ${b}u);\\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\\n currentSize = reduceSize / 2u) {\\n let interval = DIV_CEIL(reduceSize, 2u);\\n if (local_idx < currentSize) {\\n let candidate = aBestValues[local_idx + interval];\\n bestValue = ${Md[o]};\\n aBestValues[local_idx] = bestValue;\\n }\\n reduceSize = interval;\\n workgroupBarrier();\\n }\\n\\n if (local_idx == 0u) {\\n ${f.setByOffset(\"outputIndex\",`${o===\"mean\"?`${f.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${f.type.storage}(${Ud[o]})`}`)};\\n }\\n }`,getRunData:()=>({outputs:[{dims:s,dataType:n}],dispatchGroup:{x:a},programUniforms:[{type:12,data:p}]})}},ft=(e,t,r,o)=>{let n=e.inputs.length===1?r:Wn(e.inputs,r),s=n.axes;s.length===0&&!n.noopWithEmptyAxes&&(s=e.inputs[0].dims.map((_,y)=>y));let u=z.normalizeAxes(s,e.inputs[0].dims.length),l=u,a=e.inputs[0],p=Hd(l,e.inputs[0].dims.length);p.length>0&&(a=e.compute(ot(e.inputs[0],p),{inputs:[0],outputs:[-1]})[0],l=Vd(l.length,a.dims.length));let[m,f]=Nd(a.dims,l),b=m;n.keepDims&&(b=Wd(m,u)),e.compute(Ld(t,{hint:n.cacheKey,inputDependencies:[\"type\"]},[a],o,e.inputs[0].dataType,b,f),{inputs:[a]})},Aa=(e,t)=>{ft(e,\"ReduceMeanShared\",t,\"mean\")},Ta=(e,t)=>{ft(e,\"ReduceL1Shared\",t,\"l1\")},Ea=(e,t)=>{ft(e,\"ReduceL2Shared\",t,\"l2\")},Pa=(e,t)=>{ft(e,\"ReduceLogSumExpShared\",t,\"logSumExp\")},Oa=(e,t)=>{ft(e,\"ReduceMaxShared\",t,\"max\")},ka=(e,t)=>{ft(e,\"ReduceMinShared\",t,\"min\")},Ra=(e,t)=>{ft(e,\"ReduceProdShared\",t,\"prod\")},Ba=(e,t)=>{ft(e,\"ReduceSumShared\",t,\"sum\")},Da=(e,t)=>{ft(e,\"ReduceSumSquareShared\",t,\"sumSquare\")},Ma=(e,t)=>{ft(e,\"ReduceLogSumShared\",t,\"logSum\")}});var ht,Fd,Zr,Wn,gt,qd,Kd,jd,Yd,Zd,Qd,Xd,Jd,el,tl,yt,Ua,Va,Na,Wa,Ga,Ha,La,Fa,qa,Ka,Yr=q(()=>{\"use strict\";ie();_e();je();be();za();ht=e=>{if(!e||e.length===0||e.length>2)throw new Error(\"Reduce op requires 1 or 2 inputs.\");if(e.length===2&&e[1].dims.length!==1)throw new Error(\"Invalid axes input dims.\")},Fd=e=>[\"\",\"\",`var value = ${e.getByIndices(\"input_indices\")};`,\"\"],Zr=(e,t,r,o,n,s,u=!1,l=!1)=>{let a=[],p=r[0].dims,m=p.length,f=z.normalizeAxes(n,m),b=!l&&f.length===0;p.forEach((I,C)=>{b||f.indexOf(C)>=0?u&&a.push(1):a.push(I)});let _=a.length,y=z.size(a);return{name:e,shaderCache:t,getShaderSource:I=>{let C=[],v=M(\"_A\",r[0].dataType,m),A=F(\"output\",s,_),T=o(v,A,f),D=T[2];for(let U=0,V=0;U=0?(u&&V++,D=`for(var j${U}: u32 = 0; j${U} < ${p[U]}; j${U}++) {\\n ${T[2].includes(\"last_index\")?`let last_index = j${U};`:\"\"}\\n ${v.indicesSet(\"input_indices\",U,`j${U}`)}\\n ${D}\\n }`):(C.push(`${v.indicesSet(\"input_indices\",U,A.indicesGet(\"output_indices\",V))};`),V++);return`\\n\\n ${I.registerUniform(\"output_size\",\"u32\").declareVariables(v,A)}\\n\\n ${I.mainStart()}\\n ${I.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n var input_indices: ${v.type.indices};\\n let output_indices = ${A.offsetToIndices(\"global_idx\")};\\n\\n ${C.join(`\\n`)}\\n ${T[0]} // init ops for reduce max/min\\n ${T[1]}\\n ${D}\\n ${T[3]}\\n ${T.length===4?A.setByOffset(\"global_idx\",\"value\"):T.slice(4).join(`\\n`)}\\n }`},getRunData:()=>({outputs:[{dims:a,dataType:s}],dispatchGroup:{x:Math.ceil(y/64)},programUniforms:[{type:12,data:y},...j(p,a)]})}},Wn=(e,t)=>{let r=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(o=>r.push(Number(o))),$e({axes:r,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},gt=(e,t,r,o)=>{let n=e.inputs,s=n.length===1?r:Wn(n,r);e.compute(Zr(t,{hint:s.cacheKey,inputDependencies:[\"rank\"]},[n[0]],s.noopWithEmptyAxes&&s.axes.length===0?Fd:o,s.axes,n[0].dataType,s.keepDims,s.noopWithEmptyAxes),{inputs:[0]})},qd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceLogSum\",t,(o,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += ${o.getByIndices(\"input_indices\")};`,\"value = log(value);\"])},Kd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceL1\",t,(o,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += abs(${o.getByIndices(\"input_indices\")});`,\"\"])},jd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceL2\",t,(o,n)=>[`var t = ${n.type.value}(0); var value = ${n.type.value}(0);`,\"\",`t = ${o.getByIndices(\"input_indices\")}; value += (t * t);`,\"value = sqrt(value);\"])},Yd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceLogSumExp\",t,(o,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += exp(${o.getByIndices(\"input_indices\")});`,\"value = log(value);\"])},Zd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceMax\",t,(o,n,s)=>{let u=[];for(let l=0;l=0||s.length===0)&&u.push(o.indicesSet(\"input_indices\",l,0));return[`${u.join(`\\n`)}`,`var value = ${o.getByIndices(\"input_indices\")};`,`value = max(value, ${o.getByIndices(\"input_indices\")});`,\"\"]})},Qd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceMean\",t,(o,n,s)=>{let u=1;for(let l=0;l=0||s.length===0)&&(u*=e.inputs[0].dims[l]);return[\"var sum = f32(0);\",\"\",`sum += f32(${o.getByIndices(\"input_indices\")});`,`let value = ${n.type.value}(sum / ${u});`]})},Xd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceMin\",t,(o,n,s)=>{let u=[];for(let l=0;l=0||s.length===0)&&u.push(`input_indices[${l}] = 0;`);return[`${u.join(`\\n`)}`,`var value = ${o.getByIndices(\"input_indices\")};`,`value = min(value, ${o.getByIndices(\"input_indices\")});`,\"\"]})},Jd=(e,t)=>{ht(e.inputs),gt(e,\"ReduceProd\",t,(o,n)=>[`var value = ${n.type.storage}(1);`,\"\",`value *= ${o.getByIndices(\"input_indices\")};`,\"\"])},el=(e,t)=>{ht(e.inputs),gt(e,\"ReduceSum\",t,(o,n)=>[`var value = ${n.type.storage}(0);`,\"\",`value += ${o.getByIndices(\"input_indices\")};`,\"\"])},tl=(e,t)=>{ht(e.inputs),gt(e,\"ReduceSumSquare\",t,(o,n)=>[`var t = ${n.type.value}(0); var value = ${n.type.value}(0);`,\"\",`t = ${o.getByIndices(\"input_indices\")}; value += t * t;`,\"\"])},yt=(e,t,r)=>{if(t.length===0)return r;let o=1,n=1;for(let s=0;s1024},Ua=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qd(e,t):Aa(e,t)},Va=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Kd(e,t):Ta(e,t)},Na=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?jd(e,t):Ea(e,t)},Wa=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yd(e,t):Pa(e,t)},Ga=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zd(e,t):Oa(e,t)},Ha=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xd(e,t):ka(e,t)},La=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jd(e,t):Ra(e,t)},Fa=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?el(e,t):Ba(e,t)},qa=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?tl(e,t):Da(e,t)},Ka=(e,t)=>{yt(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?qd(e,t):Ma(e,t)}});var ja,Ya,Za,Gn,Qa=q(()=>{\"use strict\";ie();je();Yr();ja=e=>{if(!e||e.length===0||e.length>2)throw new Error(\"ArgMinMaxOp op requires 1 or 2 inputs.\");if(e[0].dataType!==1)throw new Error(\"Invalid input type.\")},Ya=(e,t)=>{ja(e.inputs);let r=(o,n,s)=>{let u=[];for(let l=0;l=0||s.length===0)&&u.push(`input_indices[${l}] = 0;`);return[`${u.join(`\\n`)}`,`var value = ${o.getByIndices(\"input_indices\")};\\nvar best_index : i32 = 0;`,`if (${o.getByIndices(\"input_indices\")} ${t.selectLastIndex>0?\"<=\":\"<\"} value) {\\n value = ${o.getByIndices(\"input_indices\")};\\n best_index = i32(last_index);\\n }`,\"\",n.setByOffset(\"global_idx\",\"best_index\")]};e.compute(Zr(\"ArgMin\",{hint:t.cacheKey,inputDependencies:[\"rank\"]},[e.inputs[0]],r,[t.axis],7,t.keepDims),{inputs:[0]})},Za=(e,t)=>{ja(e.inputs);let r=(o,n,s)=>{let u=[];for(let l=0;l=0||s.length===0)&&u.push(`input_indices[${l}] = 0;`);return[`${u.join(`\\n`)}`,`var value = ${o.getByIndices(\"input_indices\")};\\nvar best_index : i32 = 0;`,`if (${o.getByIndices(\"input_indices\")} ${t.selectLastIndex>0?\">=\":\">\"} value) {\\n value = ${o.getByIndices(\"input_indices\")};\\n best_index = i32(last_index);\\n }`,\"\",n.setByOffset(\"global_idx\",\"best_index\")]};e.compute(Zr(\"argMax\",{hint:t.cacheKey,inputDependencies:[\"rank\"]},[e.inputs[0]],r,[t.axis],7,t.keepDims),{inputs:[0]})},Gn=e=>$e(e)});var rl,nl,ol,al,Qr,il,Xa,Hn=q(()=>{\"use strict\";ie();Gr();be();rl=(e,t)=>{let r=e[0],o=e[1],n=e[2],s=e[3],u=e[4],l=e[5];if(u&&l)throw new Error(\"Attention cannot have both past and relative_position_bias\");if(r.dims.length!==3)throw new Error(\\'Input \"input\" must have 3 dimensions\\');let a=r.dims[0],p=r.dims[1],m=r.dims[2];if(n.dims.length!==1)throw new Error(\\'Input \"bias\" is expected to have 1 dimensions\\');if(o.dims.length!==2)throw new Error(\\'Input \"weights\" is expected to have 2 dimensions\\');if(o.dims[0]!==m)throw new Error(\"Input 1 dimension 0 should have same length as dimension 2 of input 0\");if(n.dims[0]!==o.dims[1])throw new Error(\\'Input \"bias\" dimension 0 should have same length as dimension 1 of input \"weights\"\\');let f=n.dims[0]/3,b=f,_=b;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw new Error(\"qkv_hidden_sizes attribute should have 3 elements\");for(let A of t.qkvHiddenSizes)if(A%t.numHeads!==0)throw new Error(\"qkv_hidden_sizes should be divisible by num_heads\");f=t.qkvHiddenSizes[0],b=t.qkvHiddenSizes[1],_=t.qkvHiddenSizes[2]}let y=p;if(f!==b)throw new Error(\"qkv_hidden_sizes first element should be same as the second\");if(n.dims[0]!==f+b+_)throw new Error(\\'Input \"bias\" dimension 0 should have same length as sum of Q/K/V hidden sizes\\');let $=0;if(u){if(b!==_)throw new Error(\\'Input \"past\" expect k_hidden_size == v_hidden_size\\');if(u.dims.length!==5)throw new Error(\\'Input \"past\" must have 5 dimensions\\');if(u.dims[0]!==2)throw new Error(\\'Input \"past\" first dimension must be 2\\');if(u.dims[1]!==a)throw new Error(\\'Input \"past\" second dimension must be batch_size\\');if(u.dims[2]!==t.numHeads)throw new Error(\\'Input \"past\" third dimension must be num_heads\\');if(u.dims[4]!==b/t.numHeads)throw new Error(\\'Input \"past\" fifth dimension must be k_hidden_size / num_heads\\');t.pastPresentShareBuffer||($=u.dims[3])}let I=y+$,C=-1,v=0;if(s)throw new Error(\"Mask not supported\");if(u)throw new Error(\"past is not supported\");if(l)throw new Error(\"relativePositionBias is not supported\");return{batchSize:a,sequenceLength:p,pastSequenceLength:$,kvSequenceLength:y,totalSequenceLength:I,maxSequenceLength:C,inputHiddenSize:m,hiddenSize:f,vHiddenSize:_,headSize:Math.floor(f/t.numHeads),vHeadSize:Math.floor(_/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},nl=(e,t,r,o)=>{let n=Me(o),s=64,u=o/n;u{let b=F(\"x\",t.dataType,t.dims,n),_=\"thread_max_vector\";n===2?_=\"max(thread_max_vector.x, thread_max_vector.y)\":n===4&&(_=\"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))\");let y=et(t.dataType),$=[{name:\"d_inv\",type:y},{name:\"d_comp\",type:\"u32\"},{name:\"elements_per_wg\",type:\"u32\"}];return`\\n var wgMax: array;\\n var wgSum: array;\\n ${f.registerUniforms($).declareVariables(b)}\\n ${f.mainStart([s,1,1])}\\n let localOffset = local_idx * uniforms.elements_per_wg;\\n let offset: u32 = workgroup_id.x * uniforms.d_comp + localOffset;\\n\\n var thread_max_vector = ${Ye(\"f32\",n,\"-3.402823e+38f\")};\\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\\n thread_max_vector = max(${st(y,n,\"x[offset + i]\")}, thread_max_vector);\\n }\\n wgMax[local_idx] = ${_};\\n workgroupBarrier();\\n\\n var maxValue = -3.402823e+38f;\\n for (var i = 0u; i < ${s}; i++) {\\n maxValue = max(wgMax[i], maxValue);\\n }\\n\\n var sumVector = ${Ye(\"f32\",n,\"0\")};\\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\\n sumVector += exp(${st(y,n,\"x[offset + i]\")} - maxValue);\\n }\\n wgSum[local_idx] = ${tt(\"sumVector\",n)};\\n workgroupBarrier();\\n\\n var sum: f32 = 0;\\n for (var i = 0u; i < ${s}; i++) {\\n sum += wgSum[i];\\n }\\n\\n if (sum == 0) {\\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\\n x[offset + i] = ${Ye(y,n,\"uniforms.d_inv\")};\\n }\\n } else {\\n for (var i: u32 = 0; i < uniforms.elements_per_wg && i + localOffset < uniforms.d_comp; i++) {\\n let f32input = ${st(y,n,\"x[offset + i]\")};\\n x[offset + i] = ${b.type.value}(exp(f32input - maxValue) / sum);\\n }\\n }\\n }`};e.compute({name:\"AttentionProbsSoftmax\",shaderCache:{hint:`${s};${p};${n}`},getShaderSource:m,getRunData:()=>({outputs:[],dispatchGroup:{x:r},programUniforms:a})},{inputs:[t],outputs:[]})},ol=(e,t,r,o,n,s)=>{let u=[n.batchSize,n.numHeads,n.sequenceLength,n.kvSequenceLength+n.pastSequenceLength],l=s.scale===0?1/Math.sqrt(n.headSize):s.scale,a=Me(n.headSize),p=n.headSize/a,m=12,f={x:Math.ceil(n.totalSequenceLength/m),y:Math.ceil(n.sequenceLength/m),z:n.batchSize*n.numHeads},b=[{type:12,data:n.sequenceLength},{type:12,data:p},{type:12,data:n.totalSequenceLength},{type:12,data:n.kvSequenceLength},{type:t.dataType,data:l}],_=[t,r],y=I=>{let C=M(\"q\",t.dataType,t.dims,a),v=M(\"key\",r.dataType,r.dims,a),A=F(\"output\",t.dataType,u),T=Pe(t.dataType),D=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"kv_sequence_length\",type:\"u32\"},{name:\"alpha\",type:T}];return`\\n const beta: ${T} = 1.0;\\n const TILE_SIZE = ${m}u;\\n\\n var tileQ: array<${C.type.storage}, ${m*m}>;\\n var tileK: array<${C.type.storage}, ${m*m}>;\\n ${I.registerUniforms(D).declareVariables(C,v,A)}\\n ${I.mainStart([m,m,1])}\\n // x holds the N and y holds the M\\n let headIdx = workgroup_id.z;\\n let m = workgroup_id.y * TILE_SIZE;\\n let n = workgroup_id.x * TILE_SIZE;\\n let lm = m + local_id.y;\\n let ln = n + local_id.x;\\n\\n let qOffset = uniforms.M * uniforms.K * headIdx + m * uniforms.K;\\n let kOffset = uniforms.kv_sequence_length * uniforms.K * headIdx + n * uniforms.K;\\n\\n var value = ${Ye(T,a)};\\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\\n if (m + local_id.y < uniforms.M && w + local_id.x < uniforms.K) {\\n tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x];\\n }\\n if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) {\\n tileK[TILE_SIZE * local_id.y + local_id.x] = key[kOffset + local_id.y * uniforms.K + w + local_id.x];\\n }\\n workgroupBarrier();\\n\\n for (var k: u32 = 0u; k({outputs:[{dims:u,dataType:t.dataType,gpuDataType:0}],dispatchGroup:f,programUniforms:b}),getShaderSource:y},{inputs:_,outputs:[-1]})[0];return nl(e,$,n.batchSize*n.numHeads*n.sequenceLength,n.totalSequenceLength),$},al=(e,t,r,o)=>{let n=[o.batchSize,o.sequenceLength,o.vHiddenSize],s=12,u={x:Math.ceil(o.vHeadSize/s),y:Math.ceil(o.sequenceLength/s),z:o.batchSize*o.numHeads},l=[{type:12,data:o.sequenceLength},{type:12,data:o.totalSequenceLength},{type:12,data:o.vHeadSize},{type:12,data:o.numHeads},{type:12,data:o.vHiddenSize}],a=p=>{let m=M(\"probs\",t.dataType,t.dims),f=M(\"v\",r.dataType,r.dims),b=F(\"output\",t.dataType,n),_=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"v_hidden_size\",type:\"u32\"}];return`\\n const TILE_SIZE = ${s}u;\\n var tileQ: array<${m.type.value}, ${s*s}>;\\n var tileK: array<${m.type.value}, ${s*s}>;\\n ${p.registerUniforms(_).declareVariables(m,f,b)}\\n ${p.mainStart([s,s,1])}\\n let headIdx = workgroup_id.z;\\n let m = workgroup_id.y * TILE_SIZE + local_id.y;\\n let n = workgroup_id.x * TILE_SIZE + local_id.x;\\n\\n let offsetA = headIdx * (uniforms.M * uniforms.K) + m * uniforms.K;\\n let offsetB = headIdx * (uniforms.N * uniforms.K) + n;\\n\\n var value = ${m.type.storage}(0);\\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\\n tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x];\\n }\\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\\n tileK[TILE_SIZE * local_id.y + local_id.x] = v[offsetB + (w + local_id.y) * uniforms.N];\\n }\\n workgroupBarrier();\\n for (var k: u32 = 0u; k({outputs:[{dims:n,dataType:t.dataType,gpuDataType:0}],dispatchGroup:u,programUniforms:l}),getShaderSource:a},{inputs:[t,r],outputs:[0]})[0]},Qr=(e,t,r,o,n,s,u,l,a,p,m)=>{let f=ol(e,t,r,a,p,m);al(e,f,o,p)},il=(e,t)=>{let r=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],o=t.sequenceLength,n=t.inputHiddenSize,s=t.headSize,u=12,l={x:Math.ceil(t.headSize/u),y:Math.ceil(t.sequenceLength/u),z:t.batchSize*t.numHeads},a=[e.inputs[0],e.inputs[1],e.inputs[2]],p=[{type:12,data:o},{type:12,data:n},{type:12,data:s},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],m=f=>{let b=F(\"output_q\",a[0].dataType,r),_=F(\"output_k\",a[0].dataType,r),y=F(\"output_v\",a[0].dataType,r),$=M(\"input\",a[0].dataType,a[0].dims),I=M(\"weight\",a[1].dataType,a[1].dims),C=M(\"bias\",a[2].dataType,a[2].dims),v=$.type.storage,A=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"head_size\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"},{name:\"ldb\",type:\"u32\"}];return`\\n const TILE_SIZE = ${u}u;\\n var tileInput: array<${v}, ${u*u}>;\\n var tileWeightQ: array<${v}, ${u*u}>;\\n var tileWeightK: array<${v}, ${u*u}>;\\n var tileWeightV: array<${v}, ${u*u}>;\\n ${f.registerUniforms(A).declareVariables($,I,C,b,_,y)}\\n ${f.mainStart([u,u,1])}\\n let batchIndex = workgroup_id.z / uniforms.num_heads;\\n let headNumber = workgroup_id.z % uniforms.num_heads;\\n let m = workgroup_id.y * TILE_SIZE + local_id.y;\\n let n = workgroup_id.x * TILE_SIZE + local_id.x;\\n\\n let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K;\\n let biasOffsetQ = headNumber * uniforms.head_size;\\n let biasOffsetK = uniforms.hidden_size + biasOffsetQ;\\n let biasOffsetV = uniforms.hidden_size + biasOffsetK;\\n\\n var valueQ = ${v}(0);\\n var valueK = ${v}(0);\\n var valueV = ${v}(0);\\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\\n tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x];\\n }\\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\\n let offset = n + (w + local_id.y) * uniforms.ldb;\\n tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset];\\n tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset];\\n tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset];\\n }\\n workgroupBarrier();\\n for (var k: u32 = 0u; k({outputs:[{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:l,programUniforms:p}),getShaderSource:m},{inputs:a,outputs:[-1,-1,-1]})},Xa=(e,t)=>{let r=rl(e.inputs,t),[o,n,s]=il(e,r);return Qr(e,o,n,s,e.inputs[4],void 0,void 0,void 0,e.inputs[5],r,t)}});var sl,ul,dl,Ja,ei=q(()=>{\"use strict\";Kt();ie();_e();je();be();sl=(e,t)=>{if(!e||e.length!==5)throw new Error(\"BatchNormalization requires 5 inputs\");let r=(o,n,s)=>{let u=n.length;if(u!==o.length)throw new Error(`${s}: num dimensions != ${u}`);n.forEach((l,a)=>{if(l!==o[a])throw new Error(`${s}: dim[${a}] do not match`)})};if(e[0].dims.length>1){let o=t.format===\"NHWC\"?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);r(e[1].dims,o,\"Invalid input scale\"),r(e[2].dims,o,\"Invalid input B\"),r(e[3].dims,o,\"Invalid input mean\"),r(e[4].dims,o,\"Invalid input var\")}else r(e[1].dims,[1],\"Invalid input scale\"),r(e[2].dims,[1],\"Invalid input B\"),r(e[3].dims,[1],\"Invalid input mean\"),r(e[4].dims,[1],\"Invalid input var\")},ul=(e,t)=>{let{epsilon:r,spatial:o,format:n}=t,s=e[0].dims,u=o?Me(s[s.length-1]):1,l=n===\"NHWC\"&&s.length>1?u:1,a=z.size(s)/u,p=o,m=p?s.length:s,f=M(\"x\",e[0].dataType,e[0].dims,u),b=M(\"scale\",e[1].dataType,e[1].dims,l),_=M(\"bias\",e[2].dataType,e[2].dims,l),y=M(\"inputMean\",e[3].dataType,e[3].dims,l),$=M(\"inputVar\",e[4].dataType,e[4].dims,l),I=F(\"y\",e[0].dataType,m,u),C=()=>{let A=\"\";if(o)A=`let cOffset = ${s.length===1?\"0u\":n===\"NHWC\"?`outputIndices[${s.length-1}] / ${u}`:\"outputIndices[1]\"};`;else if(n===\"NCHW\")A=`\\n ${I.indicesSet(\"outputIndices\",\"0\",\"0\")}\\n let cOffset = ${I.indicesToOffset(\"outputIndices\")};`;else{A=`var cIndices = ${b.type.indices}(0);\\n cIndices[0] = outputIndices[${s.length-1}];`;for(let T=1;T`\\n const epsilon = ${r};\\n ${A.registerUniform(\"outputSize\",\"u32\").declareVariables(f,b,_,y,$,I)}\\n ${A.mainStart()}\\n ${A.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n var outputIndices = ${I.offsetToIndices(`global_idx * ${u}`)};\\n ${C()}\\n let scale = ${b.getByOffset(\"cOffset\")};\\n let bias = ${_.getByOffset(\"cOffset\")};\\n let inputMean = ${y.getByOffset(\"cOffset\")};\\n let inputVar = ${$.getByOffset(\"cOffset\")};\\n let x = ${f.getByOffset(\"global_idx\")};\\n let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias;\\n ${I.setByOffset(\"global_idx\",\"value\")}\\n }`;return{name:\"BatchNormalization\",shaderCache:{hint:`${t.epsilon}_${t.format}_${o}_${u}`,inputDependencies:p?[\"rank\",\"type\",\"type\",\"type\",\"type\"]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:p?[{type:12,data:a},...j(s)]:[{type:12,data:a}]})}},dl=e=>$e(e),Ja=(e,t)=>{let{inputs:r,outputCount:o}=e,n=dl({...t,outputCount:o});if(qt.webgpu.validateInputContent&&sl(r,n),t.trainingMode)throw new Error(\"BatchNormalization trainingMode is not supported yet.\");e.compute(ul(r,n))}});var ll,cl,ti,ri=q(()=>{\"use strict\";_e();be();ll=e=>{if(e[0].dims.length!==3)throw new Error(\"input should have 3 dimensions\");if(![320,640,1280].includes(e[0].dims[2]))throw new Error(\"number of channels should be 320, 640 or 1280\");if(e[1].dims.length!==1)throw new Error(\"bias is expected to have 1 dimensions\");if(e[0].dims[2]!==e[1].dims[0])throw new Error(\"last dimension of input and bias are not the same\")},cl=e=>{let t=e[0].dims,r=e[0].dims[2],o=z.size(t)/4,n=e[0].dataType,s=M(\"input\",n,t,4),u=M(\"bias\",n,[r],4),l=M(\"residual\",n,t,4),a=F(\"output\",n,t,4);return{name:\"BiasAdd\",getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)}}),getShaderSource:m=>`\\n const channels = ${r}u / 4;\\n ${m.declareVariables(s,u,l,a)}\\n\\n ${m.mainStart()}\\n ${m.guardAgainstOutOfBoundsWorkgroupSizes(o)}\\n let value = ${s.getByOffset(\"global_idx\")}\\n + ${u.getByOffset(\"global_idx % channels\")} + ${l.getByOffset(\"global_idx\")};\\n ${a.setByOffset(\"global_idx\",\"value\")}\\n }`}},ti=e=>{ll(e.inputs),e.compute(cl(e.inputs))}});var pl,Ee,ni,oi,ai,ii,si,ui,di,li,ci,ml,pi,mi,fi,hi,Xr,gi,Jr,yi,bi,wi,vi,$i,_i,xi,Si,Ci,Ii,Ai,Ti,Ei,Pi,Oi,ki,Ri,Bi,Ln,Fn,Di,Mi,zi,en=q(()=>{\"use strict\";ie();_e();je();be();pl=(e,t,r,o,n,s)=>{let u=Math.ceil(t/4),l=\"\";typeof n==\"string\"?l=`${n}(a)`:l=n(\"a\");let a=M(\"inputData\",r,[u],4),p=F(\"outputData\",o,[u],4);return`\\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(a,p)}\\n\\n ${s??\"\"}\\n\\n ${e.mainStart()}\\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\\n\\n let a = ${a.getByOffset(\"global_idx\")};\\n ${p.setByOffset(\"global_idx\",l)}\\n }`},Ee=(e,t,r,o,n,s=e.dataType)=>({name:t,shaderCache:{hint:n,inputDependencies:[\"type\"]},getShaderSource:u=>pl(u,z.size(e.dims),e.dataType,s,r,o),getRunData:u=>({outputs:[{dims:e.dims,dataType:s}],dispatchGroup:{x:Math.ceil(z.size(u[0].dims)/64/4)},programUniforms:[{type:12,data:Math.ceil(z.size(e.dims)/4)}]})}),ni=e=>{e.compute(Ee(e.inputs[0],\"Abs\",\"abs\"))},oi=e=>{e.compute(Ee(e.inputs[0],\"Acos\",\"acos\"))},ai=e=>{e.compute(Ee(e.inputs[0],\"Acosh\",\"acosh\"))},ii=e=>{e.compute(Ee(e.inputs[0],\"Asin\",\"asin\"))},si=e=>{e.compute(Ee(e.inputs[0],\"Asinh\",\"asinh\"))},ui=e=>{e.compute(Ee(e.inputs[0],\"Atan\",\"atan\"))},di=e=>{e.compute(Ee(e.inputs[0],\"Atanh\",\"atanh\"))},li=e=>$e(e),ci=(e,t)=>{let r;switch(t.to){case 10:r=\"vec4\";break;case 1:r=\"vec4\";break;case 12:r=\"vec4\";break;case 6:r=\"vec4\";break;case 9:r=\"vec4\";break;default:throw new RangeError(`not supported type (specified in attribute \\'to\\' from \\'Cast\\' operator): ${t.to}`)}e.compute(Ee(e.inputs[0],\"Cast\",r,void 0,t.cacheKey,t.to))},ml=e=>{let t=e.length>=2&&e[1].data!==0?e[1].getFloat32Array()[0]:Fr,r=e.length>=3&&e[2].data!==0?e[2].getFloat32Array()[0]:qr;return $e({min:t,max:r})},pi=(e,t)=>{let r=e.inputs.length===1?t:ml(e.inputs),o=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"Clip\",n=>`clamp(${n}, clip_min_, clip_max_)`,`\\n const clip_min_: vec4<${o}> = vec4(${o}(${r.min}));\\n const clip_max_: vec4<${o}> = vec4(${o}(${r.max}));\\n`,r.cacheKey),{inputs:[0]})},mi=e=>{e.compute(Ee(e.inputs[0],\"Ceil\",\"ceil\"))},fi=e=>{e.compute(Ee(e.inputs[0],\"Cos\",\"cos\"))},hi=e=>{e.compute(Ee(e.inputs[0],\"Cosh\",\"cosh\"))},Xr=e=>$e(e),gi=(e,t)=>{let r=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"Elu\",o=>`elu_vf32(${o})`,`\\n const elu_alpha_ = ${r}(${t.alpha});\\n\\n fn elu_f32(a: ${r}) -> ${r} {\\n return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0);\\n }\\n\\n fn elu_vf32(v: vec4<${r}>) -> vec4<${r}> {\\n return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w));\\n }`,t.cacheKey))},Jr=(e=\"f32\")=>`\\nconst r0: ${e} = 0.3275911;\\nconst r1: ${e} = 0.254829592;\\nconst r2: ${e} = -0.284496736;\\nconst r3: ${e} = 1.421413741;\\nconst r4: ${e} = -1.453152027;\\nconst r5: ${e} = 1.061405429;\\n\\nfn erf_vf32(v: vec4<${e}>) -> vec4<${e}> {\\n let absv = abs(v);\\n let x = 1.0 / (1.0 + r0 * absv);\\n return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv));\\n}`,yi=e=>{let t=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"Erf\",r=>`erf_vf32(${r})`,Jr(t)))},bi=e=>{e.compute(Ee(e.inputs[0],\"Exp\",\"exp\"))},wi=e=>{e.compute(Ee(e.inputs[0],\"Floor\",\"floor\"))},vi=e=>{let t=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"Gelu\",r=>`0.5 * ${r} * (1.0 + erf_vf32(${r} * 0.7071067811865475))`,Jr(t)))},$i=(e,t)=>{let r=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"LeakyRelu\",o=>`select(leaky_relu_alpha_ * ${o}, ${o}, ${o} >= vec4<${r}>(0.0))`,`const leaky_relu_alpha_ = ${r}(${t.alpha});`,t.cacheKey))},_i=e=>{e.compute(Ee(e.inputs[0],\"Not\",t=>`!${t}`))},xi=e=>{e.compute(Ee(e.inputs[0],\"Neg\",t=>`-${t}`))},Si=e=>{e.compute(Ee(e.inputs[0],\"Reciprocal\",t=>`1.0/${t}`))},Ci=e=>{let t=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"Relu\",r=>`select(vec4<${t}>(0.0), ${r}, ${r} > vec4<${t}>(0.0))`))},Ii=e=>{e.compute(Ee(e.inputs[0],\"Sigmoid\",t=>`(1.0 / (1.0 + exp(-${t})))`))},Ai=e=>$e(e),Ti=(e,t)=>{let r=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"HardSigmoid\",o=>`max(vec4<${r}>(0.0), min(vec4<${r}>(1.0), ${t.alpha} * ${o} + vec4<${r}>(${t.beta})))`,void 0,t.cacheKey))},Ei=e=>{e.compute(Ee(e.inputs[0],\"Sin\",\"sin\"))},Pi=e=>{e.compute(Ee(e.inputs[0],\"Sinh\",\"sinh\"))},Oi=e=>{e.compute(Ee(e.inputs[0],\"Sqrt\",\"sqrt\"))},ki=e=>{e.compute(Ee(e.inputs[0],\"Tan\",\"tan\"))},Ri=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,Bi=e=>{e.compute(Ee(e.inputs[0],\"Tanh\",Ri))},Ln=(e=\"f32\")=>`\\nconst fast_gelu_a: ${e} = 0.5;\\nconst fast_gelu_b: ${e} = 0.7978845608028654;\\nconst fast_gelu_c: ${e} = 0.035677408136300125;\\n\\nfn tanh_v(v: vec4<${e}>) -> vec4<${e}> {\\n return ${Ri(\"v\")};\\n}\\n`,Fn=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Di=e=>{let t=et(e.inputs[0].dataType);e.compute(Ee(e.inputs[0],\"FastGelu\",Fn,Ln(t),void 0,e.inputs[0].dataType))},Mi=(e,t)=>{let r=et(e.inputs[0].dataType);return e.compute(Ee(e.inputs[0],\"ThresholdedRelu\",o=>`select(vec4<${r}>(0.0), ${o}, ${o} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${r}>(${t.alpha});`,t.cacheKey)),0},zi=e=>{e.compute(Ee(e.inputs[0],\"Log\",\"log\"))}});var fl,hl,Vi,Ni=q(()=>{\"use strict\";_e();be();en();fl=e=>{if(e[0].dims.length!==3)throw new Error(\"input should have 3 dimensions\");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error(\"hidden state should be 2560, 5120 or 10240\");if(e[1].dims.length!==1)throw new Error(\"bias is expected to have 1 dimensions\");if(e[0].dims[2]!==e[1].dims[0])throw new Error(\"last dimension of input and bias are not the same\")},hl=e=>{let t=e[0].dims.slice();t[2]=t[2]/2;let r=M(\"input\",e[0].dataType,e[0].dims,4),o=M(\"bias\",e[0].dataType,[e[0].dims[2]],4),n=F(\"output\",e[0].dataType,t,4),s=z.size(t)/4,u=Pe(e[0].dataType);return{name:\"BiasSplitGelu\",getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)}}),getShaderSource:a=>`\\n const M_SQRT2 = sqrt(2.0);\\n const halfChannels = ${e[0].dims[2]/4/2}u;\\n\\n ${a.declareVariables(r,o,n)}\\n\\n ${Jr(u)}\\n\\n ${a.mainStart()}\\n ${a.guardAgainstOutOfBoundsWorkgroupSizes(s)}\\n let biasIdx = global_idx % halfChannels;\\n let batchIndex = global_idx / halfChannels;\\n let inputOffset = biasIdx + batchIndex * halfChannels * 2;\\n let valueLeft = input[inputOffset] + bias[biasIdx];\\n let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels];\\n let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1);\\n\\n ${n.setByOffset(\"global_idx\",\"valueLeft * geluRight\")}\\n }`}},Vi=e=>{fl(e.inputs),e.compute(hl(e.inputs))}});var gl,yl,bt,Wi,Gi,Hi,Li,Fi,qi,Ki,ji,Yi,Zi,Qi=q(()=>{\"use strict\";ie();_e();be();gl=(e,t,r,o,n,s,u,l,a,p,m,f)=>{let b,_;typeof l==\"string\"?b=_=(v,A)=>`${l}((${v}),(${A}))`:typeof l==\"function\"?b=_=l:(b=l.scalar,_=l.vector);let y=F(\"outputData\",m,o.length,4),$=M(\"aData\",a,t.length,4),I=M(\"bData\",p,r.length,4),C;if(n)if(s){let v=z.size(t)===1,A=z.size(r)===1,T=t.length>0&&t[t.length-1]%4===0,D=r.length>0&&r[r.length-1]%4===0;v||A?C=y.setByOffset(\"global_idx\",_(v?`${$.type.value}(${$.getByOffset(\"0\")}.x)`:$.getByOffset(\"global_idx\"),A?`${I.type.value}(${I.getByOffset(\"0\")}.x)`:I.getByOffset(\"global_idx\"))):C=`\\n let outputIndices = ${y.offsetToIndices(\"global_idx * 4u\")};\\n let offsetA = ${$.broadcastedIndicesToOffset(\"outputIndices\",y)};\\n let offsetB = ${I.broadcastedIndicesToOffset(\"outputIndices\",y)};\\n ${y.setByOffset(\"global_idx\",_(u||T?$.getByOffset(\"offsetA / 4u\"):`${$.type.value}(${$.getByOffset(\"offsetA / 4u\")}[offsetA % 4u])`,u||D?I.getByOffset(\"offsetB / 4u\"):`${I.type.value}(${I.getByOffset(\"offsetB / 4u\")}[offsetB % 4u])`))}\\n `}else C=y.setByOffset(\"global_idx\",_($.getByOffset(\"global_idx\"),I.getByOffset(\"global_idx\")));else{if(!s)throw new Error(\"no necessary to use scalar implementation for element-wise binary op implementation.\");let v=(A,T,D=\"\")=>{let U=`aData[indexA${T}][componentA${T}]`,V=`bData[indexB${T}][componentB${T}]`;return`\\n let outputIndices${T} = ${y.offsetToIndices(`global_idx * 4u + ${T}u`)};\\n let offsetA${T} = ${$.broadcastedIndicesToOffset(`outputIndices${T}`,y)};\\n let offsetB${T} = ${I.broadcastedIndicesToOffset(`outputIndices${T}`,y)};\\n let indexA${T} = offsetA${T} / 4u;\\n let indexB${T} = offsetB${T} / 4u;\\n let componentA${T} = offsetA${T} % 4u;\\n let componentB${T} = offsetB${T} % 4u;\\n ${A}[${T}] = ${D}(${b(U,V)});\\n `};m===9?C=`\\n var data = vec4(0);\\n ${v(\"data\",0,\"u32\")}\\n ${v(\"data\",1,\"u32\")}\\n ${v(\"data\",2,\"u32\")}\\n ${v(\"data\",3,\"u32\")}\\n outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:C=`\\n ${v(\"outputData[global_idx]\",0)}\\n ${v(\"outputData[global_idx]\",1)}\\n ${v(\"outputData[global_idx]\",2)}\\n ${v(\"outputData[global_idx]\",3)}\\n `}return`\\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables($,I,y)}\\n\\n ${f??\"\"}\\n\\n ${e.mainStart()}\\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\\n ${C}\\n }`},yl=(e,t,r,o,n,s,u=r.dataType)=>{let l=!z.areEqual(r.dims,o.dims),a=r.dims,p=z.size(r.dims),m=!1,f=!1,b=[l];if(l){let _=mt.calcShape(r.dims,o.dims,!1);if(!_)throw new Error(\"Can\\'t perform binary op on the given tensors\");a=_,p=z.size(a);let y=z.size(r.dims)===1,$=z.size(o.dims)===1,I=r.dims.length>0&&r.dims[r.dims.length-1]%4===0,C=o.dims.length>0&&o.dims[o.dims.length-1]%4===0;b.push(y),b.push($),b.push(I),b.push(C);let v=1;for(let A=1;A_.toString()).join(\"_\"),inputDependencies:[\"rank\",\"rank\"]},getShaderSource:_=>gl(_,r.dims,o.dims,a,m,l,f,n,r.dataType,o.dataType,u,s),getRunData:()=>({outputs:[{dims:a,dataType:u}],dispatchGroup:{x:Math.ceil(p/64/4)},programUniforms:[{type:12,data:Math.ceil(z.size(a)/4)},...j(r.dims,o.dims,a)]})}},bt=(e,t,r,o,n,s)=>{e.compute(yl(t,n??\"\",e.inputs[0],e.inputs[1],r,o,s))},Wi=e=>{bt(e,\"Add\",(t,r)=>`${t}+${r}`)},Gi=e=>{bt(e,\"Div\",(t,r)=>`${t}/${r}`)},Hi=e=>{bt(e,\"Equal\",{scalar:(t,r)=>`u32(${t}==${r})`,vector:(t,r)=>`vec4(${t}==${r})`},void 0,void 0,9)},Li=e=>{bt(e,\"Mul\",(t,r)=>`${t}*${r}`)},Fi=e=>{let t=M(\"input\",e.inputs[0].dataType,e.inputs[0].dims).type.value;bt(e,\"Pow\",{scalar:(o,n)=>`pow_custom(${o},${n})`,vector:(o,n)=>`pow_vector_custom(${o},${n})`},`\\n fn pow_custom(a : ${t}, b : ${t}) -> ${t} {\\n if (b == ${t}(0.0)) {\\n return ${t}(1.0);\\n } else if (a < ${t}(0.0) && f32(b) != floor(f32(b))) {\\n return ${t}(pow(f32(a), f32(b))); // NaN\\n }\\n return select(sign(a), ${t}(1.0), round(f32(abs(b) % ${t}(2.0))) != 1.0) * ${t}(${t===\"i32\"?\"round\":\"\"}(pow(f32(abs(a)), f32(b))));\\n }\\n fn pow_vector_custom(a : vec4<${t}>, b : vec4<${t}>) -> vec4<${t}> {\\n // TODO: implement vectorized pow\\n return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w));\\n }\\n `)},qi=e=>{bt(e,\"Sub\",(t,r)=>`${t}-${r}`)},Ki=e=>{bt(e,\"Greater\",{scalar:(t,r)=>`u32(${t}>${r})`,vector:(t,r)=>`vec4(${t}>${r})`},void 0,void 0,9)},ji=e=>{bt(e,\"Less\",{scalar:(t,r)=>`u32(${t}<${r})`,vector:(t,r)=>`vec4(${t}<${r})`},void 0,void 0,9)},Yi=e=>{bt(e,\"GreaterOrEqual\",{scalar:(t,r)=>`u32(${t}>=${r})`,vector:(t,r)=>`vec4(${t}>=${r})`},void 0,void 0,9)},Zi=e=>{bt(e,\"LessOrEqual\",{scalar:(t,r)=>`u32(${t}<=${r})`,vector:(t,r)=>`vec4(${t}<=${r})`},void 0,void 0,9)}});var wl,vl,$l,_l,Xi,Ji,es=q(()=>{\"use strict\";ie();_e();je();be();wl=(e,t)=>{if(!e||e.length<1)throw new Error(\"too few inputs\");let r=0,o=e[r],n=o.dataType,s=o.dims.length;e.forEach((u,l)=>{if(l!==r){if(u.dataType!==n)throw new Error(\"input tensors should be one type\");if(u.dims.length!==s)throw new Error(\"input tensors should have the same shape\");u.dims.forEach((a,p)=>{if(p!==t&&a!==o.dims[p])throw new Error(\"non concat dimensions must match\")})}})},vl=(e,t)=>`\\n fn calculateInputIndex(index: u32) -> u32 {\\n let sizeInConcatAxis = array(${t});\\n for (var i: u32 = 0u; i < ${e}; i += 1u ) {\\n if (index < sizeInConcatAxis[i]) {\\n return i;\\n }\\n }\\n return ${e}u;\\n }`,$l=(e,t)=>{let r=e.length,o=[];for(let n=0;n{let n=z.size(r),s=new Array(e.length),u=new Array(e.length),l=0,a=[],p=[],m=[{type:12,data:n}];for(let $=0;$`uniforms.sizeInConcatAxis${$}`).join(\",\"),y=$=>`\\n\\n ${(()=>{$.registerUniform(\"outputSize\",\"u32\");for(let I=0;I(${_});\\n ${b} -= sizeInConcatAxis[inputIndex - 1u];\\n }\\n\\n ${$l(u,f)}\\n }`;return{name:\"Concat\",shaderCache:{hint:`${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:r,dataType:o}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:m}),getShaderSource:y}},Xi=(e,t)=>{let r=e.inputs,o=r[0].dims,n=z.normalizeAxis(t.axis,o.length);wl(r,n);let s=o.slice();s[n]=r.reduce((l,a)=>l+(a.dims.length>n?a.dims[n]:0),0);let u=r.filter(l=>z.size(l.dims)>0);e.compute(_l(u,n,s,r[0].dataType),{inputs:u})},Ji=e=>$e({axis:e.axis})});var ut,dt,lt,tn,Ot=q(()=>{\"use strict\";ie();_e();ut=(e,t,r=\"f32\")=>{switch(e.activation){case\"Relu\":return`value = max(value, ${t}(0.0));`;case\"Sigmoid\":return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case\"Clip\":return`value = clamp(value, ${t}(${r}(uniforms.clip_min)), ${t}(${r}(uniforms.clip_max)));`;case\"HardSigmoid\":return`value = max(${t}(0.0), min(${t}(1.0), ${r}(uniforms.alpha) * value + ${r}(uniforms.beta)));`;case\"LeakyRelu\":return`value = select(${r}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case\"\":return\"\";default:throw new Error(`Unsupported activation ${e.activation}`)}},dt=(e,t)=>{e.activation===\"Clip\"?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===\"HardSigmoid\"?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===\"LeakyRelu\"&&t.push({type:1,data:e.alpha})},lt=(e,t)=>{e.activation===\"Clip\"?t.push({name:\"clip_max\",type:\"f32\"},{name:\"clip_min\",type:\"f32\"}):e.activation===\"HardSigmoid\"?t.push({name:\"alpha\",type:\"f32\"},{name:\"beta\",type:\"f32\"}):e.activation===\"LeakyRelu\"&&t.push({name:\"alpha\",type:\"f32\"})},tn=e=>{let t=e?.activation||\"\";if(t===\"HardSigmoid\"){let[r,o]=e?.activation_params||[.2,.5];return{activation:t,alpha:r,beta:o}}else if(t===\"Clip\"){let[r,o]=e?.activation_params||[Fr,qr];return{activation:t,clipMax:o,clipMin:r}}else if(t===\"LeakyRelu\"){let[r]=e?.activation_params||[.01];return{activation:t,alpha:r}}return{activation:t}}});var Ze,rn,nn=q(()=>{\"use strict\";Ze=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${e}-component is not supported.`)}},rn=e=>`\\n ${e?\"value = value + getBiasByOutputCoords(coords);\":\"\"}\\n `});var on,qn=q(()=>{\"use strict\";on=e=>`\\nfn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\\n return dot(coords, vec4(\\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\\n}\\nfn getOutputIndexFromCoords(coords : vec4) -> i32 {\\n return dot(coords, vec4(\\n i32(${e}.x), i32(${e}.y), i32(${e}.z), 1));\\n}\\n`});var xl,Sl,gr,ts,Cl,yr,Il,an,br=q(()=>{\"use strict\";ie();_e();be();Ot();nn();xl=(e,t)=>e?`\\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\\n kStart + inputRow,\\n globalRowStart / innerElementSize + inputCol${t?\", batchIndices\":\"\"});\\n `:`\\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\\n globalRow + innerRow,\\n kStart / innerElementSize + inputCol${t?\", batchIndices\":\"\"});\\n `,Sl=(e,t)=>e?`\\n let ACached0 = mm_Asub[k * innerElementSize][localRow];\\n let ACached1 = mm_Asub[k * innerElementSize + 1][localRow];\\n let ACached2 = mm_Asub[k * innerElementSize + 2][localRow];\\n ${t===3?\"\":\"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];\"}\\n for (var i = 0; i < rowPerThread; i = i + 1) {\\n acc[i] = BCached0 * ACached0[i] + acc[i];\\n acc[i] = BCached1 * ACached1[i] + acc[i];\\n acc[i] = BCached2 * ACached2[i] + acc[i];\\n ${t===3?\"\":\"acc[i] = BCached3 * ACached3[i] + acc[i];\"}\\n }`:`\\n for (var i = 0; i < rowPerThread; i = i + 1) {\\n let ACached = mm_Asub[tileRow + i][k];\\n acc[i] = BCached0 * ACached.x + acc[i];\\n acc[i] = BCached1 * ACached.y + acc[i];\\n acc[i] = BCached2 * ACached.z + acc[i];\\n ${t===3?\"\":\"acc[i] = BCached3 * ACached.w + acc[i];\"}\\n }`,gr=(e,t,r=\"f32\",o,n=!1,s=32,u=!1,l=32)=>{let a=t[1]*e[1],p=t[0]*e[0],m=n?a:s,f=n?s:a,b=m/t[0],_=s/t[1];if(!((n&&b===4&&e[1]===4||!n&&(b===3||b===4))&&m%t[0]===0&&s%t[1]===0&&e[0]===4))throw new Error(`If transposeA ${n} is true, innerElementSize ${b} and workPerThread[1] ${e[1]} must be 4.\\n Otherwise, innerElementSize ${b} must be 3 or 4.\\n tileAWidth ${m} must be divisible by workgroupSize[0]${t[0]}. tileInner ${s} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return`\\nvar mm_Asub: array, ${m/b}>, ${f}>;\\nvar mm_Bsub: array, ${p/e[0]}>, ${s}>;\\n\\nconst rowPerThread = ${e[1]};\\nconst colPerThread = ${e[0]};\\nconst innerElementSize = ${b};\\nconst tileInner = ${s};\\n\\n@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})\\nfn main(@builtin(local_invocation_id) localId : vec3,\\n @builtin(global_invocation_id) globalId : vec3,\\n @builtin(workgroup_id) workgroupId : vec3) {\\n let localRow = i32(localId.y);\\n let tileRow = localRow * rowPerThread;\\n let tileCol = i32(localId.x);\\n\\n let globalRow =i32(globalId.y) * rowPerThread;\\n let globalCol = i32(globalId.x);\\n let batch = ${u?\"0\":\"i32(globalId.z)\"};\\n ${o?`let batchIndices = ${o.offsetToIndices(\"u32(batch)\")};`:\"\"}\\n let globalRowStart = i32(workgroupId.y) * ${a};\\n\\n let num_tiles = ${u?`${Math.ceil(l/s)}`:\"(uniforms.dim_inner - 1) / tileInner + 1\"};\\n var kStart = ${u?`i32(globalId.z) * ${l}`:\"0\"};\\n\\n var acc: array, rowPerThread>;\\n\\n // Loop over shared dimension.\\n let tileRowB = localRow * ${_};\\n for (var t = 0; t < num_tiles; t = t + 1) {\\n // Load one tile of A into local memory.\\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n let inputRow = tileRow + innerRow;\\n let inputCol = tileCol;\\n ${xl(n,o)}\\n }\\n\\n // Load one tile of B into local memory.\\n for (var innerRow = 0; innerRow < ${_}; innerRow = innerRow + 1) {\\n let inputRow = tileRowB + innerRow;\\n let inputCol = tileCol;\\n mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${o?\", batchIndices\":\"\"});\\n }\\n kStart = kStart + tileInner;\\n workgroupBarrier();\\n\\n // Compute acc values for a single thread.\\n for (var k = 0; k < tileInner / innerElementSize; k = k + 1) {\\n let BCached0 = mm_Bsub[k * innerElementSize][tileCol];\\n let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol];\\n let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol];\\n ${b===3?\"\":\"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];\"}\\n\\n ${Sl(n,b)}\\n }\\n\\n workgroupBarrier();\\n }\\n\\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\\n }\\n}`},ts=(e,t)=>e?`\\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\\n kStart + inputRow,\\n globalRowStart + inputCol${t?\", batchIndices\":\"\"});\\n `:`\\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\\n globalRowStart + inputRow,\\n kStart + inputCol${t?\", batchIndices\":\"\"});\\n `,Cl=e=>e?\"let ACached = mm_Asub[k][tileRow + innerRow];\":\"let ACached = mm_Asub[tileRow + innerRow][k];\",yr=(e,t,r=\"f32\",o,n=!1,s=32,u=!1,l=32,a=!1)=>{let p=e[1]*t[1],m=e[0]*t[0],f=n?p:s,b=n?s:p;if(!(b%t[1]===0&&f%t[0]===0&&s%t[1]===0))throw new Error(`tileAHight ${b} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${f} must be divisible by workgroupSize[0]${t[0]}, tileInner ${s} must be divisible by workgroupSize[1]${t[1]}`);let _=b/t[1],y=f/t[0],$=s/t[1],I=a?`\\n let localRow = i32(localId.y);\\n let localCol = i32(localId.x);\\n let globalRowStart = i32(workgroupId.y) * ${p};\\n let globalColStart = i32(workgroupId.x) * ${m};\\n\\n // Loop over shared dimension.\\n for (var t = 0; t < num_tiles; t = t + 1) {\\n // Load one tile of A into local memory.\\n for (var inputRow = localRow; inputRow < ${b}; inputRow = inputRow + ${t[1]}) {\\n for (var inputCol = localCol; inputCol < ${f}; inputCol = inputCol + ${t[0]}) {\\n ${ts(n,o)}\\n }\\n }\\n // Load one tile of B into local memory.\\n for (var inputRow = localRow; inputRow < ${s}; inputRow = inputRow + ${t[1]}) {\\n for (var inputCol = localCol; inputCol < ${m}; inputCol = inputCol + ${t[0]}) {\\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\\n kStart + inputRow,\\n globalColStart + inputCol${o?\", batchIndices\":\"\"});\\n }\\n }\\n kStart = kStart + tileInner;\\n workgroupBarrier();\\n\\n // Compute acc values for a single thread.\\n var BCached : array<${r}, colPerThread>;\\n for (var k = 0; k < tileInner; k = k + 1) {\\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\\n BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}];\\n }\\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n let ACached = ${n?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`}\\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\\n acc[innerRow][innerCol] = acc[innerRow][innerCol] +\\n ACached * BCached[innerCol];\\n }\\n }\\n }\\n workgroupBarrier();\\n }\\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n let gRow = globalRowStart + localRow + innerRow * ${t[1]};\\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\\n let gCol = globalColStart + localCol + innerCol * ${t[0]};\\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\\n }\\n }\\n `:`\\nlet tileRow = i32(localId.y) * rowPerThread;\\nlet tileCol = i32(localId.x) * colPerThread;\\n\\nlet globalRow = i32(globalId.y) * rowPerThread;\\nlet globalCol = i32(globalId.x) * colPerThread;\\nlet globalRowStart = i32(workgroupId.y) * ${p};\\n\\nlet tileRowA = i32(localId.y) * ${_};\\nlet tileColA = i32(localId.x) * ${y};\\nlet tileRowB = i32(localId.y) * ${$};\\n// Loop over shared dimension.\\nfor (var t = 0; t < num_tiles; t = t + 1) {\\n // Load one tile of A into local memory.\\n for (var innerRow = 0; innerRow < ${_}; innerRow = innerRow + 1) {\\n for (var innerCol = 0; innerCol < ${y}; innerCol = innerCol + 1) {\\n let inputRow = tileRowA + innerRow;\\n let inputCol = tileColA + innerCol;\\n ${ts(n,o)}\\n }\\n }\\n\\n // Load one tile of B into local memory.\\n for (var innerRow = 0; innerRow < ${$}; innerRow = innerRow + 1) {\\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\\n let inputRow = tileRowB + innerRow;\\n let inputCol = tileCol + innerCol;\\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\\n kStart + inputRow,\\n globalCol + innerCol${o?\", batchIndices\":\"\"});\\n }\\n }\\n kStart = kStart + tileInner;\\n workgroupBarrier();\\n\\n // Compute acc values for a single thread.\\n var BCached : array<${r}, colPerThread>;\\n for (var k = 0; k < tileInner; k = k + 1) {\\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\\n BCached[inner] = mm_Bsub[k][tileCol + inner];\\n }\\n\\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n ${Cl(n)}\\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\\n acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol];\\n }\\n }\\n }\\n\\n workgroupBarrier();\\n}\\n\\nfor (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\\n acc[innerRow][innerCol]);\\n }\\n}\\n`;return`\\n var mm_Asub : array, ${b}>;\\n var mm_Bsub : array, ${s}>;\\n const rowPerThread = ${e[1]};\\n const colPerThread = ${e[0]};\\n const tileInner = ${s};\\n\\n@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})\\nfn main(@builtin(local_invocation_id) localId : vec3,\\n @builtin(global_invocation_id) globalId : vec3,\\n @builtin(workgroup_id) workgroupId : vec3) {\\n let batch = ${u?\"0\":\"i32(globalId.z)\"};\\n ${o?`let batchIndices = ${o.offsetToIndices(\"u32(batch)\")};`:\"\"}\\n let num_tiles = ${u?`${Math.ceil(l/s)}`:\"(uniforms.dim_inner - 1) / tileInner + 1\"};\\n var kStart = ${u?`i32(globalId.z) * ${l}`:\"0\"};\\n\\n var acc : array, rowPerThread>;\\n\\n // Without this initialization strange values show up in acc.\\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\\n acc[innerRow][innerCol] = 0.0;\\n }\\n }\\n ${I}\\n }\\n`},Il=(e,t,r,o,n,s=!1)=>{let[u,l,a]=n,[p,m,f,b]=o,_=jt(u,a),y=jt(l,a),$=Pe(o[0].type.tensor),I=()=>{let A=m.rank,T=p.rank,D=`var aIndices: ${m.type.indices};`;for(let U=A-2-1,V=T-1;U>=0;U--,V--)D+=`\\naIndices[${U}] = ${T>1?`batchIndices[${V}]`:\"batchIndices\"};`;return _.forEach(U=>{D+=`\\naIndices[${U}] = 0;`}),D+=`\\naIndices[${A-2}] = u32(row);\\n aIndices[${A-1}] = u32(colIn);`,D},C=()=>{let A=f.rank,T=p.rank,D=`var bIndices: ${f.type.indices};`;for(let U=A-2-1,V=T-1;U>=0;U--,V--)D+=`\\nbIndices[${U}] = ${T>1?`batchIndices[${V}]`:\"batchIndices\"};`;return y.forEach(U=>{D+=`\\nbIndices[${U}] = 0;`}),D+=`\\nbIndices[${A-2}] = u32(row);\\n bIndices[${A-1}] = u32(colIn);`,D};return`\\n fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${p.type.indices}) -> ${Ze(e,$)} {\\n var value = ${Ze(e,$)}(0.0);\\n let col = colIn * ${e};\\n if(row < uniforms.dim_a_outer && col < uniforms.dim_inner)\\n {\\n ${I()}\\n value = ${m.getByIndices(\"aIndices\")};\\n }\\n return value;\\n }\\n\\n fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${p.type.indices}) -> ${Ze(e,$)} {\\n var value = ${Ze(e,$)}(0.0);\\n let col = colIn * ${e};\\n if(row < uniforms.dim_inner && col < uniforms.dim_b_outer)\\n {\\n ${C()}\\n value = ${f.getByIndices(\"bIndices\")};\\n }\\n return value;\\n }\\n\\n fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${Ze(e,$)}) {\\n let col = colIn * ${e};\\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\\n var value = valueIn;\\n let coords = vec3(batch, row, colIn);\\n ${t?`value = value + ${s?\"bias[colIn]\":`${Ze(e,$)}(bias[row])`};`:\"\"}\\n ${r}\\n ${b.setByIndices(\"vec3(coords)\",\"value\")}\\n }\\n }\\n `},an=(e,t,r,o,n=!1)=>{let s=e[0].dims,u=e[1].dims,l=s.slice(0,-2),a=u.slice(0,-2),p=o?o.slice(0,-2):r.slice(0,-2),m=z.size(p),f=s[s.length-2],b=s[s.length-1],_=u[u.length-1],y=b%4===0&&_%4===0,$=f<=8?[4,1,1]:[4,4,1],I=[8,8,1],C=[Math.ceil(_/I[0]/$[0]),Math.ceil(f/I[1]/$[1]),Math.ceil(m/I[2]/$[2])],v=y?4:1,A=[...l,f,b/v],T=A.length,D=[...a,b,_/v],U=D.length,V=[m,f,_/v],H=[{type:6,data:f},{type:6,data:_},{type:6,data:b}];dt(t,H),H.push(...j(p,A,D));let R=[\"rank\",\"rank\"],L=e.length>2;L&&(H.push(...j(e[2].dims)),R.push(\"rank\")),H.push(...j(V));let pe=Ie=>{let we=p.length,ne=jr(\"batchDims\",e[0].dataType,we,1),ze=Pe(e[0].dataType),Q=M(\"a\",e[0].dataType,T,v),xe=M(\"b\",e[1].dataType,U,v),me=F(\"result\",e[0].dataType,V.length,v),ue=[Q,xe];if(L){let G=n?v:1;ue.push(M(\"bias\",e[2].dataType,e[2].dims.length,G))}let se=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"}];lt(t,se);let he=Pe(me.type.tensor),Ae=ut(t,me.type.value,he),He=Il(v,L,Ae,[ne,Q,xe,me],[l,a,p],n);return`\\n ${Ie.registerUniforms(se).registerInternalVariables(ne).declareVariables(...ue,me)}\\n ${He}\\n ${y?gr($,I,ze,ne):yr($,I,ze,ne)}\\n `};return{name:\"MatMul\",shaderCache:{hint:`${$};${t.activation};${y};${n}`,inputDependencies:R},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:C[0],y:C[1],z:C[2]},programUniforms:H}),getShaderSource:pe}}});var Al,rs,ns=q(()=>{\"use strict\";ie();Pt();be();Ot();nn();qn();br();Al=(e,t,r,o,n=!1,s,u=4,l=4,a=4,p=\"f32\")=>{let m=L=>{switch(L){case 1:return\"resData = x[xIndex];\";case 3:return`resData = vec3<${p}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return\"resData = x[xIndex / 4];\";default:throw new Error(`innerElementSize ${L} is not supported.`)}},f=L=>{switch(L){case 1:return\"return w[row * i32(uniforms.w_shape[3]) + colIn];\";case 4:return\"return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];\";default:throw new Error(`innerElementSize ${L} is not supported.`)}},b=e?`\\n let coord = vec4(batch, xRow, xCol, xCh);\\n `:`\\n let coord = vec4(batch, xCh, xRow, xCol);\\n `,_=e?`\\n let coords = vec4(\\n batch,\\n row / outWidth,\\n row % outWidth,\\n col);\\n `:`\\n let coords = vec4(\\n batch,\\n row,\\n col / outWidth,\\n col % outWidth);\\n `,y=e?\"i32(uniforms.x_shape[1])\":\"i32(uniforms.x_shape[2])\",$=e?\"i32(uniforms.x_shape[2])\":\"i32(uniforms.x_shape[3])\",I=e?\"row\":\"col\",C=e?\"col\":\"row\",v=`\\n let inChannels = i32(uniforms.w_shape[2]);\\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\\n let outRow = ${I} / outWidth;\\n let outCol = ${I} % outWidth;\\n\\n let WRow = ${C} / (i32(uniforms.w_shape[1]) * inChannels);\\n let WCol = ${C} / inChannels % i32(uniforms.w_shape[1]);\\n let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0];\\n let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1];\\n let xCh = ${C} % inChannels;\\n var resData = ${Ze(u,p)}(0.0);\\n // The bounds checking is always needed since we use it to pad zero for\\n // the \\'same\\' padding type.\\n if (xRow >= 0 && xRow < ${y} && xCol >= 0 && xCol < ${$}) {\\n ${b}\\n let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape));\\n ${m(u)}\\n }\\n return resData;`,A=e?t&&o?`\\n let col = colIn * ${u};\\n ${v}`:`\\n let col = colIn * ${u};\\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\\n ${v}\\n }\\n return ${Ze(u,p)}(0.0);`:o&&r?`\\n let col = colIn * ${u};\\n ${v}`:`\\n let col = colIn * ${u};\\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\\n ${v}\\n }\\n return ${Ze(u,p)}(0.0);`,T=`${f(l)}`,D=Ze(a,p),U=e?Ze(u,p):Ze(l,p),V=e?Ze(l,p):Ze(u,p),H=ut(s,D,p);return`\\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${U} {\\n ${e?A:T}\\n }\\n\\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${V} {\\n ${e?T:A}\\n }\\n\\n fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${D}) {\\n let col = colIn * ${a};\\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer)\\n {\\n var value = valueIn;\\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\\n ${_}\\n ${rn(n)}\\n ${H}\\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\\n }\\n }`},rs=(e,t,r,o,n,s,u,l)=>{let a=t.format===\"NHWC\",p=a?e[0].dims[3]:e[0].dims[1],m=r[0],f=a?r[2]:r[3],b=a?r[1]:r[2],_=a?r[3]:r[1],y=a&&(p%4===0||p%3===0)&&_%4===0,$=a?_:f*b,I=a?f*b:_,C=[8,8,1],v=o<=8?[4,1,1]:[4,4,1],A=[Math.ceil($/C[0]/v[0]),Math.ceil(I/C[1]/v[1]),Math.ceil(m/C[2]/v[2])];De(\"verbose\",()=>`[conv2d_mm_webgpu] dispatch = ${A}`);let T=y?a&&p%4!==0?3:4:1,D=C[1]*v[1],U=C[0]*v[0],V=Math.max(C[0]*T,C[1]),H=o%D===0,R=n%U===0,L=s%V===0,pe=y?[T,4,4]:[1,1,1],Ie=[{type:6,data:o},{type:6,data:n},{type:6,data:s},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];dt(t,Ie),Ie.push(...j(e[0].dims,e[1].dims));let we=[\"rank\",\"rank\"];u&&(Ie.push(...j(e[2].dims)),we.push(\"rank\")),Ie.push(...j(r));let ne=ze=>{let Q=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"},{name:\"pad\",type:\"i32\",length:2},{name:\"stride\",type:\"i32\",length:2},{name:\"dilation\",type:\"i32\",length:2}];lt(t,Q);let xe=y?4:1,me=Pe(e[0].dataType),ue=`\\n fn setOutputAtIndex(flatIndex : i32, value : ${y?`vec4<${me}>`:me}) {\\n result[flatIndex] = ${y?`vec4<${me}>`:me}(value);\\n }\\n fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${y?`vec4<${me}>`:me}) {\\n let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3));\\n setOutputAtIndex(flatIndex ${y?\"/ 4\":\"\"}, value);\\n }`,se=M(\"x\",e[0].dataType,e[0].dims.length,T===3?1:T),he=M(\"w\",e[1].dataType,e[1].dims.length,xe),Ae=[se,he],He=F(\"result\",e[0].dataType,r.length,xe);if(u){let G=M(\"bias\",e[2].dataType,e[2].dims.length,xe);Ae.push(G),ue+=`\\n fn getBiasByOutputCoords(coords : vec4) -> ${y?`vec4<${me}>`:me} {\\n return bias[coords.${a?\"w\":\"y\"}${y?\"/ 4\":\"\"}];\\n }`}return`\\n ${on(\"uniforms.result_strides\")}\\n //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4,\\n // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2,\\n // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 };\\n ${ze.registerUniforms(Q).declareVariables(...Ae,He)}\\n ${ue}\\n ${Al(a,H,R,L,u,t,pe[0],pe[1],pe[2],me)}\\n ${y?gr(v,C,me,void 0,!a,V):yr(v,C,me,void 0,!a,V,!1,void 0,l)}`};return{name:\"Conv2DMatMul\",shaderCache:{hint:`${t.cacheKey};${T};${y};${H};${R};${L};${D};${U};${V}`,inputDependencies:we},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:A[0],y:A[1],z:A[2]},programUniforms:Ie}),getShaderSource:ne}}});var Kn,os,as=q(()=>{\"use strict\";ie();_e();be();jn();Ot();Kn=(e,t,r)=>{let o=e.length>2,n=o?\"value += b[output_channel];\":\"\",s=e[0].dims,u=e[1].dims,l=u[0]/t.group,a=t.format===\"NHWC\",p=sn(s,u,t.dilations,t.pads,t.strides,a),m=z.size(p),f=[{type:12,data:m},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:l}];dt(t,f),f.push(...j(s,u,p));let b=[\"rank\",\"rank\"];o&&(f.push(...j(e[2].dims)),b.push(\"rank\")),f.push(...j(p));let _=y=>{let $=F(\"output\",e[0].dataType,p.length),I=Pe($.type.tensor),C=ut(t,$.type.value,I),v=M(\"x\",e[0].dataType,s.length),A=M(\"w\",e[1].dataType,u.length),T=[v,A];o&&T.push(M(\"b\",e[2].dataType,e[2].dims));let D=[{name:\"output_size\",type:\"u32\"},{name:\"dilations\",type:\"u32\",length:t.dilations.length},{name:\"strides\",type:\"u32\",length:2},{name:\"pads\",type:\"u32\",length:2},{name:\"output_channels_per_group\",type:\"u32\"}];return lt(t,D),`\\n ${y.registerUniforms(D).declareVariables(...T,$)}\\n\\n ${y.mainStart()}\\n ${y.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n\\n let outputIndices = ${$.offsetToIndices(\"global_idx\")};\\n let batch: u32 = outputIndices[0];\\n let output_channel: u32 = outputIndices[${a?3:1}];\\n let xRCCorner: vec2 = vec2(outputIndices[${a?1:2}], outputIndices[${a?2:3}]) * uniforms.strides - uniforms.pads;\\n let group_id: u32 = output_channel / uniforms.output_channels_per_group;\\n\\n var value: ${$.type.value} = ${$.type.value}(0);\\n for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) {\\n let input_channel = group_id * uniforms.w_shape[1] + wInChannel;\\n for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) {\\n let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0];\\n\\n if (xHeight < 0u || xHeight >= uniforms.x_shape[${a?1:2}]) {\\n continue;\\n }\\n\\n for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) {\\n let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1];\\n if (xWidth < 0u || xWidth >= uniforms.x_shape[${a?2:3}]) {\\n continue;\\n }\\n\\n let xVal = ${a?v.get(\"batch\",\"xHeight\",\"xWidth\",\"input_channel\"):v.get(\"batch\",\"input_channel\",\"xHeight\",\"xWidth\")};\\n let wVal = ${A.get(\"output_channel\",\"wInChannel\",\"wHeight\",\"wWidth\")};\\n value += xVal*wVal;\\n }\\n }\\n }\\n ${n}\\n ${C}\\n ${$.setByOffset(\"global_idx\",\"value\")}\\n }`};return{name:\"GroupedConv\",shaderCache:{hint:t.cacheKey,inputDependencies:b},getRunData:()=>({outputs:[{dims:r?r(p):p,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:f}),getShaderSource:_}},os=(e,t,r)=>{let o=e.length>2,n=Me(r[3]),s=Me(r[2]),u=z.size(r)/n/s,l=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/n],a=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/n],p=[r[0],r[1],r[2],r[3]/n],m=[{type:12,data:u},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];dt(t,m),m.push(...j(l,a,p));let f=(s-1)*t.strides[1]+a[1],b=_=>{let y=F(\"output\",e[0].dataType,p.length,n),$=Pe(y.type.tensor),I=ut(t,y.type.value,$),C=M(\"x\",e[0].dataType,l.length,n),v=M(\"w\",e[1].dataType,a.length,n),A=[C,v];o&&A.push(M(\"b\",e[2].dataType,e[2].dims,n));let T=o?\"value += b[output_channel];\":\"\",D=[{name:\"output_size\",type:\"u32\"},{name:\"strides\",type:\"i32\",length:2},{name:\"pads\",type:\"i32\",length:2}];return lt(t,D),`\\n ${_.registerUniforms(D).declareVariables(...A,y)}\\n ${_.mainStart()}\\n ${_.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n let width0 = uniforms.output_shape[3];\\n let output_channel = global_idx % width0;\\n var index1 = global_idx / width0;\\n let width1 = uniforms.output_shape[2] / ${s}u;\\n let col = (index1 % width1) * ${s}u;\\n index1 = index1 / width1;\\n let row = index1 % uniforms.output_shape[1];\\n let batch = index1 / uniforms.output_shape[1];\\n\\n let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads;\\n\\n var x_vals: array<${C.type.value}, ${f}>;\\n var values: array<${y.type.value}, ${s}>;\\n let input_channel = output_channel;\\n // Use constant instead of uniform can give better performance for w\\'s height/width.\\n for (var w_height: u32 = 0u; w_height < ${a[0]}; w_height++) {\\n let x_height = x_corner.x + i32(w_height);\\n if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) {\\n for (var i = 0; i < ${f}; i++) {\\n let x_width = x_corner.y + i;\\n if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) {\\n x_vals[i] = ${C.get(\"batch\",\"u32(x_height)\",\"u32(x_width)\",\"input_channel\")};\\n } else {\\n x_vals[i] = ${C.type.value}(0);\\n }\\n }\\n for (var w_width: u32 = 0u; w_width < ${a[1]}; w_width++) {\\n let w_val = ${v.get(\"w_height\",\"w_width\",\"0\",\"output_channel\")};\\n for (var i = 0u; i < ${s}u; i++) {\\n values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]);\\n }\\n }\\n }\\n }\\n\\n for (var i = 0u; i < ${s}u; i++) {\\n var value = values[i];\\n ${T}\\n ${I}\\n ${y.set(\"batch\",\"row\",\"col + i\",\"output_channel\",\"value\")};\\n }\\n }`};return{name:\"GroupedConv-Vectorize\",shaderCache:{hint:`${t.cacheKey};${n};${s};${f};${a[0]};${a[1]}`,inputDependencies:o?[\"rank\",\"rank\",\"type\"]:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:b}}});var Yn,Tl,is,Zn=q(()=>{\"use strict\";ie();_e();br();be();Ot();Yn=(e,t,r,o,n=!1)=>{let s=e[0].dims,u=e[1].dims,l=s[s.length-2],a=u[u.length-1],p=s[s.length-1],m=Me(a),f=Me(p),b=Me(l),_=z.size(r)/m/b,y=e.length>2,$=o?o.slice(0,-2):r.slice(0,-2),C=[z.size($),l,a],v=[{type:12,data:_},{type:12,data:l},{type:12,data:a},{type:12,data:p}];dt(t,v),v.push(...j($,s,u)),y&&v.push(...j(e[2].dims)),v.push(...j(C));let A=T=>{let D=jr(\"batch_dims\",e[0].dataType,$.length),U=M(\"a\",e[0].dataType,s.length,f),V=M(\"b\",e[1].dataType,u.length,m),H=F(\"output\",e[0].dataType,C.length,m),R=Pe(H.type.tensor),L=ut(t,H.type.value,R),pe=[U,V],Ie=\"\";if(y){let se=n?m:1;pe.push(M(\"bias\",e[2].dataType,e[2].dims.length,se)),Ie=`${n?`value += bias[col / ${se}];`:`value += ${H.type.value}(bias[row + i]);`}`}let we=s.slice(0,-2),ne=u.slice(0,-2),ze=jt(we,$),Q=jt(ne,$),xe=[{name:\"output_size\",type:\"u32\"},{name:\"M\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"K\",type:\"u32\"}];lt(t,xe);let me=(se,he)=>{let Ae=se.rank,He=se.name;if(Ae===2)return`var ${He}_indices = ${se.type.indices}(0u, 0u);`;let G=D.rank,J=`var ${He}_indices: ${se.type.indices};`;for(let Se=Ae-2-1,Qe=G-1;Se>=0;Se--,Qe--)J+=`\\n${He}_indices[${Se}] = ${G>1?`batch_indices[${Qe}]`:\"batch_indices\"};`;return he.forEach(Se=>{J+=`\\n${He}_indices[${Se}] = 0;`}),J+=`${He}_indices[${Ae-2}] = 0u;\\n ${He}_indices[${Ae-1}] = 0u;`,J},ue=()=>{let se=`var a_data: ${U.type.value};`;for(let he=0;he;\\n for (var k: u32 = 0u; k < uniforms.K; k = k + ${f}) {\\n ${ue()}\\n }\\n for (var i = 0u; i < ${b}u; i++) {\\n var value = values[i];\\n ${Ie}\\n ${L}\\n let cur_indices = ${H.type.indices}(batch, row + i, col);\\n let offset = ${H.indicesToOffset(\"cur_indices\")};\\n ${H.setByOffset(`offset / ${m}`,\"value\")};\\n }\\n }\\n `};return{name:\"MatMulNaive\",shaderCache:{hint:`${t.activation};${m};${f};${b};${n}`,inputDependencies:y?[\"rank\",\"rank\",\"rank\"]:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:A}},Tl=e=>{if(!e||e.length!==2)throw new Error(\"MatMul requires 2 inputs.\");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error(\"shared dimension does not match.\")},is=e=>{Tl(e.inputs);let t=mt.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw new Error(\"Can\\'t use matmul on the given tensors\");let r=t[t.length-1],o=e.inputs[0].dims[e.inputs[0].dims.length-1];r<8&&o<8?e.compute(Yn(e.inputs,{activation:\"\"},t)):e.compute(an(e.inputs,{activation:\"\"},t))}});var sn,Qn,El,ss,Xn,Pl,Ol,Jn,jn=q(()=>{\"use strict\";_e();ns();br();as();Ot();Zn();Yt();sn=(e,t,r,o,n,s)=>{let u=e[0],l=e.slice(s?1:2,s?3:4),a=l.length,p=t[0],f=t.slice(2).map((y,$)=>y+(y-1)*(r[$]-1)),_=l.map((y,$)=>y+o[$]+o[$+a]).map((y,$)=>Math.floor((y-f[$]+n[$])/n[$]));return _.splice(0,0,u),_.splice(s?3:1,0,p),_},Qn=[2,3,1,0],El=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw new Error(\"Conv requires 2 or 3 inputs\");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error(\"currently only support conv 1D and 2D\");if(e[0].dims.length!==e[1].dims.length)throw new Error(\"filter does not have same dimension as input\");let r=e[0].dims[t.format===\"NHWC\"?e[0].dims.length-1:1],o=e[1].dims[1]*t.group;if(r!==o)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error(\"invalid bias\");let n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==n*2)throw new Error(`pads should be ${n*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw new Error(\"invalid kernel shape\")},ss=(e,t)=>{let r=e.kernelShape.slice();for(let s=2;s{let t=tn(e),r=e.format,o=[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][e.auto_pad],n=e.dilations,s=e.group,u=e.kernel_shape,l=e.pads,a=e.strides,p=e.w_is_const();return{autoPad:o,format:r,dilations:n,group:s,kernelShape:u,pads:l,strides:a,wIsConst:p,...t,cacheKey:`${e.format};${t.activation};`}},Pl=(e,t,r)=>{let o=ss(r,t),n=r.format===\"NHWC\";if(r.group!==1){if(!e.adapterInfo.isArchitecture(\"ampere\")&&n&&t[1].dims[0]===r.group&&t[1].dims[1]===1&&r.dilations[0]===1&&r.dilations[1]===1){let V=sn(t[0].dims,t[1].dims,r.dilations,o.pads,r.strides,n),H=e.kernelCustomData.wT??e.compute(ot(t[1],Qn),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=H);let R=[t[0],H];t.length===3&&R.push(t[2]),e.compute(os(R,o,V),{inputs:R})}else e.compute(Kn(t,o));return}let s=t.length===3,u=t[0].dims[n?1:2],l=t[0].dims[n?2:3],a=t[0].dims[n?3:1],p=t[1].dims[2],m=t[1].dims[3],f=sn(t[0].dims,t[1].dims,r.dilations,o.pads,r.strides,n),b=f[n?1:2],_=f[n?2:3],y=f[n?3:1],$=n&&p===u&&m===l&&r.pads[0]===0&&r.pads[1]===0;if($||p===1&&m===1&&r.dilations[0]===1&&r.dilations[1]===1&&r.strides[0]===1&&r.strides[1]===1&&r.pads[0]===0&&r.pads[1]===0){let U=f[0],V,H,R,L=[];if(n){let we=e.kernelCustomData.wT??e.compute(ot(t[1],Qn),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];if(r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=we),$){let ne=u*l*a;V=t[0].reshape([1,U,ne]),H=we.reshape([1,ne,y]),R=[1,U,y]}else V=t[0].reshape([U,u*l,a]),H=we.reshape([1,a,y]),R=[U,b*_,y];L.push(V),L.push(H)}else V=t[0].reshape([U,a,u*l]),H=t[1].reshape([1,y,a]),R=[U,y,b*_],L.push(H),L.push(V);s&&L.push(t[2]);let pe=R[2],Ie=L[0].dims[L[0].dims.length-1];pe<8&&Ie<8?e.compute(Yn(L,o,f,R,n),{inputs:L}):e.compute(an(L,o,f,R,n),{inputs:L});return}let I=!0,C=e.kernelCustomData.wT??e.compute(ot(t[1],Qn),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=C);let v=[t[0],C];s&&v.push(t[2]);let A=n?b*_:y,T=n?y:b*_,D=p*m*a;e.compute(rs(v,o,f,A,T,D,s,I),{inputs:v})},Ol=(e,t)=>{let r=t.format===\"NHWC\",o=[e.inputs[0].reshape(r?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&o.push(e.inputs[2]);let n=[0,t.pads[0],0,t.pads[1]],s=[1].concat(t.strides),u=[1].concat(t.dilations),l=[1].concat(t.kernelShape),a=ss({...t,pads:n,strides:s,dilations:u,kernelShape:l},o);e.compute(Kn(o,a,p=>r?[p[0],p[2],p[3]]:[]))},Jn=(e,t)=>{El(e.inputs,t),e.inputs[0].dims.length===3?Ol(e,t):Pl(e,e.inputs,t)}});var kl,us,ds=q(()=>{\"use strict\";ie();Pt();be();Ot();nn();qn();br();kl=(e,t=!1,r,o,n=4)=>{let s=C=>{switch(C){case 1:return\"return w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\";case 4:return`\\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\\n let v0 = w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\\n let v1 = w[getIndexFromCoords4D(coord1, vec4(uniforms.w_shape))];\\n let v2 = w[getIndexFromCoords4D(coord2, vec4(uniforms.w_shape))];\\n let v3 = w[getIndexFromCoords4D(coord3, vec4(uniforms.w_shape))];\\n return ${o}(v0, v1, v2, v3);\\n `;default:throw new Error(`innerElementSize ${C} is not supported.`)}},u=e?`\\n let coord = vec4(batch, iXR, iXC, xCh);\\n `:`\\n let coord = vec4(batch, xCh, iXR, iXC);\\n `,l=e?`\\n let coords = vec4(\\n batch,\\n row / outWidth,\\n row % outWidth,\\n col);\\n `:`\\n let coords = vec4(\\n batch,\\n row,\\n col / outWidth,\\n col % outWidth);\\n `,a=e?\"i32(uniforms.x_shape[1])\":\"i32(uniforms.x_shape[2])\",p=e?\"i32(uniforms.x_shape[2])\":\"i32(uniforms.x_shape[3])\",m=e?\"row\":\"col\",f=e?\"col\":\"row\",b=`\\n let inChannels = ${e?\"i32(uniforms.x_shape[3])\":\"i32(uniforms.x_shape[1])\"};\\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\\n let outRow = ${m} / outWidth;\\n let outCol = ${m} % outWidth;\\n\\n let WRow = ${f} / (uniforms.filter_dims[1] * inChannels);\\n let WCol = ${f} / inChannels % uniforms.filter_dims[1];\\n let xR = f32(outRow - uniforms.pads[0] + uniforms.dilations[0] * WRow) / f32(uniforms.strides[0]);\\n let xC = f32(outCol - uniforms.pads[1] + uniforms.dilations[1] * WCol) / f32(uniforms.strides[1]);\\n if (xR < 0.0 || xR >= f32(${a}) || fract(xR) > 0.0) {\\n return ${o}(0.0);\\n }\\n if (xC < 0.0 || xC >= f32(${p}) || fract(xC) > 0.0) {\\n return ${o}(0.0);\\n }\\n let iXR = i32(xR);\\n let iXC = i32(xC);\\n let xCh = ${f} % inChannels;\\n ${u}\\n return x[getIndexFromCoords4D(coord, vec4(uniforms.x_shape))/${n}];`,_=e?`\\n let col = colIn * ${n};\\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\\n ${b}\\n }\\n return ${o}(0.0);`:`\\n let col = colIn * ${n};\\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\\n ${b}\\n }\\n return ${o}(0.0);`,y=`\\n let col = colIn * ${n};\\n let inChannels = ${e?\"i32(uniforms.x_shape[3])\":\"i32(uniforms.x_shape[1])\"};\\n let coordX = uniforms.filter_dims[0] - 1 - row / (uniforms.filter_dims[1] * inChannels);\\n let coordY = uniforms.filter_dims[1] - 1 - (row / inChannels) % uniforms.filter_dims[1];\\n if (${e?\"row < uniforms.dim_inner && col < uniforms.dim_b_outer\":\"row < uniforms.dim_inner && col < uniforms.dim_a_outer\"} && coordX >= 0 && coordY >= 0) {\\n let rowInner = row % inChannels;\\n let coord = vec4(coordX, coordY, col, rowInner);\\n ${s(n)}\\n }\\n return ${o}(0.0);\\n `,$=ut(r,o);return`\\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${o} {\\n ${e?_:y}\\n }\\n\\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${o} {\\n ${e?y:_}\\n }\\n\\n fn mm_write(batch: i32, row : i32, colIn : i32, valueInput : ${o}) {\\n let col = colIn * ${n};\\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\\n var value = valueInput;\\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\\n ${l}\\n ${rn(t)}\\n ${$}\\n result[getIndexFromCoords4D(coords, vec4(uniforms.result_shape))/${n}] = value;\\n }\\n }`},us=(e,t,r,o,n,s,u,l)=>{let a=t.format===\"NHWC\",p=a?e[0].dims[3]:e[0].dims[1],m=r[0],f=a?r[2]:r[3],b=a?r[1]:r[2],_=a?r[3]:r[1],y=a?p%4===0&&_%4===0:f%4===0&&_%4===0,$=a?_:f*b,I=a?f*b:_,C=y?[8,8,1]:[$<=4||I<=4?4:16,$>4&&I<=4?4:16,1],v=y?[4,4,1]:[$<=4?1:4,$>4&&I<=4?1:4,1],A=[Math.ceil($/C[0]/v[0]),Math.ceil(I/C[1]/v[1]),Math.ceil(m/C[2]/v[2])];De(\"verbose\",()=>`[conv_backprop_mm_webgpu] dispatch = ${A}`);let T=y?4:1,D=Math.max(C[0]*T,C[1]),U=y?4:1,V=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],H=[V[0]+(t.dilations[0]<=1?0:(V[0]-1)*(t.dilations[0]-1)),V[1]+(t.dilations[1]<=1?0:(V[1]-1)*(t.dilations[1]-1))],R=[H[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),H[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],L=[{type:6,data:o},{type:6,data:n},{type:6,data:s},{type:6,data:t.strides},{type:6,data:t.dilations},{type:6,data:V},{type:6,data:R}];dt(t,L),L.push(...j(e[0].dims,e[1].dims));let pe=[\"rank\",\"rank\"];u&&(L.push(...j(e[2].dims)),pe.push(\"rank\")),L.push(...j(r));let Ie=we=>{let ne=M(\"x\",e[0].dataType,e[0].dims.length,U),ze=M(\"w\",e[1].dataType,e[1].dims.length,1),Q=F(\"result\",e[0].dataType,r.length,U),xe=[ne,ze],me=\"\";if(u){let he=M(\"bias\",e[2].dataType,e[2].dims.length,U);xe.push(he),me+=`\\n fn getBiasByOutputCoords(coords : vec4) -> ${he.type.value} {\\n return bias[coords.${a?\"w\":\"y\"}${y?\"/ 4\":\"\"}];\\n }`}let ue=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"},{name:\"strides\",type:\"i32\",length:2},{name:\"dilations\",type:\"i32\",length:2},{name:\"filter_dims\",type:\"i32\",length:V.length},{name:\"pads\",type:\"i32\",length:R.length}];lt(t,ue);let se=Pe(e[0].dataType,1);if(se!==\"f16\"&&se!==\"f32\")throw new Error(`elemType ${se} is not supported.`);return`\\n ${on(\"uniforms.result_strides\")}\\n ${we.registerUniforms(ue).declareVariables(...xe,Q)};\\n ${me}\\n ${kl(a,u,t,ne.type.value,T)}\\n ${y?gr(v,C,se,void 0,!a,D):yr(v,C,se,void 0,!a,D,!1,void 0,l)}`};return{name:\"Conv2DTransposeMatMul\",shaderCache:{hint:`${t.cacheKey};${v};${C};${y}`,inputDependencies:pe},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:A[0],y:A[1],z:A[2]},programUniforms:L}),getShaderSource:Ie}}});var Rl,eo,ls=q(()=>{\"use strict\";ie();Pt();_e();be();Rl=(e,t,r,o,n,s=!1,u,l,a=!1)=>{let p=a?1:2,m=a?2:3,f=a?3:1,b=s?2:1,_=`\\n fn setOutputAtIndex(flatIndex : u32, value : ${s?`vec4<${u}>`:u}) {\\n result[flatIndex] = ${s?`vec4<${u}>`:u}(value);\\n }`;o&&(_+=`\\n fn getBiasByOutputCoords(coords : vec4) -> ${s?`vec4<${u}>`:u} {\\n return bias[coords.${a?\"w\":\"y\"}${s?\"/ 4\":\"\"}];\\n }`);let y=s?4:1,$=M(\"W\",t[1].dataType,t[1].dims.length,y),I=M(\"Dy\",t[0].dataType,t[0].dims.length,y),C=[I,$];o&&C.push(M(\"bias\",t[2].dataType,[r[f]].length,y));let v=F(\"result\",t[0].dataType,r.length,y),A=`{\\n let batch: u32 = ${n?\"global_id.z\":\"workgroup_id.z\"} / uniforms.result_shape[1];\\n let r = ${n?\"global_id.z\":\"workgroup_id.z\"} % uniforms.result_shape[1];\\n let c = ${n?\"global_id.y\":\"workgroup_id.y\"} * ${b};\\n let d1: u32 = ${n?\"global_id.x\":\"workgroup_id.x\"} * 4;\\n\\n let dyCorner = vec2(i32(r), i32(c)) - vec2(uniforms.pads);\\n\\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\\n // ? = to be determined. : = across all values in that axis.\\n var dotProd: array, ${b}>;\\n for (var i = 0; i < ${b}; i++) {\\n dotProd[i] = vec4<${u}>(0.0);\\n }\\n for (var wR: u32 = 0; wR < uniforms.filter_dims[0]; wR = wR + 1) {\\n var dyR = (${u}(dyCorner.x) + ${u}(wR)) / ${u}(uniforms.strides.x);\\n let wRPerm = uniforms.filter_dims[0] - 1 - wR;\\n if (dyR < 0.0 || dyR >= ${u}(uniforms.Dy_shape[1]) ||\\n fract(dyR) > 0.0 || wRPerm < 0) {\\n continue;\\n }\\n let idyR: u32 = u32(dyR);\\n\\n for (var wC: u32 = 0; wC < uniforms.filter_dims[1]; wC = wC + 1) {\\n let dyC = (${u}(dyCorner.y) + ${u}(wC)) / ${u}(uniforms.strides.y);\\n let dyC2 = (${u}(dyCorner.y) + 1.0 + ${u}(wC)) / ${u}(uniforms.strides.y);\\n let wCPerm = uniforms.filter_dims[1] - 1 - wC;\\n if (wCPerm < 0) {\\n continue;\\n }\\n var bDyCVal = true;\\n var bDyCVal2 = true;\\n if (dyC < 0.0 || dyC >= ${u}(uniforms.Dy_shape[2]) ||\\n fract(dyC) > 0.0) {\\n bDyCVal = false;\\n }\\n if (dyC2 < 0.0 || dyC2 >= ${u}(uniforms.Dy_shape[2]) ||\\n fract(dyC2) > 0.0) {\\n bDyCVal2 = false;\\n }\\n\\n let idyC: u32 = u32(dyC);\\n let idyC2: u32 = u32(dyC2);\\n if (bDyCVal && bDyCVal2) {\\n let d2Length = uniforms.Dy_shape[3];\\n for (var d2 :u32 = 0; d2 < d2Length; d2 = d2 + 4) {\\n let wValue0 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\\n let wValue1 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\\n let wValue2 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\\n let wValue3 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\\n\\n var xValue = ${I.get(\"batch\",\"idyR\",\"idyC\",\"d2\")};\\n let tmpval = vec4<${u}>(dot(xValue, wValue0),\\n dot(xValue, wValue1),\\n dot(xValue, wValue2),\\n dot(xValue, wValue3));\\n dotProd[0] = dotProd[0] + tmpval;\\n\\n xValue = ${I.get(\"batch\",\"idyR\",\"idyC2\",\"d2\")};\\n\\n dotProd[1] = dotProd[1] + vec4<${u}>(dot(xValue, wValue0),\\n dot(xValue, wValue1),\\n dot(xValue, wValue2),\\n dot(xValue, wValue3));\\n }\\n } else if (bDyCVal) {\\n let d2Length = uniforms.Dy_shape[${f}];\\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\\n let wValue0 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\\n let wValue1 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\\n let wValue2 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\\n let wValue3 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\\n\\n var xValue = ${I.get(\"batch\",\"idyR\",\"idyC\",\"d2\")};\\n let tmpval = vec4<${u}>(dot(xValue, wValue0),\\n dot(xValue, wValue1),\\n dot(xValue, wValue2),\\n dot(xValue, wValue3));\\n dotProd[0] = dotProd[0] + tmpval;\\n }\\n } else if (bDyCVal2) {\\n let d2Length = uniforms.Dy_shape[3];\\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\\n let wValue0 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\\n let wValue1 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\\n let wValue2 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\\n let wValue3 = ${$.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\\n\\n var xValue = ${I.get(\"batch\",\"idyR\",\"idyC2\",\"d2\")};\\n let tmpval = vec4<${u}>(dot(xValue, wValue0),\\n dot(xValue, wValue1),\\n dot(xValue, wValue2),\\n dot(xValue, wValue3));\\n dotProd[1] = dotProd[1] + tmpval;\\n }\\n }\\n }\\n }\\n\\n for (var i: u32 = 0; i < ${b}; i = i + 1) {\\n let value = dotProd[i] + ${o?\"bias[c+i]\":`vec4<${u}>(0.0)`};\\n ${v.set(\"batch\",\"r\",\"c + i\",\"d1\",\"value\")};\\n }\\n }`,T=`\\n let outputIndices = ${v.offsetToIndices(\"global_idx\")};\\n let batch = ${v.indicesGet(\"outputIndices\",0)};\\n let d1 = ${v.indicesGet(\"outputIndices\",f)};\\n let r = ${v.indicesGet(\"outputIndices\",p)};\\n let c = ${v.indicesGet(\"outputIndices\",m)};\\n let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads;\\n let dyRCorner = dyCorner.x;\\n let dyCCorner = dyCorner.y;\\n let groupId = d1 / uniforms.output_channels_per_group;\\n let wOutChannel = d1 - groupId * uniforms.output_channels_per_group;\\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\\n // ? = to be determined. : = across all values in that axis.\\n var dotProd = ${u}(0.0);\\n for (var wR: u32 = 0; wR < uniforms.effective_filter_dims.x; wR = wR + 1) {\\n if (wR % uniforms.dilations.x != 0) {\\n continue;\\n }\\n let dyR = (${u}(dyRCorner) + ${u}(wR)) / ${u}(uniforms.strides[0]);\\n let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x;\\n if (dyR < 0.0 || dyR >= ${u}(uniforms.Dy_shape[${p}]) || fract(dyR) > 0.0 ||\\n wRPerm < 0) {\\n continue;\\n }\\n let idyR: u32 = u32(dyR);\\n\\n for (var wC: u32 = 0; wC < uniforms.effective_filter_dims.y; wC = wC + 1) {\\n if (wC % uniforms.dilations.y != 0) {\\n continue;\\n }\\n let dyC = (${u}(dyCCorner) + ${u}(wC)) / ${u}(uniforms.strides.y);\\n let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y;\\n if (dyC < 0.0 || dyC >= ${u}(uniforms.Dy_shape[${m}]) ||\\n fract(dyC) > 0.0 || wCPerm < 0) {\\n continue;\\n }\\n let idyC: u32 = u32(dyC);\\n var inputChannel = groupId * uniforms.input_channels_per_group;\\n for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group; d2 = d2 + 1) {\\n let xValue = ${a?I.get(\"batch\",\"idyR\",\"idyC\",\"inputChannel\"):I.get(\"batch\",\"inputChannel\",\"idyR\",\"idyC\")};\\n let wValue = ${$.get(\"inputChannel\",\"wOutChannel\",\"u32(wRPerm)\",\"u32(wCPerm)\")};\\n dotProd = dotProd + xValue * wValue;\\n inputChannel = inputChannel + 1;\\n }\\n }\\n }\\n let value = dotProd + ${o?\"bias[d1]\":`${u}(0.0)`};\\n ${v.setByOffset(\"global_idx\",\"value\")};\\n `;return`\\n ${e.registerUniforms(l).declareVariables(...C,v)}\\n ${_}\\n\\n ${e.mainStart()}\\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")};\\n ${s?A:T}}`},eo=(e,t,r)=>{let o=e.length>2,n=t.outputShape,s=z.size(n),u=[Math.ceil(s/64),1,1];De(\"verbose\",()=>`[conv2d_backprop_webgpu] dispatch = ${u}`);let l=t.format===\"NHWC\",a=[\"rank\",\"rank\"],p=[t.strides[0],t.strides[1]],m=[t.kernelShape[l?1:2],t.kernelShape[l?2:3]],f=[t.dilations[0],t.dilations[1]],b=[m[0]+(t.dilations[0]<=1?0:(t.kernelShape[l?1:2]-1)*(t.dilations[0]-1)),m[1]+(t.dilations[1]<=1?0:(t.kernelShape[l?2:3]-1)*(t.dilations[1]-1))],_=[b[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),b[1]-1-Math.floor(t.pads[1]+t.pads[3])/2],y=!1,$=t.group,I=e[1].dims,C=I[0]/$,v=I[1],A=[{type:6,data:s},{type:12,data:p},{type:12,data:m},{type:12,data:f},{type:12,data:b},{type:6,data:_},{type:12,data:C},{type:12,data:v},...j(e[0].dims,e[1].dims)];o&&(A.push(...j(e[2].dims)),a.push(\"rank\")),A.push(...j(n));let T=u[1]===1&&u[2]===1,D=U=>{let V=[{name:\"output_size\",type:\"u32\"},{name:\"strides\",type:\"u32\",length:p.length},{name:\"filter_dims\",type:\"u32\",length:m.length},{name:\"dilations\",type:\"u32\",length:m.length},{name:\"effective_filter_dims\",type:\"u32\",length:b.length},{name:\"pads\",type:\"i32\",length:_.length},{name:\"input_channels_per_group\",type:\"u32\"},{name:\"output_channels_per_group\",type:\"u32\"}],H=Pe(e[0].dataType);return`${Rl(U,e,n,o,T,y,H,V,l)}`};return{name:\"ConvTranspose2D\",shaderCache:{hint:`${t.cacheKey};`,inputDependencies:a},getRunData:()=>({dispatchGroup:{x:u[0],y:u[1],z:u[2]},outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],programUniforms:A}),getShaderSource:D}}});var Bl,Dl,Ml,cs,ps,zl,Ul,Vl,Nl,ms,fs=q(()=>{\"use strict\";ds();ls();Ot();Yt();Bl=(e,t,r,o,n,s)=>(e-1)*t+r+(o-1)*n+1-s,Dl=(e,t,r,o,n)=>{let s=Math.floor(e/2);t===\"SAME_UPPER\"?(r[o]=s,r[n]=e-s):t===\"SAME_LOWER\"&&(r[o]=e-s,r[n]=s)},Ml=(e,t,r,o,n,s,u,l,a,p)=>{let m=e.length-2,f=p.length===0;if(a.length===0)for(let y=0;y{let r=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((f,b)=>f*b,1)===0){r.length=0;for(let f=2;ff+b,0)===0){let f=t[0].dims.length-2;a=new Array(f).fill(1)}let p=e.strides.slice();if(p.reduce((f,b)=>f+b,0)===0){let f=t[0].dims.length-2;p=new Array(f).fill(1)}Ml(l,r,a,e.autoPad,e.group,n,p,o,u,s);let m=Object.assign({},e);return Object.assign(m,{kernelShape:r,pads:n,outputPadding:u,outputShape:s,dilations:a,strides:p}),m},ps=e=>{let t=tn(e),r=e.format,o=[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][typeof e.autoPad>\"u\"?0:e.autoPad],n=e.dilations,s=e.group,u=e.kernelShape,l=e.pads,a=e.strides,p=e.wIsConst(),m=e.outputPadding,f=e.outputShape;return{autoPad:o,format:r,dilations:n,group:s,kernelShape:u,outputPadding:m,outputShape:f,pads:l,strides:a,wIsConst:p,...t,cacheKey:`${e.format};${t.activation};`}},zl=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw new Error(\"Conv requires 2 or 3 inputs\");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error(\"currently only support 2-dimensional conv\");if(e[0].dims.length!==e[1].dims.length)throw new Error(\"filter does not have same dimension as input\");let r=e[0].dims[t.format===\"NHWC\"?e[0].dims.length-1:1],o=e[1].dims[0];if(r!==o)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");let n=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==n))throw new Error(\"invalid bias\");let s=e[0].dims.length-2;if(t.dilations.reduce((m,f)=>m+f,0)>0&&t.dilations.length!==s)throw new Error(`dilations should be ${s}D`);if(t.strides.reduce((m,f)=>m+f,0)>0&&t.strides.length!==s)throw new Error(`strides should be ${s}D`);if(t.pads.reduce((m,f)=>m+f,0)>0&&t.pads.length!==s*2)throw new Error(`pads should be ${s*2}D`);if(t.outputPadding.length!==s&&t.outputPadding.length!==0)throw new Error(`output_padding should be ${s}D`);if(t.kernelShape.reduce((m,f)=>m+f,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw new Error(\"invalid output shape\")},Ul=[2,3,1,0],Vl=(e,t,r)=>{let o=cs(r,t),n=r.format===\"NHWC\",s=o.outputShape,u=s[n?3:1],l=t[0].dims[n?3:1];if(o.group!==1||u===1&&l===1){e.compute(eo(t,o));return}let a=s[n?1:2],p=s[n?2:3],m=t[1].dims[2],f=t[1].dims[3],b=n?a*p:u,_=n?u:a*p,y=m*f*l,$=!0,I=e.kernelCustomData.wT??e.compute(ot(t[1],Ul),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=I);let C=[t[0],I],v=t.length===3;v&&(!n&&t[2].dims.length===1?C.push(t[2].reshape([t[2].dims[0],1,1])):C.push(t[2])),e.compute(us(C,o,s,b,_,y,v,$),{inputs:C})},Nl=(e,t)=>{let r=t.format===\"NHWC\",o=[e.inputs[0].reshape(r?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];o.length===3&&o.push(e.inputs[2]);let n=t.kernelShape;(n.length===0||n[0]===0)&&(n=[e.inputs[1].dims[2]]);let s=t.dilations;(s.length===0||s[0]===0)&&(s=[1]);let u=t.strides;(u.length===0||u[0]===0)&&(u=[1]);let l=t.pads;l.length===0&&(l=[0,0]),l=[0,l[0],0,l[1]],u=[1].concat(u),s=[1].concat(s),n=[1].concat(n);let a=cs({...t,pads:l,strides:u,dilations:s,kernelShape:n},o);e.compute(eo(o,a,p=>r?[p[0],p[2],p[3]]:[p[0],p[1],p[3]]))},ms=(e,t)=>{zl(e.inputs,t),e.inputs[0].dims.length===3?Nl(e,t):Vl(e,e.inputs,t)}});var Wl,hs,gs,ys=q(()=>{\"use strict\";ie();_e();je();be();Wl=(e,t,r,o)=>{let n=z.size(t),s=t.length,u=M(\"input\",e,s),l=F(\"output\",e,s),a=r.dataType===6?r.getInt32Array()[0]:Number(r.getBigInt64Array()[0]),p=z.normalizeAxis(a,s),m=f=>{let b=` i32(${u.indicesGet(\"inputIndices\",\"uniforms.axis\")}) `,_=re(\"uniforms.input_shape\",\"uniforms.axis\",s),y=o.reverse?b+(o.exclusive?\" + 1\":\"\"):\"0\",$=o.reverse?_:b+(o.exclusive?\"\":\" + 1\");return`\\n ${f.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axis\",\"u32\").declareVariables(u,l)}\\n ${f.mainStart()}\\n ${f.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n var inputIndices = ${l.offsetToIndices(\"global_idx\")};\\n var sum = ${l.type.value}(0);\\n let first : i32 = ${y};\\n let last : i32 = ${$};\\n for (var i : i32 = first; i < last; i++) {\\n ${u.indicesSet(\"inputIndices\",\"uniforms.axis\",\"u32(i)\")};\\n sum = sum + ${u.getByIndices(\"inputIndices\")};\\n }\\n ${l.setByOffset(\"global_idx\",\"sum\")};\\n }`};return{name:\"CumSum\",shaderCache:{hint:o.cacheKey,inputDependencies:[\"rank\"]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},{type:6,data:p},...j(t,t)]}),getShaderSource:m}},hs=(e,t)=>{let r=e.inputs[0].dims,o=e.inputs[0].dataType,n=e.inputs[1];e.compute(Wl(o,r,n,t),{inputs:[0]})},gs=e=>{let t=e.exclusive===1,r=e.reverse===1;return $e({exclusive:t,reverse:r})}});var to,un,bs,Gl,Hl,ro,no,ws,Ll,vs,$s,_s=q(()=>{\"use strict\";ie();_e();je();be();to=\"[a-zA-Z]|\\\\\\\\.\\\\\\\\.\\\\\\\\.\",un=\"(\"+to+\")+\",bs=\"^\"+un+\"$\",Gl=\"(\"+un+\",)*\"+un,Hl=\"^\"+Gl+\"$\",ro=class{constructor(t=-1){this.symbolToIndices=new Map,this.inputIndex=t}addSymbol(t,r){let o=this.symbolToIndices.get(t);o===void 0?o=[r]:o.push(r),this.symbolToIndices.set(t,o)}},no=class{constructor(t,r){this.equation=r;this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[o,n]=r.includes(\"->\")?r.split(\"->\",2):[r,\"\"];if(!o.match(RegExp(Hl)))throw new Error(\"Invalid LHS term\");if(o.split(\",\").forEach((l,a)=>{let p=t[a].dims.slice();if(!l.match(RegExp(bs)))throw new Error(\"Invalid LHS term\");let m=this.processTerm(l,!0,p,a);this.lhs.push(m)}),n===\"\")n+=[...this.symbolToInfo.entries()].filter(([l,a])=>a.count===1||l===\"...\").map(([l])=>l).join(\"\");else if(!n.match(RegExp(un)))throw new Error(\"Invalid RHS\");n.match(RegExp(to,\"g\"))?.forEach(l=>{if(l===\"...\")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let a=this.symbolToInfo.get(l);if(a===void 0)throw new Error(\"Invalid RHS symbol\");this.outputDims.push(a.dimValue)}}),this.rhs=this.processTerm(n,!1,this.outputDims)}addSymbol(t,r,o){let n=this.symbolToInfo.get(t);if(n!==void 0){if(n.dimValue!==r&&n.count!==1)throw new Error(\"Dimension mismatch\");n.count++,n.inputIndices.push(o)}else n={count:1,dimValue:r,inputIndices:[o]};this.symbolToInfo.set(t,n)}processTerm(t,r,o,n=-1){let s=o.length,u=!1,l=[],a=0;if(!t.match(RegExp(bs))&&!r&&t!==\"\")throw new Error(\"Invalid LHS term\");let p=t.match(RegExp(to,\"g\")),m=new ro(n);return p?.forEach((f,b)=>{if(f===\"...\"){if(u)throw new Error(\"Only one ellipsis is allowed per input term\");u=!0;let _=s-p.length+1;if(_<0)throw new Error(\"Ellipsis out of bounds\");if(l=o.slice(a,a+_),this.hasEllipsis){if(this.ellipsisDims.length!==l.length||this.ellipsisDims.toString()!==l.toString())throw new Error(\"Ellipsis dimensions mismatch\")}else if(r)this.hasEllipsis=!0,this.ellipsisDims=l;else throw new Error(\"Ellipsis must be specified in the LHS\");for(let y=0;ye+\"_max\",Ll=(e,t,r,o)=>{let s=e.map(m=>m.length).map((m,f)=>M(`input${f}`,t,m)),u=z.size(o),l=F(\"output\",t,o.length),a=[...r.symbolToInfo.keys()].filter(m=>!r.rhs.symbolToIndices.has(m)),p=m=>{let f=[],b=\"var prod = 1.0;\",_=\"var sum = 0.0;\",y=\"sum += prod;\",$=[],I=[],C=[],v=[],A=r.symbolToInfo.size===r.rhs.symbolToIndices.size;r.symbolToInfo.forEach((D,U)=>{if(r.rhs.symbolToIndices.has(U)){let V=r.rhs.symbolToIndices.get(U)?.[0];V!==void 0&&r.lhs.forEach((H,R)=>{if(D.inputIndices.includes(R)){let L=H.symbolToIndices.get(U);if(L===void 0)throw new Error(\"Invalid symbol error\");L.forEach(pe=>{f.push(`${s[R].indicesSet(`input${R}Indices`,pe,l.indicesGet(\"outputIndices\",V))}`)})}})}else r.lhs.forEach((V,H)=>{if(D.inputIndices.includes(H)){let R=V.symbolToIndices.get(U);if(R===void 0)throw new Error(\"Invalid symbol error\");R.forEach(L=>{$.push(`${s[H].indicesSet(`input${H}Indices`,L,`${U}`)}`)}),v.push(`prod *= ${s[H].getByIndices(`input${H}Indices`)};`)}}),I.push(`for(var ${U}: u32 = 0; ${U} < uniforms.${ws(U)}; ${U}++) {`),C.push(\"}\")});let T=A?[...f,`let sum = ${s.map((D,U)=>D.getByIndices(`input${U}Indices`)).join(\" * \")};`]:[...f,_,...I,...$,b,...v,y,...C];return`\\n ${m.registerUniforms(a.map(D=>({name:`${ws(D)}`,type:\"u32\"}))).registerUniform(\"outputSize\",\"u32\").declareVariables(...s,l)}\\n\\n ${m.mainStart()}\\n ${m.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n var outputIndices = ${l.offsetToIndices(\"global_idx\")};\\n ${s.map((D,U)=>`var input${U}Indices: ${s[U].type.indices};`).join(`\\n`)}\\n ${T.join(`\\n`)};\\n ${l.setByOffset(\"global_idx\",\"sum\")};\\n }`};return{name:\"Einsum\",shaderCache:{hint:r.equation,inputDependencies:e.map(()=>\"rank\")},getRunData:()=>{let m=a.filter(b=>r.symbolToInfo.has(b)).map(b=>({type:12,data:r.symbolToInfo.get(b)?.dimValue||0}));m.push({type:12,data:u});let f=e.map((b,_)=>[...j(b)]).reduce((b,_)=>b.concat(_),m);return f.push(...j(o)),{outputs:[{dims:o,dataType:t}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:f}},getShaderSource:p}},vs=(e,t)=>{let r=new no(e.inputs,t.equation),o=r.outputDims,n=e.inputs.map((s,u)=>s.dims);e.compute(Ll(n,e.inputs[0].dataType,r,o))},$s=e=>{let t=e.equation.replace(/\\\\s+/g,\"\");return $e({equation:t})}});var Fl,xs,ql,Kl,Ss,Cs=q(()=>{\"use strict\";ie();_e();be();Fl=e=>{if(!e||e.length!==2)throw new Error(\"Expand requires 2 input.\");let t=e[0].dims,r=Array.from(e[1].getBigInt64Array(),Number),o=r.length{let r=e.length-t.length,o=[];for(let n=0;ne.length>t.length?xs(e,t):xs(t,e),Kl=e=>{let t=e[0].dims,r=Array.from(e[1].getBigInt64Array(),Number),o=ql(t,r),n=e[0].dataType,s=n===9?4:1,u=Math.ceil(z.size(o)/s),l=p=>{let m=M(\"input\",n,t.length,s),f=F(\"output\",n,o.length,s),b;if(n===9){let _=(y,$,I=\"\")=>`\\n let outputIndices${$} = ${f.offsetToIndices(`outputOffset + ${$}u`)};\\n let offset${$} = ${m.broadcastedIndicesToOffset(`outputIndices${$}`,f)};\\n let index${$} = offset${$} / 4u;\\n let component${$} = offset${$} % 4u;\\n ${y}[${$}] = ${I}(${m.getByOffset(`index${$}`)}[component${$}]);\\n `;b=`\\n let outputOffset = global_idx * ${s};\\n var data = vec4(0);\\n ${_(\"data\",0,\"u32\")}\\n ${_(\"data\",1,\"u32\")}\\n ${_(\"data\",2,\"u32\")}\\n ${_(\"data\",3,\"u32\")}\\n ${f.setByOffset(\"global_idx\",\"data\")}\\n }`}else b=`\\n let outputIndices = ${f.offsetToIndices(\"global_idx\")};\\n let inputOffset = ${m.broadcastedIndicesToOffset(\"outputIndices\",f)};\\n ${f.setByOffset(\"global_idx\",m.getByOffset(\"inputOffset\"))}\\n }`;return`\\n ${p.registerUniform(\"vec_size\",\"u32\").declareVariables(m,f)}\\n ${p.mainStart()}\\n ${p.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\\n ${b}`},a=[{type:12,data:u},...j(t,o)];return{name:\"Expand\",shaderCache:{hint:`${o.length}`,inputDependencies:[\"rank\"]},getShaderSource:l,getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:a})}},Ss=e=>{Fl(e.inputs),e.compute(Kl(e.inputs),{inputs:[0]})}});var jl,Is,As=q(()=>{\"use strict\";ie();_e();be();en();jl=e=>{let t=e[0].dataType,r=z.size(e[0].dims),o=z.size(e[1].dims),n=o%4===0,s=u=>{let l=M(\"x\",t,[1],4),a=M(\"bias\",t,[1],4),p=F(\"y\",t,[1],4),m=[{name:\"output_vec_size\",type:\"u32\"},{name:\"bias_size\",type:\"u32\"}],f=_=>`\\n let bias${_}_offset: u32 = (global_idx * 4 + ${_}) % uniforms.bias_size;\\n let bias${_} = ${a.getByOffset(`bias${_}_offset / 4`)}[bias${_}_offset % 4];`,b=n?`\\n let bias = ${a.getByOffset(\"global_idx % (uniforms.bias_size / 4)\")};`:`${f(0)}${f(1)}${f(2)}${f(3)}\\n let bias = ${l.type.value}(bias0, bias1, bias2, bias3);`;return`${u.registerUniforms(m).declareVariables(l,a,p)}\\n\\n ${Ln(et(t))}\\n\\n ${u.mainStart(Kr)}\\n ${u.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_vec_size\")}\\n\\n let x = ${l.getByOffset(\"global_idx\")};\\n ${b}\\n let x_in = x + bias;\\n ${p.setByOffset(\"global_idx\",Fn(\"x_in\"))}\\n }`};return{name:\"FastGeluWithBias\",shaderCache:{hint:`${n}`,inputDependencies:[\"type\",\"type\"]},getShaderSource:s,getRunData:u=>({outputs:[{dims:u[0].dims,dataType:u[0].dataType}],programUniforms:[{type:12,data:Math.ceil(r/4)},{type:12,data:o}],dispatchGroup:{x:Math.ceil(r/Kr/4)}})}},Is=e=>{e.inputs.length<2||z.size(e.inputs[1].dims)===0?Di(e):e.compute(jl(e.inputs))}});var Yl,Zl,Ts,Es,Ps=q(()=>{\"use strict\";ie();_e();je();be();Yl=e=>{if(!e||e.length!==2)throw new Error(\"Gather requires 2 inputs.\")},Zl=(e,t)=>{let r=e[0].dims,o=e[1].dims,n=r.length,s=z.normalizeAxis(t.axis,n),u=r.slice(0);u.splice(s,1,...o);let l=r[s],a=e[0].dataType===9?4:1,p=Math.ceil(z.size(u)/a),m=[{type:12,data:p},{type:6,data:l},{type:12,data:s},...j(e[0].dims,e[1].dims,u)],f=b=>{let _=M(\"data\",e[0].dataType,e[0].dims.length,a),y=M(\"inputIndices\",e[1].dataType,e[1].dims.length),$=F(\"output\",e[0].dataType,u.length,a),I=v=>{let A=o.length,T=`var indicesIndices${v} = ${y.type.indices}(0);`;for(let D=0;D1?`indicesIndices${v}[${D}]`:`indicesIndices${v}`} = ${u.length>1?`outputIndices${v}[uniforms.axis + ${D}]`:`outputIndices${v}`};`;T+=`\\n var idx${v} = ${y.getByIndices(`indicesIndices${v}`)};\\n if (idx${v} < 0) {\\n idx${v} = idx${v} + uniforms.axisDimLimit;\\n }\\n var dataIndices${v} : ${_.type.indices};\\n `;for(let D=0,U=0;D1?`dataIndices${v}[${D}]`:`dataIndices${v}`} = u32(idx${v});`,U+=A):(T+=`${n>1?`dataIndices${v}[${D}]`:`dataIndices${v}`} = ${u.length>1?`outputIndices${v}[${U}]`:`outputIndices${v}`};`,U++);return T},C;if(e[0].dataType===9){let v=(A,T,D=\"\")=>`\\n let outputIndices${T} = ${$.offsetToIndices(`outputOffset + ${T}u`)};\\n ${I(T)};\\n let offset${T} = ${_.indicesToOffset(`dataIndices${T}`)};\\n let index${T} = offset${T} / 4u;\\n let component${T} = offset${T} % 4u;\\n ${A}[${T}] = ${D}(${_.getByOffset(`index${T}`)}[component${T}]);\\n `;C=`\\n let outputOffset = global_idx * ${a};\\n var value = vec4(0);\\n ${v(\"value\",0,\"u32\")}\\n ${v(\"value\",1,\"u32\")}\\n ${v(\"value\",2,\"u32\")}\\n ${v(\"value\",3,\"u32\")}\\n ${$.setByOffset(\"global_idx\",\"value\")}\\n `}else C=`\\n let outputIndices = ${$.offsetToIndices(\"global_idx\")};\\n ${I(\"\")};\\n let value = ${_.getByIndices(\"dataIndices\")};\\n ${$.setByOffset(\"global_idx\",\"value\")};\\n `;return`\\n ${b.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axisDimLimit\",\"i32\").registerUniform(\"axis\",\"u32\").declareVariables(_,y,$)}\\n ${b.mainStart()}\\n ${b.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n ${C}\\n }`};return{name:\"Gather\",shaderCache:{hint:t.cacheKey,inputDependencies:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:u,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:m}),getShaderSource:f}},Ts=e=>$e({axis:e.axis}),Es=(e,t)=>{let r=e.inputs;Yl(r),e.compute(Zl(e.inputs,t))}});var Ql,Xl,Os,ks,Rs=q(()=>{\"use strict\";ie();_e();je();be();Ql=e=>{if(!e||e.length!==2)throw new Error(\"GatherElements requires 2 inputs.\");if(e[0].dims.length<1)throw new Error(\"GatherElements requires that the data input be rank >= 1.\");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and\\n indices input tensors be of same rank.`)},Xl=(e,t)=>{let r=e[0].dims,o=e[0].dataType,n=r.length,s=e[1].dims,u=e[1].dataType,l=z.normalizeAxis(t.axis,n),a=r[l],p=s.slice(0),m=z.size(p),f=M(\"input\",o,n),b=M(\"indicesInput\",u,s.length),_=F(\"output\",o,p.length),y=[{type:12,data:m},{type:6,data:a},{type:12,data:l}];return y.push(...j(r,s,p)),{name:\"GatherElements\",shaderCache:{inputDependencies:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:p,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:y}),getShaderSource:C=>`\\n ${C.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axisDimLimit\",\"i32\").registerUniform(\"axis\",\"u32\").declareVariables(f,b,_)}\\n ${C.mainStart()}\\n ${C.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n\\n let outputIndices = ${_.offsetToIndices(\"global_idx\")};\\n\\n var idx = ${b.getByOffset(\"global_idx\")};\\n if (idx < 0) {\\n idx = idx + uniforms.axisDimLimit;\\n }\\n var inputIndices = ${f.type.indices}(outputIndices);\\n ${f.indicesSet(\"inputIndices\",\"uniforms.axis\",\"u32(idx)\")};\\n let value = ${f.getByIndices(\"inputIndices\")};\\n\\n ${_.setByOffset(\"global_idx\",\"value\")};\\n }`}},Os=e=>$e({axis:e.axis}),ks=(e,t)=>{let r=e.inputs;Ql(r),e.compute(Xl(e.inputs,t))}});var Jl,ec,Bs,Ds,Ms=q(()=>{\"use strict\";ie();_e();be();Jl=e=>{if(!e)throw new Error(\"Input is missing\");if(e.length<2||e.length>3)throw new Error(\"Invaid input number.\");if(e.length===3&&e[2].dims.length>2)throw new Error(\"Invalid input shape of C\");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error(\"Input types are mismatched\")},ec=(e,t)=>{let r=e[0].dims.slice(),o=e[1].dims.slice(),[n,s,u]=Lr.getShapeOfGemmResult(r,t.transA,o,t.transB,e.length===3?e[2].dims:void 0),l=[n,s];if(!l)throw new Error(\"Can\\'t use gemm on the given tensors\");let a=z.size(l),p=[{type:12,data:a},{type:12,data:n},{type:12,data:s},{type:12,data:u},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[\"type\",\"type\"];e.length===3&&(p.push(...j(e[2].dims)),m.push(\"rank\")),p.push(...j(l));let f=b=>{let _=\"\";t.transA&&t.transB?_=\"value += a[k * uniforms.M + m] * b[n * uniforms.K + k];\":t.transA&&!t.transB?_=\"value += a[k * uniforms.M + m] * b[k * uniforms.N + n];\":!t.transA&&t.transB?_=\"value += a[m * uniforms.K + k] * b[n * uniforms.K + k];\":!t.transA&&!t.transB&&(_=\"value += a[m * uniforms.K + k] * b[k * uniforms.N + n];\");let y=t.alpha===1?\"\":\"value *= uniforms.alpha;\",$=M(\"a\",e[0].dataType,e[0].dims),I=M(\"b\",e[1].dataType,e[1].dims),C=$.type.value,v=null,A=[$,I];e.length===3&&(v=M(\"c\",e[2].dataType,e[2].dims.length),A.push(v));let T=F(\"output\",e[0].dataType,l.length);A.push(T);let D=[{name:\"output_size\",type:\"u32\"},{name:\"M\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"alpha\",type:\"f32\"},{name:\"beta\",type:\"f32\"}];return`\\n ${b.registerUniforms(D).declareVariables(...A)}\\n\\n ${b.mainStart()}\\n ${b.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n\\n let m = global_idx / uniforms.N;\\n let n = global_idx % uniforms.N;\\n\\n var value = ${C}(0);\\n for (var k: u32 = 0u; k < uniforms.K; k++) {\\n ${_}\\n }\\n\\n ${y}\\n ${(()=>v!=null?`let cOffset = ${v.broadcastedIndicesToOffset(\"vec2(m, n)\",T)}; value += ${C}(uniforms.beta) * ${v.getByOffset(\"cOffset\")};`:\"\")()}\\n output[global_idx] = value;\\n }`};return{name:\"Gemm\",shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:p}),getShaderSource:f}},Bs=e=>{let t=e.transA,r=e.transB,o=e.alpha,n=e.beta;return{transA:t,transB:r,alpha:o,beta:n,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},Ds=(e,t)=>{Jl(e.inputs),e.compute(ec(e.inputs,t))}});var tc,rc,nc,zs,Us=q(()=>{\"use strict\";ie();_e();be();tc=(e,t)=>{let r=e[0].dims,o=r,n=2,s=z.sizeToDimension(r,n),u=z.sizeFromDimension(r,n),l=Me(u),a=u/l,p=[r[0],r[1],a],m=[\"rank\",\"type\",\"type\"],f=[{type:12,data:u},{type:12,data:a}];f.push(...j(p,p));let b=_=>{let y=M(\"x\",e[0].dataType,p.length,l),$=M(\"scale\",e[1].dataType,e[1].dims),I=M(\"bias\",e[2].dataType,e[2].dims),C=F(\"output\",e[0].dataType,p.length,l),v=[y,$,I,C],A=y.type.value,T=l===1?\"f32\":`vec${l}`,D=64,U=[{name:\"normSize\",type:\"u32\"},{name:\"normPackedSize\",type:\"u32\"}];return`\\n var meanShared : f32;\\n var squaredNormShared : f32;\\n var workgroupShared : array<${T}, ${D}>;\\n const workgroupSize = ${D}u;\\n ${_.registerUniforms(U).declareVariables(...v)}\\n ${_.mainStart(D)}\\n let norm = global_idx / workgroupSize;\\n let batch = norm / uniforms.x_shape[1];\\n let channel = norm % uniforms.x_shape[1];\\n let localIndex = local_id.x;\\n\\n // initialize workgroup memory\\n var initial = ${T}(0);\\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\\n initial = initial + ${T}(${y.get(\"batch\",\"channel\",\"h\")});\\n }\\n workgroupShared[localIndex] = initial;\\n workgroupBarrier();\\n\\n // Calculate the mean of current channel data.\\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\\n if (localIndex < currSize) {\\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\\n }\\n workgroupBarrier();\\n }\\n if (localIndex == 0) {\\n meanShared = ${tt(\"workgroupShared[0]\",l)} / f32(uniforms.normSize);\\n }\\n workgroupBarrier();\\n\\n // reinitialize workgroup memory.\\n initial = ${T}(0);\\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\\n let deviation = ${T}(${y.get(\"batch\",\"channel\",\"h\")}) - ${T}(meanShared);\\n initial = initial + deviation * deviation;\\n }\\n workgroupShared[localIndex] = initial;\\n workgroupBarrier();\\n\\n // Calculate the sum of square of deviation of current channel data.\\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\\n if (localIndex < currSize) {\\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\\n }\\n workgroupBarrier();\\n }\\n if (localIndex == 0) {\\n squaredNormShared = ${tt(\"workgroupShared[0]\",l)};\\n }\\n workgroupBarrier();\\n\\n let invStdDev = inverseSqrt(squaredNormShared / f32(uniforms.normSize) + f32(${t.epsilon}));\\n let channelScale = invStdDev * f32(${$.getByOffset(\"channel\")});\\n let channelShift = f32(${I.getByOffset(\"channel\")}) - meanShared * channelScale;\\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\\n let value = ${y.get(\"batch\",\"channel\",\"h\")} * ${A}(${T}(channelScale)) + ${A}(${T}(channelShift));\\n ${C.set(\"batch\",\"channel\",\"h\",\"value\")};\\n }\\n }`};return{name:\"InstanceNormalization\",shaderCache:{hint:`${t.epsilon};${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:s},programUniforms:f}),getShaderSource:b}},rc=(e,t,r,o,n,s,u,l)=>{let a=Me(u),p=64,m=a===1?\"vec2f\":`mat2x${a}f`,f=a===1?\"f32\":`vec${a}f`,b=(U,V)=>`${m}(${U}, ${V})`,_=n*u/a,y=Math.ceil(s/p),$=[\"type\"],I=[{type:12,data:y},{type:12,data:s},{type:12,data:Math.floor(u/a)},{type:12,data:Math.floor(s*u/a)}],C=U=>{let V=M(\"input\",t.dataType,t.dims,a);return`\\n ${U.declareVariables(V)}\\n @group(0) @binding(1) var output : array<${m}>;\\n struct Uniforms {wg_size:u32, H:u32, C:u32, image_size:u32};\\n @group(0) @binding(2) var uniforms: Uniforms;\\n\\n ${U.mainStart(p)}\\n let currentImageNumber = global_idx / ${p} / uniforms.C;\\n let currentChannelNumber = (global_idx / ${p}) % uniforms.C;\\n let wgId = global_idx % ${p};\\n let wgOffset = wgId * uniforms.wg_size;\\n if (wgOffset >= uniforms.H) {\\n return;\\n }\\n let wgMax = min(wgOffset + uniforms.wg_size, uniforms.H);\\n\\n let offset = currentImageNumber * uniforms.image_size + currentChannelNumber;\\n var sum = ${Ye(\"f32\",a)};\\n var squaredSum = ${Ye(\"f32\",a)};\\n for (var i: u32 = wgOffset; i < wgMax; i++) {\\n let value = ${f}(input[offset + i * uniforms.C]);\\n sum += value;\\n squaredSum += value * value;\\n }\\n output[global_idx] = ${b(\"sum\",\"squaredSum\")};\\n }`},v=e.compute({name:\"InstanceNormComputeMean\",shaderCache:{hint:`${a}`,inputDependencies:$},getRunData:()=>({outputs:[{dims:[n,u,p,2],dataType:1}],dispatchGroup:{x:n*u/a},programUniforms:I}),getShaderSource:C},{inputs:[t],outputs:[-1]})[0],A=[{type:12,data:_},{type:12,data:s},{type:12,data:Math.floor(u/a)},{type:12,data:Math.floor(p*u/a)}],T=[\"type\",\"type\",\"type\"],D=U=>{let V=M(\"scale\",r.dataType,r.dims,a),H=M(\"bias\",o.dataType,o.dims,a);return`\\n @group(0) @binding(0) var input : array<${m}>;\\n @group(0) @binding(1) var scale : array<${V.type.storage}>;\\n @group(0) @binding(2) var bias : array<${H.type.storage}>;\\n @group(0) @binding(3) var output : array<${m}>;\\n struct Uniforms {units_of_work : u32, H: u32, C : u32, image_size : u32};\\n @group(0) @binding(4) var uniforms: Uniforms;\\n\\n ${U.mainStart()}\\n ${U.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.units_of_work\")}\\n let currentImageNumber = global_idx / uniforms.C;\\n let currentChannelNumber = global_idx % uniforms.C;\\n\\n let offset = currentImageNumber * uniforms.image_size;\\n var sum = ${Ye(\"f32\",a)};\\n var squaredSum = ${Ye(\"f32\",a)};\\n for (var i: u32 = 0; i < min(${p}, uniforms.H); i++) {\\n let value = input[offset + i + currentChannelNumber * ${p}];\\n sum += value[0];\\n squaredSum += value[1];\\n }\\n sum = sum / f32(uniforms.H);\\n squaredSum = squaredSum / f32(uniforms.H);\\n let invStdDev = inverseSqrt(squaredSum - sum * sum + f32(${l}));\\n let channelScale = invStdDev * ${f}(scale[currentChannelNumber]);\\n let channelShift = ${f}(bias[currentChannelNumber]) - sum * channelScale;\\n\\n output[global_idx] = ${b(\"channelScale\",\"channelShift\")};\\n }`};return e.compute({name:\"InstanceNormComputeChannelScaleShift\",shaderCache:{hint:`${a};${l}`,inputDependencies:T},getRunData:()=>({outputs:[{dims:[n,u,2],dataType:1}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:A}),getShaderSource:D},{inputs:[v,r,o],outputs:[-1]})[0]},nc=(e,t,r)=>{let o=t[0].dims,n=o,s=o[0],u=o[o.length-1],l=z.sizeFromDimension(o,1)/u,a=Me(u),p=z.size(n)/a,m=[{type:12,data:l},{type:12,data:Math.floor(u/a)}],f=[\"type\",\"type\"],b=rc(e,t[0],t[1],t[2],s,l,u,r.epsilon),_=y=>{let $=Pe(t[0].dataType),I=a===1?\"vec2f\":`mat2x${a}f`,C=a===1?$:`vec${a}<${$}>`,v=M(\"input\",t[0].dataType,t[0].dims,a),A=F(\"output\",t[0].dataType,n,a);return`\\n @group(0) @binding(0) var input : array<${v.type.storage}>;\\n @group(0) @binding(1) var scaleInput : array<${I}>;\\n @group(0) @binding(2) var output : array<${A.type.storage}>;\\n struct Uniforms {H: u32, C : u32};\\n @group(0) @binding(3) var uniforms: Uniforms;\\n\\n ${y.mainStart()}\\n let currentImageNumber = global_idx / (uniforms.C * uniforms.H);\\n let currentChannelNumber = global_idx % uniforms.C;\\n\\n let scaleOffset = currentImageNumber * uniforms.C + currentChannelNumber;\\n let scale = scaleInput[scaleOffset];\\n output[global_idx] = fma(input[global_idx], ${C}(scale[0]), ${C}(scale[1]));\\n }`};e.compute({name:\"InstanceNormalizationNHWC\",shaderCache:{hint:`${a}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:n,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:m}),getShaderSource:_},{inputs:[t[0],b]})},zs=(e,t)=>{t.format===\"NHWC\"?nc(e,e.inputs,t):e.compute(tc(e.inputs,t))}});var oc,ac,Vs,Ns=q(()=>{\"use strict\";ie();_e();be();oc=e=>{if(!e||e.length<2)throw new Error(\"layerNorm requires at least 2 inputs.\")},ac=(e,t,r)=>{let o=e[0].dims,n=e[1],s=e[2],u=o,l=z.normalizeAxis(t.axis,o.length),a=z.sizeToDimension(o,l),p=z.sizeFromDimension(o,l),m=z.size(n.dims),f=s?z.size(s.dims):0;if(m!==p||s&&f!==p)throw new Error(`Size of X.shape()[axis:] == ${p}.\\n Size of scale and bias (if provided) must match this.\\n Got scale size of ${m} and bias size of ${f}`);let b=[];for(let T=0;T1,C=r>2,v=T=>{let D=Pe(e[0].dataType),U=[M(\"x\",e[0].dataType,e[0].dims,_),M(\"scale\",n.dataType,n.dims,_)];s&&U.push(M(\"bias\",s.dataType,s.dims,_)),U.push(F(\"output\",e[0].dataType,u,_)),I&&U.push(F(\"mean_data_output\",1,b)),C&&U.push(F(\"inv_std_output\",1,b));let V=[{name:\"norm_count\",type:\"u32\"},{name:\"norm_size\",type:\"f32\"},{name:\"norm_size_vectorized\",type:\"u32\"},{name:\"epsilon\",type:\"f32\"}];return`\\n ${T.registerUniforms(V).declareVariables(...U)}\\n ${T.mainStart()}\\n ${T.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.norm_count\")}\\n let offset = global_idx * uniforms.norm_size_vectorized;\\n var mean_vector = ${Ye(\"f32\",_)};\\n var mean_square_vector = ${Ye(\"f32\",_)};\\n\\n for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) {\\n let value = ${st(D,_,\"x[h + offset]\")};\\n mean_vector += value;\\n mean_square_vector += value * value;\\n }\\n let mean = ${tt(\"mean_vector\",_)} / uniforms.norm_size;\\n let inv_std_dev = inverseSqrt(${tt(\"mean_square_vector\",_)} / uniforms.norm_size - mean * mean + uniforms.epsilon);\\n\\n for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) {\\n let f32input = ${st(D,_,\"x[j + offset]\")};\\n let f32scale = ${st(D,_,\"scale[j]\")};\\n output[j + offset] = ${U[0].type.value}((f32input - mean) * inv_std_dev * f32scale\\n ${s?`+ ${st(D,_,\"bias[j]\")}`:\"\"}\\n );\\n }\\n\\n ${I?\"mean_data_output[global_idx] = mean\":\"\"};\\n ${C?\"inv_std_output[global_idx] = inv_std_dev\":\"\"};\\n }`},A=[{dims:u,dataType:e[0].dataType}];return I&&A.push({dims:b,dataType:1}),C&&A.push({dims:b,dataType:1}),{name:\"LayerNormalization\",shaderCache:{hint:`${_};${r}`,inputDependencies:y},getRunData:()=>({outputs:A,dispatchGroup:{x:Math.ceil(a/64)},programUniforms:$}),getShaderSource:v}},Vs=(e,t)=>{oc(e.inputs),e.compute(ac(e.inputs,t,e.outputCount))}});var ic,sc,Ws,Gs,Hs=q(()=>{\"use strict\";ie();_e();je();be();ic=(e,t)=>{if(e.length<3||e.length>4)throw new Error(\"MatMulNBits requires 3 or 4 inputs\");let r=e[0],o=r.dims.length;if(r.dims[o-1]!==t.k)throw new Error(\"The last dim of input shape does not match the k value\");let n=Math.floor((t.k+t.blockSize-1)/t.blockSize),s=t.blockSize/8*t.bits,u=e[1];if(!z.areEqual(u.dims,[t.n,n,s]))throw new Error(\"The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize\");let a=e[2].dims;if(z.size(a)!==t.n*n)throw new Error(\"scales input size error.\");if(e.length===4){let m=e[3].dims,f=t.bits>4?t.n*n:t.n*Math.floor((n+1)/2);if(z.size(m)!==f)throw new Error(\"zeroPoints input size error.\")}},sc=(e,t)=>{let r=e[0].dims,o=r.length,n=r.slice(0,o-1).concat(t.n),s=r[o-2],l=t.blockSize/8*t.bits/4,a=Me(s),p=Me(t.n),m=Me(t.k),f=Me(l),b=z.size(n)/p/a,_=[{type:12,data:b},{type:12,data:t.k},{type:12,data:t.n},{type:12,data:t.accuracyLevel},{type:12,data:t.bits},{type:12,data:t.blockSize}],y=r.slice();y.splice(-1,1,t.k/m);let $=z.convertShape(e[1].dims).slice();$.splice(-1,1,l/f),_.push(...j(y)),_.push(...j($)),_.push(...j(e[2].dims)),e.length===4&&_.push(...j(z.convertShape(e[3].dims)));let I=n.slice();I.splice(-1,1,t.n/p),_.push(...j(I));let C=v=>{let A=M(\"a\",e[0].dataType,y.length,m),T=M(\"b\",12,$.length,f),D=M(\"scales\",e[2].dataType,e[2].dims.length),U=[A,T,D],V=e.length===4?M(\"zero_points\",12,e[3].dims.length):void 0;V&&U.push(V);let H=F(\"output\",e[0].dataType,n.length,p),R=[{name:\"output_size\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"accuracy_level\",type:\"u32\"},{name:\"bits\",type:\"u32\"},{name:\"block_size\",type:\"u32\"}],L=Math.floor((t.k+t.blockSize-1)/t.blockSize),pe=Pe(e[0].dataType),Ie=(()=>{switch(m){case 1:return`array<${pe}, 8>`;case 2:return`mat4x2<${pe}>`;case 4:return`mat2x4<${pe}>`;default:throw new Error(`${m}-component is not supported.`)}})(),we=`\\n fn dequantize(quantized: ${Ie}, zero_point: ${pe}, scale: ${pe}) -> ${Ie} {\\n ${(()=>m===1?`var dequantized = ${Ie}(${Array.from({length:8},(Q,xe)=>`(quantized[${xe}] - zero_point) * scale`).join(\", \")});\\n return dequantized;`:`var zero_points: ${Ie} = ${Ie}(${Array(8).fill(\"zero_point\").join(\",\")});\\n return (quantized - zero_points) * scale;`)()}\\n }`,ne=`\\n fn ortUnpack8x4snorm(value: u32) -> ${Ie} {\\n var quantized: ${Ie};\\n var offset: u32 = 0;\\n let count: u32 = 4;\\n for (var i: u32 = 0; i < 8u; i++) {\\n var result = ${pe}(extractBits(value, offset, count));\\n ${(()=>{switch(m){case 1:return\"quantized[i] = result;\";case 2:return\"quantized[i / 2][i % 2] = result;\";case 4:return\"quantized[i / 4][i % 4] = result;\";default:throw new Error(`${m}-component is not supported.`)}})()}\\n offset += count;\\n }\\n return quantized;\\n }`,ze=V?`\\n zero_point_offset += 4;\\n if (zero_point_offset == 32) {\\n zero_point_offset = 0;\\n zero_point_index++;\\n zero_point_word = ${V.getByOffset(\"zero_point_index\")};\\n }`:\"\";return`\\n ${we};\\n ${ne};\\n ${v.registerUniforms(R).declareVariables(...U,H)}\\n ${v.mainStart()}\\n ${v.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n var output_values: array<${H.type.value}, ${a}>;\\n var output_indices = ${H.offsetToIndices(\"global_idx\")};\\n var n = ${H.indicesGet(\"output_indices\",o-1)};\\n var m = ${H.indicesGet(\"output_indices\",o-2)};\\n var a_indices: ${A.type.indices} = output_indices;\\n // Two zero points are packed into one byte because uniforms.bits <= 4.\\n // zero_point_offset is either 0 or 4. It is bit offset within one byte.\\n // TODO support zero_point_offset for bits > 4\\n ${V?`\\n var zero_point_index: u32 = n * ${p} * ((${L} + 1) / 2) / 4;\\n var zero_point_word: u32 = ${V.getByOffset(\"zero_point_index\")};\\n var zero_point_offset: u32 = 0;`:\"\"}\\n var scale_index = n * ${L*p};\\n var b_indices: ${T.type.indices};\\n for (var c: u32 = 0; c < ${p}; c++) {\\n ${T.indicesSet(\"b_indices\",\"0\",`n * ${p} + c`)};\\n var block_offset: u32 = 0;\\n for (var block: u32 = 0; block < ${L}; block++) {\\n // The scale and zero points are computed per block.\\n let scale = ${D.getByOffset(\"scale_index\")};\\n // The default zero point is 8 for unsigned 4-bit quantization.\\n let zero_point = ${pe}(${V?\"extractBits(zero_point_word, zero_point_offset, 4)\":8});\\n ${T.indicesSet(\"b_indices\",\"1\",\"block\")};\\n var word_offset: u32 = block_offset;\\n for (var word: u32 = 0; word < ${l}; word += ${f}) {\\n ${T.indicesSet(\"b_indices\",\"2\",\"word\")};\\n let b_data = ${T.getByIndices(\"b_indices\")};\\n for (var i: u32 = 0; i < ${f}; i++) {\\n let b_value = ${f===1?\"b_data\":\"b_data[word + i]\"};\\n let b_quantized_values: ${Ie} = ortUnpack8x4snorm(b_value);\\n let b_dequantized_values = dequantize(b_quantized_values, zero_point, scale);\\n // Number of B elements per 32-bit word is 32/bits = 32/4 = 8\\n var offset: u32 = word_offset;\\n for (var j: u32 = 0; j < 8/${m}; j++) {\\n ${A.indicesSet(\"a_indices\",o-1,`offset/${m}`)};\\n for (var k: u32 = 0; k < ${a}u; k++) {\\n ${A.indicesSet(\"a_indices\",o-2,`m * ${a} + k`)};\\n let a_data = ${A.getByIndices(\"a_indices\")};\\n output_values[k]${p>1?\"[c]\":\"\"} += ${m===1?\"a_data * b_dequantized_values[j]\":\"dot(a_data, b_dequantized_values[j])\"};\\n }\\n offset += ${m};\\n }\\n word_offset += 8;\\n }\\n }\\n scale_index++;\\n ${ze}\\n block_offset += uniforms.block_size;\\n }\\n // Drop the trailing 4 bits if the zero_poit_offset is not a byte boundary to align with the next byte.\\n ${V?`if (zero_point_offset % 8 > 0) {\\n ${ze}\\n }`:\"\"}\\n }\\n for (var k: u32 = 0u; k < ${a}u; k++) {\\n ${H.indicesSet(\"output_indices\",o-2,`${a+\" * m + k\"}`)};\\n ${H.setByIndices(\"output_indices\",\"output_values[k]\")}\\n }\\n }`};return{name:\"MatMulNBits\",shaderCache:{hint:`${t.cacheKey};${e.length}`,inputDependencies:Array(e.length).fill(\"rank\")},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(b/64)},programUniforms:_}),getShaderSource:C}},Ws=(e,t)=>{ic(e.inputs,t),e.compute(sc(e.inputs,t))},Gs=e=>$e(e)});var uc,Fs,Ls,dc,oo,qs,Ks=q(()=>{\"use strict\";ie();_e();je();Gr();Hn();be();Yt();uc=(e,t)=>{let r=e[0],o=e[1],n=e[2],s=e[3],u=e[4],l=e[5],a=e[6],p=e[7];if(r.dims.length!==3&&r.dims.length!==5)throw new Error(\"Input query is expected to have 3 or 5 dimensions\");let m=!1,f=r.dims[0],b=r.dims[1],_=r.dims.length===3?m?r.dims[2]/3:r.dims[2]:t.numHeads*r.dims[4],y=b,$=0,I=0,C=Math.floor(_/t.numHeads);if(a&&p){if(a.dims.length!==4)throw new Error(\\'Input \"past_key\" is expected to have 4 dimensions\\');if(p.dims.length!==4)throw new Error(\\'Input \"past_value\" is expected to have 4 dimensions\\');$=a.dims[2],I=a.dims[2]}else if(a||p)throw new Error(\\'Input \"past_key\" and \"past_value\" shall be both present or both absent\\');let v;if(o){if(r.dims.length!==3)throw new Error(\\'Input \"query\" is expected to have 3 dimensions when key is given\\');if(o.dims.length<3||o.dims.length>5)throw new Error(\\'Input \"key\" is expected to have 3, 4, or 5 dimensions\\');if(r.dims[0]!==o.dims[0])throw new Error(\\'Input \"query\" and \"key\" shall have same dim 0 (batch size)\\');if(o.dims.length===3){if(o.dims[2]!==r.dims[2])throw new Error(\\'Input \"query\" and \"key\" shall have same dim 2 (hidden_size)\\');v=2,y=o.dims[1]}else if(o.dims.length===5){if(o.dims[2]!==t.numHeads||o.dims[3]!==2||o.dims[4]!==C)throw new Error(\\'Expect \"key\" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv\\');if(n)throw new Error(\\'Expect \"value\" be none when \"key\" has packed kv format.\\');v=5,y=o.dims[1]}else{if(o.dims[1]!==t.numHeads||o.dims[3]!==C)throw new Error(\\'Expect \"key\" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key\\');v=0,y=o.dims[2]}}else{if(r.dims.length!==3&&r.dims.length!==5)throw new Error(\\'Input \"query\" is expected to have 3 or 5 dimensions when key is empty\\');if(r.dims.length===5&&(r.dims[2]!==t.numHeads||r.dims[3]!==3))throw new Error(\\'Expect \"query\" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv\\');v=3}if(s){if(s.dims.length!==1)throw new Error(\\'Input \"bias\" is expected to have 1 dimension\\');if(n&&r.dims.length===5&&r.dims[3]===2)throw new Error(\"bias is not allowed for packed kv.\")}let A=0;if(u){A=8;let H=u.dims;throw H.length===1?H[0]===f?A=1:H[0]===3*f+2&&(A=3):H.length===2&&H[0]===f&&H[1]===y&&(A=5),A===8?new Error(\\'Input \"key_padding_mask\" shape shall be (batch_size) or (batch_size, kv_sequence_length)\\'):new Error(\"Mask not supported\")}let T=!1,D=_;if(n){if(n.dims.length!==3&&n.dims.length!==4)throw new Error(\\'Input \"value\" is expected to have 3 or 4 dimensions\\');if(r.dims[0]!==n.dims[0])throw new Error(\\'Input \"query\" and \"value\" shall have same dim 0 (batch_size)\\');if(n.dims.length===3){if(y!==n.dims[1])throw new Error(\\'Input \"key\" and \"value\" shall have the same dim 1 (kv_sequence_length)\\');D=n.dims[2]}else{if(y!==n.dims[2])throw new Error(\\'Input \"past_key\" and \"past_value\" shall have the same dim 2 (kv_sequence_length)\\');D=n.dims[1]*n.dims[3],T=!0}}let U=$+y,V=!1;if(u)throw new Error(\"Key padding mask is not supported\");if(l)throw new Error(\"extraAddQk is not supported\");if(a)throw new Error(\"pastKey is not supported\");if(p)throw new Error(\"pastValue is not supported\");return{batchSize:f,sequenceLength:b,pastSequenceLength:$,kvSequenceLength:y,totalSequenceLength:U,maxSequenceLength:I,inputHiddenSize:0,hiddenSize:_,vHiddenSize:D,headSize:C,vHeadSize:Math.floor(D/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:A,scale:t.scale,broadcastResPosBias:V,passPastInKv:T,qkvFormat:v}},Fs=e=>$e({...e}),Ls=$e({perm:[0,2,1,3]}),dc=(e,t,r,o,n,s,u)=>{let l=[o,n,s],a=z.size(l),p=[{type:12,data:a},{type:12,data:u},{type:12,data:s}],m=f=>{let b=F(\"qkv_with_bias\",t.dataType,l),_=M(\"qkv\",t.dataType,l),y=M(\"bias\",r.dataType,l),$=[{name:\"output_size\",type:\"u32\"},{name:\"bias_offset\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"}];return`\\n ${f.registerUniforms($).declareVariables(_,y,b)}\\n ${f.mainStart()}\\n ${f.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset;\\n\\n qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx];\\n }`};return e.compute({name:\"MultiHeadAttentionAddBias\",shaderCache:{inputDependencies:[\"type\",\"type\"]},getRunData:()=>({outputs:[{dims:l,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:p}),getShaderSource:m},{inputs:[t,r],outputs:[-1]})[0]},oo=(e,t,r,o,n,s,u,l)=>{let a=s;if(u){if(o===1)throw new Error(\"AddBiasReshape is not implemented. Please export your model with packed QKV or KV\");return a=dc(e,s,u,t,o,r*n,l),a=a.reshape([t,o,r,n]),e.compute(ot(a,Ls.perm),{inputs:[a],outputs:[-1]})[0]}else return s.dims.length===3&&(a=s.reshape([t,o,r,n])),e.compute(ot(a,Ls.perm),{inputs:[a],outputs:[-1]})[0]},qs=(e,t)=>{let r=uc(e.inputs,t);if(e.inputs[0].dims.length===5)throw new Error(\"Packed QKV is not implemented\");if(e.inputs[1]?.dims.length===5)throw new Error(\"Packed KV is not implemented\");let o=e.inputs[1]&&e.inputs[2]&&e.inputs[1].dims.length===4&&e.inputs[2].dims.length===4,n=oo(e,r.batchSize,r.numHeads,r.sequenceLength,r.headSize,e.inputs[0],e.inputs[3],0);if(o)return Qr(e,n,e.inputs[1],e.inputs[2],e.inputs[4],void 0,void 0,void 0,e.inputs[5],r,t);let s=oo(e,r.batchSize,r.numHeads,r.kvSequenceLength,r.headSize,e.inputs[1],e.inputs[3],r.hiddenSize),u=oo(e,r.batchSize,r.numHeads,r.kvSequenceLength,r.vHeadSize,e.inputs[2],e.inputs[3],2*r.hiddenSize);Qr(e,n,s,u,e.inputs[4],void 0,e.inputs[6],e.inputs[7],e.inputs[5],r,t)}});var lc,cc,pc,mc,fc,hc,gc,yc,js,Ys=q(()=>{\"use strict\";ie();_e();be();lc=e=>{if(!e||e.length<1)throw new Error(\"Too few inputs\");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error(\"Input type must be float or float16.\");if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw new Error(\"The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].\")}},cc=(e,t,r)=>{let o=\"\";for(let n=t-1;n>=0;--n)o+=`\\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\\n if (k < 0) {\\n break;\\n }\\n if (k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\\n break;\\n }\\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\\n `;return`\\n value = ${e.type.value}(uniforms.constant_value);\\n for (var i = 0; i < 1; i++) {\\n var offset = 0;\\n var k = 0;\\n ${o}\\n value = x[offset];\\n }\\n `},pc=(e,t,r)=>{let o=\"\";for(let n=t-1;n>=0;--n)o+=`\\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\\n if (k < 0) {\\n k = -k;\\n }\\n {\\n let _2n_1 = 2 * (i32(${re(\"uniforms.x_shape\",n,t)}) - 1);\\n k = k % _2n_1;\\n if(k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\\n k = _2n_1 - k;\\n }\\n }\\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\\n `;return`\\n var offset = 0;\\n var k = 0;\\n ${o}\\n value = x[offset];\\n `},mc=(e,t,r)=>{let o=\"\";for(let n=t-1;n>=0;--n)o+=`\\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\\n if (k < 0) {\\n k = 0;\\n }\\n if (k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\\n k = i32(${re(\"uniforms.x_shape\",n,t)}) - 1;\\n }\\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\\n `;return`\\n var offset = 0;\\n var k = 0;\\n ${o}\\n value = x[offset];\\n `},fc=(e,t,r)=>{let o=\"\";for(let n=t-1;n>=0;--n)o+=`\\n k = i32(${e.indicesGet(\"indices\",n)}) - ${re(\"uniforms.pads\",n,r)};\\n if (k < 0) {\\n k += i32(${re(\"uniforms.x_shape\",n,t)}]);\\n }\\n if (k >= i32(${re(\"uniforms.x_shape\",n,t)})) {\\n k -= i32(${re(\"uniforms.x_shape\",n,t)});\\n }\\n offset += k * i32(${re(\"uniforms.x_strides\",n,t)});\\n `;return`\\n var offset = 0;\\n var k = 0;\\n ${o}\\n value = x[offset];\\n `},hc=(e,t,r)=>{switch(r.mode){case 0:return cc(e,t,r.pads.length);case 1:return pc(e,t,r.pads.length);case 2:return mc(e,t,r.pads.length);case 3:return fc(e,t,r.pads.length);default:throw new Error(\"Invalid mode\")}},gc=(e,t)=>{let r=z.padShape(e[0].dims.slice(),t.pads),o=e[0].dims,n=z.size(r),s=[{type:12,data:n},{type:12,data:t.pads}];t.mode===0&&s.push({type:e[0].dataType,data:t.value}),s.push(...j(e[0].dims,r));let u=[\"rank\"],l=a=>{let p=F(\"output\",e[0].dataType,r.length),m=M(\"x\",e[0].dataType,o.length),f=m.type.value,b=hc(p,o.length,t),_=[{name:\"output_size\",type:\"u32\"},{name:\"pads\",type:\"i32\",length:t.pads.length}];return t.mode===0&&_.push({name:\"constant_value\",type:f}),`\\n ${a.registerUniforms(_).declareVariables(m,p)}\\n ${a.mainStart()}\\n ${a.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n\\n let indices = ${p.offsetToIndices(\"global_idx\")};\\n\\n var value = ${f}(0);\\n ${b}\\n output[global_idx] = value;\\n }`};return{name:\"Pad\",shaderCache:{hint:`${t.mode}`,inputDependencies:u},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(z.size(r)/64)},programUniforms:s}),getShaderSource:l}},yc=(e,t)=>{if(e.length>1){let r=e[1].getBigInt64Array(),o=e.length>=3&&e[2].data?e[2].getFloat32Array()[0]:0,n=e[0].dims.length,s=new Int32Array(2*n).fill(0);if(e.length>=4){let l=e[3].getBigInt64Array();for(let a=0;as[Number(a)]=Number(l));let u=[];return s.forEach(l=>u.push(l)),{mode:t.mode,value:o,pads:u}}else return t},js=(e,t)=>{lc(e.inputs);let r=yc(e.inputs,t);e.compute(gc(e.inputs,r),{inputs:[0]})}});var dn,Zs,Qs,Xs,Js,bc,wc,eu,tu,ru,nu,ou,au,iu,su,uu,du,lu,cu,pu=q(()=>{\"use strict\";Kt();ie();_e();be();dn=e=>{if(qt.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error(\"Pool ops requires 1 input.\")},Zs=(e,t,r)=>{let o=t.format===\"NHWC\",n=e.dims.slice();o&&n.splice(1,0,n.pop());let s=Object.hasOwnProperty.call(t,\"dilations\"),u=t.kernelShape.slice(),l=t.strides.slice(),a=s?t.dilations.slice():[],p=t.pads.slice();zt.adjustPoolAttributes(r,n,u,l,a,p);let m=zt.computePoolOutputShape(r,n,l,a,u,p,t.autoPad),f=Object.assign({},t);s?Object.assign(f,{kernelShape:u,strides:l,pads:p,dilations:a,cacheKey:t.cacheKey}):Object.assign(f,{kernelShape:u,strides:l,pads:p,cacheKey:t.cacheKey});let b=m.slice();return b.push(b.splice(1,1)[0]),[f,o?b:m]},Qs=(e,t)=>{let r=t.format===\"NHWC\",o=z.size(e),n=z.size(t.kernelShape),s=[{type:12,data:o},{type:12,data:n}],u=[{name:\"outputSize\",type:\"u32\"},{name:\"kernelSize\",type:\"u32\"}];if(t.kernelShape.length<=2){let l=t.kernelShape[t.kernelShape.length-1],a=t.strides[t.strides.length-1],p=t.pads[t.pads.length/2-1],m=t.pads[t.pads.length-1],f=!!(p+m);s.push({type:12,data:l},{type:12,data:a},{type:12,data:p},{type:12,data:m}),u.push({name:\"kw\",type:\"u32\"},{name:\"sw\",type:\"u32\"},{name:\"pwStart\",type:\"u32\"},{name:\"pwEnd\",type:\"u32\"});let b=!1;if(t.kernelShape.length===2){let _=t.kernelShape[t.kernelShape.length-2],y=t.strides[t.strides.length-2],$=t.pads[t.pads.length/2-2],I=t.pads[t.pads.length-2];b=!!($+I),s.push({type:12,data:_},{type:12,data:y},{type:12,data:$},{type:12,data:I}),u.push({name:\"kh\",type:\"u32\"},{name:\"sh\",type:\"u32\"},{name:\"phStart\",type:\"u32\"},{name:\"phEnd\",type:\"u32\"})}return[s,u,!0,f,b]}else{if(r)throw new Error(\"Pooling with kernelShape.length > 2 is not supported for NHWC format.\");let l=z.computeStrides(t.kernelShape);s.push({type:12,data:l},{type:12,data:t.pads},{type:12,data:t.strides}),u.push({name:\"kernelStrides\",type:\"u32\",length:l.length},{name:\"pads\",type:\"u32\",length:t.pads.length},{name:\"strides\",type:\"u32\",length:t.strides.length});let a=t.pads.reduce((p,m)=>p+m);return[s,u,!!a,!1,!1]}},Xs=(e,t,r,o,n,s,u,l,a,p,m,f)=>{let b=n.format===\"NHWC\",_=t.type.value,y=F(\"output\",t.type.tensor,o);if(n.kernelShape.length<=2){let $=\"\",I=\"\",C=\"\",v=r-(b?2:1);if(m?$=`\\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\\n xIndices[${v}] = indices[${v}] * uniforms.sw - uniforms.pwStart + i;\\n if (xIndices[${v}] < 0 || xIndices[${v}]\\n >= uniforms.x_shape[${v}]) {\\n pad++;\\n continue;\\n }\\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\\n ${s}\\n }`:$=`\\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\\n xIndices[${v}] = indices[${v}] * uniforms.sw - uniforms.pwStart + i;\\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\\n ${s}\\n }`,n.kernelShape.length===2){let T=r-(b?3:2);f?I=`\\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\\n xIndices[${T}] = indices[${T}] * uniforms.sh - uniforms.phStart + j;\\n if (xIndices[${T}] < 0 || xIndices[${T}] >= uniforms.x_shape[${T}]) {\\n pad += i32(uniforms.kw);\\n continue;\\n }\\n `:I=`\\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\\n xIndices[${T}] = indices[${T}] * uniforms.sh - uniforms.phStart + j;\\n `,C=`\\n }\\n `}return`\\n ${e.registerUniforms(a).declareVariables(t,y)}\\n\\n ${e.mainStart()}\\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n\\n let indices = ${y.offsetToIndices(\"global_idx\")};\\n var xIndices = ${y.offsetToIndices(\"global_idx\")};\\n\\n var value = ${_}(${l});\\n var pad = 0;\\n ${I}\\n ${$}\\n ${C}\\n ${u}\\n\\n output[global_idx] = value;\\n }`}else{if(b)throw new Error(\"Pooling with kernelShape.length > 2 is not supported for NHWC format.\");let $=n.kernelShape.length,I=n.pads.length,C=\"\";return p?C=`\\n if (xIndices[j] >= uniforms.x_shape[j]) {\\n pad++;\\n isPad = true;\\n break;\\n }\\n }\\n if (!isPad) {\\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\\n ${s}\\n }`:C=`\\n }\\n let x_val = x[${t.indicesToOffset(\"xIndices\")}];\\n ${s}\\n `,`\\n ${e.registerUniforms(a).declareVariables(t,y)}\\n\\n ${e.mainStart()}\\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n let indices = ${y.offsetToIndices(\"global_idx\")};\\n var xIndices = ${y.offsetToIndices(\"global_idx\")};\\n\\n var offsets: array;\\n\\n var value = ${_}(${l});\\n var pad = 0;\\n var isPad = false;\\n\\n for (var i: u32 = 0u; i < uniforms.kernelSize; i++) {\\n var offset = i;\\n for (var j = 0u; j < ${$-1}u; j++) {\\n offsets[j] = offset / ${re(\"uniforms.kernelStrides\",\"j\",$)};\\n offset -= offsets[j] * ${re(\"uniforms.kernelStrides\",\"j\",$)};\\n }\\n offsets[${$-1}] = offset;\\n\\n isPad = false;\\n for (var j = ${r-$}u; j < ${r}u; j++) {\\n xIndices[j] = indices[j] * ${re(\"uniforms.strides\",`j - ${r-$}u`,$)}\\n + offsets[j - ${r-$}u] - ${re(\"uniforms.pads\",\"j - 2u\",I)};\\n ${C}\\n }\\n ${u}\\n\\n output[global_idx] = value;\\n }`}},Js=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,bc=e=>`${Js(e)};${e.countIncludePad}`,wc=e=>`${Js(e)};${e.storageOrder};${e.dilations}`,eu=e=>({format:e.format,autoPad:[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),tu=(e,t,r,o)=>{let[n,s]=Zs(t,o,r),u=M(\"x\",t.dataType,t.dims.length),l=u.type.value,a=\"value += x_val;\",p=\"\";n.countIncludePad?p+=`value /= ${l}(uniforms.kernelSize);`:p+=`value /= ${l}(i32(uniforms.kernelSize) - pad);`;let[m,f,b,_,y]=Qs(s,n);m.push(...j(t.dims,s));let $=[\"rank\"];return{name:e,shaderCache:{hint:`${o.cacheKey};${b};${_};${y}`,inputDependencies:$},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(z.size(s)/64)},programUniforms:m}),getShaderSource:I=>Xs(I,u,t.dims.length,s.length,n,a,p,0,f,b,_,y)}},ru=e=>{let t=e.count_include_pad!==0,r=eu(e);if(r.ceilMode!==0)throw new Error(\"using ceil() in shape computation is not yet supported for AveragePool\");let o={countIncludePad:t,...r,cacheKey:\"\"};return{...o,cacheKey:bc(o)}},nu=(e,t)=>{dn(e.inputs),e.compute(tu(\"AveragePool\",e.inputs[0],!1,t))},ou={autoPad:\"\",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},au=e=>{let t=e.format;return{format:t,...ou,cacheKey:t}},iu=(e,t)=>{dn(e.inputs),e.compute(tu(\"GlobalAveragePool\",e.inputs[0],!0,t))},su=(e,t,r,o)=>{let[n,s]=Zs(t,o,r),u=`\\n value = max(x_val, value);\\n `,l=\"\",a=M(\"x\",t.dataType,t.dims.length),p=[\"rank\"],[m,f,b,_,y]=Qs(s,n);return m.push(...j(t.dims,s)),{name:e,shaderCache:{hint:`${o.cacheKey};${b};${_};${y}`,inputDependencies:p},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(z.size(s)/64)},programUniforms:m}),getShaderSource:$=>Xs($,a,t.dims.length,s.length,n,u,l,t.dataType===10?-65504:-1e5,f,b,_,y)}},uu=(e,t)=>{dn(e.inputs),e.compute(su(\"MaxPool\",e.inputs[0],!1,t))},du=e=>{let t=e.storage_order,r=e.dilations,o=eu(e);if(t!==0)throw new Error(\"column major storage order is not yet supported for MaxPool\");if(o.ceilMode!==0)throw new Error(\"using ceil() in shape computation is not yet supported for MaxPool\");let n={storageOrder:t,dilations:r,...o,cacheKey:\"\"};return{...n,cacheKey:wc(n)}},lu=e=>{let t=e.format;return{format:t,...ou,cacheKey:t}},cu=(e,t)=>{dn(e.inputs),e.compute(su(\"GlobalMaxPool\",e.inputs[0],!0,t))}});var $c,_c,mu,fu=q(()=>{\"use strict\";Kt();ie();be();$c=(e,t,r)=>{let o=e===t,n=et&&r>0;if(o||n||s)throw new Error(\"Range these inputs\\' contents are invalid.\")},_c=(e,t,r,o)=>{let n=Math.abs(Math.ceil((t-e)/r)),s=[n],u=n,l=[{type:12,data:u},{type:o,data:e},{type:o,data:r},...j(s)],a=p=>{let m=F(\"output\",o,s.length),f=m.type.value,b=[{name:\"outputSize\",type:\"u32\"},{name:\"start\",type:f},{name:\"delta\",type:f}];return`\\n ${p.registerUniforms(b).declareVariables(m)}\\n ${p.mainStart()}\\n ${p.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n output[global_idx] = uniforms.start + ${f}(global_idx) * uniforms.delta;\\n }`};return{name:\"Range\",shaderCache:{hint:`${o}`},getShaderSource:a,getRunData:()=>({outputs:[{dims:s,dataType:o}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:l})}},mu=e=>{let t=0,r=0,o=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],r=e.inputs[1].getInt32Array()[0],o=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],r=e.inputs[1].getFloat32Array()[0],o=e.inputs[2].getFloat32Array()[0]),qt.webgpu.validateInputContent&&$c(t,r,o),e.compute(_c(t,r,o,e.inputs[0].dataType),{inputs:[]})}});var xc,Sc,Cc,Ic,Ac,Tc,Ec,Pc,Oc,kc,Rc,hu,Bc,Dc,Mc,zc,Uc,gu,yu,bu=q(()=>{\"use strict\";ie();_e();je();be();xc=(e,t)=>{if(e.every(r=>r>0||(()=>{throw new Error(\"Resize requires scales input values to be positive\")})),e.length>0){if(t.mode===\"linear\"){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw new Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and\\n one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===\"cubic\"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error(\"Resize requires scales input size to be 2 or 4 for cubic mode\")}},Sc=(e,t,r)=>{t.every(n=>n>=0&&n{throw new Error(\"Resize requires axes input values to be positive and less than rank\")}));let o=new Array(r).fill(1);return t.forEach((n,s)=>o[n]=e[s]),o},Cc=(e,t,r,o,n,s)=>{let[u,l,a]=r>10?[1,2,3]:[-1,e.length>1?1:-1,-1],p=e[0].dims.length;if(u>0&&e.length>u&&e[u].dims.length>0)e[u].getFloat32Array().forEach(m=>s.push(m));else if(t.coordinateTransformMode===\"tf_crop_and_resize\")throw new Error(\"Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize\");if(l>0&&e.length>l&&e[l].dims.length>0){if(e[l].getFloat32Array().forEach(m=>o.push(m)),o.length!==0&&o.length!==p&&r>=18&&o.length!==t.axes.length)throw new Error(\"Resize requires scales input size to be same as input rank or axes size for opset 18 and up\");xc(o,t),t.axes.length>0&&Sc(o,t.axes,p).forEach((m,f)=>o[f]=m)}if(a>0&&e.length>a&&(e[a].getBigInt64Array().forEach(m=>n.push(Number(m))),n.length!==p||r>=18&&n.length===t.axes.length))throw new Error(\"Resize requires sizes input size to be same as input rank or axes size for opset 18 and up\");if(t.axes.length>0){if(o.length!==t.axes.length)throw new Error(\\'Resize requires \"scales\" input size to be of axes rank when axes attributes is specified\\');if(n.length!==t.axes.length)throw new Error(\\'Resize requires \"sizes\" input size to be of rank axes rank when axes attributes is specified\\')}if(typeof o<\"u\"&&typeof n<\"u\"&&o.length>0&&n.length>p)throw new Error(\"Resize requires only of scales or sizes to be specified\")},Ic=(e,t)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32,\\n lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${t} { `+(()=>{switch(e){case\"asymmetric\":return`return ${t}(xResized) / ${t}(xScale);`;case\"pytorch_half_pixel\":return`if (lengthResized > 1) {\\n return (${t}(xResized) + 0.5) / ${t}(xScale) - 0.5;\\n } else {\\n return 0.0;\\n }`;case\"tf_half_pixel_for_nn\":return`return (${t}(xResized) + 0.5) / ${t}(xScale);`;case\"align_corners\":return`if (lengthResized == 1) {\\n return 0.0;\\n } else {\\n // The whole part and the fractional part are calculated separately due to inaccuracy of floating\\n // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an\\n // offset-by-one error later in floor().\\n let whole = ${t}(xResized * (lengthOriginal - 1) / (lengthResized - 1));\\n let fract =\\n ${t}(xResized * (lengthOriginal - 1) % (lengthResized - 1)) / ${t}(lengthResized - 1);\\n return whole + fract;\\n }`;case\"tf_crop_and_resize\":return`if (lengthResized > 1) {\\n return ${t}(roiStart) * ${t}(lengthOriginal - 1) +\\n (${t}(xResized) * ${t}(roiEnd - roiStart) * ${t}(lengthOriginal - 1)) /\\n ${t}(lengthResized - 1);\\n } else {\\n return 0.5 * ${t}(roiStart + roiEnd) * ${t}(lengthOriginal - 1);\\n }`;case\"half_pixel_symmetric\":return`const outputWidth = ${t}xScale * ${t}(lengthResized);\\n const adjustment = ${t}(lengthResized) / outputWidth;\\n const center = ${t}(lengthOriginal) / 2;\\n const offset = center * (1 - adjustment);\\n return offset + ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;case\"half_pixel\":return`return ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+\"}\",Ac=(e,t,r)=>`fn getNearestPixelFromOriginal(xOriginal: ${r}, isDownSample: bool) -> ${r} {`+(()=>{switch(e){case\"round_prefer_ceil\":return\"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }\";case\"floor\":return\"return floor(xOriginal);\";case\"ceil\":return\"return ceil(xOriginal);\";case\"round_prefer_floor\":return\"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }\";case\"simple\":default:if(t<11)return\"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }\";throw new Error(`Nearest mode ${e} is not supported`)}})()+\"}\",Tc=(e,t,r)=>{let o=new Array(r).fill(0).concat(new Array(r).fill(1)),n=e.length===0?o:e.slice();return t.length>0?(t.forEach((s,u)=>{o[s]=n[u],o[u+r]=n[t.length+u]}),o):n},Ec=(e,t,r,o)=>{let n=[];if(r.length>0)if(o.length>0){if(e.forEach(s=>n.push(s)),Math.max(...o)>e.length)throw new Error(\"axes is out of bound\");o.forEach((s,u)=>n[s]=r[u])}else r.forEach(s=>n.push(s));else{if(t.length===0)throw new Error(\"Resize requires either scales or sizes.\");n=e.map((s,u)=>Math.round(s*t[u]))}return n},Pc=(e,t,r)=>{let o=(()=>{switch(r.keepAspectRatioPolicy){case\"not_larger\":return r.axes.length>0?Math.min(...r.axes.map(s=>t[s]),Number.MAX_VALUE):Math.min(...t,Number.MAX_VALUE);case\"not_smaller\":return r.axes.length>0?Math.max(...r.axes.map(s=>t[s]),Number.MIN_VALUE):Math.max(...t,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${r.keepAspectRatioPolicy} is not supported`)}})();t.fill(1,0,t.length);let n=e.slice();return r.axes.length>0?(r.axes.forEach(s=>t[s]=o),r.axes.forEach(s=>n[s]=Math.round(e[s]*t[s]))):(t.fill(o,0,t.length),n.forEach((s,u)=>n[u]=Math.round(s*t[u]))),n},Oc=(e,t,r,o,n)=>`\\n fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${r.length}> {\\n var original_indices: array<${e.type.value}, ${r.length}>;\\n for (var i:u32 = 0; i < ${r.length}; i++) {\\n var output_index = ${e.indicesGet(\"output_indices\",\"i\")};\\n var scale = ${re(\"uniforms.scales\",\"i\",o)};\\n var roi_low = ${re(\"uniforms.roi\",\"i\",n)};\\n var roi_hi = ${re(\"uniforms.roi\",`i + ${t.length}`,n)};\\n if (scale == 1.0) {\\n original_indices[i] = ${e.type.value}(output_index);\\n } else {\\n var input_shape_i = ${re(\"uniforms.input_shape\",\"i\",t.length)};\\n var output_shape_i = ${re(\"uniforms.output_shape\",\"i\",r.length)};\\n original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\\n input_shape_i, roi_low, roi_hi);\\n }\\n }\\n return original_indices;\\n }`,kc=(e,t,r,o,n,s,u)=>`\\n fn calculateInputIndicesFromOutputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} {\\n var input_indices: ${e.type.indices};\\n for (var i:u32 = 0; i < ${o.length}; i++) {\\n var output_index = ${t.indicesGet(\"output_indices\",\"i\")};\\n var input_index: u32;\\n var scale = ${re(\"uniforms.scales\",\"i\",n)};\\n if (scale == 1.0) {\\n input_index = output_index;\\n } else {\\n var roi_low = ${re(\"uniforms.roi\",\"i\",s)};\\n var roi_hi = ${re(\"uniforms.roi\",`i + ${r.length}`,s)};\\n var input_shape_i = ${re(\"uniforms.input_shape\",\"i\",r.length)};\\n var output_shape_i = ${re(\"uniforms.output_shape\",\"i\",o.length)};\\n var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\\n input_shape_i, roi_low, roi_hi);\\n if (!${u} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) {\\n if (original_idx < 0) {\\n input_index = 0;\\n } else if (original_idx > ${t.type.value}(input_shape_i - 1)) {\\n input_index = input_shape_i - 1;\\n } else {\\n input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1));\\n }\\n } else {\\n input_index = u32(original_idx);\\n }\\n }\\n ${e.indicesSet(\"input_indices\",\"i\",\" input_index\")}\\n }\\n return input_indices;\\n }`,Rc=(e,t)=>`\\n fn checkInputIndices(input_indices: ${e.type.indices}) -> bool {\\n for (var i:u32 = 0; i < ${t.length}; i++) {\\n var input_index = ${e.indicesGet(\"input_indices\",\"i\")};\\n if (input_index < 0 || input_index >= ${re(\"uniforms.input_shape\",\"i\",t.length)}) {\\n return false;\\n }\\n }\\n return true;\\n }`,hu=(e,t,r,o)=>e.rank>o?`\\n ${e.indicesSet(\"input_indices\",t,\"channel\")};\\n ${e.indicesSet(\"input_indices\",r,\"batch\")};\\n`:\"\",Bc=(e,t,r,o,n)=>{let[u,l,a,p]=r.length===2?[-1,0,1,-1]:[0,2,3,1],m=e.type.value;return`\\n fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${m} {\\n var input_indices: ${e.type.indices};\\n ${e.indicesSet(\"input_indices\",l,`max(0, min(row, ${r[l]} - 1))`)};\\n ${e.indicesSet(\"input_indices\",a,`max(0, min(col, ${r[a]} - 1))`)};\\n ${hu(e,p,u,2)}\\n return ${e.getByIndices(\"input_indices\")};\\n }\\n\\n fn bilinearInterpolation(output_indices: ${t.type.indices}) -> ${m} {\\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\\n var row:${m} = originalIndices[${l}];\\n var col:${m} = originalIndices[${a}];\\n ${o?`if (row < 0 || row > (${r[l]} - 1) || col < 0 || col > (${r[a]} - 1)) {\\n return ${n};\\n }`:\"\"};\\n row = max(0, min(row, ${r[l]} - 1));\\n col = max(0, min(col, ${r[a]} - 1));\\n var row1: u32 = u32(row);\\n var col1: u32 = u32(col);\\n var row2: u32 = u32(row + 1);\\n var col2: u32 = u32(col + 1);\\n var channel: u32 = ${r.length>2?`u32(originalIndices[${p}])`:\"0\"};\\n var batch: u32 = ${r.length>2?`u32(originalIndices[${u}])`:\"0\"};\\n var x11: ${m} = getInputValue(batch, channel, row1, col1);\\n var x12: ${m} = getInputValue(batch, channel, row1, col2);\\n var x21: ${m} = getInputValue(batch, channel, row2, col1);\\n var x22: ${m} = getInputValue(batch, channel, row2, col2);\\n var dx1: ${m} = abs(row - ${m}(row1));\\n var dx2: ${m} = abs(${m}(row2) - row);\\n var dy1: ${m} = abs(col - ${m}(col1));\\n var dy2: ${m} = abs(${m}(col2) - col);\\n if (row1 == row2) {\\n dx1 = 0.5;\\n dx2 = 0.5;\\n }\\n if (col1 == col2) {\\n dy1 = 0.5;\\n dy2 = 0.5;\\n }\\n return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1);\\n }`},Dc=(e,t,r,o,n,s,u,l,a,p)=>{let m=r.length===2,f=!0,[b,_]=m?[0,1]:f?[2,3]:[1,2],y=e.type.value,$=I=>{let C=I===b?\"row\":\"col\";return`\\n fn ${C}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${t.type.indices}) -> ${y} {\\n var output_index = ${t.indicesGet(\"output_indices\",I)};\\n var originalIdx: ${y} = getOriginalCoordinateFromResizedCoordinate(output_index, ${n[I]},\\n ${o[I]}, ${r[I]}, ${s[I]}, ${s[I]} + ${r.length});\\n var fractOriginalIdx: ${y} = originalIdx - floor(originalIdx);\\n var coefs = getCubicInterpolationCoefs(fractOriginalIdx);\\n\\n if (${l} && (originalIdx < 0 || originalIdx > (${r[I]} - 1))) {\\n return ${a};\\n }\\n var data: array<${y}, 4> = array<${y}, 4>(0.0, 0.0, 0.0, 0.0);\\n for (var i: i32 = -1; i < 3; i++) {\\n var ${C}: ${y} = originalIdx + ${y}(i);\\n if (${C} < 0 || ${C} >= ${r[I]}) {\\n ${(()=>p?`coefs[i + 1] = 0.0;\\n continue;`:l?`return ${a};`:`${C} = max(0, min(${C}, ${r[I]} - 1));`)()};\\n }\\n var input_indices_copy: ${e.type.indices} = input_indices;\\n ${e.indicesSet(\"input_indices_copy\",I,`u32(${C})`)};\\n data[i + 1] = ${I===b?e.getByIndices(\"input_indices_copy\"):\"rowCubicInterpolation(input_indices_copy, output_indices)\"};\\n }\\n return cubicInterpolation1D(data, coefs);\\n }`};return`\\n ${$(b)};\\n ${$(_)};\\n fn getCubicInterpolationCoefs(s: ${y}) -> array<${y}, 4> {\\n var absS = abs(s);\\n var coeffs: array<${y}, 4> = array<${y}, 4>(0.0, 0.0, 0.0, 0.0);\\n var oneMinusAbsS: ${y} = 1.0 - absS;\\n var twoMinusAbsS: ${y} = 2.0 - absS;\\n var onePlusAbsS: ${y} = 1.0 + absS;\\n coeffs[0] = ((${u} * onePlusAbsS - 5 * ${u}) * onePlusAbsS + 8 * ${u}) * onePlusAbsS - 4 * ${u};\\n coeffs[1] = ((${u} + 2) * absS - (${u} + 3)) * absS * absS + 1;\\n coeffs[2] = ((${u} + 2) * oneMinusAbsS - (${u} + 3)) * oneMinusAbsS * oneMinusAbsS + 1;\\n coeffs[3] = ((${u} * twoMinusAbsS - 5 * ${u}) * twoMinusAbsS + 8 * ${u}) * twoMinusAbsS - 4 * ${u};\\n return coeffs;\\n }\\n\\n fn cubicInterpolation1D(x: array<${y}, 4>, coefs: array<${y}, 4>) -> ${y} {\\n var coefsSum: ${y} = coefs[0] + coefs[1] + coefs[2] + coefs[3];\\n return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum;\\n }\\n\\n fn bicubicInterpolation(output_indices: ${t.type.indices}) -> ${y} {\\n var input_indices: ${e.type.indices} = output_indices;\\n return colCubicInterpolation(input_indices, output_indices);\\n }\\n `},Mc=(e,t,r,o,n)=>{let[u,l,a,p,m]=r.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],f=e.type.value;return`\\n fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${f} {\\n var input_indices: ${e.type.indices};\\n ${e.indicesSet(\"input_indices\",l,`max(0, min(depth, ${r[l]} - 1))`)};\\n ${e.indicesSet(\"input_indices\",a,`max(0, min(height, ${r[a]} - 1))`)};\\n ${e.indicesSet(\"input_indices\",p,`max(0, min(width, ${r[p]} - 1))`)};\\n ${hu(e,m,u,3)}\\n return ${e.getByIndices(\"input_indices\")};\\n }\\n\\n fn trilinearInterpolation(output_indices: ${t.type.indices}) -> ${f} {\\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\\n var depth:${f} = originalIndices[${l}];\\n var height:${f} = originalIndices[${a}];\\n var width:${f} = originalIndices[${p}];\\n ${o?`if (depth < 0 || depth > (${r[l]} - 1) || height < 0 || height > (${r[a]} - 1) || width < 0 || (width > ${r[p]} - 1)) {\\n return ${n};\\n }`:\"\"};\\n\\n depth = max(0, min(depth, ${r[l]} - 1));\\n height = max(0, min(height, ${r[a]} - 1));\\n width = max(0, min(width, ${r[p]} - 1));\\n var depth1: u32 = u32(depth);\\n var height1: u32 = u32(height);\\n var width1: u32 = u32(width);\\n var depth2: u32 = u32(depth + 1);\\n var height2: u32 = u32(height + 1);\\n var width2: u32 = u32(width + 1);\\n var channel: u32 = ${r.length>3?`u32(originalIndices[${m}])`:\"0\"};\\n var batch: u32 = ${r.length>3?`u32(originalIndices[${u}])`:\"0\"};\\n\\n var x111: ${f} = getInputValue(batch, channel, depth1, height1, width1);\\n var x112: ${f} = getInputValue(batch, channel, depth1, height1, width2);\\n var x121: ${f} = getInputValue(batch, channel, depth1, height2, width1);\\n var x122: ${f} = getInputValue(batch, channel, depth1, height2, width2);\\n var x211: ${f} = getInputValue(batch, channel, depth2, height1, width1);\\n var x212: ${f} = getInputValue(batch, channel, depth2, height1, width2);\\n var x221: ${f} = getInputValue(batch, channel, depth2, height2, width1);\\n var x222: ${f} = getInputValue(batch, channel, depth2, height2, width2);\\n var dx1: ${f} = abs(depth - ${f}(depth1));\\n var dx2: ${f} = abs(${f}(depth2) - depth);\\n var dy1: ${f} = abs(height - ${f}(height1));\\n var dy2: ${f} = abs(${f}(height2) - height);\\n var dz1: ${f} = abs(width - ${f}(width1));\\n var dz2: ${f} = abs(${f}(width2) - width);\\n if (depth1 == depth2) {\\n dx1 = 0.5;\\n dx2 = 0.5;\\n }\\n if (height1 == height2) {\\n dy1 = 0.5;\\n dy2 = 0.5;\\n }\\n if (width1 == width2) {\\n dz1 = 0.5;\\n dz2 = 0.5;\\n }\\n return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 +\\n x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1);\\n }`},zc=(e,t,r,o,n,s)=>{let u=e.dims,l=Tc(s,t.axes,u.length),a=Ec(u,o,n,t.axes),p=o.slice();o.length===0&&(p=u.map((v,A)=>v===0?1:a[A]/v),t.keepAspectRatioPolicy!==\"stretch\"&&(a=Pc(u,p,t)));let m=F(\"output\",e.dataType,a.length),f=M(\"input\",e.dataType,u.length),b=z.size(a),_=u.length===a.length&&u.every((v,A)=>v===a[A]),y=t.coordinateTransformMode===\"tf_crop_and_resize\",$=t.extrapolationValue,I=f.type.value,C=v=>`\\n ${_?\"\":`\\n ${Ic(t.coordinateTransformMode,I)};\\n ${(()=>{switch(t.mode){case\"nearest\":return`\\n ${Rc(f,u)};\\n ${Ac(t.nearestMode,r,I)};\\n ${kc(f,m,u,a,p.length,l.length,y)};\\n `;case\"linear\":return`\\n ${Oc(m,u,a,p.length,l.length)};\\n ${(()=>{if(u.length===2||u.length===4)return`${Bc(f,m,u,y,$)}`;if(u.length===3||u.length===5)return`${Mc(f,m,u,y,$)}`;throw Error(\"Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.\")})()};\\n `;case\"cubic\":return`\\n ${(()=>{if(u.length===2||u.length===4)return`${Dc(f,m,u,a,p,l,t.cubicCoeffA,y,t.extrapolationValue,t.excludeOutside)}`;throw Error(\"Cubic mode only supports input dims 2 and 4 are supported in linear mode.\")})()};\\n `;default:throw Error(\"Invalid resize mode\")}})()};\\n `}\\n ${v.registerUniform(\"output_size\",\"u32\").registerUniform(\"scales\",\"f32\",p.length).registerUniform(\"roi\",\"f32\",l.length).declareVariables(f,m)}\\n ${v.mainStart()}\\n ${v.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n ${_?\"output[global_idx] = input[global_idx];\":`\\n let output_indices = ${m.offsetToIndices(\"global_idx\")};\\n var input_indices: ${f.type.indices};\\n ${(()=>{switch(t.mode){case\"nearest\":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices);\\n if (checkInputIndices(input_indices)) {\\n output[global_idx] = ${f.getByIndices(\"input_indices\")};\\n } else {\\n output[global_idx] = ${t.extrapolationValue};\\n }`;case\"linear\":return`output[global_idx] = ${u.length===2||u.length===4?\"bilinearInterpolation\":\"trilinearInterpolation\"}(output_indices);`;case\"cubic\":return\"output[global_idx] = bicubicInterpolation(output_indices);\";default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()};\\n`}\\n }`;return{name:\"Resize\",shaderCache:{hint:`${t.cacheKey}|${r}|${p.length>0?p:\"\"}|${n.length>0?n:\"\"}|${l.length>0?l:\"\"}|${_}|${u}`,inputDependencies:[\"rank\"]},getShaderSource:C,getRunData:()=>({outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(b/64)},programUniforms:[{type:12,data:b},{type:1,data:p},{type:1,data:l},...j(u,a)]})}},Uc=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},gu=(e,t)=>{let r=[],o=[],n=[],s=Uc(e);if(t.antialias!==0)throw Error(\"Only default value (0) for Antialias attribute is supported\");Cc(e.inputs,t,s,r,o,n),e.compute(zc(e.inputs[0],t,s,r,o,n),{inputs:[0]})},yu=e=>{let t=e.antialias,r=e.axes,o=e.coordinateTransformMode,n=e.cubicCoeffA,s=e.excludeOutside!==0,u=e.extrapolationValue,l=e.keepAspectRatioPolicy,a=e.mode,p=e.nearestMode===\"\"?\"simple\":e.nearestMode;return $e({antialias:t,axes:r,coordinateTransformMode:o,cubicCoeffA:n,excludeOutside:s,extrapolationValue:u,keepAspectRatioPolicy:l,mode:a,nearestMode:p})}});var Vc,Nc,wu,vu=q(()=>{\"use strict\";ie();_e();be();Vc=e=>{if(!e||e.length<3)throw new Error(\"layerNorm requires at least 3 inputs.\");let t=e[0],r=e[1],o=e[2];if(t.dataType!==r.dataType||t.dataType!==o.dataType)throw new Error(\"All inputs must have the same data type\");if(t.dims.length!==3&&t.dims.length!==2)throw new Error(\"Input must be 2D or 3D\");if(r.dims.length!==3&&r.dims.length!==2)throw new Error(\"Skip must be 2D or 3D\");let n=t.dims[t.dims.length-1],s=t.dims[t.dims.length-2];if(r.dims[r.dims.length-1]!==n)throw new Error(\"Skip must have the same hidden size as input\");if(r.dims[r.dims.length-2]!==s)throw new Error(\"Skip must have the same sequence length as input\");if(o.dims.length!==1)throw new Error(\"Gamma must be 1D\");if(o.dims[o.dims.length-1]!==n)throw new Error(\"Gamma must have the same hidden size as input\");if(e.length>3){let u=e[3];if(u.dims.length!==1)throw new Error(\"Beta must be 1D\");if(u.dims[u.dims.length-1]!==n)throw new Error(\"Beta must have the same hidden size as input\")}if(e.length>4){let u=e[4];if(u.dims.length!==1)throw new Error(\"Bias must be 1D\");if(u.dims[u.dims.length-1]!==n)throw new Error(\"Bias must have the same hidden size as input\")}},Nc=(e,t,r,o)=>{let n=e[0].dims,s=z.size(n),u=n,l=s,a=n.slice(-1)[0],p=o?n.slice(0,-1).concat(1):[],m=e.length>3,f=e.length>4,b=o&&r>1,_=o&&r>2,y=r>3,$=Me(a),I=[{type:12,data:l},{type:12,data:$},{type:12,data:a},{type:1,data:t.epsilon}],C=A=>{let T=[{name:\"output_size\",type:\"u32\"},{name:\"components\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"},{name:\"epsilon\",type:\"f32\"}],D=[M(\"x\",e[0].dataType,e[0].dims,$),M(\"skip\",e[1].dataType,e[1].dims,$),M(\"gamma\",e[2].dataType,e[2].dims,$)];m&&D.push(M(\"beta\",e[3].dataType,e[3].dims,$)),f&&D.push(M(\"bias\",e[4].dataType,e[4].dims,$)),D.push(F(\"output\",e[0].dataType,u,$)),b&&D.push(F(\"mean_output\",1,p)),_&&D.push(F(\"inv_std_output\",1,p)),y&&D.push(F(\"input_skip_bias_sum\",e[0].dataType,u,$));let U=Pe(e[0].dataType);return`\\n\\n ${A.registerUniforms(T).declareVariables(...D)}\\n\\n ${A.mainStart()}\\n ${A.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size / uniforms.hidden_size\")}\\n let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components;\\n let offset = global_idx * hidden_size_vectorized;\\n var sum = ${Ye(\"f32\",$)};\\n var squareSum = ${Ye(\"f32\",$)};\\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\\n let skip_value = skip[offset + i];\\n let bias_value = ${f?\"bias[i]\":\"0.0\"};\\n let input_value = x[offset + i];\\n let value = input_value + skip_value + bias_value;\\n ${y?\"input_skip_bias_sum[offset + i] = value;\":\"\"}\\n output[offset + i] = value;\\n let f32_value = ${st(U,$,\"value\")};\\n sum += f32_value;\\n squareSum += f32_value * f32_value;\\n }\\n let mean = ${tt(\"sum\",$)} / f32(uniforms.hidden_size);\\n let inv_std_dev = inverseSqrt(${tt(\"squareSum\",$)} / f32(uniforms.hidden_size) - mean * mean + uniforms.epsilon);\\n ${b?\"mean_output[global_idx] = mean;\":\"\"}\\n ${_?\"inv_std_output[global_idx] = inv_std_dev;\":\"\"}\\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\\n output[offset + i] = (output[offset + i] - ${U}(mean)) * ${U}(inv_std_dev) * gamma[i] + ${m?\"beta[i]\":\"0.0\"};\\n }\\n }`},v=[{dims:u,dataType:e[0].dataType}];return r>1&&v.push({dims:p,dataType:1}),r>2&&v.push({dims:p,dataType:1}),r>3&&v.push({dims:n,dataType:e[0].dataType}),{name:\"SkipLayerNormalization\",shaderCache:{hint:`${$};${b};${_};${y}`,inputDependencies:e.map((A,T)=>\"type\")},getShaderSource:C,getRunData:()=>({outputs:v,dispatchGroup:{x:Math.ceil(l/a/64)},programUniforms:I})}},wu=(e,t)=>{Vc(e.inputs);let o=[0];e.outputCount>1&&o.push(-3),e.outputCount>2&&o.push(-3),e.outputCount>3&&o.push(3),e.compute(Nc(e.inputs,t,e.outputCount,!1),{outputs:o})}});var Wc,ln,Gc,$u,Hc,Lc,_u,xu,Su=q(()=>{\"use strict\";ie();_e();je();be();Wc=(e,t)=>{if(!e||e.length<1)throw new Error(\"too few inputs\");if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw new Error(\"axes, starts and ends must have the same length\")}else if(t.starts.length!==t.ends.length)throw new Error(\"starts and ends must have the same length\");e.slice(1).forEach((r,o)=>{if(e[o+1].dataType!==6&&e[o+1].dataType!==7)throw new Error(`Input ${o} must be an array of int32 or int64`)})},ln=(e,t)=>{let r=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(o=>r.push(Number(o)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(o=>r.push(Number(o)));else throw new Error(`Input ${t} must be an array of int32 or int64`);return r},Gc=(e,t)=>{if(e.length>1){let r=ln(e,1),o=ln(e,2),n=ln(e,3);return n.length===0&&(n=[...Array(e[0].dims.length).keys()]),$e({starts:r,ends:o,axes:n})}else return t},$u=(e,t,r,o,n)=>{let s=e;return e<0&&(s+=r[o[t]]),n[t]<0?Math.max(0,Math.min(s,r[o[t]]-1)):Math.max(0,Math.min(s,r[o[t]]))},Hc=(e,t,r)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} {\\n var input_indices: ${e.type.indices};\\n var carry = 0u;\\n for (var i = ${r.length}; i >= 0; i--) {\\n let input_shape_i = ${re(\"uniforms.input_shape\",\"i\",r.length)};\\n let steps_i = ${re(\"uniforms.steps\",\"i\",r.length)};\\n let signs_i = ${re(\"uniforms.signs\",\"i\",r.length)};\\n let starts_i = ${re(\"uniforms.starts\",\"i\",r.length)};\\n var output_index = ${t.indicesGet(\"output_indices\",\"i\")};\\n var input_index = output_index * steps_i + starts_i + carry;\\n carry = input_index / input_shape_i;\\n input_index = input_index % input_shape_i;\\n if (signs_i < 0) {\\n input_index = input_shape_i - input_index - 1u + starts_i;\\n }\\n ${e.indicesSet(\"input_indices\",\"i\",\"input_index\")};\\n }\\n return input_indices;\\n }`,Lc=(e,t)=>{let r=e[0].dims,o=z.size(r),n=t.axes.length>0?z.normalizeAxes(t.axes,r.length):[...Array(r.length).keys()],s=ln(e,4);s.forEach(C=>C!==0||(()=>{throw new Error(\"step cannot be 0\")})),s.length===0&&(s=Array(n.length).fill(1));let u=t.starts.map((C,v)=>$u(C,v,r,n,s)),l=t.ends.map((C,v)=>$u(C,v,r,n,s));if(n.length!==u.length||n.length!==l.length)throw new Error(\"start, ends and axes should have the same number of elements\");if(n.length!==r.length)for(let C=0;CMath.sign(C));s.forEach((C,v,A)=>{if(C<0){let T=(l[v]-u[v])/C,D=u[v],U=D+T*s[v];u[v]=U,l[v]=D,A[v]=-C}});let p=r.slice(0);n.forEach((C,v)=>{p[C]=Math.ceil((l[C]-u[C])/s[C])});let m={dims:p,dataType:e[0].dataType},f=F(\"output\",e[0].dataType,p.length),b=M(\"input\",e[0].dataType,e[0].dims.length),_=z.size(p),y=[{name:\"outputSize\",type:\"u32\"},{name:\"starts\",type:\"u32\",length:u.length},{name:\"signs\",type:\"i32\",length:a.length},{name:\"steps\",type:\"u32\",length:s.length}],$=[{type:12,data:_},{type:12,data:u},{type:6,data:a},{type:12,data:s},...j(e[0].dims,p)],I=C=>`\\n ${C.registerUniforms(y).declareVariables(b,f)}\\n ${Hc(b,f,r)}\\n ${C.mainStart()}\\n ${C.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\\n let output_indices = ${f.offsetToIndices(\"global_idx\")};\\n let input_indices = calculateInputIndices(output_indices);\\n ${f.setByOffset(\"global_idx\",b.getByIndices(\"input_indices\"))}\\n }`;return{name:\"Slice\",shaderCache:{hint:`${a.length}_${u.length}_${s.length}`,inputDependencies:[\"rank\"]},getShaderSource:I,getRunData:()=>({outputs:[m],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:$})}},_u=(e,t)=>{Wc(e.inputs,t);let r=Gc(e.inputs,t);e.compute(Lc(e.inputs,r),{inputs:[0]})},xu=e=>{let t=e.starts,r=e.ends,o=e.axes;return $e({starts:t,ends:r,axes:o})}});var Fc,qc,Cu,Iu,Au=q(()=>{\"use strict\";ie();_e();je();be();Fc=e=>{if(!e||e.length!==1)throw new Error(\"Softmax op requires 1 input.\")},qc=(e,t)=>{let r=e.dims,o=z.size(r),n=64,s=t.axis;if(s<0&&(s=r.length+s),sC===4?`max(max(${I}.x, ${I}.y), max(${I}.z, ${I}.w))`:C===2?`max(${I}.x, ${I}.y)`:C===3?`max(max(${I}.x, ${I}.y), ${I}.z)`:I,f=M(\"x\",e.dataType,e.dims,a),b=F(\"result\",e.dataType,e.dims,a),_=f.type.value,y=Pe(e.dataType)===\"f32\"?`var threadMax = ${_}(-3.402823e+38f);`:`var threadMax = ${_}(-65504.0h);`,$=I=>`\\n var rowMaxShared : ${_};\\n var rowSumShared : ${_};\\n var threadShared : array<${_}, ${n}>;\\n\\n fn getValue(row: i32, col: i32, row_stride: i32) -> ${_} {\\n let index = row * row_stride + col;\\n return x[index];\\n }\\n\\n fn setValue(row: i32, col: i32, row_stride: i32, value: ${_}) {\\n let index = row * row_stride + col;\\n result[index] = value;\\n }\\n ${I.registerUniform(\"packedCols\",\"i32\").declareVariables(f,b)}\\n ${I.mainStart()}\\n let gindex = i32(global_idx);\\n let lindex = i32(local_idx);\\n const wg = ${n};\\n let row = gindex / wg;\\n let cols = uniforms.packedCols;\\n let row_stride : i32 = uniforms.packedCols;\\n\\n // find the rows max\\n ${y}\\n for (var col = lindex; col < cols; col += wg) {\\n let value = getValue(row, col, row_stride);\\n threadMax = max(threadMax, value);\\n }\\n if (lindex < cols) {\\n threadShared[lindex] = threadMax;\\n }\\n workgroupBarrier();\\n\\n var reduceSize = min(cols, wg);\\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\\n reduceSize = currSize + (reduceSize & 1);\\n if (lindex < currSize) {\\n threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]);\\n }\\n workgroupBarrier();\\n }\\n if (lindex == 0) {\\n rowMaxShared = ${_}(${m(\"threadShared[0]\",a)});\\n }\\n workgroupBarrier();\\n\\n // find the rows sum\\n var threadSum = ${_}(0.0);\\n for (var col = lindex; col < cols; col += wg) {\\n let subExp = exp(getValue(row, col, row_stride) - rowMaxShared);\\n threadSum += subExp;\\n }\\n threadShared[lindex] = threadSum;\\n workgroupBarrier();\\n\\n for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) {\\n if (lindex < currSize) {\\n threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize];\\n }\\n workgroupBarrier();\\n }\\n if (lindex == 0) {\\n rowSumShared = ${_}(${tt(\"threadShared[0]\",a)});\\n }\\n workgroupBarrier();\\n\\n // calculate final value for each element in the row\\n for (var col = lindex; col < cols; col += wg) {\\n let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared;\\n setValue(row, col, row_stride, value);\\n }\\n }`;return{name:\"Softmax\",shaderCache:{hint:`${a}`,inputDependencies:[\"type\"]},getRunData:()=>({outputs:[{dims:r,dataType:e.dataType}],dispatchGroup:{x:l},programUniforms:[{type:12,data:p}]}),getShaderSource:$}},Cu=(e,t)=>{Fc(e.inputs),e.compute(qc(e.inputs[0],t))},Iu=e=>$e({axis:e.axis})});var Kc,jc,Yc,Zc,Qc,Tu,Eu,Pu=q(()=>{\"use strict\";ie();_e();je();be();Kc=e=>{if(!e||e.length<1)throw new Error(\"too few inputs\")},jc=(e,t)=>{let r=[],o=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(n=>r.push(Number(n))),o=r.length),$e({numOutputs:o,axis:t.axis,splitSizes:r})},Yc=e=>`\\nfn calculateOutputIndex(index: u32) -> u32 {\\n for (var i: u32 = 0u; i < ${e}u; i += 1u ) {\\n if (index < ${re(\"uniforms.size_in_split_axis\",\"i\",e)}) {\\n return i;\\n }\\n }\\n return ${e}u;\\n}`,Zc=e=>{let t=e.length,r=[];for(let o=0;o{let r=e[0].dims,o=z.size(r),n=e[0].dataType,s=z.normalizeAxis(t.axis,r.length),u=new Array(t.numOutputs),l=M(\"input\",n,r.length),a=new Array(t.numOutputs),p=[],m=[],f=0,b=[{type:12,data:o}];for(let y=0;y`\\n ${y.registerUniform(\"input_size\",\"u32\").registerUniform(\"size_in_split_axis\",\"u32\",a.length).declareVariables(l,...u)}\\n ${Yc(a.length)}\\n ${Zc(u)}\\n\\n ${y.mainStart()}\\n ${y.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.input_size\")}\\n\\n var indices = ${l.offsetToIndices(\"global_idx\")};\\n var index = ${l.indicesGet(\"indices\",s)};\\n let output_number = calculateOutputIndex(index);\\n if (output_number != 0) {\\n index -= ${re(\"uniforms.size_in_split_axis\",\"output_number - 1u\",a.length)};\\n ${l.indicesSet(\"indices\",s,\"index\")};\\n }\\n writeBufferData(output_number, indices, global_idx);\\n }`;return{name:\"Split\",shaderCache:{hint:t.cacheKey,inputDependencies:[\"rank\"]},getShaderSource:_,getRunData:()=>({outputs:p,dispatchGroup:{x:Math.ceil(o/64)},programUniforms:b})}},Tu=(e,t)=>{Kc(e.inputs);let r=e.inputs.length===1?t:jc(e.inputs,t);e.compute(Qc(e.inputs,r),{inputs:[0]})},Eu=e=>{let t=e.axis,r=e.splitSizes,o=e.numOutputs<0?r.length:e.numOutputs;if(o!==r.length)throw new Error(\"numOutputs and splitSizes lengh must be equal\");return $e({axis:t,numOutputs:o,splitSizes:r})}});var Ou,Xc,Jc,ep,ku,Ru=q(()=>{\"use strict\";ie();_e();be();Ou=e=>Array.from(e.getBigInt64Array(),Number),Xc=e=>{if(!e||e.length!==2)throw new Error(\"Tile requires 2 inputs.\");if(e[0].dataType!==1&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error(\"Tile only support float, int32, and uint32 data types\");if(e[1].dataType!==7)throw new Error(\"Tile `repeats` input should be of int64 data type\");if(e[1].dims.length!==1)throw new Error(\"Tile `repeats` input should be 1-D\");if(Ou(e[1]).length!==e[0].dims.length)throw new Error(\"Tile `repeats` input should have same number of elements as rank of input data tensor\")},Jc=(e,t)=>{let r=[];for(let o=0;o{let t=e[0].dims,r=Ou(e[1]),o=Jc(t,r),n=z.size(o),s=e[0].dataType,u=M(\"input\",s,t.length),l=F(\"output\",s,o.length),a=p=>`\\n const inputShape = ${u.indices(...t)};\\n ${p.registerUniform(\"output_size\",\"u32\").declareVariables(u,l)}\\n ${p.mainStart()}\\n ${p.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\\n let output_indices = ${l.offsetToIndices(\"global_idx\")};\\n var input_indices: ${u.type.indices};\\n for (var i = 0; i < ${t.length}; i++) {\\n let input_dim_i = ${u.indicesGet(\"uniforms.input_shape\",\"i\")};\\n let input_dim_value = ${l.indicesGet(\"output_indices\",\"i\")} % input_dim_i;\\n\\n ${u.indicesSet(\"input_indices\",\"i\",\"input_dim_value\")}\\n }\\n ${l.setByOffset(\"global_idx\",u.getByIndices(\"input_indices\"))}\\n }`;return{name:\"Tile\",shaderCache:{hint:`${r}`,inputDependencies:[\"rank\"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},...j(e[0].dims,o)]}),getShaderSource:a}},ku=e=>{Xc(e.inputs),e.compute(ep(e.inputs),{inputs:[0]})}});var tp,rp,Bu,Du=q(()=>{\"use strict\";ie();_e();be();tp=(e,t,r,o,n)=>{let s=F(\"output_data\",n,r.length,4),u=M(\"a_data\",t[1].dataType,t[1].dims.length,4),l=M(\"b_data\",t[2].dataType,t[2].dims.length,4),a=M(\"c_data\",t[0].dataType,t[0].dims.length,4),p,m=(f,b,_)=>`select(${b}, ${f}, ${_})`;if(!o)p=s.setByOffset(\"global_idx\",m(u.getByOffset(\"global_idx\"),l.getByOffset(\"global_idx\"),a.getByOffset(\"global_idx\")));else{let f=(b,_,y=\"\")=>{let $=`a_data[index_a${_}][component_a${_}]`,I=`b_data[index_b${_}][component_b${_}]`,C=`bool(c_data[index_c${_}] & (0xffu << (component_c${_} * 8)))`;return`\\n let output_indices${_} = ${s.offsetToIndices(`global_idx * 4u + ${_}u`)};\\n let offset_a${_} = ${u.broadcastedIndicesToOffset(`output_indices${_}`,s)};\\n let offset_b${_} = ${l.broadcastedIndicesToOffset(`output_indices${_}`,s)};\\n let offset_c${_} = ${a.broadcastedIndicesToOffset(`output_indices${_}`,s)};\\n let index_a${_} = offset_a${_} / 4u;\\n let index_b${_} = offset_b${_} / 4u;\\n let index_c${_} = offset_c${_} / 4u;\\n let component_a${_} = offset_a${_} % 4u;\\n let component_b${_} = offset_b${_} % 4u;\\n let component_c${_} = offset_c${_} % 4u;\\n ${b}[${_}] = ${y}(${m($,I,C)});\\n `};n===9?p=`\\n var data = vec4(0);\\n ${f(\"data\",0,\"u32\")}\\n ${f(\"data\",1,\"u32\")}\\n ${f(\"data\",2,\"u32\")}\\n ${f(\"data\",3,\"u32\")}\\n output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:p=`\\n ${f(\"output_data[global_idx]\",0)}\\n ${f(\"output_data[global_idx]\",1)}\\n ${f(\"output_data[global_idx]\",2)}\\n ${f(\"output_data[global_idx]\",3)}\\n `}return`\\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(a,u,l,s)}\\n ${e.mainStart()}\\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\\n ${p}\\n }`},rp=e=>{let t=e[1].dims,r=e[2].dims,o=e[0].dims,n=e[1].dataType,s=!(z.areEqual(t,r)&&z.areEqual(r,o)),u=t,l=z.size(t);if(s){let p=mt.calcShape(mt.calcShape(t,r,!1),o,!1);if(!p)throw new Error(\"Can\\'t perform where op on the given tensors\");u=p,l=z.size(u)}let a=Math.ceil(l/4);return{name:\"Where\",shaderCache:{inputDependencies:[\"rank\",\"rank\",\"rank\"]},getShaderSource:p=>tp(p,e,u,s,n),getRunData:()=>({outputs:[{dims:u,dataType:n}],dispatchGroup:{x:Math.ceil(l/64/4)},programUniforms:[{type:12,data:a},...j(o,t,r,u)]})}},Bu=e=>{e.compute(rp(e.inputs))}});var Mu,zu=q(()=>{\"use strict\";Qa();Hn();ei();ri();Ni();Qi();es();jn();fs();ys();_s();Cs();As();Ps();Rs();Ms();Us();Ns();Zn();Hs();Ks();Ys();pu();fu();Yr();bu();vu();Su();Au();Pu();Ru();Yt();en();Du();Mu=new Map([[\"Abs\",[ni]],[\"Acos\",[oi]],[\"Acosh\",[ai]],[\"Add\",[Wi]],[\"ArgMax\",[Za,Gn]],[\"ArgMin\",[Ya,Gn]],[\"Asin\",[ii]],[\"Asinh\",[si]],[\"Atan\",[ui]],[\"Atanh\",[di]],[\"Attention\",[Xa]],[\"AveragePool\",[nu,ru]],[\"BatchNormalization\",[Ja]],[\"BiasAdd\",[ti]],[\"BiasSplitGelu\",[Vi]],[\"Cast\",[ci,li]],[\"Ceil\",[mi]],[\"Clip\",[pi]],[\"Concat\",[Xi,Ji]],[\"Conv\",[Jn,Xn]],[\"ConvTranspose\",[ms,ps]],[\"Cos\",[fi]],[\"Cosh\",[hi]],[\"CumSum\",[hs,gs]],[\"Div\",[Gi]],[\"Einsum\",[vs,$s]],[\"Elu\",[gi,Xr]],[\"Equal\",[Hi]],[\"Erf\",[yi]],[\"Exp\",[bi]],[\"Expand\",[Ss]],[\"FastGelu\",[Is]],[\"Floor\",[wi]],[\"FusedConv\",[Jn,Xn]],[\"Gather\",[Es,Ts]],[\"GatherElements\",[ks,Os]],[\"Gelu\",[vi]],[\"Gemm\",[Ds,Bs]],[\"GlobalAveragePool\",[iu,au]],[\"GlobalMaxPool\",[cu,lu]],[\"Greater\",[Ki]],[\"GreaterOrEqual\",[Yi]],[\"HardSigmoid\",[Ti,Ai]],[\"InstanceNormalization\",[zs]],[\"LayerNormalization\",[Vs]],[\"LeakyRelu\",[$i,Xr]],[\"Less\",[ji]],[\"LessOrEqual\",[Zi]],[\"Log\",[zi]],[\"MatMul\",[is]],[\"MatMulNBits\",[Ws,Gs]],[\"MaxPool\",[uu,du]],[\"Mul\",[Li]],[\"MultiHeadAttention\",[qs,Fs]],[\"Neg\",[xi]],[\"Not\",[_i]],[\"Pad\",[js]],[\"Pow\",[Fi]],[\"Range\",[mu]],[\"Reciprocal\",[Si]],[\"ReduceMin\",[Ha]],[\"ReduceMean\",[Ua]],[\"ReduceMax\",[Ga]],[\"ReduceSum\",[Fa]],[\"ReduceProd\",[La]],[\"ReduceL1\",[Va]],[\"ReduceL2\",[Na]],[\"ReduceLogSum\",[Ka]],[\"ReduceLogSumExp\",[Wa]],[\"ReduceSumSquare\",[qa]],[\"Relu\",[Ci]],[\"Resize\",[gu,yu]],[\"Sigmoid\",[Ii]],[\"Sin\",[Ei]],[\"Sinh\",[Pi]],[\"Slice\",[_u,xu]],[\"SkipLayerNormalization\",[wu]],[\"Split\",[Tu,Eu]],[\"Sqrt\",[Oi]],[\"Softmax\",[Cu,Iu]],[\"Sub\",[qi]],[\"Tan\",[ki]],[\"Tanh\",[Bi]],[\"ThresholdedRelu\",[Mi,Xr]],[\"Tile\",[ku]],[\"Transpose\",[Ca,Ia]],[\"Where\",[Bu]]])});var cn,Uu=q(()=>{\"use strict\";Kt();Pt();be();cn=class{constructor(t){this.backend=t;this.repo=new Map,this.attributesBound=!1}getArtifact(t){return this.repo.get(t)}setArtifact(t,r){this.repo.set(t,r)}run(t,r,o,n,s){Mt(t.programInfo.name);let u=this.backend.device,l=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let a=[];for(let m of r)a.push({binding:a.length,resource:{buffer:m.buffer}});for(let m of o)a.push({binding:a.length,resource:{buffer:m.buffer}});s&&a.push({binding:a.length,resource:s});let p=u.createBindGroup({layout:t.computePipeline.getBindGroupLayout(0),entries:a,label:t.programInfo.name});if(this.backend.sessionStatus===\"capturing\"){let m={kernelId:this.backend.currentKernelId,computePipeline:t.computePipeline,bindGroup:p,dispatchGroup:n};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(m)}l.setPipeline(t.computePipeline),l.setBindGroup(0,p),l.dispatchWorkgroups(...n),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===\"at-passes\")&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),Et(t.programInfo.name)}dispose(){}build(t,r){Mt(t.name);let o=this.backend.device,n=[];o.features.has(\"shader-f16\")&&n.push(\"enable f16;\");let s=xa(r),u=t.getShaderSource(s),l=`${n.join(`\\n`)}\\n${s.additionalImplementations}\\n${u}`,a=o.createShaderModule({code:l,label:t.name});De(\"verbose\",()=>`[WebGPU] ${t.name} shader code: ${l}`);let p=o.createComputePipeline({compute:{module:a,entryPoint:\"main\"},layout:\"auto\",label:t.name});return Et(t.name),{programInfo:t,computePipeline:p}}normalizeDispatchGroupSize(t){let r=typeof t==\"number\"?t:t.x,o=typeof t==\"number\"?1:t.y||1,n=typeof t==\"number\"?1:t.z||1,s=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(r<=s&&o<=s&&n<=s)return[r,o,n];let u=r*o*n,l=Math.ceil(Math.sqrt(u));if(l>s){if(l=Math.ceil(Math.cbrt(u)),l>s)throw new Error(\"Total dispatch size exceeds WebGPU maximum.\");return[l,l,l]}else return[l,l,1]}}});var np,op,ao,pn,Vu=q(()=>{\"use strict\";Kt();ie();Pt();ba();_a();zu();Uu();np=(e,t)=>{if(t.length!==e.length)throw new Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let r=[];for(let o=0;o{let o=e.name;return e.shaderCache?.hint&&(o+=\"[\"+e.shaderCache.hint+\"]\"),o+=\":\"+r+`:${np(t,e.shaderCache?.inputDependencies??new Array(t.length).fill(\"dims\"))}`,o},ao=class{constructor(t){t&&(this.architecture=t.architecture,this.vendor=t.vendor)}isArchitecture(t){return this.architecture===t}isVendor(t){return this.vendor===t}},pn=class{constructor(){this.currentSessionId=null;this.currentKernelId=null;this.commandEncoder=null;this.computePassEncoder=null;this.maxDispatchNumber=16;this.pendingDispatchNumber=0;this.pendingKernels=[];this.pendingQueries=new Map;this.sessionStatus=\"default\";this.capturedCommandList=new Map;this.capturedPendingKernels=new Map;this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw new Error(\"currentKernelCustomData(): currentKernelId is null. (should not happen)\");let t=this.kernelCustomData.get(this.currentKernelId);return t||(t={},this.kernelCustomData.set(this.currentKernelId,t)),t}async initialize(t,r){this.env=t;let o=[],n={requiredLimits:{maxComputeWorkgroupStorageSize:r.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.limits.maxStorageBufferBindingSize,maxBufferSize:r.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:r.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:r.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:r.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:r.limits.maxComputeWorkgroupSizeZ},requiredFeatures:o};r.features.has(\"chromium-experimental-timestamp-query-inside-passes\")?o.push(\"chromium-experimental-timestamp-query-inside-passes\"):r.features.has(\"timestamp-query\")&&o.push(\"timestamp-query\"),r.features.has(\"shader-f16\")&&o.push(\"shader-f16\"),this.device=await r.requestDevice(n),this.adapterInfo=new ao(await r.requestAdapterInfo()),this.gpuDataManager=$a(this),this.programManager=new cn(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,ga(t.logLevel,!!t.debug),this.device.onuncapturederror=s=>{s.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${s.error.message}`)},Object.defineProperty(this.env.webgpu,\"device\",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,\"adapter\",{value:r,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<\"u\"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let t=this.getCommandEncoder(),r={};this.queryType===\"at-passes\"&&(r.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=t.beginComputePass(r)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;Mt(),this.endComputePass();let t;this.queryType!==\"none\"&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),t=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(t,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==\"none\"&&t.mapAsync(GPUMapMode.READ).then(()=>{let r=new BigUint64Array(t.getMappedRange()),o=this.pendingQueries.get(t);for(let n=0;n\"u\"&&(this.queryTimeBase=_);let $=Number(_-this.queryTimeBase),I=Number(y-this.queryTimeBase);if(!Number.isSafeInteger($)||!Number.isSafeInteger(I))throw new RangeError(\"incorrect timestamp range\");if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:f.map(C=>({dims:C.dims,dataType:Tt(C.dataType)})),outputsMetadata:b.map(C=>({dims:C.dims,dataType:Tt(C.dataType)})),kernelId:u,kernelType:a,kernelName:p,programName:m,startTime:$,endTime:I});else{let C=\"\";f.forEach((A,T)=>{C+=`input[${T}]: [${A.dims}] | ${Tt(A.dataType)}, `});let v=\"\";b.forEach((A,T)=>{v+=`output[${T}]: [${A.dims}] | ${Tt(A.dataType)}, `}),console.log(`[profiling] kernel \"${u}|${a}|${p}|${m}\" ${C}${v}execution time: ${I-$} ns`)}kn(\"GPU\",`${m}::${_}::${y}`)}t.unmap(),this.pendingQueries.delete(t)}),Et()}run(t,r,o,n,s){Mt(t.name);let u=[];for(let v=0;vA):o;if(m.length!==l.length)throw new Error(`Output size ${m.length} must be equal to ${l.length}.`);let f=[],b=[];for(let v=0;v=l.length)throw new Error(`Invalid output index: ${m[v]}`);if(m[v]===-3)continue;let A=m[v]===-1,T=m[v]===-2,D=A||T?s(l[v].dataType,l[v].dims):n(m[v],l[v].dataType,l[v].dims);if(f.push(D),D.data===0)continue;let U=this.gpuDataManager.get(D.data);if(!U)throw new Error(`no GPU data for output: ${D.data}`);if(A&&this.temporaryData.push(U),T){let V=this.kernelPersistentData.get(this.currentKernelId);V||(V=[],this.kernelPersistentData.set(this.currentKernelId,V)),V.push(U)}b.push(U)}if(u.length!==r.length||b.length!==f.length){if(b.length===0)return Et(t.name),f;throw new Error(`Program ${t.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let _;if(p){let v=0,A=[];p.forEach(V=>{let H=typeof V.data==\"number\"?[V.data]:V.data;if(H.length===0)return;let R=V.type===10?2:4,L,pe;V.type===10?(pe=H.length>4?16:H.length>2?8:H.length*R,L=H.length>4?16:R*H.length):(pe=H.length<=2?H.length*R:16,L=16),v=Math.ceil(v/pe)*pe,A.push(v);let Ie=V.type===10?8:4;v+=H.length>4?Math.ceil(H.length/Ie)*L:H.length*R});let T=16;v=Math.ceil(v/T)*T;let D=new ArrayBuffer(v);p.forEach((V,H)=>{let R=A[H],L=typeof V.data==\"number\"?[V.data]:V.data;if(V.type===6)new Int32Array(D,R,L.length).set(L);else if(V.type===12)new Uint32Array(D,R,L.length).set(L);else if(V.type===10)new Uint16Array(D,R,L.length).set(L);else if(V.type===1)new Float32Array(D,R,L.length).set(L);else throw new Error(`Unsupported uniform type: ${Tt(V.type)}`)});let U=this.gpuDataManager.create(v,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(U.buffer,0,D,0,v),this.gpuDataManager.release(U.id),_={offset:0,size:v,buffer:U.buffer}}let y=this.programManager.normalizeDispatchGroupSize(a),$=y[1]===1&&y[2]===1,I=op(t,r,$),C=this.programManager.getArtifact(I);if(C||(C=this.programManager.build(t,y),this.programManager.setArtifact(I,C),De(\"info\",()=>`[artifact] key: ${I}, programName: ${t.name}`)),De(\"info\",()=>`[ProgramManager] run \"${t.name}\" (key=${I}) with ${y[0]}x${y[1]}x${y[2]}`),this.queryType!==\"none\"||this.sessionStatus===\"capturing\"){let v={kernelId:this.currentKernelId,programName:C.programInfo.name,inputTensorViews:r,outputTensorViews:f};this.pendingKernels.push(v),this.sessionStatus===\"capturing\"&&this.capturedPendingKernels.get(this.currentSessionId).push(v)}return this.programManager.run(C,u,b,y,_),Et(t.name),f}upload(t,r){this.gpuDataManager.upload(t,r)}memcpy(t,r){this.gpuDataManager.memcpy(t,r)}async download(t,r){await this.gpuDataManager.download(t,r)}alloc(t){return this.gpuDataManager.create(t).id}free(t){return this.gpuDataManager.release(t)}createKernel(t,r,o,n){let s=Mu.get(t);if(!s)throw new Error(`kernel not implemented: ${t}`);let u={kernelType:t,kernelName:n,kernelEntry:s[0],attributes:[s[1],o]};this.kernels.set(r,u)}releaseKernel(t){let r=this.kernelPersistentData.get(t);if(r){for(let o of r)this.gpuDataManager.release(o.id);this.kernelPersistentData.delete(t)}this.kernelCustomData.delete(t),this.kernels.delete(t)}computeKernel(t,r,o){let n=this.kernels.get(t);if(!n)throw new Error(`kernel not created: ${t}`);let s=n.kernelType,u=n.kernelName,l=n.kernelEntry,a=n.attributes;if(this.currentKernelId!==null)throw new Error(`kernel \"[${s}] ${u}\" is not allowed to be called recursively`);this.currentKernelId=t,a[0]&&(a[1]=a[0](a[1]),a[0]=void 0),De(\"info\",()=>`[WebGPU] Start to run kernel \"[${s}] ${u}\"...`);let p=this.env.debug;this.temporaryData=[];try{return p&&this.device.pushErrorScope(\"validation\"),l(r,a[1]),0}catch(m){return o.push(Promise.resolve(`[WebGPU] Kernel \"[${s}] ${u}\" failed. ${m}`)),1}finally{p&&o.push(this.device.popErrorScope().then(m=>m?`GPU validation error for kernel \"[${s}] ${u}\": ${m.message}`:null));for(let m of this.temporaryData)this.gpuDataManager.release(m.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(t,r,o,n){let s=this.sessionExternalDataMapping.get(t);s||(s=new Map,this.sessionExternalDataMapping.set(t,s));let u=s.get(r),l=this.gpuDataManager.registerExternalBuffer(o,n,u?.[1]);return s.set(r,[l,o]),l}unregisterBuffers(t){let r=this.sessionExternalDataMapping.get(t);r&&(r.forEach(o=>this.gpuDataManager.unregisterExternalBuffer(o[1])),this.sessionExternalDataMapping.delete(t))}getBuffer(t){let r=this.gpuDataManager.get(t);if(!r)throw new Error(`no GPU data for buffer: ${t}`);return r.buffer}createDownloader(t,r,o){return async()=>{let n=await Dn(this,t,r);return ya(n.buffer,o)}}writeTimestamp(t){this.queryType===\"inside-passes\"&&this.computePassEncoder.writeTimestamp(this.querySet,t)}setQueryType(){this.queryType=\"none\",(this.env.webgpu.profiling?.mode===\"default\"||(typeof this.env.trace>\"u\"?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(\"chromium-experimental-timestamp-query-inside-passes\")?this.queryType=\"inside-passes\":this.device.features.has(\"timestamp-query\")&&(this.queryType=\"at-passes\"),this.queryType!==\"none\"&&typeof this.querySet>\"u\"&&(this.querySet=this.device.createQuerySet({type:\"timestamp\",count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){De(\"info\",\"captureBegin\"),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=\"capturing\"}captureEnd(){De(\"info\",\"captureEnd\"),this.flush(),this.sessionStatus=\"default\"}replay(){De(\"info\",\"replay\"),this.sessionStatus=\"replaying\";let t=this.capturedCommandList.get(this.currentSessionId),r=this.capturedPendingKernels.get(this.currentSessionId),o=t.length;this.pendingKernels=[];for(let n=0;n=this.maxDispatchNumber||this.queryType===\"at-passes\")&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=\"default\"}onReleaseSession(t){this.unregisterBuffers(t),this.capturedCommandList.has(t)&&this.capturedCommandList.delete(t),this.capturedPendingKernels.has(t)&&this.capturedPendingKernels.delete(t),this.gpuDataManager.onReleaseSession(t)}onRunStart(t){this.currentSessionId=t,this.setQueryType()}}});var Nu={};Mr(Nu,{init:()=>ap});var wr,io,ap,Wu=q(()=>{\"use strict\";ie();Vu();Pt();_e();wr=class e{constructor(t,r,o,n){this.module=t;this.dataType=r;this.data=o;this.dims=n}getFloat32Array(){if(this.dataType!==1)throw new Error(\"Invalid data type\");let t=z.size(this.dims);return t===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,t)}getBigInt64Array(){if(this.dataType!==7)throw new Error(\"Invalid data type\");let t=z.size(this.dims);return t===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,t)}getInt32Array(){if(this.dataType!==6)throw new Error(\"Invalid data type\");let t=z.size(this.dims);return t===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,t)}reshape(t){if(z.size(t)!==z.size(this.dims))throw new Error(\"Invalid new shape\");return new e(this.module,this.dataType,this.data,t)}},io=class{constructor(t,r,o){this.module=t;this.backend=r;this.customDataOffset=0;this.customDataSize=0;this.adapterInfo=r.adapterInfo;let n=t.HEAPU32,s=o>>>2;this.opKernelContext=n[s++];let u=n[s++];this.outputCount=n[s++],this.customDataOffset=n[s++],this.customDataSize=n[s++];let l=[];for(let a=0;atypeof l==\"number\"?this.inputs[l]:l)??this.inputs,n=r?.outputs??[],s=(l,a,p)=>new wr(this.module,a,this.output(l,p),p),u=(l,a)=>{let p=fr(l);if(!p)throw new Error(`Unsupported data type: ${l}`);let m=p*z.size(a),f=m>0?this.backend.gpuDataManager.create(m).id:0;return new wr(this.module,l,f,a)};return this.backend.run(t,o,n,s,u)}output(t,r){let o=this.module.stackSave();try{let n=this.module.stackAlloc((1+r.length)*4),s=n>>2;this.module.HEAPU32[s++]=r.length;for(let u=0;u{let n=t.jsepInit;if(!n)throw new Error(\"Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.\");if(e===\"webgpu\"){let s=new pn;await s.initialize(r,o),n(\"webgpu\",[s,u=>s.alloc(u),u=>s.free(u),(u,l,a,p=!1)=>{if(p)De(\"verbose\",()=>`[WebGPU] jsepCopyGpuToGpu: src=${u}, dst=${l}, size=${a}`),s.memcpy(u,l);else{De(\"verbose\",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${u}, gpuDataId=${l}, size=${a}`);let m=t.HEAPU8.subarray(u>>>0,(u>>>0)+a);s.upload(l,m)}},async(u,l,a)=>{De(\"verbose\",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${u}, dataOffset=${l}, size=${a}`),await s.download(u,()=>t.HEAPU8.subarray(l>>>0,(l>>>0)+a))},(u,l,a)=>s.createKernel(u,l,a,t.UTF8ToString(t._JsepGetNodeName(l))),u=>s.releaseKernel(u),(u,l,a,p)=>{De(\"verbose\",()=>`[WebGPU] jsepRun: sessionHandle=${a}, kernel=${u}, contextDataOffset=${l}`);let m=new io(t,s,l);return s.computeKernel(u,m,p)},()=>s.captureBegin(),()=>s.captureEnd(),()=>s.replay()])}else n(\"webnn\")}});var Ho;Ho=Ro();var bd=No(),An,Tn=!1,zr=!1,Go=!1,wd=e=>{if(e===1)return!1;if(typeof SharedArrayBuffer>\"u\")return typeof self<\"u\"&&!self.crossOriginIsolated&&console.warn(\"env.wasm.numThreads is set to \"+e+\", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.\"),!1;typeof process<\"u\"&&process.versions&&process.versions.node&&console.warn(\"env.wasm.numThreads is set to \"+e+\", however, currently onnxruntime-web does not support multi-threads in Node.js. Please consider using onnxruntime-node for performance critical scenarios.\");try{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]))}catch{return!1}},vd=()=>{try{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]))}catch{return!1}},$d=(e,t)=>e?t?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-simd.wasm\":t?\"ort-wasm-threaded.wasm\":\"ort-wasm.wasm\",Lo=async e=>{if(Tn)return Promise.resolve();if(zr)throw new Error(\"multiple calls to \\'initializeWebAssembly()\\' detected.\");if(Go)throw new Error(\"previous call to \\'initializeWebAssembly()\\' failed.\");zr=!0;let t=e.initTimeout,r=e.numThreads,o=e.simd,n=wd(r),s=o&&vd(),u=e.wasmPaths,l=typeof u==\"string\"?u:void 0,a=$d(s,n),p=typeof u==\"object\"?u[a]:void 0,m=!1,f=[];if(t>0&&f.push(new Promise(b=>{setTimeout(()=>{m=!0,b()},t)})),f.push(new Promise((b,_)=>{let y=n?bd:Ho,$={locateFile:(I,C)=>{if(n&&I.endsWith(\".worker.js\")&&typeof Blob<\"u\")return URL.createObjectURL(new Blob([Wo()],{type:\"text/javascript\"}));if(I.endsWith(\".wasm\")){if(p)return p;let v=l??C;return a===\"ort-wasm-simd.wasm\"?v+\"ort-wasm-simd.jsep.wasm\":a===\"ort-wasm-simd-threaded.wasm\"?v+\"ort-wasm-simd-threaded.jsep.wasm\":v+a}return C+I}};if(n)if($.numThreads=r,typeof Blob>\"u\")$.mainScriptUrlOrBlob=(void 0)(__dirname,\"ort-wasm-threaded.js\");else{let I=`var ortWasmThreaded=${y.toString()};`;$.mainScriptUrlOrBlob=new Blob([I],{type:\"text/javascript\"})}y($).then(I=>{zr=!1,Tn=!0,An=I,b()},I=>{zr=!1,Go=!0,_(I)})})),await Promise.race(f),m)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},We=()=>{if(Tn&&An)return An;throw new Error(\"WebAssembly is not initialized yet.\")};var Ge=(e,t)=>{let r=We(),o=r.lengthBytesUTF8(e)+1,n=r._malloc(o);return r.stringToUTF8(e,n,o),t.push(n),n},mr=(e,t,r,o)=>{if(typeof e==\"object\"&&e!==null){if(r.has(e))throw new Error(\"Circular reference in options\");r.add(e)}Object.entries(e).forEach(([n,s])=>{let u=t?t+n:n;if(typeof s==\"object\")mr(s,u+\".\",r,o);else if(typeof s==\"string\"||typeof s==\"number\")o(u,s.toString());else if(typeof s==\"boolean\")o(u,s?\"1\":\"0\");else throw new Error(`Can\\'t handle extra config type: ${typeof s}`)})},Be=e=>{let t=We(),r=t.stackSave();try{let o=t.stackAlloc(8);t._OrtGetLastError(o,o+4);let n=t.HEAP32[o/4],s=t.HEAPU32[o/4+1],u=s?t.UTF8ToString(s):\"\";throw new Error(`${e} ERROR_CODE: ${n}, ERROR_MESSAGE: ${u}`)}finally{t.stackRestore(r)}};var Fo=e=>{let t=We(),r=0,o=[],n=e||{};try{if(e?.logSeverityLevel===void 0)n.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=\"number\"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)n.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=\"number\"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(n.terminate=!1);let s=0;return e?.tag!==void 0&&(s=Ge(e.tag,o)),r=t._OrtCreateRunOptions(n.logSeverityLevel,n.logVerbosityLevel,!!n.terminate,s),r===0&&Be(\"Can\\'t create run options.\"),e?.extra!==void 0&&mr(e.extra,\"\",new WeakSet,(u,l)=>{let a=Ge(u,o),p=Ge(l,o);t._OrtAddRunConfigEntry(r,a,p)!==0&&Be(`Can\\'t set a run config entry: ${u} - ${l}.`)}),[r,o]}catch(s){throw r!==0&&t._OrtReleaseRunOptions(r),o.forEach(u=>t._free(u)),s}};var _d=e=>{switch(e){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},xd=e=>{switch(e){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},Sd=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly=\"1\"),e.executionProviders&&e.executionProviders.some(r=>(typeof r==\"string\"?r:r.name)===\"webgpu\")&&(e.enableMemPattern=!1)},Cd=(e,t,r)=>{for(let o of t){let n=typeof o==\"string\"?o:o.name;switch(n){case\"webnn\":if(n=\"WEBNN\",typeof o!=\"string\"){let u=o;if(u?.deviceType){let l=Ge(\"deviceType\",r),a=Ge(u.deviceType,r);We()._OrtAddSessionConfigEntry(e,l,a)!==0&&Be(`Can\\'t set a session config entry: \\'deviceType\\' - ${u.deviceType}.`)}if(u?.numThreads){let l=u.numThreads;(typeof l!=\"number\"||!Number.isInteger(l)||l<0)&&(l=0);let a=Ge(\"numThreads\",r),p=Ge(l.toString(),r);We()._OrtAddSessionConfigEntry(e,a,p)!==0&&Be(`Can\\'t set a session config entry: \\'numThreads\\' - ${u.numThreads}.`)}if(u?.powerPreference){let l=Ge(\"powerPreference\",r),a=Ge(u.powerPreference,r);We()._OrtAddSessionConfigEntry(e,l,a)!==0&&Be(`Can\\'t set a session config entry: \\'powerPreference\\' - ${u.powerPreference}.`)}}break;case\"webgpu\":if(n=\"JS\",typeof o!=\"string\"){let u=o;if(u?.preferredLayout){if(u.preferredLayout!==\"NCHW\"&&u.preferredLayout!==\"NHWC\")throw new Error(`preferredLayout must be either \\'NCHW\\' or \\'NHWC\\': ${u.preferredLayout}`);let l=Ge(\"preferredLayout\",r),a=Ge(u.preferredLayout,r);We()._OrtAddSessionConfigEntry(e,l,a)!==0&&Be(`Can\\'t set a session config entry: \\'preferredLayout\\' - ${u.preferredLayout}.`)}}break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported execution provider: ${n}`)}let s=Ge(n,r);We()._OrtAppendExecutionProvider(e,s)!==0&&Be(`Can\\'t append execution provider: ${n}.`)}},qo=e=>{let t=We(),r=0,o=[],n=e||{};Sd(n);try{let s=_d(n.graphOptimizationLevel??\"all\"),u=xd(n.executionMode??\"sequential\"),l=typeof n.logId==\"string\"?Ge(n.logId,o):0,a=n.logSeverityLevel??2;if(!Number.isInteger(a)||a<0||a>4)throw new Error(`log serverity level is not valid: ${a}`);let p=n.logVerbosityLevel??0;if(!Number.isInteger(p)||p<0||p>4)throw new Error(`log verbosity level is not valid: ${p}`);let m=typeof n.optimizedModelFilePath==\"string\"?Ge(n.optimizedModelFilePath,o):0;if(r=t._OrtCreateSessionOptions(s,!!n.enableCpuMemArena,!!n.enableMemPattern,u,!!n.enableProfiling,0,l,a,p,m),r===0&&Be(\"Can\\'t create session options.\"),n.executionProviders&&Cd(r,n.executionProviders,o),n.enableGraphCapture!==void 0){if(typeof n.enableGraphCapture!=\"boolean\")throw new Error(`enableGraphCapture must be a boolean value: ${n.enableGraphCapture}`);let f=Ge(\"enableGraphCapture\",o),b=Ge(n.enableGraphCapture.toString(),o);t._OrtAddSessionConfigEntry(r,f,b)!==0&&Be(`Can\\'t set a session config entry: \\'enableGraphCapture\\' - ${n.enableGraphCapture}.`)}if(n.freeDimensionOverrides)for(let[f,b]of Object.entries(n.freeDimensionOverrides)){if(typeof f!=\"string\")throw new Error(`free dimension override name must be a string: ${f}`);if(typeof b!=\"number\"||!Number.isInteger(b)||b<0)throw new Error(`free dimension override value must be a non-negative integer: ${b}`);let _=Ge(f,o);t._OrtAddFreeDimensionOverride(r,_,b)!==0&&Be(`Can\\'t set a free dimension override: ${f} - ${b}.`)}return n.extra!==void 0&&mr(n.extra,\"\",new WeakSet,(f,b)=>{let _=Ge(f,o),y=Ge(b,o);t._OrtAddSessionConfigEntry(r,_,y)!==0&&Be(`Can\\'t set a session config entry: ${f} - ${b}.`)}),[r,o]}catch(s){throw r!==0&&t._OrtReleaseSessionOptions(r),o.forEach(u=>t._free(u)),s}};ie();var jo=async e=>{if(typeof e==\"string\")if(typeof process<\"u\"&&process.versions&&process.versions.node)try{return new Uint8Array(await(void 0)(e))}catch(t){if(t.code===\"ERR_FS_FILE_TOO_LARGE\"){let r=(void 0)(e),o=[];for await(let n of r)o.push(n);return new Uint8Array(Buffer.concat(o))}throw t}else{let t=await fetch(e);if(!t.ok)throw new Error(`failed to load external data file: ${e}`);let r=t.headers.get(\"Content-Length\"),o=r?parseInt(r,10):0;if(o<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),s;try{s=new ArrayBuffer(o)}catch(l){if(l instanceof RangeError){let a=Math.ceil(o/65536);s=new WebAssembly.Memory({initial:a,maximum:a}).buffer}else throw l}let u=0;for(;;){let{done:l,value:a}=await n.read();if(l)break;let p=a.byteLength;new Uint8Array(s,u,p).set(a),u+=p}return new Uint8Array(s,0,o)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)};var ip=(e,t)=>{We()._OrtInit(e,t)!==0&&Be(\"Can\\'t initialize onnxruntime.\")},Hu=async e=>{ip(e.wasm.numThreads,hr(e.logLevel))},Lu=async(e,t)=>{{let r=(Wu(),Ft(Nu)).init;if(t===\"webgpu\"){if(typeof navigator>\"u\"||!navigator.gpu)throw new Error(\"WebGPU is not supported in current environment\");let o=e.webgpu.adapter;if(o){if(typeof o.limits!=\"object\"||typeof o.features!=\"object\"||typeof o.requestDevice!=\"function\")throw new Error(\"Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.\")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==\"low-power\"&&n!==\"high-performance\")throw new Error(`Invalid powerPreference setting: \"${n}\"`);let s=e.webgpu.forceFallbackAdapter;if(s!==void 0&&typeof s!=\"boolean\")throw new Error(`Invalid forceFallbackAdapter setting: \"${s}\"`);if(o=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:s}),!o)throw new Error(\\'Failed to get GPU adapter. You may need to enable flag \"--enable-unsafe-webgpu\" if you are using Chrome.\\')}if(!e.wasm.simd)throw new Error(\"Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using `webgpu` EP\");await r(\"webgpu\",We(),e,o)}if(t===\"webnn\"){if(typeof navigator>\"u\"||!navigator.ml)throw new Error(\"WebNN is not supported in current environment\");await r(\"webnn\",We(),e)}}},Ut=new Map,sp=e=>{let t=We(),r=t.stackSave();try{let o=t.stackAlloc(8);return t._OrtGetInputOutputCount(e,o,o+4)!==0&&Be(\"Can\\'t get session input/output count.\"),[t.HEAP32[o/4],t.HEAP32[o/4+1]]}finally{t.stackRestore(r)}},so=e=>{let t=We(),r=t._malloc(e.byteLength);if(r===0)throw new Error(`Can\\'t create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,r),[r,e.byteLength]},Fu=async(e,t)=>{let r,o,n=We();Array.isArray(e)?[r,o]=e:e.buffer===n.HEAPU8.buffer?[r,o]=[e.byteOffset,e.byteLength]:[r,o]=so(e);let s=0,u=0,l=0,a=[],p=[],m=[];try{if([u,a]=qo(t),t?.externalData&&n.mountExternalData){let v=[];for(let A of t.externalData){let T=typeof A==\"string\"?A:A.path;v.push(jo(typeof A==\"string\"?A:A.data).then(D=>{n.mountExternalData(T,D)}))}await Promise.all(v)}s=await n._OrtCreateSession(r,o,u),s===0&&Be(\"Can\\'t create a session.\");let[f,b]=sp(s),_=!!t?.enableGraphCapture,y=[],$=[],I=[];for(let v=0;vv===\"gpu-buffer\")&&(l=n._OrtCreateBinding(s),l===0&&Be(\"Can\\'t create IO binding.\"),C={handle:l,outputPreferredLocations:I,outputPreferredLocationsEncoded:I.map(v=>Pn(v))}),Ut.set(s,[s,p,m,C,_,!1]),[s,y,$]}catch(f){throw p.forEach(b=>n._OrtFree(b)),m.forEach(b=>n._OrtFree(b)),l!==0&&n._OrtReleaseBinding(l),s!==0&&n._OrtReleaseSession(s),f}finally{n._free(r),u!==0&&n._OrtReleaseSessionOptions(u),a.forEach(f=>n._free(f)),n.unmountExternalData?.()}},qu=e=>{let t=We(),r=Ut.get(e);if(!r)throw new Error(`cannot release session. invalid session id: ${e}`);let[o,n,s,u,l]=r;u&&(l&&t._OrtClearBoundOutputs(u.handle),t._OrtReleaseBinding(u.handle)),t.jsepOnReleaseSession?.(e),n.forEach(a=>t._OrtFree(a)),s.forEach(a=>t._OrtFree(a)),t._OrtReleaseSession(o),Ut.delete(e)},Gu=(e,t,r,o,n,s=!1)=>{if(!e){t.push(0);return}let u=We(),l=e[0],a=e[1],p=e[3],m,f;if(l===\"string\"&&p===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");if(s&&p!==\"gpu-buffer\")throw new Error(`External buffer must be provided for input/output index ${n} when enableGraphCapture is true.`);if(p===\"gpu-buffer\"){let y=e[2].gpuBuffer,$=fr(En(l));f=a.reduce((C,v)=>C*v,1)*$;let I=u.jsepRegisterBuffer;if(!I)throw new Error(\\'Tensor location \"gpu-buffer\" is not supported without using WebGPU.\\');m=I(o,n,y,f)}else{let y=e[2];if(Array.isArray(y)){f=4*y.length,m=u._malloc(f),r.push(m);let $=m/4;for(let I=0;Iu.HEAP32[y++]=I);let $=u._OrtCreateTensor(En(l),m,f,_,a.length,Pn(p));$===0&&Be(`Can\\'t create tensor for input/output. session=${o}, index=${n}.`),t.push($)}finally{u.stackRestore(b)}},Ku=async(e,t,r,o,n,s)=>{let u=We(),l=Ut.get(e);if(!l)throw new Error(`cannot run inference. invalid session id: ${e}`);let a=l[0],p=l[1],m=l[2],f=l[3],b=l[4],_=l[5],y=t.length,$=o.length,I=0,C=[],v=[],A=[],T=[],D=u.stackSave(),U=u.stackAlloc(y*4),V=u.stackAlloc(y*4),H=u.stackAlloc($*4),R=u.stackAlloc($*4);try{[I,C]=Fo(s);for(let Q=0;QNe*Fe,1);he=Tt(J);let wt=f?.outputPreferredLocations[o[Q]];if(he===\"string\"){if(wt===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");let Ne=[],Fe=Ae/4;for(let Je=0;Je0){let Ne=u.jsepGetBuffer;if(!Ne)throw new Error(\\'preferredLocation \"gpu-buffer\" is not supported without using WebGPU.\\');let Fe=Ne(Ae),Je=fr(J);if(Je===void 0||!Ko(he))throw new Error(`Unsupported data type: ${he}`);se=!0,ze.push([he,Xe,{gpuBuffer:Fe,download:u.jsepCreateDownloader(Fe,Le*Je,he),dispose:()=>{u._OrtReleaseTensor(xe)}},\"gpu-buffer\"])}else{let Ne=Ur(he),Fe=new Ne(Le);new Uint8Array(Fe.buffer,Fe.byteOffset,Fe.byteLength).set(u.HEAPU8.subarray(Ae,Ae+Fe.byteLength)),ze.push([he,Xe,Fe,\"cpu\"])}}finally{u.stackRestore(me),he===\"string\"&&Ae&&u._free(Ae),se||u._OrtReleaseTensor(xe)}}return f&&!b&&(u._OrtClearBoundOutputs(f.handle),Ut.set(e,[a,p,m,f,b,!1])),ze}finally{u.stackRestore(D),v.forEach(L=>u._OrtReleaseTensor(L)),A.forEach(L=>u._OrtReleaseTensor(L)),T.forEach(L=>u._free(L)),I!==0&&u._OrtReleaseRunOptions(I),C.forEach(L=>u._free(L))}},ju=e=>{let t=We(),r=Ut.get(e);if(!r)throw new Error(\"invalid session id\");let o=r[0],n=t._OrtEndProfiling(o);n===0&&Be(\"Can\\'t get an profile file name.\"),t._OrtFree(n)},Yu=e=>{let t=[];for(let r of e){let o=r[2];!Array.isArray(o)&&\"buffer\"in o&&t.push(o.buffer)}return t};self.onmessage=e=>{let{type:t,in:r}=e.data;try{switch(t){case\"init-wasm\":Lo(r.wasm).then(()=>{Hu(r).then(()=>{postMessage({type:t})},o=>{postMessage({type:t,err:o})})},o=>{postMessage({type:t,err:o})});break;case\"init-ep\":{let{epName:o,env:n}=r;Lu(n,o).then(()=>{postMessage({type:t})},s=>{postMessage({type:t,err:s})});break}case\"copy-from\":{let{buffer:o}=r,n=so(o);postMessage({type:t,out:n});break}case\"create\":{let{model:o,options:n}=r;Fu(o,n).then(s=>{postMessage({type:t,out:s})},s=>{postMessage({type:t,err:s})});break}case\"release\":qu(r),postMessage({type:t});break;case\"run\":{let{sessionId:o,inputIndices:n,inputs:s,outputIndices:u,options:l}=r;Ku(o,n,s,u,new Array(u.length).fill(null),l).then(a=>{a.some(p=>p[3]!==\"cpu\")?postMessage({type:t,err:\"Proxy does not support non-cpu tensor location.\"}):postMessage({type:t,out:a},Yu([...s,...a]))},a=>{postMessage({type:t,err:a})});break}case\"end-profiling\":ju(r),postMessage({type:t});break;default:}}catch(o){postMessage({type:t,err:o})}};})();\\n/**\\n * @license\\n * Copyright 2021 Google LLC. All Rights Reserved.\\n * Licensed under the Apache License, Version 2.0 (the \"License\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n * http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \"AS IS\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n * =============================================================================\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC. All Rights Reserved.\\n * Licensed under the Apache License, Version 2.0 (the \"License\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n * http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \"AS IS\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n * =============================================================================\\n */\\n/**\\n * @license\\n * Copyright 2019 Google LLC. All Rights Reserved.\\n * Licensed under the Apache License, Version 2.0 (the \"License\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n * http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \"AS IS\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n * =============================================================================\\n */\\n'});var Kt,ct,Rr,zn,Bn,Ba,Da,or,sr,ff,Rn,Ul,Nl,Wl,Vl,Gl,Hl,Ll,Ma=F(()=>{\"use strict\";lt();Dl();nr();Kt=()=>!!Ae.wasm.proxy&&typeof document<\"u\",Rr=!1,zn=!1,Bn=!1,Da=new Map,or=(e,t)=>{let r=Da.get(e);r?r.push(t):Da.set(e,[t])},sr=()=>{if(Rr||!zn||Bn||!ct)throw new Error(\"worker not ready\")},ff=e=>{switch(e.data.type){case\"init-wasm\":Rr=!1,e.data.err?(Bn=!0,Ba[1](e.data.err)):(zn=!0,Ba[0]());break;case\"init-ep\":case\"copy-from\":case\"create\":case\"release\":case\"run\":case\"end-profiling\":{let t=Da.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},Rn=typeof document<\"u\"?document?.currentScript?.src:void 0,Ul=async()=>{if(!zn){if(Rr)throw new Error(\"multiple calls to 'initWasm()' detected.\");if(Bn)throw new Error(\"previous call to 'initWasm()' failed.\");if(Rr=!0,Kt())return Ae.wasm.wasmPaths===void 0&&Rn&&Rn.indexOf(\"blob:\")!==0&&(Ae.wasm.wasmPaths=Rn.substr(0,+Rn.lastIndexOf(\"/\")+1)),new Promise((e,t)=>{ct?.terminate();let r=URL.createObjectURL(new Blob([Ml()],{type:\"text/javascript\"}));ct=new Worker(r,{name:\"ort-wasm-proxy-worker\"}),ct.onerror=n=>t(n),ct.onmessage=ff,URL.revokeObjectURL(r),Ba=[e,t];let a={type:\"init-wasm\",in:Ae};ct.postMessage(a)});try{await Ki(Ae.wasm),await Tl(Ae),zn=!0}catch(e){throw Bn=!0,e}finally{Rr=!1}}},Nl=async e=>{if(Kt())return sr(),new Promise((t,r)=>{or(\"init-ep\",[t,r]);let a={type:\"init-ep\",in:{epName:e,env:Ae}};ct.postMessage(a)});await Ol(Ae,e)},Wl=async e=>Kt()?(sr(),new Promise((t,r)=>{or(\"copy-from\",[t,r]);let a={type:\"copy-from\",in:{buffer:e}};ct.postMessage(a,[e.buffer])})):za(e),Vl=async(e,t)=>{if(Kt()){if(t?.preferredOutputLocation)throw new Error('session option \"preferredOutputLocation\" is not supported for proxy.');return sr(),new Promise((r,a)=>{or(\"create\",[r,a]);let n={type:\"create\",in:{model:e,options:{...t}}},o=[];e instanceof Uint8Array&&o.push(e.buffer),ct.postMessage(n,o)})}else return kl(e,t)},Gl=async e=>{if(Kt())return sr(),new Promise((t,r)=>{or(\"release\",[t,r]);let a={type:\"release\",in:e};ct.postMessage(a)});Pl(e)},Hl=async(e,t,r,a,n,o)=>{if(Kt()){if(r.some(s=>s[3]!==\"cpu\"))throw new Error(\"input tensor on GPU is not supported for proxy.\");if(n.some(s=>s))throw new Error(\"pre-allocated output tensor is not supported for proxy.\");return sr(),new Promise((s,l)=>{or(\"run\",[s,l]);let i=r,c={type:\"run\",in:{sessionId:e,inputIndices:t,inputs:i,outputIndices:a,options:o}};ct.postMessage(c,Bl(i))})}else return Rl(e,t,r,a,n,o)},Ll=async e=>{if(Kt())return sr(),new Promise((t,r)=>{or(\"end-profiling\",[t,r]);let a={type:\"end-profiling\",in:e};ct.postMessage(a)});zl(e)}});var Fl,mf,Dn,ql=F(()=>{\"use strict\";lt();Ma();ie();oa();Fl=(e,t)=>{switch(e.location){case\"cpu\":return[e.type,e.dims,e.data,\"cpu\"];case\"gpu-buffer\":return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},\"gpu-buffer\"];default:throw new Error(`invalid data location: ${e.location} for ${t()}`)}},mf=e=>{switch(e[3]){case\"cpu\":return new Ze(e[0],e[2],e[1]);case\"gpu-buffer\":{let t=e[0];if(!un(t))throw new Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:r,download:a,dispose:n}=e[2];return Ze.fromGpuBuffer(r,{dataType:t,dims:e[1],download:a,dispose:n})}default:throw new Error(`invalid data location: ${e[3]}`)}},Dn=class{async fetchModelAndCopyToWasmMemory(t){return Wl(await Ar(t))}async loadModel(t,r){st();let a;typeof t==\"string\"?typeof process<\"u\"&&process.versions&&process.versions.node?a=await Ar(t):a=await this.fetchModelAndCopyToWasmMemory(t):a=t,[this.sessionId,this.inputNames,this.outputNames]=await Vl(a,r),nt()}async dispose(){return Gl(this.sessionId)}async run(t,r,a){st();let n=[],o=[];Object.entries(t).forEach(h=>{let w=h[0],b=h[1],$=this.inputNames.indexOf(w);if($===-1)throw new Error(`invalid input '${w}'`);n.push(b),o.push($)});let s=[],l=[];Object.entries(r).forEach(h=>{let w=h[0],b=h[1],$=this.outputNames.indexOf(w);if($===-1)throw new Error(`invalid output '${w}'`);s.push(b),l.push($)});let i=n.map((h,w)=>Fl(h,()=>`input \"${this.inputNames[o[w]]}\"`)),c=s.map((h,w)=>h?Fl(h,()=>`output \"${this.outputNames[l[w]]}\"`):null),f=await Hl(this.sessionId,o,i,l,c,a),m={};for(let h=0;h{\"use strict\";lt();Ma();ql();hf=()=>{if((typeof Ae.wasm.initTimeout!=\"number\"||Ae.wasm.initTimeout<0)&&(Ae.wasm.initTimeout=0),typeof Ae.wasm.simd!=\"boolean\"&&(Ae.wasm.simd=!0),typeof Ae.wasm.proxy!=\"boolean\"&&(Ae.wasm.proxy=!1),typeof Ae.wasm.trace!=\"boolean\"&&(Ae.wasm.trace=!1),typeof Ae.wasm.numThreads!=\"number\"||!Number.isInteger(Ae.wasm.numThreads)||Ae.wasm.numThreads<=0){(typeof self<\"u\"&&!self.crossOriginIsolated||typeof process<\"u\"&&process.versions&&process.versions.node)&&(Ae.wasm.numThreads=1);let e=typeof navigator>\"u\"?(void 0)().length:navigator.hardwareConcurrency;Ae.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Mn=class{async init(t){hf(),await Ul(),await Nl(t)}async createInferenceSessionHandler(t,r){let a=new Dn;return await a.loadModel(t,r),Promise.resolve(a)}}});var Kl={};rr(Kl,{wasmBackend:()=>gf});var gf,Yl=F(()=>{\"use strict\";jl();gf=new Mn});lt();lt();lt();var Ri=\"1.17.3\";var Kv=Yn;{let e=(Yl(),Gt(Kl)).wasmBackend;Lt(\"webgpu\",e,5),Lt(\"webnn\",e,5),Lt(\"cpu\",e,10),Lt(\"wasm\",e,10)}Object.defineProperty(Ae.versions,\"web\",{value:Ri,enumerable:!0});export{md as InferenceSession,tn as TRACE,st as TRACE_FUNC_BEGIN,nt as TRACE_FUNC_END,Ze as Tensor,gd as TrainingSession,Kv as default,Ae as env,Lt as registerBackend};\n/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n//# sourceMappingURL=ort.webgpu.min.js.map\n","/**\n * @file Handler file for choosing the correct version of ONNX Runtime, based on the environment.\n * Ideally, we could import the `onnxruntime-web` and `onnxruntime-node` packages only when needed,\n * but dynamic imports don't seem to work with the current webpack version and/or configuration.\n * This is possibly due to the experimental nature of top-level await statements.\n * So, we just import both packages, and use the appropriate one based on the environment:\n * - When running in node, we use `onnxruntime-node`.\n * - When running in the browser, we use `onnxruntime-web` (`onnxruntime-node` is not bundled).\n * \n * This module is not directly exported, but can be accessed through the environment variables:\n * ```javascript\n * import { env } from '@xenova/transformers';\n * console.log(env.backends.onnx);\n * ```\n * \n * @module backends/onnx\n */\n\nimport { env, apis } from '../env.js';\n\n// NOTE: Import order matters here. We need to import `onnxruntime-node` before `onnxruntime-web`.\n// In either case, we select the default export if it exists, otherwise we use the named export.\nimport * as ONNX_NODE from 'onnxruntime-node';\nimport * as ONNX_WEB from 'onnxruntime-web/webgpu';\n\nexport { Tensor } from 'onnxruntime-common';\n\n/** @type {import('../utils/devices.js').DeviceType[]} */\nconst supportedExecutionProviders = [];\n\n/** @type {import('../utils/devices.js').DeviceType[]} */\nlet defaultExecutionProviders;\nlet ONNX;\nif (apis.IS_NODE_ENV) {\n ONNX = ONNX_NODE.default ?? ONNX_NODE;\n supportedExecutionProviders.push('cpu');\n defaultExecutionProviders = ['cpu'];\n} else {\n ONNX = ONNX_WEB;\n if (apis.IS_WEBGPU_AVAILABLE) {\n supportedExecutionProviders.push('webgpu');\n }\n supportedExecutionProviders.push('wasm');\n defaultExecutionProviders = ['wasm'];\n}\n\n// @ts-ignore\nconst InferenceSession = ONNX.InferenceSession;\n\n/**\n * Map a device to the execution providers to use for the given device.\n * @param {import(\"../utils/devices.js\").DeviceType} [device=null] (Optional) The device to run the inference on.\n * @returns {import(\"../utils/devices.js\").DeviceType[]} The execution providers to use for the given device.\n */\nexport function deviceToExecutionProviders(device) {\n // TODO: Use mapping from device to execution providers for overloaded devices (e.g., 'gpu' or 'cpu').\n let executionProviders = defaultExecutionProviders;\n if (device) { // User has specified a device\n if (!supportedExecutionProviders.includes(device)) {\n throw new Error(`Unsupported device: \"${device}\". Should be one of: ${supportedExecutionProviders.join(', ')}.`)\n }\n executionProviders = [device];\n }\n return executionProviders;\n}\n\n/**\n * Create an ONNX inference session.\n * @param {Uint8Array} buffer The ONNX model buffer.\n * @param {Object} session_options ONNX inference session options.\n * @returns {Promise} The ONNX inference session.\n */\nexport async function createInferenceSession(buffer, session_options) {\n return await InferenceSession.create(buffer, session_options);\n}\n\n/**\n * Check if an object is an ONNX tensor.\n * @param {any} x The object to check\n * @returns {boolean} Whether the object is an ONNX tensor.\n */\nexport function isONNXTensor(x) {\n return x instanceof ONNX.Tensor;\n}\n\n// @ts-ignore\nconst ONNX_ENV = ONNX?.env;\nif (ONNX_ENV?.wasm) {\n // Initialize wasm backend with suitable default settings.\n\n // Set path to wasm files. This is needed when running in a web worker.\n // https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths\n // We use remote wasm files by default to make it easier for newer users.\n // In practice, users should probably self-host the necessary .wasm files.\n // TODO: update this before release\n ONNX_ENV.wasm.wasmPaths = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.17.3/dist/';\n\n // Proxy the WASM backend to prevent the UI from freezing\n // NOTE: This is only needed when running in a non-worker browser environment.\n ONNX_ENV.wasm.proxy = !apis.IS_WEBWORKER_ENV;\n\n // https://developer.mozilla.org/en-US/docs/Web/API/crossOriginIsolated\n if (typeof crossOriginIsolated === 'undefined' || !crossOriginIsolated) {\n ONNX_ENV.wasm.numThreads = 1;\n }\n\n // Running in a browser-environment\n // TODO: Check if 1.17.1 fixes this issue.\n // SIMD for WebAssembly does not operate correctly in some recent versions of iOS (16.4.x).\n // As a temporary fix, we disable it for now.\n // For more information, see: https://github.com/microsoft/onnxruntime/issues/15644\n const isIOS = typeof navigator !== 'undefined' && /iP(hone|od|ad).+16_4.+AppleWebKit/.test(navigator.userAgent);\n if (isIOS) {\n ONNX_ENV.wasm.simd = false;\n }\n}\n\n/**\n * Check if ONNX's WASM backend is being proxied.\n * @returns {boolean} Whether ONNX's WASM backend is being proxied.\n */\nexport function isONNXProxy() {\n // TODO: Update this when allowing non-WASM backends.\n return ONNX_ENV?.wasm?.proxy;\n}\n\n// Expose ONNX environment variables to `env.backends.onnx`\nenv.backends.onnx = ONNX_ENV;\n","\n/**\n * @file Helper module for using model configs. For more information, see the corresponding\n * [Python documentation](https://huggingface.co/docs/transformers/main/en/model_doc/auto#transformers.AutoConfig).\n * \n * **Example:** Load an `AutoConfig`.\n * \n * ```javascript\n * import { AutoConfig } from '@xenova/transformers';\n * let config = await AutoConfig.from_pretrained('bert-base-uncased');\n * console.log(config);\n * // PretrainedConfig {\n * // \"model_type\": \"bert\",\n * // \"is_encoder_decoder\": false,\n * // \"architectures\": [\n * // \"BertForMaskedLM\"\n * // ],\n * // \"vocab_size\": 30522\n * // \"num_attention_heads\": 12,\n * // \"num_hidden_layers\": 12,\n * // \"hidden_size\": 768,\n * // \"max_position_embeddings\": 512,\n * // ...\n * // }\n * ```\n * \n * @module configs\n */\n\nimport {\n getModelJSON,\n} from './utils/hub.js';\n\n/**\n * @typedef {import('./utils/hub.js').PretrainedOptions} PretrainedOptions\n */\n\n\n/**\n * Loads a config from the specified path.\n * @param {string} pretrained_model_name_or_path The path to the config directory.\n * @param {PretrainedOptions} options Additional options for loading the config.\n * @returns {Promise} A promise that resolves with information about the loaded config.\n */\nasync function loadConfig(pretrained_model_name_or_path, options) {\n let info = await getModelJSON(pretrained_model_name_or_path, 'config.json', true, options);\n return info;\n}\n\n/**\n * Base class for all configuration classes. For more information, see the corresponding\n * [Python documentation](https://huggingface.co/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig).\n */\nexport class PretrainedConfig {\n // NOTE: Typo in original\n\n /**\n * Create a new PreTrainedTokenizer instance.\n * @param {Object} configJSON The JSON of the config.\n */\n constructor(configJSON) {\n this.model_type = null;\n this.is_encoder_decoder = false;\n\n Object.assign(this, configJSON);\n }\n\n /**\n * Loads a pre-trained config from the given `pretrained_model_name_or_path`. \n * \n * @param {string} pretrained_model_name_or_path The path to the pre-trained config.\n * @param {PretrainedOptions} options Additional options for loading the config.\n * @throws {Error} Throws an error if the config.json is not found in the `pretrained_model_name_or_path`.\n * \n * @returns {Promise} A new instance of the `PretrainedConfig` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n } = {}) {\n\n let data = config ?? await loadConfig(pretrained_model_name_or_path, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n })\n return new this(data);\n }\n}\n\n/**\n * Helper class which is used to instantiate pretrained configs with the `from_pretrained` function.\n * \n * @example\n * const config = await AutoConfig.from_pretrained('Xenova/bert-base-uncased'); \n */\nexport class AutoConfig {\n /** @type {typeof PretrainedConfig.from_pretrained} */\n static async from_pretrained(...args) {\n return PretrainedConfig.from_pretrained(...args);\n }\n}\n","/**\n * @file Module used to configure Transformers.js.\n * \n * **Example:** Disable remote models.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.allowRemoteModels = false;\n * ```\n * \n * **Example:** Set local model path.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.localModelPath = '/path/to/local/models/';\n * ```\n * \n * **Example:** Set cache directory.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.cacheDir = '/path/to/cache/directory/';\n * ```\n * \n * @module env\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport url from 'url';\n\nconst VERSION = '3.0.0-alpha.0';\n\n// Check if various APIs are available (depends on environment)\nconst IS_BROWSER_ENV = typeof self !== 'undefined';\nconst IS_WEBWORKER_ENV = IS_BROWSER_ENV && self.constructor.name === 'DedicatedWorkerGlobalScope';\nconst IS_WEB_CACHE_AVAILABLE = IS_BROWSER_ENV && 'caches' in self;\nconst IS_WEBGPU_AVAILABLE = typeof navigator !== 'undefined' && 'gpu' in navigator;\n\nconst IS_NODE_ENV = typeof process !== 'undefined' && process?.release?.name === 'node';\nconst IS_FS_AVAILABLE = !isEmpty(fs);\nconst IS_PATH_AVAILABLE = !isEmpty(path);\n\n/**\n * A read-only object containing information about the APIs available in the current environment.\n */\nexport const apis = Object.freeze({\n /** Whether we are running in a browser environment */\n IS_BROWSER_ENV,\n\n /** Whether we are running in a web worker environment */\n IS_WEBWORKER_ENV,\n\n /** Whether the Cache API is available */\n IS_WEB_CACHE_AVAILABLE,\n\n /** Whether the WebGPU API is available */\n IS_WEBGPU_AVAILABLE,\n\n /** Whether we are running in a Node.js environment */\n IS_NODE_ENV,\n\n /** Whether the filesystem API is available */\n IS_FS_AVAILABLE,\n\n /** Whether the path API is available */\n IS_PATH_AVAILABLE,\n});\n\nconst RUNNING_LOCALLY = IS_FS_AVAILABLE && IS_PATH_AVAILABLE;\nconst __dirname = RUNNING_LOCALLY\n ? path.dirname(path.dirname(url.fileURLToPath(import.meta.url)))\n : './';\n\n// Only used for environments with access to file system\nconst DEFAULT_CACHE_DIR = RUNNING_LOCALLY\n ? path.join(__dirname, '/.cache/')\n : null;\n\n// Set local model path, based on available APIs\nconst DEFAULT_LOCAL_MODEL_PATH = '/models/';\nconst localModelPath = RUNNING_LOCALLY\n ? path.join(__dirname, DEFAULT_LOCAL_MODEL_PATH)\n : DEFAULT_LOCAL_MODEL_PATH;\n\n/**\n * Global variable given visible to users to control execution. This provides users a simple way to configure Transformers.js.\n * @typedef {Object} TransformersEnvironment\n * @property {string} version This version of Transformers.js.\n * @property {Object} backends Expose environment variables of different backends,\n * allowing users to set these variables if they want to.\n * @property {boolean} allowRemoteModels Whether to allow loading of remote files, defaults to `true`.\n * If set to `false`, it will have the same effect as setting `local_files_only=true` when loading pipelines, models, tokenizers, processors, etc.\n * @property {string} remoteHost Host URL to load models from. Defaults to the Hugging Face Hub.\n * @property {string} remotePathTemplate Path template to fill in and append to `remoteHost` when loading models.\n * @property {boolean} allowLocalModels Whether to allow loading of local files, defaults to `false` if running in-browser, and `true` otherwise.\n * If set to `false`, it will skip the local file check and try to load the model from the remote host.\n * @property {string} localModelPath Path to load local models from. Defaults to `/models/`.\n * @property {boolean} useFS Whether to use the file system to load files. By default, it is `true` if available.\n * @property {boolean} useBrowserCache Whether to use Cache API to cache models. By default, it is `true` if available.\n * @property {boolean} useFSCache Whether to use the file system to cache files. By default, it is `true` if available.\n * @property {string} cacheDir The directory to use for caching files with the file system. By default, it is `./.cache`.\n * @property {boolean} useCustomCache Whether to use a custom cache system (defined by `customCache`), defaults to `false`.\n * @property {Object} customCache The custom cache to use. Defaults to `null`. Note: this must be an object which\n * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache\n */\n\n/** @type {TransformersEnvironment} */\nexport const env = {\n version: VERSION,\n\n /////////////////// Backends settings ///////////////////\n // NOTE: These will be populated later by the backends themselves.\n backends: {\n // onnxruntime-web/onnxruntime-node\n onnx: {},\n\n // TensorFlow.js\n tfjs: {},\n },\n\n\n /////////////////// Model settings ///////////////////\n allowRemoteModels: true,\n remoteHost: 'https://huggingface.co/',\n remotePathTemplate: '{model}/resolve/{revision}/',\n\n allowLocalModels: !IS_BROWSER_ENV,\n localModelPath: localModelPath,\n useFS: IS_FS_AVAILABLE,\n\n /////////////////// Cache settings ///////////////////\n useBrowserCache: IS_WEB_CACHE_AVAILABLE,\n\n useFSCache: IS_FS_AVAILABLE,\n cacheDir: DEFAULT_CACHE_DIR,\n\n useCustomCache: false,\n customCache: null,\n //////////////////////////////////////////////////////\n}\n\n\n/**\n * @param {Object} obj\n * @private\n */\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n","\n/**\n * @module generation/configuration_utils\n */\n\nimport { pick } from \"../utils/core.js\";\n\n/**\n * Class that holds a configuration for a generation task.\n */\nexport class GenerationConfig {\n // Parameters that control the length of the output\n /**\n * The maximum length the generated tokens can have.\n * Corresponds to the length of the input prompt + `max_new_tokens`.\n * Its effect is overridden by `max_new_tokens`, if also set.\n * @type {number}\n * @default 20\n */\n max_length = 20;\n\n /**\n * The maximum numbers of tokens to generate, ignoring the number of tokens in the prompt.\n * @type {number}\n * @default null\n */\n max_new_tokens = null;\n\n /**\n * The minimum length of the sequence to be generated.\n * Corresponds to the length of the input prompt + `min_new_tokens`.\n * Its effect is overridden by `min_new_tokens`, if also set.\n * @type {number}\n * @default 0\n */\n min_length = 0;\n\n /**\n * The minimum numbers of tokens to generate, ignoring the number of tokens in the prompt.\n * @type {number}\n * @default null\n */\n min_new_tokens = null;\n\n /**\n * Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:\n * - `true`, where the generation stops as soon as there are `num_beams` complete candidates;\n * - `false`, where an heuristic is applied and the generation stops when is it very unlikely to find better candidates;\n * - `\"never\"`, where the beam search procedure only stops when there cannot be better candidates (canonical beam search algorithm).\n * @type {boolean|\"never\"}\n * @default false\n */\n early_stopping = false;\n\n /**\n * The maximum amount of time you allow the computation to run for in seconds.\n * Generation will still finish the current pass after allocated time has been passed.\n * @type {number}\n * @default null\n */\n max_time = null;\n\n // Parameters that control the generation strategy used\n /**\n * Whether or not to use sampling; use greedy decoding otherwise.\n * @type {boolean}\n * @default false\n */\n do_sample = false;\n\n /**\n * Number of beams for beam search. 1 means no beam search.\n * @type {number}\n * @default 1\n */\n num_beams = 1;\n\n /**\n * Number of groups to divide `num_beams` into in order to ensure diversity among different groups of beams.\n * See [this paper](https://arxiv.org/pdf/1610.02424.pdf) for more details.\n * @type {number}\n * @default 1\n */\n num_beam_groups = 1;\n\n /**\n * The values balance the model confidence and the degeneration penalty in contrastive search decoding.\n * @type {number}\n * @default null\n */\n penalty_alpha = null;\n\n /**\n * Whether or not the model should use the past last key/values attentions (if applicable to the model) to speed up decoding.\n * @type {boolean}\n * @default true\n */\n use_cache = true;\n\n // Parameters for manipulation of the model output logits\n /**\n * The value used to modulate the next token probabilities.\n * @type {number}\n * @default 1.0\n */\n temperature = 1.0;\n\n /**\n * The number of highest probability vocabulary tokens to keep for top-k-filtering.\n * @type {number}\n * @default 50\n */\n top_k = 50;\n\n /**\n * If set to float < 1, only the smallest set of most probable tokens with probabilities that add up to `top_p` or higher are kept for generation.\n * @type {number}\n * @default 1.0\n */\n top_p = 1.0;\n\n /**\n * Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated.\n * If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to `typical_p` or higher are kept for generation.\n * See [this paper](https://arxiv.org/pdf/2202.00666.pdf) for more details.\n * @type {number}\n * @default 1.0\n */\n typical_p = 1.0;\n\n /**\n * If set to float strictly between 0 and 1, only tokens with a conditional probability greater than `epsilon_cutoff` will be sampled.\n * In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model.\n * See [Truncation Sampling as Language Model Desmoothing](https://arxiv.org/abs/2210.15191) for more details.\n * @type {number}\n * @default 0.0\n */\n epsilon_cutoff = 0.0;\n\n /**\n * Eta sampling is a hybrid of locally typical sampling and epsilon sampling.\n * If set to float strictly between 0 and 1, a token is only considered if it is greater than either `eta_cutoff` or `sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits)))`.\n * The latter term is intuitively the expected next token probability, scaled by `sqrt(eta_cutoff)`. In the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model.\n * See [Truncation Sampling as Language Model Desmoothing](https://arxiv.org/abs/2210.15191) for more details.\n * @type {number}\n * @default 0.0\n */\n eta_cutoff = 0.0;\n\n /**\n * This value is subtracted from a beam's score if it generates a token same as any beam from other group at a particular time.\n * Note that `diversity_penalty` is only effective if `group beam search` is enabled.\n * @type {number}\n * @default 0.0\n */\n diversity_penalty = 0.0;\n\n /**\n * The parameter for repetition penalty. 1.0 means no penalty.\n * See [this paper](https://arxiv.org/pdf/1909.05858.pdf) for more details.\n * @type {number}\n * @default 1.0\n */\n repetition_penalty = 1.0;\n\n /**\n * The paramater for encoder_repetition_penalty.\n * An exponential penalty on sequences that are not in the original input.\n * 1.0 means no penalty.\n * @type {number}\n * @default 1.0\n */\n encoder_repetition_penalty = 1.0;\n\n /**\n * Exponential penalty to the length that is used with beam-based generation.\n * It is applied as an exponent to the sequence length, which in turn is used to divide the score of the sequence.\n * Since the score is the log likelihood of the sequence (i.e. negative), `length_penalty` > 0.0 promotes longer sequences, while `length_penalty` < 0.0 encourages shorter sequences.\n * @type {number}\n * @default 1.0\n */\n length_penalty = 1.0;\n\n /**\n * If set to int > 0, all ngrams of that size can only occur once.\n * @type {number}\n * @default 0\n */\n no_repeat_ngram_size = 0;\n\n /**\n * List of token ids that are not allowed to be generated.\n * In order to get the token ids of the words that should not appear in the generated text, use\n * `tokenizer(bad_words, { add_prefix_space: true, add_special_tokens: false }).input_ids`.\n * @type {number[][]}\n * @default null\n */\n bad_words_ids = null;\n\n /**\n * List of token ids that must be generated.\n * If given a `number[][]`, this is treated as a simple list of words that must be included, the opposite to `bad_words_ids`.\n * If given `number[][][]`, this triggers a [disjunctive constraint](https://github.com/huggingface/transformers/issues/14081), where one can allow different forms of each word.\n * @type {number[][]|number[][][]}\n * @default null\n */\n force_words_ids = null;\n\n /**\n * Whether to renormalize the logits after applying all the logits processors or warpers (including the custom ones).\n * It's highly recommended to set this flag to `true` as the search algorithms suppose the score logits are normalized but some logit processors or warpers break the normalization.\n * @type {boolean}\n * @default false\n */\n renormalize_logits = false;\n\n /**\n * Custom constraints that can be added to the generation to ensure that the output will contain the use of certain tokens as defined by `Constraint` objects, in the most sensible way possible.\n * @type {Object[]}\n * @default null\n */\n constraints = null;\n\n /**\n * The id of the token to force as the first generated token after the `decoder_start_token_id`.\n * Useful for multilingual models like mBART where the first generated token needs to be the target language token.\n * @type {number}\n * @default null\n */\n forced_bos_token_id = null;\n\n /**\n * The id of the token to force as the last generated token when `max_length` is reached.\n * Optionally, use a list to set multiple *end-of-sequence* tokens.\n * @type {number|number[]}\n * @default null\n */\n forced_eos_token_id = null;\n\n /**\n * Whether to remove possible *nan* and *inf* outputs of the model to prevent the generation method to crash. Note that using `remove_invalid_values` can slow down generation.\n * @type {boolean}\n */\n remove_invalid_values = false;\n\n /**\n * This Tuple adds an exponentially increasing length penalty, after a certain amount of tokens have been generated.\n * The tuple shall consist of: `(start_index, decay_factor)` where `start_index` indicates where penalty starts and `decay_factor` represents the factor of exponential decay.\n * @type {[number, number]}\n * @default null\n */\n exponential_decay_length_penalty = null;\n\n /**\n * A list of tokens that will be suppressed at generation.\n * The `SuppressTokens` logit processor will set their log probs to `-inf` so that they are not sampled.\n * @type {number[]}\n * @default null\n */\n suppress_tokens = null;\n\n /**\n * A list of tokens that will be suppressed at the beginning of the generation.\n * The `SuppressBeginTokens` logit processor will set their log probs to `-inf` so that they are not sampled.\n * @type {number[]}\n * @default null\n */\n begin_suppress_tokens = null;\n\n /**\n * A list of pairs of integers which indicates a mapping from generation indices to token indices that will be forced before sampling.\n * For example, `[[1, 123]]` means the second generated token will always be a token of index 123.\n * @type {[number, number][]}\n * @default null\n */\n forced_decoder_ids = null;\n\n /**\n * The guidance scale for classifier free guidance (CFG). CFG is enabled by setting `guidance_scale > 1`.\n * Higher guidance scale encourages the model to generate samples that are more closely linked to the input\n * prompt, usually at the expense of poorer quality.\n * @type {number}\n * @default null\n */\n guidance_scale = null;\n\n // Parameters that define the output variables of `generate`\n /**\n * The number of independently computed returned sequences for each element in the batch.\n * @type {number}\n * @default 1\n */\n num_return_sequences = 1;\n\n /**\n * Whether or not to return the attentions tensors of all attention layers.\n * See `attentions` under returned tensors for more details.\n * @type {boolean}\n * @default false\n */\n output_attentions = false;\n\n /**\n * Whether or not to return the hidden states of all layers.\n * See `hidden_states` under returned tensors for more details.\n * @type {boolean}\n * @default false\n */\n output_hidden_states = false;\n\n /**\n * Whether or not to return the prediction scores.\n * See `scores` under returned tensors for more details.\n * @type {boolean}\n * @default false\n */\n output_scores = false;\n\n /**\n * Whether or not to return a `ModelOutput` instead of a plain tuple.\n * @type {boolean}\n * @default false\n */\n return_dict_in_generate = false;\n\n // Special tokens that can be used at generation time\n /**\n * The id of the *padding* token.\n * @type {number}\n * @default null\n */\n pad_token_id = null;\n\n /**\n * The id of the *beginning-of-sequence* token.\n * @type {number}\n * @default null\n */\n bos_token_id = null;\n\n /**\n * The id of the *end-of-sequence* token.\n * Optionally, use a list to set multiple *end-of-sequence* tokens.\n * @type {number|number[]}\n * @default null\n */\n eos_token_id = null;\n\n // Generation parameters exclusive to encoder-decoder models\n /**\n * If set to int > 0, all ngrams of that size that occur in the `encoder_input_ids` cannot occur in the `decoder_input_ids`.\n * @type {number}\n * @default 0\n */\n encoder_no_repeat_ngram_size = 0;\n\n /**\n * If an encoder-decoder model starts decoding with a different token than *bos*, the id of that token.\n * @type {number}\n * @default null\n */\n decoder_start_token_id = null;\n\n // Wild card\n /**\n * Additional generation kwargs will be forwarded to the `generate` function of the model.\n * Kwargs that are not present in `generate`'s signature will be used in the model forward pass.\n * @type {Object}\n * @default {}\n */\n generation_kwargs = {};\n\n /**\n * \n * @param {GenerationConfig} config \n */\n constructor(config) {\n Object.assign(this, pick(config, Object.getOwnPropertyNames(this)));\n }\n}\n\n","\n/**\n * @module generation/logits_process\n */\n\nimport { Callable } from \"../utils/generic.js\";\nimport { Tensor } from \"../utils/tensor.js\";\n\nimport { max, log_softmax } from \"../utils/maths.js\";\n\n/**\n * Abstract base class for all logit processors that can be applied during generation.\n */\nexport class LogitsProcessor extends Callable {\n /**\n * Apply the processor to the input logits.\n *\n * @abstract\n * @param {number[][]} input_ids The input ids.\n * @param {Tensor} logits The logits to process.\n * @throws {Error} Throws an error if `_call` is not implemented in the subclass.\n */\n _call(input_ids, logits) {\n throw Error(\"`_call` should be implemented in a subclass\")\n }\n}\n\n\n/**\n * Abstract base class for all logit warpers that can be applied during generation with multinomial sampling.\n */\nexport class LogitsWarper extends Callable {\n /**\n * Apply the processor to the input logits.\n *\n * @abstract\n * @param {number[][]} input_ids The input ids.\n * @param {Tensor} logits The logits to process.\n * @throws {Error} Throws an error if `_call` is not implemented in the subclass.\n */\n _call(input_ids, logits) {\n throw Error(\"`_call` should be implemented in a subclass\")\n }\n}\n\n\n/**\n * A class representing a list of logits processors. A logits processor is a function that modifies the logits\n * output of a language model. This class provides methods for adding new processors and applying all processors to a\n * batch of logits.\n */\nexport class LogitsProcessorList extends Callable {\n /**\n * Constructs a new instance of `LogitsProcessorList`.\n */\n constructor() {\n super();\n this.processors = [];\n }\n\n /**\n * Adds a new logits processor to the list.\n *\n * @param {LogitsProcessor} item The logits processor function to add.\n */\n push(item) {\n this.processors.push(item);\n }\n\n /**\n * Adds multiple logits processors to the list.\n *\n * @param {LogitsProcessor[]} items The logits processor functions to add.\n */\n extend(items) {\n this.processors.push(...items);\n }\n\n /**\n * Applies all logits processors in the list to a batch of logits, modifying them in-place.\n *\n * @param {number[][]} input_ids The input IDs for the language model.\n * @param {Tensor} logits\n */\n _call(input_ids, logits) {\n let toReturn = logits;\n // NOTE: Most processors modify logits inplace\n for (const processor of this.processors) {\n toReturn = processor(input_ids, toReturn);\n }\n return toReturn;\n }\n\n [Symbol.iterator]() {\n return this.processors.values();\n }\n}\n\n// DEPRECATED: https://github.com/huggingface/transformers/pull/29485\n// /**\n// * A logits processor that forces a specific token to be generated by the decoder.\n// */\n// export class ForceTokensLogitsProcessor extends LogitsProcessor {\n// /**\n// * Constructs a new instance of `ForceTokensLogitsProcessor`.\n// * \n// * @param {[number, number][]} forced_decoder_ids The ids of tokens that should be forced.\n// */\n// constructor(forced_decoder_ids) {\n// super();\n// // TODO: convert to `new Map(forced_decoder_ids)`\n// this.force_token_map = Object.fromEntries(forced_decoder_ids ?? []);\n// }\n\n// /**\n// * Apply the processor to the input logits.\n// *\n// * @param {number[][]} input_ids The input ids.\n// * @param {Tensor} logits The logits to process.\n// * @returns {Tensor} The processed logits.\n// */\n// _call(input_ids, logits) {\n// console.log('this.force_token_map', this.force_token_map)\n// console.log('call ForceTokensLogitsProcessor', input_ids, logits)\n// console.log('input_ids.length', input_ids.length)\n// let map = this.force_token_map[input_ids.length];\n// if (map) { // There exists a mapping\n// logits.data.fill(-Infinity)\n// logits.data[map] = 0;\n// }\n// console.log('map', map)\n// // throw Error(\"Not implemented\")\n// return logits;\n// }\n// }\n\n/**\n * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence.\n */\nexport class ForcedBOSTokenLogitsProcessor extends LogitsProcessor {\n /**\n * Create a ForcedBOSTokenLogitsProcessor.\n * @param {number} bos_token_id The ID of the beginning-of-sequence token to be forced.\n */\n constructor(bos_token_id) {\n super();\n this.bos_token_id = bos_token_id;\n }\n\n /**\n * Apply the BOS token forcing to the logits.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The logits with BOS token forcing.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n if (input_ids[i].length === 1) {\n const batch_logits = logits[i];\n batch_logits.data.fill(-Infinity);\n batch_logits.data[this.bos_token_id] = 0;\n }\n }\n return logits;\n }\n}\n\n/**\n * A logits processor that forces end-of-sequence token probability to 1.\n */\nexport class ForcedEOSTokenLogitsProcessor extends LogitsProcessor {\n /**\n * Create a ForcedEOSTokenLogitsProcessor.\n * @param {number} max_length Max length of the sequence.\n * @param {number|number[]} forced_eos_token_id The ID of the end-of-sequence token to be forced.\n */\n constructor(max_length, forced_eos_token_id) {\n super();\n this.max_length = max_length;\n this.forced_eos_token_id = forced_eos_token_id;\n }\n\n /**\n * Apply the processor to input_ids and logits.\n * \n * @param {number[][]} input_ids The input ids.\n * @param {Tensor} logits The logits tensor.\n */\n _call(input_ids, logits) {\n // console.log('call ForcedEOSTokenLogitsProcessor')\n // TODO\n }\n}\n\n/**\n * A LogitsProcessor that suppresses a list of tokens as soon as the `generate` function starts\n * generating using `begin_index` tokens. This should ensure that the tokens defined by\n * `begin_suppress_tokens` at not sampled at the begining of the generation.\n */\nexport class SuppressTokensAtBeginLogitsProcessor extends LogitsProcessor {\n /**\n * Create a SuppressTokensAtBeginLogitsProcessor.\n * @param {number[]} begin_suppress_tokens The IDs of the tokens to suppress.\n * @param {number} begin_index The number of tokens to generate before suppressing tokens.\n */\n constructor(begin_suppress_tokens, begin_index) {\n super();\n this.begin_suppress_tokens = begin_suppress_tokens;\n this.begin_index = begin_index;\n }\n\n /**\n * Apply the BOS token forcing to the logits.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The logits with BOS token forcing.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n if (input_ids[i].length === this.begin_index) {\n const batch_logits = logits[i];\n for (const token_id of this.begin_suppress_tokens) {\n batch_logits.data[token_id] = -Infinity;\n }\n }\n }\n return logits;\n }\n}\n\n/**\n * A LogitsProcessor that handles adding timestamps to generated text.\n */\nexport class WhisperTimeStampLogitsProcessor extends LogitsProcessor {\n /**\n * Constructs a new WhisperTimeStampLogitsProcessor.\n * @param {Object} generate_config The config object passed to the `generate()` method of a transformer model.\n * @param {number} generate_config.eos_token_id The ID of the end-of-sequence token.\n * @param {number} generate_config.no_timestamps_token_id The ID of the token used to indicate that a token should not have a timestamp.\n * @param {[number, number][]} [generate_config.forced_decoder_ids] An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp.\n * @param {number} [generate_config.max_initial_timestamp_index] The maximum index at which an initial timestamp can appear.\n */\n constructor(generate_config) {\n super();\n this.eos_token_id = generate_config.eos_token_id;\n this.no_timestamps_token_id = generate_config.no_timestamps_token_id;\n this.timestamp_begin = this.no_timestamps_token_id + 1;\n\n this.begin_index = (generate_config.forced_decoder_ids || []).length + 2;\n if (generate_config.forced_decoder_ids.slice(-1)[0][1] === this.no_timestamps_token_id) {\n this.begin_index -= 1;\n }\n this.max_initial_timestamp_index = generate_config.max_initial_timestamp_index;\n\n }\n\n /**\n * Modify the logits to handle timestamp tokens.\n * @param {number[][]} input_ids The input sequence of tokens.\n * @param {Tensor} logits The logits output by the model.\n * @returns {Tensor} The modified logits.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n const batch_logits = logits[i];\n const logitsData = /** @type {Float32Array} */(batch_logits.data);\n\n // suppress <|notimestamps|> which is handled by without_timestamps\n logitsData[this.no_timestamps_token_id] = -Infinity;\n\n if (input_ids[i].length === this.begin_index - 1) {\n logitsData.fill(-Infinity);\n logitsData[this.timestamp_begin] = 0;\n continue;\n }\n\n // timestamps have to appear in pairs, except directly before eos_token; mask logits accordingly\n const seq = input_ids[i].slice(this.begin_index);\n const last_was_timestamp = seq.length >= 1 && seq[seq.length - 1] >= this.timestamp_begin;\n const penultimate_was_timestamp = seq.length < 2 || seq[seq.length - 2] >= this.timestamp_begin;\n\n if (last_was_timestamp) {\n if (penultimate_was_timestamp) { // has to be non-timestamp\n logitsData.subarray(this.timestamp_begin).fill(-Infinity);\n } else { // cannot be normal text tokens\n logitsData.subarray(0, this.eos_token_id).fill(-Infinity);\n }\n }\n\n // apply the `max_initial_timestamp` option\n if (input_ids[i].length === this.begin_index && this.max_initial_timestamp_index !== null) {\n const last_allowed = this.timestamp_begin + this.max_initial_timestamp_index;\n logitsData.subarray(last_allowed + 1).fill(-Infinity);\n }\n\n // if sum of probability over timestamps is above any other token, sample timestamp\n const logprobs = log_softmax(logitsData);\n const timestamp_logprob = Math.log(logprobs.subarray(this.timestamp_begin).map(Math.exp).reduce((a, b) => a + b));\n const max_text_token_logprob = max(logprobs.subarray(0, this.timestamp_begin))[0];\n\n if (timestamp_logprob > max_text_token_logprob) {\n logitsData.subarray(0, this.timestamp_begin).fill(-Infinity);\n }\n }\n\n return logits;\n }\n}\n\n/**\n * A logits processor that disallows ngrams of a certain size to be repeated.\n */\nexport class NoRepeatNGramLogitsProcessor extends LogitsProcessor {\n /**\n * Create a NoRepeatNGramLogitsProcessor.\n * @param {number} no_repeat_ngram_size The no-repeat-ngram size. All ngrams of this size can only occur once.\n */\n constructor(no_repeat_ngram_size) {\n super();\n this.no_repeat_ngram_size = no_repeat_ngram_size;\n }\n\n /**\n * Generate n-grams from a sequence of token ids.\n * @param {number[]} prevInputIds List of previous input ids\n * @returns {Map} Map of generated n-grams\n */\n getNgrams(prevInputIds) {\n const curLen = prevInputIds.length;\n\n /**@type {number[][]} */\n const ngrams = [];\n for (let j = 0; j < curLen + 1 - this.no_repeat_ngram_size; ++j) {\n const ngram = [];\n for (let k = 0; k < this.no_repeat_ngram_size; ++k) {\n ngram.push(prevInputIds[j + k]);\n }\n ngrams.push(ngram);\n }\n\n /** @type {Map} */\n const generatedNgram = new Map();\n for (const ngram of ngrams) {\n const prevNgram = ngram.slice(0, ngram.length - 1);\n const prevNgramKey = JSON.stringify(prevNgram);\n const prevNgramValue = generatedNgram.get(prevNgramKey) ?? [];\n prevNgramValue.push(ngram[ngram.length - 1]);\n generatedNgram.set(prevNgramKey, prevNgramValue);\n }\n return generatedNgram;\n }\n\n /**\n * Generate n-grams from a sequence of token ids.\n * @param {Map} bannedNgrams Map of banned n-grams\n * @param {number[]} prevInputIds List of previous input ids\n * @returns {number[]} Map of generated n-grams\n */\n getGeneratedNgrams(bannedNgrams, prevInputIds) {\n const ngramIdx = prevInputIds.slice(prevInputIds.length + 1 - this.no_repeat_ngram_size, prevInputIds.length);\n const banned = bannedNgrams.get(JSON.stringify(ngramIdx)) ?? [];\n return banned;\n }\n\n /**\n * Calculate banned n-gram tokens\n * @param {number[]} prevInputIds List of previous input ids\n * @returns {number[]} Map of generated n-grams\n */\n calcBannedNgramTokens(prevInputIds) {\n const bannedTokens = [];\n if (prevInputIds.length + 1 < this.no_repeat_ngram_size) {\n // return no banned tokens if we haven't generated no_repeat_ngram_size tokens yet\n return bannedTokens;\n\n } else {\n const generatedNgrams = this.getNgrams(prevInputIds);\n const bannedTokens = this.getGeneratedNgrams(generatedNgrams, prevInputIds);\n return bannedTokens;\n }\n }\n\n /**\n * Apply the no-repeat-ngram processor to the logits.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The logits with no-repeat-ngram processing.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n const batch_logits = logits[i];\n const bannedTokens = this.calcBannedNgramTokens(input_ids[i]);\n for (const token of bannedTokens) {\n batch_logits.data[token] = -Infinity;\n }\n }\n return logits;\n }\n}\n\n/**\n * A logits processor that penalises repeated output tokens.\n */\nexport class RepetitionPenaltyLogitsProcessor extends LogitsProcessor {\n /**\n * Create a RepetitionPenaltyLogitsProcessor.\n * @param {number} penalty The penalty to apply for repeated tokens.\n */\n constructor(penalty) {\n super();\n this.penalty = penalty;\n }\n\n /**\n * Apply the repetition penalty to the logits.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The logits with repetition penalty processing.\n */\n _call(input_ids, logits) {\n // Modify the logits corresponding to each element in `input_ids`.\n // As a consequence, the logits corresponding to tokens that appear\n // many times in the output will be penalised more.\n\n for (let i = 0; i < input_ids.length; ++i) {\n const batch_logits = logits[i];\n\n for (const input_id of input_ids[i]) {\n if (batch_logits.data[input_id] < 0) {\n batch_logits.data[input_id] *= this.penalty;\n } else {\n batch_logits.data[input_id] /= this.penalty;\n }\n }\n }\n\n return logits\n }\n}\n\n/**\n * A logits processor that enforces a minimum number of tokens.\n */\nexport class MinLengthLogitsProcessor extends LogitsProcessor {\n /**\n * Create a MinLengthLogitsProcessor.\n * @param {number} min_length The minimum length below which the score of `eos_token_id` is set to negative infinity.\n * @param {number|number[]} eos_token_id The ID/IDs of the end-of-sequence token.\n */\n constructor(min_length, eos_token_id) {\n super();\n this.min_length = min_length;\n this.eos_token_id = Array.isArray(eos_token_id) ? eos_token_id : [eos_token_id];\n }\n\n /**\n * Apply logit processor.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The processed logits.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n if (input_ids[i].length < this.min_length) {\n const batch_logits = logits[i];\n for (const eos_token of this.eos_token_id) {\n batch_logits.data[eos_token] = -Infinity;\n }\n }\n }\n\n return logits\n }\n}\n\n/**\n * A logits processor that enforces a minimum number of new tokens.\n */\nexport class MinNewTokensLengthLogitsProcessor extends LogitsProcessor {\n /**\n * Create a MinNewTokensLengthLogitsProcessor.\n * @param {number} prompt_length_to_skip The input tokens length.\n * @param {number} min_new_tokens The minimum *new* tokens length below which the score of `eos_token_id` is set to negative infinity.\n * @param {number|number[]} eos_token_id The ID/IDs of the end-of-sequence token.\n */\n constructor(prompt_length_to_skip, min_new_tokens, eos_token_id) {\n super();\n this.prompt_length_to_skip = prompt_length_to_skip;\n this.min_new_tokens = min_new_tokens;\n this.eos_token_id = Array.isArray(eos_token_id) ? eos_token_id : [eos_token_id];\n }\n\n /**\n * Apply logit processor.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The processed logits.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n const new_tokens_length = input_ids[i].length - this.prompt_length_to_skip;\n if (new_tokens_length < this.min_new_tokens) {\n const batch_logits = logits[i];\n for (const eos_token of this.eos_token_id) {\n batch_logits[eos_token] = -Infinity;\n }\n }\n }\n return logits\n }\n}\n\nexport class NoBadWordsLogitsProcessor extends LogitsProcessor {\n /**\n * Create a `NoBadWordsLogitsProcessor`.\n * @param {number[][]} bad_words_ids List of list of token ids that are not allowed to be generated.\n * @param {number|number[]} eos_token_id The id of the *end-of-sequence* token. Optionally, use a list to set multiple *end-of-sequence* tokens.\n */\n constructor(bad_words_ids, eos_token_id) {\n super();\n this.bad_words_ids = bad_words_ids;\n this.eos_token_id = Array.isArray(eos_token_id) ? eos_token_id : [eos_token_id];\n }\n\n /**\n * Apply logit processor.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The processed logits.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n const batch_logits = logits[i];\n for (const bad_word_ids of this.bad_words_ids) {\n // Whether to modify the logits of the last token in the bad word id sequence\n let mark = true;\n\n // For each bad word in the list, if the current sequence of input ids ends with this sequence (excluding the last),\n // then we set the logits of the last bad word id to -Infinity.\n for (let i = 1; i <= bad_word_ids.length - 1 && bad_word_ids.length < input_ids[i].length; ++i) {\n\n if (bad_word_ids.at(-i - 1) !== input_ids[i].at(-i)) {\n // We have found a mismatch\n mark = false;\n break;\n }\n }\n if (mark) {\n batch_logits[bad_word_ids.at(-1)] = -Infinity;\n }\n }\n }\n return logits\n }\n}\n\n/**\n * [`LogitsProcessor`] for classifier free guidance (CFG). The scores are split over the batch dimension,\n * where the first half correspond to the conditional logits (predicted from the input prompt) and the second half\n * correspond to the unconditional logits (predicted from an empty or 'null' prompt). The processor computes a\n * weighted average across the conditional and unconditional logits, parameterised by the `guidance_scale`.\n * \n * See [the paper](https://arxiv.org/abs/2306.05284) for more information.\n */\nexport class ClassifierFreeGuidanceLogitsProcessor extends LogitsProcessor {\n\n /**\n * Create a `ClassifierFreeGuidanceLogitsProcessor`.\n * @param {number} guidance_scale The guidance scale for classifier free guidance (CFG). CFG is enabled by setting `guidance_scale > 1`.\n * Higher guidance scale encourages the model to generate samples that are more closely linked to the input\n * prompt, usually at the expense of poorer quality.\n */\n constructor(guidance_scale) {\n super();\n if (guidance_scale <= 1) {\n throw new Error(\n `Require guidance scale >1 to use the classifier free guidance processor, got guidance scale ${guidance_scale}.`\n )\n }\n this.guidance_scale = guidance_scale;\n }\n\n /**\n * Apply logit processor.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The processed logits.\n */\n _call(input_ids, logits) {\n if (logits.dims[0] !== 2 * input_ids.length) {\n throw new Error(\n `Logits should have twice the batch size of the input ids, the first half of batches corresponding to ` +\n `the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got ` +\n `batch size ${logits.dims[0]} for the logits and ${input_ids.length} for the input ids.`\n )\n }\n\n const unguided_bsz = input_ids.length;\n const cond_logits = logits.slice([0, unguided_bsz], null);\n const uncond_logits = logits.slice([unguided_bsz, logits.dims[0]], null);\n\n // Merge into uncond_logits (to save memory). This is equivalent to the following:\n // scores = uncond_logits + (cond_logits - uncond_logits) * guidance_scale\n for (let i = 0; i < uncond_logits.data.length; ++i) {\n uncond_logits.data[i] += (cond_logits.data[i] - uncond_logits.data[i]) * this.guidance_scale;\n }\n\n return uncond_logits;\n }\n}\n\n/**\n * [`LogitsWarper`] for temperature (exponential scaling output probability distribution), which effectively means\n * that it can control the randomness of the predicted tokens. Often used together with [`TopPLogitsWarper`] and [`TopKLogitsWarper`].\n */\nexport class TemperatureLogitsWarper extends LogitsWarper {\n /**\n * Create a `TemperatureLogitsWarper`.\n * @param {number} temperature Strictly positive float value used to modulate the logits distribution.\n * A value smaller than `1` decreases randomness (and vice versa), with `0` being equivalent to shifting\n * all probability mass to the most likely token.\n */\n constructor(temperature) {\n super();\n\n if (typeof temperature !== 'number' || temperature <= 0) {\n let errorMessage =\n `\\`temperature\\` (=${temperature}) must be a strictly positive float, otherwise your next token scores will be invalid.`;\n\n if (temperature === 0) {\n errorMessage += \" If you're looking for greedy decoding strategies, set `do_sample=false`.\"\n }\n }\n this.temperature = temperature;\n }\n\n /**\n * Apply logit warper.\n * @param {number[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Object} The processed logits.\n */\n _call(input_ids, logits) {\n const logitsData = /** @type {Float32Array} */(logits.data);\n for (let i = 0; i < logitsData.length; ++i) {\n logitsData[i] /= this.temperature;\n }\n return logits;\n }\n}\n\n/**\n * [`LogitsWarper`] that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off.\n * Often used together with [`TemperatureLogitsWarper`] and [`TopKLogitsWarper`].\n */\nexport class TopPLogitsWarper extends LogitsWarper {\n /**\n * Create a `TopPLogitsWarper`.\n * @param {number} top_p If set to < 1, only the smallest set of most probable tokens with\n * probabilities that add up to `top_p` or higher are kept for generation.\n * @param {Object} options Additional options for the top-p sampling.\n * @param {number} [options.filter_value=-Infinity] All filtered values will be set to this float value.\n * @param {number} [options.min_tokens_to_keep=1] Minimum number of tokens that cannot be filtered.\n */\n constructor(top_p, {\n filter_value = -Infinity,\n min_tokens_to_keep = 1,\n } = {}) {\n super();\n if (top_p < 0 || top_p > 1.0) {\n throw new Error(`\\`top_p\\` must be a float > 0 and < 1, but is ${top_p}`)\n }\n if (!Number.isInteger(min_tokens_to_keep) || min_tokens_to_keep < 1) {\n throw new Error(`\\`min_tokens_to_keep\\` must be a positive integer, but is ${min_tokens_to_keep}`)\n }\n\n this.top_p = top_p\n this.filter_value = filter_value\n this.min_tokens_to_keep = min_tokens_to_keep\n }\n}\n\n/**\n * [`LogitsWarper`] that performs top-k, i.e. restricting to the k highest probability elements.\n * Often used together with [`TemperatureLogitsWarper`] and [`TopPLogitsWarper`].\n */\nexport class TopKLogitsWarper extends LogitsWarper {\n /**\n * Create a `TopKLogitsWarper`.\n * @param {number} top_k If set to > 0, only the top `top_k` tokens are kept for generation.\n * @param {Object} options Additional options for the top-k sampling.\n * @param {number} [options.filter_value=-Infinity] All filtered values will be set to this float value.\n * @param {number} [options.min_tokens_to_keep=1] Minimum number of tokens that cannot be filtered.\n */\n constructor(top_k, {\n filter_value = -Infinity,\n min_tokens_to_keep = 1,\n } = {}) {\n super();\n if (!Number.isInteger(top_k) || top_k < 0) {\n throw new Error(`\\`top_k\\` must be a positive integer, but is ${top_k}`)\n }\n\n this.top_k = Math.max(top_k, min_tokens_to_keep)\n this.filter_value = filter_value\n }\n}","\n/**\n * @module generation/logits_sampler\n */\n\nimport { Callable } from \"../utils/generic.js\";\nimport { Tensor } from \"../utils/tensor.js\";\n\nimport {\n max,\n softmax,\n getTopItems,\n} from '../utils/maths.js';\nimport { GenerationConfig } from '../generation/configuration_utils.js';\n\n/**\n * Sampler is a base class for all sampling methods used for text generation.\n */\nexport class LogitsSampler extends Callable {\n /**\n * Creates a new Sampler object with the specified generation config.\n * @param {GenerationConfig} generation_config The generation config.\n */\n constructor(generation_config) {\n super();\n this.generation_config = generation_config;\n }\n\n /**\n * Executes the sampler, using the specified logits.\n * @param {Tensor} logits\n * @param {number} index\n * @returns {[number, number][]}\n */\n _call(logits, index = -1) {\n // Sample from logits, of dims [batch, sequence_length, vocab_size].\n // If index is specified, sample from [batch, index, vocab_size].\n return this.sample(logits, index);\n }\n\n /**\n * Abstract method for sampling the logits.\n * @param {Tensor} logits\n * @param {number} index\n * @throws {Error}\n * @returns {[number, number][]}\n */\n sample(logits, index) {\n throw Error(\"sample should be implemented in subclasses.\")\n }\n\n /**\n * Returns the specified logits as an array, with temperature applied.\n * @param {Tensor} logits\n * @param {number} index\n * @returns {Float32Array}\n */\n getLogits(logits, index) {\n let vocabSize = logits.dims.at(-1);\n\n let logs = /** @type {Float32Array} */(logits.data);\n\n if (index === -1) {\n logs = logs.slice(-vocabSize);\n } else {\n let startIndex = index * vocabSize;\n logs = logs.slice(startIndex, startIndex + vocabSize);\n }\n return logs;\n }\n\n /**\n * Selects an item randomly based on the specified probabilities.\n * @param {Array} probabilities An array of probabilities to use for selection.\n * @returns {number} The index of the selected item.\n */\n randomSelect(probabilities) {\n // Return index of chosen item\n let sumProbabilities = probabilities.reduce((acc, curr) => acc + curr, 0);\n\n let r = Math.random() * sumProbabilities;\n for (let i = 0; i < probabilities.length; ++i) {\n r -= probabilities[i];\n if (r <= 0) {\n return i;\n }\n }\n return 0; // return first (most probable) as a fallback\n }\n\n /**\n * Returns a Sampler object based on the specified options.\n * @param {GenerationConfig} generation_config An object containing options for the sampler.\n * @returns {LogitsSampler} A Sampler object.\n */\n static getSampler(generation_config) {\n // - *greedy decoding*: `num_beams=1` and `do_sample=False`\n // - *contrastive search*: `penalty_alpha>0` and `top_k>1`\n // - *multinomial sampling*: `num_beams=1` and `do_sample=True`\n // - *beam-search decoding*: `num_beams>1` and `do_sample=False`\n // - *beam-search multinomial sampling*: `num_beams>1` and `do_sample=True`\n // - *diverse beam-search decoding*: `num_beams>1` and `num_beam_groups>1`\n // - *constrained beam-search decoding*: `constraints!=None` or `force_words_ids!=None`\n\n // NOTE: beam search is implemented directly into the generation function\n if (generation_config.do_sample) {\n return new MultinomialSampler(generation_config);\n\n } else if (generation_config.num_beams > 1) {\n return new BeamSearchSampler(generation_config);\n\n } else {\n if (generation_config.num_return_sequences > 1) {\n throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${generation_config.num_return_sequences}.`)\n }\n return new GreedySampler(generation_config);\n }\n }\n}\n\n/**\n * Class representing a Greedy Sampler.\n */\nclass GreedySampler extends LogitsSampler {\n /**\n * Sample the maximum probability of a given logits tensor.\n * @param {Tensor} logits\n * @param {number} [index=-1]\n * @returns {[number, number][]} An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search).\n */\n sample(logits, index = -1) {\n // NOTE: no need to do log_softmax here since we only take the maximum\n let logs = this.getLogits(logits, index);\n let argmax = max(logs)[1];\n\n // Note: score is meaningless in this context, since we are performing\n // greedy search (p = 1 => log(p) = 0)\n return [\n [argmax, 0]\n ];\n }\n}\n\n/**\n * Class representing a MultinomialSampler.\n */\nclass MultinomialSampler extends LogitsSampler {\n\n /**\n * Sample from the logits.\n * @param {Tensor} logits\n * @param {number} index\n * @returns {[number, number][]}\n */\n sample(logits, index = -1) {\n let k = logits.dims.at(-1); // defaults to vocab size\n if (this.generation_config.top_k > 0) {\n k = Math.min(this.generation_config.top_k, k);\n }\n\n // Get logits of nth token\n const logs = this.getLogits(logits, index);\n\n // Get top k tokens\n const topLogits = getTopItems(logs, k);\n\n // Compute softmax over logits\n const probabilities = softmax(topLogits.map(x => x[1]));\n\n return Array.from({ length: this.generation_config.num_beams }, () => {\n const sampledIndex = this.randomSelect(probabilities);\n return [\n topLogits[sampledIndex][0], // token id\n Math.log(probabilities[sampledIndex]), // score\n ];\n });\n }\n}\n\n\n/**\n * Class representing a BeamSearchSampler.\n */\nclass BeamSearchSampler extends LogitsSampler {\n\n /**\n * Sample from the logits.\n * @param {Tensor} logits\n * @param {number} index\n * @returns {[number, number][]}\n */\n sample(logits, index = -1) {\n let k = logits.dims.at(-1); // defaults to vocab size\n if (this.generation_config.top_k > 0) {\n k = Math.min(this.generation_config.top_k, k);\n }\n\n // Get logits of nth token\n const logs = this.getLogits(logits, index);\n\n // Get top k tokens\n const topLogits = getTopItems(logs, k);\n\n // Compute softmax over logits\n const probabilities = softmax(topLogits.map(x => x[1]));\n\n return Array.from({ length: this.generation_config.num_beams }, (_, i) => {\n return [\n topLogits[i][0], // token id\n Math.log(probabilities[i]), // score\n ];\n });\n }\n}\n","\n/**\n * @module generation/stopping_criteria\n */\n\nimport { Callable } from \"../utils/generic.js\";\n\n// NOTE:\n// Stopping Criteria returns a list of `batch_size` booleans, indicating whether each sequence in the batch should be stopped.\n\n/**\n * Abstract base class for all stopping criteria that can be applied during generation.\n */\nexport class StoppingCriteria extends Callable {\n /**\n * \n * @param {number[][]} input_ids (`number[][]` of shape `(batch_size, sequence_length)`):\n * Indices of input sequence tokens in the vocabulary.\n * @param {number[][]} scores scores (`number[][]` of shape `(batch_size, config.vocab_size)`):\n * Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax\n * or scores for each vocabulary token after SoftMax.\n * @returns {boolean[]} A list of booleans indicating whether each sequence should be stopped.\n */\n _call(input_ids, scores) {\n throw Error(\"StoppingCriteria needs to be subclassed\");\n }\n}\n/**\n */\nexport class StoppingCriteriaList extends Callable {\n /**\n * Constructs a new instance of `StoppingCriteriaList`.\n */\n constructor() {\n super();\n this.criteria = [];\n }\n\n /**\n * Adds a new stopping criterion to the list.\n *\n * @param {StoppingCriteria} item The stopping criterion to add.\n */\n push(item) {\n this.criteria.push(item);\n }\n\n /**\n * Adds multiple stopping criteria to the list.\n *\n * @param {StoppingCriteriaList|StoppingCriteria[]} items The stopping criteria to add.\n */\n extend(items) {\n if (items instanceof StoppingCriteriaList) {\n items = items.criteria;\n }\n this.criteria.push(...items);\n }\n\n _call(input_ids, scores) {\n const is_done = new Array(input_ids.length).fill(false);\n for (const criterion of this.criteria) {\n const criterion_done = criterion(input_ids, scores);\n for (let i = 0; i < is_done.length; ++i) {\n is_done[i] ||= criterion_done[i];\n }\n }\n return is_done;\n }\n\n [Symbol.iterator]() {\n return this.criteria.values();\n }\n}\n\n/**\n * This class can be used to stop generation whenever the full generated number of tokens exceeds `max_length`.\n * Keep in mind for decoder-only type of transformers, this will include the initial prompted tokens.\n */\nexport class MaxLengthCriteria extends StoppingCriteria {\n\n /**\n * \n * @param {number} max_length The maximum length that the output sequence can have in number of tokens.\n * @param {number} [max_position_embeddings=null] The maximum model length, as defined by the model's `config.max_position_embeddings` attribute.\n */\n constructor(max_length, max_position_embeddings = null) {\n super();\n this.max_length = max_length;\n this.max_position_embeddings = max_position_embeddings;\n }\n\n _call(input_ids) {\n return input_ids.map(ids => ids.length >= this.max_length);\n }\n}\n\n// TODO: add MaxTimeCriteria\n\n/**\n * This class can be used to stop generation whenever the \"end-of-sequence\" token is generated.\n * By default, it uses the `model.generation_config.eos_token_id`.\n */\nexport class EosTokenCriteria extends StoppingCriteria {\n\n /**\n * \n * @param {number|number[]} eos_token_id The id of the *end-of-sequence* token.\n * Optionally, use a list to set multiple *end-of-sequence* tokens.\n */\n constructor(eos_token_id) {\n super();\n if (!Array.isArray(eos_token_id)) {\n eos_token_id = [eos_token_id];\n }\n this.eos_token_id = eos_token_id;\n }\n\n /**\n * \n * @param {number[][]} input_ids \n * @param {number[][]} scores \n * @returns {boolean[]}\n */\n _call(input_ids, scores) {\n return input_ids.map(ids => this.eos_token_id.includes(ids.at(-1)));\n }\n}","\n/**\n * @module generation/streamers\n */\n\nexport class BaseStreamer {\n /**\n * Function that is called by `.generate()` to push new tokens\n * @param {bigint[][]} value \n */\n put(value) {\n throw Error('Not implemented');\n }\n\n /**\n * Function that is called by `.generate()` to signal the end of generation\n */\n end() {\n throw Error('Not implemented');\n }\n}\n","\n/**\n * @file Definitions of all models available in Transformers.js.\n * \n * **Example:** Load and run an `AutoModel`.\n * \n * ```javascript\n * import { AutoModel, AutoTokenizer } from '@xenova/transformers';\n * \n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n * let model = await AutoModel.from_pretrained('Xenova/bert-base-uncased');\n * \n * let inputs = await tokenizer('I love transformers!');\n * let { logits } = await model(inputs);\n * // Tensor {\n * // data: Float32Array(183132) [-7.117443084716797, -7.107812881469727, -7.092104911804199, ...]\n * // dims: (3) [1, 6, 30522],\n * // type: \"float32\",\n * // size: 183132,\n * // }\n * ```\n * \n * We also provide other `AutoModel`s (listed below), which you can use in the same way as the Python library. For example:\n * \n * **Example:** Load and run an `AutoModelForSeq2SeqLM`.\n * ```javascript\n * import { AutoModelForSeq2SeqLM, AutoTokenizer } from '@xenova/transformers';\n * \n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/t5-small');\n * let model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small');\n * \n * let { input_ids } = await tokenizer('translate English to German: I love transformers!');\n * let outputs = await model.generate(input_ids);\n * let decoded = tokenizer.decode(outputs[0], { skip_special_tokens: true });\n * // 'Ich liebe Transformatoren!'\n * ```\n * \n * @module models\n */\n\nimport {\n AutoConfig,\n} from './configs.js';\n\nimport {\n deviceToExecutionProviders,\n createInferenceSession,\n isONNXTensor,\n isONNXProxy,\n} from './backends/onnx.js';\nimport {\n DATA_TYPES,\n DEFAULT_DEVICE_DTYPE_MAPPING,\n DEFAULT_DTYPE_SUFFIX_MAPPING,\n isFp16Supported,\n} from './utils/dtypes.js';\n\nimport {\n Callable,\n} from './utils/generic.js';\n\nimport {\n isIntegralNumber,\n mergeArrays,\n pick,\n} from './utils/core.js';\n\nimport {\n getModelFile,\n getModelJSON,\n} from './utils/hub.js';\n\nimport {\n LogitsProcessorList,\n ForcedBOSTokenLogitsProcessor,\n ForcedEOSTokenLogitsProcessor,\n SuppressTokensAtBeginLogitsProcessor,\n WhisperTimeStampLogitsProcessor,\n NoRepeatNGramLogitsProcessor,\n RepetitionPenaltyLogitsProcessor,\n NoBadWordsLogitsProcessor,\n MinLengthLogitsProcessor,\n MinNewTokensLengthLogitsProcessor,\n\n TemperatureLogitsWarper,\n TopKLogitsWarper,\n TopPLogitsWarper,\n ClassifierFreeGuidanceLogitsProcessor,\n} from './generation/logits_process.js';\n\nimport {\n GenerationConfig,\n} from './generation/configuration_utils.js';\n\nimport {\n cat,\n dynamicTimeWarping,\n full_like,\n mean,\n ones,\n ones_like,\n stack,\n std_mean,\n Tensor,\n zeros_like,\n} from './utils/tensor.js';\n\nimport { medianFilter } from './utils/maths.js';\nimport { EosTokenCriteria, MaxLengthCriteria, StoppingCriteriaList } from './generation/stopping_criteria.js';\nimport { LogitsSampler } from './generation/logits_sampler.js';\n\n//////////////////////////////////////////////////\n// Model types: used internally\nconst MODEL_TYPES = {\n EncoderOnly: 0,\n EncoderDecoder: 1,\n Seq2Seq: 2,\n Vision2Seq: 3,\n DecoderOnly: 4,\n MaskGeneration: 5,\n ImageTextToText: 6,\n Musicgen: 7,\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Helper functions\n\n// NOTE: These will be populated fully later\nconst MODEL_TYPE_MAPPING = new Map();\nconst MODEL_NAME_TO_CLASS_MAPPING = new Map();\nconst MODEL_CLASS_TO_NAME_MAPPING = new Map();\n\n\n/**\n * Constructs an InferenceSession using a model file located at the specified path.\n * @param {string} pretrained_model_name_or_path The path to the directory containing the model file.\n * @param {string} fileName The name of the model file.\n * @param {import('./utils/hub.js').PretrainedModelOptions} options Additional options for loading the model.\n * @returns {Promise<{buffer: Uint8Array, session_options: Object}>} A Promise that resolves to the data needed to create an InferenceSession object.\n * @private\n */\nasync function getSession(pretrained_model_name_or_path, fileName, options) {\n let device = options.device;\n if (device && typeof device !== 'string') {\n if (device.hasOwnProperty(fileName)) {\n device = device[fileName];\n } else {\n console.warn(`Device not specified for ${fileName}. Using the default device.`);\n device = null;\n }\n }\n\n // If the device is not specified, we use the default (supported) execution providers.\n const executionProviders = deviceToExecutionProviders(\n /** @type {import(\"./utils/devices.js\").DeviceType|null} */(device)\n );\n\n // If options.dtype is specified, we use it to choose the suffix for the model file.\n // Otherwise, we use the default dtype for the device.\n let dtype = options.dtype;\n if (typeof dtype !== 'string') {\n if (dtype && dtype.hasOwnProperty(fileName)) {\n dtype = dtype[fileName];\n } else {\n dtype = DEFAULT_DEVICE_DTYPE_MAPPING[executionProviders[0]];\n console.warn(`Dtype not specified for ${fileName}. Using the default dtype: ${dtype}.`);\n }\n }\n\n if (!DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(dtype)) {\n throw new Error(`Invalid dtype: ${dtype}. Should be one of: ${Object.keys(DATA_TYPES).join(', ')}`);\n } else if (dtype === DATA_TYPES.fp16 && !(await isFp16Supported())) {\n throw new Error(`The device does not support fp16.`);\n }\n\n // Construct the model file name\n const suffix = DEFAULT_DTYPE_SUFFIX_MAPPING[dtype];\n const modelFileName = `${options.subfolder ?? ''}/${fileName}${suffix}.onnx`;\n\n const buffer = await getModelFile(pretrained_model_name_or_path, modelFileName, true, options);\n\n const session_options = { ...options.session_options } ?? {};\n\n // Overwrite `executionProviders` if not specified\n session_options.executionProviders ??= executionProviders;\n\n // handle onnx external data files\n if (session_options.externalData !== undefined) {\n for (let i = 0; i < session_options.externalData.length; ++i) {\n const ext = session_options.externalData[i];\n // if the external data is a string, fetch the file and replace the string with its content\n if (typeof ext.data === \"string\") {\n const ext_buffer = await getModelFile(pretrained_model_name_or_path, ext.data, true, options);\n ext.data = ext_buffer;\n }\n }\n }\n\n // TODO: Add support for preferredOutputLocation\n // if (options.device == \"webgpu\") {\n // for (let i = 0; i < config.layers; ++i) {\n // options.session_options.preferredOutputLocation[`present.${i}.key`] = 'gpu-buffer';\n // options.session_options.preferredOutputLocation[`present.${i}.value`] = 'gpu-buffer';\n // }\n // }\n return { buffer, session_options };\n}\n\n/**\n * Helper function to sequentially create multiple InferenceSession objects.\n * NOTE: It is important to create the sessions sequentially, otherwise ORT will throw an error indicating\n * that multiple calls to `initWasm` were made.\n * \n * @param {string} pretrained_model_name_or_path The path to the directory containing the model file.\n * @param {Record} names The names of the model files to load.\n * @param {import('./utils/hub.js').PretrainedModelOptions} options Additional options for loading the model.\n * @returns {Promise>} A Promise that resolves to a dictionary of InferenceSession objects.\n * @private\n */\nasync function constructSessions(pretrained_model_name_or_path, names, options) {\n const keys = Object.keys(names);\n const sessionData = await Promise.all(\n keys.map(async (name) => getSession(pretrained_model_name_or_path, names[name], options))\n );\n\n const sessions = {};\n for (let i = 0; i < keys.length; ++i) {\n const { buffer, session_options } = sessionData[i];\n const session = await createInferenceSession(buffer, session_options);\n sessions[keys[i]] = session;\n }\n return sessions;\n}\n\n/**\n * Validate model inputs\n * @param {Object} session The InferenceSession object that will be run.\n * @param {Object} inputs The inputs to check.\n * @returns {Record} The checked inputs.\n * @throws {Error} If any inputs are missing.\n * @private\n */\nfunction validateInputs(session, inputs) {\n /**\n * NOTE: Create either a shallow or deep copy based on `onnx.wasm.proxy`\n * @type {Record}\n */\n const checkedInputs = Object.create(null);\n const missingInputs = [];\n for (const inputName of session.inputNames) {\n const tensor = inputs[inputName];\n // Rare case where one of the model's input names corresponds to a built-in\n // object name (e.g., toString), which would cause a simple (!tensor) check to fail,\n // because it's not undefined but a function.\n if (!(tensor instanceof Tensor)) {\n missingInputs.push(inputName);\n continue;\n }\n // NOTE: When `env.wasm.proxy is true` the tensor is moved across the Worker\n // boundary, transferring ownership to the worker and invalidating the tensor.\n // So, in this case, we simply sacrifice a clone for it.\n checkedInputs[inputName] = isONNXProxy() ? tensor.clone() : tensor;\n }\n if (missingInputs.length > 0) {\n throw new Error(\n `An error occurred during model execution: \"Missing the following inputs: ${missingInputs.join(', ')}.`);\n }\n\n const numInputsProvided = Object.keys(inputs).length;\n const numInputsNeeded = session.inputNames.length;\n if (numInputsProvided > numInputsNeeded) {\n // No missing inputs, but too many inputs were provided.\n // Warn the user and ignore the extra inputs.\n let ignored = Object.keys(inputs).filter(inputName => !session.inputNames.includes(inputName));\n console.warn(`WARNING: Too many inputs were provided (${numInputsProvided} > ${numInputsNeeded}). The following inputs will be ignored: \"${ignored.join(', ')}\".`);\n }\n\n return checkedInputs;\n}\n\n/**\n * Executes an InferenceSession using the specified inputs.\n * NOTE: `inputs` must contain at least the input names of the model.\n * - If additional inputs are passed, they will be ignored.\n * - If inputs are missing, an error will be thrown.\n * \n * @param {Object} session The InferenceSession object to run.\n * @param {Object} inputs An object that maps input names to input tensors.\n * @returns {Promise} A Promise that resolves to an object that maps output names to output tensors.\n * @private\n */\nasync function sessionRun(session, inputs) {\n const checkedInputs = validateInputs(session, inputs);\n try {\n // pass the original ort tensor\n const ortFeed = Object.fromEntries(Object.entries(checkedInputs).map(([k, v]) => [k, v.ort_tensor]));\n let output = await session.run(ortFeed);\n output = replaceTensors(output);\n for (const [name, t] of Object.entries(checkedInputs)) {\n // if we use gpu buffers for kv_caches, we own them and need to dispose()\n if (name.startsWith('past_key_values')) {\n t.dispose();\n };\n }\n return output;\n } catch (e) {\n // This usually occurs when the inputs are of the wrong type.\n console.error(`An error occurred during model execution: \"${e}\".`);\n console.error('Inputs given to model:', checkedInputs);\n throw e;\n }\n}\n\n/**\n * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions.\n * @param {Object} obj The object to replace tensor objects in.\n * @returns {Object} The object with tensor objects replaced by custom Tensor objects.\n * @private\n */\nfunction replaceTensors(obj) {\n for (let prop in obj) {\n if (isONNXTensor(obj[prop])) {\n obj[prop] = new Tensor(obj[prop]);\n } else if (typeof obj[prop] === 'object') {\n replaceTensors(obj[prop]);\n }\n }\n return obj;\n}\n\n\n/**\n * Converts an array or Tensor of integers to an int64 Tensor.\n * @param {Array|Tensor} items The input integers to be converted.\n * @returns {Tensor} The int64 Tensor with the converted values.\n * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length.\n * @private\n */\nfunction toI64Tensor(items) {\n if (items instanceof Tensor) {\n return items;\n }\n // items is an array\n if (items.length === 0) {\n throw Error(\"items must be non-empty\");\n }\n\n if (Array.isArray(items[0])) {\n // batched\n if (items.some(x => x.length !== items[0].length)) {\n throw Error(\"Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.\")\n }\n\n return new Tensor('int64',\n BigInt64Array.from(items.flat().map(x => BigInt(x))),\n [items.length, items[0].length]\n );\n } else {\n //flat\n return new Tensor('int64',\n BigInt64Array.from(items.map(x => BigInt(x))),\n [1, items.length]\n );\n }\n}\n\n/**\n * Prepares an attention mask for a sequence of tokens based on configuration options.\n * @param {Object} self The calling object instance.\n * @param {Tensor} tokens The input tokens.\n * @returns {Tensor} The attention mask tensor.\n * @private\n */\nfunction prepareAttentionMask(self, tokens) {\n\n // Prepare attention mask\n let pad_token_id = self.config.pad_token_id ?? null;\n let eos_token_id = self.config.eos_token_id ?? null;\n if (isIntegralNumber(eos_token_id)) {\n eos_token_id = [eos_token_id];\n }\n\n let is_pad_token_in_inputs = tokens.indexOf(pad_token_id) !== -1;\n let is_pad_token_not_equal_to_eos_token_id = (eos_token_id === null) || !eos_token_id.includes(pad_token_id)\n\n if (is_pad_token_in_inputs && is_pad_token_not_equal_to_eos_token_id) {\n let data = BigInt64Array.from(\n // Note: != so that int matches bigint\n // @ts-ignore\n tokens.data.map(x => x != pad_token_id)\n )\n return new Tensor('int64', data, tokens.dims)\n } else {\n return ones_like(tokens);\n }\n}\n\n/**\n * Creates a boolean tensor with a single value.\n * @param {boolean} value The value of the tensor.\n * @returns {Tensor} The boolean tensor.\n * @private\n */\nfunction boolTensor(value) {\n return new Tensor('bool', [value], [1]);\n}\n\n// JS doesn't support mixins, so we define some reused functions here, and allow \"this\" to be passed in\n/**\n * Perform forward pass on the seq2seq model (both encoder and decoder).\n * @param {Object} self The seq2seq model object.\n * @param {Object} model_inputs The input object for the model containing encoder and decoder inputs.\n * @returns {Promise} Promise that resolves with the output of the seq2seq model.\n * @private\n */\nasync function seq2seqForward(self, model_inputs) {\n\n let { encoder_outputs, past_key_values } = model_inputs;\n\n // Encode if needed\n if (!encoder_outputs) {\n const encoder_inputs = pick(model_inputs, self.sessions['model'].inputNames);\n // Encoder outputs are not given, so we must compute them.\n encoder_outputs = (await encoderForward(self, encoder_inputs)).last_hidden_state;\n }\n\n const { input_ids, decoder_input_ids, ...other_decoder_inputs } = model_inputs;\n other_decoder_inputs.input_ids = decoder_input_ids;\n other_decoder_inputs.encoder_hidden_states = encoder_outputs;\n\n if (self.sessions['decoder_model_merged'].inputNames.includes('encoder_attention_mask')) {\n other_decoder_inputs.encoder_attention_mask = model_inputs.attention_mask\n }\n\n const decoderResults = await decoderForward(self, other_decoder_inputs, true);\n\n // Get cross attention and/or decoder attentions if they are present\n // const attns = self.getAttentions(decoderResults);\n\n return decoderResults;\n}\n\n/**\n * Forward pass of an encoder model.\n * @param {Object} self The encoder model.\n * @param {Object} model_inputs The input data to be used for the forward pass.\n * @returns {Promise} Promise that resolves with an object containing the model's outputs.\n * @private\n */\nasync function encoderForward(self, model_inputs) {\n const session = self.sessions['model'];\n const encoderFeeds = Object.create(null);\n for (const key of session.inputNames) {\n encoderFeeds[key] = model_inputs[key];\n }\n if (session.inputNames.includes('token_type_ids') && !encoderFeeds.token_type_ids) {\n // Assign default `token_type_ids` (all zeroes) to the `encoderFeeds` if the model expects it,\n // but they weren't created by the tokenizer.\n encoderFeeds.token_type_ids = new Tensor(\n 'int64',\n new BigInt64Array(encoderFeeds.input_ids.data.length),\n encoderFeeds.input_ids.dims\n )\n }\n return await sessionRun(session, encoderFeeds);\n}\n\n/**\n * Forward pass of a decoder model.\n * @param {Object} self The decoder model.\n * @param {Object} model_inputs The input data to be used for the forward pass.\n * @returns {Promise} Promise that resolves with an object containing the logits and past key values.\n * @private\n */\nasync function decoderForward(self, model_inputs, is_encoder_decoder = false) {\n\n const session = self.sessions[\n is_encoder_decoder ? 'decoder_model_merged' : 'model'\n ]\n\n const { past_key_values, ...new_model_inputs } = model_inputs;\n\n if (session.inputNames.includes('use_cache_branch')) {\n new_model_inputs.use_cache_branch = boolTensor(!!past_key_values);\n }\n\n // Unpack the `past_key_values` object into model inputs\n self.addPastKeyValues(new_model_inputs, past_key_values);\n const fixed = pick(new_model_inputs, session.inputNames);\n return await sessionRun(session, fixed);\n}\n\nfunction decoder_prepare_inputs_for_generation(self, input_ids, model_inputs, generation_config) {\n const session = self.sessions['model'];\n\n if (session.inputNames.includes('position_ids') && model_inputs.attention_mask && !model_inputs.position_ids) {\n // If the model supports providing position_ids, we create position_ids on the fly for batch generation,\n // by computing the cumulative sum of the attention mask along the sequence length dimension.\n // \n // Equivalent to:\n // position_ids = attention_mask.long().cumsum(-1) - 1\n // position_ids.masked_fill_(attention_mask == 0, 1)\n // if past_key_values:\n // position_ids = position_ids[:, -input_ids.shape[1] :]\n const [bz, seq_len] = model_inputs.attention_mask.dims;\n\n const data = new BigInt64Array(model_inputs.attention_mask.data.length);\n for (let i = 0; i < bz; ++i) {\n const start = i * seq_len;\n let sum = BigInt(0);\n for (let j = 0; j < seq_len; ++j) {\n const index = start + j;\n if (model_inputs.attention_mask.data[index] === 0n) {\n data[index] = BigInt(1);\n } else { // === 1n\n data[index] = sum;\n sum += model_inputs.attention_mask.data[index];\n }\n }\n }\n\n model_inputs.position_ids = new Tensor('int64', data, model_inputs.attention_mask.dims);\n if (model_inputs.past_key_values) {\n model_inputs.position_ids = model_inputs.position_ids.slice(null, -1).unsqueeze_(-1);\n }\n }\n\n return model_inputs;\n}\n\nfunction encoder_decoder_prepare_inputs_for_generation(self, input_ids, model_inputs, generation_config) {\n\n // console.log('model_inputs', model_inputs)\n const { ...new_model_inputs } = model_inputs;\n\n const past_key_values = model_inputs.past_key_values;\n // self.addPastKeyValues(new_model_inputs, past_key_values);\n\n if (past_key_values) {\n // keep only final IDs:\n input_ids = input_ids.map(x => [x.at(-1)]);\n } else {\n // input_ids;\n }\n new_model_inputs['decoder_input_ids'] = toI64Tensor(input_ids);\n\n return new_model_inputs;\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n/**\n * A base class for pre-trained models that provides the model configuration and an ONNX session.\n */\nexport class PreTrainedModel extends Callable {\n main_input_name = 'input_ids';\n forward_params = ['input_ids', 'attention_mask'];\n /**\n * Creates a new instance of the `PreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n */\n constructor(config, sessions) {\n super();\n\n this.config = config;\n this.sessions = sessions;\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor);\n const modelType = MODEL_TYPE_MAPPING.get(modelName);\n\n this.can_generate = false;\n this._forward = null;\n\n this._prepare_inputs_for_generation = null;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n this.can_generate = true;\n\n this._forward = decoderForward;\n this._prepare_inputs_for_generation = decoder_prepare_inputs_for_generation;\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq || modelType === MODEL_TYPES.Musicgen) {\n this.can_generate = true;\n\n this._forward = seq2seqForward;\n this._prepare_inputs_for_generation = encoder_decoder_prepare_inputs_for_generation;\n\n } else if (modelType === MODEL_TYPES.EncoderDecoder) {\n // console.warn('TODO: Implement EncoderDecoderForward')\n this._forward = seq2seqForward;\n\n } else if (modelType === MODEL_TYPES.ImageTextToText) {\n this.can_generate = true;\n console.warn('TODO: Implement visionDecoderForward');\n // this._forward = visionDecoderForward;\n } else { // should be MODEL_TYPES.EncoderOnly\n this._forward = encoderForward;\n }\n }\n\n /**\n * Disposes of all the ONNX sessions that were created during inference.\n * @returns {Promise} An array of promises, one for each ONNX session that is being disposed.\n * @todo Use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n async dispose() {\n const promises = [];\n for (let key of Object.keys(this)) {\n let item = this[key];\n // TODO improve check for ONNX session\n if (item?.handler?.dispose !== undefined) {\n promises.push(item.handler.dispose())\n }\n }\n return await Promise.all(promises);\n }\n\n /**\n * Instantiate one of the model classes of the library from a pretrained model.\n * \n * The model class to instantiate is selected based on the `model_type` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained model hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing model weights, e.g., `./my_model_directory/`.\n * @param {import('./utils/hub.js').PretrainedModelOptions} options Additional options for loading the model.\n * \n * @returns {Promise} A new instance of the `PreTrainedModel` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n model_file_name = null,\n subfolder = 'onnx',\n device = null,\n dtype = null,\n session_options = {},\n } = {}) {\n\n let options = {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n model_file_name,\n subfolder,\n device,\n dtype,\n session_options,\n }\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this);\n const modelType = MODEL_TYPE_MAPPING.get(modelName);\n\n let info;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n model: options.model_file_name ?? 'model',\n }, options),\n getModelJSON(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq) {\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n model: 'encoder_model',\n decoder_model_merged: 'decoder_model_merged',\n }, options),\n getModelJSON(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.MaskGeneration) {\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n model: 'vision_encoder',\n prompt_encoder_mask_decoder: 'prompt_encoder_mask_decoder',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.EncoderDecoder) {\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n model: 'encoder_model',\n decoder_model_merged: 'decoder_model_merged',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.ImageTextToText) {\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n embed_tokens: 'embed_tokens',\n vision_encoder: 'vision_encoder',\n decoder_model_merged: 'decoder_model_merged',\n }, options),\n getModelJSON(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.Musicgen) {\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n model: 'text_encoder',\n decoder_model_merged: 'decoder_model_merged',\n encodec_decode: 'encodec_decode',\n }, options),\n getModelJSON(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else { // should be MODEL_TYPES.EncoderOnly\n if (modelType !== MODEL_TYPES.EncoderOnly) {\n console.warn(`Model type for '${modelName ?? config?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n info = await Promise.all([\n AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSessions(pretrained_model_name_or_path, {\n model: options.model_file_name ?? 'model',\n }, options),\n ]);\n }\n\n // @ts-ignore\n return new this(...info);\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Object containing input tensors\n * @returns {Promise} Object containing output tensors\n */\n async _call(model_inputs) {\n return await this.forward(model_inputs);\n }\n\n /**\n * Forward method for a pretrained model. If not overridden by a subclass, the correct forward method\n * will be chosen based on the model type.\n * @param {Object} model_inputs The input data to the model in the format specified in the ONNX model.\n * @returns {Promise} The output data from the model in the format specified in the ONNX model.\n * @throws {Error} This method must be implemented in subclasses.\n */\n async forward(model_inputs) {\n return await this._forward(this, model_inputs);\n }\n\n /**\n * This function returns a [`LogitsProcessorList`] list object that contains all relevant [`LogitsWarper`]\n * instances used for multinomial sampling.\n * @param {GenerationConfig} generation_config The generation config.\n * @returns {LogitsProcessorList} generation_config \n */\n _get_logits_warper(generation_config) {\n\n // instantiate warpers list\n const warpers = new LogitsProcessorList();\n\n if (generation_config.temperature !== null && generation_config.temperature !== 1.0) {\n warpers.push(new TemperatureLogitsWarper(generation_config.temperature));\n }\n if (generation_config.top_k !== null && generation_config.top_k !== 0) {\n // TODO: add min_tokens_to_keep\n warpers.push(new TopKLogitsWarper(generation_config.top_k));\n }\n if (generation_config.top_p !== null && generation_config.top_p < 1.0) {\n // TODO: add min_tokens_to_keep\n warpers.push(new TopPLogitsWarper(generation_config.top_p));\n }\n\n return warpers;\n }\n\n /**\n * @param {GenerationConfig} generation_config \n * @param {number} input_ids_seq_length The starting sequence length for the input ids.\n * @returns {LogitsProcessorList}\n * @private\n */\n _get_logits_processor(\n generation_config,\n input_ids_seq_length,\n // encoder_input_ids, TODO\n // prefix_allowed_tokens_fn, TODO\n logits_processor = null\n ) {\n const processors = new LogitsProcessorList();\n\n // if (generation_config.diversity_penalty !== null && generation_config.diversity_penalty > 0.0) {\n // processors.push(new HammingDiversityLogitsProcessor(\n // generation_config.diversity_penalty,\n // generation_config.num_beams,\n // generation_config.num_beam_groups\n // ));\n // }\n\n // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== 1.0) {\n // processors.push(new EncoderRepetitionPenaltyLogitsProcessor(\n // generation_config.encoder_repetition_penalty,\n // encoder_input_ids\n // ));\n // }\n\n if (generation_config.repetition_penalty !== null && generation_config.repetition_penalty !== 1.0) {\n processors.push(new RepetitionPenaltyLogitsProcessor(generation_config.repetition_penalty));\n }\n\n if (generation_config.no_repeat_ngram_size !== null && generation_config.no_repeat_ngram_size > 0) {\n processors.push(new NoRepeatNGramLogitsProcessor(generation_config.no_repeat_ngram_size));\n }\n\n // if (generation_config.encoder_no_repeat_ngram_size !== null && generation_config.encoder_no_repeat_ngram_size > 0) {\n // if (this.config.is_encoder_decoder) {\n // processors.push(new EncoderNoRepeatNGramLogitsProcessor(\n // generation_config.encoder_no_repeat_ngram_size,\n // encoder_input_ids\n // ));\n // } else {\n // throw new Error(\"It's impossible to use `encoder_no_repeat_ngram_size` with decoder-only architecture\");\n // }\n // }\n\n if (generation_config.bad_words_ids !== null) {\n processors.push(new NoBadWordsLogitsProcessor(generation_config.bad_words_ids, generation_config.eos_token_id));\n }\n\n if (generation_config.min_length !== null && generation_config.eos_token_id !== null && generation_config.min_length > 0) {\n processors.push(new MinLengthLogitsProcessor(generation_config.min_length, generation_config.eos_token_id));\n }\n\n if (generation_config.min_new_tokens !== null && generation_config.eos_token_id !== null && generation_config.min_new_tokens > 0) {\n processors.push(new MinNewTokensLengthLogitsProcessor(\n input_ids_seq_length,\n generation_config.min_new_tokens,\n generation_config.eos_token_id\n ));\n }\n\n // if (prefix_allowed_tokens_fn !== null) {\n // processors.push(new PrefixConstrainedLogitsProcessor(\n // prefix_allowed_tokens_fn,\n // generation_config.num_beams / generation_config.num_beam_groups\n // ));\n // }\n\n\n if (generation_config.forced_bos_token_id !== null) {\n processors.push(new ForcedBOSTokenLogitsProcessor(generation_config.forced_bos_token_id));\n }\n\n if (generation_config.forced_eos_token_id !== null) {\n processors.push(new ForcedEOSTokenLogitsProcessor(\n generation_config.max_length,\n generation_config.forced_eos_token_id\n ));\n }\n\n // if (generation_config.remove_invalid_values === true) {\n // processors.push(new InfNanRemoveLogitsProcessor());\n // }\n\n // if (generation_config.exponential_decay_length_penalty !== null) {\n // processors.push(new ExponentialDecayLengthPenalty(\n // generation_config.exponential_decay_length_penalty,\n // generation_config.eos_token_id,\n // input_ids_seq_length\n // ));\n // }\n\n // if (generation_config.suppress_tokens !== null) {\n // processors.push(new SuppressTokensLogitsProcessor(generation_config.suppress_tokens));\n // }\n\n if (generation_config.begin_suppress_tokens !== null) {\n let begin_index = (input_ids_seq_length > 1 || generation_config.forced_bos_token_id === null)\n ? input_ids_seq_length\n : input_ids_seq_length + 1;\n\n if (generation_config.forced_decoder_ids !== null) {\n // generation starts after the last token that is forced\n begin_index += generation_config.forced_decoder_ids[generation_config.forced_decoder_ids.length - 1][0];\n }\n processors.push(new SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, begin_index));\n }\n\n // DEPRECATED: https://github.com/huggingface/transformers/pull/29485\n // if (generation_config.forced_decoder_ids !== null) {\n // processors.push(new ForceTokensLogitsProcessor(generation_config.forced_decoder_ids));\n // }\n\n\n // 8. prepare batched CFG externally\n if (generation_config.guidance_scale !== null && generation_config.guidance_scale > 1) {\n processors.push(new ClassifierFreeGuidanceLogitsProcessor(generation_config.guidance_scale));\n }\n\n if (logits_processor !== null) {\n processors.extend(logits_processor)\n }\n\n // `LogitNormalization` should always be the last logit processor, when present\n // if (generation_config.renormalize_logits === true) {\n // processors.push(new LogitNormalization());\n // }\n\n return processors;\n }\n\n /**\n * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation.\n * It first creates an empty `GenerationConfig` object, then it applies the model's own `generation_config` property to it. Finally, if a `generation_config` object was passed in the arguments, it overwrites the corresponding properties in the final config with those of the passed config object.\n * @param {GenerationConfig} generation_config A `GenerationConfig` object containing generation parameters.\n * @param {Object} kwargs Additional generation parameters to be used in place of those in the `generation_config` object.\n * @returns {GenerationConfig} The final generation config object to be used by the model for text generation.\n */\n _prepare_generation_config(generation_config, kwargs) {\n // Create empty generation config (contains defaults)\n // We pass `this.config` so that if `eos_token_id` or `bos_token_id` exist in the model's config, we will use them\n const gen_config = new GenerationConfig(this.config);\n\n // Apply model's generation config, if it exists\n if ('generation_config' in this) {\n Object.assign(gen_config, this.generation_config);\n }\n\n // Next, use any generation config specified by the user\n // when calling `generate`\n if (generation_config) {\n Object.assign(gen_config, generation_config);\n }\n\n // Finally, if any kwargs were passed, use them to overwrite\n if (kwargs) {\n Object.assign(gen_config, pick(kwargs, Object.getOwnPropertyNames(gen_config)));\n }\n\n return gen_config;\n }\n\n /**\n * \n * @param {GenerationConfig} generation_config \n * @param {StoppingCriteriaList} [stopping_criteria=null] \n */\n _get_stopping_criteria(generation_config, stopping_criteria = null) {\n const criteria = new StoppingCriteriaList();\n\n if (generation_config.max_length !== null) {\n criteria.push(new MaxLengthCriteria(\n generation_config.max_length,\n this.config.max_position_embeddings ?? null,\n ));\n }\n // if (generation_config.max_time !== null) {\n // criteria.push(new MaxTimeCriteria(generation_config.max_time));\n // }\n if (generation_config.eos_token_id !== null) {\n criteria.push(new EosTokenCriteria(generation_config.eos_token_id));\n }\n\n if (stopping_criteria) {\n criteria.extend(stopping_criteria);\n }\n return criteria;\n\n }\n\n /**\n * Confirms that the model class is compatible with generation.\n * If not, raises an exception that points to the right class to use.\n */\n _validate_model_class() {\n if (!this.can_generate) {\n const generate_compatible_mappings = [\n MODEL_FOR_CAUSAL_LM_MAPPING_NAMES,\n // MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING, // TODO\n MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,\n MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES,\n MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES,\n ];\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor);\n\n const generate_compatible_classes = new Set();\n const modelType = this.config.model_type;\n for (const model_mapping of generate_compatible_mappings) {\n const supported_models = model_mapping.get(modelType);\n if (supported_models) {\n generate_compatible_classes.add(supported_models[0]);\n }\n }\n\n let errorMessage = `The current model class (${modelName}) is not compatible with \\`.generate()\\`, as it doesn't have a language model head.`\n if (generate_compatible_classes.size > 0) {\n errorMessage += ` Please use the following class instead: ${[...generate_compatible_classes].join(', ')}`;\n }\n throw Error(errorMessage);\n }\n }\n\n prepare_inputs_for_generation(...args) {\n return this._prepare_inputs_for_generation(this, ...args);\n }\n\n _update_model_kwargs_for_generation({ generated_input_ids, outputs, model_inputs, is_encoder_decoder }) {\n // update past_key_values\n model_inputs['past_key_values'] = this.getPastKeyValues(outputs, model_inputs.past_key_values);\n\n // update inputs for next run\n model_inputs['input_ids'] = new Tensor('int64', generated_input_ids, [generated_input_ids.length, 1]);\n\n if (!is_encoder_decoder) {\n // update attention mask\n model_inputs.attention_mask = cat(\n [\n model_inputs.attention_mask,\n ones([model_inputs.attention_mask.dims[0], 1]),\n ], 1\n );\n } else if ('decoder_attention_mask' in model_inputs) {\n // TODO: update decoder attention mask if the model requires it\n }\n\n // force recreate position_ids in next iteration\n model_inputs['position_ids'] = null;\n\n return model_inputs;\n }\n\n /**\n * This function extracts the model-specific `inputs` for generation.\n * @param {Object} params\n * @param {Tensor} [params.inputs=null]\n * @param {number} [params.bos_token_id=null]\n * @param {Record} [params.model_kwargs]\n * @returns {{inputs_tensor: Tensor, model_inputs: Record, model_input_name: string}} The model-specific inputs for generation.\n */\n _prepare_model_inputs({ inputs, bos_token_id, model_kwargs }) {\n const model_inputs = pick(model_kwargs, this.forward_params);\n // console.log('model_inputs', model_inputs)\n const input_name = this.main_input_name;\n if (input_name in model_inputs) {\n if (inputs) {\n throw new Error(\n \"`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. \" +\n \"Make sure to either pass {inputs} or {input_name}=...\"\n );\n }\n } else {\n model_inputs[input_name] = inputs;\n }\n\n const inputs_tensor = model_inputs[input_name];\n\n return { inputs_tensor, model_inputs, model_input_name: input_name };\n }\n\n async _prepare_encoder_decoder_kwargs_for_generation({ inputs_tensor, model_inputs, model_input_name, generation_config }) {\n const encoder_kwargs = pick(model_inputs, this.sessions['model'].inputNames);\n\n let { last_hidden_state } = await encoderForward(this, encoder_kwargs);\n\n // for classifier free guidance we need to add a 'null' input to our encoder hidden states\n if (generation_config.guidance_scale !== null && generation_config.guidance_scale > 1) {\n\n last_hidden_state = cat([\n last_hidden_state,\n full_like(last_hidden_state, 0.0),\n ], 0);\n\n if ('attention_mask' in model_inputs) {\n model_inputs['attention_mask'] = cat([\n model_inputs['attention_mask'],\n zeros_like(model_inputs['attention_mask']),\n ], 0);\n }\n }\n model_inputs['encoder_outputs'] = last_hidden_state;\n\n return model_inputs;\n }\n\n /**\n * Prepares `decoder_input_ids` for generation with encoder-decoder models\n * @param {*} param0 \n */\n _prepare_decoder_input_ids_for_generation({ batch_size, model_input_name, model_kwargs, decoder_start_token_id, bos_token_id, generation_config }) {\n\n decoder_start_token_id = decoder_start_token_id ?? bos_token_id;\n\n let decoder_input_ids_start_data;\n if (this.config.model_type === 'musicgen') {\n // Custom logic\n // TODO: move to Musicgen class\n decoder_input_ids_start_data =\n new Array(batch_size * this.config.decoder.num_codebooks)\n .fill(decoder_start_token_id);\n\n } else if (Array.isArray(decoder_start_token_id)) {\n if (decoder_start_token_id.length !== batch_size) {\n throw new Error(\n `\\`decoder_start_token_id\\` expcted to have length ${batch_size} but got ${decoder_start_token_id.length}`\n )\n }\n // TODO: support list of start tokens?\n decoder_input_ids_start_data = decoder_start_token_id;\n } else {\n decoder_input_ids_start_data = new Array(batch_size).fill(decoder_start_token_id);\n }\n const decoder_input_ids_start = new Tensor(\n 'int64',\n decoder_input_ids_start_data,\n [decoder_input_ids_start_data.length, 1],\n );\n\n // TODO add other functionality\n const decoder_input_ids = decoder_input_ids_start;\n model_kwargs['decoder_attention_mask'] = ones_like(decoder_input_ids);\n\n return { input_ids: decoder_input_ids, model_inputs: model_kwargs };\n }\n\n /**\n * Generates sequences of token ids for models with a language modeling head.\n * @param {import('./generation/parameters.js').GenerationFunctionParameters} options\n * @returns {Promise} The output of the model, which can contain the generated token ids, attentions, and scores.\n */\n async generate({\n inputs = null,\n generation_config = null,\n logits_processor = null,\n stopping_criteria = null,\n streamer = null,\n\n // inputs_attention_mask = null,\n ...kwargs\n }) {\n this._validate_model_class();\n\n // Update generation config with defaults and kwargs\n generation_config = this._prepare_generation_config(generation_config, kwargs);\n\n // 3. Define model inputs\n let { inputs_tensor, model_inputs, model_input_name } = this._prepare_model_inputs({\n inputs,\n model_kwargs: kwargs,\n });\n\n const is_encoder_decoder = this.config.is_encoder_decoder;\n\n // 4. Define other model kwargs\n if (!is_encoder_decoder) {\n // decoder-only models should use left-padding for generation\n } else if (!('encoder_outputs' in model_inputs)) {\n // if model is encoder decoder encoder_outputs are created\n // and added to `model_kwargs`\n model_inputs = await this._prepare_encoder_decoder_kwargs_for_generation(\n { inputs_tensor, model_inputs, model_input_name, generation_config }\n )\n }\n\n // 5. Prepare `input_ids` which will be used for auto-regressive generation\n // TODO: Update to align with HF transformers' implementation\n let input_ids;\n if (is_encoder_decoder) {\n // Generating from the encoder outputs\n\n ({ input_ids, model_inputs } = this._prepare_decoder_input_ids_for_generation({\n batch_size: model_inputs[model_input_name].dims.at(0),\n model_input_name,\n model_kwargs: model_inputs,\n decoder_start_token_id: generation_config.decoder_start_token_id,\n bos_token_id: generation_config.bos_token_id,\n generation_config,\n }));\n } else {\n input_ids = model_inputs[model_input_name]\n }\n\n // 6. Prepare `max_length` depending on other stopping criteria.\n let input_ids_length = input_ids.dims.at(-1);\n\n if (generation_config.max_new_tokens !== null) {\n generation_config.max_length = input_ids_length + generation_config.max_new_tokens;\n }\n\n // input_ids_length = model_inputs[model_input_name].dims.at(1);\n // // inputs instanceof Tensor ? : inputs.length;\n\n // // decoder-only\n // if (input_ids_length === 0) {\n // throw Error(\"Must supply a non-empty array of input token ids.\")\n // }\n\n // let decoder_input_ids =\n // generation_config.decoder_input_ids\n // ?? generation_config.decoder_start_token_id\n // ?? generation_config.bos_token_id\n // ?? generation_config.eos_token_id;\n\n // Update logits processor\n // 8. prepare distribution pre_processing samplers\n const prepared_logits_processor = this._get_logits_processor(\n generation_config,\n input_ids_length,\n logits_processor,\n )\n\n // 9. prepare stopping criteria\n const prepared_stopping_criteria = this._get_stopping_criteria(\n generation_config, stopping_criteria\n )\n\n // /** @type {number[]} */\n // let eos_token_ids = generation_config.eos_token_id;\n // if (eos_token_ids !== null && !Array.isArray(eos_token_ids)) {\n // eos_token_ids = [eos_token_ids];\n // }\n\n const numInputs = model_inputs[model_input_name].dims.at(0);\n\n // TODO:\n // done is a list of booleans to keep track of which inputs are done\n // const done = new Array(numInputs).fill(false);\n // For efficiency purposes, we remove completed rows from model_inputs\n // when the beam is complete, and we keep track of the row index\n // const rowIndexToBatchIndex = new Map();\n\n const sampler = LogitsSampler.getSampler(generation_config);\n\n // TODO make > numInputs\n const scores = new Array(numInputs).fill(0);\n /** @type {bigint[][]} */\n const all_input_ids = input_ids.tolist();\n if (streamer) {\n streamer.put(all_input_ids);\n }\n // const all_generated_input_ids = Array.from({ length: numInputs }, () => []);\n\n // NOTE: For now, we don't support spawning new beams\n // TODO: when we do, we simply copy past key values and accumulate into single large tensor\n\n ////////////////////////////////////////////////////\n // Generic search which handles 4 generation modes:\n // - GenerationMode.GREEDY_SEARCH\n // - GenerationMode.SAMPLE\n // - GenerationMode.BEAM_SEARCH\n // - GenerationMode.BEAM_SAMPLE\n ////////////////////////////////////////////////////\n while (true) {\n // prepare model inputs\n model_inputs = this.prepare_inputs_for_generation(all_input_ids, model_inputs, generation_config);\n\n const outputs = await this.forward(model_inputs);\n\n // Logits are of the form [batch_size, out_seq_length, vocab_size]\n // In most cases, this will be [batch_size, 1, vocab_size]\n // So, we select the last token's logits:\n // (equivalent to `logits = outputs.logits[:, -1, :]`)\n const logits = outputs.logits.slice(null, -1, null);\n\n const next_tokens_scores = prepared_logits_processor(all_input_ids, logits);\n\n // only for this batch\n const generated_input_ids = [];\n // const new_kv_cache = [];// NOTE: Only used for beam search when concatenating new kv\n // Loop over each batch\n for (let batch_idx = 0; batch_idx < next_tokens_scores.dims.at(0); ++batch_idx) {\n const logs = next_tokens_scores[batch_idx];\n\n const sampledTokens = sampler(logs);\n for (const [newTokenId, logProb] of sampledTokens) {\n const bigint = BigInt(newTokenId);\n // TODO: If branching, use previous beam as a starting point\n // update generated ids, model inputs, and length for next step\n scores[batch_idx] += logProb;\n all_input_ids[batch_idx].push(bigint);\n generated_input_ids.push(bigint);\n }\n }\n if (streamer) {\n streamer.put(all_input_ids);\n }\n\n const stop = prepared_stopping_criteria(all_input_ids);\n if (stop.every(x => x)) {\n break;\n }\n\n model_inputs = this._update_model_kwargs_for_generation({\n generated_input_ids, outputs, model_inputs, is_encoder_decoder,\n })\n }\n\n if (streamer) {\n streamer.end();\n }\n\n // TODO: ensure all_input_ids is padded correctly...\n return new Tensor('int64', all_input_ids.flat(), [all_input_ids.length, all_input_ids[0].length]);\n\n // TODO:\n // let numOutputTokens = 1;\n // const maxOutputTokens = numOutputTokens + (generation_config.max_new_tokens ?? Infinity);\n\n // // Only use max length if max_new_tokens is not provided\n // const useMaxLength = Number.isInteger(generation_config.max_length) && (generation_config.max_new_tokens ?? null) === null;\n\n // // console.log('inputs', inputs)\n // let beams = this.getStartBeams(inputs, generation_config, numOutputTokens, inputs_attention_mask);\n\n // while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) {\n // let newest_beams = [];\n // for (let beam of beams) {\n // if (beam.done) {\n // // Add this beam back into the pool\n // newest_beams.push(beam);\n // continue\n // }\n // if (useMaxLength && beam.output_token_ids.length >= generation_config.max_length) {\n // // Set this beam to done and add it back into the pool\n // beam.done = true;\n // newest_beams.push(beam);\n // continue\n // }\n\n // // TODO generalize\n // let output = await this.runBeam(beam);\n\n\n // // add attentions/scores to beam only if user requested\n // if (generation_config.output_attentions) {\n // this.addAttentionsToBeam(beam, output);\n // }\n // if (generation_config.output_scores) {\n // // TODO add\n // }\n\n // let logits = output.logits.slice(null, -1, null);\n\n // // Apply logits processor\n // logits_processor(beam.output_token_ids, logits);\n\n // let sampledTokens = sampler(logits);\n // for (let [newTokenId, logProb] of sampledTokens) {\n // // use previous beam as a starting point\n // let newBeam = { ...beam };\n\n // // update new beam\n // // @ts-ignore\n // this.updateBeam(newBeam, newTokenId);\n\n // newBeam.score += logProb;\n\n // if (eos_token_ids && eos_token_ids.includes(newTokenId)) {\n // newBeam.done = true;\n // }\n\n // newest_beams.push(newBeam);\n // }\n // }\n // ++numOutputTokens;\n\n // // Next, we get the best beams, per ID\n // newest_beams = this.groupBeams(newest_beams).map(\n // group => group\n // .sort((a, b) => b.score - a.score) // sort by score\n // .slice(0, generation_config.num_beams) // remove outside beam width\n // );\n\n // // Flatten beams\n // beams = newest_beams.flat();\n\n // // Run callback\n // if (generation_config.callback_function) {\n // throw new Error(\"Callback function not yet implemented\")\n // generation_config.callback_function(beams);\n // }\n // }\n\n // // TODO: Ensure that we can return non-batched outputs\n\n // const groupedBeams = this.groupBeams(beams);\n\n // const getFlattened = (key) => groupedBeams.map(\n // batch => {\n // if (generation_config.num_return_sequences > 1) {\n // return batch.slice(0, generation_config.num_return_sequences).map(x => x[key]);\n // } else {\n // return [batch[0][key]];\n // }\n // }\n // ).flat(); // Flatten across batches (depth=1)\n\n // const sequences = getFlattened('output_token_ids'); // [1, seqLength]\n\n // if (generation_config.return_dict_in_generate) {\n // // NOTE: `decoder_attentions` and `cross_attentions` should be:\n // // list (one element for each generated token)\n // // of list (one element for each layer of the decoder)\n // // of torch.FloatTensor of shape (batch_size, num_heads, generated_length, sequence_length)\n // // However, since we are only generating one batch at a time, they are of the form:\n // // list (batches)\n // // of list (one element for each generated token)\n // // of list (one element for each layer of the decoder)\n // // of torch.FloatTensor of shape (1, num_heads, generated_length, sequence_length)\n // // \n // // TODO: In future (when true parallelism, we should be able to return the correct shape)\n\n // const decoder_attentions = getFlattened('decoder_attentions');\n // const cross_attentions = getFlattened('cross_attentions');\n\n // return {\n // sequences,\n\n // decoder_attentions,\n // cross_attentions,\n // }\n // } else {\n // return sequences;\n // }\n }\n\n /**\n * Helper function to add attentions to beam\n * @param {Object} beam \n * @param {Object} output\n * @private \n */\n addAttentionsToBeam(beam, output) {\n if (this.config.is_encoder_decoder) {\n if (!output.cross_attentions || output.cross_attentions.length === 0) {\n throw Error(\n \"`output_attentions` is true, but the model did not produce cross-attentions. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n if (!beam.cross_attentions) {\n beam.cross_attentions = [];\n }\n beam.cross_attentions.push(output.cross_attentions);\n }\n\n if (!output.decoder_attentions || output.decoder_attentions.length === 0) {\n throw Error(\n \"`output_attentions` is true, but the model did not produce decoder-attentions. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n if (!beam.decoder_attentions) {\n beam.decoder_attentions = [];\n }\n beam.decoder_attentions.push(output.decoder_attentions);\n }\n\n /**\n * Groups an array of beam objects by their ids.\n *\n * @param {Array} beams The array of beam objects to group.\n * @returns {Array} An array of arrays, where each inner array contains beam objects with the same id.\n */\n groupBeams(beams) {\n // Group beams by their ids\n const groups = Object.create(null);\n for (const obj of beams) {\n if (groups[obj.id] === undefined) {\n groups[obj.id] = [obj];\n } else {\n groups[obj.id].push(obj);\n }\n }\n\n return Object.values(groups);\n }\n\n /**\n * Returns an object containing past key values from the given decoder results object.\n *\n * @param {Object} decoderResults The decoder results object.\n * @param {Object} pastKeyValues The previous past key values.\n * @returns {Object} An object containing past key values.\n */\n getPastKeyValues(decoderResults, pastKeyValues) {\n const pkvs = Object.create(null);\n\n for (const name in decoderResults) {\n if (name.startsWith('present')) {\n let newName = name.replace('present', 'past_key_values');\n\n if (pastKeyValues && name.includes('encoder')) {\n // Optimization introduced by optimum to reuse past key values. So, we just replace the constant\n // outputs with the previous past key values.\n // https://github.com/huggingface/optimum/blob/0bf2c05fb7e1182b52d21b703cfc95fd9e4ea3dc/optimum/onnxruntime/base.py#L677-L704\n pkvs[newName] = pastKeyValues[newName];\n } else {\n pkvs[newName] = decoderResults[name];\n }\n }\n }\n return pkvs;\n }\n\n /**\n * Returns an object containing attentions from the given decoder results object.\n *\n * @param {Object} decoderResults The decoder results object.\n * @returns {Object} An object containing attentions.\n */\n getAttentions(decoderResults) {\n const attns = Object.create(null);\n\n for (const attnName of ['cross_attentions', 'decoder_attentions']) {\n const result = [];\n for (const name in decoderResults) {\n if (name.startsWith(attnName)) {\n const index = name.split('.').pop()\n result[index] = decoderResults[name];\n }\n }\n attns[attnName] = result;\n }\n return attns;\n }\n\n /**\n * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.\n *\n * @param {Object} decoderFeeds The decoder feeds object to add past key values to.\n * @param {Object} pastKeyValues An object containing past key values.\n */\n addPastKeyValues(decoderFeeds, pastKeyValues) {\n if (pastKeyValues) {\n Object.assign(decoderFeeds, pastKeyValues)\n } else {\n // TODO support batches (i.e., batch_size > 1)\n const batch_size = 1;\n const dtype = 'float32'; // this.config.precision || \n const empty = [];\n // (dtype === 'float16') ? new Uint16Array() : [];\n\n // @ts-ignore\n if (this.config.is_encoder_decoder && (this.add_encoder_pkv ?? true)) {\n // @ts-ignore\n let encoder_dims = [batch_size, this.num_encoder_heads, 0, this.encoder_dim_kv];\n // @ts-ignore\n let decoder_dims = [batch_size, this.num_decoder_heads, 0, this.decoder_dim_kv];\n // @ts-ignore\n for (let i = 0; i < this.num_decoder_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.encoder.key`] = new Tensor(dtype, empty, encoder_dims)\n decoderFeeds[`past_key_values.${i}.encoder.value`] = new Tensor(dtype, empty, encoder_dims)\n decoderFeeds[`past_key_values.${i}.decoder.key`] = new Tensor(dtype, empty, decoder_dims)\n decoderFeeds[`past_key_values.${i}.decoder.value`] = new Tensor(dtype, empty, decoder_dims)\n }\n } else if (this.config.model_type === 'falcon') {\n // NOTE: Custom implementation for Falcon\n // @ts-ignore\n let dims = [batch_size * this.num_heads, 0, this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new Tensor(dtype, empty, dims)\n decoderFeeds[`past_key_values.${i}.value`] = new Tensor(dtype, empty, dims)\n }\n } else if (this.config.multi_query) { // e.g., for `gpt_bigcode`\n // @ts-ignore\n let dims = [batch_size * this.num_heads, 0, 2 * this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key_value`] = new Tensor(dtype, empty, dims)\n }\n } else if (this.config.model_type === 'bloom') {\n // NOTE: Custom implementation for Bloom\n\n // @ts-ignore\n let keyDims = [batch_size * this.num_heads, this.dim_kv, 0] // [batch_size x num_heads,64,past_sequence_length]\n // @ts-ignore\n let valueDims = [batch_size * this.num_heads, 0, this.dim_kv] // [batch_size x num_heads,past_sequence_length,64]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new Tensor(dtype, empty, keyDims)\n decoderFeeds[`past_key_values.${i}.value`] = new Tensor(dtype, empty, valueDims)\n }\n } else { // Decoder-only\n // @ts-ignore\n let dims = [batch_size, this.num_heads, 0, this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new Tensor(dtype, empty, dims)\n decoderFeeds[`past_key_values.${i}.value`] = new Tensor(dtype, empty, dims)\n }\n }\n }\n }\n}\n\n//////////////////////////////////////////////////\n// Base model output class\nexport class ModelOutput { }\n\n/**\n * Base class for model's outputs, with potential hidden states and attentions.\n */\nexport class BaseModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.last_hidden_state Sequence of hidden-states at the output of the last layer of the model.\n * @param {Tensor} [output.hidden_states] Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.\n * @param {Tensor} [output.attentions] Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads.\n */\n constructor({ last_hidden_state, hidden_states = null, attentions = null }) {\n super();\n this.last_hidden_state = last_hidden_state;\n this.hidden_states = hidden_states;\n this.attentions = attentions;\n }\n}\n//////////////////////////////////////////////////\n// Bert models\nexport class BertPreTrainedModel extends PreTrainedModel { }\nexport class BertModel extends BertPreTrainedModel { }\n\n/**\n * BertForMaskedLM is a class representing a BERT model for masked language modeling.\n */\nexport class BertForMaskedLM extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForSequenceClassification is a class representing a BERT model for sequence classification.\n */\nexport class BertForSequenceClassification extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForTokenClassification is a class representing a BERT model for token classification.\n */\nexport class BertForTokenClassification extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForQuestionAnswering is a class representing a BERT model for question answering.\n */\nexport class BertForQuestionAnswering extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// NomicBert models\nexport class NomicBertPreTrainedModel extends PreTrainedModel { }\nexport class NomicBertModel extends NomicBertPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// RoFormer models\nexport class RoFormerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare RoFormer Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class RoFormerModel extends RoFormerPreTrainedModel { }\n\n/**\n * RoFormer Model with a `language modeling` head on top.\n */\nexport class RoFormerForMaskedLM extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class RoFormerForSequenceClassification extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nexport class RoFormerForTokenClassification extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nexport class RoFormerForQuestionAnswering extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n// TODO: Add RoFormerForCausalLM and RoFormerForMultipleChoice\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// ConvBert models\nexport class ConvBertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvBERT Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class ConvBertModel extends ConvBertPreTrainedModel { }\n\n/**\n * ConvBERT Model with a language modeling head on top.\n */\nexport class ConvBertForMaskedLM extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class ConvBertForSequenceClassification extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nexport class ConvBertForTokenClassification extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`)\n */\nexport class ConvBertForQuestionAnswering extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Electra models\nexport class ElectraPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Electra Model transformer outputting raw hidden-states without any specific head on top.\n * Identical to the BERT model except that it uses an additional linear layer between the embedding\n * layer and the encoder if the hidden size and embedding size are different.\n */\nexport class ElectraModel extends ElectraPreTrainedModel { }\n// TODO add ElectraForPreTraining\n/**\n * Electra model with a language modeling head on top.\n */\nexport class ElectraForMaskedLM extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class ElectraForSequenceClassification extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Electra model with a token classification head on top.\n */\nexport class ElectraForTokenClassification extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * LECTRA Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nexport class ElectraForQuestionAnswering extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CamemBERT models\nexport class CamembertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare CamemBERT Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class CamembertModel extends CamembertPreTrainedModel { }\n\n/**\n * CamemBERT Model with a `language modeling` head on top.\n */\nexport class CamembertForMaskedLM extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g. for GLUE tasks.\n */\nexport class CamembertForSequenceClassification extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nexport class CamembertForTokenClassification extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model with a span classification head on top for extractive question-answering tasks\n */\nexport class CamembertForQuestionAnswering extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DeBERTa models\nexport class DebertaPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DeBERTa Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class DebertaModel extends DebertaPreTrainedModel { }\n\n/**\n * DeBERTa Model with a `language modeling` head on top.\n */\nexport class DebertaForMaskedLM extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class DebertaForSequenceClassification extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nexport class DebertaForTokenClassification extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear\n * layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nexport class DebertaForQuestionAnswering extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DeBERTa-v2 models\nexport class DebertaV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DeBERTa-V2 Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class DebertaV2Model extends DebertaV2PreTrainedModel { }\n\n/**\n * DeBERTa-V2 Model with a `language modeling` head on top.\n */\nexport class DebertaV2ForMaskedLM extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class DebertaV2ForSequenceClassification extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nexport class DebertaV2ForTokenClassification extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear\n * layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nexport class DebertaV2ForQuestionAnswering extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DistilBert models\nexport class DistilBertPreTrainedModel extends PreTrainedModel { }\nexport class DistilBertModel extends DistilBertPreTrainedModel { }\n\n/**\n * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification.\n */\nexport class DistilBertForSequenceClassification extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification.\n */\nexport class DistilBertForTokenClassification extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n\n/**\n * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering.\n */\nexport class DistilBertForQuestionAnswering extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task.\n */\nexport class DistilBertForMaskedLM extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// ESM models\nexport class EsmPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ESM Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class EsmModel extends EsmPreTrainedModel { }\n\n/**\n * ESM Model with a `language modeling` head on top.\n */\nexport class EsmForMaskedLM extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class EsmForSequenceClassification extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ESM Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nexport class EsmForTokenClassification extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MobileBert models\nexport class MobileBertPreTrainedModel extends PreTrainedModel { }\nexport class MobileBertModel extends MobileBertPreTrainedModel { }\n\n/**\n * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task.\n */\nexport class MobileBertForMaskedLM extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class MobileBertForSequenceClassification extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MobileBert Model with a span classification head on top for extractive question-answering tasks\n */\nexport class MobileBertForQuestionAnswering extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MPNet models\nexport class MPNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MPNet Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class MPNetModel extends MPNetPreTrainedModel { }\n\n/**\n * MPNetForMaskedLM is a class representing a MPNet model for masked language modeling.\n */\nexport class MPNetForMaskedLM extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForSequenceClassification is a class representing a MPNet model for sequence classification.\n */\nexport class MPNetForSequenceClassification extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForTokenClassification is a class representing a MPNet model for token classification.\n */\nexport class MPNetForTokenClassification extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForQuestionAnswering is a class representing a MPNet model for question answering.\n */\nexport class MPNetForQuestionAnswering extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// SqueezeBert models\nexport class SqueezeBertPreTrainedModel extends PreTrainedModel { }\nexport class SqueezeBertModel extends SqueezeBertPreTrainedModel { }\nexport class SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\nexport class SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nexport class SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Albert models\nexport class AlbertPreTrainedModel extends PreTrainedModel { }\nexport class AlbertModel extends AlbertPreTrainedModel { }\nexport class AlbertForSequenceClassification extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nexport class AlbertForQuestionAnswering extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\nexport class AlbertForMaskedLM extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// T5 models\nexport class T5PreTrainedModel extends PreTrainedModel {\n forward_params = ['input_ids', 'attention_mask', 'encoder_outputs', 'decoder_input_ids', 'decoder_attention_mask', 'past_key_values'];\n\n /**\n * Creates a new instance of the `T5PreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n};\n\nexport class T5Model extends T5PreTrainedModel { }\n\n/**\n * T5Model is a class representing a T5 model for conditional generation.\n */\nexport class T5ForConditionalGeneration extends T5PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LONGT5 models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nexport class LongT5PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `LongT5ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n};\n\n/**\n * The bare LONGT5 Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class LongT5Model extends LongT5PreTrainedModel { }\n\n/**\n * LONGT5 Model with a `language modeling` head on top.\n */\nexport class LongT5ForConditionalGeneration extends LongT5PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MT5 models\nexport class MT5PreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `MT5ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n};\n\nexport class MT5Model extends MT5PreTrainedModel { }\n\n/**\n * A class representing a conditional sequence-to-sequence model based on the MT5 architecture.\n */\nexport class MT5ForConditionalGeneration extends MT5PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Bart models\nexport class BartPretrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `BartForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\n/**\n * The bare BART Model outputting raw hidden-states without any specific head on top.\n */\nexport class BartModel extends BartPretrainedModel { }\n\n/**\n * The BART Model with a language modeling head. Can be used for summarization.\n */\nexport class BartForConditionalGeneration extends BartPretrainedModel { }\n\n/**\n * Bart model with a sequence classification/head on top (a linear layer on top of the pooled output)\n */\nexport class BartForSequenceClassification extends BartPretrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MBart models\nexport class MBartPreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `MBartForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\n/**\n * The bare MBART Model outputting raw hidden-states without any specific head on top.\n */\nexport class MBartModel extends MBartPreTrainedModel { }\n\n/**\n * The MBART Model with a language modeling head. Can be used for summarization, after fine-tuning the pretrained models.\n */\nexport class MBartForConditionalGeneration extends MBartPreTrainedModel { }\n\n/**\n * MBart model with a sequence classification/head on top (a linear layer on top of the pooled output).\n */\nexport class MBartForSequenceClassification extends MBartPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n\nexport class MBartForCausalLM extends MBartPreTrainedModel {\n /**\n * Creates a new instance of the `MBartForCausalLM` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions, generation_config);\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Blenderbot models\nexport class BlenderbotPreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `BlenderbotForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\n/**\n * The bare Blenderbot Model outputting raw hidden-states without any specific head on top.\n */\nexport class BlenderbotModel extends BlenderbotPreTrainedModel { }\n\n/**\n * The Blenderbot Model with a language modeling head. Can be used for summarization.\n */\nexport class BlenderbotForConditionalGeneration extends BlenderbotPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Blenderbot models\nexport class BlenderbotSmallPreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `BlenderbotForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\n/**\n * The bare BlenderbotSmall Model outputting raw hidden-states without any specific head on top.\n */\nexport class BlenderbotSmallModel extends BlenderbotSmallPreTrainedModel { }\n\n/**\n * The BlenderbotSmall Model with a language modeling head. Can be used for summarization.\n */\nexport class BlenderbotSmallForConditionalGeneration extends BlenderbotSmallPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Roberta models\nexport class RobertaPreTrainedModel extends PreTrainedModel { }\nexport class RobertaModel extends RobertaPreTrainedModel { }\n\n/**\n * RobertaForMaskedLM class for performing masked language modeling on Roberta models.\n */\nexport class RobertaForMaskedLM extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForSequenceClassification class for performing sequence classification on Roberta models.\n */\nexport class RobertaForSequenceClassification extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForTokenClassification class for performing token classification on Roberta models.\n */\nexport class RobertaForTokenClassification extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForQuestionAnswering class for performing question answering on Roberta models.\n */\nexport class RobertaForQuestionAnswering extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// XLM models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nexport class XLMPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare XLM Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class XLMModel extends XLMPreTrainedModel { }\n\n/**\n * The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nexport class XLMWithLMHeadModel extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nexport class XLMForSequenceClassification extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a token classification head on top (a linear layer on top of the hidden-states output)\n */\nexport class XLMForTokenClassification extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a span classification head on top for extractive question-answering tasks\n */\nexport class XLMForQuestionAnswering extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// XLMRoberta models\nexport class XLMRobertaPreTrainedModel extends PreTrainedModel { }\nexport class XLMRobertaModel extends XLMRobertaPreTrainedModel { }\n\n/**\n * XLMRobertaForMaskedLM class for performing masked language modeling on XLMRoberta models.\n */\nexport class XLMRobertaForMaskedLM extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForSequenceClassification class for performing sequence classification on XLMRoberta models.\n */\nexport class XLMRobertaForSequenceClassification extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForTokenClassification class for performing token classification on XLMRoberta models.\n */\nexport class XLMRobertaForTokenClassification extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForQuestionAnswering class for performing question answering on XLMRoberta models.\n */\nexport class XLMRobertaForQuestionAnswering extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Audio Spectrogram Transformer (AST) models\nexport class ASTPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare AST Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class ASTModel extends ASTPreTrainedModel { }\n\n/**\n * Audio Spectrogram Transformer model with an audio classification head on top\n * (a linear layer on top of the pooled output) e.g. for datasets like AudioSet, Speech Commands v2.\n */\nexport class ASTForAudioClassification extends ASTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Whisper models\nexport class WhisperPreTrainedModel extends PreTrainedModel {\n\n requires_attention_mask = false;\n main_input_name = 'input_features';\n forward_params = ['input_features', 'attention_mask', 'decoder_input_ids', 'decoder_attention_mask', 'past_key_values'];\n\n /**\n * Creates a new instance of the `WhisperForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\n/**\n * WhisperModel class for training Whisper models without a language model head.\n */\nexport class WhisperModel extends WhisperPreTrainedModel { }\n\n\nclass WhisperGenerationConfig extends GenerationConfig {\n\n /**\n * Whether to return the timestamps with the text. This enables the `WhisperTimestampsLogitsProcessor`.\n * @type {boolean}\n */\n return_timestamps = null;\n\n /**\n * Whether to return token-level timestamps\n * with the text. This can be used with or without the `return_timestamps` option. To get word-level\n * timestamps, use the tokenizer to group the tokens into words.\n * @type {boolean}\n */\n return_token_timestamps = null;\n\n /**\n * The number of audio frames available in this chunk. This is only used generating word-level timestamps.\n * @type {number}\n */\n num_frames = null;\n\n /**\n * Alignment heads to predict word-level timestamps. This is a list of [layer, head] pairs that\n * select the cross-attention heads that are highly correlated to word-level timing.\n * @type {[number, number][]}\n */\n alignment_heads = null;\n\n /**\n * Task to use for generation, either \"translate\" or \"transcribe\".\n * @type {string}\n */\n task = null;\n\n /**\n * Language token to use for generation, can be either in the form of `<|en|>`, `en` or `english`.\n * You can find all the possible language tokens in the `model.generation_config.lang_to_id` dictionary.\n * @type {string}\n */\n language = null;\n}\n\n/**\n * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.\n */\nexport class WhisperForConditionalGeneration extends WhisperPreTrainedModel {\n\n /**\n * \n * @param {WhisperGenerationConfig} generation_config \n */\n _retrieve_init_tokens(generation_config) {\n const init_tokens = [generation_config.decoder_start_token_id]\n\n throw new Error(\"Not implemented yet\")\n }\n\n /**\n * @typedef {Object} WhisperGenerationSpecificParams\n * @property {WhisperGenerationConfig} generation_config\n */\n\n /**\n * Transcribes or translates log-mel input features to a sequence of auto-regressively generated token ids.\n * @param {import('./generation/parameters.js').GenerationFunctionParameters & {generation_config: WhisperGenerationConfig} & WhisperGenerationConfig} options\n * @returns {Promise} The output of the model, which can contain the generated token ids, attentions, and scores.\n */\n async generate({\n inputs = null,\n generation_config = null,\n logits_processor = null,\n stopping_criteria = null,\n\n // Whisper-specific options\n language = null,\n task = null,\n\n ...kwargs\n }) {\n throw new Error(\"WhisperForConditionalGeneration.generate is not yet in Transformers.js v3.\")\n\n // console.log('inputs', inputs);\n // console.log('kwargs', kwargs);\n // async generate({\n // inputs,\n // },\n // generation_config = null,\n // logits_processor = null,\n // // {\n // // return_timestamps = null,\n // // return_token_timestamps = null,\n // // language = null,\n // // task = null,\n // // } = {},\n // ) {\n // Create generation config object\n // TODO: this doesn't create a WhisperGenerationConfig, it makes a GenerationConfig\n generation_config = this._prepare_generation_config(generation_config);\n\n\n // Whisper has additional options for returning timestamps\n generation_config.return_timestamps ??= false;\n\n // TODO add language and task\n\n if (generation_config.return_timestamps) {\n throw new Error(\"Not implemented yet\")\n // logits_processor = [new WhisperTimeStampLogitsProcessor(generation_config)]\n }\n\n if (generation_config.return_token_timestamps) {\n generation_config.output_attentions = true;\n generation_config.return_dict_in_generate = true;\n\n if (generation_config.task === 'translate') {\n console.warn(\"Token-level timestamps may not be reliable for task 'translate'.\")\n }\n\n if (!generation_config.alignment_heads) {\n throw new Error(\n \"Model generation config has no `alignment_heads`, token-level timestamps not available. \" +\n \"See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.\"\n )\n }\n }\n\n const init_tokens = this._retrieve_init_tokens(generation_config)\n\n // https://github.com/huggingface/transformers/pull/28687/files\n\n const outputs = await super.generate({\n inputs, generation_config, logits_processor, ...kwargs\n });\n\n if (generation_config.return_token_timestamps && generation_config.alignment_heads) {\n outputs[\"token_timestamps\"] = this._extract_token_timestamps(\n outputs,\n generation_config.alignment_heads,\n generation_config.num_frames,\n )\n }\n\n return outputs\n }\n\n /**\n * Calculates token-level timestamps using the encoder-decoder cross-attentions and\n * dynamic time-warping (DTW) to map each output token to a position in the input audio.\n * @param {Object} generate_outputs Outputs generated by the model\n * @param {Tensor[][][]} generate_outputs.cross_attentions The cross attentions output by the model\n * @param {Tensor[][][]} generate_outputs.decoder_attentions The decoder attentions output by the model\n * @param {number[][]} generate_outputs.sequences The sequences output by the model\n * @param {number[][]} alignment_heads Alignment heads of the model\n * @param {number} [num_frames=null] Number of frames in the input audio.\n * @param {number} [time_precision=0.02] Precision of the timestamps in seconds\n * @returns {Tensor} tensor containing the timestamps in seconds for each predicted token\n */\n _extract_token_timestamps(generate_outputs, alignment_heads, num_frames = null, time_precision = 0.02) {\n if (!generate_outputs.cross_attentions) {\n throw new Error(\n \"Model outputs must contain cross attentions to extract timestamps. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n\n let median_filter_width = this.config.median_filter_width;\n if (median_filter_width === undefined) {\n console.warn(\"Model config has no `median_filter_width`, using default value of 7.\")\n median_filter_width = 7;\n }\n\n const batchedMatrices = generate_outputs.cross_attentions.map(batch => {\n // Create a list with `decoder_layers` elements, each a tensor of shape\n // (batch size, attention_heads, output length, input length).\n let cross_attentions = Array.from({ length: this.config.decoder_layers },\n (_, i) => cat(batch.map(x => x[i]), 2)\n );\n\n let weights = stack(alignment_heads.map(([l, h]) => {\n return num_frames\n ? cross_attentions[l].slice(null, h, null, [0, num_frames])\n : cross_attentions[l].slice(null, h);\n }));\n weights = weights.transpose(1, 0, 2, 3)\n\n let [std, calculatedMean] = std_mean(weights, -2, 0, true);\n\n // Normalize and smoothen the weights.\n let smoothedWeights = weights.clone(); // [1, 8, seqLength, 1500]\n\n for (let a = 0; a < smoothedWeights.dims[0]; ++a) {\n let aTensor = smoothedWeights[a]; // [8, seqLength, 1500]\n\n for (let b = 0; b < aTensor.dims[0]; ++b) {\n let bTensor = aTensor[b]; // [seqLength, 1500]\n\n const stdTensor = std[a][b][0]; // [1500]\n const meanTensor = calculatedMean[a][b][0]; // [1500]\n\n for (let c = 0; c < bTensor.dims[0]; ++c) {\n\n let cTensor = bTensor[c]; // [1500]\n for (let d = 0; d < cTensor.data.length; ++d) {\n cTensor.data[d] = (cTensor.data[d] - meanTensor.data[d]) / stdTensor.data[d]\n }\n\n // Apply median filter.\n cTensor.data.set(medianFilter(cTensor.data, median_filter_width))\n }\n }\n }\n\n // Average the different cross-attention heads.\n const matrix = mean(smoothedWeights, 1);\n return matrix;\n });\n\n const timestampsShape = [generate_outputs.sequences.length, generate_outputs.sequences[0].length];\n\n const timestamps = new Tensor(\n 'float32',\n new Float32Array(timestampsShape[0] * timestampsShape[1]),\n timestampsShape\n );\n\n // Perform dynamic time warping on each element of the batch.\n for (let batch_idx = 0; batch_idx < timestampsShape[0]; ++batch_idx) {\n // NOTE: Since we run only one batch at a time, we can squeeze to get the same dimensions\n // as the python implementation\n const matrix = batchedMatrices[batch_idx].neg().squeeze_(0);\n let [text_indices, time_indices] = dynamicTimeWarping(matrix);\n\n let diffs = Array.from({ length: text_indices.length - 1 }, (v, i) => text_indices[i + 1] - text_indices[i]);\n let jumps = mergeArrays([1], diffs).map(x => !!x); // convert to boolean\n\n let jump_times = [];\n for (let i = 0; i < jumps.length; ++i) {\n if (jumps[i]) {\n jump_times.push(time_indices[i] * time_precision);\n // NOTE: No point in rounding here, since we set to Float32Array later\n }\n }\n timestamps[batch_idx].data.set(jump_times, 1)\n }\n\n return timestamps;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n/**\n * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks\n */\nexport class VisionEncoderDecoderModel extends PreTrainedModel {\n main_input_name = 'pixel_values';\n\n /**\n * Creates a new instance of the `VisionEncoderDecoderModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // Extract configs\n const encoderConfig = this.config.encoder;\n const decoderConfig = this.config.decoder;\n\n // Validate encoder\n const encoderModelType = encoderConfig.model_type;\n const encoderModel =\n MODEL_MAPPING_NAMES_ENCODER_ONLY.get(encoderModelType)\n ?? MODEL_MAPPING_NAMES_ENCODER_DECODER.get(encoderModelType);\n if (!encoderModel) {\n console.warn(`Model type for encoder '${encoderModelType}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);\n }\n\n // Validate decoder\n const decoderModel = MODEL_FOR_CAUSAL_LM_MAPPING_NAMES.get(decoderConfig.model_type);\n if (!decoderModel) {\n throw new Error(`Unable to construct \\`VisionEncoderDecoder\\` due to unsupported decoder: \"${this.config.decoder.model_type}\"`);\n }\n\n // @ts-ignore\n const decoderModelClass = decoderModel[1];\n // @ts-ignore\n const decoder = new decoderModelClass(decoderConfig, { /* No sessions */ }, generation_config);\n\n this.add_encoder_pkv = 'num_decoder_layers' in decoder;\n if (this.add_encoder_pkv) {\n // Decoder is part of an encoder-decoder model\n this.num_decoder_layers = decoder.num_decoder_layers;\n this.num_decoder_heads = decoder.num_decoder_heads;\n this.decoder_dim_kv = decoder.decoder_dim_kv;\n\n this.num_encoder_layers = decoder.num_encoder_layers;\n this.num_encoder_heads = decoder.num_encoder_heads;\n this.encoder_dim_kv = decoder.encoder_dim_kv;\n\n } else {\n // Decoder is a decoder-only model\n this.num_layers = decoder.num_layers;\n this.num_heads = decoder.num_heads;\n this.dim_kv = decoder.dim_kv;\n }\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LLaVa Models\nexport class LlavaPreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n 'past_key_values',\n 'pixel_values',\n 'attention_mask',\n ];\n\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n const decoderConfig = this.config.text_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = decoderConfig.eos_token_id;\n\n this.num_heads = decoderConfig.num_attention_heads;\n this.num_layers = decoderConfig.num_hidden_layers;\n this.dim_kv = decoderConfig.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The LLAVA model which consists of a vision backbone and a language model.\n */\nexport class LlavaForConditionalGeneration extends LlavaPreTrainedModel {\n\n async encode_image({ pixel_values }) {\n // image_inputs === { pixel_values }\n return (await sessionRun(this.sessions['vision_encoder'], { pixel_values })).image_features;\n }\n\n async encode_text({ input_ids }) {\n // text_inputs === { input_ids, attention_mask }\n return (await sessionRun(this.sessions['embed_tokens'], { input_ids })).inputs_embeds;\n }\n\n _merge_input_ids_with_image_features({\n inputs_embeds,\n image_features,\n input_ids,\n attention_mask,\n }) {\n\n const image_token_index = this.config.image_token_index;\n\n const idsList = input_ids.tolist();\n\n // NOTE: we use .findIndex instead of .indexOf to perform weak comparison (==) between BigInt and Number\n const indexOfImage = idsList.map(x => x.findIndex(x => x == image_token_index));\n\n const noImages = indexOfImage.every(x => x === -1);\n const allImages = indexOfImage.every(x => x !== -1);\n if (!noImages && !allImages) {\n // Check for padding reasons\n throw new Error('Every input should contain either 0 or 1 image token.');\n }\n\n if (noImages) {\n return {\n inputs_embeds,\n attention_mask,\n position_ids: null,\n };\n }\n\n let stacked = [];\n let stacked_attention_mask = [];\n for (let i = 0; i < indexOfImage.length; ++i) {\n const index = indexOfImage[i];\n\n const e = inputs_embeds[i];\n const im = image_features[i];\n const am = attention_mask[i];\n stacked.push(\n cat([\n e.slice([0, index]),\n im,\n e.slice([index + 1, e.dims[0]]),\n ], 0)\n );\n\n stacked_attention_mask.push(\n cat([\n am.slice([0, index]),\n ones([im.dims[0]]),\n am.slice([index + 1, am.dims[0]])\n ], 0)\n )\n }\n\n return {\n inputs_embeds: stack(stacked, 0),\n attention_mask: stack(stacked_attention_mask, 0),\n position_ids: null,\n };\n }\n\n prepare_inputs_for_generation(input_ids, model_inputs, generation_config) {\n return model_inputs;\n }\n\n /**\n * \n * @param {Object} params\n * @param {Tensor} [params.input_ids=null]\n * @param {Tensor} [params.attention_mask=null]\n * @param {Tensor} [params.pixel_values=null]\n * @param {Tensor} [params.position_ids=null]\n * @param {Tensor} [params.inputs_embeds=null]\n * @param {Tensor} [params.past_key_values=null]\n * @param {Object} [params.generation_config=null]\n * @param {Object} [params.logits_processor=null]\n * @returns {Promise} The model's output tensor\n */\n async forward({\n // These are produced by the processors:\n input_ids = null,\n attention_mask = null,\n pixel_values = null,\n\n // Used during generation:\n position_ids = null,\n inputs_embeds = null,\n past_key_values = null,\n\n // Generic generation parameters\n generation_config = null,\n logits_processor = null,\n\n // TODO: needed?\n ...kwargs\n }) {\n\n if (!inputs_embeds) {\n // 1. Extract the input embeddings\n inputs_embeds = await this.encode_text({ input_ids });\n\n // 2. Possibly, merge text and images\n if (pixel_values && input_ids.dims[1] !== 1) {\n const image_features = await this.encode_image({ pixel_values });\n\n ({ inputs_embeds, inputs_embeds, attention_mask, position_ids } = this._merge_input_ids_with_image_features({\n image_features,\n inputs_embeds,\n input_ids,\n attention_mask,\n }));\n\n } else if (past_key_values && pixel_values && input_ids.dims[1] === 1) {\n // In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of\n // generation with cache\n const target_length = input_ids.dims[1]; // always 1\n const past_length = Object.values(past_key_values)[0].dims.at(-2);\n\n attention_mask = cat([\n ones([input_ids.dims[0], past_length]),\n attention_mask.slice(null, [attention_mask.dims[1] - target_length, attention_mask.dims[1]]),\n ], 1);\n }\n }\n\n const outputs = await decoderForward(this, {\n inputs_embeds,\n past_key_values,\n attention_mask,\n generation_config,\n logits_processor,\n }, true);\n return outputs;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// CLIP models\nexport class CLIPPreTrainedModel extends PreTrainedModel { }\n\n/**\n * CLIP Text and Vision Model with a projection layers on top\n * \n * **Example:** Perform zero-shot image classification with a `CLIPModel`.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, CLIPModel, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');\n * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * let model = await CLIPModel.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Run tokenization\n * let texts = ['a photo of a car', 'a photo of a football match']\n * let text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Read image and run processor\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * let output = await model({ ...text_inputs, ...image_inputs });\n * // {\n * // logits_per_image: Tensor {\n * // dims: [ 1, 2 ],\n * // data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],\n * // },\n * // logits_per_text: Tensor {\n * // dims: [ 2, 1 ],\n * // data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],\n * // },\n * // text_embeds: Tensor {\n * // dims: [ 2, 512 ],\n * // data: Float32Array(1024) [ ... ],\n * // },\n * // image_embeds: Tensor {\n * // dims: [ 1, 512 ],\n * // data: Float32Array(512) [ ... ],\n * // }\n * // }\n * ```\n */\nexport class CLIPModel extends CLIPPreTrainedModel { }\n\n/**\n * CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)\n * \n * **Example:** Compute text embeddings with `CLIPTextModelWithProjection`.\n * \n * ```javascript\n * import { AutoTokenizer, CLIPTextModelWithProjection } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');\n * const text_model = await CLIPTextModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Run tokenization\n * let texts = ['a photo of a car', 'a photo of a football match'];\n * let text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Compute embeddings\n * const { text_embeds } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 512 ],\n * // type: 'float32',\n * // data: Float32Array(1024) [ ... ],\n * // size: 1024\n * // }\n * ```\n */\nexport class CLIPTextModelWithProjection extends CLIPPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)\n * \n * **Example:** Compute vision embeddings with `CLIPVisionModelWithProjection`.\n * \n * ```javascript\n * import { AutoProcessor, CLIPVisionModelWithProjection, RawImage} from '@xenova/transformers';\n * \n * // Load processor and vision model\n * const processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * const vision_model = await CLIPVisionModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Read image and run processor\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * \n * // Compute embeddings\n * const { image_embeds } = await vision_model(image_inputs);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nexport class CLIPVisionModelWithProjection extends CLIPPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'vision_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// SigLIP models\nexport class SiglipPreTrainedModel extends PreTrainedModel { }\n\n/**\n * SigLIP Text and Vision Model with a projection layers on top\n * \n * **Example:** Perform zero-shot image classification with a `SiglipModel`.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, SiglipModel, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/siglip-base-patch16-224');\n * const processor = await AutoProcessor.from_pretrained('Xenova/siglip-base-patch16-224');\n * const model = await SiglipModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Run tokenization\n * const texts = ['a photo of 2 cats', 'a photo of 2 dogs'];\n * const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });\n * \n * // Read image and run processor\n * const image = await RawImage.read('http://images.cocodataset.org/val2017/000000039769.jpg');\n * const image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * const output = await model({ ...text_inputs, ...image_inputs });\n * // {\n * // logits_per_image: Tensor {\n * // dims: [ 1, 2 ],\n * // data: Float32Array(2) [ -1.6019744873046875, -10.720091819763184 ],\n * // },\n * // logits_per_text: Tensor {\n * // dims: [ 2, 1 ],\n * // data: Float32Array(2) [ -1.6019744873046875, -10.720091819763184 ],\n * // },\n * // text_embeds: Tensor {\n * // dims: [ 2, 768 ],\n * // data: Float32Array(1536) [ ... ],\n * // },\n * // image_embeds: Tensor {\n * // dims: [ 1, 768 ],\n * // data: Float32Array(768) [ ... ],\n * // }\n * // }\n * ```\n */\nexport class SiglipModel extends SiglipPreTrainedModel { }\n\n/**\n * The text model from SigLIP without any head or projection on top.\n * \n * **Example:** Compute text embeddings with `SiglipTextModel`.\n * \n * ```javascript\n * import { AutoTokenizer, SiglipTextModel } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/siglip-base-patch16-224');\n * const text_model = await SiglipTextModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Run tokenization\n * const texts = ['a photo of 2 cats', 'a photo of 2 dogs'];\n * const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });\n * \n * // Compute embeddings\n * const { pooler_output } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 768 ],\n * // type: 'float32',\n * // data: Float32Array(1536) [ ... ],\n * // size: 1536\n * // }\n * ```\n */\nexport class SiglipTextModel extends SiglipPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * The vision model from SigLIP without any head or projection on top.\n * \n * **Example:** Compute vision embeddings with `SiglipVisionModel`.\n * \n * ```javascript\n * import { AutoProcessor, SiglipVisionModel, RawImage} from '@xenova/transformers';\n * \n * // Load processor and vision model\n * const processor = await AutoProcessor.from_pretrained('Xenova/siglip-base-patch16-224');\n * const vision_model = await SiglipVisionModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Read image and run processor\n * const image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * const image_inputs = await processor(image);\n * \n * // Compute embeddings\n * const { pooler_output } = await vision_model(image_inputs);\n * // Tensor {\n * // dims: [ 1, 768 ],\n * // type: 'float32',\n * // data: Float32Array(768) [ ... ],\n * // size: 768\n * // }\n * ```\n */\nexport class SiglipVisionModel extends CLIPPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'vision_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n// ChineseCLIP models\nexport class ChineseCLIPPreTrainedModel extends PreTrainedModel { }\n\nexport class ChineseCLIPModel extends ChineseCLIPPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CLIPSeg models\nexport class CLIPSegPreTrainedModel extends PreTrainedModel { }\n\nexport class CLIPSegModel extends CLIPSegPreTrainedModel { }\n\n/**\n * CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation.\n * \n * **Example:** Perform zero-shot image segmentation with a `CLIPSegForImageSegmentation` model.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, CLIPSegForImageSegmentation, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clipseg-rd64-refined');\n * const processor = await AutoProcessor.from_pretrained('Xenova/clipseg-rd64-refined');\n * const model = await CLIPSegForImageSegmentation.from_pretrained('Xenova/clipseg-rd64-refined');\n * \n * // Run tokenization\n * const texts = ['a glass', 'something to fill', 'wood', 'a jar'];\n * const text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Read image and run processor\n * const image = await RawImage.read('https://github.com/timojl/clipseg/blob/master/example_image.jpg?raw=true');\n * const image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * const { logits } = await model({ ...text_inputs, ...image_inputs });\n * // logits: Tensor {\n * // dims: [4, 352, 352],\n * // type: 'float32',\n * // data: Float32Array(495616) [ ... ],\n * // size: 495616\n * // }\n * ```\n * \n * You can visualize the predictions as follows:\n * ```javascript\n * const preds = logits\n * .unsqueeze_(1)\n * .sigmoid_()\n * .mul_(255)\n * .round_()\n * .to('uint8');\n * \n * for (let i = 0; i < preds.dims[0]; ++i) {\n * const img = RawImage.fromTensor(preds[i]);\n * img.save(`prediction_${i}.png`);\n * }\n * ```\n */\nexport class CLIPSegForImageSegmentation extends CLIPSegPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPT2 models\nexport class GPT2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPT2PreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nexport class GPT2Model extends GPT2PreTrainedModel { }\n\n/**\n * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks.\n */\nexport class GPT2LMHeadModel extends GPT2PreTrainedModel { }\n// export class GPT2ForSequenceClassification extends GPT2PreTrainedModel {\n// TODO\n// }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeo models\nexport class GPTNeoPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTNeoPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_heads;\n this.num_layers = this.config.num_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\nexport class GPTNeoModel extends GPTNeoPreTrainedModel { }\n\nexport class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeoX models\nexport class GPTNeoXPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTNeoXPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\nexport class GPTNeoXModel extends GPTNeoXPreTrainedModel { }\n\nexport class GPTNeoXForCausalLM extends GPTNeoXPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPT-J models\nexport class GPTJPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTJPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nexport class GPTJModel extends GPTJPreTrainedModel { }\n\nexport class GPTJForCausalLM extends GPTJPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPTBigCode models\nexport class GPTBigCodePreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTBigCodePreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nexport class GPTBigCodeModel extends GPTBigCodePreTrainedModel { }\n\nexport class GPTBigCodeForCausalLM extends GPTBigCodePreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// CodeGen models\nexport class CodeGenPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `CodeGenPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n/**\n * CodeGenModel is a class representing a code generation model without a language model head.\n */\nexport class CodeGenModel extends CodeGenPreTrainedModel { }\n\n/**\n * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class.\n */\nexport class CodeGenForCausalLM extends CodeGenPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LLama models\n\n/**\n * The bare LLama Model outputting raw hidden-states without any specific head on top.\n */\nexport class LlamaPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `LlamaPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads ?? this.config.num_attention_heads\n this.num_layers = this.config.num_hidden_layers\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads\n }\n}\n/**\n * The bare LLaMA Model outputting raw hidden-states without any specific head on top.\n */\nexport class LlamaModel extends LlamaPreTrainedModel { }\n\nexport class LlamaForCausalLM extends LlamaPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Qwen2 models\n\n/**\n * The bare Qwen2 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Qwen2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `Qwen2PreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads ?? this.config.num_attention_heads\n this.num_layers = this.config.num_hidden_layers\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads\n }\n}\n/**\n * The bare Qwen2 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Qwen2Model extends Qwen2PreTrainedModel { }\n\nexport class Qwen2ForCausalLM extends Qwen2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Phi models\nexport class PhiPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `PhiPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id;\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n/**\n * The bare Phi Model outputting raw hidden-states without any specific head on top.\n */\nexport class PhiModel extends PhiPreTrainedModel { }\n\nexport class PhiForCausalLM extends PhiPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Bloom models\n/**\n * The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nexport class BloomPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `BloomPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare Bloom Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class BloomModel extends BloomPreTrainedModel { }\n\n/**\n * The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nexport class BloomForCausalLM extends BloomPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MPT models\nexport class MptPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `MptPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_heads\n this.num_layers = this.config.n_layers\n this.dim_kv = this.config.d_model / this.num_heads;\n }\n}\n\n/**\n * The bare Mpt Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class MptModel extends MptPreTrainedModel { }\n\n/**\n * The MPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nexport class MptForCausalLM extends MptPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// OPT models\nexport class OPTPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `OPTPreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare OPT Model outputting raw hidden-states without any specific head on top.\n */\nexport class OPTModel extends OPTPreTrainedModel { }\n\n/**\n * The OPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nexport class OPTForCausalLM extends OPTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class ViTPreTrainedModel extends PreTrainedModel { }\nexport class ViTModel extends ViTPreTrainedModel { }\nexport class ViTForImageClassification extends ViTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class VitMattePreTrainedModel extends PreTrainedModel { }\n\n/**\n * ViTMatte framework leveraging any vision backbone e.g. for ADE20k, CityScapes.\n * \n * **Example:** Perform image matting with a `VitMatteForImageMatting` model.\n * ```javascript\n * import { AutoProcessor, VitMatteForImageMatting, RawImage } from '@xenova/transformers';\n * \n * // Load processor and model\n * const processor = await AutoProcessor.from_pretrained('Xenova/vitmatte-small-distinctions-646');\n * const model = await VitMatteForImageMatting.from_pretrained('Xenova/vitmatte-small-distinctions-646');\n * \n * // Load image and trimap\n * const image = await RawImage.fromURL('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/vitmatte_image.png');\n * const trimap = await RawImage.fromURL('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/vitmatte_trimap.png');\n * \n * // Prepare image + trimap for the model\n * const inputs = await processor(image, trimap);\n * \n * // Predict alpha matte\n * const { alphas } = await model(inputs);\n * // Tensor {\n * // dims: [ 1, 1, 640, 960 ],\n * // type: 'float32',\n * // size: 614400,\n * // data: Float32Array(614400) [ 0.9894027709960938, 0.9970508813858032, ... ]\n * // }\n * ```\n * \n * You can visualize the alpha matte as follows:\n * ```javascript\n * import { Tensor, cat } from '@xenova/transformers';\n * \n * // Visualize predicted alpha matte\n * const imageTensor = image.toTensor();\n * \n * // Convert float (0-1) alpha matte to uint8 (0-255)\n * const alphaChannel = alphas\n * .squeeze(0)\n * .mul_(255)\n * .clamp_(0, 255)\n * .round_()\n * .to('uint8');\n * \n * // Concatenate original image with predicted alpha\n * const imageData = cat([imageTensor, alphaChannel], 0);\n * \n * // Save output image\n * const outputImage = RawImage.fromTensor(imageData);\n * outputImage.save('output.png');\n * ```\n */\nexport class VitMatteForImageMatting extends VitMattePreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new ImageMattingOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class MobileViTPreTrainedModel extends PreTrainedModel { }\nexport class MobileViTModel extends MobileViTPreTrainedModel { }\nexport class MobileViTForImageClassification extends MobileViTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n// TODO: MobileViTForSemanticSegmentation\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class OwlViTPreTrainedModel extends PreTrainedModel { }\nexport class OwlViTModel extends OwlViTPreTrainedModel { }\nexport class OwlViTForObjectDetection extends OwlViTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class Owlv2PreTrainedModel extends PreTrainedModel { }\nexport class Owlv2Model extends Owlv2PreTrainedModel { }\nexport class Owlv2ForObjectDetection extends Owlv2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Beit Models\nexport class BeitPreTrainedModel extends PreTrainedModel { }\nexport class BeitModel extends BeitPreTrainedModel { }\nexport class BeitForImageClassification extends BeitPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class DetrPreTrainedModel extends PreTrainedModel { }\nexport class DetrModel extends DetrPreTrainedModel { }\nexport class DetrForObjectDetection extends DetrPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new DetrObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nexport class DetrForSegmentation extends DetrPreTrainedModel {\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new DetrSegmentationOutput(await super._call(model_inputs));\n }\n}\n\nexport class DetrObjectDetectionOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification logits (including no-object) for all queries.\n * @param {Tensor} output.pred_boxes Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height).\n * These values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding possible padding).\n */\n constructor({ logits, pred_boxes }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n }\n}\n\nexport class DetrSegmentationOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits The output logits of the model.\n * @param {Tensor} output.pred_boxes Predicted boxes.\n * @param {Tensor} output.pred_masks Predicted masks.\n */\n constructor({ logits, pred_boxes, pred_masks }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n this.pred_masks = pred_masks;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class TableTransformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer)\n * outputting raw hidden-states without any specific head on top.\n */\nexport class TableTransformerModel extends TableTransformerPreTrainedModel { }\n\n/**\n * Table Transformer Model (consisting of a backbone and encoder-decoder Transformer)\n * with object detection heads on top, for tasks such as COCO detection.\n */\nexport class TableTransformerForObjectDetection extends TableTransformerPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new TableTransformerObjectDetectionOutput(await super._call(model_inputs));\n }\n}\nexport class TableTransformerObjectDetectionOutput extends DetrObjectDetectionOutput { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class DeiTPreTrainedModel extends PreTrainedModel { }\nexport class DeiTModel extends DeiTPreTrainedModel { }\nexport class DeiTForImageClassification extends DeiTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nexport class ResNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ResNet model outputting raw features without any specific head on top.\n */\nexport class ResNetModel extends ResNetPreTrainedModel { }\n\n/**\n * ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nexport class ResNetForImageClassification extends ResNetPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class SwinPreTrainedModel extends PreTrainedModel { }\nexport class SwinModel extends SwinPreTrainedModel { }\nexport class SwinForImageClassification extends SwinPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class Swin2SRPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Swin2SR Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class Swin2SRModel extends Swin2SRPreTrainedModel { }\n\n/**\n * Swin2SR Model transformer with an upsampler head on top for image super resolution and restoration.\n * \n * **Example:** Super-resolution w/ `Xenova/swin2SR-classical-sr-x2-64`.\n * \n * ```javascript\n * import { AutoProcessor, Swin2SRForImageSuperResolution, RawImage } from '@xenova/transformers';\n * \n * // Load processor and model\n * const model_id = 'Xenova/swin2SR-classical-sr-x2-64';\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const model = await Swin2SRForImageSuperResolution.from_pretrained(model_id);\n * \n * // Prepare model inputs\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';\n * const image = await RawImage.fromURL(url);\n * const inputs = await processor(image);\n * \n * // Run model\n * const outputs = await model(inputs);\n * \n * // Convert Tensor to RawImage\n * const output = outputs.reconstruction.squeeze().clamp_(0, 1).mul_(255).round_().to('uint8');\n * const outputImage = RawImage.fromTensor(output);\n * // RawImage {\n * // data: Uint8Array(786432) [ 41, 31, 24, ... ],\n * // width: 512,\n * // height: 512,\n * // channels: 3\n * // }\n * ```\n */\nexport class Swin2SRForImageSuperResolution extends Swin2SRPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class DPTPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DPT Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class DPTModel extends DPTPreTrainedModel { }\n\n/**\n * DPT Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.\n * \n * **Example:** Depth estimation w/ `Xenova/dpt-hybrid-midas`.\n * ```javascript\n * import { DPTForDepthEstimation, AutoProcessor, RawImage, interpolate, max } from '@xenova/transformers';\n * \n * // Load model and processor\n * const model_id = 'Xenova/dpt-hybrid-midas';\n * const model = await DPTForDepthEstimation.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Load image from URL\n * const url = 'http://images.cocodataset.org/val2017/000000039769.jpg';\n * const image = await RawImage.fromURL(url);\n * \n * // Prepare image for the model\n * const inputs = await processor(image);\n * \n * // Run model\n * const { predicted_depth } = await model(inputs);\n * \n * // Interpolate to original size\n * const prediction = interpolate(predicted_depth, image.size.reverse(), 'bilinear', false);\n * \n * // Visualize the prediction\n * const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n * const depth = RawImage.fromTensor(formatted);\n * // RawImage {\n * // data: Uint8Array(307200) [ 85, 85, 84, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * ```\n */\nexport class DPTForDepthEstimation extends DPTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class DepthAnythingPreTrainedModel extends PreTrainedModel { }\n\n/**\n * Depth Anything Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.\n */\nexport class DepthAnythingForDepthEstimation extends DepthAnythingPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class GLPNPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare GLPN encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.\n */\nexport class GLPNModel extends GLPNPreTrainedModel { }\n\n/**\n * GLPN Model transformer with a lightweight depth estimation head on top e.g. for KITTI, NYUv2.\n * \n * **Example:** Depth estimation w/ `Xenova/glpn-kitti`.\n * ```javascript\n * import { GLPNForDepthEstimation, AutoProcessor, RawImage, interpolate, max } from '@xenova/transformers';\n * \n * // Load model and processor\n * const model_id = 'Xenova/glpn-kitti';\n * const model = await GLPNForDepthEstimation.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Load image from URL\n * const url = 'http://images.cocodataset.org/val2017/000000039769.jpg';\n * const image = await RawImage.fromURL(url);\n * \n * // Prepare image for the model\n * const inputs = await processor(image);\n * \n * // Run model\n * const { predicted_depth } = await model(inputs);\n * \n * // Interpolate to original size\n * const prediction = interpolate(predicted_depth, image.size.reverse(), 'bilinear', false);\n * \n * // Visualize the prediction\n * const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n * const depth = RawImage.fromTensor(formatted);\n * // RawImage {\n * // data: Uint8Array(307200) [ 207, 169, 154, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * ```\n */\nexport class GLPNForDepthEstimation extends GLPNPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class DonutSwinPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Donut Swin Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Step-by-step Document Parsing.\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';\n * \n * // Choose model to use\n * const model_id = 'Xenova/donut-base-finetuned-cord-v2';\n * \n * // Prepare image inputs\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/receipt.png';\n * const image = await RawImage.read(url);\n * const image_inputs = await processor(image);\n * \n * // Prepare decoder inputs\n * const tokenizer = await AutoTokenizer.from_pretrained(model_id);\n * const task_prompt = '';\n * const decoder_input_ids = tokenizer(task_prompt, {\n * add_special_tokens: false,\n * }).input_ids;\n * \n * // Create the model\n * const model = await AutoModelForVision2Seq.from_pretrained(model_id);\n * \n * // Run inference\n * const output = await model.generate(image_inputs.pixel_values, {\n * decoder_input_ids,\n * max_length: model.config.decoder.max_position_embeddings,\n * });\n * \n * // Decode output\n * const decoded = tokenizer.batch_decode(output)[0];\n * // CINNAMON SUGAR 17,000 1 x 17,000 17,000 17,000 20,000 3,000\n * ```\n * \n * **Example:** Step-by-step Document Visual Question Answering (DocVQA)\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';\n * \n * // Choose model to use\n * const model_id = 'Xenova/donut-base-finetuned-docvqa';\n * \n * // Prepare image inputs\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';\n * const image = await RawImage.read(url);\n * const image_inputs = await processor(image);\n * \n * // Prepare decoder inputs\n * const tokenizer = await AutoTokenizer.from_pretrained(model_id);\n * const question = 'What is the invoice number?';\n * const task_prompt = `${question}`;\n * const decoder_input_ids = tokenizer(task_prompt, {\n * add_special_tokens: false,\n * }).input_ids;\n * \n * // Create the model\n * const model = await AutoModelForVision2Seq.from_pretrained(model_id);\n * \n * // Run inference\n * const output = await model.generate(image_inputs.pixel_values, {\n * decoder_input_ids,\n * max_length: model.config.decoder.max_position_embeddings,\n * });\n * \n * // Decode output\n * const decoded = tokenizer.batch_decode(output)[0];\n * // What is the invoice number? us-001\n * ```\n */\nexport class DonutSwinModel extends DonutSwinPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class ConvNextPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvNext model outputting raw features without any specific head on top.\n */\nexport class ConvNextModel extends ConvNextPreTrainedModel { }\n\n/**\n * ConvNext Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nexport class ConvNextForImageClassification extends ConvNextPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class ConvNextV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvNextV2 model outputting raw features without any specific head on top.\n */\nexport class ConvNextV2Model extends ConvNextV2PreTrainedModel { }\n\n/**\n * ConvNextV2 Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nexport class ConvNextV2ForImageClassification extends ConvNextV2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class Dinov2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DINOv2 Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class Dinov2Model extends Dinov2PreTrainedModel { }\n\n/**\n * Dinov2 Model transformer with an image classification head on top (a linear layer on top of the final hidden state of the [CLS] token) e.g. for ImageNet.\n */\nexport class Dinov2ForImageClassification extends Dinov2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class YolosPreTrainedModel extends PreTrainedModel { }\nexport class YolosModel extends YolosPreTrainedModel { }\nexport class YolosForObjectDetection extends YolosPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new YolosObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nexport class YolosObjectDetectionOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification logits (including no-object) for all queries.\n * @param {Tensor} output.pred_boxes Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height).\n * These values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding possible padding).\n */\n constructor({ logits, pred_boxes }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n }\n}\n//////////////////////////////////////////////////\n\n\n\n\n//////////////////////////////////////////////////\nexport class SamPreTrainedModel extends PreTrainedModel { }\n\n/**\n * Segment Anything Model (SAM) for generating segmentation masks, given an input image\n * and optional 2D location and bounding boxes.\n * \n * **Example:** Perform mask generation w/ `Xenova/sam-vit-base`.\n * ```javascript\n * import { SamModel, AutoProcessor, RawImage } from '@xenova/transformers';\n * \n * const model = await SamModel.from_pretrained('Xenova/sam-vit-base');\n * const processor = await AutoProcessor.from_pretrained('Xenova/sam-vit-base');\n * \n * const img_url = 'https://huggingface.co/ybelkada/segment-anything/resolve/main/assets/car.png';\n * const raw_image = await RawImage.read(img_url);\n * const input_points = [[[450, 600]]] // 2D localization of a window\n * \n * const inputs = await processor(raw_image, input_points);\n * const outputs = await model(inputs);\n * \n * const masks = await processor.post_process_masks(outputs.pred_masks, inputs.original_sizes, inputs.reshaped_input_sizes);\n * // [\n * // Tensor {\n * // dims: [ 1, 3, 1764, 2646 ],\n * // type: 'bool',\n * // data: Uint8Array(14002632) [ ... ],\n * // size: 14002632\n * // }\n * // ]\n * const scores = outputs.iou_scores;\n * // Tensor {\n * // dims: [ 1, 1, 3 ],\n * // type: 'float32',\n * // data: Float32Array(3) [\n * // 0.8892380595207214,\n * // 0.9311248064041138,\n * // 0.983696699142456\n * // ],\n * // size: 3\n * // }\n * ```\n */\nexport class SamModel extends SamPreTrainedModel {\n\n /**\n * Compute image embeddings and positional image embeddings, given the pixel values of an image.\n * @param {Object} model_inputs Object containing the model inputs.\n * @param {Tensor} model_inputs.pixel_values Pixel values obtained using a `SamProcessor`.\n * @returns {Promise<{ image_embeddings: Tensor, image_positional_embeddings: Tensor }>} The image embeddings and positional image embeddings.\n */\n async get_image_embeddings({ pixel_values }) {\n // in:\n // - pixel_values: tensor.float32[batch_size,3,1024,1024]\n // \n // out:\n // - image_embeddings: tensor.float32[batch_size,256,64,64]\n // - image_positional_embeddings: tensor.float32[batch_size,256,64,64]\n return await encoderForward(this, { pixel_values })\n }\n\n /**\n * @typedef {Object} SamModelInputs Object containing the model inputs.\n * @property {Tensor} pixel_values Pixel values as a Tensor with shape `(batch_size, num_channels, height, width)`.\n * These can be obtained using a `SamProcessor`.\n * @property {Tensor} input_points Input 2D spatial points with shape `(batch_size, num_points, 2)`.\n * This is used by the prompt encoder to encode the prompt.\n * @property {Tensor} [input_labels] Input labels for the points, as a Tensor of shape `(batch_size, point_batch_size, num_points)`.\n * This is used by the prompt encoder to encode the prompt. There are 4 types of labels:\n * - `1`: the point is a point that contains the object of interest\n * - `0`: the point is a point that does not contain the object of interest\n * - `-1`: the point corresponds to the background\n * - `-10`: the point is a padding point, thus should be ignored by the prompt encoder\n * @property {Tensor} [input_boxes] Input bounding boxes with shape `(batch_size, num_boxes, 4)`.\n * @property {Tensor} [image_embeddings] Image embeddings used by the mask decoder.\n * @property {Tensor} [image_positional_embeddings] Image positional embeddings used by the mask decoder.\n */\n\n /**\n * @param {SamModelInputs} model_inputs Object containing the model inputs.\n * @returns {Promise} The output of the model.\n */\n async forward(model_inputs) {\n if (!model_inputs.image_embeddings || !model_inputs.image_positional_embeddings) {\n // Compute the image embeddings if they are missing\n model_inputs = {\n ...model_inputs,\n ...(await this.get_image_embeddings(model_inputs))\n }\n }\n\n if (!model_inputs.input_labels && model_inputs.input_points) {\n // Set default input labels if they are missing\n const shape = model_inputs.input_points.dims.slice(0, -1);\n const numElements = shape.reduce((a, b) => a * b, 1);\n model_inputs.input_labels = new Tensor(\n 'int64',\n new BigInt64Array(numElements).fill(1n),\n shape\n );\n }\n\n const decoder_inputs = {\n image_embeddings: model_inputs.image_embeddings,\n image_positional_embeddings: model_inputs.image_positional_embeddings,\n };\n if (model_inputs.input_points) {\n decoder_inputs.input_points = model_inputs.input_points;\n }\n if (model_inputs.input_labels) {\n decoder_inputs.input_labels = model_inputs.input_labels;\n }\n if (model_inputs.input_boxes) {\n decoder_inputs.input_boxes = model_inputs.input_boxes;\n }\n\n // Returns:\n // - iou_scores: tensor.float32[batch_size,point_batch_size,3]\n // - pred_masks: tensor.float32[batch_size,point_batch_size,3,256,256]\n return await sessionRun(this.sessions['prompt_encoder_mask_decoder'], decoder_inputs);\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new SamImageSegmentationOutput(await super._call(model_inputs));\n }\n}\n\n\n/**\n * Base class for Segment-Anything model's output.\n */\nexport class SamImageSegmentationOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.iou_scores The output logits of the model.\n * @param {Tensor} output.pred_masks Predicted boxes.\n */\n constructor({ iou_scores, pred_masks }) {\n super();\n this.iou_scores = iou_scores;\n this.pred_masks = pred_masks;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MarianMT models\nexport class MarianPreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `MarianMTModel` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\nexport class MarianModel extends MarianPreTrainedModel { }\n\nexport class MarianMTModel extends MarianPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// M2M100 models\nexport class M2M100PreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `M2M100ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n};\n\nexport class M2M100Model extends M2M100PreTrainedModel { }\n\nexport class M2M100ForConditionalGeneration extends M2M100PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Wav2Vec2 models\nexport class Wav2Vec2PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `Wav2Vec2Model` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/mms-300m');\n * const audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/mms-300m');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 1144, 1024 ],\n * // type: 'float32',\n * // data: Float32Array(1171456) [ ... ],\n * // size: 1171456\n * // }\n * // }\n * ```\n */\nexport class Wav2Vec2Model extends Wav2Vec2PreTrainedModel { }\n\nexport class Wav2Vec2ForCTC extends Wav2Vec2PreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\nexport class Wav2Vec2ForSequenceClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization.\n */\nexport class Wav2Vec2ForAudioFrameClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// UniSpeech models\nexport class UniSpeechPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare UniSpeech Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class UniSpeechModel extends UniSpeechPreTrainedModel { }\n\n/**\n * UniSpeech Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nexport class UniSpeechForCTC extends UniSpeechPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * UniSpeech Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nexport class UniSpeechForSequenceClassification extends UniSpeechPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// UniSpeechSat models\nexport class UniSpeechSatPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare UniSpeechSat Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class UniSpeechSatModel extends UniSpeechSatPreTrainedModel { }\n\n/**\n * UniSpeechSat Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nexport class UniSpeechSatForCTC extends UniSpeechSatPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * UniSpeechSat Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nexport class UniSpeechSatForSequenceClassification extends UniSpeechSatPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * UniSpeechSat Model with a frame classification head on top for tasks like Speaker Diarization.\n */\nexport class UniSpeechSatForAudioFrameClassification extends UniSpeechSatPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Wav2Vec2Bert models\nexport class Wav2Vec2BertPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Wav2Vec2Bert Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class Wav2Vec2BertModel extends Wav2Vec2BertPreTrainedModel { }\n\n/**\n * Wav2Vec2Bert Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nexport class Wav2Vec2BertForCTC extends Wav2Vec2BertPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_features Float values of input mel-spectrogram.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Wav2Vec2Bert Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nexport class Wav2Vec2BertForSequenceClassification extends Wav2Vec2BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Hubert models\nexport class HubertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Hubert Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `HubertModel` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/hubert-base-ls960');\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);\n * const inputs = await processor(audio);\n * \n * // Load and run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/hubert-base-ls960');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 549, 768 ],\n * // type: 'float32',\n * // data: Float32Array(421632) [0.0682469978928566, 0.08104046434164047, -0.4975186586380005, ...],\n * // size: 421632\n * // }\n * // }\n * ```\n */\nexport class HubertModel extends Wav2Vec2PreTrainedModel { }\n\n/**\n * Hubert Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nexport class HubertForCTC extends Wav2Vec2PreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Hubert Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB Keyword Spotting.\n */\nexport class HubertForSequenceClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// WavLM models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nexport class WavLMPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `WavLMModel` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base');\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/wavlm-base');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 549, 768 ],\n * // type: 'float32',\n * // data: Float32Array(421632) [-0.349443256855011, -0.39341306686401367, 0.022836603224277496, ...],\n * // size: 421632\n * // }\n * // }\n * ```\n */\nexport class WavLMModel extends WavLMPreTrainedModel { }\n\n/**\n * WavLM Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nexport class WavLMForCTC extends WavLMPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nexport class WavLMForSequenceClassification extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification.\n * \n * **Example:** Extract speaker embeddings with `WavLMForXVector`.\n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base-plus-sv');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const audio = await read_audio(url, 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/wavlm-base-plus-sv');\n * const outputs = await model(inputs);\n * // {\n * // logits: Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [0.5847219228744507, ...],\n * // size: 512\n * // },\n * // embeddings: Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [-0.09079201519489288, ...],\n * // size: 512\n * // }\n * // }\n * ```\n */\nexport class WavLMForXVector extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits and speaker embeddings.\n */\n async _call(model_inputs) {\n return new XVectorOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with a frame classification head on top for tasks like Speaker Diarization.\n * \n * **Example:** Perform speaker diarization with `WavLMForAudioFrameClassification`.\n * ```javascript\n * import { AutoProcessor, AutoModelForAudioFrameClassification, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base-plus-sd');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const audio = await read_audio(url, 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModelForAudioFrameClassification.from_pretrained('Xenova/wavlm-base-plus-sd');\n * const { logits } = await model(inputs);\n * // {\n * // logits: Tensor {\n * // dims: [ 1, 549, 2 ], // [batch_size, num_frames, num_speakers]\n * // type: 'float32',\n * // data: Float32Array(1098) [-3.5301010608673096, ...],\n * // size: 1098\n * // }\n * // }\n * \n * const labels = logits[0].sigmoid().tolist().map(\n * frames => frames.map(speaker => speaker > 0.5 ? 1 : 0)\n * );\n * console.log(labels); // labels is a one-hot array of shape (num_frames, num_speakers)\n * // [\n * // [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],\n * // [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],\n * // [0, 0], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1],\n * // ...\n * // ]\n * ```\n */\nexport class WavLMForAudioFrameClassification extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n// SpeechT5 models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nexport class SpeechT5PreTrainedModel extends PreTrainedModel {\n\n /**\n * Creates a new instance of the `SpeechT5ForTextToSpeech` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.hidden_size / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.hidden_size / this.num_encoder_heads;\n }\n};\n\n/**\n * The bare SpeechT5 Encoder-Decoder Model outputting raw hidden-states without any specific pre- or post-nets.\n */\nexport class SpeechT5Model extends SpeechT5PreTrainedModel { };\n\n/**\n * SpeechT5 Model with a speech encoder and a text decoder.\n * \n * **Example:** Generate speech from text with `SpeechT5ForSpeechToText`.\n * ```javascript\n * import { AutoTokenizer, AutoProcessor, SpeechT5ForTextToSpeech, SpeechT5HifiGan, Tensor } from '@xenova/transformers';\n * \n * // Load the tokenizer and processor\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/speecht5_tts');\n * const processor = await AutoProcessor.from_pretrained('Xenova/speecht5_tts');\n * \n * // Load the models\n * // NOTE: We use the full-precision versions as they are more accurate\n * const model = await SpeechT5ForTextToSpeech.from_pretrained('Xenova/speecht5_tts', { dtype: 'fp32' });\n * const vocoder = await SpeechT5HifiGan.from_pretrained('Xenova/speecht5_hifigan', { dtype: 'fp32' });\n * \n * // Load speaker embeddings from URL\n * const speaker_embeddings_data = new Float32Array(\n * await (await fetch('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin')).arrayBuffer()\n * );\n * const speaker_embeddings = new Tensor(\n * 'float32',\n * speaker_embeddings_data,\n * [1, speaker_embeddings_data.length]\n * )\n * \n * // Run tokenization\n * const { input_ids } = tokenizer('Hello, my dog is cute');\n * \n * // Generate waveform\n * const { waveform } = await model.generate_speech(input_ids, speaker_embeddings, { vocoder });\n * console.log(waveform)\n * // Tensor {\n * // dims: [ 26112 ],\n * // type: 'float32',\n * // size: 26112,\n * // data: Float32Array(26112) [ -0.00043630177970044315, -0.00018082228780258447, ... ],\n * // }\n * ```\n */\nexport class SpeechT5ForSpeechToText extends SpeechT5PreTrainedModel { }\n\n/**\n * SpeechT5 Model with a text encoder and a speech decoder.\n */\nexport class SpeechT5ForTextToSpeech extends SpeechT5PreTrainedModel {\n\n /**\n * @typedef {Object} SpeechOutput\n * @property {Tensor} [spectrogram] The predicted log-mel spectrogram of shape\n * `(output_sequence_length, config.num_mel_bins)`. Returned when no `vocoder` is provided\n * @property {Tensor} [waveform] The predicted waveform of shape `(num_frames,)`. Returned when a `vocoder` is provided.\n * @property {Tensor} [cross_attentions] The outputs of the decoder's cross-attention layers of shape\n * `(config.decoder_layers, config.decoder_attention_heads, output_sequence_length, input_sequence_length)`. returned when `output_cross_attentions` is `true`.\n */\n\n /**\n * Converts a sequence of input tokens into a sequence of mel spectrograms, which are subsequently turned into a speech waveform using a vocoder.\n * @param {Tensor} input_values Indices of input sequence tokens in the vocabulary.\n * @param {Tensor} speaker_embeddings Tensor containing the speaker embeddings.\n * @param {Object} options Optional parameters for generating speech.\n * @param {number} [options.threshold=0.5] The generated sequence ends when the predicted stop token probability exceeds this value.\n * @param {number} [options.minlenratio=0.0] Used to calculate the minimum required length for the output sequence.\n * @param {number} [options.maxlenratio=20.0] Used to calculate the maximum allowed length for the output sequence.\n * @param {Object} [options.vocoder=null] The vocoder that converts the mel spectrogram into a speech waveform. If `null`, the output is the mel spectrogram.\n * @param {boolean} [options.output_cross_attentions=false] Whether or not to return the attentions tensors of the decoder's cross-attention layers.\n * @returns {Promise} A promise which resolves to an object containing the spectrogram, waveform, and cross-attention tensors.\n */\n async generate_speech(input_values, speaker_embeddings, {\n threshold = 0.5,\n minlenratio = 0.0,\n maxlenratio = 20.0,\n vocoder = null,\n // output_cross_attentions = false, // TODO add\n } = {}) {\n\n const model_inputs = {\n input_ids: input_values\n }\n\n const { encoder_outputs, encoder_attention_mask } = await encoderForward(this, model_inputs);\n\n const r = encoder_outputs.dims[1] / this.config.reduction_factor;\n const maxlen = Math.floor(r * maxlenratio);\n const minlen = Math.floor(r * minlenratio);\n\n const num_mel_bins = this.config.num_mel_bins;\n\n let spectrogramParts = [];\n let past_key_values = null;\n let decoder_outputs = null;\n let idx = 0;\n\n while (true) {\n ++idx;\n\n const use_cache_branch = boolTensor(!!decoder_outputs);\n let output_sequence;\n if (decoder_outputs) {\n output_sequence = decoder_outputs.output_sequence_out;\n } else {\n output_sequence = new Tensor(\n 'float32',\n new Float32Array(num_mel_bins),\n [1, 1, num_mel_bins],\n )\n }\n let decoderFeeds = {\n use_cache_branch,\n output_sequence,\n encoder_attention_mask: encoder_attention_mask,\n speaker_embeddings: speaker_embeddings,\n encoder_hidden_states: encoder_outputs,\n };\n\n this.addPastKeyValues(decoderFeeds, past_key_values);\n decoder_outputs = await sessionRun(this.sessions['decoder_model_merged'], decoderFeeds);\n past_key_values = this.getPastKeyValues(decoder_outputs, past_key_values);\n\n const { prob, spectrum } = decoder_outputs;\n spectrogramParts.push(spectrum);\n\n if (idx >= minlen && (\n // Finished when stop token or maximum length is reached.\n Array.from(prob.data).filter(p => p >= threshold).length > 0 || idx >= maxlen\n )) {\n break;\n }\n }\n\n const spectrogram = cat(spectrogramParts);\n const { waveform } = await sessionRun(vocoder.sessions['model'], { spectrogram });\n\n return {\n spectrogram,\n waveform,\n // cross_attentions: null, // TODO add\n }\n }\n}\n\n/**\n * HiFi-GAN vocoder.\n * \n * See [SpeechT5ForSpeechToText](./models#module_models.SpeechT5ForSpeechToText) for example usage.\n */\nexport class SpeechT5HifiGan extends PreTrainedModel {\n main_input_name = 'spectrogram';\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// TrOCR models\nexport class TrOCRPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `TrOCRPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id;\n\n this.num_encoder_layers = this.num_decoder_layers = this.config.decoder_layers;\n this.num_encoder_heads = this.num_decoder_heads = this.config.decoder_attention_heads;\n this.encoder_dim_kv = this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n }\n}\n\n/**\n * The TrOCR Decoder with a language modeling head.\n */\nexport class TrOCRForCausalLM extends TrOCRPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Mistral models\n/**\n * The bare Mistral Model outputting raw hidden-states without any specific head on top.\n */\nexport class MistralPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `MistralPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nexport class MistralModel extends MistralPreTrainedModel { }\n\nexport class MistralForCausalLM extends MistralPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Starcoder2 models\n/**\n * The bare Starcoder2 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Starcoder2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `Starcoder2PreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nexport class Starcoder2Model extends Starcoder2PreTrainedModel { }\n\nexport class Starcoder2ForCausalLM extends Starcoder2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Falcon models\n/**\n * The bare Falcon Model outputting raw hidden-states without any specific head on top.\n */\nexport class FalconPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `FalconPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nexport class FalconModel extends FalconPreTrainedModel { }\n\nexport class FalconForCausalLM extends FalconPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CLAP models\nexport class ClapPreTrainedModel extends PreTrainedModel { }\n\nexport class ClapModel extends ClapPreTrainedModel { }\n\n/**\n * CLAP Text Model with a projection layer on top (a linear layer on top of the pooled output).\n * \n * **Example:** Compute text embeddings with `ClapTextModelWithProjection`.\n * \n * ```javascript\n * import { AutoTokenizer, ClapTextModelWithProjection } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clap-htsat-unfused');\n * const text_model = await ClapTextModelWithProjection.from_pretrained('Xenova/clap-htsat-unfused');\n * \n * // Run tokenization\n * const texts = ['a sound of a cat', 'a sound of a dog'];\n * const text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Compute embeddings\n * const { text_embeds } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 512 ],\n * // type: 'float32',\n * // data: Float32Array(1024) [ ... ],\n * // size: 1024\n * // }\n * ```\n */\nexport class ClapTextModelWithProjection extends ClapPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * CLAP Audio Model with a projection layer on top (a linear layer on top of the pooled output).\n * \n * **Example:** Compute audio embeddings with `ClapAudioModelWithProjection`.\n * \n * ```javascript\n * import { AutoProcessor, ClapAudioModelWithProjection, read_audio } from '@xenova/transformers';\n * \n * // Load processor and audio model\n * const processor = await AutoProcessor.from_pretrained('Xenova/clap-htsat-unfused');\n * const audio_model = await ClapAudioModelWithProjection.from_pretrained('Xenova/clap-htsat-unfused');\n * \n * // Read audio and run processor\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cat_meow.wav');\n * const audio_inputs = await processor(audio);\n * \n * // Compute embeddings\n * const { audio_embeds } = await audio_model(audio_inputs);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nexport class ClapAudioModelWithProjection extends ClapPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'audio_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// VITS models\nexport class VitsPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The complete VITS model, for text-to-speech synthesis.\n * \n * **Example:** Generate speech from text with `VitsModel`.\n * ```javascript\n * import { AutoTokenizer, VitsModel } from '@xenova/transformers';\n * \n * // Load the tokenizer and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/mms-tts-eng');\n * const model = await VitsModel.from_pretrained('Xenova/mms-tts-eng');\n * \n * // Run tokenization\n * const inputs = tokenizer('I love transformers');\n * \n * // Generate waveform\n * const { waveform } = await model(inputs);\n * // Tensor {\n * // dims: [ 1, 35328 ],\n * // type: 'float32',\n * // data: Float32Array(35328) [ ... ],\n * // size: 35328,\n * // }\n * ```\n */\nexport class VitsModel extends VitsPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} The outputs for the VITS model.\n */\n async _call(model_inputs) {\n return new VitsModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Segformer models\nexport class SegformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.\n */\nexport class SegformerModel extends SegformerPreTrainedModel { }\n\n/**\n * SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden states) e.g. for ImageNet.\n */\nexport class SegformerForImageClassification extends SegformerPreTrainedModel { }\n\n/**\n * SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.\n */\nexport class SegformerForSemanticSegmentation extends SegformerPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// StableLm models\nexport class StableLmPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `StableLmPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n // this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare StableLm Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class StableLmModel extends StableLmPreTrainedModel { }\n\n/**\n * StableLm Model with a `language modeling` head on top for Causal Language Modeling (with past).\n */\nexport class StableLmForCausalLM extends StableLmPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class EfficientNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare EfficientNet model outputting raw features without any specific head on top.\n */\nexport class EfficientNetModel extends EfficientNetPreTrainedModel { }\n\n/**\n * EfficientNet Model with an image classification head on top (a linear layer on top of the pooled features).\n */\nexport class EfficientNetForImageClassification extends EfficientNetPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Musicgen models\nexport class MusicgenPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Musicgen decoder model outputting raw hidden-states without any specific head on top.\n */\nexport class MusicgenModel extends MusicgenPreTrainedModel { }\n\n/**\n * The MusicGen decoder model with a language modelling head on top.\n */\nexport class MusicgenForCausalLM extends MusicgenPreTrainedModel { }\n\n/**\n * The composite MusicGen model with a text encoder, audio encoder and Musicgen decoder,\n * for music generation tasks with one or both of text and audio prompts.\n * \n * **Example:** Generate music from text with `Xenova/musicgen-small`.\n * ```javascript\n * import { AutoTokenizer, MusicgenForConditionalGeneration } from '@xenova/transformers';\n * \n * // Load tokenizer and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/musicgen-small');\n * const model = await MusicgenForConditionalGeneration.from_pretrained(\n * 'Xenova/musicgen-small', { dtype: 'fp32' }\n * );\n * \n * // Prepare text input\n * const prompt = '80s pop track with bassy drums and synth';\n * const inputs = tokenizer(prompt);\n * \n * // Generate audio\n * const audio_values = await model.generate({\n * ...inputs,\n * max_new_tokens: 512,\n * do_sample: true,\n * guidance_scale: 3,\n * });\n * \n * // (Optional) Write the output to a WAV file\n * import wavefile from 'wavefile';\n * import fs from 'fs';\n * \n * const wav = new wavefile.WaveFile();\n * wav.fromScratch(1, model.config.audio_encoder.sampling_rate, '32f', audio_values.data);\n * fs.writeFileSync('musicgen_out.wav', wav.toBuffer());\n * ```\n */\nexport class MusicgenForConditionalGeneration extends PreTrainedModel { // NOTE: not MusicgenPreTrainedModel\n forward_params = ['input_ids', 'attention_mask', 'encoder_outputs', 'decoder_input_ids', 'decoder_attention_mask', 'past_key_values'];\n\n /**\n * Creates a new instance of the `MusicgenForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {Record} sessions The inference sessions for the model.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, sessions, generation_config) {\n super(config, sessions);\n this.generation_config = generation_config;\n\n // decoder\n const decoderConfig = config.decoder;\n this.num_encoder_layers = this.num_decoder_layers = decoderConfig.num_hidden_layers;\n this.num_encoder_heads = this.num_decoder_heads = decoderConfig.num_attention_heads;\n this.encoder_dim_kv = this.decoder_dim_kv = decoderConfig.hidden_size / this.num_decoder_heads;\n }\n\n /**\n * Apply the pattern mask to the final ids,\n * then revert the pattern delay mask by filtering the pad token id in a single step.\n * @param {Tensor} outputs The output tensor from the model.\n * @returns {Tensor} The filtered output tensor.\n */\n _apply_and_filter_by_delay_pattern_mask(outputs) {\n const [bs_x_codebooks, seqLength] = outputs.dims;\n const num_codebooks = this.config.decoder.num_codebooks;\n const upperBound = (seqLength - num_codebooks);\n\n let newDataSize = 0;\n for (let i = 0; i < outputs.size; ++i) {\n if (outputs.data[i] === this.config.decoder.pad_token_id) {\n continue;\n }\n\n const row = (i % seqLength);\n const col = Math.floor(i / seqLength) % num_codebooks;\n\n const diff = row - col;\n if (diff > 0 && diff <= upperBound) {\n outputs.data[newDataSize++] = outputs.data[i];\n }\n }\n\n const batch_size = Math.floor(bs_x_codebooks / num_codebooks);\n const inferred = newDataSize / (batch_size * num_codebooks);\n // TODO: assert `inferred` is an integer\n return new Tensor(\n outputs.type,\n outputs.data.slice(0, newDataSize),\n [batch_size, num_codebooks, inferred]\n );\n }\n\n\n prepare_inputs_for_generation(input_ids, model_inputs, generation_config) {\n // apply the delay pattern mask\n let clonedInputIds = structuredClone(input_ids);\n for (let i = 0; i < clonedInputIds.length; ++i) {\n for (let j = 0; j < clonedInputIds[i].length; ++j) {\n if ((i % this.config.decoder.num_codebooks) >= j) {\n clonedInputIds[i][j] = BigInt(this.config.decoder.pad_token_id);\n }\n }\n }\n // for classifier free guidance we need to replicate the decoder args across the batch dim\n // (we'll split these before sampling)\n if (generation_config.guidance_scale !== null && generation_config.guidance_scale > 1) {\n // [batch, seqLength] -> [2 * batch, seqLength]\n clonedInputIds = clonedInputIds.concat(clonedInputIds);\n }\n\n const prepped = super.prepare_inputs_for_generation(clonedInputIds, model_inputs, generation_config);\n return prepped;\n }\n\n /**\n * Generates sequences of token ids for models with a language modeling head.\n * @param {import('./generation/parameters.js').GenerationFunctionParameters} options\n * @returns {Promise} The output of the model, which can contain the generated token ids, attentions, and scores.\n */\n async generate(options) {\n\n const output_ids = await super.generate(options);\n\n // apply the pattern mask to the final ids\n // tensor: int64[1,batch_size,4,chunk_length]\n const audio_codes = this._apply_and_filter_by_delay_pattern_mask(\n /** @type {Tensor} */(output_ids)\n ).unsqueeze_(0); // append the frame dimension back to the audio codes\n\n const { audio_values } = await sessionRun(this.sessions['encodec_decode'], { audio_codes })\n\n return audio_values;\n }\n}\n\n//////////////////////////////////////////////////\n// AutoModels, used to simplify construction of PreTrainedModels\n// (uses config to instantiate correct class)\n\n/**\n * Base class of all AutoModels. Contains the `from_pretrained` function\n * which is used to instantiate pretrained models.\n */\nexport class PretrainedMixin {\n /**\n * Mapping from model type to model class.\n * @type {Map[]}\n */\n static MODEL_CLASS_MAPPINGS = null;\n\n /**\n * Whether to attempt to instantiate the base class (`PretrainedModel`) if \n * the model type is not found in the mapping.\n */\n static BASE_IF_FAIL = false;\n\n\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n model_file_name = null,\n subfolder = 'onnx',\n device = null,\n dtype = null,\n session_options = {},\n } = {}) {\n\n let options = {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n model_file_name,\n subfolder,\n device,\n dtype,\n session_options,\n }\n config = await AutoConfig.from_pretrained(pretrained_model_name_or_path, options);\n if (!options.config) {\n // If no config was passed, reuse this config for future processing\n options.config = config;\n }\n\n if (!this.MODEL_CLASS_MAPPINGS) {\n throw new Error(\"`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: \" + this.name);\n }\n\n for (let MODEL_CLASS_MAPPING of this.MODEL_CLASS_MAPPINGS) {\n const modelInfo = MODEL_CLASS_MAPPING.get(config.model_type);\n if (!modelInfo) {\n continue; // Item not found in this mapping\n }\n return await modelInfo[1].from_pretrained(pretrained_model_name_or_path, options);\n }\n\n if (this.BASE_IF_FAIL) {\n console.warn(`Unknown model class \"${config.model_type}\", attempting to construct from base class.`);\n return await PreTrainedModel.from_pretrained(pretrained_model_name_or_path, options);\n } else {\n throw Error(`Unsupported model type: ${config.model_type}`)\n }\n }\n}\n\nconst MODEL_MAPPING_NAMES_ENCODER_ONLY = new Map([\n ['bert', ['BertModel', BertModel]],\n ['nomic_bert', ['NomicBertModel', NomicBertModel]],\n ['roformer', ['RoFormerModel', RoFormerModel]],\n ['electra', ['ElectraModel', ElectraModel]],\n ['esm', ['EsmModel', EsmModel]],\n ['convbert', ['ConvBertModel', ConvBertModel]],\n ['camembert', ['CamembertModel', CamembertModel]],\n ['deberta', ['DebertaModel', DebertaModel]],\n ['deberta-v2', ['DebertaV2Model', DebertaV2Model]],\n ['mpnet', ['MPNetModel', MPNetModel]],\n ['albert', ['AlbertModel', AlbertModel]],\n ['distilbert', ['DistilBertModel', DistilBertModel]],\n ['roberta', ['RobertaModel', RobertaModel]],\n ['xlm', ['XLMModel', XLMModel]],\n ['xlm-roberta', ['XLMRobertaModel', XLMRobertaModel]],\n ['clap', ['ClapModel', ClapModel]],\n ['clip', ['CLIPModel', CLIPModel]],\n ['clipseg', ['CLIPSegModel', CLIPSegModel]],\n ['chinese_clip', ['ChineseCLIPModel', ChineseCLIPModel]],\n ['siglip', ['SiglipModel', SiglipModel]],\n ['mobilebert', ['MobileBertModel', MobileBertModel]],\n ['squeezebert', ['SqueezeBertModel', SqueezeBertModel]],\n ['wav2vec2', ['Wav2Vec2Model', Wav2Vec2Model]],\n ['wav2vec2-bert', ['Wav2Vec2BertModel', Wav2Vec2BertModel]],\n ['unispeech', ['UniSpeechModel', UniSpeechModel]],\n ['unispeech-sat', ['UniSpeechSatModel', UniSpeechSatModel]],\n ['hubert', ['HubertModel', HubertModel]],\n ['wavlm', ['WavLMModel', WavLMModel]],\n ['audio-spectrogram-transformer', ['ASTModel', ASTModel]],\n ['vits', ['VitsModel', VitsModel]],\n\n ['detr', ['DetrModel', DetrModel]],\n ['table-transformer', ['TableTransformerModel', TableTransformerModel]],\n ['vit', ['ViTModel', ViTModel]],\n ['mobilevit', ['MobileViTModel', MobileViTModel]],\n ['owlvit', ['OwlViTModel', OwlViTModel]],\n ['owlv2', ['Owlv2Model', Owlv2Model]],\n ['beit', ['BeitModel', BeitModel]],\n ['deit', ['DeiTModel', DeiTModel]],\n ['convnext', ['ConvNextModel', ConvNextModel]],\n ['convnextv2', ['ConvNextV2Model', ConvNextV2Model]],\n ['dinov2', ['Dinov2Model', Dinov2Model]],\n ['resnet', ['ResNetModel', ResNetModel]],\n ['swin', ['SwinModel', SwinModel]],\n ['swin2sr', ['Swin2SRModel', Swin2SRModel]],\n ['donut-swin', ['DonutSwinModel', DonutSwinModel]],\n ['yolos', ['YolosModel', YolosModel]],\n ['dpt', ['DPTModel', DPTModel]],\n ['glpn', ['GLPNModel', GLPNModel]],\n\n ['hifigan', ['SpeechT5HifiGan', SpeechT5HifiGan]],\n ['efficientnet', ['EfficientNetModel', EfficientNetModel]],\n]);\n\nconst MODEL_MAPPING_NAMES_ENCODER_DECODER = new Map([\n ['t5', ['T5Model', T5Model]],\n ['longt5', ['LongT5Model', LongT5Model]],\n ['mt5', ['MT5Model', MT5Model]],\n ['bart', ['BartModel', BartModel]],\n ['mbart', ['MBartModel', MBartModel]],\n ['marian', ['MarianModel', MarianModel]],\n ['whisper', ['WhisperModel', WhisperModel]],\n ['m2m_100', ['M2M100Model', M2M100Model]],\n ['blenderbot', ['BlenderbotModel', BlenderbotModel]],\n ['blenderbot-small', ['BlenderbotSmallModel', BlenderbotSmallModel]],\n]);\n\n\nconst MODEL_MAPPING_NAMES_DECODER_ONLY = new Map([\n ['bloom', ['BloomModel', BloomModel]],\n ['gpt2', ['GPT2Model', GPT2Model]],\n ['gptj', ['GPTJModel', GPTJModel]],\n ['gpt_bigcode', ['GPTBigCodeModel', GPTBigCodeModel]],\n ['gpt_neo', ['GPTNeoModel', GPTNeoModel]],\n ['gpt_neox', ['GPTNeoXModel', GPTNeoXModel]],\n ['codegen', ['CodeGenModel', CodeGenModel]],\n ['llama', ['LlamaModel', LlamaModel]],\n ['qwen2', ['Qwen2Model', Qwen2Model]],\n ['phi', ['PhiModel', PhiModel]],\n ['mpt', ['MptModel', MptModel]],\n ['opt', ['OPTModel', OPTModel]],\n ['mistral', ['MistralModel', MistralModel]],\n ['starcoder2', ['Starcoder2Model', Starcoder2Model]],\n ['falcon', ['FalconModel', FalconModel]],\n]);\n\nconst MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForSpeechToText', SpeechT5ForSpeechToText]],\n ['whisper', ['WhisperForConditionalGeneration', WhisperForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForTextToSpeech', SpeechT5ForTextToSpeech]],\n]);\n\nconst MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES = new Map([\n ['vits', ['VitsModel', VitsModel]],\n ['musicgen', ['MusicgenForConditionalGeneration', MusicgenForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForSequenceClassification', BertForSequenceClassification]],\n ['roformer', ['RoFormerForSequenceClassification', RoFormerForSequenceClassification]],\n ['electra', ['ElectraForSequenceClassification', ElectraForSequenceClassification]],\n ['esm', ['EsmForSequenceClassification', EsmForSequenceClassification]],\n ['convbert', ['ConvBertForSequenceClassification', ConvBertForSequenceClassification]],\n ['camembert', ['CamembertForSequenceClassification', CamembertForSequenceClassification]],\n ['deberta', ['DebertaForSequenceClassification', DebertaForSequenceClassification]],\n ['deberta-v2', ['DebertaV2ForSequenceClassification', DebertaV2ForSequenceClassification]],\n ['mpnet', ['MPNetForSequenceClassification', MPNetForSequenceClassification]],\n ['albert', ['AlbertForSequenceClassification', AlbertForSequenceClassification]],\n ['distilbert', ['DistilBertForSequenceClassification', DistilBertForSequenceClassification]],\n ['roberta', ['RobertaForSequenceClassification', RobertaForSequenceClassification]],\n ['xlm', ['XLMForSequenceClassification', XLMForSequenceClassification]],\n ['xlm-roberta', ['XLMRobertaForSequenceClassification', XLMRobertaForSequenceClassification]],\n ['bart', ['BartForSequenceClassification', BartForSequenceClassification]],\n ['mbart', ['MBartForSequenceClassification', MBartForSequenceClassification]],\n ['mobilebert', ['MobileBertForSequenceClassification', MobileBertForSequenceClassification]],\n ['squeezebert', ['SqueezeBertForSequenceClassification', SqueezeBertForSequenceClassification]],\n]);\n\nconst MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForTokenClassification', BertForTokenClassification]],\n ['roformer', ['RoFormerForTokenClassification', RoFormerForTokenClassification]],\n ['electra', ['ElectraForTokenClassification', ElectraForTokenClassification]],\n ['esm', ['EsmForTokenClassification', EsmForTokenClassification]],\n ['convbert', ['ConvBertForTokenClassification', ConvBertForTokenClassification]],\n ['camembert', ['CamembertForTokenClassification', CamembertForTokenClassification]],\n ['deberta', ['DebertaForTokenClassification', DebertaForTokenClassification]],\n ['deberta-v2', ['DebertaV2ForTokenClassification', DebertaV2ForTokenClassification]],\n ['mpnet', ['MPNetForTokenClassification', MPNetForTokenClassification]],\n ['distilbert', ['DistilBertForTokenClassification', DistilBertForTokenClassification]],\n ['roberta', ['RobertaForTokenClassification', RobertaForTokenClassification]],\n ['xlm', ['XLMForTokenClassification', XLMForTokenClassification]],\n ['xlm-roberta', ['XLMRobertaForTokenClassification', XLMRobertaForTokenClassification]],\n]);\n\nconst MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES = new Map([\n ['t5', ['T5ForConditionalGeneration', T5ForConditionalGeneration]],\n ['longt5', ['LongT5ForConditionalGeneration', LongT5ForConditionalGeneration]],\n ['mt5', ['MT5ForConditionalGeneration', MT5ForConditionalGeneration]],\n ['bart', ['BartForConditionalGeneration', BartForConditionalGeneration]],\n ['mbart', ['MBartForConditionalGeneration', MBartForConditionalGeneration]],\n ['marian', ['MarianMTModel', MarianMTModel]],\n ['m2m_100', ['M2M100ForConditionalGeneration', M2M100ForConditionalGeneration]],\n ['blenderbot', ['BlenderbotForConditionalGeneration', BlenderbotForConditionalGeneration]],\n ['blenderbot-small', ['BlenderbotSmallForConditionalGeneration', BlenderbotSmallForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_CAUSAL_LM_MAPPING_NAMES = new Map([\n ['bloom', ['BloomForCausalLM', BloomForCausalLM]],\n ['gpt2', ['GPT2LMHeadModel', GPT2LMHeadModel]],\n ['gptj', ['GPTJForCausalLM', GPTJForCausalLM]],\n ['gpt_bigcode', ['GPTBigCodeForCausalLM', GPTBigCodeForCausalLM]],\n ['gpt_neo', ['GPTNeoForCausalLM', GPTNeoForCausalLM]],\n ['gpt_neox', ['GPTNeoXForCausalLM', GPTNeoXForCausalLM]],\n ['codegen', ['CodeGenForCausalLM', CodeGenForCausalLM]],\n ['llama', ['LlamaForCausalLM', LlamaForCausalLM]],\n ['qwen2', ['Qwen2ForCausalLM', Qwen2ForCausalLM]],\n ['phi', ['PhiForCausalLM', PhiForCausalLM]],\n ['mpt', ['MptForCausalLM', MptForCausalLM]],\n ['opt', ['OPTForCausalLM', OPTForCausalLM]],\n ['mbart', ['MBartForCausalLM', MBartForCausalLM]],\n ['mistral', ['MistralForCausalLM', MistralForCausalLM]],\n ['starcoder2', ['Starcoder2ForCausalLM', Starcoder2ForCausalLM]],\n ['falcon', ['FalconForCausalLM', FalconForCausalLM]],\n ['trocr', ['TrOCRForCausalLM', TrOCRForCausalLM]],\n ['stablelm', ['StableLmForCausalLM', StableLmForCausalLM]],\n]);\n\nconst MODEL_FOR_MASKED_LM_MAPPING_NAMES = new Map([\n ['bert', ['BertForMaskedLM', BertForMaskedLM]],\n ['roformer', ['RoFormerForMaskedLM', RoFormerForMaskedLM]],\n ['electra', ['ElectraForMaskedLM', ElectraForMaskedLM]],\n ['esm', ['EsmForMaskedLM', EsmForMaskedLM]],\n ['convbert', ['ConvBertForMaskedLM', ConvBertForMaskedLM]],\n ['camembert', ['CamembertForMaskedLM', CamembertForMaskedLM]],\n ['deberta', ['DebertaForMaskedLM', DebertaForMaskedLM]],\n ['deberta-v2', ['DebertaV2ForMaskedLM', DebertaV2ForMaskedLM]],\n ['mpnet', ['MPNetForMaskedLM', MPNetForMaskedLM]],\n ['albert', ['AlbertForMaskedLM', AlbertForMaskedLM]],\n ['distilbert', ['DistilBertForMaskedLM', DistilBertForMaskedLM]],\n ['roberta', ['RobertaForMaskedLM', RobertaForMaskedLM]],\n ['xlm', ['XLMWithLMHeadModel', XLMWithLMHeadModel]],\n ['xlm-roberta', ['XLMRobertaForMaskedLM', XLMRobertaForMaskedLM]],\n ['mobilebert', ['MobileBertForMaskedLM', MobileBertForMaskedLM]],\n ['squeezebert', ['SqueezeBertForMaskedLM', SqueezeBertForMaskedLM]],\n]);\n\nconst MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES = new Map([\n ['bert', ['BertForQuestionAnswering', BertForQuestionAnswering]],\n ['roformer', ['RoFormerForQuestionAnswering', RoFormerForQuestionAnswering]],\n ['electra', ['ElectraForQuestionAnswering', ElectraForQuestionAnswering]],\n ['convbert', ['ConvBertForQuestionAnswering', ConvBertForQuestionAnswering]],\n ['camembert', ['CamembertForQuestionAnswering', CamembertForQuestionAnswering]],\n ['deberta', ['DebertaForQuestionAnswering', DebertaForQuestionAnswering]],\n ['deberta-v2', ['DebertaV2ForQuestionAnswering', DebertaV2ForQuestionAnswering]],\n ['mpnet', ['MPNetForQuestionAnswering', MPNetForQuestionAnswering]],\n ['albert', ['AlbertForQuestionAnswering', AlbertForQuestionAnswering]],\n ['distilbert', ['DistilBertForQuestionAnswering', DistilBertForQuestionAnswering]],\n ['roberta', ['RobertaForQuestionAnswering', RobertaForQuestionAnswering]],\n ['xlm', ['XLMForQuestionAnswering', XLMForQuestionAnswering]],\n ['xlm-roberta', ['XLMRobertaForQuestionAnswering', XLMRobertaForQuestionAnswering]],\n ['mobilebert', ['MobileBertForQuestionAnswering', MobileBertForQuestionAnswering]],\n ['squeezebert', ['SqueezeBertForQuestionAnswering', SqueezeBertForQuestionAnswering]],\n]);\n\nconst MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES = new Map([\n ['vision-encoder-decoder', ['VisionEncoderDecoderModel', VisionEncoderDecoderModel]],\n]);\n\nconst MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES = new Map([\n ['llava', ['LlavaForConditionalGeneration', LlavaForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES = new Map([\n ['vision-encoder-decoder', ['VisionEncoderDecoderModel', VisionEncoderDecoderModel]],\n]);\n\nconst MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['vit', ['ViTForImageClassification', ViTForImageClassification]],\n ['mobilevit', ['MobileViTForImageClassification', MobileViTForImageClassification]],\n ['beit', ['BeitForImageClassification', BeitForImageClassification]],\n ['deit', ['DeiTForImageClassification', DeiTForImageClassification]],\n ['convnext', ['ConvNextForImageClassification', ConvNextForImageClassification]],\n ['convnextv2', ['ConvNextV2ForImageClassification', ConvNextV2ForImageClassification]],\n ['dinov2', ['Dinov2ForImageClassification', Dinov2ForImageClassification]],\n ['resnet', ['ResNetForImageClassification', ResNetForImageClassification]],\n ['swin', ['SwinForImageClassification', SwinForImageClassification]],\n ['segformer', ['SegformerForImageClassification', SegformerForImageClassification]],\n ['efficientnet', ['EfficientNetForImageClassification', EfficientNetForImageClassification]],\n]);\n\nconst MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForObjectDetection', DetrForObjectDetection]],\n ['table-transformer', ['TableTransformerForObjectDetection', TableTransformerForObjectDetection]],\n ['yolos', ['YolosForObjectDetection', YolosForObjectDetection]],\n]);\n\nconst MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['owlvit', ['OwlViTForObjectDetection', OwlViTForObjectDetection]],\n ['owlv2', ['Owlv2ForObjectDetection', Owlv2ForObjectDetection]],\n]);\n\nconst MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForSegmentation', DetrForSegmentation]],\n ['clipseg', ['CLIPSegForImageSegmentation', CLIPSegForImageSegmentation]],\n]);\n\nconst MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES = new Map([\n ['segformer', ['SegformerForSemanticSegmentation', SegformerForSemanticSegmentation]],\n]);\n\nconst MODEL_FOR_MASK_GENERATION_MAPPING_NAMES = new Map([\n ['sam', ['SamModel', SamModel]],\n]);\n\nconst MODEL_FOR_CTC_MAPPING_NAMES = new Map([\n ['wav2vec2', ['Wav2Vec2ForCTC', Wav2Vec2ForCTC]],\n ['wav2vec2-bert', ['Wav2Vec2BertForCTC', Wav2Vec2BertForCTC]],\n ['unispeech', ['UniSpeechForCTC', UniSpeechForCTC]],\n ['unispeech-sat', ['UniSpeechSatForCTC', UniSpeechSatForCTC]],\n ['wavlm', ['WavLMForCTC', WavLMForCTC]],\n ['hubert', ['HubertForCTC', HubertForCTC]],\n]);\n\nconst MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['wav2vec2', ['Wav2Vec2ForSequenceClassification', Wav2Vec2ForSequenceClassification]],\n ['wav2vec2-bert', ['Wav2Vec2BertForSequenceClassification', Wav2Vec2BertForSequenceClassification]],\n ['unispeech', ['UniSpeechForSequenceClassification', UniSpeechForSequenceClassification]],\n ['unispeech-sat', ['UniSpeechSatForSequenceClassification', UniSpeechSatForSequenceClassification]],\n ['wavlm', ['WavLMForSequenceClassification', WavLMForSequenceClassification]],\n ['hubert', ['HubertForSequenceClassification', HubertForSequenceClassification]],\n ['audio-spectrogram-transformer', ['ASTForAudioClassification', ASTForAudioClassification]],\n]);\n\nconst MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES = new Map([\n ['wavlm', ['WavLMForXVector', WavLMForXVector]],\n]);\n\nconst MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['unispeech-sat', ['UniSpeechSatForAudioFrameClassification', UniSpeechSatForAudioFrameClassification]],\n ['wavlm', ['WavLMForAudioFrameClassification', WavLMForAudioFrameClassification]],\n ['wav2vec2', ['Wav2Vec2ForAudioFrameClassification', Wav2Vec2ForAudioFrameClassification]],\n]);\n\nconst MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES = new Map([\n ['vitmatte', ['VitMatteForImageMatting', VitMatteForImageMatting]],\n]);\n\nconst MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES = new Map([\n ['swin2sr', ['Swin2SRForImageSuperResolution', Swin2SRForImageSuperResolution]],\n])\n\nconst MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES = new Map([\n ['dpt', ['DPTForDepthEstimation', DPTForDepthEstimation]],\n ['depth_anything', ['DepthAnythingForDepthEstimation', DepthAnythingForDepthEstimation]],\n ['glpn', ['GLPNForDepthEstimation', GLPNForDepthEstimation]],\n])\n\n// NOTE: This is custom to Transformers.js, and is necessary because certain models\n// (e.g., CLIP) are split into vision and text components\nconst MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES = new Map([\n ['clip', ['CLIPVisionModelWithProjection', CLIPVisionModelWithProjection]],\n ['siglip', ['SiglipVisionModel', SiglipVisionModel]],\n])\n\nconst MODEL_CLASS_TYPE_MAPPING = [\n [MODEL_MAPPING_NAMES_ENCODER_ONLY, MODEL_TYPES.EncoderOnly],\n [MODEL_MAPPING_NAMES_ENCODER_DECODER, MODEL_TYPES.EncoderDecoder],\n [MODEL_MAPPING_NAMES_DECODER_ONLY, MODEL_TYPES.DecoderOnly],\n [MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_CAUSAL_LM_MAPPING_NAMES, MODEL_TYPES.DecoderOnly],\n [MODEL_FOR_MASKED_LM_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES, MODEL_TYPES.Vision2Seq],\n [MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES, MODEL_TYPES.ImageTextToText],\n [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_MASK_GENERATION_MAPPING_NAMES, MODEL_TYPES.MaskGeneration],\n [MODEL_FOR_CTC_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n\n // Custom:\n [MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n];\n\nfor (const [mappings, type] of MODEL_CLASS_TYPE_MAPPING) {\n // @ts-ignore\n for (const [name, model] of mappings.values()) {\n MODEL_TYPE_MAPPING.set(name, type);\n MODEL_CLASS_TO_NAME_MAPPING.set(model, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, model);\n }\n}\n\nconst CUSTOM_MAPPING = [\n // OVERRIDE:\n // TODO: Refactor to allow class to specify model\n ['MusicgenForConditionalGeneration', MusicgenForConditionalGeneration, MODEL_TYPES.Musicgen],\n\n ['CLIPTextModelWithProjection', CLIPTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['SiglipTextModel', SiglipTextModel, MODEL_TYPES.EncoderOnly],\n ['ClapTextModelWithProjection', ClapTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['ClapAudioModelWithProjection', ClapAudioModelWithProjection, MODEL_TYPES.EncoderOnly],\n]\nfor (const [name, model, type] of CUSTOM_MAPPING) {\n MODEL_TYPE_MAPPING.set(name, type);\n MODEL_CLASS_TO_NAME_MAPPING.set(model, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, model);\n}\n\n\n/**\n * Helper class which is used to instantiate pretrained models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModel.from_pretrained('Xenova/bert-base-uncased');\n */\nexport class AutoModel extends PretrainedMixin {\n /** @type {Map[]} */\n // @ts-ignore\n static MODEL_CLASS_MAPPINGS = MODEL_CLASS_TYPE_MAPPING.map(x => x[0]);\n static BASE_IF_FAIL = true;\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSequenceClassification.from_pretrained('Xenova/distilbert-base-uncased-finetuned-sst-2-english');\n */\nexport class AutoModelForSequenceClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained token classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTokenClassification.from_pretrained('Xenova/distilbert-base-multilingual-cased-ner-hrl');\n */\nexport class AutoModelForTokenClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small');\n */\nexport class AutoModelForSeq2SeqLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence speech-to-text models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSpeechSeq2Seq.from_pretrained('openai/whisper-tiny.en');\n */\nexport class AutoModelForSpeechSeq2Seq extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence text-to-spectrogram models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTextToSpectrogram.from_pretrained('microsoft/speecht5_tts');\n */\nexport class AutoModelForTextToSpectrogram extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained text-to-waveform models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTextToSpectrogram.from_pretrained('facebook/mms-tts-eng');\n */\nexport class AutoModelForTextToWaveform extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained causal language models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForCausalLM.from_pretrained('Xenova/gpt2');\n */\nexport class AutoModelForCausalLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_CAUSAL_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained masked language models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForMaskedLM.from_pretrained('Xenova/bert-base-uncased');\n */\nexport class AutoModelForMaskedLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_MASKED_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained question answering models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForQuestionAnswering.from_pretrained('Xenova/distilbert-base-cased-distilled-squad');\n */\nexport class AutoModelForQuestionAnswering extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained vision-to-sequence models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForVision2Seq.from_pretrained('Xenova/vit-gpt2-image-captioning');\n */\nexport class AutoModelForVision2Seq extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForImageClassification.from_pretrained('Xenova/vit-base-patch16-224');\n */\nexport class AutoModelForImageClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForImageSegmentation.from_pretrained('Xenova/detr-resnet-50-panoptic');\n */\nexport class AutoModelForImageSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSemanticSegmentation.from_pretrained('nvidia/segformer-b3-finetuned-cityscapes-1024-1024');\n */\nexport class AutoModelForSemanticSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForObjectDetection.from_pretrained('Xenova/detr-resnet-50');\n */\nexport class AutoModelForObjectDetection extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES];\n}\n\nexport class AutoModelForZeroShotObjectDetection extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES];\n}\n\n\n/**\n * Helper class which is used to instantiate pretrained mask generation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForMaskGeneration.from_pretrained('Xenova/sam-vit-base');\n */\nexport class AutoModelForMaskGeneration extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_MASK_GENERATION_MAPPING_NAMES];\n}\n\nexport class AutoModelForCTC extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_CTC_MAPPING_NAMES];\n}\n\nexport class AutoModelForAudioClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES];\n}\n\nexport class AutoModelForXVector extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES];\n}\n\nexport class AutoModelForAudioFrameClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES];\n}\n\nexport class AutoModelForDocumentQuestionAnswering extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES];\n}\n\nexport class AutoModelForImageMatting extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES];\n}\n\nexport class AutoModelForImageToImage extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES];\n}\n\nexport class AutoModelForDepthEstimation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES];\n}\n\nexport class AutoModelForImageFeatureExtraction extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES];\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class Seq2SeqLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits The output logits of the model.\n * @param {Tensor} output.past_key_values An tensor of key/value pairs that represent the previous state of the model.\n * @param {Tensor} output.encoder_outputs The output of the encoder in a sequence-to-sequence model.\n * @param {Tensor} [output.decoder_attentions] Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the self-attention heads.\n * @param {Tensor} [output.cross_attentions] Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the weighted average in the cross-attention heads.\n */\n constructor({ logits, past_key_values, encoder_outputs, decoder_attentions = null, cross_attentions = null }) {\n super();\n this.logits = logits;\n this.past_key_values = past_key_values;\n this.encoder_outputs = encoder_outputs;\n this.decoder_attentions = decoder_attentions;\n this.cross_attentions = cross_attentions;\n }\n}\n\n/**\n * Base class for outputs of sentence classification models.\n */\nexport class SequenceClassifierOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits classification (or regression if config.num_labels==1) scores (before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for outputs of XVector models.\n */\nexport class XVectorOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification hidden states before AMSoftmax, of shape `(batch_size, config.xvector_output_dim)`.\n * @param {Tensor} output.embeddings Utterance embeddings used for vector similarity-based retrieval, of shape `(batch_size, config.xvector_output_dim)`.\n */\n constructor({ logits, embeddings }) {\n super();\n this.logits = logits;\n this.embeddings = embeddings;\n }\n}\n\n/**\n * Base class for outputs of token classification models.\n */\nexport class TokenClassifierOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification scores (before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for masked language models outputs.\n */\nexport class MaskedLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for outputs of question answering models.\n */\nexport class QuestionAnsweringModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.start_logits Span-start scores (before SoftMax).\n * @param {Tensor} output.end_logits Span-end scores (before SoftMax).\n */\n constructor({ start_logits, end_logits }) {\n super();\n this.start_logits = start_logits;\n this.end_logits = end_logits;\n }\n}\n\n\n/**\n * Base class for causal language model (or autoregressive) outputs.\n */\nexport class CausalLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before softmax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for causal language model (or autoregressive) outputs.\n */\nexport class CausalLMOutputWithPast extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before softmax).\n * @param {Tensor} output.past_key_values Contains pre-computed hidden-states (key and values in the self-attention blocks)\n * that can be used (see `past_key_values` input) to speed up sequential decoding.\n */\n constructor({ logits, past_key_values }) {\n super();\n this.logits = logits;\n this.past_key_values = past_key_values;\n }\n}\n\nexport class ImageMattingOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.alphas Estimated alpha values, of shape `(batch_size, num_channels, height, width)`.\n */\n constructor({ alphas }) {\n super();\n this.alphas = alphas;\n }\n}\n\n/**\n * Describes the outputs for the VITS model.\n */\nexport class VitsModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.waveform The final audio waveform predicted by the model, of shape `(batch_size, sequence_length)`.\n * @param {Tensor} output.spectrogram The log-mel spectrogram predicted at the output of the flow model.\n * This spectrogram is passed to the Hi-Fi GAN decoder model to obtain the final audio waveform.\n */\n constructor({ waveform, spectrogram }) {\n super();\n this.waveform = waveform;\n this.spectrogram = spectrogram;\n }\n}\n","import { createInferenceSession } from \"../backends/onnx.js\";\nimport { Tensor } from \"../utils/tensor.js\";\n\nconst wrap = async (session_bytes, session_options, name) => {\n const session = await createInferenceSession(\n session_bytes,\n session_options,\n );\n return async (inputs) => {\n const ortFeed = Object.fromEntries(Object.entries(inputs).map(([k, v]) => [k, v.ort_tensor]));\n const outputs = await session.run(ortFeed);\n return new Tensor(outputs[name]);\n }\n}\n\n// In-memory registry of initialized ONNX operators\nexport class TensorOpRegistry {\n static session_options = {\n // TODO: Allow for multiple execution providers\n // executionProviders: ['webgpu'],\n };\n\n static get bilinear_interpolate_4d() {\n if (!this._bilinear_interpolate_4d) {\n this._bilinear_interpolate_4d = wrap(\n new Uint8Array([8, 9, 18, 0, 58, 128, 1, 10, 40, 10, 1, 120, 10, 0, 10, 0, 10, 1, 115, 18, 1, 121, 34, 6, 82, 101, 115, 105, 122, 101, 42, 17, 10, 4, 109, 111, 100, 101, 34, 6, 108, 105, 110, 101, 97, 114, 160, 1, 3, 18, 1, 114, 90, 31, 10, 1, 120, 18, 26, 10, 24, 8, 1, 18, 20, 10, 3, 18, 1, 98, 10, 3, 18, 1, 99, 10, 3, 18, 1, 104, 10, 3, 18, 1, 119, 90, 15, 10, 1, 115, 18, 10, 10, 8, 8, 7, 18, 4, 10, 2, 8, 4, 98, 31, 10, 1, 121, 18, 26, 10, 24, 8, 1, 18, 20, 10, 3, 18, 1, 98, 10, 3, 18, 1, 99, 10, 3, 18, 1, 104, 10, 3, 18, 1, 119, 66, 2, 16, 20]),\n this.session_options,\n 'y',\n );\n }\n return this._bilinear_interpolate_4d;\n }\n\n static get bicubic_interpolate_4d() {\n if (!this._bicubic_interpolate_4d) {\n this._bicubic_interpolate_4d = wrap(\n new Uint8Array([8, 9, 18, 0, 58, 127, 10, 39, 10, 1, 120, 10, 0, 10, 0, 10, 1, 115, 18, 1, 121, 34, 6, 82, 101, 115, 105, 122, 101, 42, 16, 10, 4, 109, 111, 100, 101, 34, 5, 99, 117, 98, 105, 99, 160, 1, 3, 18, 1, 114, 90, 31, 10, 1, 120, 18, 26, 10, 24, 8, 1, 18, 20, 10, 3, 18, 1, 98, 10, 3, 18, 1, 99, 10, 3, 18, 1, 104, 10, 3, 18, 1, 119, 90, 15, 10, 1, 115, 18, 10, 10, 8, 8, 7, 18, 4, 10, 2, 8, 4, 98, 31, 10, 1, 121, 18, 26, 10, 24, 8, 1, 18, 20, 10, 3, 18, 1, 98, 10, 3, 18, 1, 99, 10, 3, 18, 1, 104, 10, 3, 18, 1, 119, 66, 2, 16, 20]),\n this.session_options,\n 'y',\n );\n }\n return this._bicubic_interpolate_4d;\n }\n}","/**\n * @file Pipelines provide a high-level, easy to use, API for running machine learning models.\n * \n * **Example:** Instantiate pipeline using the `pipeline` function.\n * ```javascript\n * import { pipeline } from '@xenova/transformers';\n * \n * const classifier = await pipeline('sentiment-analysis');\n * const output = await classifier('I love transformers!');\n * // [{'label': 'POSITIVE', 'score': 0.999817686}]\n * ```\n * \n * @module pipelines\n */\n\nimport {\n AutoTokenizer,\n PreTrainedTokenizer,\n} from './tokenizers.js';\nimport {\n AutoModel,\n AutoModelForSequenceClassification,\n AutoModelForAudioClassification,\n AutoModelForTokenClassification,\n AutoModelForQuestionAnswering,\n AutoModelForMaskedLM,\n AutoModelForSeq2SeqLM,\n AutoModelForSpeechSeq2Seq,\n AutoModelForTextToWaveform,\n AutoModelForTextToSpectrogram,\n AutoModelForCTC,\n AutoModelForCausalLM,\n AutoModelForVision2Seq,\n AutoModelForImageClassification,\n AutoModelForImageSegmentation,\n AutoModelForSemanticSegmentation,\n AutoModelForObjectDetection,\n AutoModelForZeroShotObjectDetection,\n AutoModelForDocumentQuestionAnswering,\n AutoModelForImageToImage,\n AutoModelForDepthEstimation,\n AutoModelForImageFeatureExtraction,\n PreTrainedModel,\n} from './models.js';\nimport {\n AutoProcessor,\n Processor\n} from './processors.js';\n\nimport {\n Callable,\n} from './utils/generic.js';\n\nimport {\n dispatchCallback,\n pop,\n product,\n} from './utils/core.js';\nimport {\n softmax,\n max,\n getTopItems,\n round,\n} from './utils/maths.js';\nimport {\n read_audio\n} from './utils/audio.js';\nimport {\n Tensor,\n mean_pooling,\n interpolate,\n quantize_embeddings,\n} from './utils/tensor.js';\nimport { RawImage } from './utils/image.js';\n\n\n/**\n * @typedef {string | RawImage | URL} ImageInput\n * @typedef {ImageInput|ImageInput[]} ImagePipelineInputs\n */\n\n/**\n * Prepare images for further tasks.\n * @param {ImagePipelineInputs} images images to prepare.\n * @returns {Promise} returns processed images.\n * @private\n */\nasync function prepareImages(images) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n\n // Possibly convert any non-images to images\n return await Promise.all(images.map(x => RawImage.read(x)));\n}\n\n/**\n * @typedef {string | URL | Float32Array | Float64Array} AudioInput\n * @typedef {AudioInput|AudioInput[]} AudioPipelineInputs\n */\n\n/**\n * Prepare audios for further tasks.\n * @param {AudioPipelineInputs} audios audios to prepare.\n * @param {number} sampling_rate sampling rate of the audios.\n * @returns {Promise} The preprocessed audio data.\n * @private\n */\nasync function prepareAudios(audios, sampling_rate) {\n if (!Array.isArray(audios)) {\n audios = [audios];\n }\n\n return await Promise.all(audios.map(x => {\n if (typeof x === 'string' || x instanceof URL) {\n return read_audio(x, sampling_rate);\n } else if (x instanceof Float64Array) {\n return new Float32Array(x);\n }\n return x;\n }));\n}\n\n/**\n * @typedef {Object} BoundingBox\n * @property {number} xmin The minimum x coordinate of the bounding box.\n * @property {number} ymin The minimum y coordinate of the bounding box.\n * @property {number} xmax The maximum x coordinate of the bounding box.\n * @property {number} ymax The maximum y coordinate of the bounding box.\n */\n\n/**\n * Helper function to convert list [xmin, xmax, ymin, ymax] into object { \"xmin\": xmin, ... }\n * @param {number[]} box The bounding box as a list.\n * @param {boolean} asInteger Whether to cast to integers.\n * @returns {BoundingBox} The bounding box as an object.\n * @private\n */\nfunction get_bounding_box(box, asInteger) {\n if (asInteger) {\n box = box.map(x => x | 0);\n }\n const [xmin, ymin, xmax, ymax] = box;\n\n return { xmin, ymin, xmax, ymax };\n}\n\n\n/**\n * @callback DisposeType Disposes the item.\n * @returns {Promise} A promise that resolves when the item has been disposed.\n * \n * @typedef {Object} Disposable\n * @property {DisposeType} dispose A promise that resolves when the pipeline has been disposed.\n */\n\n/**\n * The Pipeline class is the class from which all pipelines inherit.\n * Refer to this class for methods shared across different pipelines.\n * @extends Callable\n */\nexport class Pipeline extends Callable {\n /**\n * Create a new Pipeline.\n * @param {Object} options An object containing the following properties:\n * @param {string} [options.task] The task of the pipeline. Useful for specifying subtasks.\n * @param {PreTrainedModel} [options.model] The model used by the pipeline.\n * @param {PreTrainedTokenizer} [options.tokenizer=null] The tokenizer used by the pipeline (if any).\n * @param {Processor} [options.processor=null] The processor used by the pipeline (if any).\n */\n constructor({ task, model, tokenizer = null, processor = null }) {\n super();\n this.task = task;\n this.model = model;\n this.tokenizer = tokenizer;\n this.processor = processor;\n }\n\n /** @type {DisposeType} */\n async dispose() {\n await this.model.dispose();\n }\n}\n\n/**\n * @typedef {Object} ModelTokenizerConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {PreTrainedTokenizer} tokenizer The tokenizer used by the pipeline.\n * \n * @typedef {ModelTokenizerConstructorArgs} TextPipelineConstructorArgs An object used to instantiate a text-based pipeline.\n */\n\n/**\n * @typedef {Object} ModelProcessorConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {Processor} processor The processor used by the pipeline.\n * \n * @typedef {ModelProcessorConstructorArgs} AudioPipelineConstructorArgs An object used to instantiate an audio-based pipeline.\n * @typedef {ModelProcessorConstructorArgs} ImagePipelineConstructorArgs An object used to instantiate an image-based pipeline.\n */\n\n\n/**\n * @typedef {Object} ModelTokenizerProcessorConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {PreTrainedTokenizer} tokenizer The tokenizer used by the pipeline.\n * @property {Processor} processor The processor used by the pipeline.\n * \n * @typedef {ModelTokenizerProcessorConstructorArgs} TextAudioPipelineConstructorArgs An object used to instantiate a text- and audio-based pipeline.\n * @typedef {ModelTokenizerProcessorConstructorArgs} TextImagePipelineConstructorArgs An object used to instantiate a text- and image-based pipeline.\n */\n\n/**\n * @typedef {Object} TextClassificationSingle\n * @property {string} label The label predicted.\n * @property {number} score The corresponding probability.\n * @typedef {TextClassificationSingle[]} TextClassificationOutput\n * \n * @typedef {Object} TextClassificationPipelineOptions Parameters specific to text classification pipelines.\n * @property {number} [topk=1] The number of top predictions to be returned.\n * \n * @callback TextClassificationPipelineCallback Classify the text(s) given as inputs.\n * @param {string|string[]} texts The input text(s) to be classified.\n * @param {TextClassificationPipelineOptions} [options] The options to use for text classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {TextPipelineConstructorArgs & TextClassificationPipelineCallback & Disposable} TextClassificationPipelineType\n */\n\n/**\n * Text classification pipeline using any `ModelForSequenceClassification`.\n *\n * **Example:** Sentiment-analysis w/ `Xenova/distilbert-base-uncased-finetuned-sst-2-english`.\n * ```javascript\n * const classifier = await pipeline('sentiment-analysis', 'Xenova/distilbert-base-uncased-finetuned-sst-2-english');\n * const output = await classifier('I love transformers!');\n * // [{ label: 'POSITIVE', score: 0.999788761138916 }]\n * ```\n * \n * **Example:** Multilingual sentiment-analysis w/ `Xenova/bert-base-multilingual-uncased-sentiment` (and return top 5 classes).\n * ```javascript\n * const classifier = await pipeline('sentiment-analysis', 'Xenova/bert-base-multilingual-uncased-sentiment');\n * const output = await classifier('Le meilleur film de tous les temps.', { topk: 5 });\n * // [\n * // { label: '5 stars', score: 0.9610759615898132 },\n * // { label: '4 stars', score: 0.03323351591825485 },\n * // { label: '3 stars', score: 0.0036155181005597115 },\n * // { label: '1 star', score: 0.0011325967498123646 },\n * // { label: '2 stars', score: 0.0009423971059732139 }\n * // ]\n * ```\n * \n * **Example:** Toxic comment classification w/ `Xenova/toxic-bert` (and return all classes).\n * ```javascript\n * const classifier = await pipeline('text-classification', 'Xenova/toxic-bert');\n * const output = await classifier('I hate you!', { topk: null });\n * // [\n * // { label: 'toxic', score: 0.9593140482902527 },\n * // { label: 'insult', score: 0.16187334060668945 },\n * // { label: 'obscene', score: 0.03452680632472038 },\n * // { label: 'identity_hate', score: 0.0223250575363636 },\n * // { label: 'threat', score: 0.019197041168808937 },\n * // { label: 'severe_toxic', score: 0.005651099607348442 }\n * // ]\n * ```\n */\nexport class TextClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TextClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TextClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TextClassificationPipelineCallback} */\n async _call(texts, {\n topk = 1\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n // TODO: Use softmax tensor function\n const function_to_apply =\n this.model.config.problem_type === 'multi_label_classification'\n ? batch => batch.sigmoid().data\n : batch => softmax(batch.data); // single_label_classification (default)\n\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (const batch of outputs.logits) {\n const output = function_to_apply(batch);\n const scores = getTopItems(output, topk);\n\n const vals = scores.map(x => ({\n label: id2label[x[0]],\n score: x[1],\n }));\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return Array.isArray(texts) || topk === 1 ? /** @type {TextClassificationOutput} */ (toReturn) : /** @type {TextClassificationOutput[]} */ (toReturn)[0];\n }\n}\n\n/**\n * @typedef {Object} TokenClassificationSingle\n * @property {string} word The token/word classified. This is obtained by decoding the selected tokens.\n * @property {number} score The corresponding probability for `entity`.\n * @property {string} entity The entity predicted for that token/word.\n * @property {number} index The index of the corresponding token in the sentence.\n * @property {number} [start] The index of the start of the corresponding entity in the sentence.\n * @property {number} [end] The index of the end of the corresponding entity in the sentence.\n * @typedef {TokenClassificationSingle[]} TokenClassificationOutput\n * \n * @typedef {Object} TokenClassificationPipelineOptions Parameters specific to token classification pipelines.\n * @property {string[]} [ignore_labels] A list of labels to ignore.\n * \n * @callback TokenClassificationPipelineCallback Classify each token of the text(s) given as inputs.\n * @param {string|string[]} texts One or several texts (or one list of texts) for token classification.\n * @param {TokenClassificationPipelineOptions} [options] The options to use for token classification.\n * @returns {Promise} The result.\n * \n * @typedef {TextPipelineConstructorArgs & TokenClassificationPipelineCallback & Disposable} TokenClassificationPipelineType\n */\n\n/**\n * Named Entity Recognition pipeline using any `ModelForTokenClassification`.\n * \n * **Example:** Perform named entity recognition with `Xenova/bert-base-NER`.\n * ```javascript\n * const classifier = await pipeline('token-classification', 'Xenova/bert-base-NER');\n * const output = await classifier('My name is Sarah and I live in London');\n * // [\n * // { entity: 'B-PER', score: 0.9980202913284302, index: 4, word: 'Sarah' },\n * // { entity: 'B-LOC', score: 0.9994474053382874, index: 9, word: 'London' }\n * // ]\n * ```\n * \n * **Example:** Perform named entity recognition with `Xenova/bert-base-NER` (and return all labels).\n * ```javascript\n * const classifier = await pipeline('token-classification', 'Xenova/bert-base-NER');\n * const output = await classifier('Sarah lives in the United States of America', { ignore_labels: [] });\n * // [\n * // { entity: 'B-PER', score: 0.9966587424278259, index: 1, word: 'Sarah' },\n * // { entity: 'O', score: 0.9987385869026184, index: 2, word: 'lives' },\n * // { entity: 'O', score: 0.9990072846412659, index: 3, word: 'in' },\n * // { entity: 'O', score: 0.9988298416137695, index: 4, word: 'the' },\n * // { entity: 'B-LOC', score: 0.9995510578155518, index: 5, word: 'United' },\n * // { entity: 'I-LOC', score: 0.9990395307540894, index: 6, word: 'States' },\n * // { entity: 'I-LOC', score: 0.9986724853515625, index: 7, word: 'of' },\n * // { entity: 'I-LOC', score: 0.9975294470787048, index: 8, word: 'America' }\n * // ]\n * ```\n */\nexport class TokenClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TokenClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TokenClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TokenClassificationPipelineCallback} */\n async _call(texts, {\n ignore_labels = ['O'],\n } = {}) {\n\n const isBatched = Array.isArray(texts);\n\n // Run tokenization\n const model_inputs = this.tokenizer(isBatched ? texts : [texts], {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n const logits = outputs.logits;\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (let i = 0; i < logits.dims[0]; ++i) {\n const ids = model_inputs.input_ids[i];\n const batch = logits[i];\n\n // List of tokens that aren't ignored\n const tokens = [];\n for (let j = 0; j < batch.dims[0]; ++j) {\n const tokenData = batch[j];\n const topScoreIndex = max(tokenData.data)[1];\n\n const entity = id2label ? id2label[topScoreIndex] : `LABEL_${topScoreIndex}`;\n if (ignore_labels.includes(entity)) {\n // We predicted a token that should be ignored. So, we skip it.\n continue;\n }\n\n // TODO add option to keep special tokens?\n const word = this.tokenizer.decode([ids[j].item()], { skip_special_tokens: true });\n if (word === '') {\n // Was a special token. So, we skip it.\n continue;\n }\n\n const scores = softmax(tokenData.data);\n\n tokens.push({\n entity: entity,\n score: scores[topScoreIndex],\n index: j,\n word: word,\n\n // TODO: null for now, but will add\n start: null,\n end: null,\n });\n }\n toReturn.push(tokens);\n }\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} QuestionAnsweringOutput\n * @property {number} score The probability associated to the answer.\n * @property {number} [start] The character start index of the answer (in the tokenized version of the input).\n * @property {number} [end] The character end index of the answer (in the tokenized version of the input).\n * @property {string} answer The answer to the question.\n * \n * @typedef {Object} QuestionAnsweringPipelineOptions Parameters specific to question answering pipelines.\n * @property {number} [topk=1] The number of top answer predictions to be returned.\n * \n * @callback QuestionAnsweringPipelineCallback Answer the question(s) given as inputs by using the context(s).\n * @param {string|string[]} question One or several question(s) (must be used in conjunction with the `context` argument).\n * @param {string|string[]} context One or several context(s) associated with the question(s) (must be used in conjunction with the `question` argument).\n * @param {QuestionAnsweringPipelineOptions} [options] The options to use for question answering.\n * @returns {Promise} An array or object containing the predicted answers and scores.\n * \n * @typedef {TextPipelineConstructorArgs & QuestionAnsweringPipelineCallback & Disposable} QuestionAnsweringPipelineType\n */\n\n/**\n * Question Answering pipeline using any `ModelForQuestionAnswering`.\n * \n * **Example:** Run question answering with `Xenova/distilbert-base-uncased-distilled-squad`.\n * ```javascript\n * const answerer = await pipeline('question-answering', 'Xenova/distilbert-base-uncased-distilled-squad');\n * const question = 'Who was Jim Henson?';\n * const context = 'Jim Henson was a nice puppet.';\n * const output = await answerer(question, context);\n * // {\n * // answer: \"a nice puppet\",\n * // score: 0.5768911502526741\n * // }\n * ```\n */\nexport class QuestionAnsweringPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => QuestionAnsweringPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new QuestionAnsweringPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {QuestionAnsweringPipelineCallback} */\n async _call(question, context, {\n topk = 1\n } = {}) {\n\n // Run tokenization\n const inputs = this.tokenizer(question, {\n text_pair: context,\n padding: true,\n truncation: true,\n });\n\n const output = await this.model(inputs);\n\n /** @type {QuestionAnsweringOutput[]} */\n const toReturn = [];\n for (let j = 0; j < output.start_logits.dims[0]; ++j) {\n const ids = inputs.input_ids[j];\n const sepIndex = ids.indexOf(this.tokenizer.sep_token_id);\n\n const s1 = Array.from(softmax(output.start_logits[j].data))\n .map((x, i) => [x, i])\n .filter(x => x[1] > sepIndex);\n const e1 = Array.from(softmax(output.end_logits[j].data))\n .map((x, i) => [x, i])\n .filter(x => x[1] > sepIndex);\n\n const options = product(s1, e1)\n .filter(x => x[0][1] <= x[1][1])\n .map(x => [x[0][1], x[1][1], x[0][0] * x[1][0]])\n .sort((a, b) => b[2] - a[2]);\n\n for (let k = 0; k < Math.min(options.length, topk); ++k) {\n const [start, end, score] = options[k];\n\n const answer_tokens = [...ids].slice(start, end + 1)\n\n const answer = this.tokenizer.decode(answer_tokens, {\n skip_special_tokens: true,\n });\n\n // TODO add start and end?\n // NOTE: HF returns character index\n toReturn.push({\n answer, score\n });\n }\n }\n\n // Mimic HF's return type based on topk\n return (topk === 1) ? toReturn[0] : toReturn;\n }\n}\n\n\n/**\n * @typedef {Object} FillMaskSingle\n * @property {string} sequence The corresponding input with the mask token prediction.\n * @property {number} score The corresponding probability.\n * @property {number} token The predicted token id (to replace the masked one).\n * @property {string} token_str The predicted token (to replace the masked one).\n * @typedef {FillMaskSingle[]} FillMaskOutput\n * \n * @typedef {Object} FillMaskPipelineOptions Parameters specific to fill mask pipelines.\n * @property {number} [topk=5] When passed, overrides the number of predictions to return.\n * \n * @callback FillMaskPipelineCallback Fill the masked token in the text(s) given as inputs.\n * @param {string|string[]} texts One or several texts (or one list of prompts) with masked tokens.\n * @param {FillMaskPipelineOptions} [options] The options to use for masked language modelling.\n * @returns {Promise} An array of objects containing the score, predicted token, predicted token string,\n * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text).\n * If only one input text is given, the output will be an array of objects.\n * @throws {Error} When the mask token is not found in the input text.\n * \n * @typedef {TextPipelineConstructorArgs & FillMaskPipelineCallback & Disposable} FillMaskPipelineType\n */\n\n/**\n * Masked language modeling prediction pipeline using any `ModelWithLMHead`.\n * \n * **Example:** Perform masked language modelling (a.k.a. \"fill-mask\") with `Xenova/bert-base-uncased`.\n * ```javascript\n * const unmasker = await pipeline('fill-mask', 'Xenova/bert-base-cased');\n * const output = await unmasker('The goal of life is [MASK].');\n * // [\n * // { token_str: 'survival', score: 0.06137419492006302, token: 8115, sequence: 'The goal of life is survival.' },\n * // { token_str: 'love', score: 0.03902450203895569, token: 1567, sequence: 'The goal of life is love.' },\n * // { token_str: 'happiness', score: 0.03253183513879776, token: 9266, sequence: 'The goal of life is happiness.' },\n * // { token_str: 'freedom', score: 0.018736306577920914, token: 4438, sequence: 'The goal of life is freedom.' },\n * // { token_str: 'life', score: 0.01859794743359089, token: 1297, sequence: 'The goal of life is life.' }\n * // ]\n * ```\n * \n * **Example:** Perform masked language modelling (a.k.a. \"fill-mask\") with `Xenova/bert-base-cased` (and return top result).\n * ```javascript\n * const unmasker = await pipeline('fill-mask', 'Xenova/bert-base-cased');\n * const output = await unmasker('The Milky Way is a [MASK] galaxy.', { topk: 1 });\n * // [{ token_str: 'spiral', score: 0.6299987435340881, token: 14061, sequence: 'The Milky Way is a spiral galaxy.' }]\n * ```\n */\nexport class FillMaskPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => FillMaskPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new FillMaskPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {FillMaskPipelineCallback} */\n async _call(texts, {\n topk = 5\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n const toReturn = [];\n\n for (let i = 0; i < model_inputs.input_ids.dims[0]; ++i) {\n const ids = model_inputs.input_ids[i];\n const mask_token_index = ids.indexOf(this.tokenizer.mask_token_id)\n\n if (mask_token_index === -1) {\n throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`)\n }\n const logits = outputs.logits[i];\n const itemLogits = logits[mask_token_index];\n\n const scores = getTopItems(softmax(itemLogits.data), topk);\n\n toReturn.push(scores.map(x => {\n const sequence = [...ids];\n sequence[mask_token_index] = x[0];\n\n return {\n score: x[1],\n token: x[0],\n token_str: this.tokenizer.model.vocab[x[0]],\n sequence: this.tokenizer.decode(sequence, { skip_special_tokens: true }),\n }\n }));\n }\n return Array.isArray(texts) ? toReturn : toReturn[0];\n }\n}\n\n\n/**\n * @typedef {Object} Text2TextGenerationSingle\n * @property {string} generated_text The generated text.\n * @typedef {Text2TextGenerationSingle[]} Text2TextGenerationOutput\n * \n * @callback Text2TextGenerationPipelineCallback Generate the output text(s) using text(s) given as inputs.\n * @param {string|string[]} texts Input text for the encoder.\n * @param {import('./generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & Text2TextGenerationPipelineCallback & Disposable} Text2TextGenerationPipelineType\n */\n\n/**\n * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks.\n * \n * **Example:** Text-to-text generation w/ `Xenova/LaMini-Flan-T5-783M`.\n * ```javascript\n * const generator = await pipeline('text2text-generation', 'Xenova/LaMini-Flan-T5-783M');\n * const output = await generator('how can I become more healthy?', {\n * max_new_tokens: 100,\n * });\n * // [{ generated_text: \"To become more healthy, you can: 1. Eat a balanced diet with plenty of fruits, vegetables, whole grains, lean proteins, and healthy fats. 2. Stay hydrated by drinking plenty of water. 3. Get enough sleep and manage stress levels. 4. Avoid smoking and excessive alcohol consumption. 5. Regularly exercise and maintain a healthy weight. 6. Practice good hygiene and sanitation. 7. Seek medical attention if you experience any health issues.\" }]\n * ```\n */\nexport class Text2TextGenerationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => Text2TextGenerationPipelineType} */ (Pipeline)) {\n /** @type {'generated_text'} */\n _key = 'generated_text';\n\n /**\n * Create a new Text2TextGenerationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {Text2TextGenerationPipelineCallback} */\n async _call(texts, generate_kwargs = {}) {\n throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented\n if (!Array.isArray(texts)) {\n texts = [texts];\n }\n\n\n // Add global prefix, if present\n if (this.model.config.prefix) {\n texts = texts.map(x => this.model.config.prefix + x)\n }\n\n // Handle task specific params:\n const task_specific_params = this.model.config.task_specific_params\n if (task_specific_params && task_specific_params[this.task]) {\n // Add prefixes, if present\n if (task_specific_params[this.task].prefix) {\n texts = texts.map(x => task_specific_params[this.task].prefix + x)\n }\n\n // TODO update generation config\n }\n\n const tokenizer = this.tokenizer;\n const tokenizer_options = {\n padding: true,\n truncation: true,\n }\n let input_ids;\n if (this instanceof TranslationPipeline && '_build_translation_inputs' in tokenizer) {\n // TODO: move to Translation pipeline?\n // Currently put here to avoid code duplication\n // @ts-ignore\n input_ids = tokenizer._build_translation_inputs(texts, tokenizer_options, generate_kwargs).input_ids;\n\n } else {\n input_ids = tokenizer(texts, tokenizer_options).input_ids;\n }\n\n const outputTokenIds = await this.model.generate({ inputs: input_ids, ...generate_kwargs });\n\n return tokenizer.batch_decode(/** @type {Tensor} */(outputTokenIds), {\n skip_special_tokens: true,\n }).map(text => ({ [this._key]: text }));\n }\n}\n\n\n/**\n * @typedef {Object} SummarizationSingle\n * @property {string} summary_text The summary text.\n * @typedef {SummarizationSingle[]} SummarizationOutput\n * \n * @callback SummarizationPipelineCallback Summarize the text(s) given as inputs.\n * @param {string|string[]} texts One or several articles (or one list of articles) to summarize.\n * @param {import('./generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & SummarizationPipelineCallback & Disposable} SummarizationPipelineType\n */\n\n/**\n * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline.\n * \n * **Example:** Summarization w/ `Xenova/distilbart-cnn-6-6`.\n * ```javascript\n * const generator = await pipeline('summarization', 'Xenova/distilbart-cnn-6-6');\n * const text = 'The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, ' +\n * 'and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. ' +\n * 'During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest ' +\n * 'man-made structure in the world, a title it held for 41 years until the Chrysler Building in New ' +\n * 'York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to ' +\n * 'the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the ' +\n * 'Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second ' +\n * 'tallest free-standing structure in France after the Millau Viaduct.';\n * const output = await generator(text, {\n * max_new_tokens: 100,\n * });\n * // [{ summary_text: ' The Eiffel Tower is about the same height as an 81-storey building and the tallest structure in Paris. It is the second tallest free-standing structure in France after the Millau Viaduct.' }]\n * ```\n */\nexport class SummarizationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => SummarizationPipelineType} */ (/** @type {any} */ (Text2TextGenerationPipeline))) {\n /** @type {'summary_text'} */\n _key = 'summary_text';\n\n /**\n * Create a new SummarizationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n}\n\n\n/**\n * @typedef {Object} TranslationSingle\n * @property {string} translation_text The translated text.\n * @typedef {TranslationSingle[]} TranslationOutput\n * \n * @callback TranslationPipelineCallback Translate the text(s) given as inputs.\n * @param {string|string[]} texts Texts to be translated.\n * @param {import('./generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & TranslationPipelineCallback & Disposable} TranslationPipelineType\n */\n\n/**\n * Translates text from one language to another.\n * \n * **Example:** Multilingual translation w/ `Xenova/nllb-200-distilled-600M`.\n * \n * See [here](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M');\n * const output = await translator('जीवन एक चॉकलेट बॉक्स की तरह है।', {\n * src_lang: 'hin_Deva', // Hindi\n * tgt_lang: 'fra_Latn', // French\n * });\n * // [{ translation_text: 'La vie est comme une boîte à chocolat.' }]\n * ```\n * \n * **Example:** Multilingual translation w/ `Xenova/m2m100_418M`.\n * \n * See [here](https://huggingface.co/facebook/m2m100_418M#languages-covered)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/m2m100_418M');\n * const output = await translator('生活就像一盒巧克力。', {\n * src_lang: 'zh', // Chinese\n * tgt_lang: 'en', // English\n * });\n * // [{ translation_text: 'Life is like a box of chocolate.' }]\n * ```\n * \n * **Example:** Multilingual translation w/ `Xenova/mbart-large-50-many-to-many-mmt`.\n * \n * See [here](https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt#languages-covered)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/mbart-large-50-many-to-many-mmt');\n * const output = await translator('संयुक्त राष्ट्र के प्रमुख का कहना है कि सीरिया में कोई सैन्य समाधान नहीं है', {\n * src_lang: 'hi_IN', // Hindi\n * tgt_lang: 'fr_XX', // French\n * });\n * // [{ translation_text: 'Le chef des Nations affirme qu 'il n 'y a military solution in Syria.' }]\n * ```\n */\nexport class TranslationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TranslationPipelineType} */ (/** @type {any} */ (Text2TextGenerationPipeline))) {\n /** @type {'translation_text'} */\n _key = 'translation_text';\n\n /**\n * Create a new TranslationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n}\n\nfunction isChat(x) {\n return Array.isArray(x) && x.every(x => 'role' in x && 'content' in x);\n}\n\n/**\n * @typedef {import('./tokenizers.js').Message[]} Chat\n * \n * @typedef {Object} TextGenerationSingle\n * @property {string|Chat} generated_text The generated text.\n * @typedef {TextGenerationSingle[]} TextGenerationOutput\n * \n * @typedef {Object} TextGenerationSpecificParams Parameters specific to text-generation pipelines.\n * @property {boolean} [add_special_tokens] Whether or not to add special tokens when tokenizing the sequences.\n * @property {boolean} [return_full_text=true] If set to `false` only added text is returned, otherwise the full text is returned.\n * @typedef {import('./generation/configuration_utils.js').GenerationConfig & TextGenerationSpecificParams} TextGenerationConfig\n * \n * @callback TextGenerationPipelineCallback Complete the prompt(s) given as inputs.\n * @param {string|string[]|Chat|Chat[]} texts One or several prompts (or one list of prompts) to complete.\n * @param {TextGenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An array or object containing the generated texts.\n * \n * @typedef {TextPipelineConstructorArgs & TextGenerationPipelineCallback & Disposable} TextGenerationPipelineType\n */\n\n/**\n * Language generation pipeline using any `ModelWithLMHead` or `ModelForCausalLM`.\n * This pipeline predicts the words that will follow a specified text prompt.\n * NOTE: For the full list of generation parameters, see [`GenerationConfig`](./utils/generation#module_utils/generation.GenerationConfig).\n * \n * **Example:** Text generation with `Xenova/distilgpt2` (default settings).\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/distilgpt2');\n * const text = 'I enjoy walking with my cute dog,';\n * const output = await generator(text);\n * // [{ generated_text: \"I enjoy walking with my cute dog, and I love to play with the other dogs.\" }]\n * ```\n * \n * **Example:** Text generation with `Xenova/distilgpt2` (custom settings).\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/distilgpt2');\n * const text = 'Once upon a time, there was';\n * const output = await generator(text, {\n * temperature: 2,\n * max_new_tokens: 10,\n * repetition_penalty: 1.5,\n * no_repeat_ngram_size: 2,\n * num_beams: 2,\n * num_return_sequences: 2,\n * });\n * // [{\n * // \"generated_text\": \"Once upon a time, there was an abundance of information about the history and activities that\"\n * // }, {\n * // \"generated_text\": \"Once upon a time, there was an abundance of information about the most important and influential\"\n * // }]\n * ```\n * \n * **Example:** Run code generation with `Xenova/codegen-350M-mono`.\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/codegen-350M-mono');\n * const text = 'def fib(n):';\n * const output = await generator(text, {\n * max_new_tokens: 44,\n * });\n * // [{\n * // generated_text: 'def fib(n):\\n' +\n * // ' if n == 0:\\n' +\n * // ' return 0\\n' +\n * // ' elif n == 1:\\n' +\n * // ' return 1\\n' +\n * // ' else:\\n' +\n * // ' return fib(n-1) + fib(n-2)\\n'\n * // }]\n * ```\n */\nexport class TextGenerationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TextGenerationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TextGenerationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TextGenerationPipelineCallback} */\n async _call(texts, generate_kwargs = {}) {\n throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented\n let isBatched = false;\n let isChatInput = false;\n\n // Normalize inputs\n /** @type {string[]} */\n let inputs;\n if (typeof texts === 'string') {\n inputs = texts = [texts];\n } else if (Array.isArray(texts) && texts.every(x => typeof x === 'string')) {\n isBatched = true;\n inputs = /** @type {string[]} */(texts);\n } else {\n if (isChat(texts)) {\n texts = [/** @type {Chat} */(texts)];\n } else if (Array.isArray(texts) && texts.every(isChat)) {\n isBatched = true;\n } else {\n throw new Error('Input must be a string, an array of strings, a Chat, or an array of Chats');\n }\n isChatInput = true;\n\n // If the input is a chat, we need to apply the chat template\n inputs = /** @type {string[]} */(/** @type {Chat[]} */ (texts).map(\n x => this.tokenizer.apply_chat_template(x, {\n tokenize: false,\n add_generation_prompt: true,\n })\n ));\n }\n\n // By default, do not add special tokens\n const add_special_tokens = generate_kwargs.add_special_tokens ?? false;\n\n // By default, return full text\n const return_full_text = isChatInput\n ? false\n : generate_kwargs.return_full_text ?? true;\n\n this.tokenizer.padding_side = 'left';\n const text_inputs = this.tokenizer(inputs, {\n add_special_tokens,\n padding: true,\n truncation: true,\n });\n\n const outputTokenIds = /** @type {Tensor} */(await this.model.generate({\n // inputs: input_ids,\n // attention_mask,\n ...text_inputs,\n ...generate_kwargs\n }));\n\n let decoded = this.tokenizer.batch_decode(outputTokenIds, {\n skip_special_tokens: true,\n });\n\n\n let promptLengths;\n if (!return_full_text && input_ids.dims.at(-1) > 0) {\n promptLengths = this.tokenizer.batch_decode(input_ids, {\n skip_special_tokens: true,\n }).map(x => x.length);\n }\n\n /** @type {TextGenerationOutput[]} */\n const toReturn = Array.from({ length: texts.length }, _ => []);\n for (let i = 0; i < decoded.length; ++i) {\n const textIndex = Math.floor(i / outputTokenIds.length * texts.length);\n\n if (promptLengths) {\n // Trim the decoded text to only include the generated part\n decoded[i] = decoded[i].slice(promptLengths[textIndex]);\n }\n toReturn[textIndex].push({\n generated_text: isChatInput\n ? [\n ...((/** @type {Chat[]} */(texts)[textIndex])),\n { role: 'assistant', content: decoded[i] },\n ]\n : decoded[i]\n });\n }\n return (!isBatched && toReturn.length === 1) ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {Object} ZeroShotClassificationOutput\n * @property {string} sequence The sequence for which this is the output.\n * @property {string[]} labels The labels sorted by order of likelihood.\n * @property {number[]} scores The probabilities for each of the labels.\n * \n * @typedef {Object} ZeroShotClassificationPipelineOptions Parameters specific to zero-shot classification pipelines.\n * @property {string} [hypothesis_template=\"This example is {}.\"] The template used to turn each\n * candidate label into an NLI-style hypothesis. The candidate label will replace the {} placeholder.\n * @property {boolean} [multi_label=false] Whether or not multiple candidate labels can be true.\n * If `false`, the scores are normalized such that the sum of the label likelihoods for each sequence\n * is 1. If `true`, the labels are considered independent and probabilities are normalized for each\n * candidate by doing a softmax of the entailment score vs. the contradiction score.\n * \n * @callback ZeroShotClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {string|string[]} texts The sequence(s) to classify, will be truncated if the model input is too large.\n * @param {string|string[]} candidate_labels The set of possible class labels to classify each sequence into.\n * Can be a single label, a string of comma-separated labels, or a list of labels.\n * @param {ZeroShotClassificationPipelineOptions} [options] The options to use for zero-shot classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {TextPipelineConstructorArgs & ZeroShotClassificationPipelineCallback & Disposable} ZeroShotClassificationPipelineType\n */\n\n/**\n * NLI-based zero-shot classification pipeline using a `ModelForSequenceClassification`\n * trained on NLI (natural language inference) tasks. Equivalent of `text-classification`\n * pipelines, but these models don't require a hardcoded number of potential classes, they\n * can be chosen at runtime. It usually means it's slower but it is **much** more flexible.\n * \n * **Example:** Zero shot classification with `Xenova/mobilebert-uncased-mnli`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-classification', 'Xenova/mobilebert-uncased-mnli');\n * const text = 'Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.';\n * const labels = [ 'mobile', 'billing', 'website', 'account access' ];\n * const output = await classifier(text, labels);\n * // {\n * // sequence: 'Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.',\n * // labels: [ 'mobile', 'website', 'billing', 'account access' ],\n * // scores: [ 0.5562091040482018, 0.1843621307860853, 0.13942646639336376, 0.12000229877234923 ]\n * // }\n * ```\n * \n * **Example:** Zero shot classification with `Xenova/nli-deberta-v3-xsmall` (multi-label).\n * ```javascript\n * const classifier = await pipeline('zero-shot-classification', 'Xenova/nli-deberta-v3-xsmall');\n * const text = 'I have a problem with my iphone that needs to be resolved asap!';\n * const labels = [ 'urgent', 'not urgent', 'phone', 'tablet', 'computer' ];\n * const output = await classifier(text, labels, { multi_label: true });\n * // {\n * // sequence: 'I have a problem with my iphone that needs to be resolved asap!',\n * // labels: [ 'urgent', 'phone', 'computer', 'tablet', 'not urgent' ],\n * // scores: [ 0.9958870956360275, 0.9923963400697035, 0.002333537946160235, 0.0015134138567598765, 0.0010699384208377163 ]\n * // }\n * ```\n */\nexport class ZeroShotClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => ZeroShotClassificationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ZeroShotClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n // Use model config to get label2id mapping\n this.label2id = Object.fromEntries(\n Object.entries((/** @type {any} */(this).model).config.label2id).map(\n ([k, v]) => [k.toLowerCase(), v]\n )\n );\n\n this.entailment_id = this.label2id['entailment'];\n if (this.entailment_id === undefined) {\n console.warn(\"Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.\");\n this.entailment_id = 2;\n }\n\n this.contradiction_id = this.label2id['contradiction'] ?? this.label2id['not_entailment'];\n if (this.contradiction_id === undefined) {\n console.warn(\"Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.\");\n this.contradiction_id = 0;\n }\n }\n\n /** @type {ZeroShotClassificationPipelineCallback} */\n async _call(texts, candidate_labels, {\n hypothesis_template = \"This example is {}.\",\n multi_label = false,\n } = {}) {\n\n const isBatched = Array.isArray(texts);\n if (!isBatched) {\n texts = [/** @type {string} */ (texts)];\n }\n if (!Array.isArray(candidate_labels)) {\n candidate_labels = [candidate_labels];\n }\n\n // Insert labels into hypothesis template\n const hypotheses = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // How to perform the softmax over the logits:\n // - true: softmax over the entailment vs. contradiction dim for each label independently\n // - false: softmax the \"entailment\" logits over all candidate labels\n const softmaxEach = multi_label || candidate_labels.length === 1;\n\n /** @type {ZeroShotClassificationOutput[]} */\n const toReturn = [];\n for (const premise of texts) {\n const entails_logits = [];\n\n for (const hypothesis of hypotheses) {\n const inputs = this.tokenizer(premise, {\n text_pair: hypothesis,\n padding: true,\n truncation: true,\n })\n const outputs = await this.model(inputs)\n\n if (softmaxEach) {\n entails_logits.push([\n outputs.logits.data[this.contradiction_id],\n outputs.logits.data[this.entailment_id]\n ])\n } else {\n entails_logits.push(outputs.logits.data[this.entailment_id])\n }\n }\n\n /** @type {number[]} */\n const scores = softmaxEach\n ? entails_logits.map(x => softmax(x)[1])\n : softmax(entails_logits);\n\n // Sort by scores (desc) and return scores with indices\n const scores_sorted = scores\n .map((x, i) => [x, i])\n .sort((a, b) => (b[0] - a[0]));\n\n toReturn.push({\n sequence: premise,\n labels: scores_sorted.map(x => candidate_labels[x[1]]),\n scores: scores_sorted.map(x => x[0]),\n });\n }\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} FeatureExtractionPipelineOptions Parameters specific to feature extraction pipelines.\n * @property {'none'|'mean'|'cls'} [pooling=\"none\"] The pooling method to use.\n * @property {boolean} [normalize=false] Whether or not to normalize the embeddings in the last dimension.\n * @property {boolean} [quantize=false] Whether or not to quantize the embeddings.\n * @property {'binary'|'ubinary'} [precision='binary'] The precision to use for quantization. \n * \n * @callback FeatureExtractionPipelineCallback Extract the features of the input(s).\n * @param {string|string[]} texts One or several texts (or one list of texts) to get the features of.\n * @param {FeatureExtractionPipelineOptions} [options] The options to use for feature extraction.\n * @returns {Promise} The features computed by the model.\n * \n * @typedef {TextPipelineConstructorArgs & FeatureExtractionPipelineCallback & Disposable} FeatureExtractionPipelineType\n */\n\n/**\n * Feature extraction pipeline using no model head. This pipeline extracts the hidden\n * states from the base transformer, which can be used as features in downstream tasks.\n * \n * **Example:** Run feature extraction with `bert-base-uncased` (without pooling/normalization).\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });\n * const output = await extractor('This is a simple test.');\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.05939924716949463, 0.021655935794115067, ...],\n * // dims: [1, 8, 768]\n * // }\n * ```\n * \n * **Example:** Run feature extraction with `bert-base-uncased` (with pooling/normalization).\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });\n * const output = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.03373778983950615, -0.010106077417731285, ...],\n * // dims: [1, 768]\n * // }\n * ```\n * \n * **Example:** Calculating embeddings with `sentence-transformers` models.\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');\n * const output = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.09094982594251633, -0.014774246141314507, ...],\n * // dims: [1, 384]\n * // }\n * ```\n * **Example:** Calculating binary embeddings with `sentence-transformers` models.\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');\n * const output = await extractor('This is a simple test.', { pooling: 'mean', quantize: true, precision: 'binary' });\n * // Tensor {\n * // type: 'int8',\n * // data: Int8Array [49, 108, 24, ...],\n * // dims: [1, 48]\n * // }\n * ```\n */\nexport class FeatureExtractionPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => FeatureExtractionPipelineType} */ (Pipeline)) {\n /**\n * Create a new FeatureExtractionPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {FeatureExtractionPipelineCallback} */\n async _call(texts, {\n pooling = /** @type {'none'} */('none'),\n normalize = false,\n quantize = false,\n precision = /** @type {'binary'} */('binary'),\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n // TODO: Provide warning to the user that they might be using model which was not exported\n // specifically for feature extraction\n // console.log(this.model.config)\n // console.log(outputs)\n\n /** @type {Tensor} */\n let result = outputs.last_hidden_state ?? outputs.logits;\n if (pooling === 'none') {\n // Skip pooling\n } else if (pooling === 'mean') {\n result = mean_pooling(result, model_inputs.attention_mask);\n } else if (pooling === 'cls') {\n result = result.slice(null, 0);\n } else {\n throw Error(`Pooling method '${pooling}' not supported.`);\n }\n\n if (normalize) {\n result = result.normalize(2, -1);\n }\n\n if (quantize) {\n result = quantize_embeddings(result, precision);\n }\n\n return result;\n }\n}\n\n\n/**\n * @typedef {Object} ImageFeatureExtractionPipelineOptions Parameters specific to image feature extraction pipelines.\n * @property {boolean} [pool=null] Whether or not to return the pooled output. If set to `false`, the model will return the raw hidden states.\n * \n * @callback ImageFeatureExtractionPipelineCallback Extract the features of the input(s).\n * @param {ImagePipelineInputs} images One or several images (or one list of images) to get the features of.\n * @param {ImageFeatureExtractionPipelineOptions} [options] The options to use for image feature extraction.\n * @returns {Promise} The image features computed by the model.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageFeatureExtractionPipelineCallback & Disposable} ImageFeatureExtractionPipelineType\n */\n\n/**\n * Image feature extraction pipeline using no model head. This pipeline extracts the hidden\n * states from the base transformer, which can be used as features in downstream tasks.\n * \n * **Example:** Perform image feature extraction with `Xenova/vit-base-patch16-224-in21k`.\n * ```javascript\n * const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/vit-base-patch16-224-in21k');\n * const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';\n * const features = await image_feature_extractor(url);\n * // Tensor {\n * // dims: [ 1, 197, 768 ],\n * // type: 'float32',\n * // data: Float32Array(151296) [ ... ],\n * // size: 151296\n * // }\n * ```\n * \n * **Example:** Compute image embeddings with `Xenova/clip-vit-base-patch32`.\n * ```javascript\n * const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/clip-vit-base-patch32');\n * const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';\n * const features = await image_feature_extractor(url);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nexport class ImageFeatureExtractionPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageFeatureExtractionPipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageFeatureExtractionPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageFeatureExtractionPipelineCallback} */\n async _call(images, {\n pool = null,\n } = {}) {\n\n const preparedImages = await prepareImages(images);\n const { pixel_values } = await this.processor(preparedImages);\n const outputs = await this.model({ pixel_values });\n\n /** @type {Tensor} */\n let result;\n if (pool) {\n if (!('pooler_output' in outputs)) {\n throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);\n }\n result = outputs.pooler_output;\n\n } else {\n result = outputs.last_hidden_state ?? outputs.logits ?? outputs.image_embeds;\n }\n return result;\n }\n}\n\n// TODO\n// export class SentenceSimilarityPipeline extends Pipeline {\n// }\n\n/**\n * @typedef {Object} AudioClassificationSingle\n * @property {string} label The label predicted.\n * @property {number} score The corresponding probability.\n * @typedef {AudioClassificationSingle[]} AudioClassificationOutput\n * \n * @typedef {Object} AudioClassificationPipelineOptions Parameters specific to audio classification pipelines.\n * @property {number} [topk=null] The number of top labels that will be returned by the pipeline.\n * If the provided number is `null` or higher than the number of labels available in the model configuration,\n * it will default to the number of labels.\n * \n * @callback AudioClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be classified. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {AudioClassificationPipelineOptions} [options] The options to use for audio classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {AudioPipelineConstructorArgs & AudioClassificationPipelineCallback & Disposable} AudioClassificationPipelineType\n */\n\n/**\n * Audio classification pipeline using any `AutoModelForAudioClassification`.\n * This pipeline predicts the class of a raw waveform or an audio file.\n * \n * **Example:** Perform audio classification with `Xenova/wav2vec2-large-xlsr-53-gender-recognition-librispeech`.\n * ```javascript\n * const classifier = await pipeline('audio-classification', 'Xenova/wav2vec2-large-xlsr-53-gender-recognition-librispeech');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await classifier(url);\n * // [\n * // { label: 'male', score: 0.9981542229652405 },\n * // { label: 'female', score: 0.001845747814513743 }\n * // ]\n * ```\n * \n * **Example:** Perform audio classification with `Xenova/ast-finetuned-audioset-10-10-0.4593` and return top 4 results.\n * ```javascript\n * const classifier = await pipeline('audio-classification', 'Xenova/ast-finetuned-audioset-10-10-0.4593');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cat_meow.wav';\n * const output = await classifier(url, { topk: 4 });\n * // [\n * // { label: 'Meow', score: 0.5617874264717102 },\n * // { label: 'Cat', score: 0.22365376353263855 },\n * // { label: 'Domestic animals, pets', score: 0.1141069084405899 },\n * // { label: 'Animal', score: 0.08985692262649536 },\n * // ]\n * ```\n */\nexport class AudioClassificationPipeline extends (/** @type {new (options: AudioPipelineConstructorArgs) => AudioClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new AudioClassificationPipeline.\n * @param {AudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {AudioClassificationPipelineCallback} */\n async _call(audio, {\n topk = null\n } = {}) {\n\n const single = !Array.isArray(audio);\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n const output = await this.model(inputs);\n const logits = output.logits[0];\n\n const scores = getTopItems(softmax(logits.data), topk);\n\n const vals = scores.map(x => ({\n label: /** @type {string} */ (id2label[x[0]]),\n score: /** @type {number} */ (x[1]),\n }));\n\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n return !single || topk === 1 ? /** @type {AudioClassificationOutput} */ (toReturn) : /** @type {AudioClassificationOutput[]} */ (toReturn)[0];\n }\n}\n\n/**\n * @typedef {Object} ZeroShotAudioClassificationOutput\n * @property {string} label The label identified by the model. It is one of the suggested `candidate_label`.\n * @property {number} score The score attributed by the model for that label (between 0 and 1).\n * \n * @typedef {Object} ZeroShotAudioClassificationPipelineOptions Parameters specific to zero-shot audio classification pipelines.\n * @property {string} [hypothesis_template=\"This is a sound of {}.\"] The sentence used in conjunction with `candidate_labels`\n * to attempt the audio classification by replacing the placeholder with the candidate_labels.\n * Then likelihood is estimated by using `logits_per_audio`.\n * \n * @callback ZeroShotAudioClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be classified. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {string[]} candidate_labels The candidate labels for this audio.\n * @param {ZeroShotAudioClassificationPipelineOptions} [options] The options to use for zero-shot audio classification.\n * @returns {Promise} An array of objects containing the predicted labels and scores.\n * \n * @typedef {TextAudioPipelineConstructorArgs & ZeroShotAudioClassificationPipelineCallback & Disposable} ZeroShotAudioClassificationPipelineType\n */\n\n/**\n * Zero shot audio classification pipeline using `ClapModel`. This pipeline predicts the class of an audio when you\n * provide an audio and a set of `candidate_labels`.\n * \n * **Example**: Perform zero-shot audio classification with `Xenova/clap-htsat-unfused`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-audio-classification', 'Xenova/clap-htsat-unfused');\n * const audio = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/dog_barking.wav';\n * const candidate_labels = ['dog', 'vaccum cleaner'];\n * const scores = await classifier(audio, candidate_labels);\n * // [\n * // { score: 0.9993992447853088, label: 'dog' },\n * // { score: 0.0006007603369653225, label: 'vaccum cleaner' }\n * // ]\n * ```\n */\nexport class ZeroShotAudioClassificationPipeline extends (/** @type {new (options: TextAudioPipelineConstructorArgs) => ZeroShotAudioClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ZeroShotAudioClassificationPipeline.\n * @param {TextAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotAudioClassificationPipelineCallback} */\n async _call(audio, candidate_labels, {\n hypothesis_template = \"This is a sound of {}.\"\n } = {}) {\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n // Insert label into hypothesis template \n const texts = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // Run tokenization\n const text_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const audio_inputs = await this.processor(aud);\n\n // Run model with both text and audio inputs\n const output = await this.model({ ...text_inputs, ...audio_inputs });\n\n // Compute softmax per audio\n const probs = softmax(output.logits_per_audio.data);\n\n toReturn.push([...probs].map((x, i) => ({\n score: x,\n label: candidate_labels[i]\n })));\n }\n return single ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {{stride: number[], input_features: Tensor, is_last: boolean, tokens?: number[], token_timestamps?: number[]}} ChunkCallbackItem\n * @callback ChunkCallback\n * @param {ChunkCallbackItem} chunk The chunk to process.\n */\n\n/**\n * @typedef {Object} Chunk\n * @property {[number, number]} timestamp The start and end timestamp of the chunk in seconds.\n * @property {string} text The recognized text.\n */\n\n/**\n * @typedef {Object} AutomaticSpeechRecognitionOutput\n * @property {string} text The recognized text.\n * @property {Chunk[]} [chunks] When using `return_timestamps`, the `chunks` will become a list\n * containing all the various text chunks identified by the model.\n * \n * @typedef {Object} AutomaticSpeechRecognitionSpecificParams Parameters specific to automatic-speech-recognition pipelines.\n * @property {boolean|'word'} [kwargs.return_timestamps] Whether to return timestamps or not. Default is `false`.\n * @property {number} [kwargs.chunk_length_s] The length of audio chunks to process in seconds. Default is 0 (no chunking).\n * @property {number} [kwargs.stride_length_s] The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to `chunk_length_s / 6`.\n * @property {ChunkCallback} [kwargs.chunk_callback] Callback function to be called with each chunk processed.\n * @property {boolean} [kwargs.force_full_sequences] Whether to force outputting full sequences or not. Default is `false`.\n * @property {string} [kwargs.language] The source language. Default is `null`, meaning it should be auto-detected. Use this to potentially improve performance if the source language is known.\n * @property {string} [kwargs.task] The task to perform. Default is `null`, meaning it should be auto-detected.\n * @property {number[][]} [kwargs.forced_decoder_ids] A list of pairs of integers which indicates a mapping from generation indices to token indices\n * that will be forced before sampling. For example, [[1, 123]] means the second generated token will always be a token of index 123.\n * @property {number} [num_frames] The number of frames in the input audio.\n * @typedef {import('./generation/configuration_utils.js').GenerationConfig & AutomaticSpeechRecognitionSpecificParams} AutomaticSpeechRecognitionConfig\n * \n * @callback AutomaticSpeechRecognitionPipelineCallback Transcribe the audio sequence(s) given as inputs to text.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be transcribed. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {AutomaticSpeechRecognitionConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object containing the transcription text and optionally timestamps if `return_timestamps` is `true`.\n * \n * @typedef {TextAudioPipelineConstructorArgs & AutomaticSpeechRecognitionPipelineCallback & Disposable} AutomaticSpeechRecognitionPipelineType\n */\n\n/**\n * Pipeline that aims at extracting spoken text contained within some audio.\n *\n * **Example:** Transcribe English.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url);\n * // { text: \" And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.\" }\n * ```\n * \n * **Example:** Transcribe English w/ timestamps.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url, { return_timestamps: true });\n * // {\n * // text: \" And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.\"\n * // chunks: [\n * // { timestamp: [0, 8], text: \" And so my fellow Americans ask not what your country can do for you\" }\n * // { timestamp: [8, 11], text: \" ask what you can do for your country.\" }\n * // ]\n * // }\n * ```\n * \n * **Example:** Transcribe English w/ word-level timestamps.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url, { return_timestamps: 'word' });\n * // {\n * // \"text\": \" And so my fellow Americans ask not what your country can do for you ask what you can do for your country.\",\n * // \"chunks\": [\n * // { \"text\": \" And\", \"timestamp\": [0, 0.78] },\n * // { \"text\": \" so\", \"timestamp\": [0.78, 1.06] },\n * // { \"text\": \" my\", \"timestamp\": [1.06, 1.46] },\n * // ...\n * // { \"text\": \" for\", \"timestamp\": [9.72, 9.92] },\n * // { \"text\": \" your\", \"timestamp\": [9.92, 10.22] },\n * // { \"text\": \" country.\", \"timestamp\": [10.22, 13.5] }\n * // ]\n * // }\n * ```\n * \n * **Example:** Transcribe French.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/french-audio.mp3';\n * const output = await transcriber(url, { language: 'french', task: 'transcribe' });\n * // { text: \" J'adore, j'aime, je n'aime pas, je déteste.\" }\n * ```\n * \n * **Example:** Translate French to English.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/french-audio.mp3';\n * const output = await transcriber(url, { language: 'french', task: 'translate' });\n * // { text: \" I love, I like, I don't like, I hate.\" }\n * ```\n * \n * **Example:** Transcribe/translate audio longer than 30 seconds.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/ted_60.wav';\n * const output = await transcriber(url, { chunk_length_s: 30, stride_length_s: 5 });\n * // { text: \" So in college, I was a government major, which means [...] So I'd start off light and I'd bump it up\" }\n * ```\n */\nexport class AutomaticSpeechRecognitionPipeline extends (/** @type {new (options: TextAudioPipelineConstructorArgs) => AutomaticSpeechRecognitionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new AutomaticSpeechRecognitionPipeline.\n * @param {TextAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {AutomaticSpeechRecognitionPipelineCallback} */\n async _call(audio, kwargs = {}) {\n throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented\n switch (this.model.config.model_type) {\n case 'whisper':\n return this._call_whisper(audio, kwargs)\n case 'wav2vec2':\n case 'wav2vec2-bert':\n case 'unispeech':\n case 'unispeech-sat':\n case 'hubert':\n return this._call_wav2vec2(audio, kwargs)\n default:\n throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)\n }\n }\n\n /**\n * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_wav2vec2(audio, kwargs = {}) {\n // TODO use kwargs\n\n if (kwargs.language) {\n console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to \"English\".');\n }\n if (kwargs.task) {\n console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to \"transcribe\".');\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n const output = await this.model(inputs);\n const logits = output.logits[0];\n\n const predicted_ids = [];\n for (const item of logits) {\n predicted_ids.push(max(item.data)[1])\n }\n const predicted_sentences = this.tokenizer.decode(predicted_ids)\n toReturn.push({ text: predicted_sentences })\n }\n return single ? toReturn[0] : toReturn;\n }\n\n /**\n * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_whisper(audio, kwargs = {}) {\n\n const return_timestamps = kwargs.return_timestamps ?? false;\n const chunk_length_s = kwargs.chunk_length_s ?? 0;\n const chunk_callback = kwargs.chunk_callback ?? null;\n const force_full_sequences = kwargs.force_full_sequences ?? false;\n let stride_length_s = kwargs.stride_length_s ?? null;\n\n if (return_timestamps === 'word') {\n kwargs['return_token_timestamps'] = true;\n }\n\n const language = pop(kwargs, 'language', null);\n const task = pop(kwargs, 'task', null);\n\n if (language || task || return_timestamps) {\n if (kwargs.forced_decoder_ids) {\n throw new Error(\"Cannot specify `language`/`task`/`return_timestamps` and `forced_decoder_ids` at the same time.\")\n }\n // @ts-ignore\n const decoder_prompt_ids = this.tokenizer.get_decoder_prompt_ids({ language, task, no_timestamps: !return_timestamps })\n if (decoder_prompt_ids.length > 0) {\n kwargs.forced_decoder_ids = decoder_prompt_ids;\n }\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n const time_precision = this.processor.feature_extractor.config.chunk_length / this.model.config.max_source_positions;\n const hop_length = this.processor.feature_extractor.config.hop_length;\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n /** @type {ChunkCallbackItem[]} */\n let chunks = [];\n if (chunk_length_s > 0) {\n if (stride_length_s === null) {\n stride_length_s = chunk_length_s / 6;\n } else if (chunk_length_s <= stride_length_s) {\n throw Error(\"`chunk_length_s` must be larger than `stride_length_s`.\")\n }\n\n // TODO support different stride_length_s (for left and right)\n\n const window = sampling_rate * chunk_length_s;\n const stride = sampling_rate * stride_length_s;\n const jump = window - 2 * stride;\n let offset = 0;\n\n // Create subarrays of audio with overlaps\n\n while (offset < aud.length) {\n const subarr = aud.subarray(offset, offset + window);\n const feature = await this.processor(subarr);\n\n const isFirst = offset === 0;\n const isLast = offset + jump >= aud.length;\n chunks.push({\n stride: [\n subarr.length,\n isFirst ? 0 : stride,\n isLast ? 0 : stride\n ],\n input_features: feature.input_features,\n is_last: isLast\n })\n offset += jump;\n }\n\n } else {\n chunks = [{\n stride: [aud.length, 0, 0],\n input_features: (await this.processor(aud)).input_features,\n is_last: true\n }]\n }\n\n // Generate for each set of input features\n for (const chunk of chunks) {\n kwargs.num_frames = Math.floor(chunk.stride[0] / hop_length);\n\n // NOTE: doing sequentially for now\n const data = await this.model.generate({ inputs: chunk.input_features, ...kwargs });\n\n // TODO: Right now we only get top beam\n if (return_timestamps === 'word') {\n chunk.tokens = data.sequences[0];\n chunk.token_timestamps = data.token_timestamps.tolist()[0].map(\n (/** @type {number} */ x) => round(x, 2)\n );\n\n } else {\n chunk.tokens = data[0];\n }\n\n // convert stride to seconds\n chunk.stride = chunk.stride.map(x => x / sampling_rate);\n\n if (chunk_callback !== null) {\n chunk_callback(chunk)\n }\n }\n\n // Merge text chunks\n // @ts-ignore\n const [full_text, optional] = this.tokenizer._decode_asr(chunks, {\n time_precision, return_timestamps, force_full_sequences\n });\n\n toReturn.push({ text: full_text, ...optional })\n }\n return single ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {Object} ImageToTextSingle\n * @property {string} generated_text The generated text.\n * @typedef {ImageToTextSingle[]} ImageToTextOutput\n * \n * @callback ImageToTextPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} texts The images to be captioned.\n * @param {import('./generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object (or array of objects) containing the generated text(s).\n * \n * @typedef {TextImagePipelineConstructorArgs & ImageToTextPipelineCallback & Disposable} ImageToTextPipelineType\n */\n\n/**\n * Image To Text pipeline using a `AutoModelForVision2Seq`. This pipeline predicts a caption for a given image.\n * \n * **Example:** Generate a caption for an image w/ `Xenova/vit-gpt2-image-captioning`.\n * ```javascript\n * const captioner = await pipeline('image-to-text', 'Xenova/vit-gpt2-image-captioning');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await captioner(url);\n * // [{ generated_text: 'a cat laying on a couch with another cat' }]\n * ```\n * \n * **Example:** Optical Character Recognition (OCR) w/ `Xenova/trocr-small-handwritten`.\n * ```javascript\n * const captioner = await pipeline('image-to-text', 'Xenova/trocr-small-handwritten');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/handwriting.jpg';\n * const output = await captioner(url);\n * // [{ generated_text: 'Mr. Brown commented icily.' }]\n * ```\n */\nexport class ImageToTextPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ImageToTextPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ImageToTextPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageToTextPipelineCallback} */\n async _call(images, generate_kwargs = {}) {\n throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n const { pixel_values } = await this.processor(preparedImages);\n\n const toReturn = [];\n for (const batch of pixel_values) {\n batch.dims = [1, ...batch.dims]\n const output = await this.model.generate({ inputs: batch, ...generate_kwargs });\n const decoded = this.tokenizer.batch_decode(/** @type {Tensor} */(output), {\n skip_special_tokens: true,\n }).map(x => ({ generated_text: x.trim() }))\n toReturn.push(decoded);\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} ImageClassificationSingle\n * @property {string} label The label identified by the model.\n * @property {number} score The score attributed by the model for that label.\n * @typedef {ImageClassificationSingle[]} ImageClassificationOutput\n * \n * @typedef {Object} ImageClassificationPipelineOptions Parameters specific to image classification pipelines.\n * @property {number} [topk=1] The number of top labels that will be returned by the pipeline. \n * \n * @callback ImageClassificationPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images(s) to be classified.\n * @param {ImageClassificationPipelineOptions} [options] The options to use for image classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageClassificationPipelineCallback & Disposable} ImageClassificationPipelineType\n */\n\n/**\n * Image classification pipeline using any `AutoModelForImageClassification`.\n * This pipeline predicts the class of an image.\n * \n * **Example:** Classify an image.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url);\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // ]\n * ```\n * \n * **Example:** Classify an image and return top `n` classes.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, { topk: 3 });\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // { label: 'tiger cat', score: 0.3634825646877289 },\n * // { label: 'lion, king of beasts, Panthera leo', score: 0.00045060308184474707 },\n * // ]\n * ```\n * \n * **Example:** Classify an image and return all classes.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, { topk: 0 });\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // { label: 'tiger cat', score: 0.3634825646877289 },\n * // { label: 'lion, king of beasts, Panthera leo', score: 0.00045060308184474707 },\n * // { label: 'jaguar, panther, Panthera onca, Felis onca', score: 0.00035465499968267977 },\n * // ...\n * // ]\n * ```\n */\nexport class ImageClassificationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ImageClassificationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageClassificationPipelineCallback} */\n async _call(images, {\n topk = 1\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n const { pixel_values } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values });\n\n const id2label = this.model.config.id2label;\n const toReturn = [];\n for (const batch of output.logits) {\n const scores = getTopItems(softmax(batch.data), topk);\n\n const vals = scores.map(x => ({\n label: id2label[x[0]],\n score: x[1],\n }));\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return isBatched || topk === 1 ? /** @type {ImageClassificationOutput} */ (toReturn) : /** @type {ImageClassificationOutput[]} */ (toReturn)[0];\n }\n\n}\n\n/**\n * @typedef {Object} ImageSegmentationPipelineOutput\n * @property {string} label The label of the segment.\n * @property {number|null} score The score of the segment.\n * @property {RawImage} mask The mask of the segment.\n * \n * @typedef {Object} ImageSegmentationPipelineOptions Parameters specific to image segmentation pipelines.\n * @property {number} [threshold=0.5] Probability threshold to filter out predicted masks.\n * @property {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values.\n * @property {number} [overlap_mask_area_threshold=0.8] Mask overlap threshold to eliminate small, disconnected segments.\n * @property {null|string} [subtask=null] Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`],\n * depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order).\n * @property {number[]} [label_ids_to_fuse=null] List of label ids to fuse. If not set, do not fuse any labels.\n * @property {number[][]} [target_sizes=null] List of target sizes for the input images. If not set, use the original image sizes.\n * \n * @callback ImageSegmentationPipelineCallback Segment the input images.\n * @param {ImagePipelineInputs} images The input images.\n * @param {ImageSegmentationPipelineOptions} [options] The options to use for image segmentation.\n * @returns {Promise} The annotated segments.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageSegmentationPipelineCallback & Disposable} ImageSegmentationPipelineType\n */\n\n/**\n * Image segmentation pipeline using any `AutoModelForXXXSegmentation`.\n * This pipeline predicts masks of objects and their classes.\n * \n * **Example:** Perform image segmentation with `Xenova/detr-resnet-50-panoptic`.\n * ```javascript\n * const segmenter = await pipeline('image-segmentation', 'Xenova/detr-resnet-50-panoptic');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await segmenter(url);\n * // [\n * // { label: 'remote', score: 0.9984649419784546, mask: RawImage { ... } },\n * // { label: 'cat', score: 0.9994316101074219, mask: RawImage { ... } }\n * // ]\n * ```\n */\nexport class ImageSegmentationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageSegmentationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageSegmentationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n this.subtasks_mapping = {\n // Mapping of subtasks to their corresponding post-processing function names.\n panoptic: 'post_process_panoptic_segmentation',\n instance: 'post_process_instance_segmentation',\n semantic: 'post_process_semantic_segmentation'\n }\n }\n\n /** @type {ImageSegmentationPipelineCallback} */\n async _call(images, {\n threshold = 0.5,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8,\n label_ids_to_fuse = null,\n target_sizes = null,\n subtask = null,\n } = {}) {\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Image segmentation pipeline currently only supports a batch size of 1.\");\n }\n\n const preparedImages = await prepareImages(images);\n const imageSizes = preparedImages.map(x => [x.height, x.width]);\n\n const { pixel_values, pixel_mask } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values, pixel_mask });\n\n let fn = null;\n if (subtask !== null) {\n fn = this.subtasks_mapping[subtask];\n } else {\n for (let [task, func] of Object.entries(this.subtasks_mapping)) {\n if (func in this.processor.feature_extractor) {\n fn = this.processor.feature_extractor[func].bind(this.processor.feature_extractor);\n subtask = task;\n break;\n }\n }\n }\n\n const id2label = this.model.config.id2label;\n\n /** @type {ImageSegmentationPipelineOutput[]} */\n const annotation = [];\n if (subtask === 'panoptic' || subtask === 'instance') {\n const processed = fn(\n output,\n threshold,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse,\n target_sizes ?? imageSizes, // TODO FIX?\n )[0];\n\n const segmentation = processed.segmentation;\n\n for (const segment of processed.segments_info) {\n const maskData = new Uint8ClampedArray(segmentation.data.length);\n for (let i = 0; i < segmentation.data.length; ++i) {\n if (segmentation.data[i] === segment.id) {\n maskData[i] = 255;\n }\n }\n\n const mask = new RawImage(maskData, segmentation.dims[1], segmentation.dims[0], 1)\n\n annotation.push({\n score: segment.score,\n label: id2label[segment.label_id],\n mask: mask\n })\n }\n\n } else if (subtask === 'semantic') {\n const { segmentation, labels } = fn(output, target_sizes ?? imageSizes)[0];\n\n for (const label of labels) {\n const maskData = new Uint8ClampedArray(segmentation.data.length);\n for (let i = 0; i < segmentation.data.length; ++i) {\n if (segmentation.data[i] === label) {\n maskData[i] = 255;\n }\n }\n\n const mask = new RawImage(maskData, segmentation.dims[1], segmentation.dims[0], 1);\n\n annotation.push({\n score: null,\n label: id2label[label],\n mask: mask\n });\n }\n } else {\n throw Error(`Subtask ${subtask} not supported.`);\n }\n\n return annotation;\n }\n}\n\n/**\n * @typedef {Object} ZeroShotImageClassificationOutput\n * @property {string} label The label identified by the model. It is one of the suggested `candidate_label`.\n * @property {number} score The score attributed by the model for that label (between 0 and 1).\n * \n * @typedef {Object} ZeroShotImageClassificationPipelineOptions Parameters specific to zero-shot image classification pipelines.\n * @property {string} [hypothesis_template=\"This is a photo of {}\"] The sentence used in conjunction with `candidate_labels`\n * to attempt the image classification by replacing the placeholder with the candidate_labels.\n * Then likelihood is estimated by using `logits_per_image`.\n * \n * @callback ZeroShotImageClassificationPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {string[]} candidate_labels The candidate labels for this image.\n * @param {ZeroShotImageClassificationPipelineOptions} [options] The options to use for zero-shot image classification.\n * @returns {Promise} An array of objects containing the predicted labels and scores.\n * \n * @typedef {TextImagePipelineConstructorArgs & ZeroShotImageClassificationPipelineCallback & Disposable} ZeroShotImageClassificationPipelineType\n */\n\n/**\n * Zero shot image classification pipeline. This pipeline predicts the class of\n * an image when you provide an image and a set of `candidate_labels`.\n * \n * **Example:** Zero shot image classification w/ `Xenova/clip-vit-base-patch32`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, ['tiger', 'horse', 'dog']);\n * // [\n * // { score: 0.9993917942047119, label: 'tiger' },\n * // { score: 0.0003519294841680676, label: 'horse' },\n * // { score: 0.0002562698791734874, label: 'dog' }\n * // ]\n * ```\n */\nexport class ZeroShotImageClassificationPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ZeroShotImageClassificationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ZeroShotImageClassificationPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotImageClassificationPipelineCallback} */\n async _call(images, candidate_labels, {\n hypothesis_template = \"This is a photo of {}\"\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n // Insert label into hypothesis template \n const texts = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // Run tokenization\n const text_inputs = this.tokenizer(texts, {\n padding: this.model.config.model_type === 'siglip' ? 'max_length' : true,\n truncation: true,\n });\n\n // Run processor\n const { pixel_values } = await this.processor(preparedImages);\n\n // Run model with both text and pixel inputs\n const output = await this.model({ ...text_inputs, pixel_values });\n\n const function_to_apply =\n this.model.config.model_type === 'siglip'\n ? batch => batch.sigmoid().data\n : batch => softmax(batch.data);\n\n // Compare each image with each candidate label\n const toReturn = [];\n for (const batch of output.logits_per_image) {\n // Compute softmax per image\n const probs = function_to_apply(batch);\n\n const result = [...probs].map((x, i) => ({\n score: x,\n label: candidate_labels[i]\n }));\n result.sort((a, b) => b.score - a.score); // sort by score in descending order\n toReturn.push(result);\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n\n/**\n * @typedef {Object} ObjectDetectionPipelineSingle\n * @property {string} label The class label identified by the model.\n * @property {number} score The score attributed by the model for that label.\n * @property {BoundingBox} box The bounding box of detected object in image's original size, or as a percentage if `percentage` is set to true.\n * @typedef {ObjectDetectionPipelineSingle[]} ObjectDetectionPipelineOutput\n * \n * @typedef {Object} ObjectDetectionPipelineOptions Parameters specific to object detection pipelines.\n * @property {number} [threshold=0.9] The threshold used to filter boxes by score.\n * @property {boolean} [percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false).\n * \n * @callback ObjectDetectionPipelineCallback Detect objects (bounding boxes & classes) in the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {ObjectDetectionPipelineOptions} [options] The options to use for object detection.\n * @returns {Promise} A list of objects or a list of list of objects. \n * \n * @typedef {ImagePipelineConstructorArgs & ObjectDetectionPipelineCallback & Disposable} ObjectDetectionPipelineType\n */\n\n/**\n * Object detection pipeline using any `AutoModelForObjectDetection`.\n * This pipeline predicts bounding boxes of objects and their classes.\n * \n * **Example:** Run object-detection with `Xenova/detr-resnet-50`.\n * ```javascript\n * const detector = await pipeline('object-detection', 'Xenova/detr-resnet-50');\n * const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await detector(img, { threshold: 0.9 });\n * // [{\n * // score: 0.9976370930671692,\n * // label: \"remote\",\n * // box: { xmin: 31, ymin: 68, xmax: 190, ymax: 118 }\n * // },\n * // ...\n * // {\n * // score: 0.9984092116355896,\n * // label: \"cat\",\n * // box: { xmin: 331, ymin: 19, xmax: 649, ymax: 371 }\n * // }]\n * ```\n */\nexport class ObjectDetectionPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ObjectDetectionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ObjectDetectionPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ObjectDetectionPipelineCallback} */\n async _call(images, {\n threshold = 0.9,\n percentage = false,\n } = {}) {\n\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Object detection pipeline currently only supports a batch size of 1.\");\n }\n const preparedImages = await prepareImages(images);\n\n const imageSizes = percentage ? null : preparedImages.map(x => [x.height, x.width]);\n\n const { pixel_values, pixel_mask } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values, pixel_mask });\n\n // @ts-ignore\n const processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes);\n\n // Add labels\n const id2label = this.model.config.id2label;\n\n // Format output\n /** @type {ObjectDetectionPipelineOutput[]} */\n const result = processed.map(batch => (\n batch.boxes.map((box, i) => ({\n score: batch.scores[i],\n label: id2label[batch.classes[i]],\n box: get_bounding_box(box, !percentage),\n }))\n ))\n\n return isBatched ? result : result[0];\n }\n}\n\n\n/**\n * @typedef {Object} ZeroShotObjectDetectionOutput\n * @property {string} label Text query corresponding to the found object.\n * @property {number} score Score corresponding to the object (between 0 and 1).\n * @property {BoundingBox} box Bounding box of the detected object in image's original size, or as a percentage if `percentage` is set to true.\n * \n * @typedef {Object} ZeroShotObjectDetectionPipelineOptions Parameters specific to zero-shot object detection pipelines.\n * @property {number} [threshold=0.1] The probability necessary to make a prediction.\n * @property {number} [topk=null] The number of top predictions that will be returned by the pipeline.\n * If the provided number is `null` or higher than the number of predictions available, it will default\n * to the number of predictions.\n * @property {boolean} [percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false).\n * \n * @callback ZeroShotObjectDetectionPipelineCallback Detect objects (bounding boxes & classes) in the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {string[]} candidate_labels What the model should recognize in the image.\n * @param {ZeroShotObjectDetectionPipelineOptions} [options] The options to use for zero-shot object detection.\n * @returns {Promise} An array of objects containing the predicted labels, scores, and bounding boxes.\n * \n * @typedef {TextImagePipelineConstructorArgs & ZeroShotObjectDetectionPipelineCallback & Disposable} ZeroShotObjectDetectionPipelineType\n */\n\n/**\n * Zero-shot object detection pipeline. This pipeline predicts bounding boxes of\n * objects when you provide an image and a set of `candidate_labels`.\n * \n * **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32`.\n * ```javascript\n * const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png';\n * const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];\n * const output = await detector(url, candidate_labels);\n * // [\n * // {\n * // score: 0.24392342567443848,\n * // label: 'human face',\n * // box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 }\n * // },\n * // {\n * // score: 0.15129457414150238,\n * // label: 'american flag',\n * // box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 }\n * // },\n * // {\n * // score: 0.13649864494800568,\n * // label: 'helmet',\n * // box: { xmin: 277, ymin: 337, xmax: 511, ymax: 511 }\n * // },\n * // {\n * // score: 0.10262022167444229,\n * // label: 'rocket',\n * // box: { xmin: 352, ymin: -1, xmax: 463, ymax: 287 }\n * // }\n * // ]\n * ```\n * \n * **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32` (returning top 4 matches and setting a threshold).\n * ```javascript\n * const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/beach.png';\n * const candidate_labels = ['hat', 'book', 'sunglasses', 'camera'];\n * const output = await detector(url, candidate_labels, { topk: 4, threshold: 0.05 });\n * // [\n * // {\n * // score: 0.1606510728597641,\n * // label: 'sunglasses',\n * // box: { xmin: 347, ymin: 229, xmax: 429, ymax: 264 }\n * // },\n * // {\n * // score: 0.08935828506946564,\n * // label: 'hat',\n * // box: { xmin: 38, ymin: 174, xmax: 258, ymax: 364 }\n * // },\n * // {\n * // score: 0.08530698716640472,\n * // label: 'camera',\n * // box: { xmin: 187, ymin: 350, xmax: 260, ymax: 411 }\n * // },\n * // {\n * // score: 0.08349756896495819,\n * // label: 'book',\n * // box: { xmin: 261, ymin: 280, xmax: 494, ymax: 425 }\n * // }\n * // ]\n * ```\n */\nexport class ZeroShotObjectDetectionPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ZeroShotObjectDetectionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ZeroShotObjectDetectionPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotObjectDetectionPipelineCallback} */\n async _call(images, candidate_labels, {\n threshold = 0.1,\n topk = null,\n percentage = false,\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n // Run tokenization\n const text_inputs = this.tokenizer(candidate_labels, {\n padding: true,\n truncation: true,\n });\n\n // Run processor\n const model_inputs = await this.processor(preparedImages);\n\n // Since non-maximum suppression is performed for exporting, we need to\n // process each image separately. For more information, see:\n // https://github.com/huggingface/optimum/blob/e3b7efb1257c011db907ef40ab340e795cc5684c/optimum/exporters/onnx/model_configs.py#L1028-L1032\n const toReturn = [];\n for (let i = 0; i < preparedImages.length; ++i) {\n const image = preparedImages[i];\n const imageSize = percentage ? null : [[image.height, image.width]];\n const pixel_values = model_inputs.pixel_values[i].unsqueeze_(0);\n\n // Run model with both text and pixel inputs\n const output = await this.model({ ...text_inputs, pixel_values });\n\n // @ts-ignore\n const processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSize, true)[0];\n let result = processed.boxes.map((box, i) => ({\n score: processed.scores[i],\n label: candidate_labels[processed.classes[i]],\n box: get_bounding_box(box, !percentage),\n })).sort((a, b) => b.score - a.score);\n if (topk !== null) {\n result = result.slice(0, topk);\n }\n toReturn.push(result)\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} DocumentQuestionAnsweringSingle\n * @property {string} answer The generated text.\n * @typedef {DocumentQuestionAnsweringSingle[]} DocumentQuestionAnsweringOutput\n * \n * @callback DocumentQuestionAnsweringPipelineCallback Answer the question given as input by using the document.\n * @param {ImageInput} image The image of the document to use.\n * @param {string} question A question to ask of the document.\n * @param {import('./generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object (or array of objects) containing the answer(s).\n * \n * @typedef {TextImagePipelineConstructorArgs & DocumentQuestionAnsweringPipelineCallback & Disposable} DocumentQuestionAnsweringPipelineType\n */\n\n/**\n * Document Question Answering pipeline using any `AutoModelForDocumentQuestionAnswering`.\n * The inputs/outputs are similar to the (extractive) question answering pipeline; however,\n * the pipeline takes an image (and optional OCR'd words/boxes) as input instead of text context.\n * \n * **Example:** Answer questions about a document with `Xenova/donut-base-finetuned-docvqa`.\n * ```javascript\n * const qa_pipeline = await pipeline('document-question-answering', 'Xenova/donut-base-finetuned-docvqa');\n * const image = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';\n * const question = 'What is the invoice number?';\n * const output = await qa_pipeline(image, question);\n * // [{ answer: 'us-001' }]\n * ```\n */\nexport class DocumentQuestionAnsweringPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => DocumentQuestionAnsweringPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new DocumentQuestionAnsweringPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {DocumentQuestionAnsweringPipelineCallback} */\n async _call(image, question, generate_kwargs = {}) {\n throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented\n\n // NOTE: For now, we only support a batch size of 1\n\n // Preprocess image\n const preparedImage = (await prepareImages(image))[0];\n const { pixel_values } = await this.processor(preparedImage);\n\n // Run tokenization\n const task_prompt = `${question}`;\n const decoder_input_ids = this.tokenizer(task_prompt, {\n add_special_tokens: false,\n padding: true,\n truncation: true,\n }).input_ids;\n\n // Run model\n const output = await this.model.generate({\n inputs: pixel_values,\n max_length: this.model.config.decoder.max_position_embeddings,\n decoder_input_ids,\n ...generate_kwargs,\n });\n\n // Decode output\n const decoded = this.tokenizer.batch_decode(/** @type {Tensor} */(output))[0];\n\n // Parse answer\n const match = decoded.match(/(.*?)<\\/s_answer>/);\n let answer = null;\n if (match && match.length >= 2) {\n answer = match[1].trim();\n }\n return [{ answer }];\n }\n}\n\n\n/**\n * @typedef {Object} VocoderOptions\n * @property {PreTrainedModel} [vocoder] The vocoder used by the pipeline (if the model uses one). If not provided, use the default HifiGan vocoder.\n * @typedef {TextAudioPipelineConstructorArgs & VocoderOptions} TextToAudioPipelineConstructorArgs\n */\n\n/**\n * @typedef {Object} TextToAudioOutput\n * @property {Float32Array} audio The generated audio waveform.\n * @property {number} sampling_rate The sampling rate of the generated audio waveform.\n * \n * @typedef {Object} TextToAudioPipelineOptions Parameters specific to text-to-audio pipelines.\n * @property {Tensor|Float32Array|string|URL} [speaker_embeddings=null] The speaker embeddings (if the model requires it).\n * \n * @callback TextToAudioPipelineCallback Generates speech/audio from the inputs.\n * @param {string|string[]} texts The text(s) to generate.\n * @param {TextToAudioPipelineOptions} options Parameters passed to the model generation/forward method.\n * @returns {Promise} An object containing the generated audio and sampling rate.\n * \n * @typedef {TextToAudioPipelineConstructorArgs & TextToAudioPipelineCallback & Disposable} TextToAudioPipelineType\n */\n\n/**\n * Text-to-audio generation pipeline using any `AutoModelForTextToWaveform` or `AutoModelForTextToSpectrogram`.\n * This pipeline generates an audio file from an input text and optional other conditional inputs.\n * \n * **Example:** Generate audio from text with `Xenova/speecht5_tts`.\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'Xenova/speecht5_tts', { quantized: false });\n * const speaker_embeddings = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin';\n * const out = await synthesizer('Hello, my dog is cute', { speaker_embeddings });\n * // {\n * // audio: Float32Array(26112) [-0.00005657337896991521, 0.00020583874720614403, ...],\n * // sampling_rate: 16000\n * // }\n * ```\n * \n * You can then save the audio to a .wav file with the `wavefile` package:\n * ```javascript\n * import wavefile from 'wavefile';\n * import fs from 'fs';\n * \n * const wav = new wavefile.WaveFile();\n * wav.fromScratch(1, out.sampling_rate, '32f', out.audio);\n * fs.writeFileSync('out.wav', wav.toBuffer());\n * ```\n * \n * **Example:** Multilingual speech generation with `Xenova/mms-tts-fra`. See [here](https://huggingface.co/models?pipeline_tag=text-to-speech&other=vits&sort=trending) for the full list of available languages (1107).\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'Xenova/mms-tts-fra');\n * const out = await synthesizer('Bonjour');\n * // {\n * // audio: Float32Array(23808) [-0.00037693005288019776, 0.0003325853613205254, ...],\n * // sampling_rate: 16000\n * // }\n * ```\n */\nexport class TextToAudioPipeline extends (/** @type {new (options: TextToAudioPipelineConstructorArgs) => TextToAudioPipelineType} */ (Pipeline)) {\n DEFAULT_VOCODER_ID = \"Xenova/speecht5_hifigan\"\n\n /**\n * Create a new TextToAudioPipeline.\n * @param {TextToAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n // TODO: Find a better way for `pipeline` to set the default vocoder\n this.vocoder = options.vocoder ?? null;\n }\n\n\n /** @type {TextToAudioPipelineCallback} */\n async _call(text_inputs, {\n speaker_embeddings = null,\n } = {}) {\n throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented\n\n // If this.processor is not set, we are using a `AutoModelForTextToWaveform` model\n if (this.processor) {\n return this._call_text_to_spectrogram(text_inputs, { speaker_embeddings });\n } else {\n return this._call_text_to_waveform(text_inputs);\n }\n }\n\n async _call_text_to_waveform(text_inputs) {\n\n // Run tokenization\n const inputs = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // Generate waveform\n const { waveform } = await this.model(inputs);\n\n const sampling_rate = this.model.config.sampling_rate;\n return {\n audio: waveform.data,\n sampling_rate,\n }\n }\n\n async _call_text_to_spectrogram(text_inputs, { speaker_embeddings }) {\n\n // Load vocoder, if not provided\n if (!this.vocoder) {\n console.log('No vocoder specified, using default HifiGan vocoder.');\n this.vocoder = await AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID, { dtype: 'fp32' });\n }\n\n // Load speaker embeddings as Float32Array from path/URL\n if (typeof speaker_embeddings === 'string' || speaker_embeddings instanceof URL) {\n // Load from URL with fetch\n speaker_embeddings = new Float32Array(\n await (await fetch(speaker_embeddings)).arrayBuffer()\n );\n }\n\n if (speaker_embeddings instanceof Float32Array) {\n speaker_embeddings = new Tensor(\n 'float32',\n speaker_embeddings,\n [1, speaker_embeddings.length]\n )\n } else if (!(speaker_embeddings instanceof Tensor)) {\n throw new Error(\"Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.\")\n }\n\n // Run tokenization\n const { input_ids } = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // NOTE: At this point, we are guaranteed that `speaker_embeddings` is a `Tensor`\n // @ts-ignore\n const { waveform } = await this.model.generate_speech(input_ids, speaker_embeddings, { vocoder: this.vocoder });\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n return {\n audio: waveform.data,\n sampling_rate,\n }\n }\n}\n\n/**\n * @callback ImageToImagePipelineCallback Transform the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The images to transform.\n * @returns {Promise} The transformed image or list of images.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageToImagePipelineCallback & Disposable} ImageToImagePipelineType\n */\n\n/**\n * Image to Image pipeline using any `AutoModelForImageToImage`. This pipeline generates an image based on a previous image input.\n * \n * **Example:** Super-resolution w/ `Xenova/swin2SR-classical-sr-x2-64`\n * ```javascript\n * const upscaler = await pipeline('image-to-image', 'Xenova/swin2SR-classical-sr-x2-64');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';\n * const output = await upscaler(url);\n * // RawImage {\n * // data: Uint8Array(786432) [ 41, 31, 24, 43, ... ],\n * // width: 512,\n * // height: 512,\n * // channels: 3\n * // }\n * ```\n */\nexport class ImageToImagePipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageToImagePipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageToImagePipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageToImagePipelineCallback} */\n async _call(images) {\n\n const preparedImages = await prepareImages(images);\n const inputs = await this.processor(preparedImages);\n const outputs = await this.model(inputs);\n\n /** @type {RawImage[]} */\n const toReturn = [];\n for (const batch of outputs.reconstruction) {\n const output = batch.squeeze().clamp_(0, 1).mul_(255).round_().to('uint8');\n toReturn.push(RawImage.fromTensor(output));\n }\n\n return toReturn.length > 1 ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} DepthEstimationPipelineOutput\n * @property {Tensor} predicted_depth The raw depth map predicted by the model.\n * @property {RawImage} depth The processed depth map as an image (with the same size as the input image).\n * \n * @callback DepthEstimationPipelineCallback Predicts the depth for the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The images to compute depth for.\n * @returns {Promise} An image or a list of images containing result(s).\n * \n * @typedef {ImagePipelineConstructorArgs & DepthEstimationPipelineCallback & Disposable} DepthEstimationPipelineType\n */\n\n/**\n * Depth estimation pipeline using any `AutoModelForDepthEstimation`. This pipeline predicts the depth of an image.\n * \n * **Example:** Depth estimation w/ `Xenova/dpt-hybrid-midas`\n * ```javascript\n * const depth_estimator = await pipeline('depth-estimation', 'Xenova/dpt-hybrid-midas');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const out = await depth_estimator(url);\n * // {\n * // predicted_depth: Tensor {\n * // dims: [ 384, 384 ],\n * // type: 'float32',\n * // data: Float32Array(147456) [ 542.859130859375, 545.2833862304688, 546.1649169921875, ... ],\n * // size: 147456\n * // },\n * // depth: RawImage {\n * // data: Uint8Array(307200) [ 86, 86, 86, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * // }\n * ```\n */\nexport class DepthEstimationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => DepthEstimationPipelineType} */ (Pipeline)) {\n /**\n * Create a new DepthEstimationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {DepthEstimationPipelineCallback} */\n async _call(images) {\n\n const preparedImages = await prepareImages(images);\n\n const inputs = await this.processor(preparedImages);\n const { predicted_depth } = await this.model(inputs);\n\n const toReturn = [];\n for (let i = 0; i < preparedImages.length; ++i) {\n const prediction = interpolate(predicted_depth[i], preparedImages[i].size.reverse(), 'bilinear', false);\n const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n toReturn.push({\n predicted_depth: predicted_depth[i],\n depth: RawImage.fromTensor(formatted),\n });\n }\n\n return toReturn.length > 1 ? toReturn : toReturn[0];\n }\n}\n\nconst SUPPORTED_TASKS = Object.freeze({\n \"text-classification\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": TextClassificationPipeline,\n \"model\": AutoModelForSequenceClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"distilbert-base-uncased-finetuned-sst-2-english\",\n \"model\": \"Xenova/distilbert-base-uncased-finetuned-sst-2-english\",\n },\n \"type\": \"text\",\n },\n \"token-classification\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": TokenClassificationPipeline,\n \"model\": AutoModelForTokenClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"Davlan/bert-base-multilingual-cased-ner-hrl\",\n \"model\": \"Xenova/bert-base-multilingual-cased-ner-hrl\",\n },\n \"type\": \"text\",\n },\n \"question-answering\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": QuestionAnsweringPipeline,\n \"model\": AutoModelForQuestionAnswering,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"distilbert-base-cased-distilled-squad\",\n \"model\": \"Xenova/distilbert-base-cased-distilled-squad\",\n },\n \"type\": \"text\",\n },\n\n \"fill-mask\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": FillMaskPipeline,\n \"model\": AutoModelForMaskedLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"bert-base-uncased\",\n \"model\": \"Xenova/bert-base-uncased\",\n },\n \"type\": \"text\",\n },\n \"summarization\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": SummarizationPipeline,\n \"model\": AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"sshleifer/distilbart-cnn-6-6\",\n \"model\": \"Xenova/distilbart-cnn-6-6\",\n },\n \"type\": \"text\",\n },\n \"translation\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": TranslationPipeline,\n \"model\": AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"t5-small\",\n \"model\": \"Xenova/t5-small\",\n },\n \"type\": \"text\",\n },\n \"text2text-generation\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": Text2TextGenerationPipeline,\n \"model\": AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/flan-t5-small\",\n \"model\": \"Xenova/flan-t5-small\",\n },\n \"type\": \"text\",\n },\n \"text-generation\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": TextGenerationPipeline,\n \"model\": AutoModelForCausalLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"gpt2\",\n \"model\": \"Xenova/gpt2\",\n },\n \"type\": \"text\",\n },\n \"zero-shot-classification\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": ZeroShotClassificationPipeline,\n \"model\": AutoModelForSequenceClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"typeform/distilbert-base-uncased-mnli\",\n \"model\": \"Xenova/distilbert-base-uncased-mnli\",\n },\n \"type\": \"text\",\n },\n \"audio-classification\": {\n \"pipeline\": AudioClassificationPipeline,\n \"model\": AutoModelForAudioClassification,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"superb/wav2vec2-base-superb-ks\",\n \"model\": \"Xenova/wav2vec2-base-superb-ks\",\n },\n \"type\": \"audio\",\n },\n \"zero-shot-audio-classification\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": ZeroShotAudioClassificationPipeline,\n \"model\": AutoModel,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"laion/clap-htsat-fused\",\n \"model\": \"Xenova/clap-htsat-unfused\",\n },\n \"type\": \"multimodal\",\n },\n \"automatic-speech-recognition\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": AutomaticSpeechRecognitionPipeline,\n \"model\": [AutoModelForSpeechSeq2Seq, AutoModelForCTC],\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"openai/whisper-tiny.en\",\n \"model\": \"Xenova/whisper-tiny.en\",\n },\n \"type\": \"multimodal\",\n },\n \"text-to-audio\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": TextToAudioPipeline,\n \"model\": [AutoModelForTextToWaveform, AutoModelForTextToSpectrogram],\n \"processor\": [AutoProcessor, /* Some don't use a processor */ null],\n \"default\": {\n // TODO: replace with original\n // \"model\": \"microsoft/speecht5_tts\",\n \"model\": \"Xenova/speecht5_tts\",\n },\n \"type\": \"text\",\n },\n \"image-to-text\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": ImageToTextPipeline,\n \"model\": AutoModelForVision2Seq,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"nlpconnect/vit-gpt2-image-captioning\",\n \"model\": \"Xenova/vit-gpt2-image-captioning\",\n },\n \"type\": \"multimodal\",\n },\n\n \"image-classification\": {\n // no tokenizer\n \"pipeline\": ImageClassificationPipeline,\n \"model\": AutoModelForImageClassification,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/vit-base-patch16-224\",\n \"model\": \"Xenova/vit-base-patch16-224\",\n },\n \"type\": \"multimodal\",\n },\n\n \"image-segmentation\": {\n // no tokenizer\n \"pipeline\": ImageSegmentationPipeline,\n \"model\": [AutoModelForImageSegmentation, AutoModelForSemanticSegmentation],\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"facebook/detr-resnet-50-panoptic\",\n \"model\": \"Xenova/detr-resnet-50-panoptic\",\n },\n \"type\": \"multimodal\",\n },\n\n \"zero-shot-image-classification\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": ZeroShotImageClassificationPipeline,\n \"model\": AutoModel,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"openai/clip-vit-base-patch32\",\n \"model\": \"Xenova/clip-vit-base-patch32\",\n },\n \"type\": \"multimodal\",\n },\n\n \"object-detection\": {\n // no tokenizer\n \"pipeline\": ObjectDetectionPipeline,\n \"model\": AutoModelForObjectDetection,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"facebook/detr-resnet-50\",\n \"model\": \"Xenova/detr-resnet-50\",\n },\n \"type\": \"multimodal\",\n },\n \"zero-shot-object-detection\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": ZeroShotObjectDetectionPipeline,\n \"model\": AutoModelForZeroShotObjectDetection,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/owlvit-base-patch32\",\n \"model\": \"Xenova/owlvit-base-patch32\",\n },\n \"type\": \"multimodal\",\n },\n \"document-question-answering\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": DocumentQuestionAnsweringPipeline,\n \"model\": AutoModelForDocumentQuestionAnswering,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"naver-clova-ix/donut-base-finetuned-docvqa\",\n \"model\": \"Xenova/donut-base-finetuned-docvqa\",\n },\n \"type\": \"multimodal\",\n },\n \"image-to-image\": {\n // no tokenizer\n \"pipeline\": ImageToImagePipeline,\n \"model\": AutoModelForImageToImage,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"caidas/swin2SR-classical-sr-x2-64\",\n \"model\": \"Xenova/swin2SR-classical-sr-x2-64\",\n },\n \"type\": \"image\",\n },\n \"depth-estimation\": {\n // no tokenizer\n \"pipeline\": DepthEstimationPipeline,\n \"model\": AutoModelForDepthEstimation,\n \"processor\": AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"Intel/dpt-large\",\n \"model\": \"Xenova/dpt-large\",\n },\n \"type\": \"image\",\n },\n\n // This task serves as a useful interface for dealing with sentence-transformers (https://huggingface.co/sentence-transformers).\n \"feature-extraction\": {\n \"tokenizer\": AutoTokenizer,\n \"pipeline\": FeatureExtractionPipeline,\n \"model\": AutoModel,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"sentence-transformers/all-MiniLM-L6-v2\",\n \"model\": \"Xenova/all-MiniLM-L6-v2\",\n },\n \"type\": \"text\",\n },\n \"image-feature-extraction\": {\n \"processor\": AutoProcessor,\n \"pipeline\": ImageFeatureExtractionPipeline,\n \"model\": [AutoModelForImageFeatureExtraction, AutoModel],\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/vit-base-patch16-224\",\n \"model\": \"Xenova/vit-base-patch16-224-in21k\",\n },\n \"type\": \"image\",\n },\n})\n\n\n// TODO: Add types for TASK_ALIASES\nconst TASK_ALIASES = Object.freeze({\n \"sentiment-analysis\": \"text-classification\",\n \"ner\": \"token-classification\",\n // \"vqa\": \"visual-question-answering\", // TODO: Add\n \"asr\": \"automatic-speech-recognition\",\n \"text-to-speech\": \"text-to-audio\",\n\n // Add for backwards compatibility\n \"embeddings\": \"feature-extraction\",\n});\n\n/**\n * @typedef {keyof typeof SUPPORTED_TASKS} TaskType\n * @typedef {keyof typeof TASK_ALIASES} AliasType\n * @typedef {TaskType | AliasType} PipelineType All possible pipeline types.\n * @typedef {{[K in TaskType]: InstanceType}} SupportedTasks A mapping of pipeline names to their corresponding pipeline classes.\n * @typedef {{[K in AliasType]: InstanceType}} AliasTasks A mapping from pipeline aliases to their corresponding pipeline classes.\n * @typedef {SupportedTasks & AliasTasks} AllTasks A mapping from all pipeline names and aliases to their corresponding pipeline classes.\n */\n\n/**\n * Utility factory method to build a `Pipeline` object.\n * \n * @template {PipelineType} T The type of pipeline to return.\n * @param {T} task The task defining which pipeline will be returned. Currently accepted tasks are:\n * - `\"audio-classification\"`: will return a `AudioClassificationPipeline`.\n * - `\"automatic-speech-recognition\"`: will return a `AutomaticSpeechRecognitionPipeline`.\n * - `\"depth-estimation\"`: will return a `DepthEstimationPipeline`.\n * - `\"document-question-answering\"`: will return a `DocumentQuestionAnsweringPipeline`.\n * - `\"feature-extraction\"`: will return a `FeatureExtractionPipeline`.\n * - `\"fill-mask\"`: will return a `FillMaskPipeline`.\n * - `\"image-classification\"`: will return a `ImageClassificationPipeline`.\n * - `\"image-segmentation\"`: will return a `ImageSegmentationPipeline`.\n * - `\"image-to-text\"`: will return a `ImageToTextPipeline`.\n * - `\"object-detection\"`: will return a `ObjectDetectionPipeline`.\n * - `\"question-answering\"`: will return a `QuestionAnsweringPipeline`.\n * - `\"summarization\"`: will return a `SummarizationPipeline`.\n * - `\"text2text-generation\"`: will return a `Text2TextGenerationPipeline`.\n * - `\"text-classification\"` (alias \"sentiment-analysis\" available): will return a `TextClassificationPipeline`.\n * - `\"text-generation\"`: will return a `TextGenerationPipeline`.\n * - `\"token-classification\"` (alias \"ner\" available): will return a `TokenClassificationPipeline`.\n * - `\"translation\"`: will return a `TranslationPipeline`.\n * - `\"translation_xx_to_yy\"`: will return a `TranslationPipeline`.\n * - `\"zero-shot-classification\"`: will return a `ZeroShotClassificationPipeline`.\n * - `\"zero-shot-audio-classification\"`: will return a `ZeroShotAudioClassificationPipeline`.\n * - `\"zero-shot-image-classification\"`: will return a `ZeroShotImageClassificationPipeline`.\n * - `\"zero-shot-object-detection\"`: will return a `ZeroShotObjectDetectionPipeline`.\n * @param {string} [model=null] The name of the pre-trained model to use. If not specified, the default model for the task will be used.\n * @param {import('./utils/hub.js').PretrainedModelOptions} [options] Optional parameters for the pipeline.\n * @returns {Promise} A Pipeline object for the specified task.\n * @throws {Error} If an unsupported pipeline is requested.\n */\nexport async function pipeline(\n task,\n model = null,\n {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n device = null,\n dtype = null,\n model_file_name = null,\n session_options = {},\n } = {}\n) {\n // Helper method to construct pipeline\n\n // Apply aliases\n // @ts-ignore\n task = TASK_ALIASES[task] ?? task;\n\n // Get pipeline info\n const pipelineInfo = SUPPORTED_TASKS[task.split('_', 1)[0]];\n if (!pipelineInfo) {\n throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`)\n }\n\n // Use model if specified, otherwise, use default\n if (!model) {\n model = pipelineInfo.default.model\n console.log(`No model specified. Using default model: \"${model}\".`);\n }\n\n const pretrainedOptions = {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n device,\n dtype,\n model_file_name,\n session_options,\n }\n\n const classes = new Map([\n ['tokenizer', pipelineInfo.tokenizer],\n ['model', pipelineInfo.model],\n ['processor', pipelineInfo.processor],\n ]);\n\n // Load model, tokenizer, and processor (if they exist)\n const results = await loadItems(classes, model, pretrainedOptions);\n results.task = task;\n\n dispatchCallback(progress_callback, {\n 'status': 'ready',\n 'task': task,\n 'model': model,\n });\n\n const pipelineClass = pipelineInfo.pipeline;\n return new pipelineClass(results);\n}\n\n\n/**\n * Helper function to get applicable model, tokenizer, or processor classes for a given model.\n * @param {Map} mapping The mapping of names to classes, arrays of classes, or null.\n * @param {string} model The name of the model to load.\n * @param {import('./utils/hub.js').PretrainedOptions} pretrainedOptions The options to pass to the `from_pretrained` method.\n * @private\n */\nasync function loadItems(mapping, model, pretrainedOptions) {\n\n const result = Object.create(null);\n\n /**@type {Promise[]} */\n const promises = [];\n for (let [name, cls] of mapping.entries()) {\n if (!cls) continue;\n\n /**@type {Promise} */\n let promise;\n if (Array.isArray(cls)) {\n promise = new Promise(async (resolve, reject) => {\n let e;\n for (let c of cls) {\n if (c === null) {\n // If null, we resolve it immediately, meaning the relevant\n // class was not found, but it is optional.\n resolve(null);\n return;\n }\n try {\n resolve(await c.from_pretrained(model, pretrainedOptions));\n return;\n } catch (err) {\n if (err.message?.includes('Unsupported model type')) {\n // If the error is due to an unsupported model type, we\n // save the error and try the next class.\n e = err;\n } else {\n reject(err);\n return;\n }\n\n }\n }\n reject(e);\n })\n } else {\n promise = cls.from_pretrained(model, pretrainedOptions);\n }\n\n result[name] = promise;\n promises.push(promise);\n }\n\n // Wait for all promises to resolve (in parallel)\n await Promise.all(promises);\n\n // Then assign to result\n for (let [name, promise] of Object.entries(result)) {\n result[name] = await promise;\n }\n\n return result;\n}","\n/**\n * @file Processors are used to prepare non-textual inputs (e.g., image or audio) for a model.\n * \n * **Example:** Using a `WhisperProcessor` to prepare an audio input for a model.\n * ```javascript\n * import { AutoProcessor, read_audio } from '@xenova/transformers';\n *\n * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * let audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * let { input_features } = await processor(audio);\n * // Tensor {\n * // data: Float32Array(240000) [0.4752984642982483, 0.5597258806228638, 0.56434166431427, ...],\n * // dims: [1, 80, 3000],\n * // type: 'float32',\n * // size: 240000,\n * // }\n * ```\n * \n * @module processors\n */\nimport {\n Callable,\n} from './utils/generic.js';\n\nimport {\n calculateDimensions,\n calculateReflectOffset,\n} from './utils/core.js';\n\nimport {\n getModelJSON,\n} from './utils/hub.js';\n\nimport {\n min,\n max,\n softmax,\n bankers_round,\n} from './utils/maths.js';\n\n\nimport { Tensor, permute, cat, interpolate, stack, interpolate_4d } from './utils/tensor.js';\n\nimport { RawImage } from './utils/image.js';\nimport {\n window_function,\n spectrogram,\n mel_filter_bank,\n} from './utils/audio.js';\n\n\n// Helper functions\n\n/**\n * Converts bounding boxes from center format to corners format.\n * \n * @param {number[]} arr The coordinate for the center of the box and its width, height dimensions (center_x, center_y, width, height)\n * @returns {number[]} The coodinates for the top-left and bottom-right corners of the box (top_left_x, top_left_y, bottom_right_x, bottom_right_y)\n */\nfunction center_to_corners_format([centerX, centerY, width, height]) {\n return [\n centerX - width / 2,\n centerY - height / 2,\n centerX + width / 2,\n centerY + height / 2\n ];\n}\n\n/**\n * Post-processes the outputs of the model (for object detection).\n * @param {Object} outputs The outputs of the model that must be post-processed\n * @param {Tensor} outputs.logits The logits\n * @param {Tensor} outputs.pred_boxes The predicted boxes.\n * @param {number} [threshold=0.5] The threshold to use for the scores.\n * @param {number[][]} [target_sizes=null] The sizes of the original images.\n * @param {boolean} [is_zero_shot=false] Whether zero-shot object detection was performed.\n * @return {Object[]} An array of objects containing the post-processed outputs.\n * @private\n */\nfunction post_process_object_detection(outputs, threshold = 0.5, target_sizes = null, is_zero_shot = false) {\n const out_logits = outputs.logits;\n const out_bbox = outputs.pred_boxes;\n const [batch_size, num_boxes, num_classes] = out_logits.dims;\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n let toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n let target_size = target_sizes !== null ? target_sizes[i] : null;\n let info = {\n boxes: [],\n classes: [],\n scores: []\n }\n let logits = out_logits[i];\n let bbox = out_bbox[i];\n\n for (let j = 0; j < num_boxes; ++j) {\n let logit = logits[j];\n\n let indices = [];\n let probs;\n if (is_zero_shot) {\n // Get indices of classes with high enough probability\n probs = logit.sigmoid().data;\n for (let k = 0; k < probs.length; ++k) {\n if (probs[k] > threshold) {\n indices.push(k);\n }\n }\n\n } else {\n // Get most probable class\n let maxIndex = max(logit.data)[1];\n\n if (maxIndex === num_classes - 1) {\n // This is the background class, skip it\n continue;\n }\n // Compute softmax over classes\n probs = softmax(logit.data);\n\n if (probs[maxIndex] < threshold) {\n continue;\n }\n indices.push(maxIndex);\n }\n\n for (const index of indices) {\n\n // Some class has a high enough probability\n /** @type {number[]} */\n let box = bbox[j].data;\n\n // convert to [x0, y0, x1, y1] format\n box = center_to_corners_format(box)\n if (target_size !== null) {\n box = box.map((x, i) => x * target_size[(i + 1) % 2])\n }\n\n info.boxes.push(box);\n info.classes.push(index);\n info.scores.push(probs[index]);\n }\n }\n toReturn.push(info);\n }\n return toReturn;\n}\n\n/**\n * Named tuple to indicate the order we are using is (height x width), even though\n * the Graphics’ industry standard is (width x height).\n * @typedef {[height: number, width: number]} HeightWidth\n */\n\n/**\n * Helper function to validate audio inputs.\n * @param {any} audio The audio data.\n * @param {string} feature_extractor The name of the feature extractor.\n * @private\n */\nfunction validate_audio_inputs(audio, feature_extractor) {\n if (!(audio instanceof Float32Array || audio instanceof Float64Array)) {\n throw new Error(\n `${feature_extractor} expects input to be a Float32Array or a Float64Array, but got ${audio?.constructor?.name ?? typeof audio} instead. ` +\n `If using the feature extractor directly, remember to use \\`read_audio(url, sampling_rate)\\` to obtain the raw audio data of the file/url.`\n )\n }\n}\n\n/**\n * Helper function to constrain a value to be a multiple of a number.\n * @param {number} val The value to constrain.\n * @param {number} multiple The number to constrain to.\n * @param {number} [minVal=0] The minimum value to constrain to.\n * @param {number} [maxVal=null] The maximum value to constrain to.\n * @returns {number} The constrained value.\n * @private\n */\nfunction constraint_to_multiple_of(val, multiple, minVal = 0, maxVal = null) {\n const a = val / multiple;\n let x = bankers_round(a) * multiple;\n\n if (maxVal !== null && x > maxVal) {\n x = Math.floor(a) * multiple;\n }\n\n if (x < minVal) {\n x = Math.ceil(a) * multiple;\n }\n\n return x;\n}\n\n/**\n * Rounds the height and width down to the closest multiple of size_divisibility\n * @param {[number, number]} size The size of the image\n * @param {number} divisor The divisor to use.\n * @returns {[number, number]} The rounded size.\n */\nfunction enforce_size_divisibility([width, height], divisor) {\n return [\n Math.max(Math.floor(width / divisor), 1) * divisor,\n Math.max(Math.floor(height / divisor), 1) * divisor\n ];\n}\n\n\n/**\n * Base class for feature extractors.\n *\n * @extends Callable\n */\nexport class FeatureExtractor extends Callable {\n /**\n * Constructs a new FeatureExtractor instance.\n *\n * @param {Object} config The configuration for the feature extractor.\n */\n constructor(config) {\n super();\n this.config = config\n }\n}\n\n/**\n * @typedef {object} ImageFeatureExtractorResult\n * @property {Tensor} pixel_values The pixel values of the batched preprocessed images.\n * @property {HeightWidth[]} original_sizes Array of two-dimensional tuples like [[480, 640]].\n * @property {HeightWidth[]} reshaped_input_sizes Array of two-dimensional tuples like [[1000, 1330]].\n */\n\n/**\n * Feature extractor for image models.\n *\n * @extends FeatureExtractor\n */\nexport class ImageFeatureExtractor extends FeatureExtractor {\n\n /**\n * Constructs a new ImageFeatureExtractor instance.\n *\n * @param {Object} config The configuration for the feature extractor.\n * @param {number[]} config.image_mean The mean values for image normalization.\n * @param {number[]} config.image_std The standard deviation values for image normalization.\n * @param {boolean} config.do_rescale Whether to rescale the image pixel values to the [0,1] range.\n * @param {number} config.rescale_factor The factor to use for rescaling the image pixel values.\n * @param {boolean} config.do_normalize Whether to normalize the image pixel values.\n * @param {boolean} config.do_resize Whether to resize the image.\n * @param {number} config.resample What method to use for resampling.\n * @param {number|Object} config.size The size to resize the image to.\n */\n constructor(config) {\n super(config);\n\n this.image_mean = this.config.image_mean ?? this.config.mean;\n this.image_std = this.config.image_std ?? this.config.std;\n\n this.resample = this.config.resample ?? 2; // 2 => bilinear\n this.do_rescale = this.config.do_rescale ?? true;\n this.rescale_factor = this.config.rescale_factor ?? (1 / 255);\n this.do_normalize = this.config.do_normalize;\n\n this.do_resize = this.config.do_resize;\n this.do_thumbnail = this.config.do_thumbnail;\n this.size = this.config.size;\n this.size_divisibility = this.config.size_divisibility ?? this.config.size_divisor;\n\n this.do_center_crop = this.config.do_center_crop;\n this.crop_size = this.config.crop_size;\n this.do_convert_rgb = this.config.do_convert_rgb ?? true;\n this.do_crop_margin = this.config.do_crop_margin;\n\n this.pad_size = this.config.pad_size;\n this.do_pad = this.config.do_pad;\n\n if (this.do_pad && !this.pad_size && this.size && this.size.width !== undefined && this.size.height !== undefined) {\n // Should pad, but no pad size specified\n // We infer the pad size from the resize size\n this.pad_size = this.size\n }\n }\n\n /**\n * Resize the image to make a thumbnail. The image is resized so that no dimension is larger than any\n * corresponding dimension of the specified size.\n * @param {RawImage} image The image to be resized.\n * @param {{height:number, width:number}} size The size `{\"height\": h, \"width\": w}` to resize the image to.\n * @param {string | 0 | 1 | 2 | 3 | 4 | 5} [resample=2] The resampling filter to use.\n * @returns {Promise} The resized image.\n */\n async thumbnail(image, size, resample = 2) {\n const input_height = image.height;\n const input_width = image.width;\n\n const output_height = size.height;\n const output_width = size.width;\n\n // We always resize to the smallest of either the input or output size.\n let height = Math.min(input_height, output_height)\n let width = Math.min(input_width, output_width)\n\n if (height === input_height && width === input_width) {\n return image;\n }\n if (input_height > input_width) {\n width = Math.floor(input_width * height / input_height);\n } else if (input_width > input_height) {\n height = Math.floor(input_height * width / input_width);\n }\n return await image.resize(width, height, { resample });\n }\n\n\n /**\n * Crops the margin of the image. Gray pixels are considered margin (i.e., pixels with a value below the threshold).\n * @param {RawImage} image The image to be cropped.\n * @param {number} gray_threshold Value below which pixels are considered to be gray.\n * @returns {Promise} The cropped image.\n */\n async crop_margin(image, gray_threshold = 200) {\n\n const gray_image = image.clone().grayscale();\n\n const minValue = min(gray_image.data)[0];\n const maxValue = max(gray_image.data)[0];\n const diff = maxValue - minValue;\n\n if (diff === 0) {\n return image;\n }\n\n const threshold = gray_threshold / 255;\n\n let x_min = gray_image.width, y_min = gray_image.height, x_max = 0, y_max = 0;\n const gray_image_data = gray_image.data;\n for (let j = 0; j < gray_image.height; ++j) {\n const row = j * gray_image.width;\n for (let i = 0; i < gray_image.width; ++i) {\n if ((gray_image_data[row + i] - minValue) / diff < threshold) {\n // We have a non-zero pixel, so we update the min/max values accordingly\n x_min = Math.min(x_min, i);\n y_min = Math.min(y_min, j);\n x_max = Math.max(x_max, i);\n y_max = Math.max(y_max, j);\n }\n }\n }\n\n image = await image.crop([x_min, y_min, x_max, y_max]);\n return image;\n }\n\n /**\n * Pad the image by a certain amount.\n * @param {Float32Array} pixelData The pixel data to pad.\n * @param {number[]} imgDims The dimensions of the image (height, width, channels).\n * @param {{width:number; height:number}|number} padSize The dimensions of the padded image.\n * @param {Object} options The options for padding.\n * @param {'constant'|'symmetric'} [options.mode='constant'] The type of padding to add.\n * @param {boolean} [options.center=false] Whether to center the image.\n * @param {number} [options.constant_values=0] The constant value to use for padding.\n * @returns {[Float32Array, number[]]} The padded pixel data and image dimensions.\n */\n pad_image(pixelData, imgDims, padSize, {\n mode = 'constant',\n center = false,\n constant_values = 0,\n } = {}) {\n const [imageHeight, imageWidth, imageChannels] = imgDims;\n\n let paddedImageWidth, paddedImageHeight;\n if (typeof padSize === 'number') {\n paddedImageWidth = padSize;\n paddedImageHeight = padSize;\n } else {\n paddedImageWidth = padSize.width;\n paddedImageHeight = padSize.height;\n }\n\n // Only add padding if there is a difference in size\n if (paddedImageWidth !== imageWidth || paddedImageHeight !== imageHeight) {\n const paddedPixelData = new Float32Array(paddedImageWidth * paddedImageHeight * imageChannels);\n if (Array.isArray(constant_values)) {\n // Fill with constant values, cycling through the array\n for (let i = 0; i < paddedPixelData.length; ++i) {\n paddedPixelData[i] = constant_values[i % imageChannels];\n }\n } else if (constant_values !== 0) {\n paddedPixelData.fill(constant_values);\n }\n\n const [left, top] = center\n ? [Math.floor((paddedImageWidth - imageWidth) / 2), Math.floor((paddedImageHeight - imageHeight) / 2)]\n : [0, 0];\n\n // Copy the original image into the padded image\n for (let i = 0; i < imageHeight; ++i) {\n const a = (i + top) * paddedImageWidth;\n const b = i * imageWidth;\n for (let j = 0; j < imageWidth; ++j) {\n const c = (a + j + left) * imageChannels;\n const d = (b + j) * imageChannels;\n for (let k = 0; k < imageChannels; ++k) {\n paddedPixelData[c + k] = pixelData[d + k];\n }\n }\n }\n\n if (mode === 'symmetric') {\n if (center) {\n throw new Error('`center` padding is not supported when `mode` is set to `symmetric`.');\n // TODO: Implement this\n }\n const h1 = imageHeight - 1;\n const w1 = imageWidth - 1;\n for (let i = 0; i < paddedImageHeight; ++i) {\n const a = i * paddedImageWidth;\n const b = calculateReflectOffset(i, h1) * imageWidth;\n\n for (let j = 0; j < paddedImageWidth; ++j) {\n if (i < imageHeight && j < imageWidth) continue; // Do not overwrite original image\n const c = (a + j) * imageChannels;\n const d = (b + calculateReflectOffset(j, w1)) * imageChannels;\n\n // Copy channel-wise\n for (let k = 0; k < imageChannels; ++k) {\n paddedPixelData[c + k] = pixelData[d + k];\n }\n }\n }\n }\n\n\n // Update pixel data and image dimensions\n pixelData = paddedPixelData;\n imgDims = [paddedImageHeight, paddedImageWidth, imageChannels]\n }\n return [pixelData, imgDims];\n }\n\n /**\n * Rescale the image' pixel values by `this.rescale_factor`.\n * @param {Float32Array} pixelData The pixel data to rescale.\n * @returns {void}\n */\n rescale(pixelData) {\n for (let i = 0; i < pixelData.length; ++i) {\n pixelData[i] = this.rescale_factor * pixelData[i];\n }\n }\n\n /**\n * Find the target (width, height) dimension of the output image after\n * resizing given the input image and the desired size.\n * @param {RawImage} image The image to resize.\n * @param {any} size The size to use for resizing the image. \n * @returns {[number, number]} The target (width, height) dimension of the output image after resizing.\n */\n get_resize_output_image_size(image, size) {\n // `size` comes in many forms, so we need to handle them all here:\n // 1. `size` is an integer, in which case we resize the image to be a square \n\n const [srcWidth, srcHeight] = image.size;\n\n let shortest_edge;\n let longest_edge;\n\n if (this.do_thumbnail) {\n // NOTE: custom logic for `Donut` models\n const { height, width } = size;\n shortest_edge = Math.min(height, width)\n }\n // Support both formats for backwards compatibility\n else if (Number.isInteger(size)) {\n shortest_edge = size;\n longest_edge = this.config.max_size ?? shortest_edge;\n\n } else if (size !== undefined) {\n // Extract known properties from `size`\n shortest_edge = size.shortest_edge;\n longest_edge = size.longest_edge;\n }\n\n // If `longest_edge` and `shortest_edge` are set, maintain aspect ratio and resize to `shortest_edge`\n // while keeping the largest dimension <= `longest_edge`\n if (shortest_edge !== undefined || longest_edge !== undefined) {\n // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/\n // Try resize so that shortest edge is `shortest_edge` (target)\n const shortResizeFactor = shortest_edge === undefined\n ? 1 // If `shortest_edge` is not set, don't upscale\n : Math.max(shortest_edge / srcWidth, shortest_edge / srcHeight);\n\n const newWidth = srcWidth * shortResizeFactor;\n const newHeight = srcHeight * shortResizeFactor;\n\n // The new width and height might be greater than `longest_edge`, so\n // we downscale again to ensure the largest dimension is `longest_edge` \n const longResizeFactor = longest_edge === undefined\n ? 1 // If `longest_edge` is not set, don't downscale\n : Math.min(longest_edge / newWidth, longest_edge / newHeight);\n\n // To avoid certain floating point precision issues, we round to 2 decimal places\n let finalWidth = Math.floor(Number((newWidth * longResizeFactor).toFixed(2)));\n let finalHeight = Math.floor(Number((newHeight * longResizeFactor).toFixed(2)));\n\n if (this.size_divisibility !== undefined) {\n [finalWidth, finalHeight] = enforce_size_divisibility([finalWidth, finalHeight], this.size_divisibility)\n }\n return [finalWidth, finalHeight];\n\n } else if (size !== undefined && size.width !== undefined && size.height !== undefined) {\n // If `width` and `height` are set, resize to those dimensions\n\n let newWidth = size.width;\n let newHeight = size.height;\n\n // Custom for DPT models\n if (this.config.keep_aspect_ratio && this.config.ensure_multiple_of) {\n\n // determine new height and width\n let scale_height = newHeight / srcHeight;\n let scale_width = newWidth / srcWidth;\n\n // scale as little as possible\n if (Math.abs(1 - scale_width) < Math.abs(1 - scale_height)) {\n // fit width\n scale_height = scale_width;\n } else {\n // fit height\n scale_width = scale_height;\n }\n\n newHeight = constraint_to_multiple_of(scale_height * srcHeight, this.config.ensure_multiple_of);\n newWidth = constraint_to_multiple_of(scale_width * srcWidth, this.config.ensure_multiple_of);\n }\n\n return [newWidth, newHeight];\n\n } else if (this.size_divisibility !== undefined) {\n return enforce_size_divisibility([srcWidth, srcHeight], this.size_divisibility);\n } else {\n throw new Error(`Could not resize image due to unsupported \\`this.size\\` option in config: ${JSON.stringify(size)}`);\n }\n }\n\n /**\n * Resizes the image.\n * @param {RawImage} image The image to resize.\n * @returns {Promise} The resized image.\n */\n async resize(image) {\n const [newWidth, newHeight] = this.get_resize_output_image_size(image, this.size);\n return await image.resize(newWidth, newHeight, {\n resample: this.resample,\n });\n }\n\n /**\n * @typedef {object} PreprocessedImage\n * @property {HeightWidth} original_size The original size of the image.\n * @property {HeightWidth} reshaped_input_size The reshaped input size of the image.\n * @property {Tensor} pixel_values The pixel values of the preprocessed image.\n */\n\n /**\n * Preprocesses the given image.\n *\n * @param {RawImage} image The image to preprocess.\n * @param {Object} overrides The overrides for the preprocessing options.\n * @returns {Promise} The preprocessed image.\n */\n async preprocess(image, {\n do_normalize = null,\n do_pad = null,\n do_convert_rgb = null,\n do_convert_grayscale = null,\n } = {}) {\n if (this.do_crop_margin) {\n // NOTE: Specific to nougat processors. This is done before resizing,\n // and can be interpreted as a pre-preprocessing step.\n image = await this.crop_margin(image);\n }\n\n const [srcWidth, srcHeight] = image.size; // original image size\n\n // Convert image to RGB if specified in config.\n if (do_convert_rgb ?? this.do_convert_rgb) {\n image = image.rgb();\n } else if (do_convert_grayscale) {\n image = image.grayscale();\n }\n\n // TODO:\n // For efficiency reasons, it might be best to merge the resize and center crop operations into one.\n\n // Resize all images\n if (this.do_resize) {\n image = await this.resize(image);\n }\n\n // Resize the image using thumbnail method.\n if (this.do_thumbnail) {\n image = await this.thumbnail(image, this.size, this.resample);\n }\n\n if (this.do_center_crop) {\n\n let crop_width;\n let crop_height;\n if (Number.isInteger(this.crop_size)) {\n crop_width = this.crop_size;\n crop_height = this.crop_size;\n } else {\n crop_width = this.crop_size.width;\n crop_height = this.crop_size.height;\n }\n\n image = await image.center_crop(crop_width, crop_height);\n }\n\n /** @type {HeightWidth} */\n const reshaped_input_size = [image.height, image.width];\n\n // NOTE: All pixel-level manipulation (i.e., modifying `pixelData`)\n // occurs with data in the hwc format (height, width, channels), \n // to emulate the behavior of the original Python code (w/ numpy).\n let pixelData = Float32Array.from(image.data);\n let imgDims = [image.height, image.width, image.channels];\n\n if (this.do_rescale) {\n this.rescale(pixelData);\n }\n\n if (do_normalize ?? this.do_normalize) {\n let image_mean = this.image_mean;\n if (!Array.isArray(this.image_mean)) {\n image_mean = new Array(image.channels).fill(image_mean);\n }\n\n let image_std = this.image_std;\n if (!Array.isArray(this.image_std)) {\n image_std = new Array(image.channels).fill(image_mean);\n }\n\n if (image_mean.length !== image.channels || image_std.length !== image.channels) {\n throw new Error(`When set to arrays, the length of \\`image_mean\\` (${image_mean.length}) and \\`image_std\\` (${image_std.length}) must match the number of channels in the image (${image.channels}).`);\n }\n\n for (let i = 0; i < pixelData.length; i += image.channels) {\n for (let j = 0; j < image.channels; ++j) {\n pixelData[i + j] = (pixelData[i + j] - image_mean[j]) / image_std[j];\n }\n }\n }\n\n // do padding after rescaling/normalizing\n if (do_pad ?? this.do_pad) {\n if (this.pad_size) {\n const padded = this.pad_image(pixelData, [image.height, image.width, image.channels], this.pad_size);\n [pixelData, imgDims] = padded; // Update pixel data and image dimensions\n } else if (this.size_divisibility) {\n const [paddedWidth, paddedHeight] = enforce_size_divisibility([imgDims[1], imgDims[0]], this.size_divisibility);\n [pixelData, imgDims] = this.pad_image(pixelData, imgDims, { width: paddedWidth, height: paddedHeight });\n }\n }\n\n const pixel_values = new Tensor('float32', pixelData, imgDims)\n .permute(2, 0, 1); // convert to channel dimension format (hwc -> chw)\n\n return {\n original_size: [srcHeight, srcWidth],\n reshaped_input_size: reshaped_input_size,\n pixel_values,\n }\n }\n\n /**\n * Calls the feature extraction process on an array of images,\n * preprocesses each image, and concatenates the resulting\n * features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @param {...any} args Additional arguments.\n * @returns {Promise} An object containing the concatenated pixel values (and other metadata) of the preprocessed images.\n */\n async _call(images, ...args) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n /** @type {PreprocessedImage[]} */\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n\n // Stack pixel values\n const pixel_values = stack(imageData.map(x => x.pixel_values), 0);\n\n return {\n pixel_values,\n\n // Original sizes of images\n original_sizes: imageData.map(x => x.original_size),\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes: imageData.map(x => x.reshaped_input_size),\n }\n }\n\n}\n\nexport class SegformerFeatureExtractor extends ImageFeatureExtractor {\n\n /**\n * Converts the output of `SegformerForSemanticSegmentation` into semantic segmentation maps.\n * @param {*} outputs Raw outputs of the model.\n * @param {number[][]} [target_sizes=null] List of tuples corresponding to the requested final size\n * (height, width) of each prediction. If unset, predictions will not be resized.\n * @returns {{segmentation: Tensor; labels: number[]}[]} The semantic segmentation maps.\n */\n post_process_semantic_segmentation(outputs, target_sizes = null) {\n\n const logits = outputs.logits;\n const batch_size = logits.dims[0];\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n\n const toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n const target_size = target_sizes !== null ? target_sizes[i] : null;\n\n let data = logits[i];\n\n // 1. If target_size is not null, we need to resize the masks to the target size\n if (target_size !== null) {\n // resize the masks to the target size\n data = interpolate(data, target_size, 'bilinear', false);\n }\n const [height, width] = target_size ?? data.dims.slice(-2);\n\n const segmentation = new Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n\n // Buffer to store current largest value\n const buffer = data[0].data;\n const segmentation_data = segmentation.data;\n for (let j = 1; j < data.dims[0]; ++j) {\n const row = data[j].data;\n for (let k = 0; k < row.length; ++k) {\n if (row[k] > buffer[k]) {\n buffer[k] = row[k];\n segmentation_data[k] = j;\n }\n }\n }\n\n // Store which objects have labels\n // This is much more efficient that creating a set of the final values\n const hasLabel = new Array(data.dims[0]);\n const out = segmentation.data;\n for (let j = 0; j < out.length; ++j) {\n const index = out[j];\n hasLabel[index] = index;\n }\n /** @type {number[]} The unique list of labels that were detected */\n const labels = hasLabel.filter(x => x !== undefined);\n\n toReturn.push({ segmentation, labels });\n }\n return toReturn;\n }\n}\nexport class DPTFeatureExtractor extends ImageFeatureExtractor { }\nexport class DPTImageProcessor extends DPTFeatureExtractor { } // NOTE: extends DPTFeatureExtractor\nexport class BitImageProcessor extends ImageFeatureExtractor { }\nexport class GLPNFeatureExtractor extends ImageFeatureExtractor { }\nexport class CLIPFeatureExtractor extends ImageFeatureExtractor { }\nexport class CLIPImageProcessor extends CLIPFeatureExtractor { } // NOTE: extends CLIPFeatureExtractor\nexport class ChineseCLIPFeatureExtractor extends ImageFeatureExtractor { }\nexport class SiglipImageProcessor extends ImageFeatureExtractor { }\nexport class ConvNextFeatureExtractor extends ImageFeatureExtractor {\n constructor(config) {\n super(config);\n\n /**\n * Percentage of the image to crop. Only has an effect if this.size < 384.\n */\n this.crop_pct = this.config.crop_pct ?? (224 / 256);\n }\n\n async resize(image) {\n const shortest_edge = this.size?.shortest_edge;\n if (shortest_edge === undefined) {\n throw new Error(`Size dictionary must contain 'shortest_edge' key.`);\n }\n\n if (shortest_edge < 384) {\n // maintain same ratio, resizing shortest edge to shortest_edge/crop_pct\n const resize_shortest_edge = Math.floor(shortest_edge / this.crop_pct);\n\n const [newWidth, newHeight] = this.get_resize_output_image_size(image, {\n shortest_edge: resize_shortest_edge,\n });\n\n image = await image.resize(newWidth, newHeight, {\n resample: this.resample,\n });\n\n // then crop to (shortest_edge, shortest_edge)\n image = await image.center_crop(shortest_edge, shortest_edge);\n } else {\n // warping (no cropping) when evaluated at 384 or larger\n image = await image.resize(shortest_edge, shortest_edge, {\n resample: this.resample,\n });\n }\n\n return image;\n }\n}\nexport class ConvNextImageProcessor extends ConvNextFeatureExtractor { } // NOTE extends ConvNextFeatureExtractor\nexport class ViTFeatureExtractor extends ImageFeatureExtractor { }\nexport class ViTImageProcessor extends ImageFeatureExtractor { }\n\nexport class EfficientNetImageProcessor extends ImageFeatureExtractor {\n constructor(config) {\n super(config);\n this.include_top = this.config.include_top ?? true;\n if (this.include_top) {\n this.image_std = this.image_std.map(x => x * x);\n }\n }\n}\n\n\nexport class MobileViTFeatureExtractor extends ImageFeatureExtractor { }\nexport class OwlViTFeatureExtractor extends ImageFeatureExtractor {\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\nexport class Owlv2ImageProcessor extends OwlViTFeatureExtractor { } // NOTE extends OwlViTFeatureExtractor\n\nexport class DeiTFeatureExtractor extends ImageFeatureExtractor { }\nexport class BeitFeatureExtractor extends ImageFeatureExtractor { }\nexport class DonutFeatureExtractor extends ImageFeatureExtractor {\n pad_image(pixelData, imgDims, padSize, options = {}) {\n const [imageHeight, imageWidth, imageChannels] = imgDims;\n\n let image_mean = this.image_mean;\n if (!Array.isArray(this.image_mean)) {\n image_mean = new Array(imageChannels).fill(image_mean);\n }\n\n let image_std = this.image_std;\n if (!Array.isArray(image_std)) {\n image_std = new Array(imageChannels).fill(image_mean);\n }\n\n const constant_values = image_mean.map((x, i) => - x / image_std[i]);\n\n return super.pad_image(pixelData, imgDims, padSize, {\n center: true,\n\n // Since normalization is done after padding, we need to use certain constant values to ensure the same behaviour is observed.\n // For more information, see https://github.com/huggingface/transformers/blob/main/src/transformers/models/donut/image_processing_donut.py#L433-L451\n constant_values: constant_values,\n ...options,\n });\n }\n}\nexport class NougatImageProcessor extends DonutFeatureExtractor { } // NOTE extends DonutFeatureExtractor\n\n/**\n * @typedef {object} DetrFeatureExtractorResultProps\n * @property {Tensor} pixel_mask\n * @typedef {ImageFeatureExtractorResult & DetrFeatureExtractorResultProps} DetrFeatureExtractorResult\n */\n\n/**\n * Detr Feature Extractor.\n *\n * @extends ImageFeatureExtractor\n */\nexport class DetrFeatureExtractor extends ImageFeatureExtractor {\n /**\n * Calls the feature extraction process on an array of images, preprocesses\n * each image, and concatenates the resulting features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\n */\n async _call(images) {\n const result = await super._call(images);\n\n // TODO support differently-sized images, for now assume all images are the same size.\n // TODO support different mask sizes (not just 64x64)\n // Currently, just fill pixel mask with 1s\n const maskSize = [result.pixel_values.dims[0], 64, 64];\n const pixel_mask = new Tensor(\n 'int64',\n new BigInt64Array(maskSize.reduce((a, b) => a * b)).fill(1n),\n maskSize\n );\n\n return { ...result, pixel_mask };\n }\n\n /**\n * Post-processes the outputs of the model (for object detection).\n * @param {Object} outputs The outputs of the model that must be post-processed\n * @param {Tensor} outputs.logits The logits\n * @param {Tensor} outputs.pred_boxes The predicted boxes.\n * @return {Object[]} An array of objects containing the post-processed outputs.\n */\n\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n\n /**\n * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`.\n * @param {Tensor} class_logits The class logits.\n * @param {Tensor} mask_logits The mask logits.\n * @param {number} object_mask_threshold A number between 0 and 1 used to binarize the masks.\n * @param {number} num_labels The number of labels.\n * @returns {[Tensor[], number[], number[]]} The binarized masks, the scores, and the labels.\n */\n remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) {\n\n let mask_probs_item = [];\n let pred_scores_item = [];\n let pred_labels_item = [];\n\n for (let j = 0; j < class_logits.dims[0]; ++j) {\n let cls = class_logits[j];\n let mask = mask_logits[j];\n\n let pred_label = max(cls.data)[1];\n if (pred_label === num_labels) {\n // Is the background, so we ignore it\n continue;\n }\n\n let scores = softmax(cls.data);\n let pred_score = scores[pred_label];\n if (pred_score > object_mask_threshold) {\n mask_probs_item.push(mask);\n pred_scores_item.push(pred_score);\n pred_labels_item.push(pred_label);\n }\n }\n\n return [mask_probs_item, pred_scores_item, pred_labels_item];\n\n }\n\n /**\n * Checks whether the segment is valid or not.\n * @param {Int32Array} mask_labels Labels for each pixel in the mask.\n * @param {Tensor[]} mask_probs Probabilities for each pixel in the masks.\n * @param {number} k The class id of the segment.\n * @param {number} mask_threshold The mask threshold.\n * @param {number} overlap_mask_area_threshold The overlap mask area threshold.\n * @returns {[boolean, number[]]} Whether the segment is valid or not, and the indices of the valid labels.\n */\n check_segment_validity(\n mask_labels,\n mask_probs,\n k,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8\n ) {\n // mask_k is a 1D array of indices, indicating where the mask is equal to k\n let mask_k = [];\n let mask_k_area = 0;\n let original_area = 0;\n\n const mask_probs_k_data = mask_probs[k].data;\n\n // Compute the area of all the stuff in query k\n for (let i = 0; i < mask_labels.length; ++i) {\n if (mask_labels[i] === k) {\n mask_k.push(i);\n ++mask_k_area;\n }\n\n if (mask_probs_k_data[i] >= mask_threshold) {\n ++original_area;\n }\n }\n let mask_exists = mask_k_area > 0 && original_area > 0;\n\n // Eliminate disconnected tiny segments\n if (mask_exists) {\n // Perform additional check\n let area_ratio = mask_k_area / original_area;\n mask_exists = area_ratio > overlap_mask_area_threshold;\n }\n\n return [mask_exists, mask_k]\n }\n\n /**\n * Computes the segments.\n * @param {Tensor[]} mask_probs The mask probabilities.\n * @param {number[]} pred_scores The predicted scores.\n * @param {number[]} pred_labels The predicted labels.\n * @param {number} mask_threshold The mask threshold.\n * @param {number} overlap_mask_area_threshold The overlap mask area threshold.\n * @param {Set} label_ids_to_fuse The label ids to fuse.\n * @param {number[]} target_size The target size of the image.\n * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} The computed segments.\n */\n compute_segments(\n mask_probs,\n pred_scores,\n pred_labels,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse = null,\n target_size = null,\n ) {\n let [height, width] = target_size ?? mask_probs[0].dims;\n\n let segmentation = new Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n let segments = [];\n\n // 1. If target_size is not null, we need to resize the masks to the target size\n if (target_size !== null) {\n // resize the masks to the target size\n for (let i = 0; i < mask_probs.length; ++i) {\n mask_probs[i] = interpolate(mask_probs[i], target_size, 'bilinear', false);\n }\n }\n\n // 2. Weigh each mask by its prediction score\n // NOTE: `mask_probs` is updated in-place\n // \n // Temporary storage for the best label/scores for each pixel ([height, width]):\n let mask_labels = new Int32Array(mask_probs[0].data.length);\n let bestScores = new Float32Array(mask_probs[0].data.length);\n\n for (let i = 0; i < mask_probs.length; ++i) {\n let score = pred_scores[i];\n\n const mask_probs_i_data = mask_probs[i].data;\n\n for (let j = 0; j < mask_probs_i_data.length; ++j) {\n mask_probs_i_data[j] *= score\n if (mask_probs_i_data[j] > bestScores[j]) {\n mask_labels[j] = i;\n bestScores[j] = mask_probs_i_data[j];\n }\n }\n }\n\n let current_segment_id = 0;\n\n // let stuff_memory_list = {}\n const segmentation_data = segmentation.data;\n for (let k = 0; k < pred_labels.length; ++k) {\n let pred_class = pred_labels[k];\n\n // TODO add `should_fuse`\n // let should_fuse = pred_class in label_ids_to_fuse\n\n // Check if mask exists and large enough to be a segment\n let [mask_exists, mask_k] = this.check_segment_validity(\n mask_labels,\n mask_probs,\n k,\n mask_threshold,\n overlap_mask_area_threshold\n )\n\n if (!mask_exists) {\n // Nothing to see here\n continue;\n }\n\n // TODO\n // if (pred_class in stuff_memory_list) {\n // current_segment_id = stuff_memory_list[pred_class]\n // } else {\n // current_segment_id += 1;\n // }\n ++current_segment_id;\n\n\n // Add current object segment to final segmentation map\n for (let index of mask_k) {\n segmentation_data[index] = current_segment_id;\n }\n\n segments.push({\n id: current_segment_id,\n label_id: pred_class,\n // was_fused: should_fuse, TODO\n score: pred_scores[k],\n })\n\n // TODO\n // if(should_fuse){\n // stuff_memory_list[pred_class] = current_segment_id\n // }\n }\n\n return [segmentation, segments];\n }\n\n /**\n * Post-process the model output to generate the final panoptic segmentation.\n * @param {*} outputs The model output to post process\n * @param {number} [threshold=0.5] The probability score threshold to keep predicted instance masks.\n * @param {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values.\n * @param {number} [overlap_mask_area_threshold=0.8] The overlap mask area threshold to merge or discard small disconnected parts within each binary instance mask.\n * @param {Set} [label_ids_to_fuse=null] The labels in this state will have all their instances be fused together.\n * @param {number[][]} [target_sizes=null] The target sizes to resize the masks to.\n * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>}\n */\n post_process_panoptic_segmentation(\n outputs,\n threshold = 0.5,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8,\n label_ids_to_fuse = null,\n target_sizes = null,\n ) {\n if (label_ids_to_fuse === null) {\n console.warn(\"`label_ids_to_fuse` unset. No instance will be fused.\")\n label_ids_to_fuse = new Set();\n }\n\n const class_queries_logits = outputs.logits; // [batch_size, num_queries, num_classes+1]\n const masks_queries_logits = outputs.pred_masks; // [batch_size, num_queries, height, width]\n\n const mask_probs = masks_queries_logits.sigmoid() // [batch_size, num_queries, height, width]\n\n let [batch_size, num_queries, num_labels] = class_queries_logits.dims;\n num_labels -= 1; // Remove last class (background)\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n\n let toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n let target_size = target_sizes !== null ? target_sizes[i] : null;\n\n let class_logits = class_queries_logits[i];\n let mask_logits = mask_probs[i];\n\n let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels);\n\n if (pred_labels_item.length === 0) {\n // No mask found\n let [height, width] = target_size ?? mask_logits.dims.slice(-2);\n\n let segmentation = new Tensor(\n 'int32',\n new Int32Array(height * width).fill(-1),\n [height, width]\n )\n toReturn.push({\n segmentation: segmentation,\n segments_info: []\n });\n continue;\n }\n\n\n // Get segmentation map and segment information of batch item\n let [segmentation, segments] = this.compute_segments(\n mask_probs_item,\n pred_scores_item,\n pred_labels_item,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse,\n target_size,\n )\n\n toReturn.push({\n segmentation: segmentation,\n segments_info: segments\n })\n }\n\n return toReturn;\n }\n\n post_process_instance_segmentation() {\n // TODO\n throw Error(\"Not implemented yet\");\n }\n}\n\nexport class YolosFeatureExtractor extends ImageFeatureExtractor {\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\n\n/**\n * @typedef {object} SamImageProcessorResult\n * @property {Tensor} pixel_values\n * @property {HeightWidth[]} original_sizes\n * @property {HeightWidth[]} reshaped_input_sizes\n * @property {Tensor} [input_points]\n * @property {Tensor} [input_labels]\n * @property {Tensor} [input_boxes]\n */\n\nexport class SamImageProcessor extends ImageFeatureExtractor {\n\n /**\n * \n * @param {any} input_points \n * @param {HeightWidth[]} original_sizes \n * @param {HeightWidth[]} reshaped_input_sizes \n * @returns {Tensor}\n */\n reshape_input_points(input_points, original_sizes, reshaped_input_sizes, is_bounding_box = false) {\n\n // Make deep copy to avoid altering user's input\n input_points = structuredClone(input_points);\n let shape = calculateDimensions(input_points);\n\n // TODO: add support for 2D input_points\n if (shape.length === 3) {\n // Correct user's input\n if (!is_bounding_box) {\n shape = [1, ...shape];\n }\n input_points = [input_points];\n } else if (shape.length !== 4) {\n throw Error(\"The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.\")\n }\n\n // Reshape input points\n for (let i = 0; i < input_points.length; ++i) { // batch_size\n let originalImageSize = original_sizes[i];\n let reshapedImageSize = reshaped_input_sizes[i];\n\n let resizeFactors = [\n reshapedImageSize[0] / originalImageSize[0],\n reshapedImageSize[1] / originalImageSize[1]\n ]\n\n for (let j = 0; j < input_points[i].length; ++j) { // point_batch_size\n for (let k = 0; k < input_points[i][j].length; ++k) { // nb_points_per_image\n for (let w = 0; w < input_points[i][j][k].length; ++w) { // 2 or 4\n input_points[i][j][k][w] *= resizeFactors[w % 2];\n }\n }\n }\n }\n\n return new Tensor(\n 'float32',\n Float32Array.from(input_points.flat(Infinity)),\n shape\n )\n\n }\n\n /**\n * \n * @param {any} input_labels \n * @param {Tensor} input_points \n * @returns {Tensor}\n */\n add_input_labels(input_labels, input_points) {\n let shape = calculateDimensions(input_labels);\n if (shape.length === 2) {\n // Correct user's input\n shape = [1, ...shape];\n input_labels = [input_labels];\n } else if (shape.length !== 3) {\n throw Error(\"The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.\")\n }\n\n if (shape.some((x, i) => x !== input_points.dims[i])) {\n throw Error(`The first ${shape.length} dimensions of 'input_points' and 'input_labels' must be the same.`)\n }\n return new Tensor(\n 'int64',\n input_labels.flat(Infinity).map(BigInt),\n shape,\n )\n }\n /**\n * @param {any[]} images The URL(s) of the image(s) to extract features from.\n * @param {any} [input_points] A 3D or 4D array, representing the input points provided by the user.\n * - 3D: `[point_batch_size, nb_points_per_image, 2]`. In this case, `batch_size` is assumed to be 1.\n * - 4D: `[batch_size, point_batch_size, nb_points_per_image, 2]`.\n * @param {any} [input_labels] A 2D or 3D array, representing the input labels for the points, used by the prompt encoder to encode the prompt.\n * - 2D: `[point_batch_size, nb_points_per_image]`. In this case, `batch_size` is assumed to be 1.\n * - 3D: `[batch_size, point_batch_size, nb_points_per_image]`.\n * @param {any} [input_boxes] A 3D array of shape `(batch_size, num_boxes, 4)`, representing the input boxes provided by the user.\n * This is used by the prompt encoder to encode the prompt. Generally yields to much better generated masks.\n * The processor will generate a tensor, with each dimension corresponding respectively to the image batch size,\n * the number of boxes per image and the coordinates of the top left and botton right point of the box.\n * In the order (`x1`, `y1`, `x2`, `y2`):\n * - `x1`: the x coordinate of the top left point of the input box\n * - `y1`: the y coordinate of the top left point of the input box\n * - `x2`: the x coordinate of the bottom right point of the input box\n * - `y2`: the y coordinate of the bottom right point of the input box\n * @returns {Promise}\n */\n async _call(images, input_points = null, input_labels = null, input_boxes = null) {\n // TODO allow user to use preprocessed images\n /** @type {SamImageProcessorResult} */\n const processed = await super._call(images);\n\n if (input_points) {\n processed.input_points = this.reshape_input_points(\n input_points, processed.original_sizes, processed.reshaped_input_sizes\n );\n }\n\n if (input_labels) {\n if (!processed.input_points) {\n throw Error(\"`input_points` must be provided if `input_labels` are provided.\")\n }\n processed.input_labels = this.add_input_labels(input_labels, processed.input_points);\n }\n\n if (input_boxes) {\n processed.input_boxes = this.reshape_input_points(\n input_boxes, processed.original_sizes, processed.reshaped_input_sizes, true,\n );\n }\n\n return processed;\n }\n\n /**\n * Remove padding and upscale masks to the original image size.\n * @param {Tensor} masks Batched masks from the mask_decoder in (batch_size, num_channels, height, width) format.\n * @param {[number, number][]} original_sizes The original sizes of each image before it was resized to the model's expected input shape, in (height, width) format.\n * @param {[number, number][]} reshaped_input_sizes The size of each image as it is fed to the model, in (height, width) format. Used to remove padding.\n * @param {Object} options Optional parameters for post-processing.\n * @param {number} [options.mask_threshold] The threshold to use for binarizing the masks.\n * @param {boolean} [options.binarize] Whether to binarize the masks.\n * @param {Object} [options.pad_size] The target size the images were padded to before being passed to the model. If `null`, the target size is assumed to be the processor's `pad_size`.\n * @param {number} [options.pad_size.height] The height the images were padded to.\n * @param {number} [options.pad_size.width] The width the images were padded to.\n * @returns {Promise} Batched masks in batch_size, num_channels, height, width) format, where (height, width) is given by original_size.\n */\n async post_process_masks(masks, original_sizes, reshaped_input_sizes, {\n mask_threshold = 0.0,\n binarize = true,\n pad_size = null,\n } = {}) {\n // masks: [1, 1, 3, 256, 256]\n\n const output_masks = [];\n\n pad_size = pad_size ?? this.pad_size;\n\n /** @type {[number, number]} */\n const target_image_size = [pad_size.height, pad_size.width];\n\n for (let i = 0; i < original_sizes.length; ++i) {\n const original_size = original_sizes[i];\n const reshaped_input_size = reshaped_input_sizes[i];\n\n // Upscale mask to padded size\n let interpolated_mask = (await interpolate_4d(\n masks[i],\n { mode: 'bilinear', size: target_image_size }\n ));\n\n // Crop mask\n interpolated_mask = interpolated_mask.slice(null, null, [0, reshaped_input_size[0]], [0, reshaped_input_size[1]]);\n\n // Downscale mask\n interpolated_mask = (await interpolate_4d(\n interpolated_mask,\n { mode: 'bilinear', size: original_size }\n ));\n\n if (binarize) {\n const data = interpolated_mask.data;\n const binarizedMaskData = new Uint8Array(data.length);\n for (let i = 0; i < data.length; ++i) {\n if (data[i] > mask_threshold) {\n binarizedMaskData[i] = 1;\n }\n }\n interpolated_mask = new Tensor(\n 'bool',\n binarizedMaskData,\n interpolated_mask.dims\n )\n }\n\n output_masks.push(interpolated_mask);\n }\n\n return output_masks;\n }\n\n /**\n * Generates a list of crop boxes of different sizes. Each layer has (2**i)**2 boxes for the ith layer.\n * @param {RawImage} image Input original image\n * @param {number} target_size Target size of the resized image\n * @param {Object} options Options for generating crop boxes \n * @param {number} [options.crop_n_layers] If >0, mask prediction will be run again on crops of the image.\n * Sets the number of layers to run, where each layer has 2**i_layer number of image crops.\n * @param {number} [options.overlap_ratio] Sets the degree to which crops overlap. In the first crop layer,\n * crops will overlap by this fraction of the image length. Later layers with more crops scale down this overlap.\n * @param {number} [options.points_per_crop] Number of points to sample from each crop.\n * @param {number} [options.crop_n_points_downscale_factor] The number of points-per-side sampled in layer n is\n * scaled down by crop_n_points_downscale_factor**n.\n * @returns {Object} An object containing the crop boxes, number of points per crop, cropped images, and input labels.\n */\n generate_crop_boxes(image, target_size, {\n crop_n_layers = 0,\n overlap_ratio = 512 / 1500,\n points_per_crop = 32,\n crop_n_points_downscale_factor = 1,\n } = {}) {\n // TODO: Implement\n // return { crop_boxes, points_per_crop, cropped_images, input_labels }\n }\n}\n\nexport class Swin2SRImageProcessor extends ImageFeatureExtractor {\n pad_image(pixelData, imgDims, padSize, options = {}) {\n // NOTE: In this case, `padSize` represents the size of the sliding window for the local attention.\n // In other words, the image is padded so that its width and height are multiples of `padSize`.\n const [imageHeight, imageWidth, imageChannels] = imgDims;\n\n return super.pad_image(pixelData, imgDims, {\n // NOTE: For Swin2SR models, the original python implementation adds padding even when the image's width/height is already\n // a multiple of `pad_size`. However, this is most likely a bug (PR: https://github.com/mv-lab/swin2sr/pull/19).\n // For this reason, we only add padding when the image's width/height is not a multiple of `pad_size`.\n width: imageWidth + (padSize - imageWidth % padSize) % padSize,\n height: imageHeight + (padSize - imageHeight % padSize) % padSize,\n }, {\n mode: 'symmetric',\n center: false,\n constant_values: -1,\n ...options,\n })\n }\n}\n\nexport class VitMatteImageProcessor extends ImageFeatureExtractor {\n /**\n * Calls the feature extraction process on an array of images, preprocesses\n * each image, and concatenates the resulting features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @param {RawImage[]} trimaps The trimaps(s) to extract features from.\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\n */\n async _call(images, trimaps) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n if (!Array.isArray(trimaps)) {\n trimaps = [trimaps];\n }\n\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n const trimapData = await Promise.all(trimaps.map(x => this.preprocess(x, {\n do_normalize: false,\n do_convert_rgb: false,\n do_convert_grayscale: true,\n })));\n\n\n // Stack pixel values\n const pixel_values = stack(imageData.map(\n // Concatenate images and trimaps\n (x, i) => cat([x.pixel_values, trimapData[i].pixel_values], 0)\n ), 0);\n\n return {\n pixel_values,\n\n // Original sizes of images\n original_sizes: imageData.map(x => x.original_size),\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes: imageData.map(x => x.reshaped_input_size),\n }\n }\n}\n\nexport class WhisperFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n // Prefer given `mel_filters` from preprocessor_config.json, or calculate them if they don't exist.\n this.config.mel_filters ??= mel_filter_bank(\n Math.floor(1 + this.config.n_fft / 2), // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n 0.0, // min_frequency\n 8000.0, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n this.window = window_function(this.config.n_fft, 'hann');\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform) {\n const { data, dims } = spectrogram(\n waveform,\n this.window, // window\n this.config.n_fft, // frame_length\n this.config.hop_length, // hop_length\n {\n power: 2.0,\n mel_filters: this.config.mel_filters,\n log_mel: 'log10',\n\n // Custom\n max_num_frames: this.config.nb_max_frames, // 3000\n }\n )\n\n const maxValue = max(data)[0];\n\n for (let i = 0; i < data.length; ++i) {\n data[i] = (Math.max(data[i], maxValue - 8.0) + 4.0) / 4.0;\n }\n\n return { data, dims };\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'WhisperFeatureExtractor');\n\n let waveform;\n if (audio.length > this.config.n_samples) {\n console.warn(\n \"Attempting to extract features for audio longer than 30 seconds. \" +\n \"If using a pipeline to extract transcript from a long audio clip, \" +\n \"remember to specify `chunk_length_s` and/or `stride_length_s`.\"\n );\n waveform = audio.slice(0, this.config.n_samples);\n } else {\n // pad with zeros\n waveform = new Float32Array(this.config.n_samples);\n waveform.set(audio);\n }\n\n const { data, dims } = this._extract_fbank_features(waveform);\n\n return {\n input_features: new Tensor('float32',\n data,\n [1, ...dims]\n )\n };\n }\n}\n\nexport class Wav2Vec2FeatureExtractor extends FeatureExtractor {\n\n /**\n * @param {Float32Array} input_values \n * @returns {Float32Array} \n */\n _zero_mean_unit_var_norm(input_values) {\n // TODO support batch?\n const sum = input_values.reduce((a, b) => a + b, 0);\n const mean = sum / input_values.length;\n const variance = input_values.reduce((a, b) => a + (b - mean) ** 2, 0) / input_values.length;\n return input_values.map(x => (x - mean) / Math.sqrt(variance + 1e-7));\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_values: Tensor; attention_mask: Tensor }>} A Promise resolving to an object containing the extracted input features and attention mask as Tensors.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'Wav2Vec2FeatureExtractor');\n\n if (audio instanceof Float64Array) {\n audio = new Float32Array(audio);\n }\n\n let input_values = audio;\n\n // zero-mean and unit-variance normalization\n if (this.config.do_normalize) {\n input_values = this._zero_mean_unit_var_norm(input_values);\n }\n\n // TODO: allow user to pass in attention mask\n const shape = [1, input_values.length];\n return {\n input_values: new Tensor('float32', input_values, shape),\n attention_mask: new Tensor('int64', new BigInt64Array(input_values.length).fill(1n), shape)\n };\n }\n}\n\nexport class SeamlessM4TFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n const sampling_rate = this.config.sampling_rate;\n const mel_filters = mel_filter_bank(\n 256, // num_frequency_bins\n this.config.num_mel_bins, // num_mel_filters\n 20, // min_frequency\n Math.floor(sampling_rate / 2), // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"kaldi\", // mel_scale\n true, // triangularize_in_mel_space\n );\n\n // Do padding:\n for (let i = 0; i < mel_filters.length; ++i) {\n mel_filters[i].push(0);\n }\n this.mel_filters = mel_filters;\n\n this.window = window_function(400, 'povey', {\n periodic: false,\n })\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number} max_length The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, max_length) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n\n // Kaldi compliance: 16-bit signed integers\n // 32768 == 2 ** 15\n waveform = waveform.map((/** @type {number} */ x) => x * 32768)\n\n return spectrogram(\n waveform,\n this.window, // window\n 400, // frame_length\n 160, // hop_length\n {\n fft_length: 512,\n power: 2.0,\n center: false,\n preemphasis: 0.97,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: 1.192092955078125e-07,\n remove_dc_offset: true,\n\n // Custom\n max_num_frames: max_length,\n transpose: true,\n }\n )\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @param {Object} options Optional parameters for feature extraction.\n * @param {boolean} [options.padding=true] Whether to pad the sequence to a multiple of `pad_to_multiple_of`.\n * @param {number} [options.pad_to_multiple_of=2] The number to pad the sequence to a multiple of.\n * @param {boolean} [options.do_normalize_per_mel_bins=true] Whether or not to zero-mean unit-variance normalize the input per mel-channel.\n * @param {boolean} [options.return_attention_mask=true] Whether to return the attention mask.\n * @returns {Promise<{ input_features: Tensor, attention_mask?: Tensor }>} A Promise resolving to an object containing the extracted input features and attention masks as Tensors.\n */\n async _call(audio, {\n padding = true,\n pad_to_multiple_of = 2,\n do_normalize_per_mel_bins = true,\n return_attention_mask = true,\n } = {}) {\n validate_audio_inputs(audio, 'SeamlessM4TFeatureExtractor');\n\n let features = this._extract_fbank_features(audio, this.config.max_length);\n const features_data = features.data;\n\n if (do_normalize_per_mel_bins) {\n const [num_features, feature_size] = features.dims;\n for (let i = 0; i < feature_size; ++i) {\n let sum = 0;\n for (let j = 0; j < num_features; ++j) {\n sum += features_data[j * feature_size + i];\n }\n\n const mean = sum / num_features;\n\n let variance = 0;\n for (let j = 0; j < num_features; ++j) {\n variance += (features_data[j * feature_size + i] - mean) ** 2;\n }\n variance /= num_features - 1; // NOTE: We use ddof=1\n\n const std = Math.sqrt(variance + 1e-7);\n for (let j = 0; j < num_features; ++j) {\n const index = j * feature_size + i;\n features_data[index] = (features_data[index] - mean) / std;\n }\n }\n }\n\n let padded_attention_mask;\n if (padding) {\n const [num_frames, num_channels] = features.dims;\n\n const pad_size = num_frames % pad_to_multiple_of;\n if (pad_size > 0) {\n const padded_data = new Float32Array(num_channels * (num_frames + pad_size));\n padded_data.set(features_data)\n padded_data.fill(this.config.padding_value, features_data.length)\n\n const numPaddedFrames = num_frames + pad_size;\n features = {\n data: padded_data,\n dims: [numPaddedFrames, num_channels],\n }\n\n if (return_attention_mask) {\n padded_attention_mask = new Tensor(\n 'int64',\n new BigInt64Array(numPaddedFrames),\n [1, numPaddedFrames],\n )\n padded_attention_mask.data.fill(1n, 0, num_frames);\n }\n }\n }\n\n const [num_frames, num_channels] = features.dims;\n\n const stride = this.config.stride;\n const remainder = num_frames % stride;\n if (remainder !== 0) {\n throw new Error(`The number of frames (${num_frames}) must be a multiple of the stride (${stride}).`)\n }\n\n const input_features = new Tensor('float32',\n features_data,\n features.dims,\n ).view(\n 1,\n Math.floor(num_frames / stride),\n num_channels * stride,\n );\n\n const result = { input_features }\n\n if (return_attention_mask) {\n const reshapedNumFrames = input_features.dims[1];\n\n const attention_mask_data = new BigInt64Array(reshapedNumFrames);\n\n if (padded_attention_mask) {\n const padded_attention_mask_data = padded_attention_mask.data;\n for (let i = 1, j = 0; i < num_frames; i += stride, ++j) {\n attention_mask_data[j] = padded_attention_mask_data[i];\n }\n } else {\n attention_mask_data.fill(1n);\n }\n result.attention_mask = new Tensor(\n 'int64',\n attention_mask_data,\n [1, reshapedNumFrames],\n );\n }\n\n return result;\n }\n}\n\nexport class ASTFeatureExtractor extends FeatureExtractor {\n\n\n constructor(config) {\n super(config);\n\n const sampling_rate = this.config.sampling_rate;\n const mel_filters = mel_filter_bank(\n 256, // num_frequency_bins\n this.config.num_mel_bins, // num_mel_filters\n 20, // min_frequency\n Math.floor(sampling_rate / 2), // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"kaldi\", // mel_scale\n true, // triangularize_in_mel_space\n );\n\n // Do padding:\n for (let i = 0; i < mel_filters.length; ++i) {\n mel_filters[i].push(0);\n }\n this.mel_filters = mel_filters;\n\n this.window = window_function(400, 'hann', {\n periodic: false,\n })\n\n this.mean = this.config.mean;\n this.std = this.config.std;\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number} max_length The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, max_length) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n return spectrogram(\n waveform,\n this.window, // window\n 400, // frame_length\n 160, // hop_length\n {\n fft_length: 512,\n power: 2.0,\n center: false,\n preemphasis: 0.97,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: 1.192092955078125e-07,\n remove_dc_offset: true,\n\n // Custom\n max_num_frames: max_length,\n transpose: true,\n }\n )\n }\n\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_values: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'ASTFeatureExtractor');\n\n const features = this._extract_fbank_features(audio, this.config.max_length);\n if (this.config.do_normalize) {\n // Normalize the input audio spectrogram to have mean=0, std=0.5\n const denom = this.std * 2;\n const features_data = features.data;\n for (let i = 0; i < features_data.length; ++i) {\n features_data[i] = (features_data[i] - this.mean) / denom;\n }\n }\n\n return {\n input_values: new Tensor('float32',\n features.data,\n [1, ...features.dims]\n )\n };\n }\n}\n\nexport class ClapFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n this.mel_filters = mel_filter_bank(\n this.config.nb_frequency_bins, // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n this.config.frequency_min, // min_frequency\n this.config.frequency_max, // max_frequency\n this.config.sampling_rate, // sampling_rate\n null, // norm\n \"htk\", // mel_scale\n );\n\n this.mel_filters_slaney = mel_filter_bank(\n this.config.nb_frequency_bins, // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n this.config.frequency_min, // min_frequency\n this.config.frequency_max, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n this.window = window_function(this.config.fft_window_size, 'hann')\n\n }\n\n\n /**\n * Extracts the mel spectrogram and prepares it for the mode based on the `truncation` and `padding` arguments.\n * \n * Four different path are possible:\n * - `truncation=\"fusion\"` and the length of the waveform is greater than the max length: the mel spectrogram\n * will be computed on the entire audio. 3 random crops and a dowsampled version of the full mel spectrogram\n * are then stacked together. They will later be used for `feature_fusion`.\n * - `truncation=\"rand_trunc\"` and the length of the waveform is smaller than the max length: the audio is\n * padded based on `padding`.\n * - `truncation=\"fusion\"` and the length of the waveform is smaller than the max length: the audio is padded\n * based on `padding`, and is repeated `4` times.\n * - `truncation=\"rand_trunc\"` and the length of the waveform is greater than the max length: the mel\n * spectrogram will be computed on a random crop of the waveform.\n * \n * @param {Float32Array|Float64Array} waveform The input waveform.\n * @param {number} max_length The maximum length of the waveform.\n * @param {string} truncation The truncation strategy to use.\n * @param {string} padding The padding strategy to use.\n * @returns {{ data: Float32Array; dims: number[]; longer: boolean; }} An object containing the mel spectrogram data as a Float32Array, its dimensions as an array of numbers, and a boolean indicating whether the waveform was longer than the max length.\n */\n _get_input_mel(waveform, max_length, truncation, padding) {\n\n /** @type {{ data: Float32Array; dims: number[]}} */\n let input_mel;\n let longer = false;\n const diff = waveform.length - max_length;\n if (diff > 0) {\n if (truncation === 'rand_trunc') {\n longer = true;\n const idx = Math.floor(Math.random() * (diff + 1));\n waveform = waveform.subarray(idx, idx + max_length);\n\n input_mel = this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n input_mel.dims = [1, ...input_mel.dims]; // \"unsqueeze\"\n } else {\n // TODO implement fusion strategy\n throw new Error(`Truncation strategy \"${truncation}\" not implemented`)\n }\n } else {\n if (diff < 0) {\n let padded = new Float64Array(max_length); // already padded with zeros\n padded.set(waveform);\n\n if (padding === 'repeat') {\n for (let i = waveform.length; i < max_length; i += waveform.length) {\n padded.set(waveform.subarray(0, Math.min(waveform.length, max_length - i)), i);\n }\n } else if (padding === 'repeatpad') {\n for (let i = waveform.length; i < -diff; i += waveform.length) {\n padded.set(waveform, i);\n }\n }\n waveform = padded;\n }\n\n if (truncation === 'fusion') {\n throw new Error(`Truncation strategy \"${truncation}\" not implemented`)\n }\n\n input_mel = this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n input_mel.dims = [1, ...input_mel.dims]; // \"unsqueeze\"\n }\n\n return {\n ...input_mel,\n longer,\n }\n }\n\n /**\n * Compute the log-mel spectrogram of the provided `waveform` using the Hann window.\n * In CLAP, two different filter banks are used depending on the truncation pattern:\n * - `self.mel_filters`: they correspond to the default parameters of `torchaudio` which can be obtained from\n * calling `torchaudio.transforms.MelSpectrogram().mel_scale.fb`. These filters are used when `truncation`\n * is set to `\"fusion\"`.\n * - `self.mel_filteres_slaney` : they correspond to the default parameters of `librosa` which used\n * `librosa.filters.mel` when computing the mel spectrogram. These filters were only used in the original\n * implementation when the truncation mode is not `\"fusion\"`.\n * \n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number[][]} mel_filters The mel filters to use.\n * @param {number} [max_length=null] The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, mel_filters, max_length = null) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n return spectrogram(\n waveform,\n this.window, // window\n this.config.fft_window_size, // frame_length\n this.config.hop_length, // hop_length\n {\n power: 2.0,\n mel_filters,\n log_mel: 'dB',\n\n // Custom\n max_num_frames: max_length,\n do_pad: false,\n transpose: true,\n }\n )\n }\n\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio, {\n max_length = null,\n } = {}) {\n validate_audio_inputs(audio, 'ClapFeatureExtractor');\n\n // convert to mel spectrogram, truncate and pad if needed.\n const padded_inputs = this._get_input_mel(\n audio,\n max_length ?? this.config.nb_max_samples,\n this.config.truncation,\n this.config.padding,\n );\n\n\n return {\n input_features: new Tensor('float32',\n padded_inputs.data,\n [1, ...padded_inputs.dims]\n )\n };\n }\n}\n\n\n\nexport class SpeechT5FeatureExtractor extends FeatureExtractor { }\n\n/**\n * Represents a Processor that extracts features from an input.\n * @extends Callable\n */\nexport class Processor extends Callable {\n /**\n * Creates a new Processor with the given feature extractor.\n * @param {FeatureExtractor} feature_extractor The function used to extract features from the input.\n */\n constructor(feature_extractor) {\n super();\n this.feature_extractor = feature_extractor;\n // TODO use tokenizer here?\n }\n\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @param {...any} args Additional arguments.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(input, ...args) {\n return await this.feature_extractor(input, ...args);\n }\n}\n\nexport class SamProcessor extends Processor {\n /**\n * @borrows SamImageProcessor#_call as _call\n */\n async _call(...args) {\n return await this.feature_extractor(...args);\n }\n\n /**\n * @borrows SamImageProcessor#post_process_masks as post_process_masks\n */\n post_process_masks(...args) {\n // @ts-ignore\n return this.feature_extractor.post_process_masks(...args);\n }\n /**\n * @borrows SamImageProcessor#reshape_input_points as reshape_input_points\n */\n reshape_input_points(...args) {\n // @ts-ignore\n return this.feature_extractor.reshape_input_points(...args);\n }\n}\n\n/**\n * Represents a WhisperProcessor that extracts features from an audio input.\n * @extends Processor\n */\nexport class WhisperProcessor extends Processor {\n /**\n * Calls the feature_extractor function with the given audio input.\n * @param {any} audio The audio input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n\n\nexport class Wav2Vec2ProcessorWithLM extends Processor {\n /**\n * Calls the feature_extractor function with the given audio input.\n * @param {any} audio The audio input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n\nexport class SpeechT5Processor extends Processor {\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(input) {\n return await this.feature_extractor(input)\n }\n}\n\nexport class OwlViTProcessor extends Processor { }\n\n\n//////////////////////////////////////////////////\n/**\n * Helper class which is used to instantiate pretrained processors with the `from_pretrained` function.\n * The chosen processor class is determined by the type specified in the processor config.\n * \n * **Example:** Load a processor using `from_pretrained`.\n * ```javascript\n * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * ```\n * \n * **Example:** Run an image through a processor.\n * ```javascript\n * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * // {\n * // \"pixel_values\": {\n * // \"dims\": [ 1, 3, 224, 224 ],\n * // \"type\": \"float32\",\n * // \"data\": Float32Array [ -1.558687686920166, -1.558687686920166, -1.5440893173217773, ... ],\n * // \"size\": 150528\n * // },\n * // \"original_sizes\": [\n * // [ 533, 800 ]\n * // ],\n * // \"reshaped_input_sizes\": [\n * // [ 224, 224 ]\n * // ]\n * // }\n * ```\n */\nexport class AutoProcessor {\n static FEATURE_EXTRACTOR_CLASS_MAPPING = {\n ImageFeatureExtractor,\n WhisperFeatureExtractor,\n ViTFeatureExtractor,\n MobileViTFeatureExtractor,\n OwlViTFeatureExtractor,\n Owlv2ImageProcessor,\n CLIPFeatureExtractor,\n CLIPImageProcessor,\n ChineseCLIPFeatureExtractor,\n SiglipImageProcessor,\n ConvNextFeatureExtractor,\n ConvNextImageProcessor,\n SegformerFeatureExtractor,\n BitImageProcessor,\n DPTImageProcessor,\n DPTFeatureExtractor,\n GLPNFeatureExtractor,\n BeitFeatureExtractor,\n DeiTFeatureExtractor,\n DetrFeatureExtractor,\n YolosFeatureExtractor,\n DonutFeatureExtractor,\n NougatImageProcessor,\n EfficientNetImageProcessor,\n\n ViTImageProcessor,\n VitMatteImageProcessor,\n SamImageProcessor,\n Swin2SRImageProcessor,\n Wav2Vec2FeatureExtractor,\n SeamlessM4TFeatureExtractor,\n SpeechT5FeatureExtractor,\n ASTFeatureExtractor,\n ClapFeatureExtractor,\n }\n\n static PROCESSOR_CLASS_MAPPING = {\n WhisperProcessor,\n Wav2Vec2ProcessorWithLM,\n SamProcessor,\n SpeechT5Processor,\n OwlViTProcessor,\n }\n\n /**\n * Instantiate one of the processor classes of the library from a pretrained model.\n * \n * The processor class to instantiate is selected based on the `feature_extractor_type` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing processor files, e.g., `./my_model_directory/`.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the processor.\n * \n * @returns {Promise} A new instance of the Processor class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n } = {}) {\n\n let preprocessorConfig = config ?? await getModelJSON(pretrained_model_name_or_path, 'preprocessor_config.json', true, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n })\n\n // Determine feature extractor class\n // TODO: Ensure backwards compatibility with old configs\n let key = preprocessorConfig.feature_extractor_type ?? preprocessorConfig.image_processor_type;\n let feature_extractor_class = this.FEATURE_EXTRACTOR_CLASS_MAPPING[key];\n\n if (!feature_extractor_class) {\n if (preprocessorConfig.size !== undefined) {\n // Assume ImageFeatureExtractor\n console.warn(`Feature extractor type \"${key}\" not found, assuming ImageFeatureExtractor due to size parameter in config.`);\n feature_extractor_class = ImageFeatureExtractor;\n } else {\n throw new Error(`Unknown Feature Extractor type: ${key}`);\n }\n }\n\n // If no associated processor class, use default\n let processor_class = this.PROCESSOR_CLASS_MAPPING[preprocessorConfig.processor_class] ?? Processor;\n\n // Instantiate processor and feature extractor\n let feature_extractor = new feature_extractor_class(preprocessorConfig);\n return new processor_class(feature_extractor);\n }\n}\n//////////////////////////////////////////////////\n\n","\n/**\n * @file Tokenizers are used to prepare textual inputs for a model.\n * \n * **Example:** Create an `AutoTokenizer` and use it to tokenize a sentence.\n * This will automatically detect the tokenizer type based on the tokenizer class defined in `tokenizer.json`.\n * ```javascript\n * import { AutoTokenizer } from '@xenova/transformers';\n * \n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n * const { input_ids } = await tokenizer('I love transformers!');\n * // Tensor {\n * // data: BigInt64Array(6) [101n, 1045n, 2293n, 19081n, 999n, 102n],\n * // dims: [1, 6],\n * // type: 'int64',\n * // size: 6,\n * // }\n * ```\n * \n * @module tokenizers\n */\nimport {\n Callable,\n} from './utils/generic.js';\n\nimport {\n reverseDictionary,\n escapeRegExp,\n isIntegralNumber,\n mergeArrays,\n} from './utils/core.js';\n\nimport {\n getModelJSON,\n} from './utils/hub.js';\n\nimport { max, min, round } from './utils/maths.js';\nimport { Tensor } from './utils/tensor.js';\n\nimport {\n PriorityQueue,\n TokenLattice,\n CharTrie,\n} from './utils/data-structures.js';\n\nimport { Template } from '@huggingface/jinja';\n\n\n/**\n * @typedef {Object} TokenizerProperties Additional tokenizer-specific properties.\n * @property {boolean} [legacy=false] Whether or not the `legacy` behavior of the tokenizer should be used.\n * @typedef {import('./utils/hub.js').PretrainedOptions & TokenizerProperties} PretrainedTokenizerOptions\n */\n\n/**\n * Loads a tokenizer from the specified path.\n * @param {string} pretrained_model_name_or_path The path to the tokenizer directory.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * @returns {Promise} A promise that resolves with information about the loaded tokenizer.\n */\nasync function loadTokenizer(pretrained_model_name_or_path, options) {\n\n const info = await Promise.all([\n getModelJSON(pretrained_model_name_or_path, 'tokenizer.json', true, options),\n getModelJSON(pretrained_model_name_or_path, 'tokenizer_config.json', true, options),\n ])\n\n // Override legacy option if `options.legacy` is not null\n if (options.legacy !== null) {\n info[1].legacy = options.legacy;\n }\n return info;\n}\n\n\n/**\n * Helper function to split a string on a regex, but keep the delimiters.\n * This is required, because the JavaScript `.split()` method does not keep the delimiters,\n * and wrapping in a capturing group causes issues with existing capturing groups (due to nesting).\n * @param {string} text The text to split.\n * @param {RegExp} regex The regex to split on.\n * @returns {string[]} The split string.\n */\nfunction regexSplit(text, regex) {\n const result = [];\n let prev = 0;\n for (const match of text.matchAll(regex)) {\n const fullMatch = match[0];\n if (prev < match.index) {\n result.push(text.slice(prev, match.index));\n }\n if (fullMatch.length > 0) {\n result.push(fullMatch);\n }\n prev = match.index + fullMatch.length;\n }\n if (prev < text.length) {\n result.push(text.slice(prev));\n }\n return result;\n}\n\n\n/**\n * Helper method to construct a pattern from a config object.\n * @param {Object} pattern The pattern object.\n * @param {boolean} invert Whether to invert the pattern.\n * @returns {RegExp|null} The compiled pattern.\n */\nfunction createPattern(pattern, invert = true) {\n\n if (pattern.Regex !== undefined) {\n // In certain cases, the pattern may contain unnecessary escape sequences (e.g., \\# or \\& or \\~).\n // i.e., valid in Python (where the patterns are exported from) but invalid in JavaScript (where the patterns are parsed).\n // This isn't an issue when creating the regex w/o the 'u' flag, but it is when the 'u' flag is used.\n // For this reason, it is necessary to remove these backslashes before creating the regex.\n // See https://stackoverflow.com/a/63007777/13989043 for more information\n let regex = pattern.Regex.replace(/\\\\([#&~])/g, '$1'); // TODO: add more characters to this list if necessary\n\n // We also handle special cases where the regex contains invalid (non-JS compatible) syntax.\n for (const [key, value] of PROBLEMATIC_REGEX_MAP) {\n regex = regex.replaceAll(key, value);\n }\n\n return new RegExp(regex, 'gu');\n\n } else if (pattern.String !== undefined) {\n const escaped = escapeRegExp(pattern.String);\n // NOTE: if invert is true, we wrap the pattern in a group so that it is kept when performing .split()\n return new RegExp(invert ? escaped : `(${escaped})`, 'gu');\n\n } else {\n console.warn('Unknown pattern type:', pattern)\n return null;\n }\n}\n\n/**\n * Helper function to convert an Object to a Map\n * @param {Object} obj The object to convert.\n * @returns {Map} The map.\n */\nfunction objectToMap(obj) {\n return new Map(Object.entries(obj));\n}\n\n/**\n * Helper function to convert a tensor to a list before decoding.\n * @param {Tensor} tensor The tensor to convert.\n * @returns {number[]} The tensor as a list.\n */\nfunction prepareTensorForDecode(tensor) {\n const dims = tensor.dims;\n switch (dims.length) {\n case 1:\n return tensor.tolist();\n case 2:\n if (dims[0] !== 1) {\n throw new Error('Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.');\n }\n return tensor.tolist()[0];\n default:\n throw new Error(`Expected tensor to have 1-2 dimensions, got ${dims.length}.`)\n }\n}\n\n/**\n * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms\n * @param {string} text The text to clean up.\n * @returns {string} The cleaned up text.\n */\nfunction clean_up_tokenization(text) {\n // Clean up a list of simple English tokenization artifacts\n // like spaces before punctuations and abbreviated forms\n return text.replace(/ \\./g, '.')\n .replace(/ \\?/g, '?')\n .replace(/ \\!/g, '!')\n .replace(/ ,/g, ',')\n .replace(/ \\' /g, \"'\")\n .replace(/ n\\'t/g, \"n't\")\n .replace(/ \\'m/g, \"'m\")\n .replace(/ \\'s/g, \"'s\")\n .replace(/ \\'ve/g, \"'ve\")\n .replace(/ \\'re/g, \"'re\");\n}\n\n/**\n * Helper function to remove accents from a string.\n * @param {string} text The text to remove accents from.\n * @returns {string} The text with accents removed.\n */\nfunction remove_accents(text) {\n return text.replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Helper function to lowercase a string and remove accents.\n * @param {string} text The text to lowercase and remove accents from.\n * @returns {string} The lowercased text with accents removed.\n */\nfunction lowercase_and_remove_accent(text) {\n return remove_accents(text.toLowerCase());\n}\n\n/**\n * Helper function to fuse consecutive values in an array equal to the specified value.\n * @param {string[]} arr The input array\n * @param {any} value The value to fuse on.\n * @param {Map} mapping The mapping from input domain to value.\n */\nfunction fuse(arr, value, mapping) {\n const fused = [];\n let i = 0;\n while (i < arr.length) {\n fused.push(arr[i])\n if ((mapping.get(arr[i]) ?? value) !== value) {\n ++i;\n continue;\n }\n\n while (i < arr.length && (mapping.get(arr[i]) ?? value) === value) {\n ++i;\n }\n }\n\n return fused;\n}\n\n/**\n * Split a string on whitespace.\n * @param {string} text The text to split.\n * @returns {string[]} The split string.\n */\nfunction whitespace_split(text) {\n return text.match(/\\S+/g) || [];\n}\n\nconst PUNCTUATION_REGEX = '\\\\p{P}\\\\u0021-\\\\u002F\\\\u003A-\\\\u0040\\\\u005B-\\\\u0060\\\\u007B-\\\\u007E';\n\n// A mapping of regex patterns to their equivalent (but longer) JS-compatible versions.\nconst PROBLEMATIC_REGEX_MAP = new Map([\n // This uses the case insensitive group modifier, which is not supported in JavaScript.\n // When parsing the regex, an \"Invalid group\" error is thrown.\n [\"(?i:'s|'t|'re|'ve|'m|'ll|'d)\", \"(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))\"],\n])\n\n\n/**\n * Represent a token added by the user on top of the existing Model vocabulary.\n * AddedToken can be configured to specify the behavior they should have in various situations like:\n * - Whether they should only match single words\n * - Whether to include any whitespace on its left or right\n */\nclass AddedToken {\n /**\n * Creates a new instance of AddedToken.\n * @param {Object} config Added token configuration object.\n * @param {string} config.content The content of the added token.\n * @param {number} config.id The id of the added token.\n * @param {boolean} [config.single_word=false] Whether this token must be a single word or can break words.\n * @param {boolean} [config.lstrip=false] Whether this token should strip whitespaces on its left.\n * @param {boolean} [config.rstrip=false] Whether this token should strip whitespaces on its right.\n * @param {boolean} [config.normalized=false] Whether this token should be normalized.\n * @param {boolean} [config.special=false] Whether this token is special.\n */\n constructor(config) {\n this.content = config.content;\n this.id = config.id;\n this.single_word = config.single_word ?? false;\n this.lstrip = config.lstrip ?? false;\n this.rstrip = config.rstrip ?? false;\n this.special = config.special ?? false;\n this.normalized = config.normalized ?? null;\n }\n}\n\n/**\n * Abstract base class for tokenizer models.\n *\n * @extends Callable\n */\nexport class TokenizerModel extends Callable {\n /**\n * Creates a new instance of TokenizerModel.\n * @param {Object} config The configuration object for the TokenizerModel.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /** @type {string[]} */\n this.vocab = [];\n\n /**\n * A mapping of tokens to ids.\n * @type {Map}\n */\n this.tokens_to_ids = new Map();\n\n this.unk_token_id = undefined;\n this.unk_token = undefined;\n this.end_of_word_suffix = undefined;\n\n /** @type {boolean} Whether to fuse unknown tokens when encoding. Defaults to false. */\n this.fuse_unk = this.config.fuse_unk ?? false;\n }\n\n /**\n * Instantiates a new TokenizerModel instance based on the configuration object provided.\n * @param {Object} config The configuration object for the TokenizerModel.\n * @param {...*} args Optional arguments to pass to the specific TokenizerModel constructor.\n * @returns {TokenizerModel} A new instance of a TokenizerModel.\n * @throws Will throw an error if the TokenizerModel type in the config is not recognized.\n */\n static fromConfig(config, ...args) {\n switch (config.type) {\n case 'WordPiece':\n return new WordPieceTokenizer(config);\n case 'Unigram':\n // @ts-ignore\n return new Unigram(config, ...args);\n\n case 'BPE':\n return new BPE(config);\n\n default:\n if (config.vocab) {\n // @ts-ignore\n return new LegacyTokenizerModel(config, ...args);\n }\n throw new Error(`Unknown TokenizerModel type: ${config.type}`);\n }\n }\n\n /**\n * Internal function to call the TokenizerModel instance.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} The encoded token IDs.\n */\n _call(tokens) {\n let ids = this.encode(tokens);\n if (this.fuse_unk) {\n // Fuse unknown tokens\n ids = fuse(ids, this.unk_token_id, this.tokens_to_ids);\n }\n return ids;\n }\n\n /**\n * Encodes a list of tokens into a list of token IDs.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} The encoded tokens.\n * @throws Will throw an error if not implemented in a subclass.\n */\n encode(tokens) {\n throw Error(\"encode should be implemented in subclass.\")\n }\n\n /**\n * Converts a list of tokens into a list of token IDs.\n * @param {string[]} tokens The tokens to convert.\n * @returns {number[]} The converted token IDs.\n */\n convert_tokens_to_ids(tokens) {\n return tokens.map(t => this.tokens_to_ids.get(t) ?? this.unk_token_id);\n }\n\n /**\n * Converts a list of token IDs into a list of tokens.\n * @param {number[]} ids The token IDs to convert.\n * @returns {string[]} The converted tokens.\n */\n convert_ids_to_tokens(ids) {\n return ids.map(i => this.vocab[i] ?? this.unk_token);\n }\n}\n\n/**\n * A subclass of TokenizerModel that uses WordPiece encoding to encode tokens.\n * @extends TokenizerModel\n */\nclass WordPieceTokenizer extends TokenizerModel {\n /**\n * @param {Object} config The configuration object.\n * @param {Object} config.vocab A mapping of tokens to ids.\n * @param {string} config.unk_token The unknown token string.\n * @param {string} config.continuing_subword_prefix The prefix to use for continuing subwords.\n * @param {number} [config.max_input_chars_per_word=100] The maximum number of characters per word.\n */\n constructor(config) {\n super(config);\n /**\n * A mapping of tokens to ids.\n * @type {Map}\n */\n this.tokens_to_ids = objectToMap(config.vocab);\n\n /**\n * The id of the unknown token.\n * @type {number}\n */\n this.unk_token_id = this.tokens_to_ids.get(config.unk_token);\n\n /**\n * The unknown token string.\n * @type {string}\n */\n this.unk_token = config.unk_token;\n\n /**\n * The maximum number of characters allowed per word.\n * @type {number}\n */\n this.max_input_chars_per_word = config.max_input_chars_per_word ?? 100;\n\n /**\n * An array of tokens.\n * @type {string[]}\n */\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n }\n\n /**\n * Encodes an array of tokens using WordPiece encoding.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} An array of encoded tokens.\n */\n encode(tokens) {\n const outputTokens = [];\n for (const token of tokens) {\n const chars = [...token];\n if (chars.length > this.max_input_chars_per_word) {\n outputTokens.push(this.unk_token);\n continue;\n }\n\n let isUnknown = false;\n let start = 0;\n const subTokens = [];\n\n while (start < chars.length) {\n let end = chars.length;\n let currentSubstring = null;\n while (start < end) {\n let substr = chars.slice(start, end).join('');\n\n if (start > 0) {\n substr = this.config.continuing_subword_prefix + substr;\n }\n if (this.tokens_to_ids.has(substr)) {\n currentSubstring = substr;\n break;\n }\n\n --end;\n }\n if (currentSubstring === null) {\n isUnknown = true;\n break;\n }\n subTokens.push(currentSubstring);\n start = end;\n }\n if (isUnknown) {\n outputTokens.push(this.unk_token);\n } else {\n outputTokens.push(...subTokens);\n }\n }\n\n return outputTokens;\n }\n\n}\n\n/**\n * Class representing a Unigram tokenizer model.\n * @extends TokenizerModel\n */\nclass Unigram extends TokenizerModel {\n /**\n * Create a new Unigram tokenizer model.\n * @param {Object} config The configuration object for the Unigram model.\n * @param {number} config.unk_id The ID of the unknown token\n * @param {any[][]} config.vocab A 2D array representing a mapping of tokens to scores.\n * @param {Object} moreConfig Additional configuration object for the Unigram model.\n */\n constructor(config, moreConfig) {\n super(config);\n\n const vocabSize = config.vocab.length;\n this.vocab = new Array(vocabSize);\n this.scores = new Array(vocabSize);\n for (let i = 0; i < vocabSize; ++i) {\n const piece = config.vocab[i];\n this.vocab[i] = piece[0];\n this.scores[i] = piece[1];\n }\n\n this.unk_token_id = config.unk_id;\n this.unk_token = this.vocab[config.unk_id];\n\n this.tokens_to_ids = new Map(this.vocab.map((x, i) => [x, i]));\n this.bosToken = ' '; // beginning of a sentence token\n\n this.bosTokenId = this.tokens_to_ids.get(this.bosToken); // NOTE: may be undefined\n this.eosToken = moreConfig.eos_token;\n\n this.eosTokenId = this.tokens_to_ids.get(this.eosToken);\n this.unkToken = this.vocab[this.unk_token_id];\n\n this.minScore = min(this.scores)[0];\n\n this.unkScore = this.minScore - 10.0;\n this.scores[this.unk_token_id] = this.unkScore;\n\n this.trie = new CharTrie();\n this.trie.extend(this.vocab);\n\n // NOTE: `fuse_unk` is hardcoded to true for Unigram models\n // See: https://github.com/huggingface/tokenizers/blob/b58227c7f1ccf8b73ee2268354336da56d91e492/tokenizers/src/models/unigram/model.rs#L119\n this.fuse_unk = true;\n }\n\n /**\n * Populates lattice nodes.\n * @param {TokenLattice} lattice The token lattice to populate with nodes.\n */\n populateNodes(lattice) {\n const sentence = lattice.sentence;\n const len = sentence.length;\n let beginPos = 0;\n while (beginPos < len) {\n const mblen = 1;\n let hasSingleNode = false;\n const tokens = [];\n\n for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) {\n tokens.push(token);\n const tokenId = this.tokens_to_ids.get(token);\n const tokenScore = this.scores[tokenId];\n const n = token.length;\n lattice.insert(beginPos, n, tokenScore, tokenId);\n if (!hasSingleNode && n === mblen) {\n hasSingleNode = true;\n }\n }\n if (!hasSingleNode) {\n lattice.insert(beginPos, mblen, this.unkScore, this.unk_token_id);\n }\n beginPos += mblen;\n }\n }\n\n /**\n * Encodes an array of tokens into an array of subtokens using the unigram model.\n *\n * @param {string} normalized The normalized string.\n * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model.\n */\n tokenize(normalized) {\n const lattice = new TokenLattice(normalized, this.bosTokenId, this.eosTokenId);\n this.populateNodes(lattice);\n return lattice.tokens();\n }\n\n /**\n * Encodes an array of tokens using Unigram encoding.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} An array of encoded tokens.\n */\n encode(tokens) {\n const toReturn = [];\n for (const token of tokens) {\n const tokenized = this.tokenize(token);\n toReturn.push(...tokenized);\n }\n return toReturn;\n }\n\n}\n\n/**\n * Returns list of utf-8 byte and a mapping to unicode strings.\n * Specifically avoids mapping to whitespace/control characters the BPE code barfs on.\n * @returns {Object} Object with utf-8 byte keys and unicode string values.\n */\nconst BYTES_TO_UNICODE = (() => {\n // Returns list of utf-8 byte and a mapping to unicode strings.\n // We specifically avoids mapping to whitespace/control characters\n // the bpe code barfs on.\n\n const bs = [\n ...Array.from({ length: \"~\".charCodeAt(0) - \"!\".charCodeAt(0) + 1 }, (_, i) => i + \"!\".charCodeAt(0)),\n ...Array.from({ length: \"¬\".charCodeAt(0) - \"¡\".charCodeAt(0) + 1 }, (_, i) => i + \"¡\".charCodeAt(0)),\n ...Array.from({ length: \"ÿ\".charCodeAt(0) - \"®\".charCodeAt(0) + 1 }, (_, i) => i + \"®\".charCodeAt(0)),\n ];\n const cs = bs.slice();\n let n = 0;\n for (let b = 0; b < 256; ++b) {\n if (!bs.includes(b)) {\n bs.push(b);\n cs.push(256 + n);\n n += 1;\n }\n }\n const ccs = cs.map(n => String.fromCharCode(n));\n return Object.fromEntries(bs.map((b, i) => [b, ccs[i]]));\n})();\n\nconst UNICODE_TO_BYTES = reverseDictionary(BYTES_TO_UNICODE);\n\n\n/**\n * @typedef {Object} BPENode\n * @property {string} token The token associated with the node\n * @property {number} bias A positional bias for the node.\n * @property {number} [score] The score of the node.\n * @property {BPENode} [prev] The previous node in the linked list.\n * @property {BPENode} [next] The next node in the linked list.\n */\n\n/**\n * BPE class for encoding text into Byte-Pair-Encoding (BPE) tokens.\n * @extends TokenizerModel\n */\nclass BPE extends TokenizerModel {\n /**\n * Create a BPE instance.\n * @param {Object} config The configuration object for BPE.\n * @param {Object} config.vocab A mapping of tokens to ids.\n * @param {string} config.unk_token The unknown token used for out of vocabulary words.\n * @param {string} config.end_of_word_suffix The suffix to place at the end of each word.\n * @param {string} [config.continuing_subword_suffix] The suffix to insert between words.\n * @param {Array} config.merges An array of BPE merges as strings.\n */\n constructor(config) {\n super(config);\n\n this.BPE_SPLIT_TOKEN = ' ';\n\n /** @type {Map} */\n this.tokens_to_ids = objectToMap(config.vocab);\n\n this.unk_token_id = this.tokens_to_ids.get(config.unk_token);\n this.unk_token = config.unk_token;\n\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n\n this.bpe_ranks = new Map(config.merges.map((x, i) => [x, i]));\n this.merges = config.merges.map(x => x.split(this.BPE_SPLIT_TOKEN));\n\n this.end_of_word_suffix = config.end_of_word_suffix;\n\n // NOTE: `continuing_subword_suffix` is custom (to support `BlenderbotSmallTokenizer`)\n this.continuing_subword_suffix = config.continuing_subword_suffix ?? null;\n\n this.byte_fallback = this.config.byte_fallback ?? false;\n\n if (this.byte_fallback) {\n this.text_encoder = new TextEncoder();\n }\n\n /** @type {Map} */\n this.cache = new Map();\n }\n\n /**\n * Apply Byte-Pair-Encoding (BPE) to a given token. Efficient heap-based priority\n * queue implementation adapted from https://github.com/belladoreai/llama-tokenizer-js.\n * @param {string} token The token to encode.\n * @returns {string[]} The BPE encoded tokens.\n */\n bpe(token) {\n if (token.length === 0) {\n return [];\n }\n\n const cached = this.cache.get(token);\n if (cached !== undefined) {\n return cached;\n }\n\n const word = Array.from(token);\n if (this.end_of_word_suffix) {\n word[word.length - 1] += this.end_of_word_suffix;\n }\n\n let result = [];\n if (word.length > 1) {\n // Create a priority queue to store the nodes that will be merged.\n // The comparator function compares the scores of the nodes.\n const queue = new PriorityQueue((a, b) => a.score < b.score);\n\n // Construct a doubly-linked list of nodes that will be inserted into the priority queue,\n // starting with the individual characters. We also populate each node with a positional\n // bias to break ties in the priority queue.\n let startingNode = {\n token: word[0],\n bias: 0,\n prev: null,\n next: null,\n }\n\n let previousNode = startingNode\n for (let i = 1; i < word.length; ++i) {\n const currentNode = {\n bias: i / word.length, // Add fractional component to break ties\n token: word[i],\n prev: previousNode,\n next: null,\n }\n previousNode.next = currentNode\n this._add_node(queue, previousNode)\n previousNode = currentNode\n }\n\n while (!queue.isEmpty()) {\n // Get the next node with the highest priority\n const node = queue.pop();\n\n // Check that this merge is still possible\n if (node.deleted || !node.next || node.next.deleted) continue;\n\n // Here, we mark the current node (left side of the merge) and the next node (right side of the merge) as deleted.\n // This is because they will both be replaced by a new node representing the merge result.\n node.deleted = true;\n node.next.deleted = true;\n\n // Next, we fix the node that comes before the current node (i.e., left side of the merge).\n if (node.prev) {\n\n // Make a shallow copy of the previous node\n const newPreviousNode = { ...node.prev };\n\n // Mark the old previous node as deleted. This avoids erroneous merges later,\n // because there may still be references to this node in the priority queue.\n node.prev.deleted = true;\n node.prev = newPreviousNode;\n\n // Update the reference of the previous node, by pointing its previous node to this new previous node.\n if (newPreviousNode.prev) {\n newPreviousNode.prev.next = newPreviousNode;\n } else {\n // If the previous of the previous node does not exist, it means that\n // `newPreviousNode` must be the new `startingNode`.\n startingNode = newPreviousNode;\n }\n }\n\n // Create a new node which represents the result of the merge.\n const merged = {\n token: node.token + node.next.token,\n bias: node.bias,\n prev: node.prev,\n next: node.next.next,\n }\n\n // We now consider where we can add the new merged node to the priority queue:\n // 1. prev <-> merged\n if (merged.prev) {\n merged.prev.next = merged;\n this._add_node(queue, merged.prev);\n } else {\n // If `merged.prev` does not exist, then `merged` must be the new `startingNode`.\n startingNode = merged;\n }\n\n // 2. merged <-> next\n if (merged.next) {\n merged.next.prev = merged;\n this._add_node(queue, merged);\n }\n }\n\n // Traverse the linked list, starting from the `startingNode`, and collect the tokens.\n for (let currentNode = startingNode; currentNode !== null; currentNode = currentNode.next) {\n result.push(currentNode.token);\n }\n } else {\n result = word;\n }\n\n // Possibly append suffix\n if (this.continuing_subword_suffix) {\n // Do not append suffix to the last token\n for (let i = 0; i < result.length - 1; ++i) {\n result[i] += this.continuing_subword_suffix;\n }\n }\n\n // Save the result to the cache\n this.cache.set(token, result);\n\n return result;\n }\n\n\n /**\n * Helper function to add a node to the priority queue.\n * @param {PriorityQueue} queue \n * @param {BPENode} node\n * @private\n */\n _add_node(queue, node) {\n // `score` is a measure of the merge priority: lower means higher priority\n // We use the BPE rank as a measure of priority (i.e., the local of the merge in the merges list)\n // We also add a fractional component to the score to break ties (with the earlier character having higher priority)\n const rank = this.bpe_ranks.get(node.token + this.BPE_SPLIT_TOKEN + node.next.token);\n if (rank !== undefined) {\n node.score = rank + node.bias;\n queue.push(node);\n }\n }\n\n /**\n * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens.\n * @param {string[]} tokens The input sequence of tokens to encode.\n * @returns {string[]} The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens.\n */\n encode(tokens) {\n const outputTokens = [];\n\n for (const token of tokens) {\n const bpe_token_list = this.bpe(token);\n\n for (const t of bpe_token_list) {\n if (this.tokens_to_ids.has(t)) {\n outputTokens.push(t);\n } else {\n if (this.byte_fallback) {\n outputTokens.push(\n ...Array.from(this.text_encoder.encode(t))\n .map(x => `<0x${x.toString(16).toUpperCase().padStart(2, '0')}>`)\n );\n } else {\n outputTokens.push(this.unk_token);\n }\n }\n }\n }\n\n return outputTokens;\n }\n\n}\n\n/**\n * Legacy tokenizer class for tokenizers with only a vocabulary.\n */\nclass LegacyTokenizerModel extends TokenizerModel {\n /**\n * Create a LegacyTokenizerModel instance.\n * @param {Object} config The configuration object for LegacyTokenizerModel.\n * @param {Object} config.vocab A (possibly nested) mapping of tokens to ids.\n * @param {Object} moreConfig Additional configuration object for the LegacyTokenizerModel model.\n */\n constructor(config, moreConfig) {\n super(config);\n\n /**@type {Map} */\n this.tokens_to_ids = objectToMap(\n moreConfig.target_lang\n ? config.vocab[moreConfig.target_lang]\n : config.vocab\n );\n\n this.bos_token = moreConfig.bos_token;\n this.bos_token_id = this.tokens_to_ids.get(this.bos_token);\n\n this.eos_token = moreConfig.eos_token;\n this.eos_token_id = this.tokens_to_ids.get(this.eos_token);\n\n this.pad_token = moreConfig.pad_token;\n this.pad_token_id = this.tokens_to_ids.get(this.pad_token);\n\n this.unk_token = moreConfig.unk_token;\n this.unk_token_id = this.tokens_to_ids.get(this.unk_token);\n\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n }\n\n encode(tokens) {\n return tokens;\n }\n}\n\n\n/**\n * A base class for text normalization.\n * @abstract\n */\nclass Normalizer extends Callable {\n /**\n * @param {Object} config The configuration object for the normalizer.\n */\n constructor(config) {\n super();\n this.config = config;\n }\n\n /**\n * Factory method for creating normalizers from config objects.\n * @static\n * @param {Object} config The configuration object for the normalizer.\n * @returns {Normalizer} A Normalizer object.\n * @throws {Error} If an unknown Normalizer type is specified in the config.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'BertNormalizer':\n return new BertNormalizer(config);\n case 'Precompiled':\n return new Precompiled(config);\n case 'Sequence':\n return new NormalizerSequence(config);\n case 'Replace':\n return new Replace(config);\n case 'NFC':\n return new NFC(config);\n case 'NFKC':\n return new NFKC(config);\n case 'NFKD':\n return new NFKD(config);\n case 'Strip':\n return new StripNormalizer(config);\n case 'StripAccents':\n return new StripAccents(config);\n case 'Lowercase':\n return new Lowercase(config);\n case 'Prepend':\n return new Prepend(config);\n default:\n throw new Error(`Unknown Normalizer type: ${config.type}`);\n }\n }\n\n /**\n * Normalize the input text.\n * @abstract\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n * @throws {Error} If this method is not implemented in a subclass.\n */\n normalize(text) {\n throw Error(\"normalize should be implemented in subclass.\")\n }\n\n /**\n * Alias for {@link Normalizer#normalize}.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n _call(text) {\n return this.normalize(text);\n }\n\n}\n\n/**\n * Replace normalizer that replaces occurrences of a pattern with a given string or regular expression.\n * @extends Normalizer\n */\nclass Replace extends Normalizer {\n /**\n * Normalize the input text by replacing the pattern with the content.\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text after replacing the pattern with the content.\n */\n normalize(text) {\n const pattern = createPattern(this.config.pattern);\n return pattern === null\n ? text\n : text.replaceAll(pattern, this.config.content);\n }\n}\n\n/**\n * A normalizer that applies Unicode normalization form C (NFC) to the input text.\n * @extends Normalizer\n */\nclass NFC extends Normalizer {\n /**\n * Normalize the input text by applying Unicode normalization form C (NFC).\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFC')\n return text;\n }\n}\n\n/**\n * NFKC Normalizer.\n * @extends Normalizer\n */\nclass NFKC extends Normalizer {\n /**\n * Normalize text using NFKC normalization.\n * @param {string} text The text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFKC')\n return text;\n }\n}\n/**\n * NFKD Normalizer.\n * @extends Normalizer\n */\nclass NFKD extends Normalizer {\n /**\n * Normalize text using NFKD normalization.\n * @param {string} text The text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFKD')\n return text;\n }\n}\n\n/**\n * A normalizer that strips leading and/or trailing whitespace from the input text.\n */\nclass StripNormalizer extends Normalizer {\n /**\n * Strip leading and/or trailing whitespace from the input text.\n * @param {string} text The input text.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n if (this.config.strip_left && this.config.strip_right) {\n // Fast path to avoid an extra trim call\n text = text.trim();\n } else {\n if (this.config.strip_left) {\n text = text.trimStart();\n }\n if (this.config.strip_right) {\n text = text.trimEnd();\n }\n }\n return text;\n }\n}\n\n/**\n * StripAccents normalizer removes all accents from the text.\n * @extends Normalizer\n */\nclass StripAccents extends Normalizer {\n /**\n * Remove all accents from the text.\n * @param {string} text The input text.\n * @returns {string} The normalized text without accents.\n */\n normalize(text) {\n text = remove_accents(text);\n return text;\n }\n}\n\n/**\n * A Normalizer that lowercases the input string.\n * @extends Normalizer\n */\nclass Lowercase extends Normalizer {\n /**\n * Lowercases the input string.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.toLowerCase();\n return text;\n }\n}\n\n/**\n * A Normalizer that prepends a string to the input string.\n * @extends Normalizer\n */\nclass Prepend extends Normalizer {\n /**\n * Prepends the input string.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = this.config.prepend + text;\n return text;\n }\n}\n\n/**\n * A Normalizer that applies a sequence of Normalizers.\n * @extends Normalizer\n */\nclass NormalizerSequence extends Normalizer {\n /**\n * Create a new instance of NormalizerSequence.\n * @param {Object} config The configuration object.\n * @param {Object[]} config.normalizers An array of Normalizer configuration objects.\n */\n constructor(config) {\n super(config);\n this.normalizers = config.normalizers.map(x => Normalizer.fromConfig(x));\n }\n /**\n * Apply a sequence of Normalizers to the input text.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n return this.normalizers.reduce((t, normalizer) => {\n return normalizer.normalize(t);\n }, text);\n }\n}\n\n/**\n * A class representing a normalizer used in BERT tokenization.\n * @extends Normalizer\n */\nclass BertNormalizer extends Normalizer {\n /**\n * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text.\n *\n * @param {string} text The input text to tokenize.\n * @returns {string} The tokenized text with whitespace added around CJK characters.\n */\n _tokenize_chinese_chars(text) {\n /* Adds whitespace around any CJK character. */\n const output = [];\n for (let i = 0; i < text.length; ++i) {\n const char = text[i];\n const cp = char.charCodeAt(0);\n if (this._is_chinese_char(cp)) {\n output.push(\" \");\n output.push(char);\n output.push(\" \");\n } else {\n output.push(char);\n }\n }\n return output.join(\"\");\n }\n\n /**\n * Checks whether the given Unicode codepoint represents a CJK (Chinese, Japanese, or Korean) character.\n *\n * A \"chinese character\" is defined as anything in the CJK Unicode block:\n * https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)\n *\n * Note that the CJK Unicode block is NOT all Japanese and Korean characters, despite its name.\n * The modern Korean Hangul alphabet is a different block, as is Japanese Hiragana and Katakana.\n * Those alphabets are used to write space-separated words, so they are not treated specially\n * and are handled like all other languages.\n *\n * @param {number} cp The Unicode codepoint to check.\n * @returns {boolean} True if the codepoint represents a CJK character, false otherwise.\n */\n _is_chinese_char(cp) {\n return (\n (cp >= 0x4E00 && cp <= 0x9FFF)\n || (cp >= 0x3400 && cp <= 0x4DBF)\n || (cp >= 0x20000 && cp <= 0x2A6DF)\n || (cp >= 0x2A700 && cp <= 0x2B73F)\n || (cp >= 0x2B740 && cp <= 0x2B81F)\n || (cp >= 0x2B820 && cp <= 0x2CEAF)\n || (cp >= 0xF900 && cp <= 0xFAFF)\n || (cp >= 0x2F800 && cp <= 0x2FA1F)\n )\n }\n /**\n * Strips accents from the given text.\n * @param {string} text The text to strip accents from.\n * @returns {string} The text with accents removed.\n */\n stripAccents(text) {\n return text.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }\n\n\n /**\n * Checks whether `char` is a control character.\n * @param {string} char The character to check.\n * @returns {boolean} Whether `char` is a control character.\n * @private\n */\n _is_control(char) {\n switch (char) {\n case '\\t':\n case '\\n':\n case '\\r':\n // These are technically control characters but we count them as whitespace characters.\n return false;\n\n default:\n // Check if unicode category starts with C:\n // Cc - Control\n // Cf - Format\n // Co - Private Use\n // Cs - Surrogate\n return /^\\p{Cc}|\\p{Cf}|\\p{Co}|\\p{Cs}$/u.test(char);\n }\n }\n\n /**\n * Performs invalid character removal and whitespace cleanup on text.\n * @param {string} text The text to clean.\n * @returns {string} The cleaned text.\n * @private\n */\n _clean_text(text) {\n const output = [];\n for (const char of text) {\n const cp = char.charCodeAt(0);\n if (cp === 0 || cp === 0xFFFD || this._is_control(char)) {\n continue;\n }\n if (/^\\s$/.test(char)) { // is whitespace\n output.push(\" \");\n } else {\n output.push(char);\n }\n }\n return output.join(\"\");\n }\n /**\n * Normalizes the given text based on the configuration.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n if (this.config.clean_text) {\n text = this._clean_text(text);\n }\n\n if (this.config.handle_chinese_chars) {\n text = this._tokenize_chinese_chars(text);\n }\n\n if (this.config.lowercase) {\n text = text.toLowerCase();\n\n if (this.config.strip_accents !== false) {\n text = this.stripAccents(text);\n }\n } else if (this.config.strip_accents) {\n text = this.stripAccents(text);\n }\n\n return text;\n }\n}\n\n/**\n * A callable class representing a pre-tokenizer used in tokenization. Subclasses\n * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic.\n * @extends Callable\n */\nclass PreTokenizer extends Callable {\n /**\n * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration.\n *\n * @static\n * @param {Object} config A configuration object for the pre-tokenizer.\n * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`.\n * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer.\n */\n static fromConfig(config) {\n if (config === null) return null;\n\n switch (config.type) {\n case 'BertPreTokenizer':\n return new BertPreTokenizer(config);\n case 'Sequence':\n return new PreTokenizerSequence(config);\n case 'Whitespace':\n return new WhitespacePreTokenizer(config);\n case 'WhitespaceSplit':\n return new WhitespaceSplit(config);\n case 'Metaspace':\n return new MetaspacePreTokenizer(config);\n\n case 'ByteLevel':\n return new ByteLevelPreTokenizer(config);\n case 'Split':\n return new SplitPreTokenizer(config);\n case 'Punctuation':\n return new PunctuationPreTokenizer(config);\n case 'Digits':\n return new DigitsPreTokenizer(config);\n case 'Replace':\n return new ReplacePreTokenizer(config);\n default:\n throw new Error(`Unknown PreTokenizer type: ${config.type}`);\n }\n }\n\n /**\n * Method that should be implemented by subclasses to define the specific pre-tokenization logic.\n *\n * @abstract\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} The pre-tokenized text.\n * @throws {Error} If the method is not implemented in the subclass.\n */\n pre_tokenize_text(text, options) {\n throw Error(\"pre_tokenize_text should be implemented in subclass.\")\n }\n\n /**\n * Tokenizes the given text into pre-tokens.\n * @param {string|string[]} text The text or array of texts to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of pre-tokens.\n */\n pre_tokenize(text, options) {\n return (Array.isArray(text)\n ? text.map(x => this.pre_tokenize_text(x, options))\n : this.pre_tokenize_text(text, options)\n ).flat();\n }\n\n /**\n * Alias for {@link PreTokenizer#pre_tokenize}.\n * @param {string|string[]} text The text or array of texts to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of pre-tokens.\n */\n _call(text, options) {\n return this.pre_tokenize(text, options);\n }\n}\n\n/**\n * @extends PreTokenizer\n */\nclass BertPreTokenizer extends PreTokenizer {\n /**\n * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme\n * similar to that used in the original implementation of BERT.\n * \n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n // Construct a pattern which matches the rust implementation:\n // https://github.com/huggingface/tokenizers/blob/b4fcc9ce6e4ad5806e82826f816acfdfdc4fcc67/tokenizers/src/pre_tokenizers/bert.rs#L11\n // Equivalent to removing whitespace and splitting on punctuation (both \\p{P} and other ascii characters)\n this.pattern = new RegExp(`[^\\\\s${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]`, 'gu');\n }\n /**\n * Tokenizes a single text using the BERT pre-tokenization scheme.\n * \n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.trim().match(this.pattern) || [];\n }\n}\n\n/**\n * A pre-tokenizer that splits text into Byte-Pair-Encoding (BPE) subwords.\n * @extends PreTokenizer\n */\nclass ByteLevelPreTokenizer extends PreTokenizer {\n /**\n * Creates a new instance of the `ByteLevelPreTokenizer` class.\n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /**\n * @type {boolean} Whether to add a leading space to the first word.\n * This allows to treat the leading word just as any other word.\n */\n this.add_prefix_space = this.config.add_prefix_space;\n\n /**\n * @type {boolean} Whether the post processing step should trim offsets\n * to avoid including whitespaces.\n * @todo Use this in the pretokenization step.\n */\n this.trim_offsets = this.config.trim_offsets;\n\n /**\n * @type {boolean} Whether to use the standard GPT2 regex for whitespace splitting.\n * Set it to False if you want to use your own splitting. Defaults to true.\n */\n this.use_regex = this.config.use_regex ?? true;\n this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+/gu;\n\n this.byte_encoder = BYTES_TO_UNICODE;\n this.text_encoder = new TextEncoder();\n }\n\n /**\n * Tokenizes a single piece of text using byte-level tokenization.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n // Add a leading space if the option is enabled\n if (this.add_prefix_space && !text.startsWith(' ')) {\n text = ' ' + text;\n }\n\n // Split on whitespace and punctuation\n const tokens = this.use_regex ? (text.match(this.pattern) || []) : [text];\n\n // Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)\n return tokens.map(\n token => Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join('')\n );\n }\n}\n\n/**\n * @typedef {'removed'|'isolated'|'mergedWithPrevious'|'mergedWithNext'|'contiguous'} SplitDelimiterBehavior\n */\n\n/**\n * Splits text using a given pattern.\n * @extends PreTokenizer\n */\nclass SplitPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object.\n * @param {string|undefined} config.pattern.String The string to use for splitting. Only defined if the pattern is a string.\n * @param {string|undefined} config.pattern.Regex The regex to use for splitting. Only defined if the pattern is a regex.\n * @param {SplitDelimiterBehavior} config.behavior The behavior to use when splitting.\n * @param {boolean} config.invert Whether to split (invert=false) or match (invert=true) the pattern.\n */\n constructor(config) {\n super();\n this.config = config;\n // TODO support all behaviours (config.behavior)\n\n this.pattern = createPattern(this.config.pattern, this.config.invert);\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n if (this.pattern === null) {\n return [];\n }\n\n if (this.config.invert) {\n return text.match(this.pattern) || [];\n } else {\n return regexSplit(text, this.pattern);\n }\n }\n}\n\n/**\n * Splits text based on punctuation.\n * @extends PreTokenizer\n */\nclass PunctuationPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {SplitDelimiterBehavior} config.behavior The behavior to use when splitting.\n */\n constructor(config) {\n super();\n this.config = config;\n this.pattern = new RegExp(`[^${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]+`, 'gu');\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.match(this.pattern) || [];\n }\n}\n\n\n/**\n * Splits text based on digits.\n * @extends PreTokenizer\n */\nclass DigitsPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {boolean} config.individual_digits Whether to split on individual digits.\n */\n constructor(config) {\n super();\n this.config = config;\n\n // Construct a pattern which matches the rust implementation:\n const digit_pattern = `[^\\\\d]+|\\\\d${this.config.individual_digits ? '' : '+'}`;\n this.pattern = new RegExp(digit_pattern, 'gu');\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.match(this.pattern) || [];\n }\n}\n\n/**\n * @typedef {Object} PostProcessedOutput\n * @property {string[]} tokens List of token produced by the post-processor.\n * @property {number[]} [token_type_ids] List of token type ids produced by the post-processor.\n */\n\n\n/**\n * @typedef {Object} EncodingSingle\n * @property {number[]} input_ids List of token ids to be fed to a model.\n * @property {number[]} attention_mask List of token type ids to be fed to a model\n * @property {number[]} [token_type_ids] List of indices specifying which tokens should be attended to by the model\n */\n\n\n/**\n * @extends Callable\n */\nclass PostProcessor extends Callable {\n\n /**\n * @param {Object} config The configuration for the post-processor.\n */\n constructor(config) {\n super();\n this.config = config;\n }\n\n /**\n * Factory method to create a PostProcessor object from a configuration object.\n *\n * @param {Object} config Configuration object representing a PostProcessor.\n * @returns {PostProcessor} A PostProcessor object created from the given configuration.\n * @throws {Error} If an unknown PostProcessor type is encountered.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'TemplateProcessing':\n return new TemplateProcessing(config);\n\n case 'ByteLevel':\n return new ByteLevelPostProcessor(config);\n\n case 'RobertaProcessing':\n return new RobertaProcessing(config);\n case 'BertProcessing':\n return new BertProcessing(config);\n\n default:\n throw new Error(`Unknown PostProcessor type: ${config.type}`);\n }\n }\n\n /**\n * Method to be implemented in subclass to apply post-processing on the given tokens.\n *\n * @param {Array} tokens The input tokens to be post-processed.\n * @param {...*} args Additional arguments required by the post-processing logic.\n * @returns {PostProcessedOutput} The post-processed tokens.\n * @throws {Error} If the method is not implemented in subclass.\n */\n post_process(tokens, ...args) {\n throw Error(\"post_process should be implemented in subclass.\")\n }\n\n /**\n * Alias for {@link PostProcessor#post_process}.\n * @param {Array} tokens The text or array of texts to post-process.\n * @param {...*} args Additional arguments required by the post-processing logic.\n * @returns {PostProcessedOutput} The post-processed tokens.\n */\n _call(tokens, ...args) {\n return this.post_process(tokens, ...args);\n }\n}\n\n/**\n * A post-processor that adds special tokens to the beginning and end of the input.\n */\nclass BertProcessing extends PostProcessor {\n /**\n * @param {Object} config The configuration for the post-processor.\n * @param {string[]} config.cls The special tokens to add to the beginning of the input.\n * @param {string[]} config.sep The special tokens to add to the end of the input.\n */\n constructor(config) {\n super(config);\n // TODO use all of config: add_prefix_space, trim_offsets\n\n this.cls = config.cls[0];\n this.sep = config.sep[0];\n }\n\n /**\n * Adds the special tokens to the beginning and end of the input.\n * @param {string[]} tokens The input tokens.\n * @param {string[]} [tokens_pair=null] An optional second set of input tokens.\n * @returns {PostProcessedOutput} The post-processed tokens with the special tokens added to the beginning and end.\n */\n post_process(tokens, tokens_pair = null, {\n add_special_tokens = true,\n } = {}) {\n if (add_special_tokens) {\n tokens = mergeArrays([this.cls], tokens, [this.sep]);\n }\n\n let token_type_ids = new Array(tokens.length).fill(0);\n if (tokens_pair !== null) {\n // NOTE: It is intended to add 2 EOS tokens after the first set of tokens\n // https://github.com/huggingface/tokenizers/issues/983\n const middle = (add_special_tokens && this instanceof RobertaProcessing)\n ? [this.sep]\n : [];\n const after = add_special_tokens ? [this.sep] : [];\n\n tokens = mergeArrays(tokens, middle, tokens_pair, after);\n token_type_ids = mergeArrays(token_type_ids, new Array(tokens_pair.length + middle.length + after.length).fill(1));\n }\n return { tokens, token_type_ids };\n }\n}\nclass RobertaProcessing extends BertProcessing { } // NOTE: extends BertProcessing\n\n/**\n * Post processor that replaces special tokens in a template with actual tokens.\n * @extends PostProcessor\n */\nclass TemplateProcessing extends PostProcessor {\n /**\n * Creates a new instance of `TemplateProcessing`.\n * @param {Object} config The configuration options for the post processor.\n * @param {Array} config.single The template for a single sequence of tokens.\n * @param {Array} config.pair The template for a pair of sequences of tokens.\n */\n constructor(config) {\n super(config);\n\n this.single = config.single;\n this.pair = config.pair;\n }\n\n /**\n * Replaces special tokens in the template with actual tokens.\n * @param {string[]} tokens The list of tokens for the first sequence.\n * @param {string[]} [tokens_pair=null] The list of tokens for the second sequence (optional).\n * @returns {PostProcessedOutput} An object containing the list of tokens with the special tokens replaced with actual tokens.\n */\n post_process(tokens, tokens_pair = null, {\n add_special_tokens = true,\n } = {}) {\n const type = tokens_pair === null ? this.single : this.pair\n\n let processedTokens = [];\n let types = [];\n for (const item of type) {\n if ('SpecialToken' in item) {\n if (add_special_tokens) {\n processedTokens.push(item.SpecialToken.id);\n types.push(item.SpecialToken.type_id);\n }\n } else if ('Sequence' in item) {\n if (item.Sequence.id === 'A') {\n processedTokens = mergeArrays(processedTokens, tokens);\n types = mergeArrays(types, new Array(tokens.length).fill(item.Sequence.type_id));\n\n } else if (item.Sequence.id === 'B') {\n processedTokens = mergeArrays(processedTokens, tokens_pair);\n types = mergeArrays(types, new Array(tokens_pair.length).fill(item.Sequence.type_id));\n }\n }\n }\n return { tokens: processedTokens, token_type_ids: types };\n }\n}\n\n/**\n * A PostProcessor that returns the given tokens as is.\n * @extends PostProcessor\n */\nclass ByteLevelPostProcessor extends PostProcessor {\n /**\n * Post process the given tokens.\n * @param {string[]} tokens The list of tokens for the first sequence.\n * @param {string[]} [tokens_pair=null] The list of tokens for the second sequence (optional).\n * @returns {PostProcessedOutput} An object containing the post-processed tokens.\n */\n post_process(tokens, tokens_pair = null) {\n if (tokens_pair) {\n tokens = mergeArrays(tokens, tokens_pair);\n }\n return { tokens };\n }\n}\n\n/**\n * The base class for token decoders.\n * @extends Callable\n */\nclass Decoder extends Callable {\n\n /**\n * Creates an instance of `Decoder`.\n *\n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /** @type {AddedToken[]} */\n this.added_tokens = [];\n this.end_of_word_suffix = null;\n this.trim_offsets = config.trim_offsets;\n }\n\n /**\n * Creates a decoder instance based on the provided configuration.\n *\n * @param {Object} config The configuration object.\n * @returns {Decoder} A decoder instance.\n * @throws {Error} If an unknown decoder type is provided.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'WordPiece':\n return new WordPieceDecoder(config);\n case 'Metaspace':\n return new MetaspaceDecoder(config);\n case 'ByteLevel':\n return new ByteLevelDecoder(config);\n\n case 'Replace':\n return new ReplaceDecoder(config);\n case 'ByteFallback':\n return new ByteFallback(config);\n case 'Fuse':\n return new FuseDecoder(config);\n case 'Strip':\n return new StripDecoder(config);\n\n case 'Sequence':\n return new DecoderSequence(config);\n\n case 'CTC':\n return new CTCDecoder(config);\n case 'BPEDecoder':\n return new BPEDecoder(config);\n default:\n throw new Error(`Unknown Decoder type: ${config.type}`);\n }\n }\n\n /**\n * Calls the `decode` method.\n *\n * @param {string[]} tokens The list of tokens.\n * @returns {string} The decoded string.\n */\n _call(tokens) {\n return this.decode(tokens);\n }\n\n /**\n * Decodes a list of tokens.\n * @param {string[]} tokens The list of tokens.\n * @returns {string} The decoded string.\n */\n decode(tokens) {\n return this.decode_chain(tokens).join('');\n }\n\n /**\n * Apply the decoder to a list of tokens.\n * \n * @param {string[]} tokens The list of tokens.\n * @returns {string[]} The decoded list of tokens.\n * @throws {Error} If the `decode_chain` method is not implemented in the subclass.\n */\n decode_chain(tokens) {\n throw Error(\"`decode_chain` should be implemented in subclass.\")\n }\n\n}\n\nclass ReplaceDecoder extends Decoder {\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n const pattern = createPattern(this.config.pattern);\n return pattern === null\n ? tokens\n : tokens.map(token => token.replaceAll(pattern, this.config.content))\n }\n}\n\n\nclass ByteFallback extends Decoder {\n constructor(config) {\n super(config);\n\n this.text_decoder = new TextDecoder();\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n\n const new_tokens = [];\n let previous_byte_tokens = [];\n\n for (const token of tokens) {\n let bytes = null;\n if (token.length === 6 && token.startsWith('<0x') && token.endsWith('>')) {\n const byte = parseInt(token.slice(3, 5), 16);\n if (!isNaN(byte)) {\n bytes = byte;\n }\n }\n if (bytes !== null) {\n previous_byte_tokens.push(bytes);\n } else {\n if (previous_byte_tokens.length > 0) {\n const string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens));\n new_tokens.push(string);\n previous_byte_tokens = [];\n }\n new_tokens.push(token);\n }\n }\n if (previous_byte_tokens.length > 0) {\n const string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens));\n new_tokens.push(string);\n previous_byte_tokens = [];\n }\n\n return new_tokens;\n }\n}\n\n/**\n * Fuse simply fuses all tokens into one big string.\n * It's usually the last decoding step anyway, but this decoder\n * exists incase some decoders need to happen after that step\n */\nclass FuseDecoder extends Decoder {\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return [tokens.join('')];\n }\n}\n\n\nclass StripDecoder extends Decoder {\n constructor(config) {\n super(config);\n\n this.content = this.config.content;\n this.start = this.config.start;\n this.stop = this.config.stop;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map(token => {\n let start_cut = 0;\n for (let i = 0; i < this.start; ++i) {\n if (token[i] === this.content) {\n start_cut = i + 1;\n continue;\n } else {\n break;\n }\n }\n\n let stop_cut = token.length;\n for (let i = 0; i < this.stop; ++i) {\n const index = token.length - i - 1;\n if (token[index] === this.content) {\n stop_cut = index;\n continue;\n } else {\n break;\n }\n }\n\n return token.slice(start_cut, stop_cut)\n });\n }\n}\n\n/**\n * A decoder that decodes a list of WordPiece tokens into a single string.\n * @extends Decoder\n */\nclass WordPieceDecoder extends Decoder {\n\n /**\n * Creates a new instance of WordPieceDecoder.\n * @param {Object} config The configuration object.\n * @param {string} config.prefix The prefix used for WordPiece encoding.\n * @param {boolean} config.cleanup Whether to cleanup the decoded string.\n */\n constructor(config) {\n super(config);\n this.cleanup = config.cleanup;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map((token, i) => {\n if (i !== 0) {\n if (token.startsWith(this.config.prefix)) {\n // NOTE: .replace() is intended; only replace first occurrence\n token = token.replace(this.config.prefix, '');\n } else {\n token = ' ' + token;\n }\n }\n if (this.cleanup) {\n token = clean_up_tokenization(token)\n }\n\n return token;\n });\n }\n}\n\n/**\n * Byte-level decoder for tokenization output. Inherits from the `Decoder` class.\n * @extends Decoder\n */\nclass ByteLevelDecoder extends Decoder {\n\n /**\n * Create a `ByteLevelDecoder` object.\n * @param {Object} config Configuration object.\n */\n constructor(config) {\n super(config);\n\n this.byte_decoder = UNICODE_TO_BYTES;\n this.text_decoder = new TextDecoder(\"utf-8\", {\n fatal: false,\n ignoreBOM: true,\n });\n\n this.end_of_word_suffix = null;\n }\n\n /**\n * Convert an array of tokens to string by decoding each byte.\n * @param {string[]} tokens Array of tokens to be decoded.\n * @returns {string} The decoded string.\n */\n convert_tokens_to_string(tokens) {\n const text = tokens.join('');\n const byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c]));\n const decoded_text = this.text_decoder.decode(byteArray);\n return decoded_text;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n // TODO move to base class (like HF)\n // tokens === filtered_tokens\n\n // To avoid mixing byte-level and unicode for byte-level BPT\n // we need to build string separately for added tokens and byte-level tokens\n // cf. https://github.com/huggingface/transformers/issues/1133\n const sub_texts = [];\n let current_sub_text = [];\n for (const token of tokens) {\n // tokens sent here are already filtered, so we don't need to do this\n // if (skip_special_tokens && this.all_special_ids.includes(token)) {\n // continue;\n // }\n\n if (this.added_tokens.find(x => x.content === token) !== undefined) {\n if (current_sub_text.length > 0) {\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\n current_sub_text = [];\n }\n sub_texts.push(token);\n } else {\n current_sub_text.push(token);\n }\n }\n if (current_sub_text.length > 0) {\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\n }\n\n // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options\n\n return sub_texts;\n }\n}\n\n/**\n * The CTC (Connectionist Temporal Classification) decoder.\n * See https://github.com/huggingface/tokenizers/blob/bb38f390a61883fc2f29d659af696f428d1cda6b/tokenizers/src/decoders/ctc.rs\n */\nclass CTCDecoder extends Decoder {\n\n constructor(config) {\n super(config);\n\n this.pad_token = this.config.pad_token;\n this.word_delimiter_token = this.config.word_delimiter_token;\n this.cleanup = this.config.cleanup;\n }\n /**\n * Converts a connectionist-temporal-classification (CTC) output tokens into a single string.\n * @param {string[]} tokens Array of tokens to be decoded.\n * @returns {string} The decoded string.\n */\n convert_tokens_to_string(tokens) {\n if (tokens.length === 0) return '';\n\n // group same tokens into non-repeating tokens in CTC style decoding\n const grouped_tokens = [tokens[0]];\n for (let i = 1; i < tokens.length; ++i) {\n if (tokens[i] !== grouped_tokens.at(-1)) {\n grouped_tokens.push(tokens[i]);\n }\n }\n\n // filter self.pad_token which is used as CTC-blank token\n const filtered_tokens = grouped_tokens.filter(token => token !== this.pad_token);\n\n let text = filtered_tokens.join('');\n if (this.cleanup) {\n // cleanup and replace delimiter token\n text = clean_up_tokenization(text)\n .replaceAll(this.word_delimiter_token, ' ')\n .trim();\n }\n return text;\n }\n\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return [this.convert_tokens_to_string(tokens)];\n }\n}\n\n/**\n * Apply a sequence of decoders.\n * @extends Decoder\n */\nclass DecoderSequence extends Decoder {\n\n /**\n * Creates a new instance of DecoderSequence.\n * @param {Object} config The configuration object.\n * @param {Decoder[]} config.decoders The list of decoders to apply.\n */\n constructor(config) {\n super(config);\n this.decoders = config.decoders.map(x => Decoder.fromConfig(x));\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n // Use reduce to apply each decoder to the tokens\n return this.decoders.reduce((toks, decoder) => {\n return decoder.decode_chain(toks);\n }, tokens);\n }\n\n}\n\nclass BPEDecoder extends Decoder {\n constructor(config) {\n super(config);\n\n this.suffix = this.config.suffix;\n }\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map((token, i) => {\n return token.replaceAll(this.suffix, (i === tokens.length - 1) ? '' : ' ')\n });\n }\n}\n\n// Custom decoder for VITS\nclass VitsDecoder extends Decoder {\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n let decoded = '';\n for (let i = 1; i < tokens.length; i += 2) {\n decoded += tokens[i];\n }\n return [decoded];\n }\n}\n\n\n/**\n * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested,\n * and returns a list of tokens.\n * @extends PreTokenizer\n */\nclass MetaspacePreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration object for the MetaspacePreTokenizer.\n * @param {boolean} config.add_prefix_space Whether to add a prefix space to the first token.\n * @param {string} config.replacement The character to replace spaces with.\n * @param {string} [config.str_rep=config.replacement] An optional string representation of the replacement character.\n * @param {'first'|'never'|'always'} [config.prepend_scheme='always'] The metaspace prepending scheme.\n */\n constructor(config) {\n super();\n\n this.addPrefixSpace = config.add_prefix_space;\n this.replacement = config.replacement;\n this.strRep = config.str_rep || this.replacement;\n this.prepend_scheme = config.prepend_scheme ?? 'always';\n }\n\n /**\n * This method takes a string, replaces spaces with the replacement character,\n * adds a prefix space if requested, and returns a new list of tokens.\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] The options for the pre-tokenization.\n * @param {number} [options.section_index] The index of the section to pre-tokenize.\n * @returns {string[]} A new list of pre-tokenized tokens.\n */\n pre_tokenize_text(text, {\n section_index = undefined,\n } = {}) {\n\n let normalized = text.replaceAll(' ', this.strRep);\n\n if (\n // We add a prefix space if:\n // (1) The addPrefixSpace option is enabled and the normalized\n // token does not already start with the replacement character.\n (this.addPrefixSpace && !normalized.startsWith(this.replacement))\n\n // and (2) either:\n // (a) prepend_scheme is 'always'\n // (b) prepend_scheme is 'first' and this is the first section\n && (\n this.prepend_scheme === 'always' ||\n (this.prepend_scheme === 'first' && section_index === 0)\n )\n ) {\n normalized = this.strRep + normalized;\n }\n return [normalized];\n }\n}\n\n/**\n * MetaspaceDecoder class extends the Decoder class and decodes Metaspace tokenization.\n * @extends Decoder\n */\nclass MetaspaceDecoder extends Decoder {\n /**\n * Constructs a new MetaspaceDecoder object.\n * @param {Object} config The configuration object for the MetaspaceDecoder.\n * @param {boolean} config.add_prefix_space Whether to add a prefix space to the decoded string.\n * @param {string} config.replacement The string to replace spaces with.\n */\n constructor(config) {\n super(config);\n\n this.addPrefixSpace = config.add_prefix_space;\n this.replacement = config.replacement;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n const result = [];\n for (let i = 0; i < tokens.length; ++i) {\n let normalized = tokens[i].replaceAll(this.replacement, ' ');\n if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) {\n normalized = normalized.substring(1);\n }\n result.push(normalized);\n }\n return result;\n }\n}\n\n/**\n * A normalizer that applies a precompiled charsmap.\n * This is useful for applying complex normalizations in C++ and exposing them to JavaScript.\n * @extends Normalizer\n * @param {Object} config The configuration object for the Precompiled normalizer.\n * @param {Object} config.precompiled_charsmap The precompiled charsmap object.\n */\nclass Precompiled extends Normalizer {\n /**\n * Create a new instance of Precompiled normalizer.\n * @param {Object} config The configuration object.\n * @param {any} config.precompiled_charsmap Precompiled chars mapping.\n */\n constructor(config) {\n super(config);\n this.charsmap = config.precompiled_charsmap;\n }\n\n /**\n * Normalizes the given text by applying the precompiled charsmap.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n // As stated in the sentencepiece normalization docs (https://github.com/google/sentencepiece/blob/master/doc/normalization.md#use-pre-defined-normalization-rule),\n // there are 5 pre-defined normalization rules:\n // 1. nmt_nfkc: NFKC normalization with some additional normalization around spaces. (default)\n // 2. nfkc: original NFKC normalization.\n // 3. nmt_nfkc_cf: nmt_nfkc + Unicode case folding (mostly lower casing)\n // 4. nfkc_cf: nfkc + Unicode case folding.\n // 5. identity: no normalization\n // \n // For now, we only implement the default (nmt_nfkc).\n // See https://raw.githubusercontent.com/google/sentencepiece/master/data/nmt_nfkc.tsv for the full list of rules.\n // TODO: detect when a different `this.charsmap` is used.\n\n text = text.replace(/[\\u0001-\\u0008\\u000B\\u000E-\\u001F\\u007F\\u008F\\u009F]/gm, ''); // Remove control characters\n text = text.replace(/[\\u0009\\u000A\\u000C\\u000D\\u1680\\u200B\\u200C\\u200E\\u200F\\u2028\\u2029\\u2581\\uFEFF\\uFFFD]/gm, '\\u0020'); // Replace certain characters with a space\n\n if (text.includes('\\uFF5E')) {\n // To match the sentencepiece implementation 100%, we must handle a very strange edge-case.\n // For some reason, the \"Fullwidth Tilde\" character (\\uFF5E) should not be converted to the standard Tilde character (\\u007E).\n // However, NFKC normalization does do this conversion. As a result, we split the string on the Fullwidth Tilde character,\n // perform NFKC normalization on each substring, and then join them back together with the Fullwidth Tilde character.\n const parts = text.split('\\uFF5E');\n text = parts.map(part => part.normalize('NFKC')).join('\\uFF5E');\n } else {\n text = text.normalize('NFKC');\n }\n\n return text;\n }\n}\n\n/**\n * A pre-tokenizer that applies a sequence of pre-tokenizers to the input text.\n * @extends PreTokenizer\n */\nclass PreTokenizerSequence extends PreTokenizer {\n /**\n * Creates an instance of PreTokenizerSequence.\n * @param {Object} config The configuration object for the pre-tokenizer sequence.\n * @param {Object[]} config.pretokenizers An array of pre-tokenizer configurations.\n */\n constructor(config) {\n super();\n this.tokenizers = config.pretokenizers.map(x => PreTokenizer.fromConfig(x));\n }\n\n /**\n * Applies each pre-tokenizer in the sequence to the input text in turn.\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} The pre-tokenized text.\n */\n pre_tokenize_text(text, options) {\n // Use reduce to apply each tokenizer to the text\n return this.tokenizers.reduce((preTokenizedText, tokenizer) => {\n return tokenizer.pre_tokenize(preTokenizedText, options);\n }, [text]);\n }\n}\n\n/**\n * Splits on word boundaries (using the following regular expression: `\\w+|[^\\w\\s]+`).\n */\nclass WhitespacePreTokenizer extends PreTokenizer {\n /**\n * Creates an instance of WhitespacePreTokenizer.\n * @param {Object} config The configuration object for the pre-tokenizer.\n */\n constructor(config) {\n super();\n }\n /**\n * Pre-tokenizes the input text by splitting it on word boundaries.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\n */\n pre_tokenize_text(text, options) {\n return text.match(/\\w+|[^\\w\\s]+/g) || [];\n }\n}\n\n/**\n * Splits a string of text by whitespace characters into individual tokens.\n * @extends PreTokenizer\n */\nclass WhitespaceSplit extends PreTokenizer {\n /**\n * Creates an instance of WhitespaceSplit.\n * @param {Object} config The configuration object for the pre-tokenizer.\n */\n constructor(config) {\n super();\n }\n /**\n * Pre-tokenizes the input text by splitting it on whitespace characters.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\n */\n pre_tokenize_text(text, options) {\n return whitespace_split(text);\n }\n}\n\n// NOTE: `ReplacePreTokenizer` is custom (to support `BlenderbotSmallTokenizer`)\nclass ReplacePreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object.\n * @param {string} config.content What to replace the pattern with.\n */\n constructor(config) {\n super();\n this.config = config;\n this.pattern = createPattern(this.config.pattern);\n this.content = this.config.content;\n }\n\n /**\n * Pre-tokenizes the input text by replacing certain characters.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by replacing certain characters.\n */\n pre_tokenize_text(text, options) {\n if (this.pattern === null) {\n return [text];\n }\n return [text.replaceAll(this.pattern, this.config.content)];\n }\n}\n\nconst SPECIAL_TOKEN_ATTRIBUTES = [\n 'bos_token',\n 'eos_token',\n 'unk_token',\n 'sep_token',\n 'pad_token',\n 'cls_token',\n 'mask_token',\n // additional_special_tokens (TODO)\n]\n\n/**\n * \n * Helper function for padding values of an object, which are each arrays.\n * NOTE: No additional checks are made here for validity of arguments.\n * @param {Record} item The input object.\n * @param {number} length The length to pad to.\n * @param {(key: string) => any} value_fn Determine the value to fill the array, based on its key.\n * @param {string} side Which side to pad the array.\n * @private\n */\nfunction padHelper(item, length, value_fn, side) {\n for (const key of Object.keys(item)) {\n const diff = length - item[key].length;\n const value = value_fn(key);\n\n const padData = new Array(diff).fill(value);\n item[key] = side === 'right'\n ? mergeArrays(item[key], padData)\n : mergeArrays(padData, item[key]);\n }\n}\n\n/**\n * Helper function for truncating values of an object, which are each arrays.\n * NOTE: No additional checks are made here for validity of arguments.\n * @param {Record} item The input object.\n * @param {number} length The length to truncate to.\n * @private\n */\nfunction truncateHelper(item, length) {\n // Setting .length to a lower value truncates the array in-place:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length\n for (const key of Object.keys(item)) {\n item[key].length = length;\n }\n}\n\n\n/**\n * @typedef {Object} Message\n * @property {string} role The role of the message (e.g., \"user\" or \"assistant\" or \"system\").\n * @property {string} content The content of the message.\n */\n\nexport class PreTrainedTokenizer extends Callable {\n return_token_type_ids = false;\n\n _default_chat_template = `{% for message in messages %}{{'<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\\n' }}{% endif %}`;\n\n padding_side = 'right';\n /**\n * Create a new PreTrainedTokenizer instance.\n * @param {Object} tokenizerJSON The JSON of the tokenizer.\n * @param {Object} tokenizerConfig The config of the tokenizer.\n */\n constructor(tokenizerJSON, tokenizerConfig) {\n super();\n\n this._tokenizer_config = tokenizerConfig;\n\n // Construct parts of the tokenizer from the JSON\n this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer);\n this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer);\n this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig);\n this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor);\n this.decoder = Decoder.fromConfig(tokenizerJSON.decoder);\n\n // Add added_tokens to model\n this.special_tokens = [];\n this.all_special_ids = [];\n\n /** @type {AddedToken[]} */\n this.added_tokens = [];\n for (const addedToken of tokenizerJSON.added_tokens) {\n const token = new AddedToken(addedToken);\n this.added_tokens.push(token);\n\n this.model.tokens_to_ids.set(token.content, token.id);\n this.model.vocab[token.id] = token.content;\n\n if (token.special) {\n this.special_tokens.push(token.content);\n this.all_special_ids.push(token.id);\n }\n }\n\n // Update additional_special_tokens\n this.additional_special_tokens = tokenizerConfig.additional_special_tokens ?? [];\n this.special_tokens.push(...this.additional_special_tokens);\n this.special_tokens = [...new Set(this.special_tokens)]; // Remove duplicates\n\n if (this.decoder) {\n // Slight hack, but it prevents code duplication:\n this.decoder.added_tokens = this.added_tokens;\n\n // Another slight hack to add `end_of_word_suffix` (if present) to the decoder\n // This is needed for cases where BPE model and ByteLevel decoder are used\n // For more information, see https://github.com/xenova/transformers.js/issues/74\n // TODO: save this to the decoder when exporting?\n this.decoder.end_of_word_suffix = this.model.end_of_word_suffix;\n }\n\n\n this.added_tokens_regex = this.added_tokens.length > 0 ? new RegExp(\n this.added_tokens.map(x => `${x.lstrip ? '\\\\s*' : ''}(${escapeRegExp(x.content)})${x.rstrip ? '\\\\s*' : ''}`).join('|')\n ) : null;\n\n // Set mask token if present (otherwise will be undefined, which is fine)\n this.mask_token = this.getToken('mask_token');\n this.mask_token_id = this.model.tokens_to_ids.get(this.mask_token);\n\n this.pad_token = this.getToken('pad_token', 'eos_token');\n this.pad_token_id = this.model.tokens_to_ids.get(this.pad_token);\n\n this.sep_token = this.getToken('sep_token');\n this.sep_token_id = this.model.tokens_to_ids.get(this.sep_token);\n\n this.unk_token = this.getToken('unk_token');\n this.unk_token_id = this.model.tokens_to_ids.get(this.unk_token);\n\n this.model_max_length = tokenizerConfig.model_max_length;\n\n /** @type {boolean} Whether or not to strip the text when tokenizing (removing excess spaces before and after the string). */\n this.remove_space = tokenizerConfig.remove_space;\n\n this.clean_up_tokenization_spaces = tokenizerConfig.clean_up_tokenization_spaces ?? true;\n this.do_lowercase_and_remove_accent = tokenizerConfig.do_lowercase_and_remove_accent ?? false;\n\n if (tokenizerConfig.padding_side) {\n this.padding_side = tokenizerConfig.padding_side;\n }\n\n this.legacy = false;\n\n this.chat_template = tokenizerConfig.chat_template ?? null;\n if (Array.isArray(this.chat_template)) {\n // Chat templates are stored as lists of dicts with fixed key names,\n // we reconstruct that into a single dict while loading them.\n const chat_template = Object.create(null);\n for (const { name, template } of this.chat_template) {\n if (typeof name !== 'string' || typeof template !== 'string') {\n throw new Error('Chat template must be a list of objects with \"name\" and \"template\" properties');\n }\n chat_template[name] = template;\n }\n this.chat_template = chat_template;\n }\n this._compiled_template_cache = new Map();\n }\n\n /**\n * Returns the value of the first matching key in the tokenizer config object.\n * @param {...string} keys One or more keys to search for in the tokenizer config object.\n * @returns {string|null} The value associated with the first matching key, or null if no match is found.\n * @throws {Error} If an object is found for a matching key and its __type property is not \"AddedToken\".\n * @private\n */\n getToken(...keys) {\n for (const key of keys) {\n const item = this._tokenizer_config[key];\n\n if (!item) continue;\n\n if (typeof item === 'object') {\n if (item.__type === 'AddedToken') {\n return item.content;\n } else {\n throw Error(`Unknown token: ${item}`);\n }\n } else {\n return item;\n }\n }\n return null;\n }\n\n /**\n * Loads a pre-trained tokenizer from the given `pretrained_model_name_or_path`. \n * \n * @param {string} pretrained_model_name_or_path The path to the pre-trained tokenizer.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * \n * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the `pretrained_model_name_or_path`.\n * @returns {Promise} A new instance of the `PreTrainedTokenizer` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n legacy = null,\n } = {}) {\n\n const info = await loadTokenizer(pretrained_model_name_or_path, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n legacy,\n })\n\n // @ts-ignore\n return new this(...info);\n }\n\n /**\n * @typedef {number[]|number[][]|Tensor} BatchEncodingItem\n * \n * @typedef {Object} BatchEncoding Holds the output of the tokenizer's call function.\n * @property {BatchEncodingItem} input_ids List of token ids to be fed to a model.\n * @property {BatchEncodingItem} attention_mask List of indices specifying which tokens should be attended to by the model.\n * @property {BatchEncodingItem} [token_type_ids] List of token type ids to be fed to a model.\n */\n\n /**\n * Encode/tokenize the given text(s).\n * @param {string|string[]} text The text to tokenize.\n * @param {Object} options An optional object containing the following properties:\n * @param {string|string[]} [options.text_pair=null] Optional second sequence to be encoded. If set, must be the same type as text.\n * @param {boolean|'max_length'} [options.padding=false] Whether to pad the input sequences.\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @param {boolean} [options.truncation=null] Whether to truncate the input sequences.\n * @param {number} [options.max_length=null] Maximum length of the returned list and optionally padding length.\n * @param {boolean} [options.return_tensor=true] Whether to return the results as Tensors or arrays.\n * @returns {BatchEncoding} Object to be passed to the model.\n */\n _call(\n // Required positional arguments\n text,\n\n // Optional keyword arguments\n {\n text_pair = null,\n add_special_tokens = true,\n padding = false,\n truncation = null,\n max_length = null,\n return_tensor = true, // Different to HF\n } = {},\n ) {\n\n const isBatched = Array.isArray(text);\n\n /** @type {EncodingSingle[]} */\n let encodedTokens;\n\n if (isBatched) {\n if (text.length === 0) {\n throw Error('text array must be non-empty')\n }\n\n if (text_pair !== null) {\n if (!Array.isArray(text_pair)) {\n throw Error('text_pair must also be an array')\n\n } else if (text.length !== text_pair.length) {\n throw Error('text and text_pair must have the same length')\n }\n\n encodedTokens = text.map(\n (t, i) => this._encode_plus(t, { text_pair: text_pair[i], add_special_tokens })\n )\n\n } else {\n encodedTokens = text.map(x => this._encode_plus(x, { add_special_tokens }));\n }\n\n } else {\n if (text === null || text === undefined) {\n throw Error('text may not be null or undefined')\n }\n\n if (Array.isArray(text_pair)) {\n throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).')\n }\n\n // For single input, we just wrap in an array, and then unwrap later.\n encodedTokens = [this._encode_plus(text, { text_pair, add_special_tokens })];\n }\n // At this point, tokens is batched: [batch_size, tokens]\n // However, array may be jagged. So, we pad to max_length\n\n if (max_length === null) {\n if (padding === 'max_length') {\n max_length = this.model_max_length;\n } else {\n // Calculate max length from sequences\n max_length = max(encodedTokens.map(x => x.input_ids.length))[0];\n }\n } else {\n if (!truncation) {\n console.warn(`Truncation was not explicitly activated but \\`max_length\\` is provided a specific value, please use \\`truncation=true\\` to explicitly truncate examples to max length.`)\n }\n }\n\n // Ensure it is less than model max length\n max_length = Math.min(max_length, this.model_max_length)\n\n if (padding || truncation) {\n\n // Perform padding and/or truncation\n for (let i = 0; i < encodedTokens.length; ++i) {\n if (encodedTokens[i].input_ids.length === max_length) {\n continue;\n\n } else if (encodedTokens[i].input_ids.length > max_length) {\n // possibly truncate\n if (truncation) {\n truncateHelper(encodedTokens[i], max_length);\n }\n\n } else { // t.length < max_length\n // possibly pad\n if (padding) {\n padHelper(\n encodedTokens[i],\n max_length,\n key => key === 'input_ids' ? this.pad_token_id : 0,\n this.padding_side\n );\n }\n }\n }\n }\n\n const result = {};\n\n if (return_tensor) {\n if (!(padding && truncation)) {\n // Not, guaranteed that all items have same length, so\n // we perform additional check\n\n if (\n encodedTokens.some(x => {\n for (const key of Object.keys(x)) {\n if (x[key].length !== encodedTokens[0][key]?.length) {\n return true;\n }\n }\n return false;\n })\n ) {\n throw Error(\n \"Unable to create tensor, you should probably activate truncation and/or padding \" +\n \"with 'padding=true' and 'truncation=true' to have batched tensors with the same length.\"\n )\n }\n }\n\n // Now we actually convert to tensor\n // NOTE: In the same way as the python library, we return a batched tensor, regardless of\n // whether we have a single input or multiple inputs.\n const dims = [encodedTokens.length, encodedTokens[0].input_ids.length];\n\n for (const key of Object.keys(encodedTokens[0])) {\n result[key] = new Tensor('int64',\n BigInt64Array.from(encodedTokens.flatMap(x => x[key]).map(BigInt)),\n dims\n );\n }\n\n } else {\n for (const key of Object.keys(encodedTokens[0])) {\n result[key] = encodedTokens.map(x => x[key]);\n }\n\n // If not returning a tensor, we match the input type\n if (!isBatched) {\n // Input was not batched, so we unwrap\n for (const key of Object.keys(result)) {\n result[key] = result[key][0];\n }\n }\n }\n\n return /** @type {BatchEncoding} */(result);\n }\n\n /**\n * Encodes a single text using the preprocessor pipeline of the tokenizer.\n *\n * @param {string|null} text The text to encode.\n * @returns {string[]|null} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n // Actual function which does encoding, for a single text\n // First, we take care of special tokens. Needed to avoid issues arising from\n // normalization and/or pretokenization (which may not preserve special tokens)\n const sections = this.added_tokens_regex ? text.split(this.added_tokens_regex).filter(x => x) : [text];\n\n const tokens = sections.map((x, section_index) => {\n const addedToken = this.added_tokens.find(t => t.content === x);\n if (addedToken !== undefined) {\n // Ignore added tokens\n return x\n } else {\n if (this.remove_space === true) {\n x = x.trim().split(/\\s+/).join(' ');\n }\n if (this.do_lowercase_and_remove_accent) {\n x = lowercase_and_remove_accent(x);\n }\n\n if (this.normalizer !== null) {\n x = this.normalizer(x);\n }\n\n // If, after normalization, this section is empty (e.g., trimming whitespace),\n // we return an empty array\n if (x.length === 0) {\n return [];\n }\n\n const sectionTokens = (this.pre_tokenizer !== null) ? this.pre_tokenizer(x, {\n section_index,\n }) : [x];\n\n const tokens = this.model(sectionTokens);\n\n return tokens;\n }\n }).flat();\n\n return tokens;\n }\n\n /**\n * Encodes a single text or a pair of texts using the model's tokenizer.\n *\n * @param {string} text The text to encode.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.text_pair=null] The optional second text to encode.\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {EncodingSingle} An object containing the encoded text.\n * @private\n */\n _encode_plus(text, {\n text_pair = null,\n add_special_tokens = true,\n } = {}) {\n\n const { tokens, token_type_ids } = this._tokenize_helper(text, { pair: text_pair, add_special_tokens });\n\n const input_ids = this.model.convert_tokens_to_ids(tokens);\n\n const result = {\n input_ids,\n attention_mask: new Array(input_ids.length).fill(1),\n }\n if (this.return_token_type_ids && token_type_ids) {\n result.token_type_ids = token_type_ids;\n }\n return result;\n }\n\n /**\n * Internal helper function to tokenize a text, and optionally a pair of texts.\n * @param {string} text The text to tokenize.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.pair=null] The optional second text to tokenize.\n * @param {boolean} [options.add_special_tokens=false] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {{tokens: string[], token_type_ids?: number[]}} An object containing the tokens and optionally the token type IDs.\n */\n _tokenize_helper(text, {\n pair = null,\n add_special_tokens = false,\n } = {}) {\n const tokens = this._encode_text(text);\n const tokens2 = this._encode_text(pair);\n\n return this.post_processor\n ? this.post_processor(tokens, tokens2, { add_special_tokens })\n : { tokens: mergeArrays(tokens ?? [], tokens2 ?? []) };\n }\n\n /**\n * Converts a string into a sequence of tokens.\n * @param {string} text The sequence to be encoded.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.pair] A second sequence to be encoded with the first.\n * @param {boolean} [options.add_special_tokens=false] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {string[]} The list of tokens.\n */\n tokenize(text, {\n pair = null,\n add_special_tokens = false,\n } = {}) {\n return this._tokenize_helper(text, { pair, add_special_tokens }).tokens;\n }\n\n /**\n * Encodes a single text or a pair of texts using the model's tokenizer.\n *\n * @param {string} text The text to encode.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.text_pair=null] The optional second text to encode.\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {number[]} An array of token IDs representing the encoded text(s).\n */\n encode(text, {\n text_pair = null,\n add_special_tokens = true,\n } = {}) {\n return this._encode_plus(text, {\n text_pair,\n add_special_tokens,\n }).input_ids;\n }\n\n /**\n * Decode a batch of tokenized sequences.\n * @param {number[][]|Tensor} batch List/Tensor of tokenized input sequences.\n * @param {Object} decode_args (Optional) Object with decoding arguments.\n * @returns {string[]} List of decoded sequences.\n */\n batch_decode(batch, decode_args = {}) {\n if (batch instanceof Tensor) {\n batch = batch.tolist();\n }\n return batch.map(x => this.decode(x, decode_args));\n }\n\n /**\n * Decodes a sequence of token IDs back to a string.\n *\n * @param {number[]|Tensor} token_ids List/Tensor of token IDs to decode.\n * @param {Object} [decode_args={}]\n * @param {boolean} [decode_args.skip_special_tokens=false] If true, special tokens are removed from the output string.\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] If true, spaces before punctuations and abbreviated forms are removed.\n *\n * @returns {string} The decoded string.\n * @throws {Error} If `token_ids` is not a non-empty array of integers.\n */\n decode(\n token_ids,\n decode_args = {},\n ) {\n if (token_ids instanceof Tensor) {\n token_ids = prepareTensorForDecode(token_ids);\n }\n\n if (!Array.isArray(token_ids) || token_ids.length === 0 || !isIntegralNumber(token_ids[0])) {\n throw Error(\"token_ids must be a non-empty array of integers.\");\n }\n\n return this.decode_single(token_ids, decode_args)\n }\n\n /**\n * Decode a single list of token ids to a string.\n * @param {number[]} token_ids List of token ids to decode\n * @param {Object} decode_args Optional arguments for decoding\n * @param {boolean} [decode_args.skip_special_tokens=false] Whether to skip special tokens during decoding\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=null] Whether to clean up tokenization spaces during decoding.\n * If null, the value is set to `this.decoder.cleanup` if it exists, falling back to `this.clean_up_tokenization_spaces` if it exists, falling back to `true`.\n * @returns {string} The decoded string\n */\n decode_single(\n token_ids,\n {\n skip_special_tokens = false,\n clean_up_tokenization_spaces = null,\n }\n ) {\n let tokens = this.model.convert_ids_to_tokens(token_ids);\n if (skip_special_tokens) {\n tokens = tokens.filter(x => !this.special_tokens.includes(x));\n }\n\n // If `this.decoder` is null, we just join tokens with a space:\n // https://github.com/huggingface/tokenizers/blob/8edec536a737cb04494b454805be16c020abb14f/tokenizers/src/tokenizer/mod.rs#L835\n /** @type {string} */\n let decoded = this.decoder ? this.decoder(tokens) : tokens.join(' ');\n\n // Slight hack, but prevents having to pass `skip_special_tokens` to\n // each call to `decode`, which would lead to code duplication.\n if (this.decoder && this.decoder.end_of_word_suffix) {\n decoded = decoded.replaceAll(this.decoder.end_of_word_suffix, ' ');\n if (skip_special_tokens) {\n decoded = decoded.trim();\n }\n }\n\n if (clean_up_tokenization_spaces ?? this.clean_up_tokenization_spaces) {\n decoded = clean_up_tokenization(decoded);\n }\n\n return decoded;\n }\n\n get default_chat_template() {\n if (!this._warned_about_chat_template) {\n console.warn(\n \"No chat template is defined for this tokenizer - using a default chat template \" +\n \"that implements the ChatML format. If the default is not appropriate for \" +\n \"your model, please set `tokenizer.chat_template` to an appropriate template. \" +\n \"See https://huggingface.co/docs/transformers/main/chat_templating for more information.\"\n )\n this._warned_about_chat_template = true; // TODO move to logger.warning_once()\n }\n\n return this._default_chat_template;\n }\n\n /**\n * Converts a list of message objects with `\"role\"` and `\"content\"` keys to a list of token\n * ids. This method is intended for use with chat models, and will read the tokenizer's chat_template attribute to\n * determine the format and control tokens to use when converting. When chat_template is None, it will fall back\n * to the default_chat_template specified at the class level.\n * \n * See [here](https://huggingface.co/docs/transformers/chat_templating) for more information.\n * \n * **Example:** Applying a chat template to a conversation.\n * \n * ```javascript\n * import { AutoTokenizer } from \"@xenova/transformers\";\n * \n * const tokenizer = await AutoTokenizer.from_pretrained(\"mistralai/Mistral-7B-Instruct-v0.1\");\n * \n * const chat = [\n * { \"role\": \"user\", \"content\": \"Hello, how are you?\" },\n * { \"role\": \"assistant\", \"content\": \"I'm doing great. How can I help you today?\" },\n * { \"role\": \"user\", \"content\": \"I'd like to show off how chat templating works!\" },\n * ]\n * \n * const text = tokenizer.apply_chat_template(chat, { tokenize: false });\n * // \"[INST] Hello, how are you? [/INST]I'm doing great. How can I help you today? [INST] I'd like to show off how chat templating works! [/INST]\"\n * \n * const input_ids = tokenizer.apply_chat_template(chat, { tokenize: true, return_tensor: false });\n * // [1, 733, 16289, 28793, 22557, 28725, 910, 460, 368, 28804, 733, 28748, 16289, 28793, 28737, 28742, 28719, 2548, 1598, 28723, 1602, 541, 315, 1316, 368, 3154, 28804, 2, 28705, 733, 16289, 28793, 315, 28742, 28715, 737, 298, 1347, 805, 910, 10706, 5752, 1077, 3791, 28808, 733, 28748, 16289, 28793]\n * ```\n * \n * @param {Message[]} conversation A list of message objects with `\"role\"` and `\"content\"` keys.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.chat_template=null] A Jinja template to use for this conversion. If\n * this is not passed, the model's default chat template will be used instead.\n * @param {boolean} [options.add_generation_prompt=false] Whether to end the prompt with the token(s) that indicate\n * the start of an assistant message. This is useful when you want to generate a response from the model.\n * Note that this argument will be passed to the chat template, and so it must be supported in the\n * template for this argument to have any effect.\n * @param {boolean} [options.tokenize=true] Whether to tokenize the output. If false, the output will be a string.\n * @param {boolean} [options.padding=false] Whether to pad sequences to the maximum length. Has no effect if tokenize is false.\n * @param {boolean} [options.truncation=false] Whether to truncate sequences to the maximum length. Has no effect if tokenize is false.\n * @param {number} [options.max_length=null] Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is false.\n * If not specified, the tokenizer's `max_length` attribute will be used as a default.\n * @param {boolean} [options.return_tensor=true] Whether to return the output as a Tensor or an Array. Has no effect if tokenize is false.\n * @param {Object} [options.tokenizer_kwargs={}] Additional options to pass to the tokenizer.\n * @returns {string | Tensor | number[]| number[][]} The tokenized output.\n */\n apply_chat_template(conversation, {\n chat_template = null,\n add_generation_prompt = false,\n tokenize = true,\n padding = false,\n truncation = false,\n max_length = null,\n return_tensor = true,\n tokenizer_kwargs = {},\n ...kwargs\n } = {}) {\n\n // First, handle the cases when the model has a dict of multiple templates\n if (\n (this.chat_template && typeof this.chat_template === 'object') ||\n (this.chat_template === null && this.default_chat_template && typeof this.default_chat_template === 'object')\n ) {\n const template_dict = this.chat_template ?? this.default_chat_template; // Guaranteed to be a non-null object\n\n if (chat_template !== null && Object.hasOwn(template_dict, chat_template)) {\n // The user can pass the name of a template to the chat template argument instead of an entire template\n chat_template = template_dict[chat_template];\n } else if (chat_template === null && 'default' in template_dict) {\n chat_template = template_dict['default'];\n } else if (chat_template === null) {\n throw Error(\n `This model has multiple chat templates with no default specified! Please either pass a chat ` +\n `template or the name of the template you wish to use to the 'chat_template' argument. Available ` +\n `template names are ${Object.keys(template_dict).sort()}.`\n )\n }\n } else {\n // These are the cases when the model has a single template\n // priority: `chat_template` argument > `tokenizer.chat_template` > `tokenizer.default_chat_template\n chat_template ??= this.chat_template ?? this.default_chat_template;\n }\n if (typeof chat_template !== 'string') {\n throw Error(`chat_template must be a string, but got ${typeof chat_template}`);\n }\n\n // Compilation function uses a cache to avoid recompiling the same template\n let compiledTemplate = this._compiled_template_cache.get(chat_template);\n if (compiledTemplate === undefined) {\n compiledTemplate = new Template(chat_template);\n this._compiled_template_cache.set(chat_template, compiledTemplate);\n }\n\n const special_tokens_map = Object.create(null);\n for (const key of SPECIAL_TOKEN_ATTRIBUTES) {\n const value = this.getToken(key);\n if (value) {\n special_tokens_map[key] = value;\n }\n }\n\n const rendered = compiledTemplate.render({\n messages: conversation,\n add_generation_prompt: add_generation_prompt,\n\n ...special_tokens_map,\n ...kwargs,\n });\n\n if (tokenize) {\n return this._call(rendered, {\n add_special_tokens: false,\n padding,\n truncation,\n max_length,\n return_tensor,\n ...tokenizer_kwargs,\n }).input_ids;\n }\n\n return rendered;\n }\n}\n\n/**\n * BertTokenizer is a class used to tokenize text for BERT models.\n * @extends PreTrainedTokenizer\n */\nexport class BertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\n/**\n * Albert tokenizer\n * @extends PreTrainedTokenizer\n */\nexport class AlbertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class MobileBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class SqueezeBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class DebertaTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class DebertaV2Tokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class HerbertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class ConvBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class RoFormerTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nexport class DistilBertTokenizer extends PreTrainedTokenizer { }\nexport class CamembertTokenizer extends PreTrainedTokenizer { }\nexport class XLMTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\\'s \"fast\" tokenizers library. Therefore, you may experience slightly inaccurate results.')\n }\n}\nexport class ElectraTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\n\nexport class T5Tokenizer extends PreTrainedTokenizer { }\nexport class GPT2Tokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}\" \"{{ message.content }}{{ eos_token }}\" \"{% endfor %}`\n}\nexport class BartTokenizer extends PreTrainedTokenizer { }\nexport class MBartTokenizer extends PreTrainedTokenizer {\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^[a-z]{2}_[A-Z]{2}$/;\n this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x));\n this.lang_to_token = x => x; // Identity function\n }\n\n /**\n * Helper function to build translation inputs for an `MBartTokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\nexport class MBart50Tokenizer extends MBartTokenizer { } // NOTE: extends MBartTokenizer\n\nexport class RobertaTokenizer extends PreTrainedTokenizer { }\n\nexport class BloomTokenizer extends GPT2Tokenizer { // NOTE: `GPT2Tokenizer` to get the correct chat template\n\n constructor(tokenizerJSON, tokenizerConfig) {\n // Override the default (invalid) regex of the pretokenizer.\n // For more information, see https://github.com/xenova/transformers.js/issues/94\n const splitChars = '.,!?\\u2026\\u3002\\uff0c\\u3001\\u0964\\u06d4\\u060c';\n const patternObject = tokenizerJSON.pre_tokenizer?.pretokenizers[0]?.pattern;\n if (patternObject && patternObject.Regex === ` ?[^(\\\\s|[${splitChars}])]+`) {\n patternObject.Regex = ` ?[^\\\\s${splitChars}]+`;\n }\n super(tokenizerJSON, tokenizerConfig);\n }\n}\n\nconst SPIECE_UNDERLINE = \"▁\";\n\nexport class LlamaTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<>\\n' + system_message + '\\n<>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'system' %}{{ '<>\\n' + content.strip() + '\\n<>\\n\\n' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}`\n\n DEFAULT_SYSTEM_PROMPT =\n \"You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your \" +\n \"answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure \" +\n \"that your responses are socially unbiased and positive in nature.\\n\\n\" +\n \"If a question does not make any sense, or is not factually coherent, explain why instead of answering something not \" +\n \"correct. If you don't know the answer to a question, please don't share false information.\"\n\n padding_side = 'left';\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n this.use_default_system_prompt = tokenizerConfig.use_default_system_prompt ?? false;\n\n this.legacy = tokenizerConfig.legacy ?? true;\n if (!this.legacy) {\n // See https://github.com/huggingface/transformers/pull/24565 for more information\n this.normalizer = null;\n this.pre_tokenizer = new MetaspacePreTokenizer({\n replacement: SPIECE_UNDERLINE,\n add_prefix_space: true,\n prepend_scheme: \"first\",\n });\n }\n }\n\n /**\n * Helper function to handle legacy encoding of SPM tokenizers.\n * Adapted from https://github.com/huggingface/transformers/blob/e6dcf8abd6f65bb4b6dfc1831b20d9ba49ce00e2/src/transformers/models/t5/tokenization_t5.py#L374-L387\n * @param {string} text The text to encode.\n * @returns {string[]} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n if (this.legacy || text.length === 0) {\n return super._encode_text(text);\n }\n\n let tokens = super._encode_text(SPIECE_UNDERLINE + text.replaceAll(SPIECE_UNDERLINE, \" \"));\n if (tokens.length > 1 && tokens[0] === SPIECE_UNDERLINE && this.special_tokens.includes(tokens[1])) {\n tokens = tokens.slice(1);\n }\n return tokens;\n }\n\n get default_chat_template() {\n return super.default_chat_template\n .replaceAll('USE_DEFAULT_PROMPT', this.use_default_system_prompt ? 'true' : 'false')\n .replaceAll('DEFAULT_SYSTEM_MESSAGE', this.DEFAULT_SYSTEM_PROMPT.replaceAll(\"\\n\", \"\\\\n\").replaceAll(\"'\", \"\\\\'\"));\n }\n}\nexport class CodeLlamaTokenizer extends LlamaTokenizer { } // NOTE: `LlamaTokenizer` to get the correct chat template\n\nexport class XLMRobertaTokenizer extends PreTrainedTokenizer { }\nexport class MPNetTokenizer extends PreTrainedTokenizer { }\n\nexport class FalconTokenizer extends PreTrainedTokenizer { }\n\nexport class GPTNeoXTokenizer extends PreTrainedTokenizer { }\n\nexport class EsmTokenizer extends PreTrainedTokenizer { }\n\nexport class Qwen2Tokenizer extends PreTrainedTokenizer { }\n\nexport class GemmaTokenizer extends PreTrainedTokenizer {\n _default_chat_template = \"{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '' + role + '\\n' + message['content'] | trim + '\\n' }}{% endfor %}{% if add_generation_prompt %}{{'model\\n'}}{% endif %}\"\n}\n\nexport class Grok1Tokenizer extends PreTrainedTokenizer { }\n\n/**\n * Helper function to build translation inputs for an `NllbTokenizer` or `M2M100Tokenizer`.\n * @param {PreTrainedTokenizer} self The tokenizer instance.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n * @private\n */\nfunction _build_translation_inputs(self, raw_inputs, tokenizer_options, generate_kwargs) {\n if (!('language_codes' in self) || !Array.isArray(self.language_codes)) {\n throw new Error('Tokenizer must have `language_codes` attribute set and it should be an array of language ids.')\n }\n if (!('languageRegex' in self) || !(self.languageRegex instanceof RegExp)) {\n throw new Error('Tokenizer must have `languageRegex` attribute set and it should be a regular expression.')\n }\n if (!('lang_to_token' in self) || typeof self.lang_to_token !== 'function') {\n throw new Error('Tokenizer must have `lang_to_token` attribute set and it should be a function.')\n }\n const src_lang_token = generate_kwargs.src_lang;\n const tgt_lang_token = generate_kwargs.tgt_lang;\n\n // Check that the target language is valid:\n if (!self.language_codes.includes(tgt_lang_token)) {\n throw new Error(`Target language code \"${tgt_lang_token}\" is not valid. Must be one of: {${self.language_codes.join(', ')}}`);\n }\n\n // Allow `src_lang` to be optional. If not set, we'll use the tokenizer's default.\n if (src_lang_token !== undefined) {\n // Check that the source language is valid:\n if (!self.language_codes.includes(src_lang_token)) {\n throw new Error(`Source language code \"${src_lang_token}\" is not valid. Must be one of: {${self.language_codes.join(', ')}}`);\n }\n\n // In the same way as the Python library, we override the post-processor\n // to force the source language to be first:\n for (const item of self.post_processor.config.single) {\n if ('SpecialToken' in item && self.languageRegex.test(item.SpecialToken.id)) {\n item.SpecialToken.id = self.lang_to_token(src_lang_token);\n break;\n }\n }\n // TODO: Do the same for pair?\n }\n\n // Override the `forced_bos_token_id` to force the correct language\n generate_kwargs.forced_bos_token_id = self.model.convert_tokens_to_ids([self.lang_to_token(tgt_lang_token)])[0];\n\n return self._call(raw_inputs, tokenizer_options);\n}\n\n/**\n * The NllbTokenizer class is used to tokenize text for NLLB (\"No Language Left Behind\") models.\n * \n * No Language Left Behind (NLLB) is a first-of-its-kind, AI breakthrough project\n * that open-sources models capable of delivering high-quality translations directly\n * between any pair of 200+ languages — including low-resource languages like Asturian,\n * Luganda, Urdu and more. It aims to help people communicate with anyone, anywhere,\n * regardless of their language preferences. For more information, check out their\n * [paper](https://arxiv.org/abs/2207.04672).\n * \n * For a list of supported languages (along with their language codes),\n * @see {@link https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200}\n */\nexport class NllbTokenizer extends PreTrainedTokenizer {\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^[a-z]{3}_[A-Z][a-z]{3}$/;\n this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x));\n this.lang_to_token = x => x; // Identity function\n }\n\n /**\n * Helper function to build translation inputs for an `NllbTokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\n\n/**\n * The M2M100Tokenizer class is used to tokenize text for M2M100 (\"Many-to-Many\") models.\n * \n * M2M100 is a multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many\n * multilingual translation. It was introduced in this [paper](https://arxiv.org/abs/2010.11125)\n * and first released in [this](https://github.com/pytorch/fairseq/tree/master/examples/m2m_100) repository.\n * \n * For a list of supported languages (along with their language codes),\n * @see {@link https://huggingface.co/facebook/m2m100_418M#languages-covered}\n */\nexport class M2M100Tokenizer extends PreTrainedTokenizer {\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^__[a-z]{2,3}__$/;\n this.language_codes = this.special_tokens\n .filter(x => this.languageRegex.test(x))\n .map(x => x.slice(2, -2));\n this.lang_to_token = x => `__${x}__`;\n }\n\n /**\n * Helper function to build translation inputs for an `M2M100Tokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\n\n\nconst WHISPER_LANGUAGES = [\n [\"en\", \"english\"],\n [\"zh\", \"chinese\"],\n [\"de\", \"german\"],\n [\"es\", \"spanish\"],\n [\"ru\", \"russian\"],\n [\"ko\", \"korean\"],\n [\"fr\", \"french\"],\n [\"ja\", \"japanese\"],\n [\"pt\", \"portuguese\"],\n [\"tr\", \"turkish\"],\n [\"pl\", \"polish\"],\n [\"ca\", \"catalan\"],\n [\"nl\", \"dutch\"],\n [\"ar\", \"arabic\"],\n [\"sv\", \"swedish\"],\n [\"it\", \"italian\"],\n [\"id\", \"indonesian\"],\n [\"hi\", \"hindi\"],\n [\"fi\", \"finnish\"],\n [\"vi\", \"vietnamese\"],\n [\"he\", \"hebrew\"],\n [\"uk\", \"ukrainian\"],\n [\"el\", \"greek\"],\n [\"ms\", \"malay\"],\n [\"cs\", \"czech\"],\n [\"ro\", \"romanian\"],\n [\"da\", \"danish\"],\n [\"hu\", \"hungarian\"],\n [\"ta\", \"tamil\"],\n [\"no\", \"norwegian\"],\n [\"th\", \"thai\"],\n [\"ur\", \"urdu\"],\n [\"hr\", \"croatian\"],\n [\"bg\", \"bulgarian\"],\n [\"lt\", \"lithuanian\"],\n [\"la\", \"latin\"],\n [\"mi\", \"maori\"],\n [\"ml\", \"malayalam\"],\n [\"cy\", \"welsh\"],\n [\"sk\", \"slovak\"],\n [\"te\", \"telugu\"],\n [\"fa\", \"persian\"],\n [\"lv\", \"latvian\"],\n [\"bn\", \"bengali\"],\n [\"sr\", \"serbian\"],\n [\"az\", \"azerbaijani\"],\n [\"sl\", \"slovenian\"],\n [\"kn\", \"kannada\"],\n [\"et\", \"estonian\"],\n [\"mk\", \"macedonian\"],\n [\"br\", \"breton\"],\n [\"eu\", \"basque\"],\n [\"is\", \"icelandic\"],\n [\"hy\", \"armenian\"],\n [\"ne\", \"nepali\"],\n [\"mn\", \"mongolian\"],\n [\"bs\", \"bosnian\"],\n [\"kk\", \"kazakh\"],\n [\"sq\", \"albanian\"],\n [\"sw\", \"swahili\"],\n [\"gl\", \"galician\"],\n [\"mr\", \"marathi\"],\n [\"pa\", \"punjabi\"],\n [\"si\", \"sinhala\"],\n [\"km\", \"khmer\"],\n [\"sn\", \"shona\"],\n [\"yo\", \"yoruba\"],\n [\"so\", \"somali\"],\n [\"af\", \"afrikaans\"],\n [\"oc\", \"occitan\"],\n [\"ka\", \"georgian\"],\n [\"be\", \"belarusian\"],\n [\"tg\", \"tajik\"],\n [\"sd\", \"sindhi\"],\n [\"gu\", \"gujarati\"],\n [\"am\", \"amharic\"],\n [\"yi\", \"yiddish\"],\n [\"lo\", \"lao\"],\n [\"uz\", \"uzbek\"],\n [\"fo\", \"faroese\"],\n [\"ht\", \"haitian creole\"],\n [\"ps\", \"pashto\"],\n [\"tk\", \"turkmen\"],\n [\"nn\", \"nynorsk\"],\n [\"mt\", \"maltese\"],\n [\"sa\", \"sanskrit\"],\n [\"lb\", \"luxembourgish\"],\n [\"my\", \"myanmar\"],\n [\"bo\", \"tibetan\"],\n [\"tl\", \"tagalog\"],\n [\"mg\", \"malagasy\"],\n [\"as\", \"assamese\"],\n [\"tt\", \"tatar\"],\n [\"haw\", \"hawaiian\"],\n [\"ln\", \"lingala\"],\n [\"ha\", \"hausa\"],\n [\"ba\", \"bashkir\"],\n [\"jw\", \"javanese\"],\n [\"su\", \"sundanese\"],\n]\n\n// @ts-ignore\nconst WHISPER_LANGUAGE_MAPPING = new Map(WHISPER_LANGUAGES);\n// @ts-ignore\nconst WHISPER_TO_LANGUAGE_CODE_MAPPING = new Map([\n ...WHISPER_LANGUAGES.map(([k, v]) => [v, k]),\n ...[\n [\"burmese\", \"my\"],\n [\"valencian\", \"ca\"],\n [\"flemish\", \"nl\"],\n [\"haitian\", \"ht\"],\n [\"letzeburgesch\", \"lb\"],\n [\"pushto\", \"ps\"],\n [\"panjabi\", \"pa\"],\n [\"moldavian\", \"ro\"],\n [\"moldovan\", \"ro\"],\n [\"sinhalese\", \"si\"],\n [\"castilian\", \"es\"],\n ]\n]);\n\n/**\n * WhisperTokenizer tokenizer\n * @extends PreTrainedTokenizer\n */\nexport class WhisperTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}\" \"{{ message.content }}{{ eos_token }}\" \"{% endfor %}`;\n\n /**\n * Decodes automatic speech recognition (ASR) sequences.\n * @param {Array<{tokens: number[], token_timestamps?: number[], stride: number[]}>} sequences The sequences to decode.\n * @param {Object} options The options to use for decoding.\n * @returns {Array, text: string}>}>} The decoded sequences.\n */\n _decode_asr(sequences, {\n return_timestamps = false,\n return_language = false,\n time_precision = null,\n force_full_sequences = true\n } = {}) {\n // Set force_full_sequences=false if you want streaming\n // TODO add support for `return_language`\n\n // Internal method meant to only be used by asr pipeline.\n // Handles all the little quirks specific to whisper to handle\n // the various options not allowed in other seq2seq models\n\n // =========== Overview ============\n // - iterate over all outputs\n // - all tokens within output\n // - Each token can be\n // - language token\n // - special token\n // - timestamp token\n // - text token\n // - We accumulate the text tokens.\n // - We split on end timestamps\n // - Lots of complexity comes from stride and timestamps\n\n if (time_precision === null) {\n throw Error(\"Must specify time_precision\")\n }\n let last_language = null;\n\n const returnWordTimestamps = return_timestamps === \"word\";\n\n function new_chunk() {\n return { \"language\": last_language, \"timestamp\": [null, null], \"text\": \"\" };\n }\n\n // Welcome to the state machine!\n const chunks = [];\n let chunk = new_chunk();\n let time_offset = 0.0;\n const timestamp_begin = this.model.convert_tokens_to_ids([\"<|notimestamps|>\"])[0] + 1;\n\n let previous_tokens = [];\n let previous_token_timestamps = [];\n\n let skip = false;\n let right_stride_start = null;\n\n\n const all_special_ids = new Set(this.all_special_ids);\n\n for (const output of sequences) {\n // NOTE: python version has batches, so it uses [0]\n const token_ids = output.tokens;\n const token_timestamps = returnWordTimestamps ? output.token_timestamps : null;\n\n // These keep track of timestamps within strides, which need\n // to be skipped and resolve all tokens in a single chunk.\n let last_timestamp = null;\n let first_timestamp = timestamp_begin;\n\n if (\"stride\" in output) {\n const [chunk_len, stride_left, stride_right] = output.stride;\n\n // Offset the timings to account for the other `model_outputs`.\n time_offset -= stride_left;\n right_stride_start = chunk_len - stride_right;\n\n // Keeping track of timestamps within strides\n // We're going to NOT split on those, and delay until we're\n // out of BOTH stride. Otherwise lots of issues occur and\n // corner cases\n if (stride_left) {\n first_timestamp = stride_left / time_precision + timestamp_begin;\n }\n\n if (stride_right) {\n for (let i = token_ids.length - 1; i >= 0; --i) {\n const token = token_ids[i];\n if (token >= timestamp_begin) {\n // There can be several token in the right stride\n // But the last one is ALWAYS going to be skipped\n if (last_timestamp !== null && (token - timestamp_begin) * time_precision < right_stride_start) {\n break;\n }\n last_timestamp = token;\n }\n }\n }\n }\n\n let current_tokens = [];\n let current_token_timestamps = [];\n\n // - all tokens within output\n for (let i = 0; i < token_ids.length; ++i) {\n const token = token_ids[i];\n // 4 possible states for each token\n // - 1/ Language code\n // - 2/ all other special tokens (which we ignore)\n // - 3/ Timestamp\n // - 4/ Regular text\n\n if (all_special_ids.has(token)) {\n const text = this.decode([token]);\n const language = WHISPER_LANGUAGE_MAPPING.get(text.slice(2, -2));\n\n if (language !== undefined) {\n // 1/ Indeed some language\n // TODO Handle when language is different from the previous\n // one, and we cannot use timestamped tokens to create chunks\n if (last_language !== null && language !== last_language && !return_timestamps) {\n previous_tokens.push(current_tokens);\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens)[0];\n const resolved_text = this.decode(resolved_tokens);\n chunk.text = resolved_text;\n chunks.push(chunk);\n\n // Flush all our temporary context\n previous_tokens = [];\n current_tokens = [];\n chunk = new_chunk();\n }\n\n last_language = chunk.language = language;\n } else {\n // 2/ This is a regular special token, ignoring it\n }\n } else if (token >= timestamp_begin) {\n // 3/ Timestamp token\n const time = (token - timestamp_begin) * time_precision + time_offset;\n const rounded_time = round(time, 2);\n\n if (last_timestamp !== null && token >= last_timestamp) {\n // Whisper outputted a timestamp token, but it falls within\n // our stride, so we're going to skip it for the time being\n // and resolve this later\n // Skip is necessary because timestamp tokens always come\n // by pair, so we need to skip the next one too (which would mark the start of another chunk).\n skip = true;\n } else if (skip || (previous_tokens.length > 0 && token < first_timestamp)) {\n skip = false;\n } else if (chunk.timestamp[0] === null) {\n chunk.timestamp[0] = rounded_time;\n } else {\n // This is the end of the timestamp chunk\n if (rounded_time === chunk.timestamp[0]) {\n // This is a bug in timestamp token output\n // where we're taking the duplicate token\n // as a stop where it should be a start.\n // This is an issue in the underlying model output\n // Let's just skip it so it becomes de-factor a start agin\n } else {\n chunk.timestamp[1] = rounded_time;\n\n // Handling merges\n previous_tokens.push(current_tokens)\n\n if (returnWordTimestamps) {\n previous_token_timestamps.push(current_token_timestamps);\n }\n const [resolved_tokens, resolved_token_timestamps] = this.findLongestCommonSequence(\n previous_tokens, previous_token_timestamps\n )\n\n const resolved_text = this.decode(resolved_tokens)\n chunk.text = resolved_text\n\n if (returnWordTimestamps) {\n chunk.words = this.collateWordTimestamps(\n resolved_tokens, resolved_token_timestamps, last_language,\n )\n }\n\n chunks.push(chunk)\n\n // Flush all our temporary context\n previous_tokens = []\n current_tokens = []\n previous_token_timestamps = []\n current_token_timestamps = []\n chunk = new_chunk()\n }\n }\n\n } else {\n // 4/ Regular token\n // We just append to the list of all tokens so we can handle\n // merges later and decode into text.\n current_tokens.push(token)\n\n if (returnWordTimestamps) {\n let start_time = round(token_timestamps[i] + time_offset, 2);\n\n let end_time;\n if (i + 1 < token_timestamps.length) {\n end_time = round(token_timestamps[i + 1] + time_offset, 2);\n } else {\n // should never happen\n end_time = null;\n }\n current_token_timestamps.push([start_time, end_time]);\n }\n\n }\n }\n\n if ('stride' in output) {\n const [chunk_len, stride_left, stride_right] = output.stride;\n time_offset += chunk_len - stride_right\n }\n\n // Leftover tokens\n if (current_tokens.length > 0) {\n previous_tokens.push(current_tokens)\n if (returnWordTimestamps) {\n previous_token_timestamps.push(current_token_timestamps);\n }\n } else if (previous_tokens.every(p => p.length === 0)) {\n // Flushing previous tokens (END)\"\n chunk = new_chunk()\n previous_tokens = []\n current_tokens = []\n previous_token_timestamps = [];\n current_token_timestamps = [];\n }\n\n }\n\n if (previous_tokens.length > 0) {\n if (force_full_sequences && return_timestamps) {\n // Last token should always be timestamps, so there shouldn't be\n // leftover\n throw new Error(\n \"Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. \" +\n \"Also make sure WhisperTimeStampLogitsProcessor was used during generation.\"\n );\n }\n\n // Happens when we don't use timestamps\n const [resolved_tokens, resolved_token_timestamps] = this.findLongestCommonSequence(previous_tokens, previous_token_timestamps);\n\n // Flushing previous tokens (FINAL)\n const resolved_text = this.decode(resolved_tokens);\n chunk.text = resolved_text;\n if (returnWordTimestamps) {\n chunk.words = this.collateWordTimestamps(\n resolved_tokens, resolved_token_timestamps, last_language,\n )\n }\n chunks.push(chunk);\n }\n\n let optional = Object.create(null);\n\n // Preparing and cleaning up the pipeline output\n const full_text = chunks.map(chunk => chunk.text).join('');\n if (return_timestamps || return_language) {\n for (let i = 0; i < chunks.length; ++i) {\n const chunk = chunks[i];\n if (!return_timestamps) {\n delete chunk[\"timestamp\"];\n }\n\n if (!return_language) {\n delete chunk[\"language\"];\n }\n }\n if (returnWordTimestamps) {\n const new_chunks = [];\n for (const chunk of chunks) {\n for (const word of chunk.words) {\n new_chunks.push(word);\n }\n }\n optional = { \"chunks\": new_chunks };\n } else {\n optional = { \"chunks\": chunks };\n }\n }\n return [full_text, optional];\n\n }\n\n /**\n * Finds the longest common sequence among the provided sequences.\n * @param {number[][]} sequences An array of sequences of token ids to compare.\n * @returns {number[][]} The longest common sequence found.\n * @throws {Error} If there is a bug within the function.\n * @private\n */\n findLongestCommonSequence(sequences, token_timestamp_sequences = null) {\n // It would be much harder to do O(n) because of fault tolerance.\n // We actually have a really good property which is that the total sequence\n // MUST be those subsequences in order.\n // If token_timestamp_sequences is provided, will split those sequences in\n // exactly the same way.\n let leftSequence = sequences[0];\n let leftLength = leftSequence.length;\n let totalSequence = [];\n\n const use_token_timestamp_sequences = Array.isArray(token_timestamp_sequences) && token_timestamp_sequences.length > 0;\n let total_token_timestamp_sequence = use_token_timestamp_sequences ? [] : null;\n let left_token_timestamp_sequence = use_token_timestamp_sequences ? token_timestamp_sequences[0] : null;\n for (let i = 1; i < sequences.length; ++i) {\n const rightSequence = sequences[i];\n let max = 0.0;\n let maxIndices = [leftLength, leftLength, 0, 0];\n // Here we're sliding matches\n // [a, b, c, d]\n // [c, d, f]\n // = [c] == [d]\n\n // [a, b, c, d]\n // [c, d, f]\n // = [c, d] == [c, d]\n\n\n // [a, b, c, d]\n // [c, d, f]\n\n // = [b, c, d] == [c, d, f]\n\n // [a, b, c, d]\n // [c, d, f]\n\n // [a, b, c] == [c, d, f]\n\n // [a, b, c, d]\n // [d, f]\n\n // [a, b] == [d, f]\n\n // [a, b, c, d]\n // [f]\n\n // [a] == [f]\n\n const rightLength = rightSequence.length;\n for (let j = 1; j < leftLength + rightLength; ++j) {\n const eps = j / 10000.0;\n const leftStart = Math.max(0, leftLength - j);\n const leftStop = Math.min(leftLength, leftLength + rightLength - j);\n const left = leftSequence.slice(leftStart, leftStop);\n const rightStart = Math.max(0, j - leftLength);\n const rightStop = Math.min(rightLength, j);\n const right = rightSequence.slice(rightStart, rightStop);\n if (left.length !== right.length) {\n throw new Error(\"There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.\");\n }\n const matches = left.filter((elem, idx) => elem === right[idx]).length;\n const matching = matches / j + eps;\n if (matches > 1 && matching > max) {\n max = matching;\n maxIndices = [leftStart, leftStop, rightStart, rightStop];\n }\n }\n const [leftStart, leftStop, rightStart, rightStop] = maxIndices;\n const leftMid = Math.floor((leftStop + leftStart) / 2);\n const rightMid = Math.floor((rightStop + rightStart) / 2);\n totalSequence.push(...leftSequence.slice(0, leftMid));\n leftSequence = rightSequence.slice(rightMid);\n leftLength = leftSequence.length;\n\n if (use_token_timestamp_sequences) {\n total_token_timestamp_sequence.push(...left_token_timestamp_sequence.slice(0, leftMid));\n left_token_timestamp_sequence = token_timestamp_sequences[i].slice(rightMid);\n }\n }\n totalSequence.push(...leftSequence);\n\n if (use_token_timestamp_sequences) {\n total_token_timestamp_sequence.push(...left_token_timestamp_sequence);\n return [totalSequence, total_token_timestamp_sequence];\n } else {\n return [totalSequence, []];\n }\n }\n\n /** @private */\n collateWordTimestamps(tokens, token_timestamps, language) {\n\n const [words, _, token_indices] = this.combineTokensIntoWords(tokens, language);\n\n const timings = [];\n for (let i = 0; i < words.length; ++i) {\n const indices = token_indices[i];\n timings.push({\n text: words[i],\n timestamp: [\n token_timestamps[indices.at(0)][0],\n token_timestamps[indices.at(-1)][1],\n ],\n });\n }\n return timings;\n }\n\n /**\n * Groups tokens by word. Returns a tuple containing a list of strings with the words,\n * and a list of `token_id` sequences with the tokens making up each word.\n * @param {number[]} tokens \n * @param {string} [language] \n * @param {string} prepend_punctionations \n * @param {string} append_punctuations \n * \n * @private\n */\n combineTokensIntoWords(tokens, language, prepend_punctionations = \"\\\"'“¡¿([{-\", append_punctuations = \"\\\"'.。,,!!??::”)]}、\") {\n language = language ?? 'english';\n\n let words, word_tokens, token_indices;\n\n if ([\"chinese\", \"japanese\", \"thai\", \"lao\", \"myanmar\"].includes(language)) {\n // These languages don't typically use spaces.\n [words, word_tokens, token_indices] = this.splitTokensOnUnicode(tokens)\n } else {\n [words, word_tokens, token_indices] = this.splitTokensOnSpaces(tokens)\n }\n\n return this.mergePunctuations(words, word_tokens, token_indices, prepend_punctionations, append_punctuations);\n }\n\n /** @type {PreTrainedTokenizer['decode']} */\n decode(\n token_ids,\n decode_args,\n ) {\n let text;\n // @ts-ignore\n if (decode_args && decode_args.decode_with_timestamps) {\n if (token_ids instanceof Tensor) {\n token_ids = prepareTensorForDecode(token_ids);\n }\n text = this.decodeWithTimestamps(token_ids, decode_args);\n } else {\n text = super.decode(token_ids, decode_args);\n }\n // TODO: implement offsets\n // if (decode_args.output_offsets) {\n // let offsets = this.computeOffsets\n // }\n return text;\n }\n\n /**\n * @param {number[]} token_ids List of token IDs to decode.\n * @param {Object} decode_args Optional arguments for decoding\n * @private\n */\n decodeWithTimestamps(token_ids, decode_args) {\n const time_precision = decode_args?.time_precision ?? 0.02;\n\n const timestamp_begin = Array.from(this.all_special_ids).at(-1) + 1;\n /**@type {Array} */\n let outputs = [[]];\n for (const token of token_ids) {\n if (token >= timestamp_begin) {\n const timestamp = round((token - timestamp_begin) * time_precision, 2);\n outputs.push(`<|${timestamp}|>`);\n outputs.push([]);\n } else {\n outputs[outputs.length - 1].push(token);\n }\n }\n outputs = outputs.map(\n s => {\n if (typeof s === 'string') {\n return s;\n } else {\n return super.decode(s, decode_args);\n }\n }\n )\n\n return outputs.join('');\n }\n\n /**\n * Combine tokens into words by splitting at any position where the tokens are decoded as valid unicode points.\n * @param {number[]} tokens \n * @returns {*}\n * @private\n */\n splitTokensOnUnicode(tokens) {\n const decoded_full = this.decode(tokens, {\n // @ts-ignore\n decode_with_timestamps: true,\n });\n const replacement_char = '\\uFFFD';\n\n const words = []\n const word_tokens = []\n const token_indices = []\n let current_tokens = []\n let current_indices = []\n let unicode_offset = 0\n\n for (let token_idx = 0; token_idx < tokens.length; ++token_idx) {\n const token = tokens[token_idx];\n\n current_tokens.push(token);\n current_indices.push(token_idx);\n\n const decoded = this.decode(current_tokens, {\n // @ts-ignore\n decode_with_timestamps: true,\n });\n\n if (!decoded.includes(replacement_char) || decoded_full[unicode_offset + decoded.indexOf(replacement_char)] === replacement_char) {\n words.push(decoded)\n word_tokens.push(current_tokens)\n token_indices.push(current_indices)\n current_tokens = []\n current_indices = []\n unicode_offset += decoded.length;\n }\n\n }\n\n return [words, word_tokens, token_indices]\n }\n\n /**\n * Combine tokens into words by splitting at whitespace and punctuation tokens.\n * @param {number[]} tokens \n * @private\n */\n splitTokensOnSpaces(tokens) {\n\n const [subwords, subword_tokens_list, subword_indices_list] = this.splitTokensOnUnicode(tokens);\n\n const words = []\n const word_tokens = []\n const token_indices = []\n\n const punctuationRegex = new RegExp(`^[${PUNCTUATION_REGEX}]$`, 'gu');\n\n for (let i = 0; i < subwords.length; ++i) {\n\n const subword = subwords[i];\n const subword_tokens = subword_tokens_list[i];\n const subword_indices = subword_indices_list[i];\n\n // @ts-ignore\n const special = subword_tokens[0] >= this.model.tokens_to_ids.get('<|endoftext|>');\n const with_space = subword.startsWith(' ');\n const trimmed = subword.trim();\n const punctuation = punctuationRegex.test(trimmed);\n\n if (special || with_space || punctuation || words.length === 0) {\n words.push(subword);\n word_tokens.push(subword_tokens);\n token_indices.push(subword_indices);\n } else {\n const ix = words.length - 1;\n words[ix] += subword;\n word_tokens[ix].push(...subword_tokens);\n token_indices[ix].push(...subword_indices);\n }\n }\n\n return [words, word_tokens, token_indices];\n\n }\n\n /**\n * Merges punctuation tokens with neighboring words.\n * @param {string[]} words \n * @param {number[][]} tokens \n * @param {number[][]} indices \n * @param {string} prepended \n * @param {string} appended \n * @private\n */\n mergePunctuations(words, tokens, indices, prepended, appended) {\n\n const newWords = structuredClone(words);\n const newTokens = structuredClone(tokens);\n const newIndices = structuredClone(indices);\n\n\n // prepend punctuations\n let i = newWords.length - 2;\n let j = newWords.length - 1;\n\n while (i >= 0) {\n if (newWords[i].startsWith(' ') && prepended.includes(newWords[i].trim())) {\n newWords[j] = newWords[i] + newWords[j];\n newTokens[j] = mergeArrays(newTokens[i], newTokens[j]);\n newIndices[j] = mergeArrays(newIndices[i], newIndices[j]);\n newWords[i] = '';\n newTokens[i] = [];\n newIndices[i] = [];\n } else {\n j = i;\n }\n --i;\n }\n\n // append punctuations\n i = 0;\n j = 1;\n while (j < newWords.length) {\n if (!newWords[i].endsWith(' ') && appended.includes(newWords[j])) {\n newWords[i] += newWords[j];\n newTokens[i] = mergeArrays(newTokens[i], newTokens[j]);\n newIndices[i] = mergeArrays(newIndices[i], newIndices[j]);\n newWords[j] = '';\n newTokens[j] = [];\n newIndices[j] = [];\n } else {\n i = j;\n }\n ++j;\n }\n\n return [\n newWords.filter(x => x),\n newTokens.filter(x => x.length > 0),\n newIndices.filter(x => x.length > 0),\n ]\n }\n\n /**\n * Helper function to build translation inputs for a `WhisperTokenizer`,\n * depending on the language, task, and whether to predict timestamp tokens.\n * \n * Used to override the prefix tokens appended to the start of the label sequence.\n * \n * **Example: Get ids for a language**\n * ```javascript\n * // instantiate the tokenizer and set the prefix token to Spanish\n * const tokenizer = await WhisperTokenizer.from_pretrained('Xenova/whisper-tiny');\n * const forced_decoder_ids = tokenizer.get_decoder_prompt_ids({ language: 'spanish' });\n * // [(1, 50262), (2, 50363)]\n * ```\n * \n * @param {Object} options Options to generate the decoder prompt.\n * @param {string} [options.language] The language of the transcription text.\n * The corresponding language id token is appended to the start of the sequence for multilingual\n * speech recognition and speech translation tasks, e.g. for \"Spanish\" the token \"<|es|>\" is appended\n * to the start of sequence.\n * @param {string} [options.task] Task identifier to append at the start of sequence (if any).\n * This should be used for mulitlingual fine-tuning, with \"transcribe\" for speech recognition and\n * \"translate\" for speech translation.\n * @param {boolean} [options.no_timestamps] Whether to add the <|notimestamps|> token at the start of the sequence.\n * @returns {number[][]} The decoder prompt ids.\n */\n get_decoder_prompt_ids({\n language = null,\n task = null,\n no_timestamps = true,\n } = {}) {\n\n // <|lang_id|> <|task|> <|notimestamps|>\n\n const forced_decoder_ids = [];\n\n if (language) {\n // User wishes to specify the language\n language = language.toLowerCase();\n\n // Map to code from user-friendly name (e.g., \"english\" -> \"en\")\n let language_code = WHISPER_TO_LANGUAGE_CODE_MAPPING.get(language);\n\n if (language_code === undefined) {\n // User provided something that is not a language name\n\n if (WHISPER_LANGUAGE_MAPPING.has(language)) {\n // User provided the language code directly (e.g., \"en\")\n language_code = language;\n\n } else {\n // User provided something that is not a language code or name\n const is_language_code = language.length === 2;\n const langs = is_language_code ? WHISPER_LANGUAGE_MAPPING.keys() : WHISPER_LANGUAGE_MAPPING.values();\n\n throw new Error(`Language \"${language}\" is not supported. Must be one of: ${JSON.stringify(langs)}`);\n }\n }\n\n const language_token_id = this.model.tokens_to_ids.get(`<|${language_code}|>`);\n if (language_token_id === undefined) {\n throw new Error(`Unable to find language \"${language_code}\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n\n forced_decoder_ids.push(language_token_id);\n } else {\n // No token will be forced, which leaves the model to predict the language\n forced_decoder_ids.push(null);\n }\n\n if (task) {\n task = task.toLowerCase();\n if (task !== 'transcribe' && task !== 'translate') {\n throw new Error(`Task \"${task}\" is not supported. Must be one of: [\"transcribe\", \"translate\"]`);\n }\n\n const task_token_id = this.model.tokens_to_ids.get(`<|${task}|>`);\n if (task_token_id === undefined) {\n throw new Error(`Unable to find task \"${task}\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n\n forced_decoder_ids.push(task_token_id);\n } else {\n // No token will be forced, which leaves the model to predict the task\n forced_decoder_ids.push(null);\n }\n\n if (no_timestamps) {\n const no_timestamps_id = this.model.tokens_to_ids.get(`<|notimestamps|>`);\n if (no_timestamps_id === undefined) {\n throw new Error('Unable to find \"<|notimestamps|>\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.')\n }\n\n forced_decoder_ids.push(no_timestamps_id);\n }\n\n return forced_decoder_ids.map((x, i) => [i + 1, x]).filter(x => x[1] !== null);\n\n }\n}\nexport class CodeGenTokenizer extends PreTrainedTokenizer { }\nexport class CLIPTokenizer extends PreTrainedTokenizer { }\nexport class SiglipTokenizer extends PreTrainedTokenizer { }\n\n/**\n * @todo This model is not yet supported by Hugging Face's \"fast\" tokenizers library (https://github.com/huggingface/tokenizers).\n * Therefore, this implementation (which is based on fast tokenizers) may produce slightly inaccurate results.\n */\nexport class MarianTokenizer extends PreTrainedTokenizer {\n /**\n * Create a new MarianTokenizer instance.\n * @param {Object} tokenizerJSON The JSON of the tokenizer.\n * @param {Object} tokenizerConfig The config of the tokenizer.\n */\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^(>>\\w+<<)\\s*/g;\n\n this.supported_language_codes = this.model.vocab.filter(\n x => this.languageRegex.test(x)\n );\n\n console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\\'s \"fast\" tokenizers library. Therefore, you may experience slightly inaccurate results.')\n }\n\n /**\n * Encodes a single text. Overriding this method is necessary since the language codes\n * must be removed before encoding with sentencepiece model.\n * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213\n *\n * @param {string|null} text The text to encode.\n * @returns {Array} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n // Check if text starts with language code:\n const [matchInfo, ...remainder] = text.trim().split(this.languageRegex);\n\n if (remainder.length === 0) {\n // No language code, encode normally\n return super._encode_text(matchInfo);\n\n } else if (remainder.length === 2) {\n // Text starts with language code, so we do not encode it with sentencepiece.\n const [language, text] = remainder;\n\n if (!this.supported_language_codes.includes(language)) {\n console.warn(`Unsupported language code \"${language}\" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`)\n }\n return mergeArrays([language], super._encode_text(text));\n }\n }\n\n}\n\nexport class Wav2Vec2CTCTokenizer extends PreTrainedTokenizer { }\n\nexport class BlenderbotTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}`;\n}\nexport class BlenderbotSmallTokenizer extends BlenderbotTokenizer { } // NOTE `BlenderbotTokenizer` to get the correct chat template\n\nexport class SpeechT5Tokenizer extends PreTrainedTokenizer { }\n\nexport class NougatTokenizer extends PreTrainedTokenizer { }\n\nexport class VitsTokenizer extends PreTrainedTokenizer {\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n // Custom decoder function\n this.decoder = new VitsDecoder({});\n }\n}\n\nexport class CohereTokenizer extends PreTrainedTokenizer { }\n\n/**\n * Helper class which is used to instantiate pretrained tokenizers with the `from_pretrained` function.\n * The chosen tokenizer class is determined by the type specified in the tokenizer config.\n * \n * @example\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n */\nexport class AutoTokenizer {\n static TOKENIZER_CLASS_MAPPING = {\n T5Tokenizer,\n DistilBertTokenizer,\n CamembertTokenizer,\n DebertaTokenizer,\n DebertaV2Tokenizer,\n BertTokenizer,\n HerbertTokenizer,\n ConvBertTokenizer,\n RoFormerTokenizer,\n XLMTokenizer,\n ElectraTokenizer,\n MobileBertTokenizer,\n SqueezeBertTokenizer,\n AlbertTokenizer,\n GPT2Tokenizer,\n BartTokenizer,\n MBartTokenizer,\n MBart50Tokenizer,\n RobertaTokenizer,\n WhisperTokenizer,\n CodeGenTokenizer,\n CLIPTokenizer,\n SiglipTokenizer,\n MarianTokenizer,\n BloomTokenizer,\n NllbTokenizer,\n M2M100Tokenizer,\n LlamaTokenizer,\n CodeLlamaTokenizer,\n XLMRobertaTokenizer,\n MPNetTokenizer,\n FalconTokenizer,\n GPTNeoXTokenizer,\n EsmTokenizer,\n Wav2Vec2CTCTokenizer,\n BlenderbotTokenizer,\n BlenderbotSmallTokenizer,\n SpeechT5Tokenizer,\n NougatTokenizer,\n VitsTokenizer,\n Qwen2Tokenizer,\n GemmaTokenizer,\n Grok1Tokenizer,\n CohereTokenizer,\n\n // Base case:\n PreTrainedTokenizer,\n }\n\n\n /**\n * Instantiate one of the tokenizer classes of the library from a pretrained model.\n * \n * The tokenizer class to instantiate is selected based on the `tokenizer_class` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained tokenizer hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing tokenizer files, e.g., `./my_model_directory/`.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * \n * @returns {Promise} A new instance of the PreTrainedTokenizer class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n legacy = null,\n } = {}) {\n\n const [tokenizerJSON, tokenizerConfig] = await loadTokenizer(pretrained_model_name_or_path, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n legacy,\n })\n\n // Some tokenizers are saved with the \"Fast\" suffix, so we remove that if present.\n const tokenizerName = tokenizerConfig.tokenizer_class?.replace(/Fast$/, '') ?? 'PreTrainedTokenizer';\n\n let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerName];\n if (!cls) {\n console.warn(`Unknown tokenizer class \"${tokenizerName}\", attempting to construct from base class.`);\n cls = PreTrainedTokenizer;\n }\n return new cls(tokenizerJSON, tokenizerConfig);\n }\n}\n","/**\n * @file Helper module for audio processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/audio\n */\n\nimport {\n getFile,\n} from './hub.js';\nimport { FFT, max } from './maths.js';\nimport {\n calculateReflectOffset,\n} from './core.js';\n\n\n/**\n * Helper function to read audio from a path/URL.\n * @param {string|URL} url The path/URL to load the audio from.\n * @param {number} sampling_rate The sampling rate to use when decoding the audio.\n * @returns {Promise} The decoded audio as a `Float32Array`.\n */\nexport async function read_audio(url, sampling_rate) {\n if (typeof AudioContext === 'undefined') {\n // Running in node or an environment without AudioContext\n throw Error(\n \"Unable to load audio from path/URL since `AudioContext` is not available in your environment. \" +\n \"Instead, audio data should be passed directly to the pipeline/processor. \" +\n \"For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.\"\n )\n }\n\n const response = await (await getFile(url)).arrayBuffer();\n const audioCTX = new AudioContext({ sampleRate: sampling_rate });\n if (typeof sampling_rate === 'undefined') {\n console.warn(`No sampling rate provided, using default of ${audioCTX.sampleRate}Hz.`)\n }\n const decoded = await audioCTX.decodeAudioData(response);\n\n /** @type {Float32Array} */\n let audio;\n\n // We now replicate HuggingFace's `ffmpeg_read` method:\n if (decoded.numberOfChannels === 2) {\n // When downmixing a stereo audio file to mono using the -ac 1 option in FFmpeg,\n // the audio signal is summed across both channels to create a single mono channel.\n // However, if the audio is at full scale (i.e. the highest possible volume level),\n // the summing of the two channels can cause the audio signal to clip or distort.\n\n // To prevent this clipping, FFmpeg applies a scaling factor of 1/sqrt(2) (~ 0.707)\n // to the audio signal before summing the two channels. This scaling factor ensures\n // that the combined audio signal will not exceed the maximum possible level, even\n // if both channels are at full scale.\n\n // After applying this scaling factor, the audio signal from both channels is summed\n // to create a single mono channel. It's worth noting that this scaling factor is\n // only applied when downmixing stereo audio to mono using the -ac 1 option in FFmpeg.\n // If you're using a different downmixing method, or if you're not downmixing the\n // audio at all, this scaling factor may not be needed.\n const SCALING_FACTOR = Math.sqrt(2);\n\n const left = decoded.getChannelData(0);\n const right = decoded.getChannelData(1);\n\n audio = new Float32Array(left.length);\n for (let i = 0; i < decoded.length; ++i) {\n audio[i] = SCALING_FACTOR * (left[i] + right[i]) / 2;\n }\n\n } else {\n // If the audio is not stereo, we can just use the first channel:\n audio = decoded.getChannelData(0);\n }\n\n return audio;\n}\n\n/**\n * Generates a Hanning window of length M.\n *\n * @param {number} M The length of the Hanning window to generate.\n * @returns {Float64Array} The generated Hanning window.\n */\nexport function hanning(M) {\n if (M < 1) {\n return new Float64Array();\n }\n if (M === 1) {\n return new Float64Array([1]);\n }\n const denom = M - 1;\n const factor = Math.PI / denom;\n const cos_vals = new Float64Array(M);\n for (let i = 0; i < M; ++i) {\n const n = 2 * i - denom;\n cos_vals[i] = 0.5 + 0.5 * Math.cos(factor * n);\n }\n return cos_vals;\n}\n\nconst HERTZ_TO_MEL_MAPPING = {\n \"htk\": (/** @type {number} */ freq) => 2595.0 * Math.log10(1.0 + (freq / 700.0)),\n \"kaldi\": (/** @type {number} */ freq) => 1127.0 * Math.log(1.0 + (freq / 700.0)),\n \"slaney\": (/** @type {number} */ freq, min_log_hertz = 1000.0, min_log_mel = 15.0, logstep = 27.0 / Math.log(6.4)) =>\n freq >= min_log_hertz\n ? min_log_mel + Math.log(freq / min_log_hertz) * logstep\n : 3.0 * freq / 200.0,\n}\n\n/**\n * @template {Float32Array|Float64Array|number} T \n * @param {T} freq \n * @param {string} [mel_scale]\n * @returns {T}\n */\nfunction hertz_to_mel(freq, mel_scale = \"htk\") {\n const fn = HERTZ_TO_MEL_MAPPING[mel_scale];\n if (!fn) {\n throw new Error('mel_scale should be one of \"htk\", \"slaney\" or \"kaldi\".');\n }\n\n return typeof freq === 'number' ? fn(freq) : freq.map(x => fn(x));\n}\n\nconst MEL_TO_HERTZ_MAPPING = {\n \"htk\": (/** @type {number} */ mels) => 700.0 * (10.0 ** (mels / 2595.0) - 1.0),\n \"kaldi\": (/** @type {number} */ mels) => 700.0 * (Math.exp(mels / 1127.0) - 1.0),\n \"slaney\": (/** @type {number} */ mels, min_log_hertz = 1000.0, min_log_mel = 15.0, logstep = Math.log(6.4) / 27.0) => mels >= min_log_mel\n ? min_log_hertz * Math.exp(logstep * (mels - min_log_mel))\n : 200.0 * mels / 3.0,\n}\n\n/**\n * @template {Float32Array|Float64Array|number} T \n * @param {T} mels \n * @param {string} [mel_scale]\n * @returns {T}\n */\nfunction mel_to_hertz(mels, mel_scale = \"htk\") {\n const fn = MEL_TO_HERTZ_MAPPING[mel_scale];\n if (!fn) {\n throw new Error('mel_scale should be one of \"htk\", \"slaney\" or \"kaldi\".');\n }\n\n return typeof mels === 'number' ? fn(mels) : mels.map(x => fn(x));\n}\n\n/**\n* Creates a triangular filter bank.\n*\n* Adapted from torchaudio and librosa.\n*\n* @param {Float64Array} fft_freqs Discrete frequencies of the FFT bins in Hz, of shape `(num_frequency_bins,)`.\n* @param {Float64Array} filter_freqs Center frequencies of the triangular filters to create, in Hz, of shape `(num_mel_filters,)`.\n* @returns {number[][]} of shape `(num_frequency_bins, num_mel_filters)`.\n*/\nfunction _create_triangular_filter_bank(fft_freqs, filter_freqs) {\n const filter_diff = Float64Array.from(\n { length: filter_freqs.length - 1 },\n (_, i) => filter_freqs[i + 1] - filter_freqs[i]\n );\n\n const slopes = Array.from({\n length: fft_freqs.length\n }, () => new Array(filter_freqs.length));\n\n for (let j = 0; j < fft_freqs.length; ++j) {\n const slope = slopes[j];\n for (let i = 0; i < filter_freqs.length; ++i) {\n slope[i] = filter_freqs[i] - fft_freqs[j];\n }\n }\n\n const numFreqs = filter_freqs.length - 2;\n const ret = Array.from({ length: numFreqs }, () => new Array(fft_freqs.length));\n\n for (let j = 0; j < fft_freqs.length; ++j) { // 201\n const slope = slopes[j];\n for (let i = 0; i < numFreqs; ++i) { // 80\n const down = -slope[i] / filter_diff[i];\n const up = slope[i + 2] / filter_diff[i + 1];\n ret[i][j] = Math.max(0, Math.min(down, up));\n }\n }\n return ret;\n}\n\n/**\n * Return evenly spaced numbers over a specified interval.\n * @param {number} start The starting value of the sequence.\n * @param {number} end The end value of the sequence.\n * @param {number} num Number of samples to generate.\n * @returns `num` evenly spaced samples, calculated over the interval `[start, stop]`.\n */\nfunction linspace(start, end, num) {\n const step = (end - start) / (num - 1);\n return Float64Array.from({ length: num }, (_, i) => start + step * i);\n}\n\n/**\n * Creates a frequency bin conversion matrix used to obtain a mel spectrogram. This is called a *mel filter bank*, and\n * various implementation exist, which differ in the number of filters, the shape of the filters, the way the filters\n * are spaced, the bandwidth of the filters, and the manner in which the spectrum is warped. The goal of these\n * features is to approximate the non-linear human perception of the variation in pitch with respect to the frequency.\n * @param {number} num_frequency_bins Number of frequencies used to compute the spectrogram (should be the same as in `stft`).\n * @param {number} num_mel_filters Number of mel filters to generate.\n * @param {number} min_frequency Lowest frequency of interest in Hz.\n * @param {number} max_frequency Highest frequency of interest in Hz. This should not exceed `sampling_rate / 2`.\n * @param {number} sampling_rate Sample rate of the audio waveform.\n * @param {string} [norm] If `\"slaney\"`, divide the triangular mel weights by the width of the mel band (area normalization).\n * @param {string} [mel_scale] The mel frequency scale to use, `\"htk\"` or `\"slaney\"`.\n * @param {boolean} [triangularize_in_mel_space] If this option is enabled, the triangular filter is applied in mel space rather than frequency space.\n * This should be set to `true` in order to get the same results as `torchaudio` when computing mel filters.\n * @returns {number[][]} Triangular filter bank matrix, which is a 2D array of shape (`num_frequency_bins`, `num_mel_filters`).\n * This is a projection matrix to go from a spectrogram to a mel spectrogram.\n */\nexport function mel_filter_bank(\n num_frequency_bins,\n num_mel_filters,\n min_frequency,\n max_frequency,\n sampling_rate,\n norm = null,\n mel_scale = \"htk\",\n triangularize_in_mel_space = false,\n) {\n if (norm !== null && norm !== \"slaney\") {\n throw new Error('norm must be one of null or \"slaney\"');\n }\n\n const mel_min = hertz_to_mel(min_frequency, mel_scale);\n const mel_max = hertz_to_mel(max_frequency, mel_scale);\n const mel_freqs = linspace(mel_min, mel_max, num_mel_filters + 2);\n\n let filter_freqs = mel_to_hertz(mel_freqs, mel_scale);\n let fft_freqs; // frequencies of FFT bins in Hz\n\n if (triangularize_in_mel_space) {\n const fft_bin_width = sampling_rate / (num_frequency_bins * 2);\n fft_freqs = hertz_to_mel(Float64Array.from({ length: num_frequency_bins }, (_, i) => i * fft_bin_width), mel_scale);\n filter_freqs = mel_freqs;\n } else {\n fft_freqs = linspace(0, Math.floor(sampling_rate / 2), num_frequency_bins);\n }\n\n const mel_filters = _create_triangular_filter_bank(fft_freqs, filter_freqs);\n\n if (norm !== null && norm === \"slaney\") {\n // Slaney-style mel is scaled to be approx constant energy per channel\n for (let i = 0; i < num_mel_filters; ++i) {\n const filter = mel_filters[i];\n const enorm = 2.0 / (filter_freqs[i + 2] - filter_freqs[i]);\n for (let j = 0; j < num_frequency_bins; ++j) {\n // Apply this enorm to all frequency bins\n filter[j] *= enorm;\n }\n }\n }\n\n // TODO warn if there is a zero row\n\n return mel_filters;\n\n}\n\n/**\n * @template {Float32Array|Float64Array} T\n * Pads an array with a reflected version of itself on both ends.\n * @param {T} array The array to pad.\n * @param {number} left The amount of padding to add to the left.\n * @param {number} right The amount of padding to add to the right.\n * @returns {T} The padded array.\n */\nfunction padReflect(array, left, right) {\n // @ts-ignore\n const padded = new array.constructor(array.length + left + right);\n const w = array.length - 1;\n\n for (let i = 0; i < array.length; ++i) {\n padded[left + i] = array[i];\n }\n\n for (let i = 1; i <= left; ++i) {\n padded[left - i] = array[calculateReflectOffset(i, w)];\n }\n\n for (let i = 1; i <= right; ++i) {\n padded[w + left + i] = array[calculateReflectOffset(w - i, w)];\n }\n\n return padded;\n}\n\n/**\n * Helper function to compute `amplitude_to_db` and `power_to_db`.\n * @template {Float32Array|Float64Array} T\n * @param {T} spectrogram \n * @param {number} factor \n * @param {number} reference \n * @param {number} min_value \n * @param {number} db_range \n * @returns {T}\n */\nfunction _db_conversion_helper(spectrogram, factor, reference, min_value, db_range) {\n if (reference <= 0) {\n throw new Error('reference must be greater than zero');\n }\n\n if (min_value <= 0) {\n throw new Error('min_value must be greater than zero');\n }\n\n reference = Math.max(min_value, reference);\n\n const logReference = Math.log10(reference);\n for (let i = 0; i < spectrogram.length; ++i) {\n spectrogram[i] = factor * Math.log10(Math.max(min_value, spectrogram[i]) - logReference)\n }\n\n if (db_range !== null) {\n if (db_range <= 0) {\n throw new Error('db_range must be greater than zero');\n }\n const maxValue = max(spectrogram)[0] - db_range;\n for (let i = 0; i < spectrogram.length; ++i) {\n spectrogram[i] = Math.max(spectrogram[i], maxValue);\n }\n }\n\n return spectrogram;\n}\n\n/**\n * Converts an amplitude spectrogram to the decibel scale. This computes `20 * log10(spectrogram / reference)`,\n * using basic logarithm properties for numerical stability. NOTE: Operates in-place.\n * \n * The motivation behind applying the log function on the (mel) spectrogram is that humans do not hear loudness on a\n * linear scale. Generally to double the perceived volume of a sound we need to put 8 times as much energy into it.\n * This means that large variations in energy may not sound all that different if the sound is loud to begin with.\n * This compression operation makes the (mel) spectrogram features match more closely what humans actually hear.\n * \n * @template {Float32Array|Float64Array} T\n * @param {T} spectrogram The input amplitude (mel) spectrogram.\n * @param {number} [reference=1.0] Sets the input spectrogram value that corresponds to 0 dB.\n * For example, use `np.max(spectrogram)` to set the loudest part to 0 dB. Must be greater than zero.\n * @param {number} [min_value=1e-5] The spectrogram will be clipped to this minimum value before conversion to decibels,\n * to avoid taking `log(0)`. The default of `1e-5` corresponds to a minimum of -100 dB. Must be greater than zero.\n * @param {number} [db_range=null] Sets the maximum dynamic range in decibels. For example, if `db_range = 80`, the\n * difference between the peak value and the smallest value will never be more than 80 dB. Must be greater than zero.\n * @returns {T} The modified spectrogram in decibels.\n */\nfunction amplitude_to_db(spectrogram, reference = 1.0, min_value = 1e-5, db_range = null) {\n return _db_conversion_helper(spectrogram, 20.0, reference, min_value, db_range);\n}\n\n/**\n * Converts a power spectrogram to the decibel scale. This computes `10 * log10(spectrogram / reference)`,\n * using basic logarithm properties for numerical stability. NOTE: Operates in-place.\n * \n * The motivation behind applying the log function on the (mel) spectrogram is that humans do not hear loudness on a\n * linear scale. Generally to double the perceived volume of a sound we need to put 8 times as much energy into it.\n * This means that large variations in energy may not sound all that different if the sound is loud to begin with.\n * This compression operation makes the (mel) spectrogram features match more closely what humans actually hear.\n * \n * Based on the implementation of `librosa.power_to_db`.\n * \n * @template {Float32Array|Float64Array} T\n * @param {T} spectrogram The input power (mel) spectrogram. Note that a power spectrogram has the amplitudes squared!\n * @param {number} [reference=1.0] Sets the input spectrogram value that corresponds to 0 dB.\n * For example, use `np.max(spectrogram)` to set the loudest part to 0 dB. Must be greater than zero.\n * @param {number} [min_value=1e-10] The spectrogram will be clipped to this minimum value before conversion to decibels,\n * to avoid taking `log(0)`. The default of `1e-10` corresponds to a minimum of -100 dB. Must be greater than zero.\n * @param {number} [db_range=null] Sets the maximum dynamic range in decibels. For example, if `db_range = 80`, the\n * difference between the peak value and the smallest value will never be more than 80 dB. Must be greater than zero.\n * @returns {T} The modified spectrogram in decibels.\n */\nfunction power_to_db(spectrogram, reference = 1.0, min_value = 1e-10, db_range = null) {\n return _db_conversion_helper(spectrogram, 10.0, reference, min_value, db_range);\n}\n\n/**\n * Calculates a spectrogram over one waveform using the Short-Time Fourier Transform.\n * \n * This function can create the following kinds of spectrograms:\n * - amplitude spectrogram (`power = 1.0`)\n * - power spectrogram (`power = 2.0`)\n * - complex-valued spectrogram (`power = None`)\n * - log spectrogram (use `log_mel` argument)\n * - mel spectrogram (provide `mel_filters`)\n * - log-mel spectrogram (provide `mel_filters` and `log_mel`)\n *\n * In this implementation, the window is assumed to be zero-padded to have the same size as the analysis frame.\n * A padded window can be obtained from `window_function()`. The FFT input buffer may be larger than the analysis frame, \n * typically the next power of two.\n * \n * @param {Float32Array|Float64Array} waveform The input waveform of shape `(length,)`. This must be a single real-valued, mono waveform.\n * @param {Float32Array|Float64Array} window The windowing function to apply of shape `(frame_length,)`, including zero-padding if necessary. The actual window length may be\n * shorter than `frame_length`, but we're assuming the array has already been zero-padded.\n * @param {number} frame_length The length of the analysis frames in samples (a.k.a., `fft_length`).\n * @param {number} hop_length The stride between successive analysis frames in samples.\n * @param {Object} options\n * @param {number} [options.fft_length=null] The size of the FFT buffer in samples. This determines how many frequency bins the spectrogram will have.\n * For optimal speed, this should be a power of two. If `null`, uses `frame_length`.\n * @param {number} [options.power=1.0] If 1.0, returns the amplitude spectrogram. If 2.0, returns the power spectrogram. If `null`, returns complex numbers.\n * @param {boolean} [options.center=true] Whether to pad the waveform so that frame `t` is centered around time `t * hop_length`. If `false`, frame\n * `t` will start at time `t * hop_length`.\n * @param {string} [options.pad_mode=\"reflect\"] Padding mode used when `center` is `true`. Possible values are: `\"constant\"` (pad with zeros),\n * `\"edge\"` (pad with edge values), `\"reflect\"` (pads with mirrored values).\n * @param {boolean} [options.onesided=true] If `true`, only computes the positive frequencies and returns a spectrogram containing `fft_length // 2 + 1`\n * frequency bins. If `false`, also computes the negative frequencies and returns `fft_length` frequency bins.\n * @param {number} [options.preemphasis=null] Coefficient for a low-pass filter that applies pre-emphasis before the DFT.\n * @param {number[][]} [options.mel_filters=null] The mel filter bank of shape `(num_freq_bins, num_mel_filters)`.\n * If supplied, applies this filter bank to create a mel spectrogram.\n * @param {number} [options.mel_floor=1e-10] Minimum value of mel frequency banks.\n * @param {string} [options.log_mel=null] How to convert the spectrogram to log scale. Possible options are:\n * `null` (don't convert), `\"log\"` (take the natural logarithm) `\"log10\"` (take the base-10 logarithm), `\"dB\"` (convert to decibels).\n * Can only be used when `power` is not `null`.\n * @param {number} [options.reference=1.0] Sets the input spectrogram value that corresponds to 0 dB. For example, use `max(spectrogram)[0]` to set\n * the loudest part to 0 dB. Must be greater than zero.\n * @param {number} [options.min_value=1e-10] The spectrogram will be clipped to this minimum value before conversion to decibels, to avoid taking `log(0)`.\n * For a power spectrogram, the default of `1e-10` corresponds to a minimum of -100 dB. For an amplitude spectrogram, the value `1e-5` corresponds to -100 dB.\n * Must be greater than zero.\n * @param {number} [options.db_range=null] Sets the maximum dynamic range in decibels. For example, if `db_range = 80`, the difference between the\n * peak value and the smallest value will never be more than 80 dB. Must be greater than zero.\n * @param {boolean} [options.remove_dc_offset=null] Subtract mean from waveform on each frame, applied before pre-emphasis. This should be set to `true` in\n * order to get the same results as `torchaudio.compliance.kaldi.fbank` when computing mel filters.\n * @param {number} [options.max_num_frames=null] If provided, limits the number of frames to compute to this value.\n * @param {boolean} [options.do_pad=true] If `true`, pads the output spectrogram to have `max_num_frames` frames.\n * @param {boolean} [options.transpose=false] If `true`, the returned spectrogram will have shape `(num_frames, num_frequency_bins/num_mel_filters)`. If `false`, the returned spectrogram will have shape `(num_frequency_bins/num_mel_filters, num_frames)`.\n * @returns {{data: Float32Array, dims: number[]}} Spectrogram of shape `(num_frequency_bins, length)` (regular spectrogram) or shape `(num_mel_filters, length)` (mel spectrogram).\n */\nexport function spectrogram(\n waveform,\n window,\n frame_length,\n hop_length,\n {\n fft_length = null,\n power = 1.0,\n center = true,\n pad_mode = \"reflect\",\n onesided = true,\n preemphasis = null,\n mel_filters = null,\n mel_floor = 1e-10,\n log_mel = null,\n reference = 1.0,\n min_value = 1e-10,\n db_range = null,\n remove_dc_offset = null,\n\n // Custom parameters for efficiency reasons\n max_num_frames = null,\n do_pad = true,\n transpose = false,\n } = {}\n) {\n const window_length = window.length;\n if (fft_length === null) {\n fft_length = frame_length;\n }\n if (frame_length > fft_length) {\n throw Error(`frame_length (${frame_length}) may not be larger than fft_length (${fft_length})`)\n }\n\n if (window_length !== frame_length) {\n throw new Error(`Length of the window (${window_length}) must equal frame_length (${frame_length})`);\n }\n\n if (hop_length <= 0) {\n throw new Error(\"hop_length must be greater than zero\");\n }\n\n if (center) {\n if (pad_mode !== 'reflect') {\n throw new Error(`pad_mode=\"${pad_mode}\" not implemented yet.`)\n }\n const half_window = Math.floor((fft_length - 1) / 2) + 1;\n waveform = padReflect(waveform, half_window, half_window);\n }\n\n // split waveform into frames of frame_length size\n const num_frames = Math.floor(1 + Math.floor((waveform.length - frame_length) / hop_length))\n\n const num_frequency_bins = onesided ? Math.floor(fft_length / 2) + 1 : fft_length\n\n let d1 = num_frames;\n let d1Max = num_frames;\n\n // If maximum number of frames is provided, we must either pad or truncate\n if (max_num_frames !== null) {\n if (max_num_frames > num_frames) { // input is too short, so we pad\n if (do_pad) {\n d1Max = max_num_frames;\n }\n } else { // input is too long, so we truncate\n d1Max = d1 = max_num_frames;\n }\n }\n\n // Preallocate arrays to store output.\n const fft = new FFT(fft_length);\n const inputBuffer = new Float64Array(fft_length);\n const outputBuffer = new Float64Array(fft.outputBufferSize);\n const magnitudes = new Array(d1);\n\n for (let i = 0; i < d1; ++i) {\n // Populate buffer with waveform data\n const offset = i * hop_length;\n for (let j = 0; j < frame_length; ++j) {\n inputBuffer[j] = waveform[offset + j];\n }\n\n if (remove_dc_offset) {\n let sum = 0;\n for (let j = 0; j < frame_length; ++j) {\n sum += inputBuffer[j];\n }\n const mean = sum / frame_length;\n for (let j = 0; j < frame_length; ++j) {\n inputBuffer[j] -= mean;\n }\n }\n\n if (preemphasis !== null) {\n // Done in reverse to avoid copies and distructive modification\n for (let j = frame_length - 1; j >= 1; --j) {\n inputBuffer[j] -= preemphasis * inputBuffer[j - 1];\n }\n inputBuffer[0] *= 1 - preemphasis;\n }\n\n for (let j = 0; j < window.length; ++j) {\n inputBuffer[j] *= window[j];\n }\n\n fft.realTransform(outputBuffer, inputBuffer);\n\n // compute magnitudes\n const row = new Array(num_frequency_bins);\n for (let j = 0; j < row.length; ++j) {\n const j2 = j << 1;\n row[j] = outputBuffer[j2] ** 2 + outputBuffer[j2 + 1] ** 2;\n }\n magnitudes[i] = row;\n }\n\n // TODO what should happen if power is None?\n // https://github.com/huggingface/transformers/issues/27772\n if (power !== null && power !== 2) {\n // slight optimization to not sqrt\n const pow = 2 / power; // we use 2 since we already squared\n for (let i = 0; i < magnitudes.length; ++i) {\n const magnitude = magnitudes[i];\n for (let j = 0; j < magnitude.length; ++j) {\n magnitude[j] **= pow;\n }\n }\n }\n\n // TODO: What if `mel_filters` is null?\n const num_mel_filters = mel_filters.length;\n\n // Only here do we create Float32Array\n const mel_spec = new Float32Array(num_mel_filters * d1Max);\n\n // Perform matrix muliplication:\n // mel_spec = mel_filters @ magnitudes.T\n // - mel_filters.shape=(80, 201)\n // - magnitudes.shape=(3000, 201) => - magnitudes.T.shape=(201, 3000)\n // - mel_spec.shape=(80, 3000)\n const dims = transpose ? [d1Max, num_mel_filters] : [num_mel_filters, d1Max];\n for (let i = 0; i < num_mel_filters; ++i) { // num melfilters (e.g., 80)\n const filter = mel_filters[i];\n for (let j = 0; j < d1; ++j) { // num frames (e.g., 3000)\n const magnitude = magnitudes[j];\n\n let sum = 0;\n for (let k = 0; k < num_frequency_bins; ++k) { // num frequency bins (e.g., 201)\n sum += filter[k] * magnitude[k];\n }\n\n mel_spec[\n transpose\n ? j * num_mel_filters + i\n : i * d1 + j\n ] = Math.max(mel_floor, sum);\n }\n }\n\n if (power !== null && log_mel !== null) {\n const o = Math.min(mel_spec.length, d1 * num_mel_filters);\n switch (log_mel) {\n case 'log':\n for (let i = 0; i < o; ++i) {\n mel_spec[i] = Math.log(mel_spec[i]);\n }\n break;\n case 'log10':\n for (let i = 0; i < o; ++i) {\n mel_spec[i] = Math.log10(mel_spec[i]);\n }\n break;\n case 'dB':\n if (power === 1.0) {\n // NOTE: operates in-place\n amplitude_to_db(mel_spec, reference, min_value, db_range);\n } else if (power === 2.0) {\n power_to_db(mel_spec, reference, min_value, db_range);\n } else {\n throw new Error(`Cannot use log_mel option '${log_mel}' with power ${power}`)\n }\n break;\n default:\n throw new Error(`log_mel must be one of null, 'log', 'log10' or 'dB'. Got '${log_mel}'`);\n }\n }\n\n return { data: mel_spec, dims };\n}\n\n/**\n * Returns an array containing the specified window.\n * @param {number} window_length The length of the window in samples.\n * @param {string} name The name of the window function.\n * @param {Object} options Additional options.\n * @param {boolean} [options.periodic=true] Whether the window is periodic or symmetric.\n * @param {number} [options.frame_length=null] The length of the analysis frames in samples.\n * Provide a value for `frame_length` if the window is smaller than the frame length, so that it will be zero-padded.\n * @param {boolean} [options.center=true] Whether to center the window inside the FFT buffer. Only used when `frame_length` is provided.\n * @returns {Float64Array} The window of shape `(window_length,)` or `(frame_length,)`.\n */\nexport function window_function(window_length, name, {\n periodic = true,\n frame_length = null,\n center = true,\n} = {}) {\n const length = periodic ? window_length + 1 : window_length;\n let window;\n switch (name) {\n case 'boxcar':\n window = new Float64Array(length).fill(1.0);\n break;\n case 'hann':\n case 'hann_window':\n window = hanning(length);\n break;\n case 'povey':\n window = hanning(length).map(x => Math.pow(x, 0.85));\n break;\n default:\n throw new Error(`Unknown window type ${name}.`);\n }\n if (periodic) {\n window = window.subarray(0, window_length);\n }\n if (frame_length === null) {\n return window;\n }\n if (window_length > frame_length) {\n throw new Error(`Length of the window (${window_length}) may not be larger than frame_length (${frame_length})`);\n }\n\n return window;\n}\n","\n/**\n * @file Core utility functions/classes for Transformers.js.\n * \n * These are only used internally, meaning an end-user shouldn't\n * need to access anything here.\n * \n * @module utils/core\n */\n\n/**\n * Helper function to dispatch progress callbacks.\n *\n * @param {Function} progress_callback The progress callback function to dispatch.\n * @param {any} data The data to pass to the progress callback function.\n * @returns {void}\n * @private\n */\nexport function dispatchCallback(progress_callback, data) {\n if (progress_callback) progress_callback(data);\n}\n\n/**\n * Reverses the keys and values of an object.\n *\n * @param {Object} data The object to reverse.\n * @returns {Object} The reversed object.\n * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript\n */\nexport function reverseDictionary(data) {\n // https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript\n return Object.fromEntries(Object.entries(data).map(([key, value]) => [value, key]));\n}\n\n/**\n * Escapes regular expression special characters from a string by replacing them with their escaped counterparts.\n *\n * @param {string} string The string to escape.\n * @returns {string} The escaped string.\n */\nexport function escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/**\n * Check if a value is a typed array.\n * @param {*} val The value to check.\n * @returns {boolean} True if the value is a `TypedArray`, false otherwise.\n * \n * Adapted from https://stackoverflow.com/a/71091338/13989043\n */\nexport function isTypedArray(val) {\n return val?.prototype?.__proto__?.constructor?.name === 'TypedArray';\n}\n\n\n/**\n * Check if a value is an integer.\n * @param {*} x The value to check.\n * @returns {boolean} True if the value is a string, false otherwise.\n */\nexport function isIntegralNumber(x) {\n return Number.isInteger(x) || typeof x === 'bigint'\n}\n\n/**\n * Calculates the dimensions of a nested array.\n *\n * @param {any[]} arr The nested array to calculate dimensions for.\n * @returns {number[]} An array containing the dimensions of the input array.\n */\nexport function calculateDimensions(arr) {\n const dimensions = [];\n let current = arr;\n while (Array.isArray(current)) {\n dimensions.push(current.length);\n current = current[0];\n }\n return dimensions;\n}\n\n/**\n * Replicate python's .pop() method for objects.\n * @param {Object} obj The object to pop from.\n * @param {string} key The key to pop.\n * @param {*} defaultValue The default value to return if the key does not exist.\n * @returns {*} The value of the popped key.\n * @throws {Error} If the key does not exist and no default value is provided.\n */\nexport function pop(obj, key, defaultValue = undefined) {\n const value = obj[key];\n if (value !== undefined) {\n delete obj[key];\n return value;\n }\n if (defaultValue === undefined) {\n throw Error(`Key ${key} does not exist in object.`)\n }\n return defaultValue;\n}\n\n/**\n * Efficiently merge arrays, creating a new copy.\n * Adapted from https://stackoverflow.com/a/6768642/13989043\n * @param {Array[]} arrs Arrays to merge.\n * @returns {Array} The merged array.\n */\nexport function mergeArrays(...arrs) {\n return Array.prototype.concat.apply([], arrs);\n}\n\n/**\n * Compute the Cartesian product of given arrays\n * @param {...Array} a Arrays to compute the product\n * @returns {Array} Returns the computed Cartesian product as an array\n * @private\n */\nexport function product(...a) {\n // Cartesian product of items\n // Adapted from https://stackoverflow.com/a/43053803\n return a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e])));\n}\n\n/**\n * Calculates the index offset for a given index and window size.\n * @param {number} i The index.\n * @param {number} w The window size.\n * @returns {number} The index offset.\n */\nexport function calculateReflectOffset(i, w) {\n return Math.abs((i + w) % (2 * w) - w);\n}\n\n/**\n * \n * @param {Object} o \n * @param {string[]} props \n * @returns {Object}\n */\nexport function pick(o, props) {\n return Object.assign(\n {},\n ...props.map((prop) => {\n if (o[prop] !== undefined) {\n return { [prop]: o[prop] };\n }\n })\n );\n}\n","\n/**\n * @file Custom data structures.\n * \n * These are only used internally, meaning an end-user shouldn't\n * need to access anything here.\n * \n * @module utils/data-structures\n */\n\n\n/**\n * Efficient Heap-based Implementation of a Priority Queue.\n * It uses an array-based binary heap, where the root is at index `0`, and the\n * children of node `i` are located at indices `2i + 1` and `2i + 2`, respectively.\n * \n * Adapted from the following sources:\n * - https://stackoverflow.com/a/42919752/13989043 (original)\n * - https://github.com/belladoreai/llama-tokenizer-js (minor improvements)\n */\nexport class PriorityQueue {\n\n /**\n * Create a new PriorityQueue.\n * @param {Function} comparator Comparator function to determine priority. Defaults to a MaxHeap.\n */\n constructor(comparator = (a, b) => a > b) {\n this._heap = [];\n this._comparator = comparator;\n }\n\n /**\n * The size of the queue\n */\n get size() {\n return this._heap.length;\n }\n\n /**\n * Check if the queue is empty.\n * @returns {boolean} `true` if the queue is empty, `false` otherwise.\n */\n isEmpty() {\n return this.size === 0;\n }\n\n /**\n * Return the element with the highest priority in the queue.\n * @returns {any} The highest priority element in the queue.\n */\n peek() {\n return this._heap[0];\n }\n\n /**\n * Add one or more elements to the queue.\n * @param {...any} values The values to push into the queue.\n * @returns {number} The new size of the queue.\n */\n push(...values) {\n return this.extend(values);\n }\n\n /**\n * Add multiple elements to the queue.\n * @param {any[]} values The values to push into the queue.\n * @returns {number} The new size of the queue.\n */\n extend(values) {\n for (const value of values) {\n this._heap.push(value);\n this._siftUp();\n }\n return this.size;\n }\n\n /**\n * Remove and return the element with the highest priority in the queue.\n * @returns {any} The element with the highest priority in the queue.\n */\n pop() {\n const poppedValue = this.peek();\n const bottom = this.size - 1;\n if (bottom > 0) {\n this._swap(0, bottom);\n }\n this._heap.pop();\n this._siftDown();\n return poppedValue;\n }\n\n /**\n * Replace the element with the highest priority in the queue with a new value.\n * @param {*} value The new value.\n * @returns {*} The replaced value.\n */\n replace(value) {\n const replacedValue = this.peek();\n this._heap[0] = value;\n this._siftDown();\n return replacedValue;\n }\n\n /**\n * Compute the index for the parent of the node at index `i`.\n * @param {number} i The index of the node to get the parent of.\n * @returns {number} The index of the parent node.\n * @private\n */\n _parent(i) {\n return ((i + 1) >>> 1) - 1;\n }\n\n /**\n * Compute the index for the left child of the node at index `i`.\n * @param {number} i The index of the node to get the left child of.\n * @returns {number} The index of the left child.\n * @private\n */\n _left(i) {\n return (i << 1) + 1;\n }\n\n /**\n * Compute the index for the right child of the node at index `i`.\n * @param {number} i The index of the node to get the right child of.\n * @returns {number} The index of the right child.\n * @private\n */\n _right(i) {\n return (i + 1) << 1;\n }\n\n /**\n * Check if the element at index `i` is greater than the element at index `j`.\n * @param {number} i The index of the first element to compare.\n * @param {number} j The index of the second element to compare.\n * @returns {boolean} `true` if the element at index `i` is greater than the element at index `j`, `false` otherwise.\n * @private\n */\n _greater(i, j) {\n return this._comparator(this._heap[i], this._heap[j]);\n }\n\n /**\n * Swap the elements at indices `i` and `j`.\n * @param {number} i The index of the first element to swap.\n * @param {number} j The index of the second element to swap.\n * @private\n */\n _swap(i, j) {\n const temp = this._heap[i];\n this._heap[i] = this._heap[j];\n this._heap[j] = temp;\n }\n\n /**\n * Maintain the heap property by updating positions in the heap,\n * starting at the last element and moving up the heap.\n * @private\n */\n _siftUp() {\n let node = this.size - 1;\n while (node > 0 && this._greater(node, this._parent(node))) {\n this._swap(node, this._parent(node));\n node = this._parent(node);\n }\n }\n /**\n * Maintain the heap property by updating positions in the heap,\n * starting at the first element and moving down the heap.\n * @private\n */\n _siftDown() {\n let node = 0;\n while (\n (this._left(node) < this.size && this._greater(this._left(node), node)) ||\n (this._right(node) < this.size && this._greater(this._right(node), node))\n ) {\n const maxChild = (this._right(node) < this.size && this._greater(this._right(node), this._left(node)))\n ? this._right(node)\n : this._left(node);\n this._swap(node, maxChild);\n node = maxChild;\n }\n }\n}\n\n/**\n * A trie structure to efficiently store and search for strings.\n */\nexport class CharTrie {\n constructor() {\n this.root = CharTrieNode.default();\n }\n\n /**\n * Adds one or more `texts` to the trie.\n * @param {string[]} texts The strings to add to the trie.\n */\n extend(texts) {\n for (let text of texts) {\n this.push(text);\n }\n }\n\n /**\n * Adds text to the trie.\n * @param {string} text The string to add to the trie.\n */\n push(text) {\n let node = this.root;\n for (let ch of text) {\n let child = node.children.get(ch);\n if (child === undefined) {\n child = CharTrieNode.default();\n node.children.set(ch, child);\n }\n node = child;\n }\n node.isLeaf = true;\n }\n\n /**\n * Searches the trie for all strings with a common prefix of `text`.\n * @param {string} text The common prefix to search for.\n * @yields {string} Each string in the trie that has `text` as a prefix.\n */\n *commonPrefixSearch(text) {\n let node = this.root;\n let prefix = \"\";\n for (let i = 0; i < text.length && node !== undefined; ++i) {\n const ch = text[i];\n prefix += ch;\n node = node.children.get(ch);\n if (node !== undefined && node.isLeaf) {\n yield prefix;\n }\n }\n }\n}\n\n/**\n * Represents a node in a character trie.\n */\nclass CharTrieNode {\n /**\n * Create a new CharTrieNode.\n * @param {boolean} isLeaf Whether the node is a leaf node or not.\n * @param {Map} children A map containing the node's children, where the key is a character and the value is a `CharTrieNode`.\n */\n constructor(isLeaf, children) {\n this.isLeaf = isLeaf;\n this.children = children;\n }\n\n /**\n * Returns a new `CharTrieNode` instance with default values.\n * @returns {CharTrieNode} A new `CharTrieNode` instance with `isLeaf` set to `false` and an empty `children` map.\n */\n static default() {\n return new CharTrieNode(false, new Map());\n }\n}\n\n/**\n * A lattice data structure to be used for tokenization.\n */\nexport class TokenLattice {\n /**\n * Creates a new TokenLattice instance.\n *\n * @param {string} sentence The input sentence to be tokenized.\n * @param {number} bosTokenId The beginning-of-sequence token ID.\n * @param {number} eosTokenId The end-of-sequence token ID.\n */\n constructor(sentence, bosTokenId, eosTokenId) {\n this.sentence = sentence;\n this.len = sentence.length;\n this.bosTokenId = bosTokenId;\n this.eosTokenId = eosTokenId;\n this.nodes = [];\n this.beginNodes = Array.from({ length: this.len + 1 }, () => []);\n this.endNodes = Array.from({ length: this.len + 1 }, () => []);\n\n const bos = new TokenLatticeNode(this.bosTokenId, 0, 0, 0, 0.0);\n const eos = new TokenLatticeNode(this.eosTokenId, 1, this.len, 0, 0.0);\n this.nodes.push(bos.clone());\n this.nodes.push(eos.clone());\n this.beginNodes[this.len].push(eos);\n this.endNodes[0].push(bos);\n }\n\n /**\n * Inserts a new token node into the token lattice.\n *\n * @param {number} pos The starting position of the token.\n * @param {number} length The length of the token.\n * @param {number} score The score of the token.\n * @param {number} tokenId The token ID of the token.\n */\n insert(pos, length, score, tokenId) {\n const nodeId = this.nodes.length;\n const node = new TokenLatticeNode(tokenId, nodeId, pos, length, score);\n this.beginNodes[pos].push(node);\n this.endNodes[pos + length].push(node);\n this.nodes.push(node);\n }\n\n /**\n * Implements the Viterbi algorithm to compute the most likely sequence of tokens.\n *\n * @returns {TokenLatticeNode[]} The array of nodes representing the most likely sequence of tokens.\n */\n viterbi() {\n const len = this.len;\n let pos = 0;\n while (pos <= len) {\n if (this.beginNodes[pos].length == 0) {\n return [];\n }\n for (let rnode of this.beginNodes[pos]) {\n rnode.prev = null;\n let bestScore = 0.0;\n let bestNode = null;\n for (let lnode of this.endNodes[pos]) {\n const score = lnode.backtraceScore + rnode.score;\n if (bestNode === null || score > bestScore) {\n bestNode = lnode.clone();\n bestScore = score;\n }\n }\n\n if (bestNode !== null) {\n rnode.prev = bestNode;\n rnode.backtraceScore = bestScore;\n } else {\n return [];\n }\n }\n ++pos;\n }\n\n const results = [];\n const root = this.beginNodes[len][0];\n const prev = root.prev;\n if (prev === null) {\n return [];\n }\n\n let node = prev.clone();\n while (node.prev !== null) {\n results.push(node.clone());\n const n = node.clone();\n node = n.prev.clone();\n }\n\n results.reverse();\n return results;\n }\n\n /**\n * @param {TokenLatticeNode} node\n * @returns {string} The array of nodes representing the most likely sequence of tokens.\n */\n piece(node) {\n return this.sentence.slice(node.pos, node.pos + node.length);\n }\n\n /**\n * @returns {Array} The array of nodes representing the most likely sequence of tokens.\n */\n tokens() {\n const nodes = this.viterbi();\n return nodes.map(x => this.piece(x));\n }\n\n /**\n * @returns {Array} The array of nodes representing the most likely sequence of tokens.\n */\n tokenIds() {\n const nodes = this.viterbi();\n return nodes.map(x => x.tokenId);\n }\n}\nclass TokenLatticeNode {\n /**\n * Represents a node in a token lattice for a given sentence.\n * @param {number} tokenId The ID of the token associated with this node.\n * @param {number} nodeId The ID of this node.\n * @param {number} pos The starting position of the token in the sentence.\n * @param {number} length The length of the token.\n * @param {number} score The score associated with the token.\n */\n constructor(tokenId, nodeId, pos, length, score) {\n this.tokenId = tokenId;\n this.nodeId = nodeId;\n this.pos = pos;\n this.length = length;\n this.score = score;\n this.prev = null;\n this.backtraceScore = 0.0;\n }\n\n /**\n * Returns a clone of this node.\n * @returns {TokenLatticeNode} A clone of this node.\n */\n clone() {\n const n = new TokenLatticeNode(this.tokenId, this.nodeId, this.pos, this.length, this.score);\n n.prev = this.prev;\n n.backtraceScore = this.backtraceScore;\n return n;\n }\n}\n","\nexport const DEVICE_TYPES = Object.freeze({\n cpu: 'cpu',\n gpu: 'gpu',\n wasm: 'wasm',\n webgpu: 'webgpu',\n});\n\n/**\n * @typedef {keyof typeof DEVICE_TYPES} DeviceType\n */\n","import { apis } from \"../env.js\";\n\nimport { DEVICE_TYPES } from \"./devices.js\";\n\n// TODO: Use the adapter from `env.backends.onnx.webgpu.adapter` to check for `shader-f16` support,\n// when available in https://github.com/microsoft/onnxruntime/pull/19940.\n// For more information, see https://github.com/microsoft/onnxruntime/pull/19857#issuecomment-1999984753\n\n/**\n * Checks if fp16 support is available in the current environment.\n */\nexport const isFp16Supported = (function () {\n /** @type {boolean} */\n let cachedResult;\n\n return async function () {\n if (cachedResult === undefined) {\n if (apis.IS_NODE_ENV) {\n cachedResult = true;\n } else if (!apis.IS_WEBGPU_AVAILABLE) {\n cachedResult = false;\n } else {\n try {\n const adapter = await navigator.gpu.requestAdapter();\n cachedResult = adapter.features.has('shader-f16');\n } catch (e) {\n cachedResult = false;\n }\n }\n }\n return cachedResult;\n };\n})();\n\nexport const DATA_TYPES = Object.freeze({\n fp32: 'fp32',\n fp16: 'fp16',\n q8: 'q8',\n int8: 'int8',\n uint8: 'uint8',\n});\n/** @typedef {keyof typeof DATA_TYPES} DataType */\n\nexport const DEFAULT_DEVICE_DTYPE_MAPPING = Object.freeze({\n [DEVICE_TYPES.cpu]: DATA_TYPES.q8,\n [DEVICE_TYPES.gpu]: DATA_TYPES.fp32,\n [DEVICE_TYPES.wasm]: DATA_TYPES.q8,\n [DEVICE_TYPES.webgpu]: DATA_TYPES.fp32,\n});\n\n/** @type {Record} */\nexport const DEFAULT_DTYPE_SUFFIX_MAPPING = Object.freeze({\n [DATA_TYPES.fp32]: '',\n [DATA_TYPES.fp16]: '_fp16',\n [DATA_TYPES.int8]: '_int8',\n [DATA_TYPES.uint8]: '_uint8',\n [DATA_TYPES.q8]: '_quantized',\n});\n","\n/**\n * A base class for creating callable objects.\n * See [here](https://stackoverflow.com/q/76073890) for more information.\n * \n * @type {new () => {(...args: any[]): any, _call(...args: any[]): any}}\n */\nexport const Callable = /** @type {any} */ (class {\n /**\n * Creates a new instance of the Callable class.\n */\n constructor() {\n /**\n * Creates a closure that delegates to a private method '_call' with the given arguments.\n * @type {any}\n * @param {...any} args Zero or more arguments to pass to the '_call' method.\n * @returns {*} The result of calling the '_call' method.\n */\n let closure = function (...args) {\n return closure._call(...args)\n }\n return Object.setPrototypeOf(closure, new.target.prototype)\n }\n\n /**\n * This method should be implemented in subclasses to provide the\n * functionality of the callable object.\n *\n * @param {any[]} args\n * @throws {Error} If the subclass does not implement the `_call` method.\n */\n _call(...args) {\n throw Error('Must implement _call method in subclass')\n }\n});\n","\n/**\n * @file Utility functions to interact with the Hugging Face Hub (https://huggingface.co/models)\n * \n * @module utils/hub\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { env } from '../env.js';\nimport { dispatchCallback } from './core.js';\n\n/**\n * @typedef {Object} PretrainedOptions Options for loading a pretrained model. \n * @property {function} [progress_callback=null] If specified, this function will be called during model construction, to provide the user with progress updates.\n * @property {Object} [config=null] Configuration for the model to use instead of an automatically loaded configuration. Configuration can be automatically loaded when:\n * - The model is a model provided by the library (loaded with the *model id* string of a pretrained model).\n * - The model is loaded by supplying a local directory as `pretrained_model_name_or_path` and a configuration JSON file named *config.json* is found in the directory.\n * @property {string} [cache_dir=null] Path to a directory in which a downloaded pretrained model configuration should be cached if the standard cache should not be used.\n * @property {boolean} [local_files_only=false] Whether or not to only look at local files (e.g., not try downloading the model).\n * @property {string} [revision='main'] The specific model version to use. It can be a branch name, a tag name, or a commit id,\n * since we use a git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any identifier allowed by git.\n * NOTE: This setting is ignored for local requests.\n */\n\n/**\n * @typedef {Object} ModelSpecificPretrainedOptions Options for loading a pretrained model.\n * @property {string} [subfolder='onnx'] In case the relevant files are located inside a subfolder of the model repo on huggingface.co,\n * you can specify the folder name here.\n * @property {string} [model_file_name=null] If specified, load the model with this name (excluding the .onnx suffix). Currently only valid for encoder- or decoder-only models.\n * @property {import(\"./devices.js\").DeviceType|Record} [device=null] The device to run the model on. If not specified, the device will be chosen from the environment settings.\n * @property {import(\"./dtypes.js\").DataType|Record} [dtype=null] The data type to use for the model. If not specified, the data type will be chosen from the environment settings.\n * @property {Object} [session_options] (Optional) User-specified session options passed to the runtime. If not provided, suitable defaults will be chosen.\n */\n\n/**\n * @typedef {PretrainedOptions & ModelSpecificPretrainedOptions} PretrainedModelOptions Options for loading a pretrained model.\n */\n\nclass FileResponse {\n /**\n * Mapping from file extensions to MIME types.\n */\n _CONTENT_TYPE_MAP = {\n 'txt': 'text/plain',\n 'html': 'text/html',\n 'css': 'text/css',\n 'js': 'text/javascript',\n 'json': 'application/json',\n 'png': 'image/png',\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'gif': 'image/gif',\n }\n /**\n * Creates a new `FileResponse` object.\n * @param {string|URL} filePath\n */\n constructor(filePath) {\n this.filePath = filePath;\n this.headers = new Headers();\n\n this.exists = fs.existsSync(filePath);\n if (this.exists) {\n this.status = 200;\n this.statusText = 'OK';\n\n let stats = fs.statSync(filePath);\n this.headers.set('content-length', stats.size.toString());\n\n this.updateContentType();\n\n let self = this;\n this.body = new ReadableStream({\n start(controller) {\n self.arrayBuffer().then(buffer => {\n controller.enqueue(new Uint8Array(buffer));\n controller.close();\n })\n }\n });\n } else {\n this.status = 404;\n this.statusText = 'Not Found';\n this.body = null;\n }\n }\n\n /**\n * Updates the 'content-type' header property of the response based on the extension of\n * the file specified by the filePath property of the current object.\n * @returns {void}\n */\n updateContentType() {\n // Set content-type header based on file extension\n const extension = this.filePath.toString().split('.').pop().toLowerCase();\n this.headers.set('content-type', this._CONTENT_TYPE_MAP[extension] ?? 'application/octet-stream');\n }\n\n /**\n * Clone the current FileResponse object.\n * @returns {FileResponse} A new FileResponse object with the same properties as the current object.\n */\n clone() {\n let response = new FileResponse(this.filePath);\n response.exists = this.exists;\n response.status = this.status;\n response.statusText = this.statusText;\n response.headers = new Headers(this.headers);\n return response;\n }\n\n /**\n * Reads the contents of the file specified by the filePath property and returns a Promise that\n * resolves with an ArrayBuffer containing the file's contents.\n * @returns {Promise} A Promise that resolves with an ArrayBuffer containing the file's contents.\n * @throws {Error} If the file cannot be read.\n */\n async arrayBuffer() {\n const data = await fs.promises.readFile(this.filePath);\n return data.buffer;\n }\n\n /**\n * Reads the contents of the file specified by the filePath property and returns a Promise that\n * resolves with a Blob containing the file's contents.\n * @returns {Promise} A Promise that resolves with a Blob containing the file's contents.\n * @throws {Error} If the file cannot be read.\n */\n async blob() {\n const data = await fs.promises.readFile(this.filePath);\n return new Blob([data], { type: this.headers.get('content-type') });\n }\n\n /**\n * Reads the contents of the file specified by the filePath property and returns a Promise that\n * resolves with a string containing the file's contents.\n * @returns {Promise} A Promise that resolves with a string containing the file's contents.\n * @throws {Error} If the file cannot be read.\n */\n async text() {\n const data = await fs.promises.readFile(this.filePath, 'utf8');\n return data;\n }\n\n /**\n * Reads the contents of the file specified by the filePath property and returns a Promise that\n * resolves with a parsed JavaScript object containing the file's contents.\n * \n * @returns {Promise} A Promise that resolves with a parsed JavaScript object containing the file's contents.\n * @throws {Error} If the file cannot be read.\n */\n async json() {\n return JSON.parse(await this.text());\n }\n}\n\n/**\n * Determines whether the given string is a valid HTTP or HTTPS URL.\n * @param {string|URL} string The string to test for validity as an HTTP or HTTPS URL.\n * @param {string[]} [validHosts=null] A list of valid hostnames. If specified, the URL's hostname must be in this list.\n * @returns {boolean} True if the string is a valid HTTP or HTTPS URL, false otherwise.\n */\nfunction isValidHttpUrl(string, validHosts = null) {\n // https://stackoverflow.com/a/43467144\n let url;\n try {\n url = new URL(string);\n } catch (_) {\n return false;\n }\n if (validHosts && !validHosts.includes(url.hostname)) {\n return false;\n }\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n}\n\n/**\n * Helper function to get a file, using either the Fetch API or FileSystem API.\n *\n * @param {URL|string} urlOrPath The URL/path of the file to get.\n * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API).\n */\nexport async function getFile(urlOrPath) {\n\n if (env.useFS && !isValidHttpUrl(urlOrPath)) {\n return new FileResponse(urlOrPath);\n\n } else if (typeof process !== 'undefined' && process?.release?.name === 'node') {\n const IS_CI = !!process.env?.TESTING_REMOTELY;\n const version = env.version;\n\n const headers = new Headers();\n headers.set('User-Agent', `transformers.js/${version}; is_ci/${IS_CI};`);\n\n // Check whether we are making a request to the Hugging Face Hub.\n const isHFURL = isValidHttpUrl(urlOrPath, ['huggingface.co', 'hf.co']);\n if (isHFURL) {\n // If an access token is present in the environment variables,\n // we add it to the request headers.\n // NOTE: We keep `HF_ACCESS_TOKEN` for backwards compatibility (as a fallback).\n const token = process.env?.HF_TOKEN ?? process.env?.HF_ACCESS_TOKEN;\n if (token) {\n headers.set('Authorization', `Bearer ${token}`);\n }\n }\n return fetch(urlOrPath, { headers });\n } else {\n // Running in a browser-environment, so we use default headers\n // NOTE: We do not allow passing authorization headers in the browser,\n // since this would require exposing the token to the client.\n return fetch(urlOrPath);\n }\n}\n\nconst ERROR_MAPPING = {\n // 4xx errors (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses)\n 400: 'Bad request error occurred while trying to load file',\n 401: 'Unauthorized access to file',\n 403: 'Forbidden access to file',\n 404: 'Could not locate file',\n 408: 'Request timeout error occurred while trying to load file',\n\n // 5xx errors (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses)\n 500: 'Internal server error error occurred while trying to load file',\n 502: 'Bad gateway error occurred while trying to load file',\n 503: 'Service unavailable error occurred while trying to load file',\n 504: 'Gateway timeout error occurred while trying to load file',\n}\n/**\n * Helper method to handle fatal errors that occur while trying to load a file from the Hugging Face Hub.\n * @param {number} status The HTTP status code of the error.\n * @param {string} remoteURL The URL of the file that could not be loaded.\n * @param {boolean} fatal Whether to raise an error if the file could not be loaded.\n * @returns {null} Returns `null` if `fatal = true`.\n * @throws {Error} If `fatal = false`.\n */\nfunction handleError(status, remoteURL, fatal) {\n if (!fatal) {\n // File was not loaded correctly, but it is optional.\n // TODO in future, cache the response?\n return null;\n }\n\n const message = ERROR_MAPPING[status] ?? `Error (${status}) occurred while trying to load file`;\n throw Error(`${message}: \"${remoteURL}\".`);\n}\n\nclass FileCache {\n /**\n * Instantiate a `FileCache` object.\n * @param {string} path \n */\n constructor(path) {\n this.path = path;\n }\n\n /**\n * Checks whether the given request is in the cache.\n * @param {string} request \n * @returns {Promise}\n */\n async match(request) {\n\n let filePath = path.join(this.path, request);\n let file = new FileResponse(filePath);\n\n if (file.exists) {\n return file;\n } else {\n return undefined;\n }\n }\n\n /**\n * Adds the given response to the cache.\n * @param {string} request \n * @param {Response|FileResponse} response \n * @returns {Promise}\n */\n async put(request, response) {\n const buffer = Buffer.from(await response.arrayBuffer());\n\n let outputPath = path.join(this.path, request);\n\n try {\n await fs.promises.mkdir(path.dirname(outputPath), { recursive: true });\n await fs.promises.writeFile(outputPath, buffer);\n\n } catch (err) {\n console.warn('An error occurred while writing the file to cache:', err)\n }\n }\n\n // TODO add the rest?\n // addAll(requests: RequestInfo[]): Promise;\n // delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise;\n // keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>;\n // match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise;\n // matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>;\n}\n\n/**\n * \n * @param {FileCache|Cache} cache The cache to search\n * @param {string[]} names The names of the item to search for\n * @returns {Promise} The item from the cache, or undefined if not found.\n */\nasync function tryCache(cache, ...names) {\n for (let name of names) {\n try {\n let result = await cache.match(name);\n if (result) return result;\n } catch (e) {\n continue;\n }\n }\n return undefined;\n}\n\n/**\n * \n * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API.\n * If the filesystem is available and `env.useCache = true`, the file will be downloaded and cached.\n * \n * @param {string} path_or_repo_id This can be either:\n * - a string, the *model id* of a model repo on huggingface.co.\n * - a path to a *directory* potentially containing the file.\n * @param {string} filename The name of the file to locate in `path_or_repo`.\n * @param {boolean} [fatal=true] Whether to throw an error if the file is not found.\n * @param {PretrainedOptions} [options] An object containing optional parameters.\n * \n * @throws Will throw an error if the file is not found and `fatal` is true.\n * @returns {Promise} A Promise that resolves with the file content as a buffer.\n */\nexport async function getModelFile(path_or_repo_id, filename, fatal = true, options = {}) {\n\n if (!env.allowLocalModels) {\n // User has disabled local models, so we just make sure other settings are correct.\n\n if (options.local_files_only) {\n throw Error(\"Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).\")\n } else if (!env.allowRemoteModels) {\n throw Error(\"Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.\")\n }\n }\n\n // Initiate file retrieval\n dispatchCallback(options.progress_callback, {\n status: 'initiate',\n name: path_or_repo_id,\n file: filename\n })\n\n // First, check if the a caching backend is available\n // If no caching mechanism available, will download the file every time\n let cache;\n if (!cache && env.useBrowserCache) {\n if (typeof caches === 'undefined') {\n throw Error('Browser cache is not available in this environment.')\n }\n try {\n // In some cases, the browser cache may be visible, but not accessible due to security restrictions.\n // For example, when running an application in an iframe, if a user attempts to load the page in\n // incognito mode, the following error is thrown: `DOMException: Failed to execute 'open' on 'CacheStorage':\n // An attempt was made to break through the security policy of the user agent.`\n // So, instead of crashing, we just ignore the error and continue without using the cache.\n cache = await caches.open('transformers-cache');\n } catch (e) {\n console.warn('An error occurred while opening the browser cache:', e);\n }\n }\n\n if (!cache && env.useFSCache) {\n // TODO throw error if not available\n\n // If `cache_dir` is not specified, use the default cache directory\n cache = new FileCache(options.cache_dir ?? env.cacheDir);\n }\n\n if (!cache && env.useCustomCache) {\n // Allow the user to specify a custom cache system.\n if (!env.customCache) {\n throw Error('`env.useCustomCache=true`, but `env.customCache` is not defined.')\n }\n\n // Check that the required methods are defined:\n if (!env.customCache.match || !env.customCache.put) {\n throw new Error(\n \"`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. \" +\n \"For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache\"\n )\n }\n cache = env.customCache;\n }\n\n const revision = options.revision ?? 'main';\n\n let requestURL = pathJoin(path_or_repo_id, filename);\n let localPath = pathJoin(env.localModelPath, requestURL);\n\n let remoteURL = pathJoin(\n env.remoteHost,\n env.remotePathTemplate\n .replaceAll('{model}', path_or_repo_id)\n .replaceAll('{revision}', encodeURIComponent(revision)),\n filename\n );\n\n // Choose cache key for filesystem cache\n // When using the main revision (default), we use the request URL as the cache key.\n // If a specific revision is requested, we account for this in the cache key.\n let fsCacheKey = revision === 'main' ? requestURL : pathJoin(path_or_repo_id, revision, filename);\n\n /** @type {string} */\n let cacheKey;\n let proposedCacheKey = cache instanceof FileCache ? fsCacheKey : remoteURL;\n\n // Whether to cache the final response in the end.\n let toCacheResponse = false;\n\n /** @type {Response|FileResponse|undefined} */\n let response;\n\n if (cache) {\n // A caching system is available, so we try to get the file from it.\n // 1. We first try to get from cache using the local path. In some environments (like deno),\n // non-URL cache keys are not allowed. In these cases, `response` will be undefined.\n // 2. If no response is found, we try to get from cache using the remote URL or file system cache.\n response = await tryCache(cache, localPath, proposedCacheKey);\n }\n\n const cacheHit = response !== undefined;\n\n if (response === undefined) {\n // Caching not available, or file is not cached, so we perform the request\n\n if (env.allowLocalModels) {\n // Accessing local models is enabled, so we try to get the file locally.\n // If request is a valid HTTP URL, we skip the local file check. Otherwise, we try to get the file locally.\n const isURL = isValidHttpUrl(requestURL);\n if (!isURL) {\n try {\n response = await getFile(localPath);\n cacheKey = localPath; // Update the cache key to be the local path\n } catch (e) {\n // Something went wrong while trying to get the file locally.\n // NOTE: error handling is done in the next step (since `response` will be undefined)\n console.warn(`Unable to load from local path \"${localPath}\": \"${e}\"`);\n }\n } else if (options.local_files_only) {\n throw new Error(`\\`local_files_only=true\\`, but attempted to load a remote file from: ${requestURL}.`);\n } else if (!env.allowRemoteModels) {\n throw new Error(`\\`env.allowRemoteModels=false\\`, but attempted to load a remote file from: ${requestURL}.`);\n }\n }\n\n if (response === undefined || response.status === 404) {\n // File not found locally. This means either:\n // - The user has disabled local file access (`env.allowLocalModels=false`)\n // - the path is a valid HTTP url (`response === undefined`)\n // - the path is not a valid HTTP url and the file is not present on the file system or local server (`response.status === 404`)\n\n if (options.local_files_only || !env.allowRemoteModels) {\n // User requested local files only, but the file is not found locally.\n if (fatal) {\n throw Error(`\\`local_files_only=true\\` or \\`env.allowRemoteModels=false\\` and file was not found locally at \"${localPath}\".`);\n } else {\n // File not found, but this file is optional.\n // TODO in future, cache the response?\n return null;\n }\n }\n\n // File not found locally, so we try to download it from the remote server\n response = await getFile(remoteURL);\n\n if (response.status !== 200) {\n return handleError(response.status, remoteURL, fatal);\n }\n\n // Success! We use the proposed cache key from earlier\n cacheKey = proposedCacheKey;\n }\n\n // Only cache the response if:\n toCacheResponse =\n cache // 1. A caching system is available\n && typeof Response !== 'undefined' // 2. `Response` is defined (i.e., we are in a browser-like environment)\n && response instanceof Response // 3. result is a `Response` object (i.e., not a `FileResponse`)\n && response.status === 200 // 4. request was successful (status code 200)\n }\n\n // Start downloading\n dispatchCallback(options.progress_callback, {\n status: 'download',\n name: path_or_repo_id,\n file: filename\n })\n\n const progressInfo = {\n status: 'progress',\n name: path_or_repo_id,\n file: filename\n }\n\n /** @type {Uint8Array} */\n let buffer;\n\n if (!options.progress_callback) {\n // If no progress callback is specified, we can use the `.arrayBuffer()`\n // method to read the response.\n buffer = new Uint8Array(await response.arrayBuffer());\n\n } else if (\n cacheHit // The item is being read from the cache\n &&\n typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) // We are in Firefox\n ) {\n // Due to bug in Firefox, we cannot display progress when loading from cache.\n // Fortunately, since this should be instantaneous, this should not impact users too much.\n buffer = new Uint8Array(await response.arrayBuffer());\n\n // For completeness, we still fire the final progress callback\n dispatchCallback(options.progress_callback, {\n ...progressInfo,\n progress: 100,\n loaded: buffer.length,\n total: buffer.length,\n })\n } else {\n buffer = await readResponse(response, data => {\n dispatchCallback(options.progress_callback, {\n ...progressInfo,\n ...data,\n })\n })\n }\n\n if (\n // Only cache web responses\n // i.e., do not cache FileResponses (prevents duplication)\n toCacheResponse && cacheKey\n &&\n // Check again whether request is in cache. If not, we add the response to the cache\n (await cache.match(cacheKey) === undefined)\n ) {\n // NOTE: We use `new Response(buffer, ...)` instead of `response.clone()` to handle LFS files\n await cache.put(cacheKey, new Response(buffer, {\n headers: response.headers\n }))\n .catch(err => {\n // Do not crash if unable to add to cache (e.g., QuotaExceededError).\n // Rather, log a warning and proceed with execution.\n console.warn(`Unable to add response to browser cache: ${err}.`);\n });\n\n }\n\n dispatchCallback(options.progress_callback, {\n status: 'done',\n name: path_or_repo_id,\n file: filename\n });\n\n return buffer;\n}\n\n/**\n * Fetches a JSON file from a given path and file name.\n *\n * @param {string} modelPath The path to the directory containing the file.\n * @param {string} fileName The name of the file to fetch.\n * @param {boolean} [fatal=true] Whether to throw an error if the file is not found.\n * @param {PretrainedOptions} [options] An object containing optional parameters.\n * @returns {Promise} The JSON data parsed into a JavaScript object.\n * @throws Will throw an error if the file is not found and `fatal` is true.\n */\nexport async function getModelJSON(modelPath, fileName, fatal = true, options = {}) {\n let buffer = await getModelFile(modelPath, fileName, fatal, options);\n if (buffer === null) {\n // Return empty object\n return {}\n }\n\n let decoder = new TextDecoder('utf-8');\n let jsonData = decoder.decode(buffer);\n\n return JSON.parse(jsonData);\n}\n\n/**\n * Read and track progress when reading a Response object\n *\n * @param {any} response The Response object to read\n * @param {function} progress_callback The function to call with progress updates\n * @returns {Promise} A Promise that resolves with the Uint8Array buffer\n */\nasync function readResponse(response, progress_callback) {\n\n const contentLength = response.headers.get('Content-Length');\n if (contentLength === null) {\n console.warn('Unable to determine content-length from response headers. Will expand buffer when needed.')\n }\n let total = parseInt(contentLength ?? '0');\n let buffer = new Uint8Array(total);\n let loaded = 0;\n\n const reader = response.body.getReader();\n async function read() {\n const { done, value } = await reader.read();\n if (done) return;\n\n let newLoaded = loaded + value.length;\n if (newLoaded > total) {\n total = newLoaded;\n\n // Adding the new data will overflow buffer.\n // In this case, we extend the buffer\n let newBuffer = new Uint8Array(total);\n\n // copy contents\n newBuffer.set(buffer);\n\n buffer = newBuffer;\n }\n buffer.set(value, loaded)\n loaded = newLoaded;\n\n const progress = (loaded / total) * 100;\n\n // Call your function here\n progress_callback({\n progress: progress,\n loaded: loaded,\n total: total,\n })\n\n return read();\n }\n\n // Actually read\n await read();\n\n return buffer;\n}\n\n/**\n * Joins multiple parts of a path into a single path, while handling leading and trailing slashes.\n *\n * @param {...string} parts Multiple parts of a path.\n * @returns {string} A string representing the joined path.\n */\nfunction pathJoin(...parts) {\n // https://stackoverflow.com/a/55142565\n parts = parts.map((part, index) => {\n if (index) {\n part = part.replace(new RegExp('^/'), '');\n }\n if (index !== parts.length - 1) {\n part = part.replace(new RegExp('/$'), '');\n }\n return part;\n })\n return parts.join('/');\n}\n","\n/**\n * @file Helper module for image processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/image\n */\n\nimport { getFile } from './hub.js';\nimport { env } from '../env.js';\nimport { Tensor } from './tensor.js';\n\n// Will be empty (or not used) if running in browser or web-worker\nimport sharp from 'sharp';\n\nconst BROWSER_ENV = typeof self !== 'undefined';\nconst WEBWORKER_ENV = BROWSER_ENV && self.constructor.name === 'DedicatedWorkerGlobalScope';\n\nlet createCanvasFunction;\nlet ImageDataClass;\nlet loadImageFunction;\nif (BROWSER_ENV) {\n // Running in browser or web-worker\n createCanvasFunction = (/** @type {number} */ width, /** @type {number} */ height) => {\n if (!self.OffscreenCanvas) {\n throw new Error('OffscreenCanvas not supported by this browser.');\n }\n return new self.OffscreenCanvas(width, height)\n };\n loadImageFunction = self.createImageBitmap;\n ImageDataClass = self.ImageData;\n\n} else if (sharp) {\n // Running in Node.js, electron, or other non-browser environment\n\n loadImageFunction = async (/**@type {sharp.Sharp}*/img) => {\n const metadata = await img.metadata();\n const rawChannels = metadata.channels;\n\n const { data, info } = await img.raw().toBuffer({ resolveWithObject: true });\n\n const newImage = new RawImage(new Uint8ClampedArray(data), info.width, info.height, info.channels);\n if (rawChannels !== undefined && rawChannels !== info.channels) {\n // Make sure the new image has the same number of channels as the input image.\n // This is necessary for grayscale images.\n newImage.convert(rawChannels);\n }\n return newImage;\n }\n\n} else {\n throw new Error('Unable to load image processing library.');\n}\n\n\n// Defined here: https://github.com/python-pillow/Pillow/blob/a405e8406b83f8bfb8916e93971edc7407b8b1ff/src/libImaging/Imaging.h#L262-L268\nconst RESAMPLING_MAPPING = {\n 0: 'nearest',\n 1: 'lanczos',\n 2: 'bilinear',\n 3: 'bicubic',\n 4: 'box',\n 5: 'hamming',\n}\n\n/**\n * Mapping from file extensions to MIME types.\n */\nconst CONTENT_TYPE_MAP = new Map([\n ['png', 'image/png'],\n ['jpg', 'image/jpeg'],\n ['jpeg', 'image/jpeg'],\n ['gif', 'image/gif'],\n]);\n\nexport class RawImage {\n\n /**\n * Create a new `RawImage` object.\n * @param {Uint8ClampedArray|Uint8Array} data The pixel data.\n * @param {number} width The width of the image.\n * @param {number} height The height of the image.\n * @param {1|2|3|4} channels The number of channels.\n */\n constructor(data, width, height, channels) {\n this.data = data;\n this.width = width;\n this.height = height;\n this.channels = channels;\n }\n\n /** \n * Returns the size of the image (width, height).\n * @returns {[number, number]} The size of the image (width, height).\n */\n get size() {\n return [this.width, this.height];\n }\n\n /**\n * Helper method for reading an image from a variety of input types.\n * @param {RawImage|string|URL} input \n * @returns The image object.\n * \n * **Example:** Read image from a URL.\n * ```javascript\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * // RawImage {\n * // \"data\": Uint8ClampedArray [ 25, 25, 25, 19, 19, 19, ... ],\n * // \"width\": 800,\n * // \"height\": 533,\n * // \"channels\": 3\n * // }\n * ```\n */\n static async read(input) {\n if (input instanceof RawImage) {\n return input;\n } else if (typeof input === 'string' || input instanceof URL) {\n return await this.fromURL(input);\n } else {\n throw new Error(`Unsupported input type: ${typeof input}`);\n }\n }\n\n /**\n * Read an image from a canvas.\n * @param {HTMLCanvasElement|OffscreenCanvas} canvas The canvas to read the image from.\n * @returns {RawImage} The image object.\n */\n static fromCanvas(canvas) {\n if (!BROWSER_ENV) {\n throw new Error('fromCanvas() is only supported in browser environments.')\n }\n\n const ctx = canvas.getContext('2d');\n const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;\n return new RawImage(data, canvas.width, canvas.height, 4);\n }\n\n /**\n * Read an image from a URL or file path.\n * @param {string|URL} url The URL or file path to read the image from.\n * @returns {Promise} The image object.\n */\n static async fromURL(url) {\n const response = await getFile(url);\n if (response.status !== 200) {\n throw new Error(`Unable to read image from \"${url}\" (${response.status} ${response.statusText})`);\n }\n const blob = await response.blob();\n return this.fromBlob(blob);\n }\n\n /**\n * Helper method to create a new Image from a blob.\n * @param {Blob} blob The blob to read the image from.\n * @returns {Promise} The image object.\n */\n static async fromBlob(blob) {\n if (BROWSER_ENV) {\n // Running in environment with canvas\n const img = await loadImageFunction(blob);\n\n const ctx = createCanvasFunction(img.width, img.height).getContext('2d');\n\n // Draw image to context\n ctx.drawImage(img, 0, 0);\n\n return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4);\n\n } else {\n // Use sharp.js to read (and possible resize) the image.\n const img = sharp(await blob.arrayBuffer());\n\n return await loadImageFunction(img);\n }\n }\n\n /**\n * Helper method to create a new Image from a tensor\n * @param {Tensor} tensor \n */\n static fromTensor(tensor, channel_format = 'CHW') {\n if (tensor.dims.length !== 3) {\n throw new Error(`Tensor should have 3 dimensions, but has ${tensor.dims.length} dimensions.`);\n }\n\n if (channel_format === 'CHW') {\n tensor = tensor.transpose(1, 2, 0);\n } else if (channel_format === 'HWC') {\n // Do nothing\n } else {\n throw new Error(`Unsupported channel format: ${channel_format}`);\n }\n if (!(tensor.data instanceof Uint8ClampedArray || tensor.data instanceof Uint8Array)) {\n throw new Error(`Unsupported tensor type: ${tensor.type}`);\n }\n switch (tensor.dims[2]) {\n case 1:\n case 2:\n case 3:\n case 4:\n return new RawImage(tensor.data, tensor.dims[1], tensor.dims[0], tensor.dims[2]);\n default:\n throw new Error(`Unsupported number of channels: ${tensor.dims[2]}`);\n }\n }\n\n /**\n * Convert the image to grayscale format.\n * @returns {RawImage} `this` to support chaining.\n */\n grayscale() {\n if (this.channels === 1) {\n return this;\n }\n\n const newData = new Uint8ClampedArray(this.width * this.height * 1);\n switch (this.channels) {\n case 3: // rgb to grayscale\n case 4: // rgba to grayscale\n for (let i = 0, offset = 0; i < this.data.length; i += this.channels) {\n const red = this.data[i];\n const green = this.data[i + 1];\n const blue = this.data[i + 2];\n\n newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue);\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this._update(newData, this.width, this.height, 1);\n }\n\n /**\n * Convert the image to RGB format.\n * @returns {RawImage} `this` to support chaining.\n */\n rgb() {\n if (this.channels === 3) {\n return this;\n }\n\n const newData = new Uint8ClampedArray(this.width * this.height * 3);\n\n switch (this.channels) {\n case 1: // grayscale to rgb\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n }\n break;\n case 4: // rgba to rgb\n for (let i = 0, offset = 0; i < this.data.length; i += 4) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i + 1];\n newData[offset++] = this.data[i + 2];\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this._update(newData, this.width, this.height, 3);\n\n }\n\n /**\n * Convert the image to RGBA format.\n * @returns {RawImage} `this` to support chaining.\n */\n rgba() {\n if (this.channels === 4) {\n return this;\n }\n\n const newData = new Uint8ClampedArray(this.width * this.height * 4);\n\n switch (this.channels) {\n case 1: // grayscale to rgba\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = 255;\n }\n break;\n case 3: // rgb to rgba\n for (let i = 0, offset = 0; i < this.data.length; i += 3) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i + 1];\n newData[offset++] = this.data[i + 2];\n newData[offset++] = 255;\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n\n return this._update(newData, this.width, this.height, 4);\n }\n\n /**\n * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing.\n * @param {number} width The width of the new image.\n * @param {number} height The height of the new image.\n * @param {Object} options Additional options for resizing.\n * @param {0|1|2|3|4|5|string} [options.resample] The resampling method to use.\n * @returns {Promise} `this` to support chaining.\n */\n async resize(width, height, {\n resample = 2,\n } = {}) {\n\n // Ensure resample method is a string\n let resampleMethod = RESAMPLING_MAPPING[resample] ?? resample;\n\n if (BROWSER_ENV) {\n // TODO use `resample` in browser environment\n\n // Store number of channels before resizing\n const numChannels = this.channels;\n\n // Create canvas object for this image\n const canvas = this.toCanvas();\n\n // Actually perform resizing using the canvas API\n const ctx = createCanvasFunction(width, height).getContext('2d');\n\n // Draw image to context, resizing in the process\n ctx.drawImage(canvas, 0, 0, width, height);\n\n // Create image from the resized data\n const resizedImage = new RawImage(ctx.getImageData(0, 0, width, height).data, width, height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data, and resize\n let img = this.toSharp();\n\n switch (resampleMethod) {\n case 'box':\n case 'hamming':\n if (resampleMethod === 'box' || resampleMethod === 'hamming') {\n console.warn(`Resampling method ${resampleMethod} is not yet supported. Using bilinear instead.`);\n resampleMethod = 'bilinear';\n }\n\n case 'nearest':\n case 'bilinear':\n case 'bicubic':\n // Perform resizing using affine transform. \n // This matches how the python Pillow library does it.\n img = img.affine([width / this.width, 0, 0, height / this.height], {\n interpolator: resampleMethod\n });\n break;\n\n case 'lanczos':\n // https://github.com/python-pillow/Pillow/discussions/5519\n // https://github.com/lovell/sharp/blob/main/docs/api-resize.md\n img = img.resize({\n width, height,\n fit: 'fill',\n kernel: 'lanczos3', // PIL Lanczos uses a kernel size of 3 \n });\n break;\n\n default:\n throw new Error(`Resampling method ${resampleMethod} is not supported.`);\n }\n\n return await loadImageFunction(img);\n }\n\n }\n\n async pad([left, right, top, bottom]) {\n left = Math.max(left, 0);\n right = Math.max(right, 0);\n top = Math.max(top, 0);\n bottom = Math.max(bottom, 0);\n\n if (left === 0 && right === 0 && top === 0 && bottom === 0) {\n // No padding needed\n return this;\n }\n\n if (BROWSER_ENV) {\n // Store number of channels before padding\n const numChannels = this.channels;\n\n // Create canvas object for this image\n const canvas = this.toCanvas();\n\n const newWidth = this.width + left + right;\n const newHeight = this.height + top + bottom;\n\n // Create a new canvas of the desired size.\n const ctx = createCanvasFunction(newWidth, newHeight).getContext('2d');\n\n // Draw image to context, padding in the process\n ctx.drawImage(canvas,\n 0, 0, this.width, this.height,\n left, top, newWidth, newHeight\n );\n\n // Create image from the padded data\n const paddedImage = new RawImage(\n ctx.getImageData(0, 0, newWidth, newHeight).data,\n newWidth, newHeight, 4);\n\n // Convert back so that image has the same number of channels as before\n return paddedImage.convert(numChannels);\n\n } else {\n const img = this.toSharp().extend({ left, right, top, bottom });\n return await loadImageFunction(img);\n }\n }\n\n async crop([x_min, y_min, x_max, y_max]) {\n // Ensure crop bounds are within the image\n x_min = Math.max(x_min, 0);\n y_min = Math.max(y_min, 0);\n x_max = Math.min(x_max, this.width - 1);\n y_max = Math.min(y_max, this.height - 1);\n\n // Do nothing if the crop is the entire image\n if (x_min === 0 && y_min === 0 && x_max === this.width - 1 && y_max === this.height - 1) {\n return this;\n }\n\n const crop_width = x_max - x_min + 1;\n const crop_height = y_max - y_min + 1;\n\n if (BROWSER_ENV) {\n // Store number of channels before resizing\n const numChannels = this.channels;\n\n // Create canvas object for this image\n const canvas = this.toCanvas();\n\n // Create a new canvas of the desired size. This is needed since if the \n // image is too small, we need to pad it with black pixels.\n const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d');\n\n // Draw image to context, cropping in the process\n ctx.drawImage(canvas,\n x_min, y_min, crop_width, crop_height,\n 0, 0, crop_width, crop_height\n );\n\n // Create image from the resized data\n const resizedImage = new RawImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data\n const img = this.toSharp().extract({\n left: x_min,\n top: y_min,\n width: crop_width,\n height: crop_height,\n });\n\n return await loadImageFunction(img);\n }\n\n }\n\n async center_crop(crop_width, crop_height) {\n // If the image is already the desired size, return it\n if (this.width === crop_width && this.height === crop_height) {\n return this;\n }\n\n // Determine bounds of the image in the new canvas\n const width_offset = (this.width - crop_width) / 2;\n const height_offset = (this.height - crop_height) / 2;\n\n\n if (BROWSER_ENV) {\n // Store number of channels before resizing\n const numChannels = this.channels;\n\n // Create canvas object for this image\n const canvas = this.toCanvas();\n\n // Create a new canvas of the desired size. This is needed since if the \n // image is too small, we need to pad it with black pixels.\n const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d');\n\n let sourceX = 0;\n let sourceY = 0;\n let destX = 0;\n let destY = 0;\n\n if (width_offset >= 0) {\n sourceX = width_offset;\n } else {\n destX = -width_offset;\n }\n\n if (height_offset >= 0) {\n sourceY = height_offset;\n } else {\n destY = -height_offset;\n }\n\n // Draw image to context, cropping in the process\n ctx.drawImage(canvas,\n sourceX, sourceY, crop_width, crop_height,\n destX, destY, crop_width, crop_height\n );\n\n // Create image from the resized data\n const resizedImage = new RawImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data\n let img = this.toSharp();\n\n if (width_offset >= 0 && height_offset >= 0) {\n // Cropped image lies entirely within the original image\n img = img.extract({\n left: Math.floor(width_offset),\n top: Math.floor(height_offset),\n width: crop_width,\n height: crop_height,\n })\n } else if (width_offset <= 0 && height_offset <= 0) {\n // Cropped image lies entirely outside the original image,\n // so we add padding\n const top = Math.floor(-height_offset);\n const left = Math.floor(-width_offset);\n img = img.extend({\n top: top,\n left: left,\n\n // Ensures the resulting image has the desired dimensions\n right: crop_width - this.width - left,\n bottom: crop_height - this.height - top,\n });\n } else {\n // Cropped image lies partially outside the original image.\n // We first pad, then crop.\n\n let y_padding = [0, 0];\n let y_extract = 0;\n if (height_offset < 0) {\n y_padding[0] = Math.floor(-height_offset);\n y_padding[1] = crop_height - this.height - y_padding[0];\n } else {\n y_extract = Math.floor(height_offset);\n }\n\n let x_padding = [0, 0];\n let x_extract = 0;\n if (width_offset < 0) {\n x_padding[0] = Math.floor(-width_offset);\n x_padding[1] = crop_width - this.width - x_padding[0];\n } else {\n x_extract = Math.floor(width_offset);\n }\n\n img = img.extend({\n top: y_padding[0],\n bottom: y_padding[1],\n left: x_padding[0],\n right: x_padding[1],\n }).extract({\n left: x_extract,\n top: y_extract,\n width: crop_width,\n height: crop_height,\n })\n }\n\n return await loadImageFunction(img);\n }\n }\n\n async toBlob(type = 'image/png', quality = 1) {\n if (!BROWSER_ENV) {\n throw new Error('toBlob() is only supported in browser environments.')\n }\n\n const canvas = this.toCanvas();\n return await canvas.convertToBlob({ type, quality });\n }\n\n toTensor(channel_format = 'CHW') {\n let tensor = new Tensor(\n 'uint8',\n new Uint8Array(this.data),\n [this.height, this.width, this.channels]\n );\n\n if (channel_format === 'HWC') {\n // Do nothing\n } else if (channel_format === 'CHW') { // hwc -> chw\n tensor = tensor.permute(2, 0, 1);\n } else {\n throw new Error(`Unsupported channel format: ${channel_format}`);\n }\n return tensor;\n }\n\n toCanvas() {\n if (!BROWSER_ENV) {\n throw new Error('toCanvas() is only supported in browser environments.')\n }\n\n // Clone, and convert data to RGBA before drawing to canvas.\n // This is because the canvas API only supports RGBA\n const cloned = this.clone().rgba();\n\n // Create canvas object for the cloned image\n const clonedCanvas = createCanvasFunction(cloned.width, cloned.height);\n\n // Draw image to context\n const data = new ImageDataClass(cloned.data, cloned.width, cloned.height);\n clonedCanvas.getContext('2d').putImageData(data, 0, 0);\n\n return clonedCanvas;\n }\n\n /**\n * Helper method to update the image data.\n * @param {Uint8ClampedArray} data The new image data.\n * @param {number} width The new width of the image.\n * @param {number} height The new height of the image.\n * @param {1|2|3|4|null} [channels] The new number of channels of the image.\n * @private\n */\n _update(data, width, height, channels = null) {\n this.data = data;\n this.width = width;\n this.height = height;\n if (channels !== null) {\n this.channels = channels;\n }\n return this;\n }\n\n /**\n * Clone the image\n * @returns {RawImage} The cloned image\n */\n clone() {\n return new RawImage(this.data.slice(), this.width, this.height, this.channels);\n }\n\n /**\n * Helper method for converting image to have a certain number of channels\n * @param {number} numChannels The number of channels. Must be 1, 3, or 4.\n * @returns {RawImage} `this` to support chaining.\n */\n convert(numChannels) {\n if (this.channels === numChannels) return this; // Already correct number of channels\n\n switch (numChannels) {\n case 1:\n this.grayscale();\n break;\n case 3:\n this.rgb();\n break;\n case 4:\n this.rgba();\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this;\n }\n\n /**\n * Save the image to the given path.\n * @param {string} path The path to save the image to.\n */\n async save(path) {\n\n if (BROWSER_ENV) {\n if (WEBWORKER_ENV) {\n throw new Error('Unable to save an image from a Web Worker.')\n }\n\n const extension = path.split('.').pop().toLowerCase();\n const mime = CONTENT_TYPE_MAP.get(extension) ?? 'image/png';\n\n // Convert image to Blob\n const blob = await this.toBlob(mime);\n\n // Convert the canvas content to a data URL\n const dataURL = URL.createObjectURL(blob);\n\n // Create an anchor element with the data URL as the href attribute\n const downloadLink = document.createElement('a');\n downloadLink.href = dataURL;\n\n // Set the download attribute to specify the desired filename for the downloaded image\n downloadLink.download = path;\n\n // Trigger the download\n downloadLink.click();\n\n // Clean up: remove the anchor element from the DOM\n downloadLink.remove();\n\n } else if (!env.useFS) {\n throw new Error('Unable to save the image because filesystem is disabled in this environment.')\n\n } else {\n const img = this.toSharp();\n return await img.toFile(path);\n }\n }\n\n toSharp() {\n if (BROWSER_ENV) {\n throw new Error('toSharp() is only supported in server-side environments.')\n }\n\n return sharp(this.data, {\n raw: {\n width: this.width,\n height: this.height,\n channels: this.channels\n }\n });\n }\n}","\n/**\n * @file Helper module for mathematical processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/maths\n */\n\n/**\n * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray\n * @typedef {BigInt64Array | BigUint64Array} BigTypedArray\n * @typedef {TypedArray | BigTypedArray} AnyTypedArray\n */\n\n/**\n * @param {TypedArray} input\n */\nexport function interpolate_data(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) {\n // TODO use mode and align_corners\n\n // Output image dimensions\n const x_scale = out_width / in_width;\n const y_scale = out_height / in_height;\n\n // Output image\n // @ts-ignore\n const out_img = new input.constructor(out_height * out_width * in_channels);\n\n // Pre-calculate strides\n const inStride = in_height * in_width;\n const outStride = out_height * out_width;\n\n for (let i = 0; i < out_height; ++i) {\n for (let j = 0; j < out_width; ++j) {\n // Calculate output offset\n const outOffset = i * out_width + j;\n\n // Calculate input pixel coordinates\n const x = (j + 0.5) / x_scale - 0.5;\n const y = (i + 0.5) / y_scale - 0.5;\n\n // Calculate the four nearest input pixels\n // We also check if the input pixel coordinates are within the image bounds\n let x1 = Math.floor(x);\n let y1 = Math.floor(y);\n const x2 = Math.min(x1 + 1, in_width - 1);\n const y2 = Math.min(y1 + 1, in_height - 1);\n\n x1 = Math.max(x1, 0);\n y1 = Math.max(y1, 0);\n\n\n // Calculate the fractional distances between the input pixel and the four nearest pixels\n const s = x - x1;\n const t = y - y1;\n\n // Perform bilinear interpolation\n const w1 = (1 - s) * (1 - t);\n const w2 = s * (1 - t);\n const w3 = (1 - s) * t;\n const w4 = s * t;\n\n // Calculate the four nearest input pixel indices\n const yStride = y1 * in_width;\n const xStride = y2 * in_width;\n const idx1 = yStride + x1;\n const idx2 = yStride + x2;\n const idx3 = xStride + x1;\n const idx4 = xStride + x2;\n\n for (let k = 0; k < in_channels; ++k) {\n // Calculate channel offset\n const cOffset = k * inStride;\n\n out_img[k * outStride + outOffset] =\n w1 * input[cOffset + idx1] +\n w2 * input[cOffset + idx2] +\n w3 * input[cOffset + idx3] +\n w4 * input[cOffset + idx4];\n }\n }\n }\n\n return out_img;\n}\n\n\n/**\n * Helper method to permute a `AnyTypedArray` directly\n * @template {AnyTypedArray} T \n * @param {T} array \n * @param {number[]} dims \n * @param {number[]} axes \n * @returns {[T, number[]]} The permuted array and the new shape.\n */\nexport function permute_data(array, dims, axes) {\n // Calculate the new shape of the permuted array\n // and the stride of the original array\n const shape = new Array(axes.length);\n const stride = new Array(axes.length);\n\n for (let i = axes.length - 1, s = 1; i >= 0; --i) {\n stride[i] = s;\n shape[i] = dims[axes[i]];\n s *= shape[i];\n }\n\n // Precompute inverse mapping of stride\n const invStride = axes.map((_, i) => stride[axes.indexOf(i)]);\n\n // Create the permuted array with the new shape\n // @ts-ignore\n const permutedData = new array.constructor(array.length);\n\n // Permute the original array to the new array\n for (let i = 0; i < array.length; ++i) {\n let newIndex = 0;\n for (let j = dims.length - 1, k = i; j >= 0; --j) {\n newIndex += (k % dims[j]) * invStride[j];\n k = Math.floor(k / dims[j]);\n }\n permutedData[newIndex] = array[i];\n }\n\n return [permutedData, shape];\n}\n\n\n/**\n * Compute the softmax of an array of numbers.\n * @template {TypedArray|number[]} T\n * @param {T} arr The array of numbers to compute the softmax of.\n * @returns {T} The softmax array.\n */\nexport function softmax(arr) {\n // Compute the maximum value in the array\n const maxVal = max(arr)[0];\n\n // Compute the exponentials of the array values\n const exps = arr.map(x => Math.exp(x - maxVal));\n\n // Compute the sum of the exponentials\n // @ts-ignore\n const sumExps = exps.reduce((acc, val) => acc + val, 0);\n\n // Compute the softmax values\n const softmaxArr = exps.map(x => x / sumExps);\n\n return /** @type {T} */(softmaxArr);\n}\n\n/**\n * Calculates the logarithm of the softmax function for the input array.\n * @template {TypedArray|number[]} T\n * @param {T} arr The input array to calculate the log_softmax function for.\n * @returns {T} The resulting log_softmax array.\n */\nexport function log_softmax(arr) {\n // Compute the softmax values\n const softmaxArr = softmax(arr);\n\n // Apply log formula to each element\n const logSoftmaxArr = softmaxArr.map(x => Math.log(x));\n\n return /** @type {T} */(logSoftmaxArr);\n}\n\n/**\n * Calculates the dot product of two arrays.\n * @param {number[]} arr1 The first array.\n * @param {number[]} arr2 The second array.\n * @returns {number} The dot product of arr1 and arr2.\n */\nexport function dot(arr1, arr2) {\n let result = 0;\n for (let i = 0; i < arr1.length; ++i) {\n result += arr1[i] * arr2[i];\n }\n return result;\n}\n\n\n/**\n * Get the top k items from an iterable, sorted by descending order\n * @param {any[]|TypedArray} items The items to be sorted\n * @param {number|null} [top_k=0] The number of top items to return (default: 0 = return all)\n * @returns {[number, any][]} The top k items, sorted by descending order\n */\nexport function getTopItems(items, top_k = 0) {\n // if top == 0, return all\n\n items = Array.from(items)\n .map((x, i) => [i, x]) // Get indices ([index, score])\n .sort((a, b) => b[1] - a[1]) // Sort by log probabilities\n\n if (top_k !== null && top_k > 0) {\n items = items.slice(0, top_k); // Get top k items\n }\n\n return items\n}\n\n/**\n * Computes the cosine similarity between two arrays.\n *\n * @param {number[]} arr1 The first array.\n * @param {number[]} arr2 The second array.\n * @returns {number} The cosine similarity between the two arrays.\n */\nexport function cos_sim(arr1, arr2) {\n // Calculate dot product of the two arrays\n const dotProduct = dot(arr1, arr2);\n\n // Calculate the magnitude of the first array\n const magnitudeA = magnitude(arr1);\n\n // Calculate the magnitude of the second array\n const magnitudeB = magnitude(arr2);\n\n // Calculate the cosine similarity\n const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB);\n\n return cosineSimilarity;\n}\n\n/**\n * Calculates the magnitude of a given array.\n * @param {number[]} arr The array to calculate the magnitude of.\n * @returns {number} The magnitude of the array.\n */\nexport function magnitude(arr) {\n return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0));\n}\n\n\n/**\n * Returns the value and index of the minimum element in an array.\n * @param {number[]|TypedArray} arr array of numbers.\n * @returns {number[]} the value and index of the minimum element, of the form: [valueOfMin, indexOfMin]\n * @throws {Error} If array is empty.\n */\nexport function min(arr) {\n if (arr.length === 0) throw Error('Array must not be empty');\n let min = arr[0];\n let indexOfMin = 0;\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] < min) {\n min = arr[i];\n indexOfMin = i;\n }\n }\n return [min, indexOfMin];\n}\n\n\n/**\n * Returns the value and index of the maximum element in an array.\n * @param {number[]|AnyTypedArray} arr array of numbers.\n * @returns {[number, number]} the value and index of the maximum element, of the form: [valueOfMax, indexOfMax]\n * @throws {Error} If array is empty.\n */\nexport function max(arr) {\n if (arr.length === 0) throw Error('Array must not be empty');\n let max = arr[0];\n let indexOfMax = 0;\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] > max) {\n max = arr[i];\n indexOfMax = i;\n }\n }\n return [Number(max), indexOfMax];\n}\n\nfunction isPowerOfTwo(number) {\n // Check if the number is greater than 0 and has only one bit set to 1\n return (number > 0) && ((number & (number - 1)) === 0);\n}\n\n/**\n * Implementation of Radix-4 FFT.\n * \n * P2FFT class provides functionality for performing Fast Fourier Transform on arrays\n * which are a power of two in length.\n * Code adapted from https://www.npmjs.com/package/fft.js\n */\nclass P2FFT {\n /**\n * @param {number} size The size of the input array. Must be a power of two larger than 1.\n * @throws {Error} FFT size must be a power of two larger than 1.\n */\n constructor(size) {\n this.size = size | 0; // convert to a 32-bit signed integer\n if (this.size <= 1 || !isPowerOfTwo(this.size))\n throw new Error('FFT size must be a power of two larger than 1');\n\n this._csize = size << 1;\n\n this.table = new Float64Array(this.size * 2);\n for (let i = 0; i < this.table.length; i += 2) {\n const angle = Math.PI * i / this.size;\n this.table[i] = Math.cos(angle);\n this.table[i + 1] = -Math.sin(angle);\n }\n\n // Find size's power of two\n let power = 0;\n for (let t = 1; this.size > t; t <<= 1)\n ++power;\n\n // Calculate initial step's width:\n // * If we are full radix-4, it is 2x smaller to give inital len=8\n // * Otherwise it is the same as `power` to give len=4\n this._width = power % 2 === 0 ? power - 1 : power;\n\n // Pre-compute bit-reversal patterns\n this._bitrev = new Int32Array(1 << this._width);\n for (let j = 0; j < this._bitrev.length; ++j) {\n this._bitrev[j] = 0;\n for (let shift = 0; shift < this._width; shift += 2) {\n const revShift = this._width - shift - 2;\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\n }\n }\n }\n\n /**\n * Create a complex number array with size `2 * size`\n *\n * @returns {Float64Array} A complex number array with size `2 * size`\n */\n createComplexArray() {\n return new Float64Array(this._csize);\n }\n\n /**\n * Converts a complex number representation stored in a Float64Array to an array of real numbers.\n * \n * @param {Float64Array} complex The complex number representation to be converted.\n * @param {number[]} [storage] An optional array to store the result in.\n * @returns {number[]} An array of real numbers representing the input complex number representation.\n */\n fromComplexArray(complex, storage) {\n const res = storage || new Array(complex.length >>> 1);\n for (let i = 0; i < complex.length; i += 2)\n res[i >>> 1] = complex[i];\n return res;\n }\n\n /**\n * Convert a real-valued input array to a complex-valued output array.\n * @param {Float64Array} input The real-valued input array.\n * @param {Float64Array} [storage] Optional buffer to store the output array.\n * @returns {Float64Array} The complex-valued output array.\n */\n toComplexArray(input, storage) {\n const res = storage || this.createComplexArray();\n for (let i = 0; i < res.length; i += 2) {\n res[i] = input[i >>> 1];\n res[i + 1] = 0;\n }\n return res;\n }\n\n /**\n * Completes the spectrum by adding its mirrored negative frequency components.\n * @param {Float64Array} spectrum The input spectrum.\n * @returns {void}\n */\n completeSpectrum(spectrum) {\n const size = this._csize;\n const half = size >>> 1;\n for (let i = 2; i < half; i += 2) {\n spectrum[size - i] = spectrum[i];\n spectrum[size - i + 1] = -spectrum[i + 1];\n }\n }\n\n /**\n * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer.\n * \n * @param {Float64Array} out The output buffer to store the result.\n * @param {Float64Array} data The input data to transform.\n * \n * @throws {Error} Input and output buffers must be different.\n * \n * @returns {void}\n */\n transform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._transform4(out, data, 1 /* DONE */);\n }\n\n /**\n * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer.\n * The input buffer must contain real values only, while the output buffer will contain complex values. The input and\n * output buffers must be different.\n *\n * @param {Float64Array} out The output buffer.\n * @param {Float64Array} data The input buffer containing real values.\n *\n * @throws {Error} If the input and output buffers are the same.\n */\n realTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._realTransform4(out, data, 1 /* DONE */);\n }\n\n /**\n * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`.\n * The `out` array must be a different buffer than the `data` array. The `out` array will contain the\n * result of the transformation. The `data` array will not be modified.\n * \n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {Float64Array} data The input data to transform.\n * @throws {Error} If `out` and `data` refer to the same buffer.\n * @returns {void}\n */\n inverseTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._transform4(out, data, -1 /* DONE */);\n for (let i = 0; i < out.length; ++i)\n out[i] /= this.size;\n }\n\n /**\n * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data.\n *\n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {Float64Array} data The input buffer of data to be transformed.\n * @param {number} inv A scaling factor to apply to the transform.\n * @returns {void}\n */\n _transform4(out, data, inv) {\n // radix-4 implementation\n\n const size = this._csize;\n\n // Initial step (permute and transform)\n const width = this._width;\n let step = 1 << width;\n let len = (size / step) << 1;\n\n let outOff;\n let t;\n const bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleTransform2(data, out, outOff, off, step);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleTransform4(data, out, outOff, off, step, inv);\n }\n }\n\n // Loop through steps in decreasing order\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n const limit = outOff + quarterLen - 1;\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n const tableBr = this.table[k];\n const tableBi = inv * this.table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = this.table[2 * k];\n const tableCi = inv * this.table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = this.table[3 * k];\n const tableDi = inv * this.table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = Ar + MCr;\n const T0i = Ai + MCi;\n const T1r = Ar - MCr;\n const T1i = Ai - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n out[A] = T0r + T2r;\n out[A + 1] = T0i + T2i;\n out[B] = T1r + T3i;\n out[B + 1] = T1i - T3r;\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n out[D] = T1r - T3i;\n out[D + 1] = T1i + T3r;\n }\n }\n }\n }\n\n /**\n * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data.\n *\n * @param {Float64Array} data The input buffer of data to be transformed.\n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {number} outOff The offset at which to write the output data.\n * @param {number} off The offset at which to begin reading the input data.\n * @param {number} step The step size for indexing the input data.\n * @returns {void}\n */\n _singleTransform2(data, out, outOff, off, step) {\n // radix-2 implementation\n // NOTE: Only called for len=4\n\n const evenR = data[off];\n const evenI = data[off + 1];\n const oddR = data[off + step];\n const oddI = data[off + step + 1];\n\n out[outOff] = evenR + oddR;\n out[outOff + 1] = evenI + oddI;\n out[outOff + 2] = evenR - oddR;\n out[outOff + 3] = evenI - oddI;\n }\n\n /**\n * Performs radix-4 transformation on input data of length 8\n *\n * @param {Float64Array} data Input data array of length 8\n * @param {Float64Array} out Output data array of length 8\n * @param {number} outOff Index of output array to start writing from\n * @param {number} off Index of input array to start reading from\n * @param {number} step Step size between elements in input array\n * @param {number} inv Scaling factor for inverse transform\n * \n * @returns {void}\n */\n _singleTransform4(data, out, outOff, off, step, inv) {\n // radix-4\n // NOTE: Only called for len=8\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Ai = data[off + 1];\n const Br = data[off + step];\n const Bi = data[off + step + 1];\n const Cr = data[off + step2];\n const Ci = data[off + step2 + 1];\n const Dr = data[off + step3];\n const Di = data[off + step3 + 1];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T0i = Ai + Ci;\n const T1r = Ar - Cr;\n const T1i = Ai - Ci;\n const T2r = Br + Dr;\n const T2i = Bi + Di;\n const T3r = inv * (Br - Dr);\n const T3i = inv * (Bi - Di);\n\n // Final values\n out[outOff] = T0r + T2r;\n out[outOff + 1] = T0i + T2i;\n out[outOff + 2] = T1r + T3i;\n out[outOff + 3] = T1i - T3r;\n out[outOff + 4] = T0r - T2r;\n out[outOff + 5] = T0i - T2i;\n out[outOff + 6] = T1r - T3i;\n out[outOff + 7] = T1i + T3r;\n }\n\n /**\n * Real input radix-4 implementation\n * @param {Float64Array} out Output array for the transformed data\n * @param {Float64Array} data Input array of real data to be transformed\n * @param {number} inv The scale factor used to normalize the inverse transform\n */\n _realTransform4(out, data, inv) {\n // Real input radix-4 implementation\n const size = this._csize;\n\n // Initial step (permute and transform)\n const width = this._width;\n let step = 1 << width;\n let len = (size / step) << 1;\n\n let outOff;\n let t;\n const bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv);\n }\n }\n\n // TODO: Optimize once https://github.com/indutny/fft.js/issues/25 is fixed\n // Loop through steps in decreasing order\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n const limit = outOff + quarterLen - 1;\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n const tableBr = this.table[k];\n const tableBi = inv * this.table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = this.table[2 * k];\n const tableCi = inv * this.table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = this.table[3 * k];\n const tableDi = inv * this.table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = Ar + MCr;\n const T0i = Ai + MCi;\n const T1r = Ar - MCr;\n const T1i = Ai - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n out[A] = T0r + T2r;\n out[A + 1] = T0i + T2i;\n out[B] = T1r + T3i;\n out[B + 1] = T1i - T3r;\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n out[D] = T1r - T3i;\n out[D + 1] = T1i + T3r;\n }\n }\n }\n }\n\n /**\n * Performs a single real input radix-2 transformation on the provided data\n * \n * @param {Float64Array} data The input data array\n * @param {Float64Array} out The output data array\n * @param {number} outOff The output offset\n * @param {number} off The input offset\n * @param {number} step The step\n * \n * @returns {void}\n */\n _singleRealTransform2(data, out, outOff, off, step) {\n // radix-2 implementation\n // NOTE: Only called for len=4\n\n const evenR = data[off];\n const oddR = data[off + step];\n\n out[outOff] = evenR + oddR;\n out[outOff + 1] = 0;\n out[outOff + 2] = evenR - oddR;\n out[outOff + 3] = 0;\n }\n\n /**\n * Computes a single real-valued transform using radix-4 algorithm.\n * This method is only called for len=8.\n *\n * @param {Float64Array} data The input data array.\n * @param {Float64Array} out The output data array.\n * @param {number} outOff The offset into the output array.\n * @param {number} off The offset into the input array.\n * @param {number} step The step size for the input array.\n * @param {number} inv The value of inverse.\n */\n _singleRealTransform4(data, out, outOff, off, step, inv) {\n // radix-4\n // NOTE: Only called for len=8\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Br = data[off + step];\n const Cr = data[off + step2];\n const Dr = data[off + step3];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T1r = Ar - Cr;\n const T2r = Br + Dr;\n const T3r = inv * (Br - Dr);\n\n // Final values\n out[outOff] = T0r + T2r;\n out[outOff + 1] = 0;\n out[outOff + 2] = T1r;\n out[outOff + 3] = -T3r;\n out[outOff + 4] = T0r - T2r;\n out[outOff + 5] = 0;\n out[outOff + 6] = T1r;\n out[outOff + 7] = T3r;\n }\n}\n\n/**\n * NP2FFT class provides functionality for performing Fast Fourier Transform on arrays\n * which are not a power of two in length. In such cases, the chirp-z transform is used.\n * \n * For more information, see: https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156\n */\nclass NP2FFT {\n\n /**\n * Constructs a new NP2FFT object.\n * @param {number} fft_length The length of the FFT\n */\n constructor(fft_length) {\n // Helper variables\n const a = 2 * (fft_length - 1);\n const b = 2 * (2 * fft_length - 1);\n const nextP2 = 2 ** (Math.ceil(Math.log2(b)))\n this.bufferSize = nextP2;\n this._a = a;\n\n // Define buffers\n // Compute chirp for transform\n const chirp = new Float64Array(b);\n const ichirp = new Float64Array(nextP2);\n this._chirpBuffer = new Float64Array(nextP2);\n this._buffer1 = new Float64Array(nextP2);\n this._buffer2 = new Float64Array(nextP2);\n this._outBuffer1 = new Float64Array(nextP2);\n this._outBuffer2 = new Float64Array(nextP2);\n\n // Compute complex exponentiation\n const theta = -2 * Math.PI / fft_length;\n const baseR = Math.cos(theta);\n const baseI = Math.sin(theta);\n\n // Precompute helper for chirp-z transform\n for (let i = 0; i < b >> 1; ++i) {\n // Compute complex power:\n const e = (i + 1 - fft_length) ** 2 / 2.0;\n\n // Compute the modulus and argument of the result\n const result_mod = Math.sqrt(baseR ** 2 + baseI ** 2) ** e;\n const result_arg = e * Math.atan2(baseI, baseR);\n\n // Convert the result back to rectangular form\n // and assign to chirp and ichirp\n const i2 = 2 * i;\n chirp[i2] = result_mod * Math.cos(result_arg);\n chirp[i2 + 1] = result_mod * Math.sin(result_arg);\n\n // conjugate\n ichirp[i2] = chirp[i2];\n ichirp[i2 + 1] = - chirp[i2 + 1];\n }\n this._slicedChirpBuffer = chirp.subarray(a, b);\n\n // create object to perform Fast Fourier Transforms\n // with `nextP2` complex numbers\n this._f = new P2FFT(nextP2 >> 1);\n this._f.transform(this._chirpBuffer, ichirp);\n }\n\n _transform(output, input, real) {\n const ib1 = this._buffer1;\n const ib2 = this._buffer2;\n const ob2 = this._outBuffer1;\n const ob3 = this._outBuffer2;\n const cb = this._chirpBuffer;\n const sb = this._slicedChirpBuffer;\n const a = this._a;\n\n if (real) {\n // Real multiplication\n for (let j = 0; j < sb.length; j += 2) {\n const j2 = j + 1\n const j3 = j >> 1;\n\n const a_real = input[j3];\n ib1[j] = a_real * sb[j];\n ib1[j2] = a_real * sb[j2];\n }\n } else {\n // Complex multiplication\n for (let j = 0; j < sb.length; j += 2) {\n const j2 = j + 1\n ib1[j] = input[j] * sb[j] - input[j2] * sb[j2];\n ib1[j2] = input[j] * sb[j2] + input[j2] * sb[j];\n }\n }\n this._f.transform(ob2, ib1);\n\n for (let j = 0; j < cb.length; j += 2) {\n const j2 = j + 1;\n\n ib2[j] = ob2[j] * cb[j] - ob2[j2] * cb[j2];\n ib2[j2] = ob2[j] * cb[j2] + ob2[j2] * cb[j];\n }\n this._f.inverseTransform(ob3, ib2);\n\n for (let j = 0; j < ob3.length; j += 2) {\n const a_real = ob3[j + a];\n const a_imag = ob3[j + a + 1];\n const b_real = sb[j];\n const b_imag = sb[j + 1];\n\n output[j] = a_real * b_real - a_imag * b_imag;\n output[j + 1] = a_real * b_imag + a_imag * b_real;\n }\n }\n\n transform(output, input) {\n this._transform(output, input, false);\n }\n\n realTransform(output, input) {\n this._transform(output, input, true);\n }\n}\n\nexport class FFT {\n constructor(fft_length) {\n this.fft_length = fft_length;\n this.isPowerOfTwo = isPowerOfTwo(fft_length);\n if (this.isPowerOfTwo) {\n this.fft = new P2FFT(fft_length);\n this.outputBufferSize = 2 * fft_length;\n } else {\n this.fft = new NP2FFT(fft_length);\n this.outputBufferSize = this.fft.bufferSize;\n }\n }\n\n realTransform(out, input) {\n this.fft.realTransform(out, input);\n }\n\n transform(out, input) {\n this.fft.transform(out, input);\n }\n}\n\n\n/**\n * Performs median filter on the provided data. Padding is done by mirroring the data.\n * @param {AnyTypedArray} data The input array\n * @param {number} windowSize The window size\n */\nexport function medianFilter(data, windowSize) {\n\n if (windowSize % 2 === 0 || windowSize <= 0) {\n throw new Error('Window size must be a positive odd number');\n }\n\n // @ts-ignore\n const outputArray = new data.constructor(data.length);\n\n // @ts-ignore\n const buffer = new data.constructor(windowSize); // Reusable array for storing values\n\n const halfWindowSize = Math.floor(windowSize / 2);\n\n for (let i = 0; i < data.length; ++i) {\n let valuesIndex = 0;\n\n for (let j = -halfWindowSize; j <= halfWindowSize; ++j) {\n let index = i + j;\n if (index < 0) {\n index = Math.abs(index);\n } else if (index >= data.length) {\n index = 2 * (data.length - 1) - index;\n }\n\n buffer[valuesIndex++] = data[index];\n }\n\n buffer.sort();\n outputArray[i] = buffer[halfWindowSize];\n }\n\n return outputArray;\n}\n\n/**\n * Helper function to round a number to a given number of decimals\n * @param {number} num The number to round\n * @param {number} decimals The number of decimals\n * @returns {number} The rounded number\n */\nexport function round(num, decimals) {\n const pow = Math.pow(10, decimals);\n return Math.round(num * pow) / pow;\n}\n\n/**\n * Helper function to round a number to the nearest integer, with ties rounded to the nearest even number.\n * Also known as \"bankers' rounding\". This is the default rounding mode in python. For example:\n * 1.5 rounds to 2 and 2.5 rounds to 2.\n * \n * @param {number} x The number to round\n * @returns {number} The rounded number\n */\nexport function bankers_round(x) {\n const r = Math.round(x);\n const br = Math.abs(x) % 1 === 0.5 ? (r % 2 === 0 ? r : r - 1) : r;\n return br;\n}\n","/**\n * @file Helper module for `Tensor` processing.\n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/tensor\n */\n\nimport {\n interpolate_data,\n permute_data\n} from './maths.js';\n\nimport {\n Tensor as ONNXTensor, isONNXTensor,\n} from '../backends/onnx.js';\n\nimport { TensorOpRegistry } from '../ops/registry.js';\n\nconst DataTypeMap = Object.freeze({\n float32: Float32Array,\n float16: Uint16Array,\n float64: Float64Array,\n string: Array, // string[]\n int8: Int8Array,\n uint8: Uint8Array,\n int16: Int16Array,\n uint16: Uint16Array,\n int32: Int32Array,\n uint32: Uint32Array,\n int64: BigInt64Array,\n uint64: BigUint64Array,\n bool: Uint8Array,\n});\n\n/**\n * @typedef {keyof typeof DataTypeMap} DataType\n * @typedef {import('./maths.js').AnyTypedArray | any[]} DataArray\n */\n\n\nexport class Tensor {\n /** @type {number[]} Dimensions of the tensor. */\n get dims() {\n // @ts-ignore\n return this.ort_tensor.dims;\n }\n set dims(value) {\n // FIXME: ONNXTensor declares dims as readonly so one needs to use the constructor() if dims change.\n // @ts-ignore\n this.ort_tensor.dims = value;\n }\n\n /** @type {DataType} Type of the tensor. */\n get type() {\n return this.ort_tensor.type;\n };\n\n /** @type {DataArray} The data stored in the tensor. */\n get data() {\n return this.ort_tensor.data;\n }\n\n /** @type {number} The number of elements in the tensor. */\n get size() {\n return this.ort_tensor.size;\n };\n\n ort_tensor;\n\n /**\n * Create a new Tensor or copy an existing Tensor.\n * @param {[DataType, DataArray, number[]]|[ONNXTensor]} args\n */\n constructor(...args) {\n if (isONNXTensor(args[0])) {\n this.ort_tensor = /** @type {ONNXTensor} */ (args[0]);\n } else {\n // Create new tensor\n this.ort_tensor = new ONNXTensor(\n /** @type {DataType} */(args[0]),\n /** @type {Exclude} */(args[1]),\n args[2]\n );\n }\n\n return new Proxy(this, {\n get: (obj, key) => {\n if (typeof key === 'string') {\n let index = Number(key);\n if (Number.isInteger(index)) {\n // key is an integer (i.e., index)\n return obj._getitem(index);\n }\n }\n // @ts-ignore\n return obj[key];\n },\n set: (obj, key, value) => {\n // TODO allow setting of data\n\n // @ts-ignore\n return obj[key] = value;\n }\n });\n }\n\n dispose() {\n this.ort_tensor.dispose();\n // this.ort_tensor = undefined;\n }\n\n /**\n * Returns an iterator object for iterating over the tensor data in row-major order.\n * If the tensor has more than one dimension, the iterator will yield subarrays.\n * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order.\n */\n *[Symbol.iterator]() {\n const [iterLength, ...iterDims] = this.dims;\n\n if (iterDims.length > 0) {\n const iterSize = iterDims.reduce((a, b) => a * b);\n for (let i = 0; i < iterLength; ++i) {\n yield this._subarray(i, iterSize, iterDims);\n }\n } else {\n yield* this.data\n }\n\n }\n\n /**\n * Index into a Tensor object.\n * @param {number} index The index to access.\n * @returns {Tensor} The data at the specified index.\n */\n _getitem(index) {\n const [iterLength, ...iterDims] = this.dims;\n\n index = safeIndex(index, iterLength);\n\n if (iterDims.length > 0) {\n const iterSize = iterDims.reduce((a, b) => a * b);\n return this._subarray(index, iterSize, iterDims);\n } else {\n return new Tensor(this.type, [this.data[index]], iterDims);\n }\n }\n\n /**\n * @param {number|bigint} item The item to search for in the tensor\n * @returns {number} The index of the first occurrence of item in the tensor data.\n */\n indexOf(item) {\n const this_data = this.data;\n for (let index = 0; index < this_data.length; ++index) {\n // Note: == instead of === so we can match Ints with BigInts\n if (this_data[index] == item) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * @param {number} index \n * @param {number} iterSize \n * @param {any} iterDims \n * @returns {Tensor}\n */\n _subarray(index, iterSize, iterDims) {\n const o1 = index * iterSize;\n const o2 = (index + 1) * iterSize;\n\n // We use subarray if available (typed array), otherwise we use slice (normal array)\n const data =\n ('subarray' in this.data)\n ? this.data.subarray(o1, o2)\n : this.data.slice(o1, o2);\n return new Tensor(this.type, data, iterDims);\n }\n\n /**\n * Returns the value of this tensor as a standard JavaScript Number. This only works\n * for tensors with one element. For other cases, see `Tensor.tolist()`.\n * @returns {number|bigint} The value of this tensor as a standard JavaScript Number.\n * @throws {Error} If the tensor has more than one element.\n */\n item() {\n const this_data = this.data;\n if (this_data.length !== 1) {\n throw new Error(`a Tensor with ${this_data.length} elements cannot be converted to Scalar`);\n }\n return this_data[0];\n }\n\n /**\n * Convert tensor data to a n-dimensional JS list\n * @returns {Array}\n */\n tolist() {\n return reshape(this.data, this.dims)\n }\n\n /**\n * Return a new Tensor with the sigmoid function applied to each element.\n * @returns {Tensor} The tensor with the sigmoid function applied.\n */\n sigmoid() {\n return this.clone().sigmoid_();\n }\n\n /**\n * Applies the sigmoid function to the tensor in place.\n * @returns {Tensor} Returns `this`.\n */\n sigmoid_() {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] = 1 / (1 + Math.exp(-this_data[i]));\n }\n return this;\n }\n\n /**\n * Return a new Tensor with every element multiplied by a constant.\n * @param {number} val The value to multiply by.\n * @returns {Tensor} The new tensor.\n */\n mul(val) {\n return this.clone().mul_(val);\n }\n\n /**\n * Multiply the tensor by a constant in place.\n * @param {number} val The value to multiply by.\n * @returns {Tensor} Returns `this`.\n */\n mul_(val) {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] *= val;\n }\n return this;\n }\n\n /**\n * Return a new Tensor with every element added by a constant.\n * @param {number} val The value to add by.\n * @returns {Tensor} The new tensor.\n */\n add(val) {\n return this.clone().add_(val);\n }\n\n /**\n * Add the tensor by a constant in place.\n * @param {number} val The value to add by.\n * @returns {Tensor} Returns `this`.\n */\n add_(val) {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] += val;\n }\n return this;\n }\n\n clone() {\n return new Tensor(this.type, this.data.slice(), this.dims.slice());\n }\n\n slice(...slices) {\n // This allows for slicing with ranges and numbers\n let newTensorDims = [];\n let newOffsets = [];\n\n // slices is an array of numbers or arrays of numbers\n // e.g., slices = [0, [1, 3], null, [0, 3]]\n for (let sliceIndex = 0; sliceIndex < this.dims.length; ++sliceIndex) {\n let slice = slices[sliceIndex];\n\n if (slice === null || slice === undefined) {\n // null or undefined means take the whole dimension\n newOffsets.push([0, this.dims[sliceIndex]]);\n newTensorDims.push(this.dims[sliceIndex]);\n\n } else if (typeof slice === 'number') {\n slice = safeIndex(slice, this.dims[sliceIndex], sliceIndex);\n\n // A number means take a single element\n newOffsets.push([slice, slice + 1]);\n\n } else if (Array.isArray(slice) && slice.length === 2) {\n // An array of length 2 means take a range of elements\n\n if (slice[0] > slice[1]) {\n throw new Error(`Invalid slice: ${slice}`);\n }\n\n let offsets = [\n Math.max(slice[0], 0),\n Math.min(slice[1], this.dims[sliceIndex])\n ];\n\n newOffsets.push(offsets);\n newTensorDims.push(offsets[1] - offsets[0]);\n\n } else {\n throw new Error(`Invalid slice: ${slice}`);\n }\n }\n\n let newDims = newOffsets.map(([start, end]) => end - start);\n let newBufferSize = newDims.reduce((a, b) => a * b);\n\n const this_data = this.data;\n // Allocate memory\n // @ts-ignore\n let data = new this_data.constructor(newBufferSize);\n\n // Precompute strides\n const stride = this.stride();\n\n for (let i = 0; i < newBufferSize; ++i) {\n let originalIndex = 0;\n for (let j = newDims.length - 1, num = i; j >= 0; --j) {\n const size = newDims[j];\n originalIndex += ((num % size) + newOffsets[j][0]) * stride[j];\n num = Math.floor(num / size);\n }\n data[i] = this_data[originalIndex];\n }\n return new Tensor(this.type, data, newTensorDims);\n\n }\n\n /**\n * Return a permuted version of this Tensor, according to the provided dimensions.\n * @param {...number} dims Dimensions to permute.\n * @returns {Tensor} The permuted tensor.\n */\n permute(...dims) {\n return permute(this, dims);\n }\n\n // TODO: implement transpose. For now (backwards compatibility), it's just an alias for permute()\n transpose(...dims) {\n return this.permute(...dims);\n }\n\n // TODO add .max() and .min() methods\n\n /**\n * Returns the sum of each row of the input tensor in the given dimension dim.\n * \n * @param {number} [dim=null] The dimension or dimensions to reduce. If `null`, all dimensions are reduced.\n * @param {boolean} keepdim Whether the output tensor has `dim` retained or not.\n * @returns The summed tensor\n */\n sum(dim = null, keepdim = false) {\n return this.norm(1, dim, keepdim);\n }\n\n /**\n * Returns the matrix norm or vector norm of a given tensor.\n * @param {number|string} [p='fro'] The order of norm\n * @param {number} [dim=null] Specifies which dimension of the tensor to calculate the norm across.\n * If dim is None, the norm will be calculated across all dimensions of input.\n * @param {boolean} [keepdim=false] Whether the output tensors have dim retained or not.\n * @returns {Tensor} The norm of the tensor.\n */\n norm(p = 'fro', dim = null, keepdim = false) {\n if (p === 'fro') {\n // NOTE: Since we only support integer dims, Frobenius norm produces the same result as p=2.\n p = 2;\n } else if (typeof p === 'string') {\n throw Error(`Unsupported norm: ${p}`);\n }\n\n const this_data = this.data;\n\n if (dim === null) {\n // @ts-ignore\n let val = this_data.reduce((a, b) => a + (b ** p), 0) ** (1 / p);\n return new Tensor(this.type, [val], []);\n }\n\n // Negative indexing\n dim = safeIndex(dim, this.dims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = this.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new this_data.constructor(this_data.length / this.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < this_data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = this.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = this.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += (this_data[i]) ** p;\n }\n\n if (p !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] ** (1 / p);\n }\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n return new Tensor(this.type, result, resultDims);\n }\n\n /**\n * Performs `L_p` normalization of inputs over specified dimension. Operates in place.\n * @param {number} [p=2] The exponent value in the norm formulation\n * @param {number} [dim=1] The dimension to reduce\n * @returns {Tensor} `this` for operation chaining.\n */\n normalize_(p = 2.0, dim = 1) {\n dim = safeIndex(dim, this.dims.length);\n\n const norm = this.norm(p, dim, true);\n\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = this.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = this.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= this.dims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Divide by normalized value\n this_data[i] /= norm.data[resultIndex];\n }\n\n return this;\n }\n\n /**\n * Performs `L_p` normalization of inputs over specified dimension.\n * @param {number} [p=2] The exponent value in the norm formulation\n * @param {number} [dim=1] The dimension to reduce\n * @returns {Tensor} The normalized tensor.\n */\n normalize(p = 2.0, dim = 1) {\n return this.clone().normalize_(p, dim);\n }\n\n /**\n * Compute and return the stride of this tensor.\n * Stride is the jump necessary to go from one element to the next one in the specified dimension dim.\n * @returns {number[]} The stride of this tensor.\n */\n stride() {\n return dimsToStride(this.dims);\n }\n\n /**\n * Returns a tensor with all specified dimensions of input of size 1 removed.\n * \n * NOTE: The returned tensor shares the storage with the input tensor, so changing the contents of one will change the contents of the other.\n * If you would like a copy, use `tensor.clone()` before squeezing.\n * \n * @param {number} [dim=null] If given, the input will be squeezed only in the specified dimensions.\n * @returns {Tensor} The squeezed tensor\n */\n squeeze(dim = null) {\n return new Tensor(\n this.type,\n this.data,\n calc_squeeze_dims(this.dims, dim)\n )\n }\n\n /**\n * In-place version of @see {@link Tensor.squeeze}\n */\n squeeze_(dim = null) {\n this.dims = calc_squeeze_dims(this.dims, dim);\n return this;\n }\n\n /**\n * Returns a new tensor with a dimension of size one inserted at the specified position.\n * \n * NOTE: The returned tensor shares the same underlying data with this tensor.\n * \n * @param {number} dim The index at which to insert the singleton dimension\n * @returns {Tensor} The unsqueezed tensor\n */\n unsqueeze(dim = null) {\n return new Tensor(\n this.type,\n this.data,\n calc_unsqueeze_dims(this.dims, dim)\n );\n }\n\n /**\n * In-place version of @see {@link Tensor.unsqueeze}\n */\n unsqueeze_(dim = null) {\n this.dims = calc_unsqueeze_dims(this.dims, dim);\n return this;\n }\n\n /**\n * In-place version of @see {@link Tensor.flatten}\n */\n flatten_(start_dim = 0, end_dim = -1) {\n // TODO validate inputs\n end_dim = (end_dim + this.dims.length) % this.dims.length;\n\n let dimsToKeepBefore = this.dims.slice(0, start_dim);\n let dimsToFlatten = this.dims.slice(start_dim, end_dim + 1);\n let dimsToKeepAfter = this.dims.slice(end_dim + 1);\n\n this.dims = [...dimsToKeepBefore, dimsToFlatten.reduce((a, b) => a * b, 1), ...dimsToKeepAfter]\n return this;\n }\n\n /**\n * Flattens input by reshaping it into a one-dimensional tensor.\n * If `start_dim` or `end_dim` are passed, only dimensions starting with `start_dim`\n * and ending with `end_dim` are flattened. The order of elements in input is unchanged.\n * @param {number} start_dim the first dim to flatten\n * @param {number} end_dim the last dim to flatten\n * @returns {Tensor} The flattened tensor.\n */\n flatten(start_dim = 0, end_dim = -1) {\n return this.clone().flatten_(start_dim, end_dim);\n }\n\n /**\n * Returns a new tensor with the same data as the `self` tensor but of a different `shape`.\n * @param {...number} dims the desired size\n * @returns {Tensor} The tensor with the same data but different shape\n */\n view(...dims) {\n // TODO: validate dims\n let inferredIndex = -1;\n for (let i = 0; i < dims.length; ++i) {\n if (dims[i] === -1) {\n if (inferredIndex !== -1) {\n throw new Error(\"Only one dimension can be inferred\");\n }\n inferredIndex = i;\n }\n }\n\n if (inferredIndex !== -1) {\n // Some dimension must be inferred\n const productOther = dims.reduce((product, curr, index) => {\n return index !== inferredIndex ? product * curr : product\n }, 1);\n\n dims[inferredIndex] = this.data.length / productOther;\n }\n return new Tensor(this.type, this.data, dims); // NOTE: uses same underlying storage\n }\n\n neg_() {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] = -this_data[i];\n }\n return this;\n }\n neg() {\n return this.clone().neg_();\n }\n\n /**\n * In-place version of @see {@link Tensor.clamp}\n */\n clamp_(min, max) {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] = Math.min(Math.max(this_data[i], min), max);\n }\n return this;\n }\n\n /**\n * Clamps all elements in input into the range [ min, max ]\n * @param {number} min lower-bound of the range to be clamped to\n * @param {number} max upper-bound of the range to be clamped to\n * @returns {Tensor} the output tensor.\n */\n clamp(min, max) {\n return this.clone().clamp_(min, max);\n }\n\n /**\n * In-place version of @see {@link Tensor.round}\n */\n round_() {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] = Math.round(this_data[i]);\n }\n return this;\n }\n\n /**\n * Rounds elements of input to the nearest integer.\n * @returns {Tensor} the output tensor.\n */\n round() {\n return this.clone().round_();\n }\n\n mean(dim = null, keepdim = false) {\n return mean(this, dim, keepdim);\n }\n\n /**\n * Performs Tensor dtype conversion.\n * @param {DataType} type The desired data type.\n * @returns {Tensor} The converted tensor.\n */\n to(type) {\n // If the self Tensor already has the correct dtype, then self is returned.\n if (this.type === type) return this;\n\n // Otherwise, the returned tensor is a copy of self with the desired dtype.\n if (!DataTypeMap.hasOwnProperty(type)) {\n throw new Error(`Unsupported type: ${type}`);\n }\n // @ts-ignore\n return new Tensor(type, DataTypeMap[type].from(this.data), this.dims);\n }\n}\n\n/**\n * This creates a nested array of a given type and depth (see examples).\n * \n * @example\n * NestArray; // string[]\n * @example\n * NestArray; // number[][]\n * @example\n * NestArray; // string[][][] etc.\n * @template T\n * @template {number} Depth\n * @template {never[]} [Acc=[]]\n * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray\n */\n\n/**\n * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions.\n *\n * @example\n * reshape([10 ], [1 ]); // Type: number[] Value: [10]\n * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]]\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]]\n * @param {T[]|DataArray} data The input array to reshape.\n * @param {DIM} dimensions The target shape/dimensions.\n * @template T\n * @template {[number]|number[]} DIM\n * @returns {NestArray} The reshaped array.\n */\nfunction reshape(data, dimensions) {\n\n const totalElements = data.length;\n const dimensionSize = dimensions.reduce((a, b) => a * b);\n\n if (totalElements !== dimensionSize) {\n throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`);\n }\n\n /** @type {any} */\n let reshapedArray = data;\n\n for (let i = dimensions.length - 1; i >= 0; i--) {\n reshapedArray = reshapedArray.reduce((acc, val) => {\n let lastArray = acc[acc.length - 1];\n\n if (lastArray.length < dimensions[i]) {\n lastArray.push(val);\n } else {\n acc.push([val]);\n }\n\n return acc;\n }, [[]]);\n }\n\n return reshapedArray[0];\n}\n\n/**\n * Permutes a tensor according to the provided axes.\n * @param {any} tensor The input tensor to permute.\n * @param {Array} axes The axes to permute the tensor along.\n * @returns {Tensor} The permuted tensor.\n */\nexport function permute(tensor, axes) {\n const [permutedData, shape] = permute_data(tensor.data, tensor.dims, axes);\n return new Tensor(tensor.type, permutedData, shape);\n}\n\n\n/**\n * Interpolates an Tensor to the given size.\n * @param {Tensor} input The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])\n * @param {number[]} size The output size of the image\n * @param {string} mode The interpolation mode\n * @param {boolean} align_corners Whether to align corners.\n * @returns {Tensor} The interpolated tensor.\n */\nexport function interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) {\n\n // Input image dimensions\n const in_channels = input.dims.at(-3) ?? 1;\n const in_height = input.dims.at(-2);\n const in_width = input.dims.at(-1);\n\n let output = interpolate_data(\n /** @type {import('./maths.js').TypedArray}*/(input.data),\n [in_channels, in_height, in_width],\n [out_height, out_width],\n mode,\n align_corners\n );\n return new Tensor(input.type, output, [in_channels, out_height, out_width]);\n}\n\n\n/**\n * Down/up samples the input.\n * Inspired by https://pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html.\n * @param {Tensor} input the input tensor\n * @param {Object} options the options for the interpolation\n * @param {[number, number]|[number, number, number]|[number, number, number, number]} [options.size=null] output spatial size.\n * @param {\"bilinear\"|\"bicubic\"} [options.mode='bilinear'] algorithm used for upsampling\n * @returns {Promise} The interpolated tensor.\n */\nexport async function interpolate_4d(input, {\n size = null,\n mode = 'bilinear',\n} = {}) {\n\n // Error checking\n if (input.dims.length !== 4) {\n throw new Error('`interpolate_4d` currently only supports 4D input.');\n }\n if (!size) {\n // TODO: support scale_factor\n throw new Error('`interpolate_4d` requires a `size` argument.');\n }\n\n // Fill in missing dimensions\n let targetDims;\n if (size.length === 2) {\n targetDims = [...input.dims.slice(0, 2), ...size];\n } else if (size.length === 3) {\n targetDims = [input.dims[0], ...size];\n } else if (size.length === 4) {\n targetDims = size;\n } else {\n throw new Error('`size` must be of length 2, 3, or 4.');\n }\n\n let op;\n if (mode === 'bilinear') {\n op = await TensorOpRegistry.bilinear_interpolate_4d;\n } else if (mode === 'bicubic') {\n op = await TensorOpRegistry.bicubic_interpolate_4d;\n } else {\n throw new Error(`Unsupported mode: ${mode}`);\n }\n\n const sizeTensor = new Tensor('int64', new BigInt64Array(targetDims.map(BigInt)), [targetDims.length]);\n return await op({ x: input, s: sizeTensor });\n}\n\n\n/**\n * Perform mean pooling of the last hidden state followed by a normalization step.\n * @param {Tensor} last_hidden_state Tensor of shape [batchSize, seqLength, embedDim]\n * @param {Tensor} attention_mask Tensor of shape [batchSize, seqLength]\n * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim].\n */\nexport function mean_pooling(last_hidden_state, attention_mask) {\n // last_hidden_state: [batchSize, seqLength, embedDim]\n // attention_mask: [batchSize, seqLength]\n\n let shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]];\n // @ts-ignore\n let returnedData = new last_hidden_state.data.constructor(shape[0] * shape[1]);\n let [batchSize, seqLength, embedDim] = last_hidden_state.dims;\n\n let outIndex = 0;\n for (let i = 0; i < batchSize; ++i) {\n let offset = i * embedDim * seqLength;\n\n for (let k = 0; k < embedDim; ++k) {\n let sum = 0;\n let count = 0;\n\n let attnMaskOffset = i * seqLength;\n let offset2 = offset + k;\n // Pool over all words in sequence\n for (let j = 0; j < seqLength; ++j) {\n // index into attention mask\n let attn = Number(attention_mask.data[attnMaskOffset + j]);\n\n count += attn;\n sum += last_hidden_state.data[offset2 + j * embedDim] * attn;\n }\n\n let avg = sum / count;\n returnedData[outIndex++] = avg;\n }\n }\n\n return new Tensor(\n last_hidden_state.type,\n returnedData,\n shape\n )\n}\n\n/**\n * Apply Layer Normalization for last certain number of dimensions.\n * @param {Tensor} input The input tensor\n * @param {number[]} normalized_shape input shape from an expected input of size\n * @param {Object} options The options for the layer normalization\n * @param {number} [options.eps=1e-5] A value added to the denominator for numerical stability.\n * @returns {Tensor} The normalized tensor.\n */\nexport function layer_norm(input, normalized_shape, {\n eps = 1e-5,\n} = {}) {\n if (input.dims.length !== 2) {\n throw new Error('`layer_norm` currently only supports 2D input.');\n }\n\n const [batchSize, featureDim] = input.dims;\n\n if (normalized_shape.length !== 1 && normalized_shape[0] !== featureDim) {\n throw new Error('`normalized_shape` must be a 1D array with shape `[input.dims[1]]`.');\n }\n\n const [std, mean] = std_mean(input, 1, 0, true);\n\n // @ts-ignore\n const returnedData = new input.data.constructor(input.data.length);\n\n for (let i = 0; i < batchSize; ++i) {\n const offset = i * featureDim;\n for (let j = 0; j < featureDim; ++j) {\n const offset2 = offset + j;\n returnedData[offset2] = (input.data[offset2] - mean.data[i]) / (std.data[i] + eps);\n }\n }\n return new Tensor(input.type, returnedData, input.dims);\n}\n\n/**\n * Helper function to calculate new dimensions when performing a squeeze operation.\n * @param {number[]} dims The dimensions of the tensor.\n * @param {number|number[]|null} dim The dimension(s) to squeeze.\n * @returns {number[]} The new dimensions.\n * @private\n */\nfunction calc_squeeze_dims(dims, dim) {\n dims = dims.slice();\n if (dim === null) {\n dims = dims.filter((d) => d !== 1);\n } else if (typeof dim === 'number') {\n if (dims[dim] === 1) {\n dims.splice(dim, 1);\n }\n } else if (Array.isArray(dim)) {\n dims = dims.filter((x, i) => {\n return x !== 1 || !dim.includes(i);\n });\n }\n return dims;\n}\n\n/**\n * Helper function to calculate new dimensions when performing an unsqueeze operation.\n * @param {number[]} dims The dimensions of the tensor.\n * @param {number} dim The dimension to unsqueeze.\n * @returns {number[]} The new dimensions.\n * @private\n */\nfunction calc_unsqueeze_dims(dims, dim) {\n // Dimension out of range (e.g., \"expected to be in range of [-4, 3], but got 4\")\n // + 1 since we allow inserting at the end (i.e. dim = -1)\n dim = safeIndex(dim, dims.length + 1);\n dims = dims.slice();\n // Insert 1 into specified dimension\n dims.splice(dim, 0, 1);\n return dims;\n}\n\n/**\n * Safely calculate the index for an array of a given size, allowing negative indexing.\n * @param {number} index The index that will be used.\n * @param {number} size The size of the array.\n * @param {number} [dimension=null] The dimension that the index is for (optional).\n * @returns {number} The index, guaranteed to be non-negative and less than `arrayLength`.\n * \n * @throws {Error} If the index is out of range.\n * @private\n */\nfunction safeIndex(index, size, dimension = null) {\n if (index < -size || index >= size) {\n throw new Error(`IndexError: index ${index} is out of bounds for dimension${dimension === null ? '' : ' ' + dimension} with size ${size}`);\n }\n\n if (index < 0) {\n // Negative indexing, ensuring positive index\n index = ((index % size) + size) % size;\n }\n return index;\n}\n\n/**\n * Concatenates an array of tensors along a specified dimension.\n * @param {Tensor[]} tensors The array of tensors to concatenate.\n * @param {number} dim The dimension to concatenate along.\n * @returns {Tensor} The concatenated tensor.\n */\nexport function cat(tensors, dim = 0) {\n dim = safeIndex(dim, tensors[0].dims.length);\n\n // TODO do validation of shapes\n\n const resultDims = tensors[0].dims.slice();\n resultDims[dim] = tensors.reduce((a, b) => a + b.dims[dim], 0);\n\n // Create a new array to store the accumulated values\n const resultSize = resultDims.reduce((a, b) => a * b, 1);\n // @ts-ignore\n const result = new tensors[0].data.constructor(resultSize);\n\n // Create output tensor of same type as first\n const resultType = tensors[0].type;\n\n if (dim === 0) {\n // Handle special case for performance reasons\n\n let offset = 0;\n for (let t of tensors) {\n result.set(t.data, offset);\n offset += t.data.length;\n }\n\n } else {\n\n let currentDim = 0;\n\n for (let t = 0; t < tensors.length; ++t) {\n let tensor = tensors[t];\n\n // Iterate over the data array\n for (let i = 0; i < tensor.data.length; ++i) {\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = tensor.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = tensor.dims[j];\n let index = num % size;\n if (j === dim) {\n index += currentDim;\n }\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n num = Math.floor(num / size);\n }\n // Accumulate the value at the current index\n result[resultIndex] = tensor.data[i];\n }\n\n currentDim += tensor.dims[dim];\n }\n }\n return new Tensor(resultType, result, resultDims);\n}\n\n/**\n * Stack an array of tensors along a specified dimension.\n * @param {Tensor[]} tensors The array of tensors to stack.\n * @param {number} dim The dimension to stack along.\n * @returns {Tensor} The stacked tensor.\n */\nexport function stack(tensors, dim = 0) {\n // TODO do validation of shapes\n // NOTE: stack expects each tensor to be equal size\n return cat(tensors.map(t => t.unsqueeze(dim)), dim);\n}\n\n\n/**\n * Calculates the standard deviation and mean over the dimensions specified by dim. dim can be a single dimension or `null` to reduce over all dimensions.\n * @param {Tensor} input the input tenso\n * @param {number|null} dim the dimension to reduce. If None, all dimensions are reduced.\n * @param {number} correction difference between the sample size and sample degrees of freedom. Defaults to Bessel's correction, correction=1.\n * @param {boolean} keepdim whether the output tensor has dim retained or not.\n * @returns {Tensor[]} A tuple of (std, mean) tensors.\n */\nexport function std_mean(input, dim = null, correction = 1, keepdim = false) {\n\n if (dim === null) {\n // None to reduce over all dimensions.\n // @ts-ignore\n const sum = input.data.reduce((a, b) => a + b, 0);\n const mean = sum / input.data.length;\n // @ts-ignore\n const std = Math.sqrt(input.data.reduce((a, b) => a + (b - mean) ** 2, 0) / (input.data.length - correction));\n\n const meanTensor = new Tensor(input.type, [mean], [/* scalar */]);\n const stdTensor = new Tensor(input.type, [std], [/* scalar */]);\n\n return [stdTensor, meanTensor];\n }\n\n // Negative indexing\n dim = safeIndex(dim, input.dims.length);\n\n const meanTensor = mean(input, dim, keepdim);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = input.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new input.data.constructor(input.data.length / input.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < input.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = input.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = input.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += (input.data[i] - meanTensor.data[resultIndex]) ** 2;\n }\n\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.sqrt(result[i] / (input.dims[dim] - correction));\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n const stdTensor = new Tensor(input.type, result, resultDims);\n\n return [stdTensor, meanTensor];\n}\n\n\n/**\n * Returns the mean value of each row of the input tensor in the given dimension dim.\n * @param {Tensor} input the input tensor.\n * @param {number|null} dim the dimension to reduce.\n * @param {boolean} keepdim whether the output tensor has dim retained or not.\n * @returns {Tensor} A new tensor with means taken along the specified dimension.\n */\nexport function mean(input, dim = null, keepdim = false) {\n\n if (dim === null) {\n // None to reduce over all dimensions.\n // @ts-ignore\n let val = input.data.reduce((a, b) => a + b, 0);\n return new Tensor(input.type, [val / input.data.length], [/* scalar */]);\n }\n\n // Negative indexing\n dim = safeIndex(dim, input.dims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = input.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new input.data.constructor(input.data.length / input.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < input.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = input.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = input.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += input.data[i];\n }\n\n if (input.dims[dim] !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] / input.dims[dim];\n }\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n return new Tensor(input.type, result, resultDims);\n}\n\n\n/**\n *\n * Measures similarity between two temporal sequences (e.g., input audio and output tokens\n * to generate token-level timestamps).\n * @param {Tensor} matrix \n * @returns {number[][]}\n */\nexport function dynamicTimeWarping(matrix) {\n const [output_length, input_length] = matrix.dims;\n\n const outputShape = [output_length + 1, input_length + 1];\n\n const cost = new Tensor(\n 'float32',\n new Float32Array(outputShape[0] * outputShape[1]).fill(Infinity),\n outputShape\n );\n\n const trace = new Tensor(\n 'float32',\n new Float32Array(outputShape[0] * outputShape[1]).fill(-1),\n outputShape\n )\n\n // same as `cost[0][0] = 0`;\n cost[0].data[0] = 0;\n\n for (let j = 1; j < input_length + 1; ++j) {\n for (let i = 1; i < output_length + 1; ++i) {\n\n const c0 = cost[i - 1][j - 1].item();\n const c1 = cost[i - 1][j].item();\n const c2 = cost[i][j - 1].item();\n\n let c, t;\n if (c0 < c1 && c0 < c2) {\n c = c0;\n t = 0;\n } else if (c1 < c0 && c1 < c2) {\n c = c1;\n t = 1;\n } else {\n c = c2;\n t = 2;\n }\n\n cost[i].data[j] = matrix[i - 1][j - 1].item() + c;\n trace[i].data[j] = t;\n }\n }\n\n // backtrace\n let i = output_length;\n let j = input_length;\n\n // @ts-ignore\n trace.data.fill(2, 0, outputShape[1]) // trace[0, :] = 2\n for (let i = 0; i < outputShape[0]; ++i) { // trace[:, 0] = 1\n trace[i].data[0] = 1;\n }\n\n let text_indices = [];\n let time_indices = [];\n\n while (i > 0 || j > 0) {\n text_indices.push(i - 1);\n time_indices.push(j - 1);\n\n const t = trace[i][j].item();\n switch (t) {\n case 0:\n --i; --j;\n break;\n case 1:\n --i;\n break;\n case 2:\n --j;\n break;\n default:\n throw new Error(\n `Internal error in dynamic time warping. Unexpected trace[${i}, ${j}]. Please file a bug report.`\n )\n }\n }\n\n text_indices.reverse();\n time_indices.reverse();\n\n return [text_indices, time_indices];\n\n}\n\nfunction dimsToStride(dims) {\n const stride = new Array(dims.length);\n for (let i = dims.length - 1, s2 = 1; i >= 0; --i) {\n stride[i] = s2;\n s2 *= dims[i];\n }\n return stride;\n}\n\nfunction fullHelper(size, fill_value, dtype, cls) {\n const numElements = size.reduce((a, b) => a * b, 1);\n return new Tensor(\n dtype,\n new cls(numElements).fill(fill_value),\n size\n )\n}\n\n/**\n * Creates a tensor of size size filled with fill_value. The tensor's dtype is inferred from fill_value.\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n * @param {number|bigint} fill_value The value to fill the output tensor with.\n * @returns {Tensor} The filled tensor.\n */\nexport function full(size, fill_value) {\n let dtype;\n let typedArrayCls;\n if (typeof fill_value === 'number') {\n dtype = 'float32';\n typedArrayCls = Float32Array;\n } else if (typeof fill_value === 'bigint') {\n dtype = 'int64';\n typedArrayCls = BigInt64Array;\n } else {\n // TODO: support other dtypes\n throw new Error(`Unsupported data type: ${typeof fill_value}`);\n }\n return fullHelper(size, fill_value, dtype, typedArrayCls);\n}\n\nexport function full_like(tensor, fill_value) {\n return full(tensor.dims, fill_value);\n}\n\n/**\n * Returns a tensor filled with the scalar value 1, with the shape defined by the variable argument size.\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n * @returns {Tensor} The ones tensor.\n */\nexport function ones(size) {\n return fullHelper(size, 1n, 'int64', BigInt64Array);\n}\n\n/**\n * Returns a tensor filled with the scalar value 1, with the same size as input.\n * @param {Tensor} tensor The size of input will determine size of the output tensor.\n * @returns {Tensor} The ones tensor.\n */\nexport function ones_like(tensor) {\n return ones(tensor.dims);\n}\n\n/**\n * Returns a tensor filled with the scalar value 0, with the shape defined by the variable argument size.\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n * @returns {Tensor} The zeros tensor.\n */\nexport function zeros(size) {\n return fullHelper(size, 0n, 'int64', BigInt64Array);\n}\n\n/**\n * Returns a tensor filled with the scalar value 0, with the same size as input.\n * @param {Tensor} tensor The size of input will determine size of the output tensor.\n * @returns {Tensor} The zeros tensor.\n */\nexport function zeros_like(tensor) {\n return zeros(tensor.dims);\n}\n\n/**\n * Quantizes the embeddings tensor to binary or unsigned binary precision.\n * @param {Tensor} tensor The tensor to quantize.\n * @param {'binary'|'ubinary'} precision The precision to use for quantization.\n * @returns {Tensor} The quantized tensor.\n */\nexport function quantize_embeddings(tensor, precision) {\n if (tensor.dims.length !== 2) {\n throw new Error(\"The tensor must have 2 dimensions\");\n }\n if (tensor.dims.at(-1) % 8 !== 0) {\n throw new Error(\"The last dimension of the tensor must be a multiple of 8\");\n }\n if (!['binary', 'ubinary'].includes(precision)) {\n throw new Error(\"The precision must be either 'binary' or 'ubinary'\");\n }\n\n const signed = precision === 'binary';\n const dtype = signed ? 'int8' : 'uint8';\n\n // Create a typed array to store the packed bits\n const cls = signed ? Int8Array : Uint8Array;\n const inputData = tensor.data;\n const outputData = new cls(inputData.length / 8);\n\n // Iterate over each number in the array\n for (let i = 0; i < inputData.length; ++i) {\n // Determine if the number is greater than 0\n const bit = inputData[i] > 0 ? 1 : 0;\n\n // Calculate the index in the typed array and the position within the byte\n const arrayIndex = Math.floor(i / 8);\n const bitPosition = i % 8;\n\n // Pack the bit into the typed array\n outputData[arrayIndex] |= bit << (7 - bitPosition);\n if (signed && bitPosition === 0) {\n outputData[arrayIndex] -= 128;\n }\n };\n\n return new Tensor(dtype, outputData, [tensor.dims[0], tensor.dims[1] / 8]);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["leafPrototypes","getProto","TOKEN_TYPES","Object","freeze","Text","NumericLiteral","BooleanLiteral","StringLiteral","Identifier","Equals","OpenParen","CloseParen","OpenStatement","CloseStatement","OpenExpression","CloseExpression","OpenSquareBracket","CloseSquareBracket","OpenCurlyBracket","CloseCurlyBracket","Comma","Dot","Colon","Pipe","CallOperator","AdditiveBinaryOperator","MultiplicativeBinaryOperator","ComparisonBinaryOperator","UnaryOperator","Set","If","For","In","Is","NotIn","Else","EndIf","ElseIf","EndFor","And","Or","Not","KEYWORDS","set","for","in","is","if","else","endif","elif","endfor","and","or","not","true","false","Token","constructor","value","type","this","isWord","char","test","isInteger","ORDERED_MAPPING_TABLE","ESCAPE_CHARACTERS","Map","tokenize","source","options","tokens","src","template","endsWith","slice","replace","lstrip_blocks","trim_blocks","preprocess","cursorPosition","consumeWhile","predicate","str","length","SyntaxError","escaped","unescaped","get","main","lastTokenType","at","text","push","char2","lastTokenType2","num","token","word","hasOwn","pop","c","Statement","Program","body","super","alternate","loopvar","iterable","SetStatement","assignee","Expression","MemberExpression","object","property","computed","CallExpression","callee","args","Literal","ArrayLiteral","TupleLiteral","ObjectLiteral","BinaryExpression","operator","left","right","FilterExpression","operand","filter","TestExpression","negate","UnaryExpression","argument","SliceExpression","start","stop","step","KeywordArgumentExpression","key","parse","program","current","expect","error","prev","Error","parseAny","result","parseSetStatement","parseIfStatement","loopVariable","parseExpressionSequence","parseExpression","parseForStatement","parseJinjaStatement","parseJinjaExpression","types","some","i","every","primary","fn","parsePrimaryExpression","expressions","isTuple","a","parseLogicalOrExpression","b","parseTernaryExpression","parseLogicalAndExpression","parseLogicalNegationExpression","arg","parseAdditiveExpression","parseComparisonExpression","parseMultiplicativeExpression","parseCallMemberExpression","member","parseMemberExpressionArgumentsList","parseMemberExpression","parseCallExpression","callExpression","parseArgumentsList","parseArgs","slices","isSlice","parseTestExpression","parseFilterExpression","toString","Number","expression","values","range","array","direction","Math","sign","max","min","titleCase","toUpperCase","RuntimeValue","builtins","__bool__","BooleanValue","NumericValue","StringValue","FunctionValue","toLowerCase","trim","ObjectValue","size","defaultValue","NullValue","ArrayValue","Array","from","entries","map","TupleValue","UndefinedValue","Environment","parent","variables","tests","name","declareVariable","convertToRuntimeValues","has","setVariable","resolve","lookupVariable","Interpreter","global","env","run","evaluate","evaluateBinaryExpression","node","environment","concat","find","x","includes","evaluateFilterExpression","reverse","sort","localeCompare","charAt","abs","filterName","attr","testName","testFunction","filtered","item","evaluateTestExpression","evaluateUnaryExpression","evalProgram","evaluateBlock","statements","statement","lastEvaluated","evaluateIdentifier","evaluateCallExpression","expr","kwargs","kwarg","evaluateSliceExpression","join","evaluateMemberExpression","evaluateSet","rhs","variableName","JSON","stringify","evaluateIf","evaluateFor","scope","loop","j","mapping","evaluatedKey","input","isArray","_scope","Template","parsed","render","items","backends","backendsSortedByPriority","registerBackend","backend","priority","init","createInferenceSessionHandler","TypeError","currentBackend","undefined","indexOf","splice","resolveBackend","async","backendHints","backendNames","errors","backendName","backendInfo","initialized","aborted","isInitializing","initPromise","e","err","logLevelValue","wasm","webgl","webgpu","versions","common","version","logLevel","defineProperty","enumerable","InferenceSession","handler","feeds","arg1","arg2","TRACE_FUNC_BEGIN","fetches","Tensor","isFetchesEmpty","outputNames","RangeError","isFetches","arg1Keys","getOwnPropertyNames","v","inputNames","results","returnValue","hasOwnProperty","call","data","dims","TRACE_FUNC_END","dispose","static","arg0","arg3","filePathOrUint8Array","Uint8Array","ArrayBuffer","SharedArrayBuffer","buffer","byteOffset","byteLength","isSafeInteger","executionProviders","startProfiling","endProfiling","tensorToDataURL","tensor","canvas","document","createElement","OffscreenCanvas","width","height","pixels2DContext","getContext","tensorLayout","inputformat","format","norm","normMean","normBias","mean","bias","stride","rTensorPointer","gTensorPointer","bTensorPointer","aTensorPointer","R","G","B","A","fillStyle","fillRect","toDataURL","tensorToImageData","image","channels","rImagePointer","gImagePointer","bImagePointer","aImagePointer","createImageData","bufferToTensor","outputformat","tensorFormat","float32Data","Float32Array","tensorFromImage","isHTMLImageEle","HTMLImageElement","isImageDataEle","ImageData","isImageBitmap","ImageBitmap","isString","bufferToTensorOptions","createCanvas","createCanvasContext","HTMLCanvasElement","resizedHeight","resizedWidth","drawImage","getImageData","Promise","reject","context","newImage","Image","crossOrigin","onload","img","tempCanvas","putImageData","tensorFromTexture","texture","download","location","tensorFromGpuBuffer","gpuBuffer","dataType","tensorFromPinnedBuffer","NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP","Int8Array","Uint16Array","Int16Array","Int32Array","Float64Array","Uint32Array","NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP","isBigIntChecked","checkBigInt","isBigInt64ArrayAvailable","BigInt64Array","isBigUint64ArrayAvailable","BigUint64Array","dataLocation","expectedTypedArrayConstructor","cpuData","gpuTextureData","downloader","disposer","gpuBufferData","maybeDims","typedArrayConstructor","BigInt","firstElementType","mappedType","calculateSize","toImageData","ensureValid","releaseData","isDownloading","reshape","tensorReshape","dim","TRACE","deviceType","label","console","timeStamp","TRACE_FUNC","msg","extraMsg","stack","split","hasTraceFunc","TrainingSession","hasOptimizerModel","hasEvalModel","trainingInputNames","trainingOutputNames","evalInputNames","evalOutputNames","trainingOptions","sessionOptions","evalModel","optimizerModel","createTrainingSessionHandler","checkpointState","trainModel","typeNarrowingForRunStep","convertHandlerReturnTypeToMapOfTensors","lazyResetGrad","runTrainStep","runOptimizerStep","runEvalStep","trainableOnly","getParametersSize","paramsSize","loadParametersBuffer","getContiguousParameters","Zr","Ht","Lt","fd","Xr","oi","ui","ot","Ae","di","ci","jn","fi","mi","hi","gi","Ft","Sr","bi","wi","$i","_i","rt","Ze","tn","Si","st","nt","rn","md","nn","gd","Fn","ld","getOwnPropertyDescriptor","dd","cd","prototype","F","t","tr","exports","rr","r","Gt","n","pd","Qr","o","s","add","warn","l","Proxy","Reflect","ii","si","qn","li","pi","f","m","h","w","$","I","S","E","k","yi","Jr","vi","Float16Array","xi","en","Kn","trace","Ci","Ii","Ei","Ai","Ti","Oi","ki","Pi","Yn","lt","Zn","createReadStream","zi","readFile","yd","readFileSync","bd","Xn","Qn","wd","Jn","Mi","Di","ea","Bi","currentScript","__filename","ready","d","g","mountExternalData","Fa","unmountExternalData","_","C","O","W","ut","Q","oe","pr","Ea","Za","La","flush","all","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput","jsepInit","Ra","Va","Ma","Ua","sa","Wa","Ya","Sa","Ta","Xa","jsepRegisterBuffer","registerBuffer","jsepGetBuffer","getBuffer","jsepCreateDownloader","createDownloader","jsepOnReleaseSession","onReleaseSession","jsepOnRunStart","onRunStart","assign","window","importScripts","process","dirname","__dirname","Ee","URL","normalize","thisProgram","argv","exitCode","inspect","self","href","substr","lastIndexOf","XMLHttpRequest","open","send","responseText","responseType","response","status","onerror","log","bind","WebAssembly","se","U","N","H","z","L","pe","Ie","we","HEAP8","HEAP16","HEAPU8","HEAPU16","HEAP32","HEAPU32","HEAPF32","HEAPF64","ne","Ue","X","xe","fe","ue","RuntimeError","Le","he","startsWith","locateFile","J","Je","fetch","credentials","then","ok","arrayBuffer","catch","Se","instantiate","Fe","It","je","substring","subarray","alpha","beta","to","keepDims","noopWithEmptyAxes","axes","perm","le","me","Pe","ze","P","ae","autoPad","dilations","group","kernel_shape","pads","strides","wIsConst","outputPadding","outputShape","activation","kernelShape","Ce","auto_pad","ceil_mode","count_include_pad","storage_order","transA","transB","selectLastIndex","axis","numOutputs","splitSizes","antialias","coordinateTransformMode","cubicCoeffA","excludeOutside","extrapolationValue","keepAspectRatioPolicy","mode","nearestMode","starts","ends","epsilon","equation","momentum","spatial","trainingMode","exclusive","numHeads","isUnidirectional","maskFilterValue","scale","doRotary","qkvHiddenSizes","pastPresentShareBuffer","w_is_const","activation_params","accuracyLevel","bits","blockSize","Ve","message","qe","Ja","Pa","Oa","eb","Na","Qt","Et","TextDecoder","Ot","decode","String","fromCharCode","ur","charCodeAt","Yt","kt","At","Zt","Xt","er","Nt","lr","pt","dr","USER","LOGNAME","PATH","PWD","HOME","LANG","navigator","languages","Ke","zr","Re","Jt","Lr","bt","getFullYear","getMonth","getDate","getDay","Date","Ca","Da","getTime","setDate","setMonth","setFullYear","bb","ab","Ga","Ka","Ha","xa","fb","$a","cb","RegExp","floor","Br","Pt","ft","te","Tt","cr","Dr","Mr","Ur","Vr","_r","Browser","Ia","Qa","resume","ee","Wr","pause","vr","xr","hr","forEach","onExit","Gr","fr","D","y","q","NaN","getUTCSeconds","getUTCMinutes","getUTCHours","getUTCDate","getUTCMonth","getUTCFullYear","getUTCDay","UTC","getSeconds","getMinutes","getHours","getTimezoneOffset","setTime","getYear","isNaN","mr","gr","ceil","p","toTimeString","match","apply","now","performance","K","copyWithin","u","grow","arguments","$r","Fibers","gb","Un","pa","qa","ua","wa","Hr","M","unshift","clearInterval","instantiateWasm","instantiateStreaming","et","instance","_OrtInit","_OrtGetLastError","_OrtCreateSessionOptions","_OrtAppendExecutionProvider","_OrtAddFreeDimensionOverride","_OrtAddSessionConfigEntry","T","_OrtReleaseSessionOptions","V","_OrtReleaseSession","_OrtGetInputOutputCount","_OrtGetInputName","Y","_OrtGetOutputName","Z","_OrtFree","_OrtCreateTensor","_OrtGetTensorData","aa","_OrtReleaseTensor","ba","_OrtCreateRunOptions","ca","_OrtAddRunConfigEntry","da","_OrtReleaseRunOptions","_OrtCreateBinding","fa","ga","_OrtBindOutput","ha","_OrtClearBoundOutputs","ia","_OrtReleaseBinding","ja","ka","la","_OrtEndProfiling","ma","_JsepOutput","na","_JsepGetNodeName","oa","Rt","_malloc","_free","ra","ta","yr","br","va","wr","ya","za","Aa","Ba","Wt","preRun","shift","calledRun","___start_em_js","___stop_em_js","stackAlloc","stackSave","stackRestore","UTF8ToString","stringToUTF8","lengthBytesUTF8","define","amd","Ui","Ni","Wi","cpus","vd","ji","_d","an","qi","xd","Sd","Cd","Ki","Ge","He","Cr","Be","Yi","Id","Ed","Ad","Td","Xi","Bt","Ir","sn","Er","un","Ar","Od","kd","Ji","eo","Pd","De","ro","dn","Rd","ao","oo","$e","vt","qt","cn","pn","mn","ke","Me","Xe","mt","it","re","hn","uo","ar","zd","lo","Bd","Dd","dt","co","po","Md","Ud","Nd","Wd","Vd","Gd","Hd","Ld","Fd","qd","$t","fo","mo","ho","go","yo","bo","wo","vo","$o","_o","_t","jd","yn","xt","Kd","Yd","Zd","Xd","Qd","Jd","ec","tc","rc","nc","St","So","Co","Io","Eo","Ao","To","Oo","ko","Po","Ro","zo","Bo","Do","ac","ic","oc","sc","bn","uc","Uo","lc","dc","cc","No","pc","fc","Vo","mc","Oe","Ho","Lo","Fo","qo","jo","Ko","Yo","Zo","Xo","hc","Qo","Jo","es","ts","wn","rs","vn","ns","as","os","ss","us","ls","ds","cs","ps","fs","ms","hs","gs","ys","bs","ws","vs","$s","_s","xs","gc","yc","Cs","bc","wc","Ct","Es","As","Ts","Os","ks","Ps","Rs","zs","Bs","Ds","$c","_c","xc","Sc","Us","Ns","ht","gt","yt","_n","Qe","xn","Cn","Cc","Ic","Tr","Vs","Ec","Ac","Tc","Gs","Ls","_a","Oc","qs","En","kc","js","Pc","Rc","zc","Ks","Bc","Dc","Mc","Uc","Xs","Qs","Nc","Wc","Vc","Gc","Js","Hc","tu","ru","An","au","Fc","iu","qc","ou","su","jc","lu","Kc","Yc","du","Zc","pu","Xc","Qc","mu","hu","Jc","ep","yu","bu","tp","rp","vu","$u","np","ap","ip","xu","op","sp","Cu","up","lp","Eu","Au","dp","ku","Ou","cp","Pu","pp","fp","mp","hp","gp","yp","bp","wp","zu","Tn","Du","Mu","Uu","Nu","vp","$p","Wu","Vu","Gu","Hu","Lu","Fu","qu","ju","Ku","Yu","Zu","Xu","xp","Sp","Ju","Cp","Ip","Ep","Ap","Tp","Op","kp","Pp","Rp","zp","Bp","tl","Dp","Mp","Up","Np","Wp","rl","nl","Vp","Gp","il","Hp","On","Lp","sl","Fp","qp","ul","ll","jp","Kp","cl","pl","Yp","Zp","Xp","Qp","Jp","ml","hl","yl","ef","tf","rf","bl","nf","af","vl","_l","kn","of","sf","Pn","Vi","Li","Hi","Gi","wt","ge","Nn","Gb","kb","xb","Bb","lb","Ab","Cb","Eb","yb","zb","Db","ENVIRONMENT_IS_PTHREAD","Worker","writeSync","tt","wasmMemory","Memory","initial","maximum","shared","Ut","de","ve","Ne","We","ce","Te","terminate","onmessage","mb","cmd","start_routine","Hb","ub","pthread_ptr","unref","postMessage","Nb","Hn","Kr","Ln","Ib","numThreads","qb","hb","receiveObjectTransfer","Fb","threadInitTLS","pb","setExitStatus","ob","Qb","nb","Vn","targetThread","jr","transferList","thread","loaded","alert","threadId","target","filename","lineno","on","handlers","urlOrBlob","mainScriptUrlOrBlob","wasmModule","PThread","tb","sb","rb","Nr","Pb","establishStackSpace","invokeEntryPoint","Gn","Atomics","Ob","store","__emscripten_thread_mailbox_await","checkMailbox","Wn","ai","Vt","Lb","Kb","jb","Rb","Jb","Mb","Zl","Xl","Fr","zt","qr","Jl","ed","ad","ti","ib","wb","nd","rd","ri","od","sd","id","setTimeout","vb","ref","timeOrigin","hardwareConcurrency","ei","Sb","Ql","emscripten_main_runtime_thread_id","ud","module","_pthread_self","__emscripten_tls_init","__emscripten_thread_init","__emscripten_thread_crashed","Yr","__emscripten_thread_exit","dynCall_ii","ni","startWorker","keepRuntimeAlive","ExitStatus","Fi","fm","$d","nr","crossOriginIsolated","MessageChannel","port1","validate","initTimeout","simd","wasmPaths","Blob","createObjectURL","race","Zi","logSeverityLevel","logVerbosityLevel","tag","extra","WeakSet","Qi","session","use_ort_model_bytes_directly","enableMemPattern","powerPreference","preferredLayout","graphOptimizationLevel","executionMode","logId","optimizedModelFilePath","enableCpuMemArena","enableProfiling","enableGraphCapture","freeDimensionOverrides","ie","headers","parseInt","getReader","done","read","code","Buffer","Dt","toISOString","no","ln","so","device","createBuffer","usage","GPUBufferUsage","COPY_DST","MAP_READ","getCommandEncoder","endComputePass","copyBufferToBuffer","mapAsync","GPUMapMode","READ","getMappedRange","destroy","storageCache","freeBuffers","freeUniformBuffers","buffersForUploadingPending","buffersPending","externalBuffers","capturedPendingBuffers","upload","originalSize","mappedAtCreation","MAP_WRITE","COPY_SRC","unmap","gpuData","memcpy","registerExternalBuffer","capturedCommandList","currentSessionId","delete","unregisterExternalBuffer","create","STORAGE","UNIFORM","release","refreshPendingBuffers","sessionStatus","Ye","cacheKey","_e","calcMatMulShape","getSizeFromDimensionRange","normalizeAxis","adjustPadAndReturnShape","computeShapeHelper","isValidBroadcast","be","computeStrides","keys","indices","storage","offsetToIndices","indicesToOffset","broadcastedIndicesToOffset","setByIndices","getByIndices","impl","indicesGet","rank","indicesSet","setByOffset","getByOffset","shape","normalizedDispatchGroup","internalVariables","uniforms","variableIndex","guardAgainstOutOfBoundsWorkgroupSizes","mainStart","appendVariableUniforms","declareVariables","registerInternalVariable","registerInternalVariables","registerUniform","registerUniforms","uniformDeclaration","additionalImplementations","ir","sortBasedOnPerm","shaderCache","hint","inputDependencies","getRunData","outputs","dispatchGroup","programUniforms","getShaderSource","inputs","compute","xo","gn","sum","prod","sumSquare","logSumExp","l1","l2","logSum","normalizeAxes","getBigInt64Array","Mo","batchSize","sequenceLength","pastSequenceLength","kvSequenceLength","totalSequenceLength","maxSequenceLength","inputHiddenSize","hiddenSize","vHiddenSize","headSize","vHeadSize","maskType","broadcastResPosBias","passPastInKv","qkvFormat","sqrt","gpuDataType","Wo","outputCount","validateInputContent","Go","$n","getFloat32Array","Ms","scalar","vector","areEqual","calcShape","Ws","reduce","Mt","clipMax","clipMin","Sn","kr","Hs","Fs","adjustPadsBasedOnAutoPad","adapterInfo","isArchitecture","kernelCustomData","wT","Ys","Zs","eu","fill","nu","getInt32Array","uu","symbolToIndices","inputIndex","addSymbol","hasEllipsis","symbolToInfo","lhs","outputDims","processTerm","count","ellipsisDims","dimValue","inputIndices","cu","fu","gu","wu","_u","getShapeOfGemmResult","Su","sizeToDimension","sizeFromDimension","Iu","Tu","convertShape","Ru","Bu","padShape","Qu","adjustPoolAttributes","computePoolOutputShape","ceilMode","countIncludePad","storageOrder","el","al","round","MAX_VALUE","MIN_VALUE","customDataBuffer","ol","dl","fl","gl","wl","$l","xl","Sl","repo","attributesBound","getArtifact","setArtifact","programInfo","getComputePassEncoder","writeTimestamp","pendingDispatchNumber","binding","resource","createBindGroup","layout","computePipeline","getBindGroupLayout","kernelId","currentKernelId","bindGroup","setPipeline","setBindGroup","dispatchWorkgroups","maxDispatchNumber","queryType","build","features","createShaderModule","createComputePipeline","entryPoint","normalizeDispatchGroupSize","limits","maxComputeWorkgroupsPerDimension","cbrt","Cl","architecture","vendor","isVendor","commandEncoder","computePassEncoder","pendingKernels","pendingQueries","capturedPendingKernels","sessionExternalDataMapping","currentKernelCustomData","requiredLimits","maxComputeWorkgroupStorageSize","maxStorageBufferBindingSize","maxBufferSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","requiredFeatures","requestDevice","requestAdapterInfo","gpuDataManager","programManager","kernels","kernelPersistentData","debug","onuncapturederror","GPUValidationError","writable","configurable","setQueryType","querySet","createCommandEncoder","timestampWrites","beginningOfPassWriteIndex","endOfPassWriteIndex","beginComputePass","end","resolveQuerySet","queryResolveBuffer","queue","submit","finish","kernelType","kernelName","programName","inputTensorViews","outputTensorViews","queryTimeBase","profiling","ondata","inputsMetadata","outputsMetadata","startTime","endTime","temporaryData","writeBuffer","offset","alloc","free","createKernel","kernelEntry","attributes","releaseKernel","computeKernel","pushErrorScope","popErrorScope","unregisterBuffers","createQuerySet","QUERY_RESOLVE","captureBegin","captureEnd","replay","Il","uf","Pr","lf","Tl","Ol","jt","df","kl","Pl","Al","Rl","zl","Bl","Kt","ct","Rr","zn","Bn","sr","ff","Rn","Ul","Nl","Wl","Vl","Gl","Hl","Ll","Fl","mf","Dn","hf","Mn","El","customDataOffset","customDataSize","opKernelContext","output","initialize","Dl","gpu","adapter","forceFallbackAdapter","requestAdapter","externalData","path","preferredOutputLocation","handle","outputPreferredLocations","outputPreferredLocationsEncoded","Ml","Iv","pf","proxy","out","revokeObjectURL","epName","model","sessionId","outputIndices","ql","fromGpuBuffer","fetchModelAndCopyToWasmMemory","jl","loadModel","Kl","wasmBackend","gf","Yl","Kv","supportedExecutionProviders","defaultExecutionProviders","ONNX","apis","deviceToExecutionProviders","createInferenceSession","session_options","isONNXTensor","ONNX_ENV","userAgent","isONNXProxy","PretrainedConfig","configJSON","model_type","is_encoder_decoder","pretrained_model_name_or_path","progress_callback","config","cache_dir","local_files_only","revision","getModelJSON","loadConfig","AutoConfig","from_pretrained","IS_BROWSER_ENV","IS_WEBWORKER_ENV","IS_WEB_CACHE_AVAILABLE","IS_WEBGPU_AVAILABLE","IS_NODE_ENV","IS_FS_AVAILABLE","isEmpty","IS_PATH_AVAILABLE","RUNNING_LOCALLY","DEFAULT_CACHE_DIR","DEFAULT_LOCAL_MODEL_PATH","onnx","tfjs","allowRemoteModels","remoteHost","remotePathTemplate","allowLocalModels","localModelPath","useFS","useBrowserCache","useFSCache","cacheDir","useCustomCache","customCache","obj","GenerationConfig","max_length","max_new_tokens","min_length","min_new_tokens","early_stopping","max_time","do_sample","num_beams","num_beam_groups","penalty_alpha","use_cache","temperature","top_k","top_p","typical_p","epsilon_cutoff","eta_cutoff","diversity_penalty","repetition_penalty","encoder_repetition_penalty","length_penalty","no_repeat_ngram_size","bad_words_ids","force_words_ids","renormalize_logits","constraints","forced_bos_token_id","forced_eos_token_id","remove_invalid_values","exponential_decay_length_penalty","suppress_tokens","begin_suppress_tokens","forced_decoder_ids","guidance_scale","num_return_sequences","output_attentions","output_hidden_states","output_scores","return_dict_in_generate","pad_token_id","bos_token_id","eos_token_id","encoder_no_repeat_ngram_size","decoder_start_token_id","generation_kwargs","pick","LogitsProcessor","Callable","_call","input_ids","logits","LogitsWarper","LogitsProcessorList","processors","extend","toReturn","processor","Symbol","iterator","ForcedBOSTokenLogitsProcessor","batch_logits","Infinity","ForcedEOSTokenLogitsProcessor","SuppressTokensAtBeginLogitsProcessor","begin_index","token_id","WhisperTimeStampLogitsProcessor","generate_config","no_timestamps_token_id","timestamp_begin","max_initial_timestamp_index","logitsData","seq","last_was_timestamp","penultimate_was_timestamp","last_allowed","logprobs","log_softmax","exp","NoRepeatNGramLogitsProcessor","getNgrams","prevInputIds","curLen","ngrams","ngram","generatedNgram","prevNgram","prevNgramKey","prevNgramValue","getGeneratedNgrams","bannedNgrams","ngramIdx","calcBannedNgramTokens","bannedTokens","generatedNgrams","RepetitionPenaltyLogitsProcessor","penalty","input_id","MinLengthLogitsProcessor","eos_token","MinNewTokensLengthLogitsProcessor","prompt_length_to_skip","NoBadWordsLogitsProcessor","bad_word_ids","mark","ClassifierFreeGuidanceLogitsProcessor","unguided_bsz","cond_logits","uncond_logits","TemperatureLogitsWarper","errorMessage","TopPLogitsWarper","filter_value","min_tokens_to_keep","TopKLogitsWarper","LogitsSampler","generation_config","index","sample","getLogits","vocabSize","logs","startIndex","randomSelect","probabilities","sumProbabilities","acc","curr","random","MultinomialSampler","BeamSearchSampler","GreedySampler","topLogits","getTopItems","softmax","sampledIndex","StoppingCriteria","scores","StoppingCriteriaList","criteria","is_done","criterion","criterion_done","MaxLengthCriteria","max_position_embeddings","ids","EosTokenCriteria","BaseStreamer","put","MODEL_TYPES","MODEL_TYPE_MAPPING","MODEL_NAME_TO_CLASS_MAPPING","MODEL_CLASS_TO_NAME_MAPPING","constructSessions","names","sessionData","fileName","dtype","DEFAULT_DEVICE_DTYPE_MAPPING","DEFAULT_DTYPE_SUFFIX_MAPPING","DATA_TYPES","isFp16Supported","suffix","modelFileName","subfolder","getModelFile","ext","ext_buffer","getSession","sessions","sessionRun","checkedInputs","missingInputs","inputName","clone","numInputsProvided","numInputsNeeded","ignored","validateInputs","ortFeed","fromEntries","ort_tensor","replaceTensors","prop","boolTensor","seq2seqForward","model_inputs","encoder_outputs","past_key_values","encoder_inputs","encoderForward","last_hidden_state","decoder_input_ids","other_decoder_inputs","encoder_hidden_states","encoder_attention_mask","attention_mask","decoderForward","encoderFeeds","token_type_ids","new_model_inputs","use_cache_branch","addPastKeyValues","fixed","decoder_prepare_inputs_for_generation","position_ids","bz","seq_len","unsqueeze_","encoder_decoder_prepare_inputs_for_generation","flat","toI64Tensor","PreTrainedModel","main_input_name","forward_params","modelName","modelType","can_generate","_forward","_prepare_inputs_for_generation","promises","model_file_name","info","decoder_model_merged","prompt_encoder_mask_decoder","embed_tokens","vision_encoder","encodec_decode","forward","_get_logits_warper","warpers","_get_logits_processor","input_ids_seq_length","logits_processor","_prepare_generation_config","gen_config","_get_stopping_criteria","stopping_criteria","_validate_model_class","generate_compatible_mappings","MODEL_FOR_CAUSAL_LM_MAPPING_NAMES","MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES","MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES","MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES","generate_compatible_classes","model_mapping","supported_models","prepare_inputs_for_generation","_update_model_kwargs_for_generation","generated_input_ids","getPastKeyValues","cat","ones","_prepare_model_inputs","model_kwargs","input_name","inputs_tensor","model_input_name","encoder_kwargs","full_like","zeros_like","_prepare_decoder_input_ids_for_generation","batch_size","decoder_input_ids_start_data","decoder","num_codebooks","ones_like","streamer","_prepare_encoder_decoder_kwargs_for_generation","input_ids_length","prepared_logits_processor","prepared_stopping_criteria","numInputs","sampler","all_input_ids","tolist","next_tokens_scores","batch_idx","sampledTokens","newTokenId","logProb","bigint","addAttentionsToBeam","beam","cross_attentions","decoder_attentions","groupBeams","beams","groups","decoderResults","pastKeyValues","pkvs","newName","getAttentions","attns","attnName","decoderFeeds","empty","add_encoder_pkv","encoder_dims","num_encoder_heads","encoder_dim_kv","decoder_dims","num_decoder_heads","decoder_dim_kv","num_decoder_layers","num_heads","dim_kv","num_layers","multi_query","keyDims","valueDims","ModelOutput","BaseModelOutput","hidden_states","attentions","BertPreTrainedModel","BertModel","BertForMaskedLM","MaskedLMOutput","BertForSequenceClassification","SequenceClassifierOutput","BertForTokenClassification","TokenClassifierOutput","BertForQuestionAnswering","QuestionAnsweringModelOutput","NomicBertPreTrainedModel","NomicBertModel","RoFormerPreTrainedModel","RoFormerModel","RoFormerForMaskedLM","RoFormerForSequenceClassification","RoFormerForTokenClassification","RoFormerForQuestionAnswering","ConvBertPreTrainedModel","ConvBertModel","ConvBertForMaskedLM","ConvBertForSequenceClassification","ConvBertForTokenClassification","ConvBertForQuestionAnswering","ElectraPreTrainedModel","ElectraModel","ElectraForMaskedLM","ElectraForSequenceClassification","ElectraForTokenClassification","ElectraForQuestionAnswering","CamembertPreTrainedModel","CamembertModel","CamembertForMaskedLM","CamembertForSequenceClassification","CamembertForTokenClassification","CamembertForQuestionAnswering","DebertaPreTrainedModel","DebertaModel","DebertaForMaskedLM","DebertaForSequenceClassification","DebertaForTokenClassification","DebertaForQuestionAnswering","DebertaV2PreTrainedModel","DebertaV2Model","DebertaV2ForMaskedLM","DebertaV2ForSequenceClassification","DebertaV2ForTokenClassification","DebertaV2ForQuestionAnswering","DistilBertPreTrainedModel","DistilBertModel","DistilBertForSequenceClassification","DistilBertForTokenClassification","DistilBertForQuestionAnswering","DistilBertForMaskedLM","EsmPreTrainedModel","EsmModel","EsmForMaskedLM","EsmForSequenceClassification","EsmForTokenClassification","MobileBertPreTrainedModel","MobileBertModel","MobileBertForMaskedLM","MobileBertForSequenceClassification","MobileBertForQuestionAnswering","MPNetPreTrainedModel","MPNetModel","MPNetForMaskedLM","MPNetForSequenceClassification","MPNetForTokenClassification","MPNetForQuestionAnswering","SqueezeBertPreTrainedModel","SqueezeBertModel","SqueezeBertForMaskedLM","SqueezeBertForSequenceClassification","SqueezeBertForQuestionAnswering","AlbertPreTrainedModel","AlbertModel","AlbertForSequenceClassification","AlbertForQuestionAnswering","AlbertForMaskedLM","T5PreTrainedModel","d_kv","num_encoder_layers","T5Model","T5ForConditionalGeneration","LongT5PreTrainedModel","LongT5Model","LongT5ForConditionalGeneration","MT5PreTrainedModel","MT5Model","MT5ForConditionalGeneration","BartPretrainedModel","decoder_layers","decoder_attention_heads","d_model","encoder_layers","encoder_attention_heads","BartModel","BartForConditionalGeneration","BartForSequenceClassification","MBartPreTrainedModel","MBartModel","MBartForConditionalGeneration","MBartForSequenceClassification","MBartForCausalLM","BlenderbotPreTrainedModel","BlenderbotModel","BlenderbotForConditionalGeneration","BlenderbotSmallPreTrainedModel","BlenderbotSmallModel","BlenderbotSmallForConditionalGeneration","RobertaPreTrainedModel","RobertaModel","RobertaForMaskedLM","RobertaForSequenceClassification","RobertaForTokenClassification","RobertaForQuestionAnswering","XLMPreTrainedModel","XLMModel","XLMWithLMHeadModel","XLMForSequenceClassification","XLMForTokenClassification","XLMForQuestionAnswering","XLMRobertaPreTrainedModel","XLMRobertaModel","XLMRobertaForMaskedLM","XLMRobertaForSequenceClassification","XLMRobertaForTokenClassification","XLMRobertaForQuestionAnswering","ASTPreTrainedModel","ASTModel","ASTForAudioClassification","WhisperPreTrainedModel","requires_attention_mask","WhisperModel","WhisperGenerationConfig","return_timestamps","return_token_timestamps","num_frames","alignment_heads","task","language","WhisperForConditionalGeneration","_retrieve_init_tokens","_extract_token_timestamps","generate_outputs","time_precision","median_filter_width","batchedMatrices","batch","weights","transpose","std","calculatedMean","std_mean","smoothedWeights","aTensor","bTensor","stdTensor","meanTensor","cTensor","medianFilter","timestampsShape","sequences","timestamps","matrix","neg","squeeze_","text_indices","time_indices","dynamicTimeWarping","diffs","jumps","mergeArrays","jump_times","VisionEncoderDecoderModel","encoderConfig","encoder","decoderConfig","encoderModelType","MODEL_MAPPING_NAMES_ENCODER_ONLY","MODEL_MAPPING_NAMES_ENCODER_DECODER","decoderModel","decoderModelClass","LlavaPreTrainedModel","text_config","num_attention_heads","num_hidden_layers","hidden_size","LlavaForConditionalGeneration","pixel_values","image_features","inputs_embeds","_merge_input_ids_with_image_features","image_token_index","indexOfImage","findIndex","noImages","allImages","stacked","stacked_attention_mask","im","am","encode_text","encode_image","target_length","past_length","CLIPPreTrainedModel","CLIPModel","CLIPTextModelWithProjection","CLIPVisionModelWithProjection","SiglipPreTrainedModel","SiglipModel","SiglipTextModel","SiglipVisionModel","ChineseCLIPPreTrainedModel","ChineseCLIPModel","CLIPSegPreTrainedModel","CLIPSegModel","CLIPSegForImageSegmentation","GPT2PreTrainedModel","n_head","n_layer","n_embd","GPT2Model","GPT2LMHeadModel","GPTNeoPreTrainedModel","GPTNeoModel","GPTNeoForCausalLM","GPTNeoXPreTrainedModel","GPTNeoXModel","GPTNeoXForCausalLM","GPTJPreTrainedModel","GPTJModel","GPTJForCausalLM","GPTBigCodePreTrainedModel","GPTBigCodeModel","GPTBigCodeForCausalLM","CodeGenPreTrainedModel","CodeGenModel","CodeGenForCausalLM","LlamaPreTrainedModel","num_key_value_heads","LlamaModel","LlamaForCausalLM","Qwen2PreTrainedModel","Qwen2Model","Qwen2ForCausalLM","PhiPreTrainedModel","PhiModel","PhiForCausalLM","BloomPreTrainedModel","BloomModel","BloomForCausalLM","MptPreTrainedModel","n_heads","n_layers","MptModel","MptForCausalLM","OPTPreTrainedModel","OPTModel","OPTForCausalLM","ViTPreTrainedModel","ViTModel","ViTForImageClassification","VitMattePreTrainedModel","VitMatteForImageMatting","ImageMattingOutput","MobileViTPreTrainedModel","MobileViTModel","MobileViTForImageClassification","OwlViTPreTrainedModel","OwlViTModel","OwlViTForObjectDetection","Owlv2PreTrainedModel","Owlv2Model","Owlv2ForObjectDetection","BeitPreTrainedModel","BeitModel","BeitForImageClassification","DetrPreTrainedModel","DetrModel","DetrForObjectDetection","DetrObjectDetectionOutput","DetrForSegmentation","DetrSegmentationOutput","pred_boxes","pred_masks","TableTransformerPreTrainedModel","TableTransformerModel","TableTransformerForObjectDetection","TableTransformerObjectDetectionOutput","DeiTPreTrainedModel","DeiTModel","DeiTForImageClassification","ResNetPreTrainedModel","ResNetModel","ResNetForImageClassification","SwinPreTrainedModel","SwinModel","SwinForImageClassification","Swin2SRPreTrainedModel","Swin2SRModel","Swin2SRForImageSuperResolution","DPTPreTrainedModel","DPTModel","DPTForDepthEstimation","DepthAnythingPreTrainedModel","DepthAnythingForDepthEstimation","GLPNPreTrainedModel","GLPNModel","GLPNForDepthEstimation","DonutSwinPreTrainedModel","DonutSwinModel","ConvNextPreTrainedModel","ConvNextModel","ConvNextForImageClassification","ConvNextV2PreTrainedModel","ConvNextV2Model","ConvNextV2ForImageClassification","Dinov2PreTrainedModel","Dinov2Model","Dinov2ForImageClassification","YolosPreTrainedModel","YolosModel","YolosForObjectDetection","YolosObjectDetectionOutput","SamPreTrainedModel","SamModel","image_embeddings","image_positional_embeddings","get_image_embeddings","input_labels","input_points","numElements","decoder_inputs","input_boxes","SamImageSegmentationOutput","iou_scores","MarianPreTrainedModel","MarianModel","MarianMTModel","M2M100PreTrainedModel","M2M100Model","M2M100ForConditionalGeneration","Wav2Vec2PreTrainedModel","Wav2Vec2Model","Wav2Vec2ForCTC","CausalLMOutput","Wav2Vec2ForSequenceClassification","Wav2Vec2ForAudioFrameClassification","UniSpeechPreTrainedModel","UniSpeechModel","UniSpeechForCTC","UniSpeechForSequenceClassification","UniSpeechSatPreTrainedModel","UniSpeechSatModel","UniSpeechSatForCTC","UniSpeechSatForSequenceClassification","UniSpeechSatForAudioFrameClassification","Wav2Vec2BertPreTrainedModel","Wav2Vec2BertModel","Wav2Vec2BertForCTC","Wav2Vec2BertForSequenceClassification","HubertPreTrainedModel","HubertModel","HubertForCTC","HubertForSequenceClassification","WavLMPreTrainedModel","WavLMModel","WavLMForCTC","WavLMForSequenceClassification","WavLMForXVector","XVectorOutput","WavLMForAudioFrameClassification","SpeechT5PreTrainedModel","SpeechT5Model","SpeechT5ForSpeechToText","SpeechT5ForTextToSpeech","input_values","speaker_embeddings","threshold","minlenratio","maxlenratio","vocoder","reduction_factor","maxlen","minlen","num_mel_bins","spectrogramParts","decoder_outputs","idx","output_sequence","output_sequence_out","prob","spectrum","spectrogram","waveform","SpeechT5HifiGan","TrOCRPreTrainedModel","TrOCRForCausalLM","MistralPreTrainedModel","MistralModel","MistralForCausalLM","Starcoder2PreTrainedModel","Starcoder2Model","Starcoder2ForCausalLM","FalconPreTrainedModel","FalconModel","FalconForCausalLM","ClapPreTrainedModel","ClapModel","ClapTextModelWithProjection","ClapAudioModelWithProjection","VitsPreTrainedModel","VitsModel","VitsModelOutput","SegformerPreTrainedModel","SegformerModel","SegformerForImageClassification","SegformerForSemanticSegmentation","StableLmPreTrainedModel","StableLmModel","StableLmForCausalLM","EfficientNetPreTrainedModel","EfficientNetModel","EfficientNetForImageClassification","MusicgenPreTrainedModel","MusicgenModel","MusicgenForCausalLM","MusicgenForConditionalGeneration","_apply_and_filter_by_delay_pattern_mask","bs_x_codebooks","seqLength","upperBound","newDataSize","diff","inferred","clonedInputIds","structuredClone","output_ids","generate","audio_codes","audio_values","PretrainedMixin","MODEL_CLASS_MAPPINGS","MODEL_CLASS_MAPPING","modelInfo","BASE_IF_FAIL","MODEL_MAPPING_NAMES_DECODER_ONLY","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_MASKED_LM_MAPPING_NAMES","MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES","MODEL_FOR_IMAGE_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_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_IMAGE_TO_IMAGE_MAPPING_NAMES","MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES","MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES","MODEL_CLASS_TYPE_MAPPING","mappings","CUSTOM_MAPPING","AutoModel","AutoModelForSequenceClassification","AutoModelForTokenClassification","AutoModelForSeq2SeqLM","AutoModelForSpeechSeq2Seq","AutoModelForTextToSpectrogram","AutoModelForTextToWaveform","AutoModelForCausalLM","AutoModelForMaskedLM","AutoModelForQuestionAnswering","AutoModelForVision2Seq","AutoModelForImageClassification","AutoModelForImageSegmentation","AutoModelForSemanticSegmentation","AutoModelForObjectDetection","AutoModelForZeroShotObjectDetection","AutoModelForMaskGeneration","AutoModelForCTC","AutoModelForAudioClassification","AutoModelForXVector","AutoModelForAudioFrameClassification","AutoModelForDocumentQuestionAnswering","AutoModelForImageMatting","AutoModelForImageToImage","AutoModelForDepthEstimation","AutoModelForImageFeatureExtraction","Seq2SeqLMOutput","embeddings","start_logits","end_logits","CausalLMOutputWithPast","alphas","wrap","session_bytes","TensorOpRegistry","bilinear_interpolate_4d","_bilinear_interpolate_4d","bicubic_interpolate_4d","_bicubic_interpolate_4d","prepareImages","images","RawImage","prepareAudios","audios","sampling_rate","read_audio","get_bounding_box","box","asInteger","xmin","ymin","xmax","ymax","Pipeline","tokenizer","TextClassificationPipeline","texts","topk","padding","truncation","function_to_apply","problem_type","sigmoid","id2label","vals","score","TokenClassificationPipeline","ignore_labels","isBatched","tokenData","topScoreIndex","entity","skip_special_tokens","QuestionAnsweringPipeline","question","text_pair","sepIndex","sep_token_id","s1","e1","product","answer_tokens","answer","FillMaskPipeline","mask_token_index","mask_token_id","mask_token","itemLogits","sequence","token_str","vocab","Text2TextGenerationPipeline","_key","generate_kwargs","SummarizationPipeline","TranslationPipeline","TextGenerationPipeline","ZeroShotClassificationPipeline","label2id","entailment_id","contradiction_id","candidate_labels","hypothesis_template","multi_label","hypotheses","softmaxEach","premise","entails_logits","hypothesis","scores_sorted","labels","FeatureExtractionPipeline","pooling","quantize","precision","mean_pooling","quantize_embeddings","ImageFeatureExtractionPipeline","pool","preparedImages","pooler_output","image_embeds","AudioClassificationPipeline","audio","single","feature_extractor","preparedAudios","aud","ZeroShotAudioClassificationPipeline","text_inputs","audio_inputs","probs","logits_per_audio","AutomaticSpeechRecognitionPipeline","predicted_ids","predicted_sentences","chunk_length_s","chunk_callback","force_full_sequences","stride_length_s","decoder_prompt_ids","get_decoder_prompt_ids","no_timestamps","chunk_length","max_source_positions","hop_length","chunks","jump","subarr","feature","isFirst","isLast","input_features","is_last","chunk","token_timestamps","full_text","optional","_decode_asr","ImageToTextPipeline","ImageClassificationPipeline","ImageSegmentationPipeline","subtasks_mapping","panoptic","semantic","mask_threshold","overlap_mask_area_threshold","label_ids_to_fuse","target_sizes","subtask","imageSizes","pixel_mask","func","annotation","processed","segmentation","segment","segments_info","maskData","Uint8ClampedArray","mask","label_id","ZeroShotImageClassificationPipeline","logits_per_image","ObjectDetectionPipeline","percentage","post_process_object_detection","boxes","classes","ZeroShotObjectDetectionPipeline","imageSize","DocumentQuestionAnsweringPipeline","TextToAudioPipeline","DEFAULT_VOCODER_ID","generate_speech","ImageToImagePipeline","reconstruction","squeeze","clamp_","mul_","round_","DepthEstimationPipeline","predicted_depth","prediction","interpolate","formatted","depth","SUPPORTED_TASKS","AutoTokenizer","AutoProcessor","TASK_ALIASES","pipeline","pipelineInfo","default","pretrainedOptions","cls","promise","loadItems","dispatchCallback","pipelineClass","center_to_corners_format","centerX","centerY","is_zero_shot","out_logits","out_bbox","num_boxes","num_classes","target_size","bbox","logit","maxIndex","validate_audio_inputs","constraint_to_multiple_of","val","multiple","minVal","maxVal","bankers_round","enforce_size_divisibility","divisor","FeatureExtractor","ImageFeatureExtractor","image_mean","image_std","resample","do_rescale","rescale_factor","do_normalize","do_resize","do_thumbnail","size_divisibility","size_divisor","do_center_crop","crop_size","do_convert_rgb","do_crop_margin","pad_size","do_pad","input_height","input_width","output_height","output_width","resize","gray_threshold","gray_image","grayscale","minValue","x_min","y_min","x_max","y_max","gray_image_data","row","crop","pad_image","pixelData","imgDims","padSize","center","constant_values","imageHeight","imageWidth","imageChannels","paddedImageWidth","paddedImageHeight","paddedPixelData","top","h1","w1","calculateReflectOffset","rescale","get_resize_output_image_size","srcWidth","srcHeight","shortest_edge","longest_edge","max_size","shortResizeFactor","newWidth","newHeight","longResizeFactor","finalWidth","toFixed","finalHeight","keep_aspect_ratio","ensure_multiple_of","scale_height","scale_width","do_convert_grayscale","crop_margin","rgb","thumbnail","crop_width","crop_height","center_crop","reshaped_input_size","padded","paddedWidth","paddedHeight","original_size","permute","imageData","original_sizes","reshaped_input_sizes","SegformerFeatureExtractor","post_process_semantic_segmentation","segmentation_data","hasLabel","DPTFeatureExtractor","DPTImageProcessor","BitImageProcessor","GLPNFeatureExtractor","CLIPFeatureExtractor","CLIPImageProcessor","ChineseCLIPFeatureExtractor","SiglipImageProcessor","ConvNextFeatureExtractor","crop_pct","resize_shortest_edge","ConvNextImageProcessor","ViTFeatureExtractor","ViTImageProcessor","EfficientNetImageProcessor","include_top","MobileViTFeatureExtractor","OwlViTFeatureExtractor","Owlv2ImageProcessor","DeiTFeatureExtractor","BeitFeatureExtractor","DonutFeatureExtractor","NougatImageProcessor","DetrFeatureExtractor","maskSize","remove_low_and_no_objects","class_logits","mask_logits","object_mask_threshold","num_labels","mask_probs_item","pred_scores_item","pred_labels_item","pred_label","pred_score","check_segment_validity","mask_labels","mask_probs","mask_k","mask_k_area","original_area","mask_probs_k_data","mask_exists","compute_segments","pred_scores","pred_labels","segments","bestScores","mask_probs_i_data","current_segment_id","pred_class","post_process_panoptic_segmentation","class_queries_logits","num_queries","post_process_instance_segmentation","YolosFeatureExtractor","SamImageProcessor","reshape_input_points","is_bounding_box","calculateDimensions","originalImageSize","reshapedImageSize","resizeFactors","add_input_labels","masks","binarize","output_masks","target_image_size","interpolated_mask","interpolate_4d","binarizedMaskData","generate_crop_boxes","crop_n_layers","overlap_ratio","points_per_crop","crop_n_points_downscale_factor","Swin2SRImageProcessor","VitMatteImageProcessor","trimaps","trimapData","WhisperFeatureExtractor","mel_filters","mel_filter_bank","n_fft","feature_size","window_function","_extract_fbank_features","power","log_mel","max_num_frames","nb_max_frames","maxValue","n_samples","Wav2Vec2FeatureExtractor","_zero_mean_unit_var_norm","variance","SeamlessM4TFeatureExtractor","periodic","fft_length","preemphasis","mel_floor","remove_dc_offset","pad_to_multiple_of","do_normalize_per_mel_bins","return_attention_mask","features_data","num_features","padded_attention_mask","num_channels","padded_data","padding_value","numPaddedFrames","view","reshapedNumFrames","attention_mask_data","padded_attention_mask_data","ASTFeatureExtractor","denom","ClapFeatureExtractor","nb_frequency_bins","frequency_min","frequency_max","mel_filters_slaney","fft_window_size","_get_input_mel","input_mel","longer","nb_max_samples","padded_inputs","SpeechT5FeatureExtractor","Processor","SamProcessor","post_process_masks","WhisperProcessor","Wav2Vec2ProcessorWithLM","SpeechT5Processor","OwlViTProcessor","preprocessorConfig","feature_extractor_type","image_processor_type","feature_extractor_class","FEATURE_EXTRACTOR_CLASS_MAPPING","PROCESSOR_CLASS_MAPPING","processor_class","loadTokenizer","legacy","createPattern","pattern","invert","Regex","regex","PROBLEMATIC_REGEX_MAP","replaceAll","escapeRegExp","objectToMap","prepareTensorForDecode","clean_up_tokenization","remove_accents","PUNCTUATION_REGEX","AddedToken","content","single_word","lstrip","rstrip","special","normalized","TokenizerModel","tokens_to_ids","unk_token_id","unk_token","end_of_word_suffix","fuse_unk","WordPieceTokenizer","Unigram","BPE","LegacyTokenizerModel","encode","arr","fused","fuse","convert_tokens_to_ids","convert_ids_to_tokens","max_input_chars_per_word","outputTokens","chars","isUnknown","subTokens","currentSubstring","continuing_subword_prefix","moreConfig","piece","unk_id","bosToken","bosTokenId","eosToken","eosTokenId","unkToken","minScore","unkScore","trie","CharTrie","populateNodes","lattice","sentence","len","beginPos","mblen","hasSingleNode","commonPrefixSearch","tokenId","tokenScore","insert","TokenLattice","tokenized","BYTES_TO_UNICODE","ccs","UNICODE_TO_BYTES","reverseDictionary","BPE_SPLIT_TOKEN","bpe_ranks","merges","continuing_subword_suffix","byte_fallback","text_encoder","TextEncoder","cache","bpe","cached","PriorityQueue","startingNode","next","previousNode","currentNode","_add_node","deleted","newPreviousNode","merged","bpe_token_list","padStart","target_lang","bos_token","pad_token","Normalizer","BertNormalizer","Precompiled","NormalizerSequence","Replace","NFC","NFKC","NFKD","StripNormalizer","StripAccents","Lowercase","Prepend","strip_left","strip_right","trimStart","trimEnd","prepend","normalizers","fromConfig","normalizer","_tokenize_chinese_chars","_is_chinese_char","stripAccents","_is_control","_clean_text","clean_text","handle_chinese_chars","lowercase","strip_accents","PreTokenizer","BertPreTokenizer","PreTokenizerSequence","WhitespacePreTokenizer","WhitespaceSplit","MetaspacePreTokenizer","ByteLevelPreTokenizer","SplitPreTokenizer","PunctuationPreTokenizer","DigitsPreTokenizer","ReplacePreTokenizer","pre_tokenize_text","pre_tokenize","add_prefix_space","trim_offsets","use_regex","byte_encoder","byte","matchAll","fullMatch","regexSplit","digit_pattern","individual_digits","PostProcessor","TemplateProcessing","ByteLevelPostProcessor","RobertaProcessing","BertProcessing","post_process","sep","tokens_pair","add_special_tokens","middle","after","pair","processedTokens","SpecialToken","type_id","Sequence","Decoder","added_tokens","WordPieceDecoder","MetaspaceDecoder","ByteLevelDecoder","ReplaceDecoder","ByteFallback","FuseDecoder","StripDecoder","DecoderSequence","CTCDecoder","BPEDecoder","decode_chain","text_decoder","new_tokens","previous_byte_tokens","bytes","string","start_cut","stop_cut","cleanup","prefix","byte_decoder","fatal","ignoreBOM","convert_tokens_to_string","byteArray","sub_texts","current_sub_text","word_delimiter_token","grouped_tokens","decoders","toks","VitsDecoder","decoded","addPrefixSpace","replacement","strRep","str_rep","prepend_scheme","section_index","charsmap","precompiled_charsmap","parts","part","tokenizers","pretokenizers","preTokenizedText","whitespace_split","SPECIAL_TOKEN_ATTRIBUTES","padHelper","value_fn","side","padData","truncateHelper","PreTrainedTokenizer","return_token_type_ids","_default_chat_template","padding_side","tokenizerJSON","tokenizerConfig","_tokenizer_config","pre_tokenizer","post_processor","special_tokens","all_special_ids","addedToken","additional_special_tokens","added_tokens_regex","getToken","sep_token","model_max_length","remove_space","clean_up_tokenization_spaces","do_lowercase_and_remove_accent","chat_template","_compiled_template_cache","__type","return_tensor","encodedTokens","_encode_plus","flatMap","_encode_text","lowercase_and_remove_accent","sectionTokens","_tokenize_helper","tokens2","batch_decode","decode_args","token_ids","isIntegralNumber","decode_single","default_chat_template","_warned_about_chat_template","apply_chat_template","conversation","add_generation_prompt","tokenizer_kwargs","template_dict","compiledTemplate","special_tokens_map","rendered","messages","BertTokenizer","AlbertTokenizer","MobileBertTokenizer","SqueezeBertTokenizer","DebertaTokenizer","DebertaV2Tokenizer","HerbertTokenizer","ConvBertTokenizer","RoFormerTokenizer","DistilBertTokenizer","CamembertTokenizer","XLMTokenizer","ElectraTokenizer","T5Tokenizer","GPT2Tokenizer","BartTokenizer","MBartTokenizer","languageRegex","language_codes","lang_to_token","_build_translation_inputs","raw_inputs","tokenizer_options","MBart50Tokenizer","RobertaTokenizer","BloomTokenizer","splitChars","patternObject","SPIECE_UNDERLINE","LlamaTokenizer","DEFAULT_SYSTEM_PROMPT","use_default_system_prompt","CodeLlamaTokenizer","XLMRobertaTokenizer","MPNetTokenizer","FalconTokenizer","GPTNeoXTokenizer","EsmTokenizer","Qwen2Tokenizer","GemmaTokenizer","Grok1Tokenizer","src_lang_token","src_lang","tgt_lang_token","tgt_lang","NllbTokenizer","M2M100Tokenizer","WHISPER_LANGUAGES","WHISPER_LANGUAGE_MAPPING","WHISPER_TO_LANGUAGE_CODE_MAPPING","WhisperTokenizer","return_language","last_language","returnWordTimestamps","new_chunk","time_offset","previous_tokens","previous_token_timestamps","skip","right_stride_start","last_timestamp","first_timestamp","chunk_len","stride_left","stride_right","current_tokens","current_token_timestamps","resolved_tokens","findLongestCommonSequence","resolved_text","time","rounded_time","timestamp","resolved_token_timestamps","words","collateWordTimestamps","end_time","start_time","new_chunks","token_timestamp_sequences","leftSequence","leftLength","totalSequence","use_token_timestamp_sequences","total_token_timestamp_sequence","left_token_timestamp_sequence","rightSequence","maxIndices","rightLength","eps","leftStart","leftStop","rightStart","rightStop","matches","elem","matching","leftMid","rightMid","token_indices","combineTokensIntoWords","timings","prepend_punctionations","append_punctuations","word_tokens","splitTokensOnUnicode","splitTokensOnSpaces","mergePunctuations","decode_with_timestamps","decodeWithTimestamps","decoded_full","current_indices","unicode_offset","token_idx","subwords","subword_tokens_list","subword_indices_list","punctuationRegex","subword","subword_tokens","subword_indices","with_space","trimmed","punctuation","ix","prepended","appended","newWords","newTokens","newIndices","language_code","langs","language_token_id","task_token_id","no_timestamps_id","CodeGenTokenizer","CLIPTokenizer","SiglipTokenizer","MarianTokenizer","supported_language_codes","matchInfo","remainder","Wav2Vec2CTCTokenizer","BlenderbotTokenizer","BlenderbotSmallTokenizer","SpeechT5Tokenizer","NougatTokenizer","VitsTokenizer","CohereTokenizer","tokenizerName","tokenizer_class","TOKENIZER_CLASS_MAPPING","url","AudioContext","getFile","audioCTX","sampleRate","decodeAudioData","numberOfChannels","SCALING_FACTOR","getChannelData","hanning","factor","PI","cos_vals","cos","HERTZ_TO_MEL_MAPPING","freq","log10","min_log_hertz","min_log_mel","logstep","hertz_to_mel","mel_scale","MEL_TO_HERTZ_MAPPING","mels","linspace","num_frequency_bins","num_mel_filters","min_frequency","max_frequency","triangularize_in_mel_space","mel_freqs","fft_freqs","filter_freqs","mel_to_hertz","fft_bin_width","filter_diff","slopes","slope","numFreqs","ret","down","_create_triangular_filter_bank","enorm","_db_conversion_helper","reference","min_value","db_range","logReference","frame_length","pad_mode","onesided","window_length","half_window","padReflect","d1","d1Max","fft","FFT","inputBuffer","outputBuffer","outputBufferSize","magnitudes","realTransform","j2","pow","magnitude","mel_spec","amplitude_to_db","power_to_db","isTypedArray","__proto__","dimensions","arrs","props","comparator","_heap","_comparator","peek","_siftUp","poppedValue","bottom","_swap","_siftDown","replacedValue","_parent","_left","_right","_greater","temp","maxChild","root","CharTrieNode","ch","child","children","isLeaf","nodes","beginNodes","endNodes","bos","TokenLatticeNode","eos","pos","nodeId","viterbi","rnode","bestScore","bestNode","lnode","backtraceScore","tokenIds","DEVICE_TYPES","cpu","cachedResult","fp32","fp16","q8","int8","uint8","closure","setPrototypeOf","FileResponse","_CONTENT_TYPE_MAP","filePath","Headers","exists","statusText","stats","updateContentType","ReadableStream","controller","enqueue","close","extension","isValidHttpUrl","validHosts","hostname","protocol","urlOrPath","IS_CI","TESTING_REMOTELY","HF_TOKEN","HF_ACCESS_TOKEN","ERROR_MAPPING","FileCache","request","file","outputPath","recursive","path_or_repo_id","caches","requestURL","pathJoin","localPath","remoteURL","encodeURIComponent","fsCacheKey","proposedCacheKey","toCacheResponse","tryCache","cacheHit","handleError","Response","progressInfo","progress","total","contentLength","reader","newLoaded","newBuffer","readResponse","modelPath","jsonData","BROWSER_ENV","WEBWORKER_ENV","createCanvasFunction","ImageDataClass","loadImageFunction","createImageBitmap","rawChannels","metadata","raw","toBuffer","resolveWithObject","convert","RESAMPLING_MAPPING","CONTENT_TYPE_MAP","fromURL","blob","fromBlob","ctx","channel_format","newData","red","green","blue","_update","rgba","resampleMethod","numChannels","toCanvas","toSharp","affine","interpolator","fit","kernel","extract","width_offset","height_offset","sourceX","sourceY","destX","destY","y_padding","y_extract","x_padding","x_extract","quality","convertToBlob","toTensor","cloned","clonedCanvas","toFile","mime","toBlob","dataURL","downloadLink","click","remove","interpolate_data","in_channels","in_height","in_width","out_height","out_width","align_corners","x_scale","y_scale","out_img","inStride","outStride","outOffset","x1","y1","x2","y2","w2","w3","w4","yStride","xStride","idx1","idx2","idx3","idx4","cOffset","permute_data","invStride","permutedData","newIndex","exps","sumExps","dot","arr1","arr2","cos_sim","indexOfMin","indexOfMax","isPowerOfTwo","number","P2FFT","_csize","table","angle","sin","_width","_bitrev","revShift","createComplexArray","fromComplexArray","complex","res","toComplexArray","completeSpectrum","half","transform","_transform4","_realTransform4","inverseTransform","inv","outOff","bitrev","off","_singleTransform2","_singleTransform4","quarterLen","limit","tableBr","tableBi","MBr","MBi","tableCr","tableCi","MCr","MCi","tableDr","tableDi","MDr","MDi","T0r","T0i","T1r","T1i","T2r","T2i","T3r","T3i","evenR","evenI","oddR","oddI","step2","step3","_singleRealTransform2","_singleRealTransform4","NP2FFT","nextP2","log2","bufferSize","chirp","ichirp","_chirpBuffer","_buffer1","_buffer2","_outBuffer1","_outBuffer2","theta","baseR","baseI","result_mod","result_arg","atan2","i2","_slicedChirpBuffer","_f","_transform","real","ib1","ib2","ob2","ob3","a_real","a_imag","b_real","b_imag","windowSize","outputArray","halfWindowSize","valuesIndex","decimals","DataTypeMap","float32","float16","float64","int16","uint16","int32","uint32","int64","uint64","bool","_getitem","iterLength","iterDims","iterSize","_subarray","safeIndex","this_data","o1","o2","totalElements","dimensionSize","reshapedArray","lastArray","sigmoid_","mul","add_","newTensorDims","newOffsets","sliceIndex","offsets","newDims","newBufferSize","originalIndex","keepdim","resultDims","resultIndex","resultMultiplier","normalize_","s2","dimsToStride","calc_squeeze_dims","unsqueeze","calc_unsqueeze_dims","flatten_","start_dim","end_dim","dimsToKeepBefore","dimsToFlatten","dimsToKeepAfter","flatten","inferredIndex","productOther","neg_","clamp","targetDims","sizeTensor","returnedData","embedDim","outIndex","attnMaskOffset","offset2","attn","avg","layer_norm","normalized_shape","featureDim","dimension","tensors","resultSize","resultType","currentDim","correction","output_length","input_length","cost","c0","c1","c2","fullHelper","fill_value","full","typedArrayCls","zeros","signed","inputData","outputData","bit","arrayIndex","bitPosition","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getPrototypeOf","__esModule","def","definition","toStringTag"],"sourceRoot":""}