@omote/core 0.3.25 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events/index.mjs +0 -1
- package/dist/index.d.mts +201 -259
- package/dist/index.d.ts +201 -259
- package/dist/index.js +672 -38674
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +648 -867
- package/dist/index.mjs.map +1 -1
- package/dist/logging/index.mjs +0 -1
- package/package.json +1 -2
- package/dist/chunk-B6TIE56N.mjs +0 -37779
- package/dist/chunk-B6TIE56N.mjs.map +0 -1
- package/dist/chunk-NSSMTXJJ.mjs +0 -8
- package/dist/chunk-NSSMTXJJ.mjs.map +0 -1
- package/dist/transformers.web-T5LWC34T.mjs +0 -1718
- package/dist/transformers.web-T5LWC34T.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://@huggingface/transformers/external%20module%20%22onnxruntime-common%22","webpack://@huggingface/transformers/external%20module%20%22onnxruntime-web%22","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src/backends%7Connxruntime-node","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src/utils%7Cnode:fs","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src/utils%7Cnode:path","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src/utils%7Csharp","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src%7Cnode:fs","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src%7Cnode:path","webpack://@huggingface/transformers/ignored%7C/home/runner/work/transformers.js/transformers.js/src%7Cnode:url","webpack://@huggingface/transformers/node_modules/@huggingface/jinja/dist/index.js","webpack://@huggingface/transformers/src/backends/onnx.js","webpack://@huggingface/transformers/src/base/feature_extraction_utils.js","webpack://@huggingface/transformers/src/base/image_processors_utils.js","webpack://@huggingface/transformers/src/base/processing_utils.js","webpack://@huggingface/transformers/src/configs.js","webpack://@huggingface/transformers/src/env.js","webpack://@huggingface/transformers/src/generation/configuration_utils.js","webpack://@huggingface/transformers/src/generation/logits_process.js","webpack://@huggingface/transformers/src/generation/logits_sampler.js","webpack://@huggingface/transformers/src/generation/stopping_criteria.js","webpack://@huggingface/transformers/src/generation/streamers.js","webpack://@huggingface/transformers/src/models.js","webpack://@huggingface/transformers/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js","webpack://@huggingface/transformers/src/models/auto/feature_extraction_auto.js","webpack://@huggingface/transformers/src/models/auto/image_processing_auto.js","webpack://@huggingface/transformers/src/models/auto/processing_auto.js","webpack://@huggingface/transformers/src/models/beit/image_processing_beit.js","webpack://@huggingface/transformers/src/models/bit/image_processing_bit.js","webpack://@huggingface/transformers/src/models/chinese_clip/image_processing_chinese_clip.js","webpack://@huggingface/transformers/src/models/clap/feature_extraction_clap.js","webpack://@huggingface/transformers/src/models/clip/image_processing_clip.js","webpack://@huggingface/transformers/src/models/convnext/image_processing_convnext.js","webpack://@huggingface/transformers/src/models/dac/feature_extraction_dac.js","webpack://@huggingface/transformers/src/models/deit/image_processing_deit.js","webpack://@huggingface/transformers/src/models/detr/image_processing_detr.js","webpack://@huggingface/transformers/src/models/dinov3_vit/image_processing_dinov3_vit.js","webpack://@huggingface/transformers/src/models/donut/image_processing_donut.js","webpack://@huggingface/transformers/src/models/dpt/image_processing_dpt.js","webpack://@huggingface/transformers/src/models/efficientnet/image_processing_efficientnet.js","webpack://@huggingface/transformers/src/models/encodec/feature_extraction_encodec.js","webpack://@huggingface/transformers/src/models/feature_extractors.js","webpack://@huggingface/transformers/src/models/florence2/processing_florence2.js","webpack://@huggingface/transformers/src/models/gemma3n/feature_extraction_gemma3n.js","webpack://@huggingface/transformers/src/models/gemma3n/processing_gemma3n.js","webpack://@huggingface/transformers/src/models/glpn/image_processing_glpn.js","webpack://@huggingface/transformers/src/models/grounding_dino/image_processing_grounding_dino.js","webpack://@huggingface/transformers/src/models/grounding_dino/processing_grounding_dino.js","webpack://@huggingface/transformers/src/models/idefics3/image_processing_idefics3.js","webpack://@huggingface/transformers/src/models/idefics3/processing_idefics3.js","webpack://@huggingface/transformers/src/models/image_processors.js","webpack://@huggingface/transformers/src/models/janus/image_processing_janus.js","webpack://@huggingface/transformers/src/models/janus/processing_janus.js","webpack://@huggingface/transformers/src/models/jina_clip/image_processing_jina_clip.js","webpack://@huggingface/transformers/src/models/jina_clip/processing_jina_clip.js","webpack://@huggingface/transformers/src/models/llava/processing_llava.js","webpack://@huggingface/transformers/src/models/llava_onevision/image_processing_llava_onevision.js","webpack://@huggingface/transformers/src/models/mask2former/image_processing_mask2former.js","webpack://@huggingface/transformers/src/models/maskformer/image_processing_maskformer.js","webpack://@huggingface/transformers/src/models/mgp_str/processing_mgp_str.js","webpack://@huggingface/transformers/src/models/mobilenet_v1/image_processing_mobilenet_v1.js","webpack://@huggingface/transformers/src/models/mobilenet_v2/image_processing_mobilenet_v2.js","webpack://@huggingface/transformers/src/models/mobilenet_v3/image_processing_mobilenet_v3.js","webpack://@huggingface/transformers/src/models/mobilenet_v4/image_processing_mobilenet_v4.js","webpack://@huggingface/transformers/src/models/mobilevit/image_processing_mobilevit.js","webpack://@huggingface/transformers/src/models/moonshine/feature_extraction_moonshine.js","webpack://@huggingface/transformers/src/models/moonshine/processing_moonshine.js","webpack://@huggingface/transformers/src/models/nougat/image_processing_nougat.js","webpack://@huggingface/transformers/src/models/owlv2/image_processing_owlv2.js","webpack://@huggingface/transformers/src/models/owlvit/image_processing_owlvit.js","webpack://@huggingface/transformers/src/models/owlvit/processing_owlvit.js","webpack://@huggingface/transformers/src/models/paligemma/processing_paligemma.js","webpack://@huggingface/transformers/src/models/parakeet/feature_extraction_parakeet.js","webpack://@huggingface/transformers/src/models/phi3_v/image_processing_phi3_v.js","webpack://@huggingface/transformers/src/models/phi3_v/processing_phi3_v.js","webpack://@huggingface/transformers/src/models/pixtral/image_processing_pixtral.js","webpack://@huggingface/transformers/src/models/pixtral/processing_pixtral.js","webpack://@huggingface/transformers/src/models/processors.js","webpack://@huggingface/transformers/src/models/pvt/image_processing_pvt.js","webpack://@huggingface/transformers/src/models/pyannote/feature_extraction_pyannote.js","webpack://@huggingface/transformers/src/models/pyannote/processing_pyannote.js","webpack://@huggingface/transformers/src/models/qwen2_vl/image_processing_qwen2_vl.js","webpack://@huggingface/transformers/src/models/qwen2_vl/processing_qwen2_vl.js","webpack://@huggingface/transformers/src/models/rt_detr/image_processing_rt_detr.js","webpack://@huggingface/transformers/src/models/sam/image_processing_sam.js","webpack://@huggingface/transformers/src/models/sam/processing_sam.js","webpack://@huggingface/transformers/src/models/sam2/image_processing_sam2.js","webpack://@huggingface/transformers/src/models/sam2/processing_sam2.js","webpack://@huggingface/transformers/src/models/sam3/image_processing_sam3.js","webpack://@huggingface/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js","webpack://@huggingface/transformers/src/models/segformer/image_processing_segformer.js","webpack://@huggingface/transformers/src/models/siglip/image_processing_siglip.js","webpack://@huggingface/transformers/src/models/smolvlm/image_processing_smolvlm.js","webpack://@huggingface/transformers/src/models/smolvlm/processing_smolvlm.js","webpack://@huggingface/transformers/src/models/snac/feature_extraction_snac.js","webpack://@huggingface/transformers/src/models/speecht5/feature_extraction_speecht5.js","webpack://@huggingface/transformers/src/models/speecht5/processing_speecht5.js","webpack://@huggingface/transformers/src/models/swin2sr/image_processing_swin2sr.js","webpack://@huggingface/transformers/src/models/ultravox/processing_ultravox.js","webpack://@huggingface/transformers/src/models/vit/image_processing_vit.js","webpack://@huggingface/transformers/src/models/vitmatte/image_processing_vitmatte.js","webpack://@huggingface/transformers/src/models/vitpose/image_processing_vitpose.js","webpack://@huggingface/transformers/src/models/voxtral/processing_voxtral.js","webpack://@huggingface/transformers/src/models/wav2vec2/feature_extraction_wav2vec2.js","webpack://@huggingface/transformers/src/models/wav2vec2/processing_wav2vec2.js","webpack://@huggingface/transformers/src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js","webpack://@huggingface/transformers/src/models/wespeaker/feature_extraction_wespeaker.js","webpack://@huggingface/transformers/src/models/whisper/common_whisper.js","webpack://@huggingface/transformers/src/models/whisper/feature_extraction_whisper.js","webpack://@huggingface/transformers/src/models/whisper/generation_whisper.js","webpack://@huggingface/transformers/src/models/whisper/processing_whisper.js","webpack://@huggingface/transformers/src/models/yolos/image_processing_yolos.js","webpack://@huggingface/transformers/src/ops/registry.js","webpack://@huggingface/transformers/src/pipelines.js","webpack://@huggingface/transformers/src/tokenizers.js","webpack://@huggingface/transformers/src/utils/audio.js","webpack://@huggingface/transformers/src/utils/constants.js","webpack://@huggingface/transformers/src/utils/core.js","webpack://@huggingface/transformers/src/utils/data-structures.js","webpack://@huggingface/transformers/src/utils/devices.js","webpack://@huggingface/transformers/src/utils/dtypes.js","webpack://@huggingface/transformers/src/utils/generic.js","webpack://@huggingface/transformers/src/utils/hub.js","webpack://@huggingface/transformers/src/utils/image.js","webpack://@huggingface/transformers/src/utils/maths.js","webpack://@huggingface/transformers/src/utils/tensor.js","webpack://@huggingface/transformers/src/utils/video.js","webpack://@huggingface/transformers/webpack/bootstrap","webpack://@huggingface/transformers/webpack/runtime/create%20fake%20namespace%20object","webpack://@huggingface/transformers/webpack/runtime/define%20property%20getters","webpack://@huggingface/transformers/webpack/runtime/hasOwnProperty%20shorthand","webpack://@huggingface/transformers/webpack/runtime/make%20namespace%20object","webpack://@huggingface/transformers/src/transformers.js"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE_onnxruntime_common_82b39e9f__;","module.exports = __WEBPACK_EXTERNAL_MODULE_onnxruntime_web_74d14b94__;","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","// 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, 1.0\n StringLiteral: \"StringLiteral\",\n // 'string'\n Identifier: \"Identifier\",\n // Variables, functions, statements, booleans, 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 Comment: \"Comment\"\n // {# ... #}\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}\nfunction isWhitespace(char) {\n return /\\s/.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.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 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(/{%\\s*(end)?generation\\s*%}/gs, \"\");\n}\nfunction tokenize(source, options = {}) {\n const tokens = [];\n const src = preprocess(source, options);\n let cursorPosition = 0;\n let curlyBracketDepth = 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 const stripTrailingWhitespace = () => {\n const lastToken = tokens.at(-1);\n if (lastToken && lastToken.type === TOKEN_TYPES.Text) {\n lastToken.value = lastToken.value.trimEnd();\n if (lastToken.value === \"\") {\n tokens.pop();\n }\n }\n };\n const skipLeadingWhitespace = () => {\n while (cursorPosition < src.length && isWhitespace(src[cursorPosition])) {\n ++cursorPosition;\n }\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 || lastTokenType === TOKEN_TYPES.Comment) {\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] === \"{\" || 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 if (src[cursorPosition] === \"{\" && src[cursorPosition + 1] === \"#\") {\n cursorPosition += 2;\n const stripBefore = src[cursorPosition] === \"-\";\n if (stripBefore) {\n ++cursorPosition;\n }\n let comment = \"\";\n while (src[cursorPosition] !== \"#\" || src[cursorPosition + 1] !== \"}\") {\n if (cursorPosition + 2 >= src.length) {\n throw new SyntaxError(\"Missing end of comment tag\");\n }\n comment += src[cursorPosition++];\n }\n const stripAfter = comment.endsWith(\"-\");\n if (stripAfter) {\n comment = comment.slice(0, -1);\n }\n if (stripBefore) {\n stripTrailingWhitespace();\n }\n tokens.push(new Token(comment, TOKEN_TYPES.Comment));\n cursorPosition += 2;\n if (stripAfter) {\n skipLeadingWhitespace();\n }\n continue;\n }\n if (src.slice(cursorPosition, cursorPosition + 3) === \"{%-\") {\n stripTrailingWhitespace();\n tokens.push(new Token(\"{%\", TOKEN_TYPES.OpenStatement));\n cursorPosition += 3;\n continue;\n }\n if (src.slice(cursorPosition, cursorPosition + 3) === \"{{-\") {\n stripTrailingWhitespace();\n tokens.push(new Token(\"{{\", TOKEN_TYPES.OpenExpression));\n curlyBracketDepth = 0;\n cursorPosition += 3;\n continue;\n }\n consumeWhile(isWhitespace);\n if (src.slice(cursorPosition, cursorPosition + 3) === \"-%}\") {\n tokens.push(new Token(\"%}\", TOKEN_TYPES.CloseStatement));\n cursorPosition += 3;\n skipLeadingWhitespace();\n continue;\n }\n if (src.slice(cursorPosition, cursorPosition + 3) === \"-}}\") {\n tokens.push(new Token(\"}}\", TOKEN_TYPES.CloseExpression));\n cursorPosition += 3;\n skipLeadingWhitespace();\n continue;\n }\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.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 [seq, type] of ORDERED_MAPPING_TABLE) {\n if (seq === \"}}\" && curlyBracketDepth > 0) {\n continue;\n }\n const slice2 = src.slice(cursorPosition, cursorPosition + seq.length);\n if (slice2 === seq) {\n tokens.push(new Token(seq, type));\n if (type === TOKEN_TYPES.OpenExpression) {\n curlyBracketDepth = 0;\n } else if (type === TOKEN_TYPES.OpenCurlyBracket) {\n ++curlyBracketDepth;\n } else if (type === TOKEN_TYPES.CloseCurlyBracket) {\n --curlyBracketDepth;\n }\n cursorPosition += seq.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 let num = consumeWhile(isInteger);\n if (src[cursorPosition] === \".\" && isInteger(src[cursorPosition + 1])) {\n ++cursorPosition;\n const frac = consumeWhile(isInteger);\n num = `${num}.${frac}`;\n }\n tokens.push(new Token(num, TOKEN_TYPES.NumericLiteral));\n continue;\n }\n if (isWord(char)) {\n const word = consumeWhile(isWord);\n tokens.push(new Token(word, TOKEN_TYPES.Identifier));\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, defaultBlock) {\n super();\n this.loopvar = loopvar;\n this.iterable = iterable;\n this.body = body;\n this.defaultBlock = defaultBlock;\n }\n type = \"For\";\n};\nvar Break = class extends Statement {\n type = \"Break\";\n};\nvar Continue = class extends Statement {\n type = \"Continue\";\n};\nvar SetStatement = class extends Statement {\n constructor(assignee, value, body) {\n super();\n this.assignee = assignee;\n this.value = value;\n this.body = body;\n }\n type = \"Set\";\n};\nvar Macro = class extends Statement {\n constructor(name, args, body) {\n super();\n this.name = name;\n this.args = args;\n this.body = body;\n }\n type = \"Macro\";\n};\nvar Comment = class extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Comment\";\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 IntegerLiteral = class extends Literal {\n type = \"IntegerLiteral\";\n};\nvar FloatLiteral = class extends Literal {\n type = \"FloatLiteral\";\n};\nvar StringLiteral = class extends Literal {\n type = \"StringLiteral\";\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 FilterStatement = class extends Statement {\n constructor(filter, body) {\n super();\n this.filter = filter;\n this.body = body;\n }\n type = \"FilterStatement\";\n};\nvar SelectExpression = class extends Expression {\n constructor(lhs, test) {\n super();\n this.lhs = lhs;\n this.test = test;\n }\n type = \"SelectExpression\";\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};\nvar SpreadExpression = class extends Expression {\n constructor(argument) {\n super();\n this.argument = argument;\n }\n type = \"SpreadExpression\";\n};\nvar CallStatement = class extends Statement {\n constructor(call, callerArgs, body) {\n super();\n this.call = call;\n this.callerArgs = callerArgs;\n this.body = body;\n }\n type = \"CallStatement\";\n};\nvar Ternary = class extends Expression {\n constructor(condition, trueExpr, falseExpr) {\n super();\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n type = \"Ternary\";\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 expectIdentifier(name) {\n if (!isIdentifier(name)) {\n throw new SyntaxError(`Expected ${name}`);\n }\n ++current;\n }\n function parseAny() {\n switch (tokens[current].type) {\n case TOKEN_TYPES.Comment:\n return new Comment(tokens[current++].value);\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 is(...types) {\n return current + types.length <= tokens.length && types.every((type, i) => type === tokens[current + i].type);\n }\n function isStatement(...names) {\n return tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type === TOKEN_TYPES.Identifier && names.includes(tokens[current + 1]?.value);\n }\n function isIdentifier(...names) {\n return current + names.length <= tokens.length && names.every((name, i) => tokens[current + i].type === \"Identifier\" && name === tokens[current + i].value);\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 if (tokens[current].type !== TOKEN_TYPES.Identifier) {\n throw new SyntaxError(`Unknown statement, got ${tokens[current].type}`);\n }\n const name = tokens[current].value;\n let result;\n switch (name) {\n case \"set\":\n ++current;\n result = parseSetStatement();\n break;\n case \"if\":\n ++current;\n result = parseIfStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expectIdentifier(\"endif\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n case \"macro\":\n ++current;\n result = parseMacroStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expectIdentifier(\"endmacro\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n case \"for\":\n ++current;\n result = parseForStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expectIdentifier(\"endfor\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n case \"call\": {\n ++current;\n let callerArgs = null;\n if (is(TOKEN_TYPES.OpenParen)) {\n callerArgs = parseArgs();\n }\n const callee = parsePrimaryExpression();\n if (callee.type !== \"Identifier\") {\n throw new SyntaxError(`Expected identifier following call statement`);\n }\n const callArgs = parseArgs();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n while (!isStatement(\"endcall\")) {\n body.push(parseAny());\n }\n expect(TOKEN_TYPES.OpenStatement, \"Expected '{%'\");\n expectIdentifier(\"endcall\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const callExpr = new CallExpression(callee, callArgs);\n result = new CallStatement(callExpr, callerArgs, body);\n break;\n }\n case \"break\":\n ++current;\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n result = new Break();\n break;\n case \"continue\":\n ++current;\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n result = new Continue();\n break;\n case \"filter\": {\n ++current;\n let filterNode = parsePrimaryExpression();\n if (filterNode instanceof Identifier && is(TOKEN_TYPES.OpenParen)) {\n filterNode = parseCallExpression(filterNode);\n }\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const filterBody = [];\n while (!isStatement(\"endfilter\")) {\n filterBody.push(parseAny());\n }\n expect(TOKEN_TYPES.OpenStatement, \"Expected '{%'\");\n expectIdentifier(\"endfilter\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected '%}'\");\n result = new FilterStatement(filterNode, filterBody);\n break;\n }\n default:\n throw new SyntaxError(`Unknown statement type: ${name}`);\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 = parseExpressionSequence();\n let value = null;\n const body = [];\n if (is(TOKEN_TYPES.Equals)) {\n ++current;\n value = parseExpressionSequence();\n } else {\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n while (!isStatement(\"endset\")) {\n body.push(parseAny());\n }\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expectIdentifier(\"endset\");\n }\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n return new SetStatement(left, value, body);\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 (!isStatement(\"elif\", \"else\", \"endif\")) {\n body.push(parseAny());\n }\n if (isStatement(\"elif\")) {\n ++current;\n ++current;\n const result = parseIfStatement();\n alternate.push(result);\n } else if (isStatement(\"else\")) {\n ++current;\n ++current;\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n while (!isStatement(\"endif\")) {\n alternate.push(parseAny());\n }\n }\n return new If(test, body, alternate);\n }\n function parseMacroStatement() {\n const name = parsePrimaryExpression();\n if (name.type !== \"Identifier\") {\n throw new SyntaxError(`Expected identifier following macro statement`);\n }\n const args = parseArgs();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n while (!isStatement(\"endmacro\")) {\n body.push(parseAny());\n }\n return new Macro(name, args, body);\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 if (!isIdentifier(\"in\")) {\n throw new SyntaxError(\"Expected `in` keyword following loop variable\");\n }\n ++current;\n const iterable = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n while (!isStatement(\"endfor\", \"else\")) {\n body.push(parseAny());\n }\n const alternative = [];\n if (isStatement(\"else\")) {\n ++current;\n ++current;\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n while (!isStatement(\"endfor\")) {\n alternative.push(parseAny());\n }\n }\n return new For(loopVariable, iterable, body, alternative);\n }\n function parseExpression() {\n return parseIfExpression();\n }\n function parseIfExpression() {\n const a = parseLogicalOrExpression();\n if (isIdentifier(\"if\")) {\n ++current;\n const test = parseLogicalOrExpression();\n if (isIdentifier(\"else\")) {\n ++current;\n const falseExpr = parseIfExpression();\n return new Ternary(test, a, falseExpr);\n } else {\n return new SelectExpression(a, test);\n }\n }\n return a;\n }\n function parseLogicalOrExpression() {\n let left = parseLogicalAndExpression();\n while (isIdentifier(\"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 (isIdentifier(\"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 (isIdentifier(\"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 (true) {\n let operator;\n if (isIdentifier(\"not\", \"in\")) {\n operator = new Token(\"not in\", TOKEN_TYPES.Identifier);\n current += 2;\n } else if (isIdentifier(\"in\")) {\n operator = tokens[current++];\n } else if (is(TOKEN_TYPES.ComparisonBinaryOperator)) {\n operator = tokens[current++];\n } else {\n break;\n }\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(parsePrimaryExpression());\n if (is(TOKEN_TYPES.OpenParen)) {\n return parseCallExpression(member);\n }\n return member;\n }\n function parseCallExpression(callee) {\n let expression = new CallExpression(callee, parseArgs());\n expression = parseMemberExpression(expression);\n if (is(TOKEN_TYPES.OpenParen)) {\n expression = parseCallExpression(expression);\n }\n return expression;\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;\n if (tokens[current].type === TOKEN_TYPES.MultiplicativeBinaryOperator && tokens[current].value === \"*\") {\n ++current;\n const expr = parseExpression();\n argument = new SpreadExpression(expr);\n } else {\n 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 }\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(object) {\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.OpenSquareBracket;\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 const right = parseTestExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseTestExpression() {\n let operand = parseFilterExpression();\n while (isIdentifier(\"is\")) {\n ++current;\n const negate = isIdentifier(\"not\");\n if (negate) {\n ++current;\n }\n const filter = parsePrimaryExpression();\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 const num = token.value;\n return num.includes(\".\") ? new FloatLiteral(Number(num)) : new IntegerLiteral(Number(num));\n }\n case TOKEN_TYPES.StringLiteral: {\n let value = token.value;\n while (is(TOKEN_TYPES.StringLiteral)) {\n value += tokens[current++].value;\n }\n return new StringLiteral(value);\n }\n case TOKEN_TYPES.Identifier:\n return new Identifier(token.value);\n case TOKEN_TYPES.OpenParen: {\n const expression = parseExpressionSequence();\n expect(TOKEN_TYPES.CloseParen, \"Expected closing parenthesis, got ${tokens[current].type} instead.\");\n return expression;\n }\n case TOKEN_TYPES.OpenSquareBracket: {\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 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}\nfunction strftime_now(format2) {\n return strftime(/* @__PURE__ */ new Date(), format2);\n}\nfunction strftime(date, format2) {\n const monthFormatterLong = new Intl.DateTimeFormat(void 0, { month: \"long\" });\n const monthFormatterShort = new Intl.DateTimeFormat(void 0, { month: \"short\" });\n const pad2 = (n) => n < 10 ? \"0\" + n : n.toString();\n return format2.replace(/%[YmdbBHM%]/g, (token) => {\n switch (token) {\n case \"%Y\":\n return date.getFullYear().toString();\n case \"%m\":\n return pad2(date.getMonth() + 1);\n case \"%d\":\n return pad2(date.getDate());\n case \"%b\":\n return monthFormatterShort.format(date);\n case \"%B\":\n return monthFormatterLong.format(date);\n case \"%H\":\n return pad2(date.getHours());\n case \"%M\":\n return pad2(date.getMinutes());\n case \"%%\":\n return \"%\";\n default:\n return token;\n }\n });\n}\nfunction escapeRegExp(s) {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nfunction replace(str, oldvalue, newvalue, count) {\n if (count === 0)\n return str;\n let remaining = count == null || count < 0 ? Infinity : count;\n const pattern = oldvalue.length === 0 ? new RegExp(\"(?=)\", \"gu\") : new RegExp(escapeRegExp(oldvalue), \"gu\");\n return str.replaceAll(pattern, (match) => {\n if (remaining > 0) {\n --remaining;\n return newvalue;\n }\n return match;\n });\n}\n\n// src/runtime.ts\nvar BreakControl = class extends Error {\n};\nvar ContinueControl = class extends Error {\n};\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 toString() {\n return String(this.value);\n }\n};\nvar IntegerValue = class extends RuntimeValue {\n type = \"IntegerValue\";\n};\nvar FloatValue = class extends RuntimeValue {\n type = \"FloatValue\";\n toString() {\n return this.value % 1 === 0 ? this.value.toFixed(1) : this.value.toString();\n }\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 [\n \"capitalize\",\n new FunctionValue(() => {\n return new StringValue(this.value.charAt(0).toUpperCase() + this.value.slice(1));\n })\n ],\n [\"length\", new IntegerValue(this.value.length)],\n [\n \"rstrip\",\n new FunctionValue(() => {\n return new StringValue(this.value.trimEnd());\n })\n ],\n [\n \"lstrip\",\n new FunctionValue(() => {\n return new StringValue(this.value.trimStart());\n })\n ],\n [\n \"startswith\",\n new FunctionValue((args) => {\n if (args.length === 0) {\n throw new Error(\"startswith() requires at least one argument\");\n }\n const pattern = args[0];\n if (pattern instanceof StringValue) {\n return new BooleanValue(this.value.startsWith(pattern.value));\n } else if (pattern instanceof ArrayValue) {\n for (const item of pattern.value) {\n if (!(item instanceof StringValue)) {\n throw new Error(\"startswith() tuple elements must be strings\");\n }\n if (this.value.startsWith(item.value)) {\n return new BooleanValue(true);\n }\n }\n return new BooleanValue(false);\n }\n throw new Error(\"startswith() argument must be a string or tuple of strings\");\n })\n ],\n [\n \"endswith\",\n new FunctionValue((args) => {\n if (args.length === 0) {\n throw new Error(\"endswith() requires at least one argument\");\n }\n const pattern = args[0];\n if (pattern instanceof StringValue) {\n return new BooleanValue(this.value.endsWith(pattern.value));\n } else if (pattern instanceof ArrayValue) {\n for (const item of pattern.value) {\n if (!(item instanceof StringValue)) {\n throw new Error(\"endswith() tuple elements must be strings\");\n }\n if (this.value.endsWith(item.value)) {\n return new BooleanValue(true);\n }\n }\n return new BooleanValue(false);\n }\n throw new Error(\"endswith() argument must be a string or tuple of strings\");\n })\n ],\n [\n \"split\",\n // follows Python's `str.split(sep=None, maxsplit=-1)` function behavior\n // https://docs.python.org/3.13/library/stdtypes.html#str.split\n new FunctionValue((args) => {\n const sep = args[0] ?? new NullValue();\n if (!(sep instanceof StringValue || sep instanceof NullValue)) {\n throw new Error(\"sep argument must be a string or null\");\n }\n const maxsplit = args[1] ?? new IntegerValue(-1);\n if (!(maxsplit instanceof IntegerValue)) {\n throw new Error(\"maxsplit argument must be a number\");\n }\n let result = [];\n if (sep instanceof NullValue) {\n const text = this.value.trimStart();\n for (const { 0: match, index } of text.matchAll(/\\S+/g)) {\n if (maxsplit.value !== -1 && result.length >= maxsplit.value && index !== void 0) {\n result.push(match + text.slice(index + match.length));\n break;\n }\n result.push(match);\n }\n } else {\n if (sep.value === \"\") {\n throw new Error(\"empty separator\");\n }\n result = this.value.split(sep.value);\n if (maxsplit.value !== -1 && result.length > maxsplit.value) {\n result.push(result.splice(maxsplit.value).join(sep.value));\n }\n }\n return new ArrayValue(result.map((part) => new StringValue(part)));\n })\n ],\n [\n \"replace\",\n new FunctionValue((args) => {\n if (args.length < 2) {\n throw new Error(\"replace() requires at least two arguments\");\n }\n const oldValue = args[0];\n const newValue = args[1];\n if (!(oldValue instanceof StringValue && newValue instanceof StringValue)) {\n throw new Error(\"replace() arguments must be strings\");\n }\n let count;\n if (args.length > 2) {\n if (args[2].type === \"KeywordArgumentsValue\") {\n count = args[2].value.get(\"count\") ?? new NullValue();\n } else {\n count = args[2];\n }\n } else {\n count = new NullValue();\n }\n if (!(count instanceof IntegerValue || count instanceof NullValue)) {\n throw new Error(\"replace() count argument must be a number or null\");\n }\n return new StringValue(replace(this.value, oldValue.value, newValue.value, count.value));\n })\n ]\n ]);\n};\nvar BooleanValue = class extends RuntimeValue {\n type = \"BooleanValue\";\n};\nfunction toJSON(input, indent, depth, convertUndefinedToNull = true) {\n const currentDepth = depth ?? 0;\n switch (input.type) {\n case \"NullValue\":\n return \"null\";\n case \"UndefinedValue\":\n return convertUndefinedToNull ? \"null\" : \"undefined\";\n case \"IntegerValue\":\n case \"FloatValue\":\n case \"StringValue\":\n case \"BooleanValue\":\n return JSON.stringify(input.value);\n case \"ArrayValue\":\n case \"ObjectValue\": {\n const indentValue = indent ? \" \".repeat(indent) : \"\";\n const basePadding = \"\\n\" + indentValue.repeat(currentDepth);\n const childrenPadding = basePadding + indentValue;\n if (input.type === \"ArrayValue\") {\n const core = input.value.map(\n (x) => toJSON(x, indent, currentDepth + 1, convertUndefinedToNull)\n );\n return indent ? `[${childrenPadding}${core.join(`,${childrenPadding}`)}${basePadding}]` : `[${core.join(\", \")}]`;\n } else {\n const core = Array.from(input.value.entries()).map(([key, value]) => {\n const v = `\"${key}\": ${toJSON(value, indent, currentDepth + 1, convertUndefinedToNull)}`;\n return indent ? `${childrenPadding}${v}` : v;\n });\n return indent ? `{${core.join(\",\")}${basePadding}}` : `{${core.join(\", \")}}`;\n }\n }\n default:\n throw new Error(`Cannot convert to JSON: ${input.type}`);\n }\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 [\"items\", new FunctionValue(() => this.items())],\n [\"keys\", new FunctionValue(() => this.keys())],\n [\"values\", new FunctionValue(() => this.values())],\n [\n \"dictsort\",\n new FunctionValue((args) => {\n let kwargs = /* @__PURE__ */ new Map();\n const positionalArgs = args.filter((arg) => {\n if (arg instanceof KeywordArgumentsValue) {\n kwargs = arg.value;\n return false;\n }\n return true;\n });\n const caseSensitive = positionalArgs.at(0) ?? kwargs.get(\"case_sensitive\") ?? new BooleanValue(false);\n if (!(caseSensitive instanceof BooleanValue)) {\n throw new Error(\"case_sensitive must be a boolean\");\n }\n const by = positionalArgs.at(1) ?? kwargs.get(\"by\") ?? new StringValue(\"key\");\n if (!(by instanceof StringValue)) {\n throw new Error(\"by must be a string\");\n }\n if (![\"key\", \"value\"].includes(by.value)) {\n throw new Error(\"by must be either 'key' or 'value'\");\n }\n const reverse = positionalArgs.at(2) ?? kwargs.get(\"reverse\") ?? new BooleanValue(false);\n if (!(reverse instanceof BooleanValue)) {\n throw new Error(\"reverse must be a boolean\");\n }\n const items = Array.from(this.value.entries()).map(([key, value]) => new ArrayValue([new StringValue(key), value])).sort((a, b) => {\n const index = by.value === \"key\" ? 0 : 1;\n const aVal = a.value[index];\n const bVal = b.value[index];\n const result = compareRuntimeValues(aVal, bVal, caseSensitive.value);\n return reverse.value ? -result : result;\n });\n return new ArrayValue(items);\n })\n ]\n ]);\n items() {\n return new ArrayValue(\n Array.from(this.value.entries()).map(([key, value]) => new ArrayValue([new StringValue(key), value]))\n );\n }\n keys() {\n return new ArrayValue(Array.from(this.value.keys()).map((key) => new StringValue(key)));\n }\n values() {\n return new ArrayValue(Array.from(this.value.values()));\n }\n toString() {\n return toJSON(this, null, 0, false);\n }\n};\nvar KeywordArgumentsValue = class extends ObjectValue {\n type = \"KeywordArgumentsValue\";\n};\nvar ArrayValue = class extends RuntimeValue {\n type = \"ArrayValue\";\n builtins = /* @__PURE__ */ new Map([[\"length\", new IntegerValue(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 toString() {\n return toJSON(this, null, 0, false);\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 instanceof IntegerValue)) {\n throw new Error(`cannot odd on ${operand.type}`);\n }\n return operand.value % 2 !== 0;\n }\n ],\n [\n \"even\",\n (operand) => {\n if (!(operand instanceof IntegerValue)) {\n throw new Error(`cannot even on ${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 [\"none\", (operand) => operand.type === \"NullValue\"],\n [\"string\", (operand) => operand.type === \"StringValue\"],\n [\"number\", (operand) => operand instanceof IntegerValue || operand instanceof FloatValue],\n [\"integer\", (operand) => operand instanceof IntegerValue],\n [\"iterable\", (operand) => operand.type === \"ArrayValue\" || operand.type === \"StringValue\"],\n [\"mapping\", (operand) => operand.type === \"ObjectValue\"],\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 [\"eq\", (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};\nfunction setupGlobals(env) {\n env.set(\"false\", false);\n env.set(\"true\", true);\n env.set(\"none\", null);\n env.set(\"raise_exception\", (args) => {\n throw new Error(args);\n });\n env.set(\"range\", range);\n env.set(\"strftime_now\", strftime_now);\n env.set(\"True\", true);\n env.set(\"False\", false);\n env.set(\"None\", null);\n}\nfunction getAttributeValue(item, attributePath) {\n const parts = attributePath.split(\".\");\n let value = item;\n for (const part of parts) {\n if (value instanceof ObjectValue) {\n value = value.value.get(part) ?? new UndefinedValue();\n } else if (value instanceof ArrayValue) {\n const index = parseInt(part, 10);\n if (!isNaN(index) && index >= 0 && index < value.value.length) {\n value = value.value[index];\n } else {\n return new UndefinedValue();\n }\n } else {\n return new UndefinedValue();\n }\n }\n return value;\n}\nfunction compareRuntimeValues(a, b, caseSensitive = false) {\n if (a instanceof NullValue && b instanceof NullValue) {\n return 0;\n }\n if (a instanceof NullValue || b instanceof NullValue) {\n throw new Error(`Cannot compare ${a.type} with ${b.type}`);\n }\n if (a instanceof UndefinedValue && b instanceof UndefinedValue) {\n return 0;\n }\n if (a instanceof UndefinedValue || b instanceof UndefinedValue) {\n throw new Error(`Cannot compare ${a.type} with ${b.type}`);\n }\n const isNumericLike = (v) => v instanceof IntegerValue || v instanceof FloatValue || v instanceof BooleanValue;\n const getNumericValue = (v) => {\n if (v instanceof BooleanValue) {\n return v.value ? 1 : 0;\n }\n return v.value;\n };\n if (isNumericLike(a) && isNumericLike(b)) {\n const aNum = getNumericValue(a);\n const bNum = getNumericValue(b);\n return aNum < bNum ? -1 : aNum > bNum ? 1 : 0;\n }\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 \"StringValue\": {\n let aStr = a.value;\n let bStr = b.value;\n if (!caseSensitive) {\n aStr = aStr.toLowerCase();\n bStr = bStr.toLowerCase();\n }\n return aStr < bStr ? -1 : aStr > bStr ? 1 : 0;\n }\n default:\n throw new Error(`Cannot compare type: ${a.type}`);\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 if (right instanceof UndefinedValue && [\"in\", \"not in\"].includes(node.operator.value)) {\n return new BooleanValue(node.operator.value === \"not in\");\n }\n throw new Error(`Cannot perform operation ${node.operator.value} 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 (node.operator.value === \"~\") {\n return new StringValue(left.value.toString() + right.value.toString());\n } else if ((left instanceof IntegerValue || left instanceof FloatValue) && (right instanceof IntegerValue || right instanceof FloatValue)) {\n const a = left.value, b = right.value;\n switch (node.operator.value) {\n case \"+\":\n case \"-\":\n case \"*\": {\n const res = node.operator.value === \"+\" ? a + b : node.operator.value === \"-\" ? a - b : a * b;\n const isFloat = left instanceof FloatValue || right instanceof FloatValue;\n return isFloat ? new FloatValue(res) : new IntegerValue(res);\n }\n case \"/\":\n return new FloatValue(a / b);\n case \"%\": {\n const rem = a % b;\n const isFloat = left instanceof FloatValue || right instanceof FloatValue;\n return isFloat ? new FloatValue(rem) : new IntegerValue(rem);\n }\n case \"<\":\n return new BooleanValue(a < b);\n case \">\":\n return new BooleanValue(a > b);\n case \">=\":\n return new BooleanValue(a >= b);\n case \"<=\":\n return new BooleanValue(a <= b);\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 evaluateArguments(args, environment) {\n const positionalArguments = [];\n const keywordArguments = /* @__PURE__ */ new Map();\n for (const argument of args) {\n if (argument.type === \"SpreadExpression\") {\n const spreadNode = argument;\n const val = this.evaluate(spreadNode.argument, environment);\n if (!(val instanceof ArrayValue)) {\n throw new Error(`Cannot unpack non-iterable type: ${val.type}`);\n }\n for (const item of val.value) {\n positionalArguments.push(item);\n }\n } else if (argument.type === \"KeywordArgumentExpression\") {\n const kwarg = argument;\n keywordArguments.set(kwarg.key.value, this.evaluate(kwarg.value, environment));\n } else {\n if (keywordArguments.size > 0) {\n throw new Error(\"Positional arguments must come before keyword arguments\");\n }\n positionalArguments.push(this.evaluate(argument, environment));\n }\n }\n return [positionalArguments, keywordArguments];\n }\n applyFilter(operand, filterNode, environment) {\n if (filterNode.type === \"Identifier\") {\n const filter = filterNode;\n if (filter.value === \"tojson\") {\n return new StringValue(toJSON(operand));\n }\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 IntegerValue(operand.value.length);\n case \"reverse\":\n return new ArrayValue(operand.value.slice().reverse());\n case \"sort\": {\n return new ArrayValue(operand.value.slice().sort((a, b) => compareRuntimeValues(a, b, false)));\n }\n case \"join\":\n return new StringValue(operand.value.map((x) => x.value).join(\"\"));\n case \"string\":\n return new StringValue(toJSON(operand, null, 0, false));\n case \"unique\": {\n const seen = /* @__PURE__ */ new Set();\n const output = [];\n for (const item of operand.value) {\n if (!seen.has(item.value)) {\n seen.add(item.value);\n output.push(item);\n }\n }\n return new ArrayValue(output);\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 case \"upper\":\n case \"lower\":\n case \"title\":\n case \"capitalize\": {\n const builtin = operand.builtins.get(filter.value);\n if (builtin instanceof FunctionValue) {\n return builtin.value(\n /* no arguments */\n [],\n environment\n );\n } else if (builtin instanceof IntegerValue) {\n return builtin;\n } else {\n throw new Error(`Unknown StringValue filter: ${filter.value}`);\n }\n }\n case \"trim\":\n return new StringValue(operand.value.trim());\n case \"indent\":\n return new StringValue(\n operand.value.split(\"\\n\").map(\n (x, i) => (\n // By default, don't indent the first line or empty lines\n i === 0 || x.length === 0 ? x : \" \" + x\n )\n ).join(\"\\n\")\n );\n case \"join\":\n case \"string\":\n return operand;\n case \"int\": {\n const val = parseInt(operand.value, 10);\n return new IntegerValue(isNaN(val) ? 0 : val);\n }\n case \"float\": {\n const val = parseFloat(operand.value);\n return new FloatValue(isNaN(val) ? 0 : val);\n }\n default:\n throw new Error(`Unknown StringValue filter: ${filter.value}`);\n }\n } else if (operand instanceof IntegerValue || operand instanceof FloatValue) {\n switch (filter.value) {\n case \"abs\":\n return operand instanceof IntegerValue ? new IntegerValue(Math.abs(operand.value)) : new FloatValue(Math.abs(operand.value));\n case \"int\":\n return new IntegerValue(Math.floor(operand.value));\n case \"float\":\n return new FloatValue(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 IntegerValue(operand.value.size);\n default: {\n const builtin = operand.builtins.get(filter.value);\n if (builtin) {\n if (builtin instanceof FunctionValue) {\n return builtin.value([], environment);\n }\n return builtin;\n }\n throw new Error(`Unknown ObjectValue filter: ${filter.value}`);\n }\n }\n } else if (operand instanceof BooleanValue) {\n switch (filter.value) {\n case \"bool\":\n return new BooleanValue(operand.value);\n case \"int\":\n return new IntegerValue(operand.value ? 1 : 0);\n case \"float\":\n return new FloatValue(operand.value ? 1 : 0);\n case \"string\":\n return new StringValue(operand.value ? \"true\" : \"false\");\n default:\n throw new Error(`Unknown BooleanValue filter: ${filter.value}`);\n }\n }\n throw new Error(`Cannot apply filter \"${filter.value}\" to type: ${operand.type}`);\n } else if (filterNode.type === \"CallExpression\") {\n const filter = filterNode;\n if (filter.callee.type !== \"Identifier\") {\n throw new Error(`Unknown filter: ${filter.callee.type}`);\n }\n const filterName = filter.callee.value;\n if (filterName === \"tojson\") {\n const [, kwargs] = this.evaluateArguments(filter.args, environment);\n const indent = kwargs.get(\"indent\") ?? new NullValue();\n if (!(indent instanceof IntegerValue || indent instanceof NullValue)) {\n throw new Error(\"If set, indent must be a number\");\n }\n return new StringValue(toJSON(operand, indent.value));\n } else if (filterName === \"join\") {\n let value;\n if (operand instanceof StringValue) {\n value = Array.from(operand.value);\n } else if (operand instanceof ArrayValue) {\n value = operand.value.map((x) => x.value);\n } else {\n throw new Error(`Cannot apply filter \"${filterName}\" to type: ${operand.type}`);\n }\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n const separator = args.at(0) ?? kwargs.get(\"separator\") ?? new StringValue(\"\");\n if (!(separator instanceof StringValue)) {\n throw new Error(\"separator must be a string\");\n }\n return new StringValue(value.join(separator.value));\n } else if (filterName === \"int\" || filterName === \"float\") {\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n const defaultValue = args.at(0) ?? kwargs.get(\"default\") ?? (filterName === \"int\" ? new IntegerValue(0) : new FloatValue(0));\n if (operand instanceof StringValue) {\n const val = filterName === \"int\" ? parseInt(operand.value, 10) : parseFloat(operand.value);\n return isNaN(val) ? defaultValue : filterName === \"int\" ? new IntegerValue(val) : new FloatValue(val);\n } else if (operand instanceof IntegerValue || operand instanceof FloatValue) {\n return operand;\n } else if (operand instanceof BooleanValue) {\n return filterName === \"int\" ? new IntegerValue(operand.value ? 1 : 0) : new FloatValue(operand.value ? 1 : 0);\n } else {\n throw new Error(`Cannot apply filter \"${filterName}\" to type: ${operand.type}`);\n }\n } else if (filterName === \"default\") {\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n const defaultValue = args[0] ?? new StringValue(\"\");\n const booleanValue = args[1] ?? kwargs.get(\"boolean\") ?? new BooleanValue(false);\n if (!(booleanValue instanceof BooleanValue)) {\n throw new Error(\"`default` filter flag must be a boolean\");\n }\n if (operand instanceof UndefinedValue || booleanValue.value && !operand.__bool__().value) {\n return defaultValue;\n }\n return operand;\n }\n if (operand instanceof ArrayValue) {\n switch (filterName) {\n case \"sort\": {\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n const reverse = args.at(0) ?? kwargs.get(\"reverse\") ?? new BooleanValue(false);\n if (!(reverse instanceof BooleanValue)) {\n throw new Error(\"reverse must be a boolean\");\n }\n const caseSensitive = args.at(1) ?? kwargs.get(\"case_sensitive\") ?? new BooleanValue(false);\n if (!(caseSensitive instanceof BooleanValue)) {\n throw new Error(\"case_sensitive must be a boolean\");\n }\n const attribute = args.at(2) ?? kwargs.get(\"attribute\") ?? new NullValue();\n if (!(attribute instanceof StringValue || attribute instanceof IntegerValue || attribute instanceof NullValue)) {\n throw new Error(\"attribute must be a string, integer, or null\");\n }\n const getSortValue = (item) => {\n if (attribute instanceof NullValue) {\n return item;\n }\n const attrPath = attribute instanceof IntegerValue ? String(attribute.value) : attribute.value;\n return getAttributeValue(item, attrPath);\n };\n return new ArrayValue(\n operand.value.slice().sort((a, b) => {\n const aVal = getSortValue(a);\n const bVal = getSortValue(b);\n const result = compareRuntimeValues(aVal, bVal, caseSensitive.value);\n return reverse.value ? -result : result;\n })\n );\n }\n case \"selectattr\":\n case \"rejectattr\": {\n const select = filterName === \"selectattr\";\n if (operand.value.some((x) => !(x instanceof ObjectValue))) {\n throw new Error(`\\`${filterName}\\` can only be applied to array of objects`);\n }\n if (filter.args.some((x) => x.type !== \"StringLiteral\")) {\n throw new Error(`arguments of \\`${filterName}\\` 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 const result = a ? testFunction(a, value) : false;\n return select ? result : !result;\n });\n return new ArrayValue(filtered);\n }\n case \"map\": {\n const [, kwargs] = this.evaluateArguments(filter.args, environment);\n if (kwargs.has(\"attribute\")) {\n const attr = kwargs.get(\"attribute\");\n if (!(attr instanceof StringValue)) {\n throw new Error(\"attribute must be a string\");\n }\n const defaultValue = kwargs.get(\"default\");\n const mapped = operand.value.map((item) => {\n if (!(item instanceof ObjectValue)) {\n throw new Error(\"items in map must be an object\");\n }\n const value = getAttributeValue(item, attr.value);\n return value instanceof UndefinedValue ? defaultValue ?? new UndefinedValue() : value;\n });\n return new ArrayValue(mapped);\n } else {\n throw new Error(\"`map` expressions without `attribute` set are not currently supported.\");\n }\n }\n }\n throw new Error(`Unknown ArrayValue filter: ${filterName}`);\n } else if (operand instanceof StringValue) {\n switch (filterName) {\n case \"indent\": {\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n const width = args.at(0) ?? kwargs.get(\"width\") ?? new IntegerValue(4);\n if (!(width instanceof IntegerValue)) {\n throw new Error(\"width must be a number\");\n }\n const first = args.at(1) ?? kwargs.get(\"first\") ?? new BooleanValue(false);\n const blank = args.at(2) ?? kwargs.get(\"blank\") ?? new BooleanValue(false);\n const lines = operand.value.split(\"\\n\");\n const indent = \" \".repeat(width.value);\n const indented = lines.map(\n (x, i) => !first.value && i === 0 || !blank.value && x.length === 0 ? x : indent + x\n );\n return new StringValue(indented.join(\"\\n\"));\n }\n case \"replace\": {\n const replaceFn = operand.builtins.get(\"replace\");\n if (!(replaceFn instanceof FunctionValue)) {\n throw new Error(\"replace filter not available\");\n }\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n return replaceFn.value([...args, new KeywordArgumentsValue(kwargs)], environment);\n }\n }\n throw new Error(`Unknown StringValue filter: ${filterName}`);\n } else if (operand instanceof ObjectValue) {\n const builtin = operand.builtins.get(filterName);\n if (builtin && builtin instanceof FunctionValue) {\n const [args, kwargs] = this.evaluateArguments(filter.args, environment);\n if (kwargs.size > 0) {\n args.push(new KeywordArgumentsValue(kwargs));\n }\n return builtin.value(args, environment);\n }\n throw new Error(`Unknown ObjectValue filter: ${filterName}`);\n } else {\n throw new Error(`Cannot apply filter \"${filterName}\" to type: ${operand.type}`);\n }\n }\n throw new Error(`Unknown filter: ${filterNode.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 return this.applyFilter(operand, node.filter, environment);\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 select operation type.\n */\n evaluateSelectExpression(node, environment) {\n const predicate = this.evaluate(node.test, environment);\n if (!predicate.__bool__().value) {\n return new UndefinedValue();\n }\n return this.evaluate(node.lhs, environment);\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 evaluateTernaryExpression(node, environment) {\n const cond = this.evaluate(node.condition, environment);\n return cond.__bool__().value ? this.evaluate(node.trueExpr, environment) : this.evaluate(node.falseExpr, environment);\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.toString();\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, kwargs] = this.evaluateArguments(expr.args, environment);\n if (kwargs.size > 0) {\n args.push(new KeywordArgumentsValue(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 IntegerValue || start instanceof UndefinedValue)) {\n throw new Error(\"Slice start must be numeric or undefined\");\n }\n if (!(stop instanceof IntegerValue || stop instanceof UndefinedValue)) {\n throw new Error(\"Slice stop must be numeric or undefined\");\n }\n if (!(step instanceof IntegerValue || 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 IntegerValue) {\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 = node.value ? this.evaluate(node.value, environment) : this.evaluateBlock(node.body, environment);\n if (node.assignee.type === \"Identifier\") {\n const variableName = node.assignee.value;\n environment.setVariable(variableName, rhs);\n } else if (node.assignee.type === \"TupleLiteral\") {\n const tuple = node.assignee;\n if (!(rhs instanceof ArrayValue)) {\n throw new Error(`Cannot unpack non-iterable type in set: ${rhs.type}`);\n }\n const arr = rhs.value;\n if (arr.length !== tuple.value.length) {\n throw new Error(`Too ${tuple.value.length > arr.length ? \"few\" : \"many\"} items to unpack in set`);\n }\n for (let i = 0; i < tuple.value.length; ++i) {\n const elem = tuple.value[i];\n if (elem.type !== \"Identifier\") {\n throw new Error(`Cannot unpack to non-identifier in set: ${elem.type}`);\n }\n environment.setVariable(elem.value, arr[i]);\n }\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 let test, iterable;\n if (node.iterable.type === \"SelectExpression\") {\n const select = node.iterable;\n iterable = this.evaluate(select.lhs, scope);\n test = select.test;\n } else {\n iterable = this.evaluate(node.iterable, scope);\n }\n if (!(iterable instanceof ArrayValue || iterable instanceof ObjectValue)) {\n throw new Error(`Expected iterable or object type in for loop: got ${iterable.type}`);\n }\n if (iterable instanceof ObjectValue) {\n iterable = iterable.keys();\n }\n const items = [];\n const scopeUpdateFunctions = [];\n for (let i = 0; i < iterable.value.length; ++i) {\n const loopScope = new Environment(scope);\n const current = iterable.value[i];\n let scopeUpdateFunction;\n if (node.loopvar.type === \"Identifier\") {\n scopeUpdateFunction = (scope2) => scope2.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 scopeUpdateFunction = (scope2) => {\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 scope2.setVariable(loopvar.value[j].value, c.value[j]);\n }\n };\n } else {\n throw new Error(`Invalid loop variable(s): ${node.loopvar.type}`);\n }\n if (test) {\n scopeUpdateFunction(loopScope);\n const testValue = this.evaluate(test, loopScope);\n if (!testValue.__bool__().value) {\n continue;\n }\n }\n items.push(current);\n scopeUpdateFunctions.push(scopeUpdateFunction);\n }\n let result = \"\";\n let noIteration = true;\n for (let i = 0; i < items.length; ++i) {\n const loop = /* @__PURE__ */ new Map([\n [\"index\", new IntegerValue(i + 1)],\n [\"index0\", new IntegerValue(i)],\n [\"revindex\", new IntegerValue(items.length - i)],\n [\"revindex0\", new IntegerValue(items.length - i - 1)],\n [\"first\", new BooleanValue(i === 0)],\n [\"last\", new BooleanValue(i === items.length - 1)],\n [\"length\", new IntegerValue(items.length)],\n [\"previtem\", i > 0 ? items[i - 1] : new UndefinedValue()],\n [\"nextitem\", i < items.length - 1 ? items[i + 1] : new UndefinedValue()]\n ]);\n scope.setVariable(\"loop\", new ObjectValue(loop));\n scopeUpdateFunctions[i](scope);\n try {\n const evaluated = this.evaluateBlock(node.body, scope);\n result += evaluated.value;\n } catch (err) {\n if (err instanceof ContinueControl) {\n continue;\n }\n if (err instanceof BreakControl) {\n break;\n }\n throw err;\n }\n noIteration = false;\n }\n if (noIteration) {\n const defaultEvaluated = this.evaluateBlock(node.defaultBlock, scope);\n result += defaultEvaluated.value;\n }\n return new StringValue(result);\n }\n /**\n * See https://jinja.palletsprojects.com/en/3.1.x/templates/#macros for more information.\n */\n evaluateMacro(node, environment) {\n environment.setVariable(\n node.name.value,\n new FunctionValue((args, scope) => {\n const macroScope = new Environment(scope);\n args = args.slice();\n let kwargs;\n if (args.at(-1)?.type === \"KeywordArgumentsValue\") {\n kwargs = args.pop();\n }\n for (let i = 0; i < node.args.length; ++i) {\n const nodeArg = node.args[i];\n const passedArg = args[i];\n if (nodeArg.type === \"Identifier\") {\n const identifier = nodeArg;\n if (!passedArg) {\n throw new Error(`Missing positional argument: ${identifier.value}`);\n }\n macroScope.setVariable(identifier.value, passedArg);\n } else if (nodeArg.type === \"KeywordArgumentExpression\") {\n const kwarg = nodeArg;\n const value = passedArg ?? // Try positional arguments first\n kwargs?.value.get(kwarg.key.value) ?? // Look in user-passed kwargs\n this.evaluate(kwarg.value, macroScope);\n macroScope.setVariable(kwarg.key.value, value);\n } else {\n throw new Error(`Unknown argument type: ${nodeArg.type}`);\n }\n }\n return this.evaluateBlock(node.body, macroScope);\n })\n );\n return new NullValue();\n }\n evaluateCallStatement(node, environment) {\n const callerFn = new FunctionValue((callerArgs, callerEnv) => {\n const callBlockEnv = new Environment(callerEnv);\n if (node.callerArgs) {\n for (let i = 0; i < node.callerArgs.length; ++i) {\n const param = node.callerArgs[i];\n if (param.type !== \"Identifier\") {\n throw new Error(`Caller parameter must be an identifier, got ${param.type}`);\n }\n callBlockEnv.setVariable(param.value, callerArgs[i] ?? new UndefinedValue());\n }\n }\n return this.evaluateBlock(node.body, callBlockEnv);\n });\n const [macroArgs, macroKwargs] = this.evaluateArguments(node.call.args, environment);\n macroArgs.push(new KeywordArgumentsValue(macroKwargs));\n const fn = this.evaluate(node.call.callee, environment);\n if (fn.type !== \"FunctionValue\") {\n throw new Error(`Cannot call something that is not a function: got ${fn.type}`);\n }\n const newEnv = new Environment(environment);\n newEnv.setVariable(\"caller\", callerFn);\n return fn.value(macroArgs, newEnv);\n }\n evaluateFilterStatement(node, environment) {\n const rendered = this.evaluateBlock(node.body, environment);\n return this.applyFilter(rendered, node.filter, environment);\n }\n evaluate(statement, environment) {\n if (!statement)\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 \"Macro\":\n return this.evaluateMacro(statement, environment);\n case \"CallStatement\":\n return this.evaluateCallStatement(statement, environment);\n case \"Break\":\n throw new BreakControl();\n case \"Continue\":\n throw new ContinueControl();\n case \"IntegerLiteral\":\n return new IntegerValue(statement.value);\n case \"FloatLiteral\":\n return new FloatValue(statement.value);\n case \"StringLiteral\":\n return new StringValue(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 \"FilterStatement\":\n return this.evaluateFilterStatement(statement, environment);\n case \"TestExpression\":\n return this.evaluateTestExpression(statement, environment);\n case \"SelectExpression\":\n return this.evaluateSelectExpression(statement, environment);\n case \"Ternary\":\n return this.evaluateTernaryExpression(statement, environment);\n case \"Comment\":\n return new NullValue();\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 Number.isInteger(input) ? new IntegerValue(input) : new FloatValue(input);\n case \"string\":\n return new StringValue(input);\n case \"boolean\":\n return new BooleanValue(input);\n case \"undefined\":\n return new UndefinedValue();\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/format.ts\nvar NEWLINE = \"\\n\";\nvar OPEN_STATEMENT = \"{%- \";\nvar CLOSE_STATEMENT = \" -%}\";\nfunction getBinaryOperatorPrecedence(expr) {\n switch (expr.operator.type) {\n case \"MultiplicativeBinaryOperator\":\n return 4;\n case \"AdditiveBinaryOperator\":\n return 3;\n case \"ComparisonBinaryOperator\":\n return 2;\n case \"Identifier\":\n if (expr.operator.value === \"and\")\n return 1;\n if (expr.operator.value === \"in\" || expr.operator.value === \"not in\")\n return 2;\n return 0;\n }\n return 0;\n}\nfunction format(program, indent = \"\t\") {\n const indentStr = typeof indent === \"number\" ? \" \".repeat(indent) : indent;\n const body = formatStatements(program.body, 0, indentStr);\n return body.replace(/\\n$/, \"\");\n}\nfunction createStatement(...text) {\n return OPEN_STATEMENT + text.join(\" \") + CLOSE_STATEMENT;\n}\nfunction formatStatements(stmts, depth, indentStr) {\n return stmts.map((stmt) => formatStatement(stmt, depth, indentStr)).join(NEWLINE);\n}\nfunction formatStatement(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n switch (node.type) {\n case \"Program\":\n return formatStatements(node.body, depth, indentStr);\n case \"If\":\n return formatIf(node, depth, indentStr);\n case \"For\":\n return formatFor(node, depth, indentStr);\n case \"Set\":\n return formatSet(node, depth, indentStr);\n case \"Macro\":\n return formatMacro(node, depth, indentStr);\n case \"Break\":\n return pad + createStatement(\"break\");\n case \"Continue\":\n return pad + createStatement(\"continue\");\n case \"CallStatement\":\n return formatCallStatement(node, depth, indentStr);\n case \"FilterStatement\":\n return formatFilterStatement(node, depth, indentStr);\n case \"Comment\":\n return pad + \"{# \" + node.value + \" #}\";\n default:\n return pad + \"{{- \" + formatExpression(node) + \" -}}\";\n }\n}\nfunction formatIf(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n const clauses = [];\n let current = node;\n while (current) {\n clauses.push({ test: current.test, body: current.body });\n if (current.alternate.length === 1 && current.alternate[0].type === \"If\") {\n current = current.alternate[0];\n } else {\n break;\n }\n }\n let out = pad + createStatement(\"if\", formatExpression(clauses[0].test)) + NEWLINE + formatStatements(clauses[0].body, depth + 1, indentStr);\n for (let i = 1; i < clauses.length; ++i) {\n out += NEWLINE + pad + createStatement(\"elif\", formatExpression(clauses[i].test)) + NEWLINE + formatStatements(clauses[i].body, depth + 1, indentStr);\n }\n if (current && current.alternate.length > 0) {\n out += NEWLINE + pad + createStatement(\"else\") + NEWLINE + formatStatements(current.alternate, depth + 1, indentStr);\n }\n out += NEWLINE + pad + createStatement(\"endif\");\n return out;\n}\nfunction formatFor(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n let formattedIterable = \"\";\n if (node.iterable.type === \"SelectExpression\") {\n const n = node.iterable;\n formattedIterable = `${formatExpression(n.lhs)} if ${formatExpression(n.test)}`;\n } else {\n formattedIterable = formatExpression(node.iterable);\n }\n let out = pad + createStatement(\"for\", formatExpression(node.loopvar), \"in\", formattedIterable) + NEWLINE + formatStatements(node.body, depth + 1, indentStr);\n if (node.defaultBlock.length > 0) {\n out += NEWLINE + pad + createStatement(\"else\") + NEWLINE + formatStatements(node.defaultBlock, depth + 1, indentStr);\n }\n out += NEWLINE + pad + createStatement(\"endfor\");\n return out;\n}\nfunction formatSet(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n const left = formatExpression(node.assignee);\n const right = node.value ? formatExpression(node.value) : \"\";\n const value = pad + createStatement(\"set\", `${left}${node.value ? \" = \" + right : \"\"}`);\n if (node.body.length === 0) {\n return value;\n }\n return value + NEWLINE + formatStatements(node.body, depth + 1, indentStr) + NEWLINE + pad + createStatement(\"endset\");\n}\nfunction formatMacro(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n const args = node.args.map(formatExpression).join(\", \");\n return pad + createStatement(\"macro\", `${node.name.value}(${args})`) + NEWLINE + formatStatements(node.body, depth + 1, indentStr) + NEWLINE + pad + createStatement(\"endmacro\");\n}\nfunction formatCallStatement(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n const params = node.callerArgs && node.callerArgs.length > 0 ? `(${node.callerArgs.map(formatExpression).join(\", \")})` : \"\";\n const callExpr = formatExpression(node.call);\n let out = pad + createStatement(`call${params}`, callExpr) + NEWLINE;\n out += formatStatements(node.body, depth + 1, indentStr) + NEWLINE;\n out += pad + createStatement(\"endcall\");\n return out;\n}\nfunction formatFilterStatement(node, depth, indentStr) {\n const pad = indentStr.repeat(depth);\n const spec = node.filter.type === \"Identifier\" ? node.filter.value : formatExpression(node.filter);\n let out = pad + createStatement(\"filter\", spec) + NEWLINE;\n out += formatStatements(node.body, depth + 1, indentStr) + NEWLINE;\n out += pad + createStatement(\"endfilter\");\n return out;\n}\nfunction formatExpression(node, parentPrec = -1) {\n switch (node.type) {\n case \"SpreadExpression\": {\n const n = node;\n return `*${formatExpression(n.argument)}`;\n }\n case \"Identifier\":\n return node.value;\n case \"IntegerLiteral\":\n return `${node.value}`;\n case \"FloatLiteral\":\n return `${node.value}`;\n case \"StringLiteral\":\n return JSON.stringify(node.value);\n case \"BinaryExpression\": {\n const n = node;\n const thisPrecedence = getBinaryOperatorPrecedence(n);\n const left = formatExpression(n.left, thisPrecedence);\n const right = formatExpression(n.right, thisPrecedence + 1);\n const expr = `${left} ${n.operator.value} ${right}`;\n return thisPrecedence < parentPrec ? `(${expr})` : expr;\n }\n case \"UnaryExpression\": {\n const n = node;\n const val = n.operator.value + (n.operator.value === \"not\" ? \" \" : \"\") + formatExpression(n.argument, Infinity);\n return val;\n }\n case \"CallExpression\": {\n const n = node;\n const args = n.args.map(formatExpression).join(\", \");\n return `${formatExpression(n.callee)}(${args})`;\n }\n case \"MemberExpression\": {\n const n = node;\n let obj = formatExpression(n.object);\n if (![\n \"Identifier\",\n \"MemberExpression\",\n \"CallExpression\",\n \"StringLiteral\",\n \"IntegerLiteral\",\n \"FloatLiteral\",\n \"ArrayLiteral\",\n \"TupleLiteral\",\n \"ObjectLiteral\"\n ].includes(n.object.type)) {\n obj = `(${obj})`;\n }\n let prop = formatExpression(n.property);\n if (!n.computed && n.property.type !== \"Identifier\") {\n prop = `(${prop})`;\n }\n return n.computed ? `${obj}[${prop}]` : `${obj}.${prop}`;\n }\n case \"FilterExpression\": {\n const n = node;\n const operand = formatExpression(n.operand, Infinity);\n if (n.filter.type === \"CallExpression\") {\n return `${operand} | ${formatExpression(n.filter)}`;\n }\n return `${operand} | ${n.filter.value}`;\n }\n case \"SelectExpression\": {\n const n = node;\n return `${formatExpression(n.lhs)} if ${formatExpression(n.test)}`;\n }\n case \"TestExpression\": {\n const n = node;\n return `${formatExpression(n.operand)} is${n.negate ? \" not\" : \"\"} ${n.test.value}`;\n }\n case \"ArrayLiteral\":\n case \"TupleLiteral\": {\n const elems = node.value.map(formatExpression);\n const brackets = node.type === \"ArrayLiteral\" ? \"[]\" : \"()\";\n return `${brackets[0]}${elems.join(\", \")}${brackets[1]}`;\n }\n case \"ObjectLiteral\": {\n const entries = Array.from(node.value.entries()).map(\n ([k, v]) => `${formatExpression(k)}: ${formatExpression(v)}`\n );\n return `{${entries.join(\", \")}}`;\n }\n case \"SliceExpression\": {\n const n = node;\n const s = n.start ? formatExpression(n.start) : \"\";\n const t = n.stop ? formatExpression(n.stop) : \"\";\n const st = n.step ? `:${formatExpression(n.step)}` : \"\";\n return `${s}:${t}${st}`;\n }\n case \"KeywordArgumentExpression\": {\n const n = node;\n return `${n.key.value}=${formatExpression(n.value)}`;\n }\n case \"Ternary\": {\n const n = node;\n const expr = `${formatExpression(n.trueExpr)} if ${formatExpression(n.condition, 0)} else ${formatExpression(\n n.falseExpr\n )}`;\n return parentPrec > -1 ? `(${expr})` : expr;\n }\n default:\n throw new Error(`Unknown expression type: ${node.type}`);\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 setupGlobals(env);\n if (items) {\n for (const [key, value] of Object.entries(items)) {\n env.set(key, value);\n }\n }\n const interpreter = new Interpreter(env);\n const result = interpreter.run(this.parsed);\n return result.value;\n }\n format(options) {\n return format(this.parsed, options?.indent || \"\t\");\n }\n};\nexport {\n Environment,\n Interpreter,\n Template,\n parse,\n tokenize\n};\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 '@huggingface/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';\n\nexport { Tensor } from 'onnxruntime-common';\n\n/**\n * @typedef {import('onnxruntime-common').InferenceSession.ExecutionProviderConfig} ONNXExecutionProviders\n */\n\n/** @type {Record<import(\"../utils/devices.js\").DeviceType, ONNXExecutionProviders>} */\nconst DEVICE_TO_EXECUTION_PROVIDER_MAPPING = Object.freeze({\n auto: null, // Auto-detect based on device and environment\n gpu: null, // Auto-detect GPU\n cpu: 'cpu', // CPU\n wasm: 'wasm', // WebAssembly\n webgpu: 'webgpu', // WebGPU\n cuda: 'cuda', // CUDA\n dml: 'dml', // DirectML\n\n webnn: { name: 'webnn', deviceType: 'cpu' }, // WebNN (default)\n 'webnn-npu': { name: 'webnn', deviceType: 'npu' }, // WebNN NPU\n 'webnn-gpu': { name: 'webnn', deviceType: 'gpu' }, // WebNN GPU\n 'webnn-cpu': { name: 'webnn', deviceType: 'cpu' }, // WebNN CPU\n});\n\n/** \n * The list of supported devices, sorted by priority/performance.\n * @type {import(\"../utils/devices.js\").DeviceType[]}\n */\nconst supportedDevices = [];\n\n/** @type {ONNXExecutionProviders[]} */\nlet defaultDevices;\nlet ONNX;\nconst ORT_SYMBOL = Symbol.for('onnxruntime');\n\nif (ORT_SYMBOL in globalThis) {\n // If the JS runtime exposes their own ONNX runtime, use it\n ONNX = globalThis[ORT_SYMBOL];\n\n} else if (apis.IS_NODE_ENV) {\n ONNX = ONNX_NODE.default ?? ONNX_NODE;\n\n // Updated as of ONNX Runtime 1.20.1\n // The following table lists the supported versions of ONNX Runtime Node.js binding provided with pre-built binaries.\n // | EPs/Platforms | Windows x64 | Windows arm64 | Linux x64 | Linux arm64 | MacOS x64 | MacOS arm64 |\n // | ------------- | ----------- | ------------- | ----------------- | ----------- | --------- | ----------- |\n // | CPU | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |\n // | DirectML | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ |\n // | CUDA | ❌ | ❌ | ✔️ (CUDA v11.8) | ❌ | ❌ | ❌ |\n switch (process.platform) {\n case 'win32': // Windows x64 and Windows arm64\n supportedDevices.push('dml');\n break;\n case 'linux': // Linux x64 and Linux arm64\n if (process.arch === 'x64') {\n supportedDevices.push('cuda');\n }\n break;\n case 'darwin': // MacOS x64 and MacOS arm64\n break;\n }\n\n supportedDevices.push('cpu');\n defaultDevices = ['cpu'];\n} else {\n ONNX = ONNX_WEB;\n\n if (apis.IS_WEBNN_AVAILABLE) {\n // TODO: Only push supported providers (depending on available hardware)\n supportedDevices.push('webnn-npu', 'webnn-gpu', 'webnn-cpu', 'webnn');\n }\n\n if (apis.IS_WEBGPU_AVAILABLE) {\n supportedDevices.push('webgpu');\n }\n\n supportedDevices.push('wasm');\n defaultDevices = ['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|\"auto\"|null} [device=null] (Optional) The device to run the inference on.\n * @returns {ONNXExecutionProviders[]} The execution providers to use for the given device.\n */\nexport function deviceToExecutionProviders(device = null) {\n // Use the default execution providers if the user hasn't specified anything\n if (!device) return defaultDevices;\n\n // Handle overloaded cases\n switch (device) {\n case \"auto\":\n return supportedDevices;\n case \"gpu\":\n return supportedDevices.filter(x =>\n [\"webgpu\", \"cuda\", \"dml\", \"webnn-gpu\"].includes(x),\n );\n }\n\n if (supportedDevices.includes(device)) {\n return [DEVICE_TO_EXECUTION_PROVIDER_MAPPING[device] ?? device];\n }\n\n throw new Error(`Unsupported device: \"${device}\". Should be one of: ${supportedDevices.join(', ')}.`)\n}\n\n\n/**\n * To prevent multiple calls to `initWasm()`, we store the first call in a Promise\n * that is resolved when the first InferenceSession is created. Subsequent calls\n * will wait for this Promise to resolve before creating their own InferenceSession.\n * @type {Promise<any>|null}\n */\nlet wasmInitPromise = null;\n\n/**\n * Create an ONNX inference session.\n * @param {Uint8Array|string} buffer_or_path The ONNX model buffer or path.\n * @param {import('onnxruntime-common').InferenceSession.SessionOptions} session_options ONNX inference session options.\n * @param {Object} session_config ONNX inference session configuration.\n * @returns {Promise<import('onnxruntime-common').InferenceSession & { config: Object}>} The ONNX inference session.\n */\nexport async function createInferenceSession(buffer_or_path, session_options, session_config) {\n if (wasmInitPromise) {\n // A previous session has already initialized the WASM runtime\n // so we wait for it to resolve before creating this new session.\n await wasmInitPromise;\n }\n\n const sessionPromise = InferenceSession.create(buffer_or_path, session_options);\n wasmInitPromise ??= sessionPromise;\n const session = await sessionPromise;\n session.config = session_config;\n return session;\n}\n\n\n/**\n * Currently, Transformers.js doesn't support simultaneous execution of sessions in WASM/WebGPU.\n * For this reason, we need to chain the inference calls (otherwise we get \"Error: Session already started\").\n * @type {Promise<any>}\n */\nlet webInferenceChain = Promise.resolve();\n\nconst IS_WEB_ENV = apis.IS_BROWSER_ENV || apis.IS_WEBWORKER_ENV;\n\n/**\n * Run an inference session.\n * @param {import('onnxruntime-common').InferenceSession} session The ONNX inference session.\n * @param {Record<string, import('onnxruntime-common').Tensor>} ortFeed The input tensors.\n * @returns {Promise<Record<string, import('onnxruntime-common').Tensor>>} The output tensors.\n */\nexport async function runInferenceSession(session, ortFeed) {\n const run = () => session.run(ortFeed);\n const output = await (IS_WEB_ENV\n ? (webInferenceChain = webInferenceChain.then(run))\n : run()\n );\n return output;\n}\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/** @type {import('onnxruntime-common').Env} */\n// @ts-ignore\nconst ONNX_ENV = ONNX?.env;\nif (ONNX_ENV?.wasm) {\n // Initialize wasm backend with suitable default settings.\n\n // (Optional) Set path to wasm files. This will override the default path search behavior of onnxruntime-web.\n // By default, we only do this if we are not in a service worker and the wasmPaths are not already set.\n if (\n // @ts-ignore Cannot find name 'ServiceWorkerGlobalScope'.ts(2304)\n !(typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope)\n && !ONNX_ENV.wasm.wasmPaths\n ) {\n ONNX_ENV.wasm.wasmPaths = `https://cdn.jsdelivr.net/npm/@huggingface/transformers@${env.version}/dist/`;\n }\n\n // TODO: Add support for loading WASM files from cached buffer when we upgrade to onnxruntime-web@1.19.0\n // https://github.com/microsoft/onnxruntime/pull/21534\n\n // Users may wish to proxy the WASM backend to prevent the UI from freezing,\n // However, this is not necessary when using WebGPU, so we default to false.\n ONNX_ENV.wasm.proxy = false;\n}\n\nif (ONNX_ENV?.webgpu) {\n ONNX_ENV.webgpu.powerPreference = 'high-performance';\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","import { FEATURE_EXTRACTOR_NAME } from \"../utils/constants.js\";\nimport { Callable } from \"../utils/generic.js\";\nimport { getModelJSON } from \"../utils/hub.js\";\n\n/**\n * Base class for feature extractors.\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 * Instantiate one of the feature extractor classes of the library from a pretrained model.\n * \n * The feature extractor class to instantiate is selected based on the `feature_extractor_type` property of\n * the config object (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 feature_extractor 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 feature_extractor files, e.g., `./my_model_directory/`.\n * @param {import('../utils/hub.js').PretrainedOptions} options Additional options for loading the feature_extractor.\n * \n * @returns {Promise<FeatureExtractor>} A new instance of the Feature Extractor class.\n */\n static async from_pretrained(pretrained_model_name_or_path, options={}) {\n const config = await getModelJSON(pretrained_model_name_or_path, FEATURE_EXTRACTOR_NAME, true, options);\n return new this(config);\n }\n}\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 */\nexport function 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","import { Callable } from \"../utils/generic.js\";\nimport { Tensor, interpolate, stack } from \"../utils/tensor.js\";\nimport { bankers_round, max, min, softmax } from \"../utils/maths.js\";\nimport { RawImage } from \"../utils/image.js\";\nimport { calculateReflectOffset } from \"../utils/core.js\";\nimport { getModelJSON } from \"../utils/hub.js\";\nimport { IMAGE_PROCESSOR_NAME } from '../utils/constants.js';\n\n/**\n * Named tuple to indicate the order we are using is (height x width),\n * even though the Graphics' industry standard is (width x height).\n * @typedef {[height: number, width: number]} HeightWidth\n */\n\n\n/**\n * @typedef {object} ImageProcessorResult\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\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// 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 */\nexport function 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, 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 */\nexport function 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/**\n * Post-processes the outputs of the model (for semantic segmentation).\n * @param {*} outputs Raw outputs of the model.\n * @param {[number, 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 */\nexport function 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 for (let j = 0; j < segmentation_data.length; ++j) {\n const index = segmentation_data[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\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 * @private\n */\nfunction remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) {\n\n const mask_probs_item = [];\n const pred_scores_item = [];\n const pred_labels_item = [];\n\n for (let j = 0; j < class_logits.dims[0]; ++j) {\n const cls = class_logits[j];\n const mask = mask_logits[j];\n\n const 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 const scores = softmax(cls.data);\n const 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 * 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 * @private\n */\nfunction 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 const 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<number>} 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 * @private\n */\nfunction 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 const [height, width] = target_size ?? mask_probs[0].dims;\n\n const segmentation = new Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n const 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 const mask_labels = new Int32Array(mask_probs[0].data.length);\n const 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 const 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 const [mask_exists, mask_k] = 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 (const 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 * Rescales the image so that the following conditions are met:\n *\n * 1. Both dimensions (height and width) are divisible by 'factor'.\n * 2. The total number of pixels is within the range ['min_pixels', 'max_pixels'].\n * 3. The aspect ratio of the image is maintained as closely as possible.\n * \n * @param {number} height The height of the image.\n * @param {number} width The width of the image.\n * @param {number} [factor=28] The factor to use for resizing.\n * @param {number} [min_pixels=56*56] The minimum number of pixels.\n * @param {number} [max_pixels=14*14*4*1280] The maximum number of pixels.\n * @returns {[number, number]} The new height and width of the image.\n * @throws {Error} If the height or width is smaller than the factor.\n */\nfunction smart_resize(height, width, factor = 28, min_pixels = 56 * 56, max_pixels = 14 * 14 * 4 * 1280) {\n\n if (height < factor || width < factor) {\n throw new Error(`height:${height} or width:${width} must be larger than factor:${factor}`);\n } else if (Math.max(height, width) / Math.min(height, width) > 200) {\n throw new Error(\n `absolute aspect ratio must be smaller than 200, got ${Math.max(height, width) / Math.min(height, width)}`\n );\n }\n\n let h_bar = Math.round(height / factor) * factor;\n let w_bar = Math.round(width / factor) * factor;\n\n if (h_bar * w_bar > max_pixels) {\n const beta = Math.sqrt((height * width) / max_pixels);\n h_bar = Math.floor((height / beta) / factor) * factor;\n w_bar = Math.floor((width / beta) / factor) * factor;\n } else if (h_bar * w_bar < min_pixels) {\n const beta = Math.sqrt(min_pixels / (height * width));\n h_bar = Math.ceil((height * beta) / factor) * factor;\n w_bar = Math.ceil((width * beta) / factor) * factor;\n }\n\n return [h_bar, w_bar];\n}\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<number>} [label_ids_to_fuse=null] The labels in this state will have all their instances be fused together.\n * @param {[number, 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 */\nexport function 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.class_queries_logits ?? outputs.logits; // [batch_size, num_queries, num_classes+1]\n const masks_queries_logits = outputs.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] = 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] = 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\n/**\n * Post-processes the outputs of the model (for instance segmentation).\n * @param {*} outputs Raw outputs of the model.\n * @param {number} [threshold=0.5] The probability score threshold to keep predicted instance masks.\n * @param {[number, 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 {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>}\n */\nexport function post_process_instance_segmentation(outputs, threshold = 0.5, target_sizes = null) {\n throw new Error('`post_process_instance_segmentation` is not yet implemented.');\n}\n\n\n/**\n * @typedef {Object} ImageProcessorConfig A configuration object used to create an image processor. \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 {number[]} [image_mean] The mean values for image normalization.\n * @property {number[]} [image_std] The standard deviation values for image normalization.\n * @property {boolean} [do_rescale] Whether to rescale the image pixel values to the [0,1] range.\n * @property {number} [rescale_factor] The factor to use for rescaling the image pixel values.\n * @property {boolean} [do_normalize] Whether to normalize the image pixel values.\n * @property {boolean} [do_resize] Whether to resize the image.\n * @property {number} [resample] What method to use for resampling.\n * @property {number|Object} [size] The size to resize the image to.\n * @property {number|Object} [image_size] The size to resize the image to (same as `size`).\n * @property {boolean} [do_flip_channel_order=false] Whether to flip the color channels from RGB to BGR.\n * Can be overridden by the `do_flip_channel_order` parameter in the `preprocess` method.\n * @property {boolean} [do_center_crop] Whether to center crop the image to the specified `crop_size`.\n * Can be overridden by `do_center_crop` in the `preprocess` method.\n * @property {boolean} [do_thumbnail] Whether to resize the image using thumbnail method.\n * @property {boolean} [keep_aspect_ratio] If `true`, the image is resized to the largest possible size such that the aspect ratio is preserved.\n * Can be overidden by `keep_aspect_ratio` in `preprocess`.\n * @property {number} [ensure_multiple_of] If `do_resize` is `true`, the image is resized to a size that is a multiple of this value.\n * Can be overidden by `ensure_multiple_of` in `preprocess`.\n * \n * @property {number[]} [mean] The mean values for image normalization (same as `image_mean`).\n * @property {number[]} [std] The standard deviation values for image normalization (same as `image_std`).\n */\n\nexport class ImageProcessor extends Callable {\n\n /**\n * Constructs a new `ImageProcessor`.\n * @param {ImageProcessorConfig} config The configuration object.\n */\n constructor(config) {\n super();\n\n this.image_mean = config.image_mean ?? config.mean;\n this.image_std = config.image_std ?? config.std;\n\n this.resample = config.resample ?? 2; // 2 => bilinear\n this.do_rescale = config.do_rescale ?? true;\n this.rescale_factor = config.rescale_factor ?? (1 / 255);\n this.do_normalize = config.do_normalize;\n\n this.do_thumbnail = config.do_thumbnail;\n this.size = config.size ?? config.image_size;\n this.do_resize = config.do_resize ?? (this.size !== undefined);\n // @ts-expect-error TS2339\n this.size_divisibility = config.size_divisibility ?? config.size_divisor;\n\n this.do_center_crop = config.do_center_crop;\n // @ts-expect-error TS2339\n this.crop_size = config.crop_size;\n // @ts-expect-error TS2339\n this.do_convert_rgb = config.do_convert_rgb ?? true;\n // @ts-expect-error TS2339\n this.do_crop_margin = config.do_crop_margin;\n\n // @ts-expect-error TS2339\n this.pad_size = config.pad_size;\n // @ts-expect-error TS2339\n this.do_pad = config.do_pad;\n // @ts-expect-error TS2339\n this.min_pixels = config.min_pixels;\n // @ts-expect-error TS2339\n this.max_pixels = config.max_pixels;\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 this.do_flip_channel_order = config.do_flip_channel_order ?? false;\n\n this.config = config;\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<RawImage>} 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<RawImage>} 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|'square'} 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|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 if (padSize === 'square') {\n paddedImageWidth = paddedImageHeight = Math.max(imageHeight, imageWidth);\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 // @ts-expect-error TS2339\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 if (this.min_pixels !== undefined && this.max_pixels !== undefined) {\n // Custom resize logic for Qwen2-VL models\n // @ts-expect-error TS2339\n const factor = this.config.patch_size * this.config.merge_size;\n return smart_resize(srcHeight, srcWidth, factor, this.min_pixels, this.max_pixels);\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<RawImage>} 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 // @ts-expect-error TS2322\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<PreprocessedImage>} 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 do_flip_channel_order = 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 // @ts-expect-error TS2345\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 /** @type {Float32Array} */\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_std);\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 if (do_flip_channel_order ?? this.do_flip_channel_order) {\n if (imgDims[2] !== 3) {\n throw new Error('Flipping channel order is only supported for RGB images.');\n }\n // Convert RGB to BGR\n for (let i = 0; i < pixelData.length; i += 3) {\n const temp = pixelData[i];\n pixelData[i] = pixelData[i + 2];\n pixelData[i + 2] = temp;\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<ImageProcessorResult>} 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 /**\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 `image_processor_type` (or `feature_extractor_type`; legacy)\n * property of the config object (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<ImageProcessor>} A new instance of the Processor class.\n */\n static async from_pretrained(pretrained_model_name_or_path, options={}) {\n const preprocessorConfig = await getModelJSON(pretrained_model_name_or_path, IMAGE_PROCESSOR_NAME, true, options);\n return new this(preprocessorConfig);\n }\n}\n","\n/**\n * @file Processors are used to prepare inputs (e.g., text, 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 '@huggingface/transformers';\n *\n * const processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * const audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * const { 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 { PROCESSOR_NAME, CHAT_TEMPLATE_NAME } from '../utils/constants.js';\nimport {\n Callable,\n} from '../utils/generic.js';\nimport { getModelJSON, getModelText } from '../utils/hub.js';\n\n/**\n * @typedef {Object} ProcessorProperties Additional processor-specific properties.\n * @typedef {import('../utils/hub.js').PretrainedOptions & ProcessorProperties} PretrainedProcessorOptions\n * @typedef {import('../tokenizers.js').PreTrainedTokenizer} PreTrainedTokenizer\n */\n\n\n/**\n * Represents a Processor that extracts features from an input.\n */\nexport class Processor extends Callable {\n static classes = [\n 'image_processor_class',\n 'tokenizer_class',\n 'feature_extractor_class',\n ]\n static uses_processor_config = false;\n static uses_chat_template_file = false;\n\n /**\n * Creates a new Processor with the given components\n * @param {Object} config \n * @param {Record<string, Object>} components \n * @param {string} chat_template\n */\n constructor(config, components, chat_template) {\n super();\n this.config = config;\n this.components = components;\n this.chat_template = chat_template;\n }\n\n /**\n * @returns {import('./image_processors_utils.js').ImageProcessor|undefined} The image processor of the processor, if it exists.\n */\n get image_processor() {\n return this.components.image_processor;\n }\n\n /**\n * @returns {PreTrainedTokenizer|undefined} The tokenizer of the processor, if it exists.\n */\n get tokenizer() {\n return this.components.tokenizer;\n }\n\n /**\n * @returns {import('./feature_extraction_utils.js').FeatureExtractor|undefined} The feature extractor of the processor, if it exists.\n */\n get feature_extractor() {\n return this.components.feature_extractor;\n }\n\n /**\n * @param {Parameters<PreTrainedTokenizer['apply_chat_template']>[0]} messages\n * @param {Parameters<PreTrainedTokenizer['apply_chat_template']>[1]} options\n * @returns {ReturnType<PreTrainedTokenizer['apply_chat_template']>}\n */\n apply_chat_template(messages, options = {}) {\n if (!this.tokenizer) {\n throw new Error('Unable to apply chat template without a tokenizer.');\n }\n return this.tokenizer.apply_chat_template(messages, {\n tokenize: false, // default to false\n chat_template: this.chat_template ?? undefined,\n ...options,\n });\n }\n\n /**\n * @param {Parameters<PreTrainedTokenizer['batch_decode']>} args\n * @returns {ReturnType<PreTrainedTokenizer['batch_decode']>}\n */\n batch_decode(...args) {\n if (!this.tokenizer) {\n throw new Error('Unable to decode without a tokenizer.');\n }\n return this.tokenizer.batch_decode(...args);\n }\n\n /**\n * @param {Parameters<PreTrainedTokenizer['decode']>} args\n * @returns {ReturnType<PreTrainedTokenizer['decode']>}\n */\n decode(...args) {\n if (!this.tokenizer) {\n throw new Error('Unable to decode without a tokenizer.');\n }\n return this.tokenizer.decode(...args);\n }\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<any>} A Promise that resolves with the extracted features.\n */\n async _call(input, ...args) {\n for (const item of [this.image_processor, this.feature_extractor, this.tokenizer]) {\n if (item) {\n return item(input, ...args);\n }\n }\n throw new Error('No image processor, feature extractor, or tokenizer found.');\n }\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 `image_processor_type` (or `feature_extractor_type`; legacy)\n * property of the config object (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 {PretrainedProcessorOptions} options Additional options for loading the processor.\n * \n * @returns {Promise<Processor>} A new instance of the Processor class.\n */\n static async from_pretrained(pretrained_model_name_or_path, options={}) {\n\n const [config, components, chat_template] = await Promise.all([\n // TODO:\n this.uses_processor_config\n ? getModelJSON(pretrained_model_name_or_path, PROCESSOR_NAME, true, options)\n : {},\n Promise.all(\n this.classes\n .filter((cls) => cls in this)\n .map(async (cls) => {\n const component = await this[cls].from_pretrained(pretrained_model_name_or_path, options);\n return [cls.replace(/_class$/, ''), component];\n })\n ).then(Object.fromEntries),\n this.uses_chat_template_file\n ? getModelText(pretrained_model_name_or_path, CHAT_TEMPLATE_NAME, true, options)\n : null,\n ]);\n\n return new this(config, components, chat_template);\n }\n}\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 '@huggingface/transformers';\n * const 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 { pick } from './utils/core.js';\nimport {\n getModelJSON,\n} from './utils/hub.js';\n\n/**\n * @typedef {import('./utils/hub.js').PretrainedOptions} PretrainedOptions\n */\n\n/**\n * @typedef {import('./utils/core.js').ProgressCallback} ProgressCallback\n */\n\n/**\n * @typedef {import('./utils/core.js').ProgressInfo} ProgressInfo\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<Object>} A promise that resolves with information about the loaded config.\n */\nasync function loadConfig(pretrained_model_name_or_path, options) {\n return await getModelJSON(pretrained_model_name_or_path, 'config.json', true, options);\n}\n\n/**\n * \n * @param {PretrainedConfig} config \n * @returns {Object} The normalized configuration.\n */\nfunction getNormalizedConfig(config) {\n const mapping = {};\n\n let init_normalized_config = {};\n switch (config.model_type) {\n // Sub-configs\n case 'llava':\n case 'paligemma':\n case 'gemma3':\n case 'florence2':\n case 'llava_onevision':\n case 'idefics3':\n case 'ultravox':\n case 'voxtral':\n case 'smolvlm':\n case 'gemma3n':\n case 'mistral3':\n // @ts-expect-error TS2339\n init_normalized_config = getNormalizedConfig(config.text_config);\n break;\n case 'moondream1':\n // @ts-expect-error TS2339\n init_normalized_config = getNormalizedConfig(config.phi_config);\n break;\n case 'musicgen':\n // @ts-expect-error TS2339\n init_normalized_config = getNormalizedConfig(config.decoder);\n break;\n case 'multi_modality':\n // @ts-expect-error TS2339\n init_normalized_config = getNormalizedConfig(config.language_config);\n break;\n\n // Decoder-only models\n case 'gpt2':\n case 'gptj':\n case 'jais':\n case 'codegen':\n case 'gpt_bigcode':\n mapping['num_heads'] = 'n_head';\n mapping['num_layers'] = 'n_layer';\n mapping['hidden_size'] = 'n_embd';\n break;\n case 'gpt_neox':\n case 'stablelm':\n case 'opt':\n case 'falcon':\n case 'modernbert-decoder':\n mapping['num_heads'] = 'num_attention_heads';\n mapping['num_layers'] = 'num_hidden_layers';\n mapping['hidden_size'] = 'hidden_size';\n break;\n case 'llama':\n case 'llama4_text':\n case 'nanochat':\n case 'arcee':\n case 'lfm2':\n case 'smollm3':\n case 'olmo':\n case 'olmo2':\n case 'mobilellm':\n case 'granite':\n case 'granitemoehybrid':\n case 'cohere':\n case 'mistral':\n case 'starcoder2':\n case 'qwen2':\n case 'qwen2_vl':\n case 'phi':\n case 'phi3':\n case 'phi3_v':\n case 'llava_qwen2':\n mapping['num_heads'] = 'num_key_value_heads';\n mapping['num_layers'] = 'num_hidden_layers';\n mapping['hidden_size'] = 'hidden_size';\n mapping['num_attention_heads'] = 'num_attention_heads';\n mapping['dim_kv'] = 'head_dim';\n break;\n case 'qwen3':\n case 'gemma':\n case 'gemma2':\n case 'vaultgemma':\n case 'gemma3_text':\n case 'gemma3n_text':\n case 'glm':\n case 'helium':\n case 'ernie4_5':\n case 'ministral':\n case 'ministral3':\n mapping['num_heads'] = 'num_key_value_heads';\n mapping['num_layers'] = 'num_hidden_layers';\n mapping['dim_kv'] = 'head_dim';\n break;\n case 'openelm':\n mapping['num_heads'] = 'num_kv_heads';\n mapping['num_layers'] = 'num_transformer_layers';\n mapping['dim_kv'] = 'head_dim';\n break;\n case 'gpt_neo':\n case 'donut-swin':\n mapping['num_heads'] = 'num_heads';\n mapping['num_layers'] = 'num_layers';\n mapping['hidden_size'] = 'hidden_size';\n break;\n case 'bloom':\n mapping['num_heads'] = 'n_head';\n mapping['num_layers'] = 'n_layer';\n mapping['hidden_size'] = 'hidden_size';\n break;\n case 'mpt':\n mapping['num_heads'] = 'n_heads';\n mapping['num_layers'] = 'n_layers';\n mapping['hidden_size'] = 'd_model';\n break;\n case 'exaone':\n mapping['num_heads'] = 'num_key_value_heads';\n mapping['num_layers'] = 'num_layers';\n mapping['dim_kv'] = 'head_dim';\n mapping['num_attention_heads'] = 'num_attention_heads';\n break;\n\n // Encoder-decoder models\n case 't5':\n case 'mt5':\n case 'longt5':\n mapping['num_decoder_layers'] = 'num_decoder_layers';\n mapping['num_decoder_heads'] = 'num_heads';\n mapping['decoder_dim_kv'] = 'd_kv';\n mapping['num_encoder_layers'] = 'num_layers';\n mapping['num_encoder_heads'] = 'num_heads';\n mapping['encoder_dim_kv'] = 'd_kv';\n break;\n case 'bart':\n case 'mbart':\n case 'marian':\n case 'whisper':\n case 'lite-whisper':\n case 'm2m_100':\n case 'blenderbot':\n case 'blenderbot-small':\n case 'florence2_language':\n mapping['num_decoder_layers'] = 'decoder_layers';\n mapping['num_decoder_heads'] = 'decoder_attention_heads';\n mapping['decoder_hidden_size'] = 'd_model';\n mapping['num_encoder_layers'] = 'encoder_layers';\n mapping['num_encoder_heads'] = 'encoder_attention_heads';\n mapping['encoder_hidden_size'] = 'd_model';\n break;\n case 'speecht5':\n mapping['num_decoder_layers'] = 'decoder_layers';\n mapping['num_decoder_heads'] = 'decoder_attention_heads';\n mapping['decoder_hidden_size'] = 'hidden_size';\n mapping['num_encoder_layers'] = 'encoder_layers';\n mapping['num_encoder_heads'] = 'encoder_attention_heads';\n mapping['encoder_hidden_size'] = 'hidden_size';\n break;\n case 'trocr':\n mapping['num_encoder_layers'] = mapping['num_decoder_layers'] = 'decoder_layers';\n mapping['num_encoder_heads'] = mapping['num_decoder_heads'] = 'decoder_attention_heads';\n mapping['encoder_hidden_size'] = mapping['decoder_hidden_size'] = 'd_model';\n break;\n case 'musicgen_decoder':\n mapping['num_encoder_layers'] = mapping['num_decoder_layers'] = 'num_hidden_layers';\n mapping['num_encoder_heads'] = mapping['num_decoder_heads'] = 'num_attention_heads';\n mapping['encoder_hidden_size'] = mapping['decoder_hidden_size'] = 'hidden_size';\n break;\n case 'moonshine':\n mapping['num_decoder_layers'] = 'decoder_num_hidden_layers';\n mapping['num_decoder_heads'] = 'decoder_num_key_value_heads';\n mapping['num_encoder_layers'] = 'encoder_num_hidden_layers';\n mapping['num_encoder_heads'] = 'encoder_num_key_value_heads';\n mapping['encoder_hidden_size'] = mapping['decoder_hidden_size'] = 'hidden_size';\n break;\n case 'vision-encoder-decoder':\n // @ts-expect-error TS2339\n const decoderConfig = getNormalizedConfig(config.decoder);\n\n const add_encoder_pkv = 'num_decoder_layers' in decoderConfig;\n const result = pick(config, ['model_type', 'is_encoder_decoder']);\n if (add_encoder_pkv) {\n // Decoder is part of an encoder-decoder model\n result.num_decoder_layers = decoderConfig.num_decoder_layers;\n result.num_decoder_heads = decoderConfig.num_decoder_heads;\n result.decoder_hidden_size = decoderConfig.decoder_hidden_size;\n\n result.num_encoder_layers = decoderConfig.num_encoder_layers;\n result.num_encoder_heads = decoderConfig.num_encoder_heads;\n result.encoder_hidden_size = decoderConfig.encoder_hidden_size;\n } else {\n // Decoder is a decoder-only model\n result.num_layers = decoderConfig.num_layers;\n result.num_heads = decoderConfig.num_heads;\n result.hidden_size = decoderConfig.hidden_size;\n }\n return result;\n\n }\n\n // NOTE: If `num_attention_heads` is not set, it is assumed to be equal to `num_heads`\n const normalized_config = {\n ...init_normalized_config,\n ...pick(config, ['model_type', 'multi_query', 'is_encoder_decoder']),\n };\n for (const key in mapping) {\n normalized_config[key] = config[mapping[key]];\n }\n return normalized_config;\n}\n\n/**\n * \n * @param {PretrainedConfig} config \n * @returns {Record<string, number[]>}\n */\nexport function getCacheShapes(config, options) {\n if (config.model_type === 'lfm2') {\n const pkv_prefix = options?.prefix ?? 'past_key_values';\n const conv_prefix = pkv_prefix === 'present' ? 'present' : 'past';\n\n // Custom caching mechanism for LFM2\n /** @type {Record<string, number[]>} */\n const cache_values = {};\n // @ts-expect-error TS2339\n const { layer_types, num_attention_heads, num_key_value_heads, hidden_size, conv_L_cache } = config;\n const head_dim = hidden_size / num_attention_heads;\n const batch_size = options?.batch_size ?? 1;\n for (let i = 0; i < layer_types.length; ++i) {\n if (layer_types[i] === 'full_attention') {\n for (const kv of ['key', 'value']) {\n cache_values[`${pkv_prefix}.${i}.${kv}`] = [batch_size, num_key_value_heads, 0, head_dim];\n }\n } else if (layer_types[i] === 'conv') {\n cache_values[`${conv_prefix}_conv.${i}`] = [batch_size, hidden_size, conv_L_cache];\n } else {\n throw new Error(`Unsupported layer type: ${layer_types[i]}`);\n }\n }\n return cache_values;\n }\n return getKeyValueShapes(config, options);\n}\n\n/** @type {typeof getKeyValueShapes} */\nfunction getKeyValueShapes(config, {\n prefix = 'past_key_values',\n batch_size = 1,\n} = {}) {\n /** @type {Record<string, number[]>} */\n const decoderFeeds = {};\n const normalized_config = config.normalized_config;\n\n if (normalized_config.is_encoder_decoder && (\n 'num_encoder_heads' in normalized_config && 'num_decoder_heads' in normalized_config\n )) {\n const encoder_dim_kv = normalized_config.encoder_dim_kv ?? (\n normalized_config.encoder_hidden_size / normalized_config.num_encoder_heads\n );\n const decoder_dim_kv = normalized_config.decoder_dim_kv ?? (\n normalized_config.decoder_hidden_size / normalized_config.num_decoder_heads\n );\n\n const encoder_dims = [batch_size, normalized_config.num_encoder_heads, 0, encoder_dim_kv];\n const decoder_dims = [batch_size, normalized_config.num_decoder_heads, 0, decoder_dim_kv];\n for (let i = 0; i < normalized_config.num_decoder_layers; ++i) {\n decoderFeeds[`${prefix}.${i}.encoder.key`] = encoder_dims;\n decoderFeeds[`${prefix}.${i}.encoder.value`] = encoder_dims;\n decoderFeeds[`${prefix}.${i}.decoder.key`] = decoder_dims;\n decoderFeeds[`${prefix}.${i}.decoder.value`] = decoder_dims;\n }\n } else { // Decoders\n const num_heads = normalized_config.num_heads;\n const num_layers = normalized_config.num_layers;\n const dim_kv = normalized_config.dim_kv ?? (\n normalized_config.hidden_size /\n (normalized_config.num_attention_heads ?? num_heads)\n );\n\n if (normalized_config.model_type === 'falcon') {\n // NOTE: Custom implementation for Falcon\n const dims = [batch_size * num_heads, 0, dim_kv]\n for (let i = 0; i < num_layers; ++i) {\n decoderFeeds[`${prefix}.${i}.key`] = dims;\n decoderFeeds[`${prefix}.${i}.value`] = dims;\n }\n } else if (normalized_config.multi_query) { // e.g., for `gpt_bigcode`\n const dims = [batch_size * num_heads, 0, 2 * dim_kv]\n\n for (let i = 0; i < num_layers; ++i) {\n decoderFeeds[`${prefix}.${i}.key_value`] = dims;\n }\n } else if (normalized_config.model_type === 'bloom') {\n // NOTE: Custom implementation for Bloom\n\n const keyDims = [batch_size * num_heads, dim_kv, 0] // [batch_size x num_heads,64,past_sequence_length]\n const valueDims = [batch_size * num_heads, 0, dim_kv] // [batch_size x num_heads,past_sequence_length,64]\n for (let i = 0; i < num_layers; ++i) {\n decoderFeeds[`${prefix}.${i}.key`] = keyDims;\n decoderFeeds[`${prefix}.${i}.value`] = valueDims;\n }\n } else if (normalized_config.model_type === 'openelm') {\n for (let i = 0; i < num_layers; ++i) {\n const dims = [batch_size, num_heads[i], 0, dim_kv]\n\n decoderFeeds[`${prefix}.${i}.key`] = dims;\n decoderFeeds[`${prefix}.${i}.value`] = dims;\n }\n } else { // Decoder-only\n const dims = [batch_size, num_heads, 0, dim_kv]\n for (let i = 0; i < num_layers; ++i) {\n decoderFeeds[`${prefix}.${i}.key`] = dims;\n decoderFeeds[`${prefix}.${i}.value`] = dims;\n }\n }\n }\n\n return decoderFeeds;\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 /** @type {string|null} */\n model_type = null;\n\n /** @type {boolean} */\n is_encoder_decoder = false;\n\n /** @type {number} */\n max_position_embeddings;\n\n /** @type {TransformersJSConfig} */\n 'transformers.js_config';\n\n /**\n * Create a new PreTrainedTokenizer instance.\n * @param {Object} configJSON The JSON of the config.\n */\n constructor(configJSON) {\n Object.assign(this, configJSON);\n this.normalized_config = getNormalizedConfig(this);\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<PretrainedConfig>} 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 if (config && !(config instanceof PretrainedConfig)) {\n config = new PretrainedConfig(config);\n }\n\n const 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/**\n * Transformers.js-specific configuration, possibly present in config.json under the key `transformers.js_config`.\n * @typedef {Object} TransformersJSConfig\n * @property {Record<import('./utils/devices.js').DeviceType, DeviceConfig>} [device_config] Device-specific configurations.\n * @property {import('./utils/tensor.js').DataType|Record<import('./utils/dtypes.js').DataType, import('./utils/tensor.js').DataType>} [kv_cache_dtype] The data type of the key-value cache.\n * @property {Record<string, number>} [free_dimension_overrides] Override the free dimensions of the model.\n * See https://onnxruntime.ai/docs/tutorials/web/env-flags-and-session-options.html#freedimensionoverrides\n * for more information.\n * @property {import('./utils/devices.js').DeviceType} [device] The default device to use for the model.\n * @property {import('./utils/dtypes.js').DataType|Record<string, import('./utils/dtypes.js').DataType>} [dtype] The default data type to use for the model.\n * @property {import('./utils/hub.js').ExternalData|Record<string, import('./utils/hub.js').ExternalData>} [use_external_data_format=false] Whether to load the model using the external data format (used for models >= 2GB in size).\n */\n\n/**\n * Device-specific configuration options.\n * @typedef {Omit<TransformersJSConfig, \"device\" | \"device_config\">} DeviceConfig\n */\n","/**\n * @file Module used to configure Transformers.js.\n * \n * **Example:** Disable remote models.\n * ```javascript\n * import { env } from '@huggingface/transformers';\n * env.allowRemoteModels = false;\n * ```\n * \n * **Example:** Set local model path.\n * ```javascript\n * import { env } from '@huggingface/transformers';\n * env.localModelPath = '/path/to/local/models/';\n * ```\n * \n * **Example:** Set cache directory.\n * ```javascript\n * import { env } from '@huggingface/transformers';\n * env.cacheDir = '/path/to/cache/directory/';\n * ```\n * \n * @module env\n */\n\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport url from 'node:url';\n\nconst VERSION = '3.8.1';\n\n// Check if various APIs are available (depends on environment)\nconst IS_BROWSER_ENV = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\nconst IS_WEBWORKER_ENV = typeof self !== \"undefined\" && (['DedicatedWorkerGlobalScope', 'ServiceWorkerGlobalScope', 'SharedWorkerGlobalScope'].includes(self.constructor?.name));\nconst IS_WEB_CACHE_AVAILABLE = typeof self !== \"undefined\" && 'caches' in self;\nconst IS_WEBGPU_AVAILABLE = typeof navigator !== 'undefined' && 'gpu' in navigator;\nconst IS_WEBNN_AVAILABLE = typeof navigator !== 'undefined' && 'ml' in navigator;\n\nconst IS_PROCESS_AVAILABLE = typeof process !== 'undefined';\nconst IS_NODE_ENV = IS_PROCESS_AVAILABLE && process?.release?.name === 'node';\nconst IS_FS_AVAILABLE = !isEmpty(fs);\nconst IS_PATH_AVAILABLE = !isEmpty(path);\n\n// Runtime detection\nconst IS_DENO_RUNTIME = typeof globalThis.Deno !== 'undefined';\nconst IS_BUN_RUNTIME = typeof globalThis.Bun !== 'undefined';\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 (and not a web worker) */\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 the WebNN API is available */\n IS_WEBNN_AVAILABLE,\n\n /** Whether the Node.js process API is available */\n IS_PROCESS_AVAILABLE,\n\n /** Whether we are running in a Node.js-like environment (node, deno, bun) */\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;\n\nlet dirname__ = './';\nif (RUNNING_LOCALLY) {\n // NOTE: We wrap `import.meta` in a call to `Object` to prevent Webpack from trying to bundle it in CommonJS.\n // Although we get the warning: \"Accessing import.meta directly is unsupported (only property access or destructuring is supported)\",\n // it is safe to ignore since the bundled value (`{}`) isn't used for CommonJS environments (we use __dirname instead).\n const _import_meta_url = Object(import.meta).url;\n\n if (_import_meta_url) {\n dirname__ = path.dirname(path.dirname(url.fileURLToPath(_import_meta_url))) // ESM\n } else if (typeof __dirname !== 'undefined') {\n dirname__ = path.dirname(__dirname) // CommonJS\n }\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 {{onnx: Partial<import('onnxruntime-common').Env>}} 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 * If you wish, you may also return a `Promise<string>` from the `match` function if you'd like to use a file path instead of `Promise<Response>`.\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\n /////////////////// Model settings ///////////////////\n allowRemoteModels: true,\n remoteHost: 'https://huggingface.co/',\n remotePathTemplate: '{model}/resolve/{revision}/',\n\n allowLocalModels: !(IS_BROWSER_ENV || IS_WEBWORKER_ENV),\n localModelPath: localModelPath,\n useFS: IS_FS_AVAILABLE,\n\n /////////////////// Cache settings ///////////////////\n useBrowserCache: IS_WEB_CACHE_AVAILABLE && !IS_DENO_RUNTIME,\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 * @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://huggingface.co/papers/1610.02424) 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://huggingface.co/papers/2202.00666) 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://huggingface.co/papers/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://huggingface.co/papers/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://huggingface.co/papers/1909.05858) 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 streamer that will be used to stream the generation.\n * @type {import('./streamers.js').TextStreamer}\n * @default null\n */\n streamer = 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|import('../configs.js').PretrainedConfig} 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 {bigint[][]} 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 {bigint[][]} 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 {bigint[][]} 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 {bigint[][]} 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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} 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_data = /** @type {Float32Array} */(logits[i].data);\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 enforces the specified token as the last generated token when `max_length` is reached.\n */\nexport class ForcedEOSTokenLogitsProcessor extends LogitsProcessor {\n /**\n * Create a ForcedEOSTokenLogitsProcessor.\n * @param {number} max_length The maximum length of the sequence to be generated.\n * @param {number|number[]} eos_token_id The id(s) of the *end-of-sequence* token.\n */\n constructor(max_length, eos_token_id) {\n super();\n this.max_length = max_length;\n this.eos_token_id = Array.isArray(eos_token_id) ? eos_token_id : [eos_token_id];\n }\n\n /**\n * Apply the processor to input_ids and logits.\n * \n * @param {bigint[][]} input_ids The input ids.\n * @param {Tensor} logits The logits tensor.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n if (input_ids[i].length === this.max_length - 1) {\n const batch_logits_data = /** @type {Float32Array} */(logits[i].data);\n batch_logits_data.fill(-Infinity);\n for (const eos_token of this.eos_token_id) {\n batch_logits_data[eos_token] = 0;\n }\n }\n }\n return logits;\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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} 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_data = /** @type {Float32Array} */(logits[i].data);\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 {import('../models/whisper/generation_whisper.js').WhisperGenerationConfig} generate_config The config object passed to the `generate()` method of a transformer model.\n * @param {number[]} init_tokens The initial tokens of the input sequence.\n */\n constructor(generate_config, init_tokens) {\n super();\n this.eos_token_id =\n Array.isArray(generate_config.eos_token_id)\n ? generate_config.eos_token_id[0]\n : generate_config.eos_token_id;\n\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 = init_tokens.length;\n if (init_tokens.at(-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 * Modify the logits to handle timestamp tokens.\n * @param {bigint[][]} 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_data = /** @type {Float32Array} */(logits[i].data);\n\n // suppress <|notimestamps|> which is handled by without_timestamps\n batch_logits_data[this.no_timestamps_token_id] = -Infinity;\n\n if (input_ids[i].length === this.begin_index - 1) {\n batch_logits_data.fill(-Infinity);\n batch_logits_data[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 batch_logits_data.subarray(this.timestamp_begin).fill(-Infinity);\n } else { // cannot be normal text tokens\n batch_logits_data.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 batch_logits_data.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(batch_logits_data);\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 batch_logits_data.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 {bigint[]} prevInputIds List of previous input ids\n * @returns {Map<string, number[]>} 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.map(Number));\n }\n\n /** @type {Map<string, number[]>} */\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<string, number[]>} bannedNgrams Map of banned n-grams\n * @param {bigint[]} 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.map(Number))) ?? [];\n return banned;\n }\n\n /**\n * Calculate banned n-gram tokens\n * @param {bigint[]} 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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} 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_data = /** @type {Float32Array} */(logits[i].data);\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 prevents the repetition of previous tokens through a penalty.\n * This penalty is applied at most once per token. Note that, for decoder-only models like most LLMs,\n * the considered tokens include the prompt.\n * \n * In the original [paper](https://huggingface.co/papers/1909.05858), the authors suggest the use of a\n * penalty of around 1.2 to achieve a good balance between truthful generation and lack of repetition.\n * To penalize and reduce repetition, use `penalty` values above 1.0, where a higher value penalizes\n * more strongly. To reward and encourage repetition, use `penalty` values between 0.0 and 1.0, where\n * a lower value rewards more strongly.\n */\nexport class RepetitionPenaltyLogitsProcessor extends LogitsProcessor {\n /**\n * Create a RepetitionPenaltyLogitsProcessor.\n * @param {number} penalty The parameter for repetition penalty.\n * - 1.0 means no penalty. Above 1.0 penalizes previously generated tokens.\n * - Between 0.0 and 1.0 rewards previously generated tokens.\n */\n constructor(penalty) {\n super();\n this.penalty = penalty;\n }\n\n /**\n * Apply the repetition penalty to the logits.\n * @param {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} The logits with repetition penalty processing.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n const batch_logits_data = /** @type {Float32Array} */(logits[i].data);\n for (const input_id of new Set(input_ids[i])) {\n const token = Number(input_id);\n if (batch_logits_data[token] < 0) {\n batch_logits_data[token] *= this.penalty;\n } else {\n batch_logits_data[token] /= 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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} 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_data = /** @type {Float32Array} */(logits[i].data);\n\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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} 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_data = /** @type {Float32Array} */(logits[i].data);\n\n for (const eos_token of this.eos_token_id) {\n batch_logits_data[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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} The processed logits.\n */\n _call(input_ids, logits) {\n for (let i = 0; i < input_ids.length; ++i) {\n const batch_logits_data = /** @type {Float32Array} */(logits[i].data);\n const ids = input_ids[i];\n for (const bad_word_ids of this.bad_words_ids) {\n // There aren't enough tokens to match the banned sequence\n if (ids.length < bad_word_ids.length - 1) continue;\n\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 j = 1; j <= bad_word_ids.length - 1; ++j) {\n // NOTE: We use != instead of !== to compare bigint and number\n // @ts-ignore\n if (bad_word_ids.at(-j - 1) != ids.at(-j)) {\n // We have found a mismatch\n mark = false;\n break;\n }\n }\n if (mark) {\n batch_logits_data[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://huggingface.co/papers/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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} 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 {bigint[][]} input_ids The input IDs.\n * @param {Tensor} logits The logits.\n * @returns {Tensor} The processed logits.\n */\n _call(input_ids, logits) {\n const batch_logits_data = /** @type {Float32Array} */(logits.data);\n for (let i = 0; i < batch_logits_data.length; ++i) {\n batch_logits_data[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, topk } from \"../utils/tensor.js\";\n\nimport {\n max,\n softmax,\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 * @returns {Promise<[bigint, number][]>}\n */\n async _call(logits) {\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);\n }\n\n /**\n * Abstract method for sampling the logits.\n * @param {Tensor} logits\n * @throws {Error} If not implemented in subclass.\n * @returns {Promise<[bigint, number][]>}\n */\n async sample(logits) {\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 {import(\"../transformers.js\").DataArray} 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 = 0;\n for (let i = 0; i < probabilities.length; ++i) {\n sumProbabilities += probabilities[i];\n }\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 * @returns {Promise<[bigint, 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 async sample(logits) {\n // NOTE: no need to do log_softmax here since we only take the maximum\n const argmax = max(logits.data)[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 [BigInt(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 * @returns {Promise<[bigint, number][]>}\n */\n async sample(logits) {\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 top k tokens\n const [v, i] = await topk(logits, k);\n\n // Compute softmax over logits\n const probabilities = softmax(/** @type {Float32Array} */(v.data));\n\n return Array.from({ length: this.generation_config.num_beams }, () => {\n const sampledIndex = this.randomSelect(probabilities);\n return [\n i.data[sampledIndex], // 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 * @returns {Promise<[bigint, number][]>}\n */\n async sample(logits) {\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 top k tokens\n const [v, i] = await topk(logits, k);\n\n // Compute softmax over logits\n const probabilities = softmax(/** @type {Float32Array} */(v.data));\n\n return Array.from({ length: this.generation_config.num_beams }, (_, x) => {\n return [\n i.data[x], // token id\n Math.log(probabilities[x]), // 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 {StoppingCriteria|StoppingCriteriaList|StoppingCriteria[]} items The stopping criteria to add.\n */\n extend(items) {\n if (items instanceof StoppingCriteriaList) {\n items = items.criteria;\n } else if (items instanceof StoppingCriteria) {\n items = [items];\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 => {\n const last = ids.at(-1);\n // NOTE: We use == instead of === to allow for number/bigint comparison\n return this.eos_token_id.some(eos_id => last == eos_id);\n });\n }\n}\n\n/**\n * This class can be used to stop generation whenever the user interrupts the process.\n */\nexport class InterruptableStoppingCriteria extends StoppingCriteria {\n constructor() {\n super();\n this.interrupted = false;\n }\n\n interrupt() {\n this.interrupted = true;\n }\n\n reset() {\n this.interrupted = false;\n }\n\n _call(input_ids, scores) {\n return new Array(input_ids.length).fill(this.interrupted);\n }\n}\n","\n/**\n * @module generation/streamers\n */\n\nimport { mergeArrays } from '../utils/core.js';\nimport { is_chinese_char } from '../tokenizers.js';\nimport { apis } from '../env.js';\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\nconst stdout_write = apis.IS_PROCESS_AVAILABLE\n ? x => process.stdout.write(x)\n : x => console.log(x);\n\n/**\n * Simple text streamer that prints the token(s) to stdout as soon as entire words are formed.\n */\nexport class TextStreamer extends BaseStreamer {\n /**\n * \n * @param {import('../tokenizers.js').PreTrainedTokenizer} tokenizer\n * @param {Object} options\n * @param {boolean} [options.skip_prompt=false] Whether to skip the prompt tokens\n * @param {boolean} [options.skip_special_tokens=true] Whether to skip special tokens when decoding\n * @param {function(string): void} [options.callback_function=null] Function to call when a piece of text is ready to display\n * @param {function(bigint[]): void} [options.token_callback_function=null] Function to call when a new token is generated\n * @param {Object} [options.decode_kwargs={}] Additional keyword arguments to pass to the tokenizer's decode method\n */\n constructor(tokenizer, {\n skip_prompt = false,\n callback_function = null,\n token_callback_function = null,\n skip_special_tokens = true,\n decode_kwargs = {},\n ...kwargs\n } = {}) {\n super();\n this.tokenizer = tokenizer;\n this.skip_prompt = skip_prompt;\n this.callback_function = callback_function ?? stdout_write;\n this.token_callback_function = token_callback_function;\n this.decode_kwargs = { skip_special_tokens, ...decode_kwargs, ...kwargs };\n\n // variables used in the streaming process\n this.token_cache = [];\n this.print_len = 0;\n this.next_tokens_are_prompt = true;\n }\n\n /**\n * Receives tokens, decodes them, and prints them to stdout as soon as they form entire words.\n * @param {bigint[][]} value \n */\n put(value) {\n if (value.length > 1) {\n throw Error('TextStreamer only supports batch size of 1');\n }\n\n const is_prompt = this.next_tokens_are_prompt;\n if (is_prompt) {\n this.next_tokens_are_prompt = false;\n if (this.skip_prompt) return;\n }\n\n const tokens = value[0];\n this.token_callback_function?.(tokens)\n\n // Add the new token to the cache and decodes the entire thing.\n this.token_cache = mergeArrays(this.token_cache, tokens);\n const text = this.tokenizer.decode(this.token_cache, this.decode_kwargs);\n\n let printable_text;\n if (is_prompt || text.endsWith('\\n')) {\n // After the symbol for a new line, we flush the cache.\n printable_text = text.slice(this.print_len);\n this.token_cache = [];\n this.print_len = 0;\n } else if (text.length > 0 && is_chinese_char(text.charCodeAt(text.length - 1))) {\n // If the last token is a CJK character, we print the characters.\n printable_text = text.slice(this.print_len);\n this.print_len += printable_text.length;\n } else {\n // Otherwise, prints until the last space char (simple heuristic to avoid printing incomplete words,\n // which may change with the subsequent token -- there are probably smarter ways to do this!)\n printable_text = text.slice(this.print_len, text.lastIndexOf(' ') + 1);\n this.print_len += printable_text.length;\n }\n\n this.on_finalized_text(printable_text, false);\n }\n\n /**\n * Flushes any remaining cache and prints a newline to stdout.\n */\n end() {\n let printable_text;\n if (this.token_cache.length > 0) {\n const text = this.tokenizer.decode(this.token_cache, this.decode_kwargs);\n printable_text = text.slice(this.print_len);\n this.token_cache = [];\n this.print_len = 0;\n } else {\n printable_text = '';\n }\n this.next_tokens_are_prompt = true;\n this.on_finalized_text(printable_text, true);\n }\n\n /**\n * Prints the new text to stdout. If the stream is ending, also prints a newline.\n * @param {string} text \n * @param {boolean} stream_end \n */\n on_finalized_text(text, stream_end) {\n if (text.length > 0) {\n this.callback_function?.(text);\n }\n if (stream_end && this.callback_function === stdout_write && apis.IS_PROCESS_AVAILABLE) {\n this.callback_function?.('\\n');\n }\n }\n}\n\n/**\n * Utility class to handle streaming of tokens generated by whisper speech-to-text models.\n * Callback functions are invoked when each of the following events occur:\n * - A new chunk starts (on_chunk_start)\n * - A new token is generated (callback_function)\n * - A chunk ends (on_chunk_end)\n * - The stream is finalized (on_finalize)\n */\nexport class WhisperTextStreamer extends TextStreamer {\n /**\n * @param {import('../tokenizers.js').WhisperTokenizer} tokenizer\n * @param {Object} options\n * @param {boolean} [options.skip_prompt=false] Whether to skip the prompt tokens\n * @param {function(string): void} [options.callback_function=null] Function to call when a piece of text is ready to display\n * @param {function(bigint[]): void} [options.token_callback_function=null] Function to call when a new token is generated\n * @param {function(number): void} [options.on_chunk_start=null] Function to call when a new chunk starts\n * @param {function(number): void} [options.on_chunk_end=null] Function to call when a chunk ends\n * @param {function(): void} [options.on_finalize=null] Function to call when the stream is finalized\n * @param {number} [options.time_precision=0.02] Precision of the timestamps\n * @param {boolean} [options.skip_special_tokens=true] Whether to skip special tokens when decoding\n * @param {Object} [options.decode_kwargs={}] Additional keyword arguments to pass to the tokenizer's decode method\n */\n constructor(tokenizer, {\n skip_prompt = false,\n callback_function = null,\n token_callback_function = null,\n on_chunk_start = null,\n on_chunk_end = null,\n on_finalize = null,\n time_precision = 0.02,\n skip_special_tokens = true,\n decode_kwargs = {},\n } = {}) {\n super(tokenizer, {\n skip_prompt,\n skip_special_tokens,\n callback_function,\n token_callback_function,\n decode_kwargs,\n });\n this.timestamp_begin = tokenizer.timestamp_begin;\n\n this.on_chunk_start = on_chunk_start;\n this.on_chunk_end = on_chunk_end;\n this.on_finalize = on_finalize;\n\n this.time_precision = time_precision;\n\n this.waiting_for_timestamp = false;\n }\n\n /**\n * @param {bigint[][]} value \n */\n put(value) {\n if (value.length > 1) {\n throw Error('WhisperTextStreamer only supports batch size of 1');\n }\n const tokens = value[0];\n\n // Check if the token is a timestamp\n if (tokens.length === 1) {\n const offset = Number(tokens[0]) - this.timestamp_begin;\n if (offset >= 0) {\n const time = offset * this.time_precision;\n if (this.waiting_for_timestamp) {\n this.on_chunk_end?.(time);\n } else {\n this.on_chunk_start?.(time);\n }\n this.waiting_for_timestamp = !this.waiting_for_timestamp; // Toggle\n\n // NOTE: Timestamp tokens should not be printed. Although, since they\n // aren't classified as \"special tokens\", we need to handle them here.\n this.token_callback_function?.(tokens);\n return;\n }\n }\n return super.put(value);\n }\n\n end() {\n super.end();\n this.on_finalize?.();\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 '@huggingface/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 '@huggingface/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 getCacheShapes,\n} from './configs.js';\n\nimport {\n deviceToExecutionProviders,\n createInferenceSession,\n isONNXTensor,\n isONNXProxy,\n runInferenceSession,\n} from './backends/onnx.js';\nimport {\n DATA_TYPES,\n DEFAULT_DEVICE_DTYPE_MAPPING,\n DEFAULT_DTYPE_SUFFIX_MAPPING,\n isWebGpuFp16Supported,\n} from './utils/dtypes.js';\n\nimport {\n Callable,\n} from './utils/generic.js';\n\nimport {\n mergeArrays,\n pick,\n} from './utils/core.js';\n\nimport {\n getModelFile,\n getModelJSON,\n MAX_EXTERNAL_DATA_CHUNKS,\n} from './utils/hub.js';\n\nimport {\n GITHUB_ISSUE_URL,\n} from './utils/constants.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 ClassifierFreeGuidanceLogitsProcessor,\n} from './generation/logits_process.js';\n\nimport {\n GenerationConfig,\n} from './generation/configuration_utils.js';\n\nimport {\n cat,\n mean,\n zeros,\n zeros_like,\n ones,\n ones_like,\n full,\n full_like,\n stack,\n std_mean,\n Tensor,\n DataTypeMap,\n randn,\n} from './utils/tensor.js';\nimport { RawImage } from './utils/image.js';\n\nimport { dynamic_time_warping, max, medianFilter } from './utils/maths.js';\nimport { EosTokenCriteria, MaxLengthCriteria, StoppingCriteriaList } from './generation/stopping_criteria.js';\nimport { LogitsSampler } from './generation/logits_sampler.js';\nimport { apis, env } from './env.js';\n\nimport { WhisperGenerationConfig } from './models/whisper/generation_whisper.js';\nimport { whisper_language_to_code } from './models/whisper/common_whisper.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 MultiModality: 8,\n Phi3V: 9,\n AudioTextToText: 10,\n AutoEncoder: 11,\n ImageAudioTextToText: 12,\n Supertonic: 13,\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_or_path: Uint8Array|string, session_options: Object, session_config: 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 custom_config = options.config?.['transformers.js_config'] ?? {};\n\n let device = options.device ?? custom_config.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 selectedDevice = /** @type {import(\"./utils/devices.js\").DeviceType} */(\n device ?? (apis.IS_NODE_ENV ? 'cpu' : 'wasm')\n );\n\n const executionProviders = deviceToExecutionProviders(selectedDevice);\n\n // Update custom config with the selected device's config, if it exists\n const device_config = custom_config.device_config ?? {};\n if (device_config.hasOwnProperty(selectedDevice)) {\n custom_config = {\n ...custom_config,\n ...device_config[selectedDevice],\n };\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 ?? custom_config.dtype;\n if (typeof dtype !== 'string') {\n if (dtype && dtype.hasOwnProperty(fileName)) {\n dtype = dtype[fileName];\n } else {\n dtype = DEFAULT_DEVICE_DTYPE_MAPPING[selectedDevice] ?? DATA_TYPES.fp32;\n console.warn(`dtype not specified for \"${fileName}\". Using the default dtype (${dtype}) for this device (${selectedDevice}).`);\n }\n }\n\n if (dtype === DATA_TYPES.auto) {\n // Try to choose the auto dtype based on the custom config\n let config_dtype = custom_config.dtype;\n if (typeof config_dtype !== 'string') {\n config_dtype = config_dtype?.[fileName];\n }\n\n if (config_dtype && config_dtype !== DATA_TYPES.auto && DATA_TYPES.hasOwnProperty(config_dtype)) {\n // Defined by the config, and is not \"auto\"\n dtype = config_dtype;\n } else {\n // Choose default dtype based on device, falling back to fp32\n dtype = DEFAULT_DEVICE_DTYPE_MAPPING[selectedDevice] ?? DATA_TYPES.fp32;\n }\n }\n\n const selectedDtype = /** @type {import(\"./utils/dtypes.js\").DataType} */(dtype);\n\n if (!DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(selectedDtype)) {\n throw new Error(`Invalid dtype: ${selectedDtype}. Should be one of: ${Object.keys(DATA_TYPES).join(', ')}`);\n } else if (selectedDtype === DATA_TYPES.fp16 && selectedDevice === 'webgpu' && !(await isWebGpuFp16Supported())) {\n throw new Error(`The device (${selectedDevice}) does not support fp16.`);\n }\n\n // Only valid for models with a decoder\n const kv_cache_dtype_config = custom_config.kv_cache_dtype;\n const kv_cache_dtype = kv_cache_dtype_config\n ? (typeof kv_cache_dtype_config === 'string'\n ? kv_cache_dtype_config\n : kv_cache_dtype_config[selectedDtype] ?? 'float32')\n : undefined;\n\n if (kv_cache_dtype && !['float32', 'float16'].includes(kv_cache_dtype)) {\n throw new Error(`Invalid kv_cache_dtype: ${kv_cache_dtype}. Should be one of: float32, float16`);\n }\n\n const session_config = {\n dtype: selectedDtype,\n kv_cache_dtype,\n device: selectedDevice,\n }\n\n // Construct the model file name\n const suffix = DEFAULT_DTYPE_SUFFIX_MAPPING[selectedDtype];\n const baseName = `${fileName}${suffix}.onnx`;\n const modelFileName = `${options.subfolder ?? ''}/${baseName}`;\n\n const session_options = { ...options.session_options };\n\n // Overwrite `executionProviders` if not specified\n session_options.executionProviders ??= executionProviders;\n\n // Overwrite `freeDimensionOverrides` if specified in config and not set in session options\n const free_dimension_overrides = custom_config.free_dimension_overrides;\n if (free_dimension_overrides) {\n session_options.freeDimensionOverrides ??= free_dimension_overrides;\n } else if (selectedDevice.startsWith('webnn') && !session_options.freeDimensionOverrides) {\n console.warn(\n `WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config[\"transformers.js_config\"][\"device_config\"][\"${selectedDevice}\"]. ` +\n `When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`\n );\n }\n\n const return_path = apis.IS_NODE_ENV && env.useFSCache;\n const bufferOrPathPromise = getModelFile(pretrained_model_name_or_path, modelFileName, true, options, return_path);\n\n // Handle onnx external data files\n const use_external_data_format = options.use_external_data_format ?? custom_config.use_external_data_format;\n /** @type {Promise<string|{path: string, data: Uint8Array}>[]} */\n let externalDataPromises = [];\n if (use_external_data_format) {\n let external_data_format;\n if (typeof use_external_data_format === 'object') {\n if (use_external_data_format.hasOwnProperty(baseName)) {\n external_data_format = use_external_data_format[baseName];\n } else if (use_external_data_format.hasOwnProperty(fileName)) {\n external_data_format = use_external_data_format[fileName];\n } else {\n external_data_format = false;\n }\n } else {\n external_data_format = use_external_data_format;\n }\n\n const num_chunks = +external_data_format; // (false=0, true=1, number remains the same)\n if (num_chunks > MAX_EXTERNAL_DATA_CHUNKS) {\n throw new Error(`The number of external data chunks (${num_chunks}) exceeds the maximum allowed value (${MAX_EXTERNAL_DATA_CHUNKS}).`);\n }\n for (let i = 0; i < num_chunks; ++i) {\n const path = `${baseName}_data${i === 0 ? '' : '_' + i}`;\n const fullPath = `${options.subfolder ?? ''}/${path}`;\n externalDataPromises.push(new Promise(async (resolve, reject) => {\n const data = await getModelFile(pretrained_model_name_or_path, fullPath, true, options, return_path);\n resolve(data instanceof Uint8Array ? { path, data } : path);\n }));\n }\n\n } else if (session_options.externalData !== undefined) {\n externalDataPromises = session_options.externalData.map(async (ext) => {\n // if the external data is a string, fetch the file and replace the string with its content\n // @ts-expect-error TS2339\n if (typeof ext.data === \"string\") {\n // @ts-expect-error TS2339\n const ext_buffer = await getModelFile(pretrained_model_name_or_path, ext.data, true, options);\n // @ts-expect-error TS2698\n return { ...ext, data: ext_buffer };\n }\n return ext;\n });\n }\n\n if (externalDataPromises.length > 0) {\n const externalData = await Promise.all(externalDataPromises);\n if (!apis.IS_NODE_ENV) {\n session_options.externalData = externalData;\n }\n }\n\n if (selectedDevice === 'webgpu') {\n const shapes = getCacheShapes(options.config, {\n prefix: 'present',\n });\n if (Object.keys(shapes).length > 0 && !isONNXProxy()) {\n // Only set preferredOutputLocation if shapes are present and we aren't proxying ONNX\n /** @type {Record<string, import('onnxruntime-common').Tensor.DataLocation>} */\n const preferredOutputLocation = {};\n for (const key in shapes) {\n preferredOutputLocation[key] = 'gpu-buffer';\n }\n session_options.preferredOutputLocation = preferredOutputLocation;\n }\n }\n\n const buffer_or_path = await bufferOrPathPromise;\n\n return { buffer_or_path, session_options, session_config };\n}\n\n/**\n * Helper function to create multiple InferenceSession objects.\n * \n * @param {string} pretrained_model_name_or_path The path to the directory containing the model file.\n * @param {Record<string, string>} 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<Record<string, any>>} A Promise that resolves to a dictionary of InferenceSession objects.\n * @private\n */\nasync function constructSessions(pretrained_model_name_or_path, names, options) {\n return Object.fromEntries(await Promise.all(\n Object.keys(names).map(async (name) => {\n const { buffer_or_path, session_options, session_config } = await getSession(pretrained_model_name_or_path, names[name], options);\n const session = await createInferenceSession(buffer_or_path, session_options, session_config);\n return [name, session];\n })\n ));\n}\n\n/**\n * Helper function to load multiple optional configuration files\n * @param {string} pretrained_model_name_or_path The path to the directory containing the config file.\n * @param {Record<string, string>} names The names of the config files to load.\n * @param {import('./utils/hub.js').PretrainedModelOptions} options Additional options for loading the configs.\n * @returns {Promise<Record<string, any>>} A Promise that resolves to a dictionary of configuration objects.\n * @private\n */\nasync function getOptionalConfigs(pretrained_model_name_or_path, names, options) {\n return Object.fromEntries(await Promise.all(\n Object.keys(names).map(async (name) => {\n const config = await getModelJSON(pretrained_model_name_or_path, names[name], false, options);\n return [name, config];\n })\n ));\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<string, Tensor>} 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<string, Tensor>}\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<Object>} 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 const output = await runInferenceSession(session, ortFeed);\n return replaceTensors(output);\n } catch (e) {\n // Error messages can be long (nested) and uninformative. For this reason,\n // we apply minor formatting to show the most important information\n const formatted = Object.fromEntries(Object.entries(checkedInputs)\n .map(([k, tensor]) => {\n // Extract these properties from the underlying ORT tensor\n const unpacked = {\n type: tensor.type,\n dims: tensor.dims,\n location: tensor.location,\n }\n if (unpacked.location !== \"gpu-buffer\") {\n // Only return the data if it's not a GPU buffer\n unpacked.data = tensor.data;\n }\n return [k, unpacked];\n }));\n\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:', formatted);\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 {any[]|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 * 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<Seq2SeqLMOutput>} Promise that resolves with the output of the seq2seq model.\n * @private\n */\nasync function seq2seqForward(self, model_inputs) {\n let { encoder_outputs, input_ids, decoder_input_ids, ...other_decoder_inputs } = model_inputs;\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 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 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<Object>} The model's outputs.\n * @private\n */\nasync function encoderForward(self, model_inputs) {\n const session = self.sessions['model'];\n const encoderFeeds = pick(model_inputs, session.inputNames);\n\n if (session.inputNames.includes('inputs_embeds') && !encoderFeeds.inputs_embeds) {\n if (!model_inputs.input_ids) {\n throw new Error('Both `input_ids` and `inputs_embeds` are missing in the model inputs.');\n }\n encoderFeeds.inputs_embeds = await self.encode_text({ input_ids: model_inputs.input_ids });\n }\n if (session.inputNames.includes('token_type_ids') && !encoderFeeds.token_type_ids) {\n if (!encoderFeeds.input_ids) {\n throw new Error('Both `input_ids` and `token_type_ids` are missing in the model inputs.');\n }\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 = zeros_like(encoderFeeds.input_ids);\n }\n if (session.inputNames.includes('pixel_mask') && !encoderFeeds.pixel_mask) {\n if (!encoderFeeds.pixel_values) {\n throw new Error('Both `pixel_values` and `pixel_mask` are missing in the model inputs.');\n }\n // Assign default `pixel_mask` (all ones) to the `encoderFeeds` if the model expects it,\n // but they weren't created by the processor.\n const dims = encoderFeeds.pixel_values.dims;\n encoderFeeds.pixel_mask = ones([dims[0], dims[2], dims[3]]);\n }\n\n return await sessionRun(session, encoderFeeds);\n}\n\nasync function autoEncoderForward(self, model_inputs) {\n const encoded = await self.encode(model_inputs);\n const decoded = await self.decode(encoded);\n return decoded;\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<Object>} 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 if (session.inputNames.includes('position_ids') && new_model_inputs.attention_mask && !new_model_inputs.position_ids) {\n // NOTE: Handle a special case for paligemma/gemma3 models, where positions are 1-indexed\n const start_index = ['paligemma', 'gemma3_text', 'gemma3'].includes(self.config.model_type) ? 1 : 0;\n new_model_inputs.position_ids = createPositionIds(new_model_inputs, past_key_values, start_index);\n }\n\n // Unpack the `past_key_values` object into model inputs\n self.addPastKeyValues(new_model_inputs, past_key_values);\n\n // Select only the inputs that are needed for the current session\n const fixed = pick(new_model_inputs, session.inputNames);\n return await sessionRun(session, fixed);\n}\n\n\n\nfunction default_merge_input_ids_with_features({\n modality_token_id,\n inputs_embeds,\n modality_features,\n input_ids,\n attention_mask,\n}) {\n const token_positions = input_ids.tolist().map(ids =>\n ids.reduce((acc, x, idx) => {\n if (x == modality_token_id) acc.push(idx);\n return acc;\n }, [])\n );\n const n_tokens = token_positions.reduce((acc, x) => acc + x.length, 0);\n const n_features = modality_features.dims[0];\n if (n_tokens !== n_features) {\n throw new Error(`Number of tokens and features do not match: tokens: ${n_tokens}, features ${n_features}`);\n }\n\n // Equivalent to performing a masked_scatter\n let img = 0;\n for (let i = 0; i < token_positions.length; ++i) {\n const tokens = token_positions[i];\n const embeds = inputs_embeds[i];\n for (let j = 0; j < tokens.length; ++j) {\n embeds[tokens[j]].data.set(modality_features[img++].data)\n }\n }\n return { inputs_embeds, attention_mask }\n}\n\n\nfunction default_merge_input_ids_with_image_features({\n image_token_id,\n inputs_embeds,\n image_features,\n input_ids,\n attention_mask,\n}) {\n return default_merge_input_ids_with_features({\n modality_token_id: image_token_id,\n inputs_embeds,\n modality_features: image_features,\n input_ids,\n attention_mask,\n })\n}\n\nfunction default_merge_input_ids_with_audio_features({\n audio_token_id,\n inputs_embeds,\n audio_features,\n input_ids,\n attention_mask,\n}) {\n return default_merge_input_ids_with_features({\n modality_token_id: audio_token_id,\n inputs_embeds,\n modality_features: audio_features,\n input_ids,\n attention_mask,\n })\n}\n\n/**\n * Abstract forward pass function for image-text-to-text or audio-text-to-text models.\n * @param {Object} self The model object.\n * @param {Object} params Additional parameters.\n * @param {Function} [params.encode_function] The function to encode the modality values.\n * @param {Function} [params.merge_function] The function to merge the modality features with the input embeddings.\n * @param {string} [params.modality_input_name] The modality input name.\n * @param {string} [params.modality_output_name] The modality output name.\n * @param {Tensor} [params.input_ids=null]\n * @param {Tensor} [params.attention_mask=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<Tensor>} The model's output tensor\n * @private\n */\nasync function genericTextToTextForward(self, {\n // Generic parameters:\n encode_function,\n merge_function,\n modality_input_name,\n modality_output_name,\n\n // Produced by the tokenizer/processor:\n input_ids = null,\n attention_mask = 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 // Additional parameters\n ...kwargs\n}) {\n const modality_values = kwargs[modality_input_name];\n if (!inputs_embeds) {\n // 1. Extract the text embeddings.\n inputs_embeds = await self.encode_text({ input_ids, ...kwargs });\n\n // 2. Possibly, merge text and modality values\n if (modality_values && input_ids.dims[1] !== 1) {\n const modality_features = await encode_function({\n // Pass the modality values under its expected key.\n // The caller knows whether this is audio or image.\n [modality_input_name]: modality_values,\n ...kwargs\n });\n ({ inputs_embeds, attention_mask } = merge_function({\n [modality_output_name]: modality_features,\n inputs_embeds,\n input_ids,\n attention_mask,\n }));\n\n } else if (past_key_values && modality_values && input_ids.dims[1] === 1) {\n // This branch handles the cache case.\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 if (!position_ids) {\n\n if (self.config.model_type === 'qwen2_vl') {\n // Special case for qwen2_vl models\n // @ts-ignore\n const { image_grid_thw, video_grid_thw } = kwargs;\n [position_ids] = self.get_rope_index(input_ids, image_grid_thw, video_grid_thw, attention_mask)\n }\n }\n\n // 3. Call the decoder forward using the updated inputs.\n const outputs = await decoderForward(self, {\n inputs_embeds,\n past_key_values,\n attention_mask,\n position_ids,\n generation_config,\n logits_processor,\n }, true);\n return outputs;\n}\n\n/**\n * Forward pass of an audio-text-to-text model.\n * @param {Object} self The audio-text-to-text model.\n * @param {Object} params The inputs for the audio-text-to-text forward pass.\n * @returns {Promise<Tensor>} The model's output tensor.\n * @private\n */\nasync function audioTextToTextForward(self, params) {\n return await genericTextToTextForward(self, {\n ...params,\n modality_input_name: 'audio_values',\n modality_output_name: 'audio_features',\n encode_function: self.encode_audio.bind(self),\n merge_function: self._merge_input_ids_with_audio_features.bind(self),\n });\n}\n\n/**\n * Forward pass of an image-text-to-text model.\n * @param {Object} self The image-text-to-text model.\n * @param {Object} params The inputs for the image-text-to-text forward pass.\n * @returns {Promise<Tensor>} The model's output tensor.\n * @private\n */\nasync function imageTextToTextForward(self, params) {\n return await genericTextToTextForward(self, {\n ...params,\n modality_input_name: 'pixel_values',\n modality_output_name: 'image_features',\n encode_function: self.encode_image.bind(self),\n merge_function: self._merge_input_ids_with_image_features.bind(self),\n });\n}\n\n/**\n * Helper function to perform the following:\n * ```python\n * x = attention_mask.long().cumsum(-1) - 1\n * x.masked_fill_(attention_mask == 0, 1)\n * ```\n * @param {Tensor} attention_mask\n * @returns {{data: BigInt64Array, dims: number[]}}\n */\nfunction cumsum_masked_fill(attention_mask, start_index = 0) {\n const [bz, seq_len] = attention_mask.dims;\n const attn_mask_data = attention_mask.data;\n\n const data = new BigInt64Array(attn_mask_data.length);\n for (let i = 0; i < bz; ++i) {\n const start = i * seq_len;\n let sum = BigInt(start_index);\n for (let j = 0; j < seq_len; ++j) {\n const index = start + j;\n if (attn_mask_data[index] === 0n) {\n data[index] = BigInt(1);\n } else { // === 1n\n data[index] = sum;\n sum += attn_mask_data[index];\n }\n }\n }\n return { data, dims: attention_mask.dims };\n\n}\n\n/**\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 * ```python\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 * ```\n */\nfunction createPositionIds(model_inputs, past_key_values = null, start_index = 0) {\n const { input_ids, inputs_embeds, attention_mask } = model_inputs;\n\n const { data, dims } = cumsum_masked_fill(attention_mask, start_index);\n let position_ids = new Tensor('int64', data, dims);\n if (past_key_values) {\n const offset = -(input_ids ?? inputs_embeds).dims.at(1);\n position_ids = position_ids.slice(null, [offset, null]);\n }\n return position_ids;\n}\n\nfunction decoder_prepare_inputs_for_generation(self, input_ids, model_inputs, generation_config) {\n const past_length = model_inputs.past_key_values\n ? Object.values(model_inputs.past_key_values)[0].dims.at(-2)\n : 0;\n\n if (!model_inputs.attention_mask) {\n // If the attention mask is not provided, we attempt to infer based on provided inputs\n let dims;\n for (const key of ['input_ids', 'inputs_embeds', 'position_ids']) {\n if (model_inputs[key]) {\n dims = model_inputs[key].dims;\n break;\n }\n }\n if (!dims) {\n throw new Error(\"attention_mask is not provided, and unable to infer its shape from model inputs.\");\n }\n model_inputs.attention_mask = ones([dims[0], past_length + dims[1]]);\n }\n\n if (model_inputs.past_key_values) {\n const { input_ids, attention_mask } = model_inputs;\n\n // Keep only the unprocessed tokens:\n // 1 - If the length of the attention_mask exceeds the length of input_ids, then we are in a setting where\n // some of the inputs are exclusively passed as part of the cache (e.g. when passing input_embeds as\n // input)\n if (attention_mask && attention_mask.dims[1] > input_ids.dims[1]) {\n // NOTE: not needed since we only pass the generated tokens to the next forward pass\n // const offset = -(attention_mask.dims[1] - past_length);\n // model_inputs.input_ids = input_ids.slice(null, [offset, null]);\n }\n // 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens.\n // We can discard input_ids based on the past_length.\n else if (past_length < input_ids.dims[1]) {\n // NOTE: Required for phi models.\n // See https://github.com/huggingface/transformers/issues/30809#issuecomment-2111918479 for more information.\n model_inputs.input_ids = input_ids.slice(null, [past_length, null]);\n }\n // 3 - Otherwise (past_length >= input_ids.shape[1]), let's assume input_ids only has unprocessed tokens.\n else {\n\n }\n }\n\n return model_inputs;\n}\n\nfunction encoder_decoder_prepare_inputs_for_generation(self, input_ids, model_inputs, generation_config) {\n if (model_inputs.past_key_values) {\n input_ids = input_ids.map(x => [x.at(-1)]);\n }\n\n return {\n ...model_inputs,\n decoder_input_ids: toI64Tensor(input_ids),\n };\n}\n\nfunction multimodal_text_to_text_prepare_inputs_for_generation(self, ...args) {\n if (self.config.is_encoder_decoder) {\n return encoder_decoder_prepare_inputs_for_generation(self, ...args);\n } else {\n return decoder_prepare_inputs_for_generation(self, ...args);\n }\n}\n\nfunction multimodality_prepare_inputs_for_generation(self, input_ids, model_inputs, generation_config) {\n const has_past_key_values = !!model_inputs.past_key_values;\n\n if (generation_config.guidance_scale !== null && generation_config.guidance_scale > 1) {\n if (has_past_key_values) {\n model_inputs.input_ids = cat([\n model_inputs.input_ids,\n model_inputs.input_ids,\n ], 0)\n // NOTE: attention_mask handled in generation\n } else {\n model_inputs.input_ids = cat([\n model_inputs.input_ids,\n full_like(model_inputs.input_ids, BigInt(generation_config.pad_token_id)),\n ], 0);\n model_inputs.attention_mask = cat([\n model_inputs.attention_mask,\n full_like(model_inputs.attention_mask, 0n),\n ], 0);\n }\n }\n\n if (has_past_key_values || !model_inputs.pixel_values) {\n model_inputs.pixel_values = full([0, 0, 3, 384, 384], 1.0);\n }\n\n if (has_past_key_values) {\n const num_img_tokens = 0;\n const num_text_tokens = 1;\n const has_image = num_img_tokens > 0 ? 1 : 0;\n\n const batch_size = 1;\n model_inputs.images_seq_mask = new Tensor(\n 'bool',\n new Array(num_img_tokens + num_text_tokens).fill(true).fill(false, 0, num_text_tokens),\n [batch_size, num_img_tokens + num_text_tokens],\n );\n model_inputs.images_emb_mask = new Tensor(\n 'bool',\n new Array(num_img_tokens).fill(!!has_image),\n [batch_size, 1, num_img_tokens],\n );\n }\n return model_inputs;\n}\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 {import('./configs.js').PretrainedConfig} config The model configuration.\n * @param {Record<string, any>} sessions The inference sessions for the model.\n * @param {Record<string, Object>} configs Additional configuration files (e.g., generation_config.json).\n */\n constructor(config, sessions, configs) {\n super();\n\n this.config = config;\n this.sessions = sessions;\n this.configs = configs;\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 switch (modelType) {\n case MODEL_TYPES.DecoderOnly:\n this.can_generate = true;\n this._forward = decoderForward;\n this._prepare_inputs_for_generation = decoder_prepare_inputs_for_generation;\n break;\n case MODEL_TYPES.Seq2Seq:\n case MODEL_TYPES.Vision2Seq:\n case 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 break;\n\n case MODEL_TYPES.EncoderDecoder:\n this._forward = seq2seqForward;\n break;\n case MODEL_TYPES.ImageTextToText:\n this.can_generate = true;\n this._forward = imageTextToTextForward;\n this._prepare_inputs_for_generation = multimodal_text_to_text_prepare_inputs_for_generation;\n break;\n case MODEL_TYPES.AudioTextToText:\n this.can_generate = true;\n this._forward = audioTextToTextForward;\n this._prepare_inputs_for_generation = multimodal_text_to_text_prepare_inputs_for_generation;\n break;\n case MODEL_TYPES.Phi3V:\n case MODEL_TYPES.ImageAudioTextToText:\n this.can_generate = true;\n this._prepare_inputs_for_generation = multimodal_text_to_text_prepare_inputs_for_generation;\n break;\n case MODEL_TYPES.MultiModality:\n this.can_generate = true;\n this._prepare_inputs_for_generation = multimodality_prepare_inputs_for_generation;\n break;\n case MODEL_TYPES.AutoEncoder:\n this._forward = autoEncoderForward;\n break;\n default:\n // should be MODEL_TYPES.EncoderOnly\n this._forward = encoderForward;\n break;\n }\n\n if (this.can_generate) {\n this.forward_params.push('past_key_values');\n }\n\n /** @type {import('./configs.js').TransformersJSConfig} */\n this.custom_config = this.config['transformers.js_config'] ?? {};\n }\n\n /**\n * Disposes of all the ONNX sessions that were created during inference.\n * @returns {Promise<unknown[]>} 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 (const session of Object.values(this.sessions)) {\n if (session?.handler?.dispose) {\n promises.push(session.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<PreTrainedModel>} 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 use_external_data_format = 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 use_external_data_format,\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 config = options.config = await AutoConfig.from_pretrained(pretrained_model_name_or_path, options);\n\n let info;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, {\n model: options.model_file_name ?? 'model',\n }, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq) {\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, {\n model: 'encoder_model',\n decoder_model_merged: 'decoder_model_merged',\n }, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.MaskGeneration) {\n info = await Promise.all([\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 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 const sessions = {\n embed_tokens: 'embed_tokens',\n vision_encoder: 'vision_encoder',\n decoder_model_merged: 'decoder_model_merged',\n }\n if (config.is_encoder_decoder) {\n sessions['model'] = 'encoder_model';\n }\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, sessions, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.AudioTextToText) {\n const sessions = {\n embed_tokens: 'embed_tokens',\n audio_encoder: 'audio_encoder',\n decoder_model_merged: 'decoder_model_merged',\n }\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, sessions, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n } else if (modelType === MODEL_TYPES.ImageAudioTextToText) {\n const sessions = {\n embed_tokens: 'embed_tokens',\n audio_encoder: 'audio_encoder',\n vision_encoder: 'vision_encoder',\n decoder_model_merged: 'decoder_model_merged',\n }\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, sessions, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n } else if (modelType === MODEL_TYPES.Musicgen) {\n info = await Promise.all([\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 getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.MultiModality) {\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, {\n prepare_inputs_embeds: 'prepare_inputs_embeds',\n model: 'language_model',\n lm_head: 'lm_head',\n gen_head: 'gen_head',\n gen_img_embeds: 'gen_img_embeds',\n image_decode: 'image_decode',\n }, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.Phi3V) {\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, {\n prepare_inputs_embeds: 'prepare_inputs_embeds',\n model: 'model',\n vision_encoder: 'vision_encoder',\n }, options),\n getOptionalConfigs(pretrained_model_name_or_path, {\n generation_config: 'generation_config.json',\n }, options),\n ]);\n } else if (modelType === MODEL_TYPES.AutoEncoder) {\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, {\n encoder_model: 'encoder_model',\n decoder_model: 'decoder_model',\n }, options),\n ]);\n } else if (modelType === MODEL_TYPES.Supertonic) {\n info = await Promise.all([\n constructSessions(pretrained_model_name_or_path, {\n text_encoder: 'text_encoder',\n latent_denoiser: 'latent_denoiser',\n voice_decoder: 'voice_decoder',\n }, options),\n ]);\n } else { // should be MODEL_TYPES.EncoderOnly\n if (modelType !== MODEL_TYPES.EncoderOnly) {\n const type = modelName ?? config?.model_type;\n if (type !== 'custom') {\n console.warn(`Model type for '${type}' not found, assuming encoder-only architecture. Please report this at ${GITHUB_ISSUE_URL}.`)\n }\n }\n info = await Promise.all([\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(config, ...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>} 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<Object>} 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 * Get the model's generation config, if it exists.\n * @returns {GenerationConfig|null} The model's generation config if it exists, otherwise `null`.\n */\n get generation_config() {\n return this.configs?.generation_config ?? null;\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 const 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 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\n if (generation_config.temperature === 0 && generation_config.do_sample) {\n console.warn('`do_sample` changed to false because `temperature: 0` implies greedy sampling (always selecting the most likely token), which is incompatible with `do_sample: true`.');\n generation_config.do_sample = false;\n }\n\n if (generation_config.do_sample) {\n if (generation_config.temperature !== null && generation_config.temperature !== 1.0) {\n processors.push(new TemperatureLogitsWarper(generation_config.temperature));\n }\n // TODO: Add TopPLogitsWarper and TopKLogitsWarper\n // if (generation_config.top_k !== null && generation_config.top_k !== 0) {\n // processors.push(new TopKLogitsWarper(generation_config.top_k));\n // }\n // if (generation_config.top_p !== null && generation_config.top_p < 1.0) {\n // processors.push(new TopPLogitsWarper(generation_config.top_p));\n // }\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|null} 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, cls = GenerationConfig) {\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 config = { ...this.config };\n for (const key of [\"decoder\", \"generator\", \"text_config\"]) {\n // Special case: some models have generation attributes set in the decoder.\n // Use them if still unset in the generation config.\n if (key in config) {\n Object.assign(config, config[key]);\n }\n }\n\n const gen_config = new cls(config);\n\n // Apply model's generation config, if it exists\n Object.assign(gen_config, this.generation_config ?? {});\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 /**\n * \n * @param {Object} inputs\n * @param {bigint[][]} inputs.generated_input_ids\n * @param {Object} inputs.outputs\n * @param {Object} inputs.model_inputs\n * @param {boolean} inputs.is_encoder_decoder\n * @returns {Object} The updated model inputs for the next generation iteration.\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.flat(), [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<string, Tensor|number[]>} [params.model_kwargs]\n * @returns {{inputs_tensor: Tensor, model_inputs: Record<string, Tensor>, 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 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 if (\n this.sessions['model'].inputNames.includes('inputs_embeds')\n && !model_inputs.inputs_embeds\n && '_prepare_inputs_embeds' in this\n ) {\n // Encoder expects `inputs_embeds` instead of `input_ids`\n const { input_ids, pixel_values, attention_mask, ...kwargs } = model_inputs;\n // @ts-ignore\n const prepared_inputs = await this._prepare_inputs_embeds(model_inputs);\n model_inputs = {\n ...kwargs,\n ...pick(prepared_inputs, ['inputs_embeds', 'attention_mask']),\n };\n }\n let { last_hidden_state } = await encoderForward(this, model_inputs);\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 } else if (model_inputs.decoder_input_ids) {\n // Ensure that the encoder outputs have the same batch size as the decoder inputs,\n // allowing for more efficient batched generation for single inputs\n const decoder_input_ids_batch_size = toI64Tensor(model_inputs.decoder_input_ids).dims[0];\n if (decoder_input_ids_batch_size !== last_hidden_state.dims[0]) {\n if (last_hidden_state.dims[0] !== 1) {\n throw new Error(\n `The encoder outputs have a different batch size (${last_hidden_state.dims[0]}) than the decoder inputs (${decoder_input_ids_batch_size}).`\n )\n }\n last_hidden_state = cat(Array.from({ length: decoder_input_ids_batch_size }, () => last_hidden_state), 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 let { decoder_input_ids, ...model_inputs } = model_kwargs;\n\n // Prepare input ids if the user has not defined `decoder_input_ids` manually.\n if (!(decoder_input_ids instanceof Tensor)) {\n if (!decoder_input_ids) {\n decoder_start_token_id ??= bos_token_id;\n\n if (this.config.model_type === 'musicgen') {\n // Custom logic (TODO: move to Musicgen class)\n decoder_input_ids = Array.from({\n // @ts-expect-error TS2339\n length: batch_size * this.config.decoder.num_codebooks\n }, () => [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 decoder_input_ids = decoder_start_token_id;\n } else {\n decoder_input_ids = Array.from({\n length: batch_size,\n }, () => [decoder_start_token_id]);\n }\n } else if (!Array.isArray(decoder_input_ids[0])) {\n // Correct batch size\n decoder_input_ids = Array.from({\n length: batch_size,\n }, () => decoder_input_ids);\n }\n decoder_input_ids = toI64Tensor(decoder_input_ids);\n }\n\n model_kwargs['decoder_attention_mask'] = ones_like(decoder_input_ids);\n\n return { input_ids: decoder_input_ids, model_inputs };\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<ModelOutput|Tensor>} 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 ({ 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 let outputs;\n let attentions = {};\n while (true) {\n // prepare model inputs\n model_inputs = this.prepare_inputs_for_generation(all_input_ids, model_inputs, generation_config);\n outputs = await this.forward(model_inputs);\n\n if (generation_config.output_attentions && generation_config.return_dict_in_generate) {\n // Get attentions if they are present\n const token_attentions = this.getAttentions(outputs);\n for (const key in token_attentions) {\n if (!(key in attentions)) {\n attentions[key] = [];\n }\n attentions[key].push(token_attentions[key]);\n }\n }\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 /** @type {[bigint][]} */\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 = await 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 // TODO: Support beam search\n break;\n }\n }\n if (streamer) {\n streamer.put(generated_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 // Retrieve and dispose all final past key values (including encoder attentions)\n const past_key_values = this.getPastKeyValues(outputs, model_inputs.past_key_values, true);\n\n // TODO: ensure all_input_ids is padded correctly...\n const sequences = new Tensor('int64', all_input_ids.flat(), [all_input_ids.length, all_input_ids[0].length]);\n\n if (generation_config.return_dict_in_generate) {\n return {\n sequences,\n past_key_values,\n ...attentions,\n // TODO:\n // scores,\n // logits,\n }\n } else {\n // Dispose all remaining tensors\n for (const tensor of Object.values(outputs)) {\n if (tensor.location === 'gpu-buffer') {\n tensor.dispose();\n }\n }\n return sequences;\n }\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, disposeEncoderPKVs = false) {\n const pkvs = Object.create(null);\n\n for (const name in decoderResults) {\n if (name.startsWith('present')) {\n const newName = name\n .replace('present_conv', 'past_conv') // Hybrid cache architecture (e.g., LFM2)\n .replace('present', 'past_key_values');\n const is_encoder_pkv = name.includes('encoder');\n if (is_encoder_pkv && pastKeyValues) {\n // Optimization introduced by optimum to reuse past key values.\n // So, we just replace the constant outputs (`decoderResults[name]`) 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 { // decoder or using first encoder PKVs\n pkvs[newName] = decoderResults[name];\n }\n\n if (pastKeyValues && (!is_encoder_pkv || disposeEncoderPKVs)) {\n // - Always dispose decoder PKVs\n // - Only dispose encoder past key values when requested (after generation)\n const t = pastKeyValues[newName];\n if (t.location === 'gpu-buffer') {\n t.dispose();\n }\n }\n }\n }\n return pkvs;\n }\n\n /**\n * Returns an object containing attentions from the given model output object.\n *\n * @param {Object} model_output The output of the model.\n * @returns {{cross_attentions?: Tensor[]}} An object containing attentions.\n */\n getAttentions(model_output) {\n const attentions = {};\n\n for (const attnName of ['cross_attentions', 'encoder_attentions', 'decoder_attentions']) {\n for (const name in model_output) {\n if (name.startsWith(attnName)) {\n if (!(attnName in attentions)) {\n attentions[attnName] = [];\n }\n attentions[attnName].push(model_output[name]);\n }\n }\n }\n return attentions;\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 const session = this.sessions['decoder_model_merged'] ?? this.sessions['model'];\n const batch_size = (decoderFeeds[this.main_input_name] ?? decoderFeeds.attention_mask)?.dims?.[0] ?? 1;\n\n const dtype = session?.config?.kv_cache_dtype ?? 'float32';\n const cls = (dtype === 'float16') ? DataTypeMap.float16 : DataTypeMap.float32;\n const shapes = getCacheShapes(this.config, { batch_size });\n for (const name in shapes) {\n const size = shapes[name].reduce((a, b) => a * b, 1);\n decoderFeeds[name] = new Tensor(dtype, new cls(size), shapes[name]);\n }\n }\n }\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 async encode_audio({ audio_values }) {\n // audio_inputs === { audio_values }\n return (await sessionRun(this.sessions['audio_encoder'], { audio_values })).audio_features;\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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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// NeoBert models\nexport class NeoBertPreTrainedModel extends PreTrainedModel { }\nexport class NeoBertModel extends NeoBertPreTrainedModel { }\n\nexport class NeoBertForMaskedLM extends NeoBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<MaskedLMOutput>} 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\nexport class NeoBertForSequenceClassification extends NeoBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<SequenceClassifierOutput>} 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\nexport class NeoBertForTokenClassification extends NeoBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<TokenClassifierOutput>} 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\nexport class NeoBertForQuestionAnswering extends NeoBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<QuestionAnsweringModelOutput>} 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// ModernBert models\nexport class ModernBertPreTrainedModel extends PreTrainedModel { }\nexport class ModernBertModel extends ModernBertPreTrainedModel { }\n\nexport class ModernBertForMaskedLM extends ModernBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<MaskedLMOutput>} 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\nexport class ModernBertForSequenceClassification extends ModernBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<SequenceClassifierOutput>} 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\nexport class ModernBertForTokenClassification extends ModernBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<TokenClassifierOutput>} 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// ModernBERT Decoder models\nexport class ModernBertDecoderPreTrainedModel extends PreTrainedModel { }\nexport class ModernBertDecoderModel extends ModernBertDecoderPreTrainedModel { }\nexport class ModernBertDecoderForCausalLM extends ModernBertDecoderPreTrainedModel { }\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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<SequenceClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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 = [\n 'input_ids',\n 'attention_mask',\n 'encoder_outputs',\n 'decoder_input_ids',\n 'decoder_attention_mask',\n 'past_key_values',\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/**\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\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 * 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<SequenceClassifierOutput>} 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 * 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<SequenceClassifierOutput>} 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\n\n//////////////////////////////////////////////////\n// Blenderbot models\nexport class BlenderbotPreTrainedModel extends PreTrainedModel { };\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 * 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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<MaskedLMOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<QuestionAnsweringModelOutput>} 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 = [\n 'input_features',\n 'attention_mask',\n 'decoder_input_ids',\n 'decoder_attention_mask',\n 'past_key_values',\n ];\n};\n\n/**\n * WhisperModel class for training Whisper models without a language model head.\n */\nexport class WhisperModel extends WhisperPreTrainedModel { }\n\n\n/**\n * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.\n */\nexport class WhisperForConditionalGeneration extends WhisperPreTrainedModel {\n\n _prepare_generation_config(generation_config, kwargs) {\n return /** @type {WhisperGenerationConfig} */ (super._prepare_generation_config(generation_config, kwargs, WhisperGenerationConfig));\n }\n\n /**\n * \n * @param {WhisperGenerationConfig} generation_config \n */\n _retrieve_init_tokens(generation_config) {\n // prefix tokens are of the form: \n // - Multilingual: <|startoftranscript|> <|lang_id|> <|task|> [<|notimestamps|>]\n // - English-only: <|startoftranscript|> [<|notimestamps|>]\n\n // 1. Handle <|startoftranscript|> token\n const init_tokens = [generation_config.decoder_start_token_id];\n\n // 2. Handle <|lang_id|> and <|task> tokens\n let language = generation_config.language;\n const task = generation_config.task;\n if (generation_config.is_multilingual) {\n if (!language) {\n // TODO: Implement language detection\n console.warn('No language specified - defaulting to English (en).');\n language = 'en';\n }\n\n // Add language token\n const language_code = whisper_language_to_code(language);\n const language_token = `<|${language_code}|>`;\n init_tokens.push(generation_config.lang_to_id[language_token])\n\n // Add task token\n // NOTE: Defaults to 'transcribe' if no task is specified\n init_tokens.push(generation_config.task_to_id[task ?? 'transcribe']);\n\n } else if (language || task) {\n throw new Error(\n \"Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.\"\n )\n }\n\n // 3. Handle <|notimestamps|> token\n if (\n !generation_config.return_timestamps\n && generation_config.no_timestamps_token_id\n && init_tokens.at(-1) !== generation_config.no_timestamps_token_id\n ) {\n init_tokens.push(generation_config.no_timestamps_token_id);\n } else if (\n generation_config.return_timestamps\n &&\n init_tokens.at(-1) === generation_config.no_timestamps_token_id\n ) {\n console.warn(\"<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`.\");\n init_tokens.pop();\n }\n\n // let's make sure we don't pass `null` tokens as prompt tokens\n return init_tokens.filter(token => token != null);\n }\n\n /**\n * Transcribes or translates log-mel input features to a sequence of auto-regressively generated token ids.\n * @param {import('./models/whisper/generation_whisper.js').WhisperGenerationFunctionParameters} options\n * @returns {Promise<ModelOutput|Tensor>} 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 (passed to kwargs)\n // prompt_ids = null,\n // language = null,\n // task = null,\n\n ...kwargs\n }) {\n generation_config = this._prepare_generation_config(generation_config, kwargs);\n\n const init_tokens = kwargs.decoder_input_ids ?? this._retrieve_init_tokens(generation_config);\n\n if (generation_config.return_timestamps) {\n logits_processor ??= new LogitsProcessorList();\n logits_processor.push(\n new WhisperTimeStampLogitsProcessor(generation_config, init_tokens)\n );\n }\n\n if (generation_config.begin_suppress_tokens) {\n logits_processor ??= new LogitsProcessorList();\n logits_processor.push(\n new SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, init_tokens.length)\n );\n }\n\n if (generation_config.return_token_timestamps) {\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 if (generation_config.task === 'translate') {\n console.warn(\"Token-level timestamps may not be reliable for task 'translate'.\")\n }\n\n generation_config.output_attentions = true;\n generation_config.return_dict_in_generate = true;\n }\n\n const outputs = await super.generate({\n inputs,\n generation_config,\n logits_processor,\n decoder_input_ids: init_tokens,\n ...kwargs\n });\n\n if (generation_config.return_token_timestamps) {\n outputs[\"token_timestamps\"] = this._extract_token_timestamps(\n // @ts-expect-error TS2345\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 * If `num_frames` is specified, the encoder-decoder cross-attentions will be cropped before applying DTW.\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.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 if (num_frames == null) {\n console.warn(\n \"`num_frames` has not been set, meaning the entire audio will be analyzed. \" +\n \"This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).\"\n );\n }\n\n // @ts-expect-error TS2339\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 // TODO: Improve batch processing\n const batch = generate_outputs.cross_attentions;\n // Create a list with `decoder_layers` elements, each a tensor of shape\n // (batch size, attention_heads, output length, input length).\n // @ts-expect-error TS2339\n const cross_attentions = Array.from({ length: this.config.decoder_layers },\n // Concatenate the cross attentions for each layer across sequence length dimension.\n (_, i) => cat(batch.map(x => x[i]), 2)\n );\n\n const weights = stack(alignment_heads.map(([l, h]) => {\n if (l >= cross_attentions.length) {\n throw new Error(`Layer index ${l} is out of bounds for cross attentions (length ${cross_attentions.length}).`)\n }\n return num_frames\n ? cross_attentions[l].slice(null, h, null, [0, num_frames])\n : cross_attentions[l].slice(null, h);\n })).transpose(1, 0, 2, 3);\n\n const [std, calculatedMean] = std_mean(weights, -2, 0, true);\n\n // Normalize and smoothen the weights.\n const smoothedWeights = weights.clone(); // [1, 8, seqLength, 1500]\n\n for (let a = 0; a < smoothedWeights.dims[0]; ++a) {\n const aTensor = smoothedWeights[a]; // [8, seqLength, 1500]\n\n for (let b = 0; b < aTensor.dims[0]; ++b) {\n const bTensor = aTensor[b]; // [seqLength, 1500]\n\n const stdTensorData = std[a][b][0].data; // [1500]\n const meanTensorData = calculatedMean[a][b][0].data; // [1500]\n\n for (let c = 0; c < bTensor.dims[0]; ++c) {\n\n let cTensorData = bTensor[c].data; // [1500]\n for (let d = 0; d < cTensorData.length; ++d) {\n cTensorData[d] = (cTensorData[d] - meanTensorData[d]) / stdTensorData[d]\n }\n\n // Apply median filter.\n cTensorData.set(medianFilter(cTensorData, median_filter_width))\n }\n }\n }\n\n // Average the different cross-attention heads.\n const batchedMatrices = [mean(smoothedWeights, 1)];\n\n const timestampsShape = generate_outputs.sequences.dims;\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 const [text_indices, time_indices] = dynamic_time_warping(matrix.tolist());\n\n const diffs = Array.from({ length: text_indices.length - 1 }, (v, i) => text_indices[i + 1] - text_indices[i]);\n const jumps = mergeArrays([1], diffs).map(x => !!x); // convert to boolean\n\n const jump_times = [];\n for (let i = 0; i < jumps.length; ++i) {\n if (jumps[i]) {\n // NOTE: No point in rounding here, since we set to Float32Array later\n jump_times.push(time_indices[i] * time_precision);\n }\n }\n timestamps[batch_idx].data.set(jump_times, 1)\n }\n\n return timestamps;\n }\n}\n//////////////////////////////////////////////////\n\nexport class LiteWhisperForConditionalGeneration extends WhisperForConditionalGeneration { }\n\n//////////////////////////////////////////////////\n// Moonshine models\nexport class MoonshinePreTrainedModel extends PreTrainedModel {\n\n requires_attention_mask = false;\n main_input_name = 'input_values';\n forward_params = [\n 'input_values',\n 'decoder_input_ids',\n 'past_key_values',\n ];\n};\n\n/**\n * MoonshineModel class for training Moonshine models without a language model head.\n */\nexport class MoonshineModel extends MoonshinePreTrainedModel { }\n\nexport class MoonshineForConditionalGeneration extends MoonshinePreTrainedModel { }\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 forward_params = [\n // Encoder inputs\n 'pixel_values',\n\n // Decoder inpputs\n 'decoder_input_ids',\n 'encoder_hidden_states',\n 'past_key_values',\n ];\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LLaVa Models\nexport class LlavaPreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n 'attention_mask',\n 'pixel_values',\n 'position_ids',\n 'past_key_values',\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 _merge_input_ids_with_image_features(kwargs) {\n const vision_hidden_size = kwargs.image_features.dims.at(-1);\n const reshaped_image_hidden_states = kwargs.image_features.view(-1, vision_hidden_size);\n\n return default_merge_input_ids_with_image_features({\n // @ts-ignore\n image_token_id: this.config.image_token_index,\n ...kwargs,\n image_features: reshaped_image_hidden_states,\n })\n }\n}\n//////////////////////////////////////////////////\n\nexport class LlavaOnevisionForConditionalGeneration extends LlavaForConditionalGeneration { } // NOTE: extends LlavaForConditionalGeneration\nexport class Moondream1ForConditionalGeneration extends LlavaForConditionalGeneration { } // NOTE: extends LlavaForConditionalGeneration\n\nexport class Florence2PreTrainedModel extends PreTrainedModel {\n forward_params = [\n // Encoder inputs\n 'input_ids',\n 'inputs_embeds',\n 'attention_mask',\n 'pixel_values',\n\n // Decoder inputs\n 'encoder_outputs',\n 'decoder_input_ids',\n 'decoder_inputs_embeds',\n 'decoder_attention_mask',\n 'past_key_values',\n ];\n main_input_name = 'inputs_embeds';\n}\n\nexport class Florence2ForConditionalGeneration extends Florence2PreTrainedModel {\n\n _merge_input_ids_with_image_features({\n inputs_embeds,\n image_features,\n input_ids,\n attention_mask,\n }) {\n return {\n inputs_embeds: cat([\n image_features, // image embeds\n inputs_embeds, // task prefix embeds\n ], 1),\n attention_mask: cat([\n ones(image_features.dims.slice(0, 2)), // image attention mask\n attention_mask, // task prefix attention mask\n ], 1),\n }\n }\n\n async _prepare_inputs_embeds({ input_ids, pixel_values, inputs_embeds, attention_mask }) {\n if (!input_ids && !pixel_values) {\n throw new Error('Either `input_ids` or `pixel_values` should be provided.');\n }\n\n // 1. Possibly, extract the input embeddings\n let text_features, image_features;\n if (input_ids) {\n text_features = await this.encode_text({ input_ids });\n }\n if (pixel_values) {\n image_features = await this.encode_image({ pixel_values });\n }\n\n // 2. Possibly, merge text and images\n if (text_features && image_features) {\n ({ inputs_embeds, attention_mask } = this._merge_input_ids_with_image_features({\n inputs_embeds: text_features,\n image_features,\n input_ids,\n attention_mask,\n }));\n } else {\n inputs_embeds = text_features || image_features;\n }\n\n return { inputs_embeds, attention_mask };\n }\n\n async forward({\n input_ids,\n pixel_values,\n attention_mask,\n decoder_input_ids,\n decoder_attention_mask,\n encoder_outputs,\n past_key_values,\n\n inputs_embeds,\n decoder_inputs_embeds,\n }) {\n if (!inputs_embeds) {\n ({ inputs_embeds, attention_mask } = await this._prepare_inputs_embeds({ input_ids, pixel_values, inputs_embeds, attention_mask }));\n }\n\n if (!encoder_outputs) {\n // Must compute encoder outputs\n let { last_hidden_state } = await encoderForward(this, { inputs_embeds, attention_mask });\n encoder_outputs = last_hidden_state;\n }\n\n if (!decoder_inputs_embeds) {\n if (!decoder_input_ids) {\n throw new Error('Either `decoder_input_ids` or `decoder_inputs_embeds` should be provided.');\n }\n decoder_inputs_embeds = await this.encode_text({ input_ids: decoder_input_ids });\n }\n\n const decoderFeeds = {\n inputs_embeds: decoder_inputs_embeds,\n attention_mask: decoder_attention_mask,\n encoder_attention_mask: attention_mask,\n encoder_hidden_states: encoder_outputs,\n past_key_values,\n };\n const decoder_outputs = await decoderForward(this, decoderFeeds, true);\n return decoder_outputs;\n }\n}\n\nexport class PaliGemmaPreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n // 'inputs_embeds',\n 'attention_mask',\n 'pixel_values',\n 'position_ids',\n 'past_key_values',\n ];\n}\n\nexport class PaliGemmaForConditionalGeneration extends PaliGemmaPreTrainedModel {\n _merge_input_ids_with_image_features(kwargs) {\n const vision_hidden_size = kwargs.image_features.dims.at(-1);\n const reshaped_image_hidden_states = kwargs.image_features.view(-1, vision_hidden_size);\n\n return default_merge_input_ids_with_image_features({\n // @ts-ignore\n image_token_id: this.config.image_token_index,\n ...kwargs,\n image_features: reshaped_image_hidden_states,\n })\n }\n}\n\nexport class LlavaQwen2ForCausalLM extends LlavaPreTrainedModel {\n _merge_input_ids_with_image_features(kwargs) {\n const vision_hidden_size = kwargs.image_features.dims.at(-1);\n const reshaped_image_hidden_states = kwargs.image_features.view(-1, vision_hidden_size);\n\n return default_merge_input_ids_with_image_features({\n // @ts-ignore\n image_token_id: this.config.image_token_index,\n ...kwargs,\n image_features: reshaped_image_hidden_states,\n })\n }\n}\n\nexport class Mistral3ForConditionalGeneration extends LlavaQwen2ForCausalLM { }\n\nexport class Gemma3nPreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n 'attention_mask',\n 'inputs_embeds',\n 'per_layer_inputs',\n\n 'position_ids',\n 'pixel_values',\n 'input_features',\n 'input_features_mask',\n 'past_key_values',\n ];\n}\nexport class Gemma3nForConditionalGeneration extends Gemma3nPreTrainedModel {\n\n async forward({\n // Produced by the tokenizer/processor:\n input_ids = null,\n attention_mask = null,\n pixel_values = null,\n input_features = null,\n input_features_mask = null,\n\n // Used during generation:\n position_ids = null,\n inputs_embeds = null,\n per_layer_inputs=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 if (!inputs_embeds || !per_layer_inputs) {\n // 1. Extract the text embeddings.\n ({ inputs_embeds, per_layer_inputs} = await sessionRun(this.sessions['embed_tokens'], {\n input_ids,\n }));\n if (input_ids.dims[1] !== 1) {\n if (pixel_values) {\n // Encode the image\n const { image_features } = await sessionRun(this.sessions['vision_encoder'], {\n pixel_values,\n });\n ({ inputs_embeds, attention_mask } = this._merge_input_ids_with_image_features({\n image_features,\n inputs_embeds,\n input_ids,\n attention_mask,\n }));\n }\n\n if (input_features) {\n // Encode the audio\n const { audio_features } = await sessionRun(this.sessions['audio_encoder'], {\n input_features,\n input_features_mask,\n });\n ({ inputs_embeds, attention_mask } = this._merge_input_ids_with_audio_features({\n audio_features,\n inputs_embeds,\n input_ids,\n attention_mask,\n }));\n }\n }\n }\n\n const outputs = await decoderForward(this, {\n inputs_embeds,\n per_layer_inputs,\n past_key_values,\n attention_mask,\n position_ids,\n generation_config,\n logits_processor,\n }, true);\n return outputs;\n }\n\n _merge_input_ids_with_image_features(kwargs) {\n const vision_hidden_size = kwargs.image_features.dims.at(-1);\n const reshaped_image_hidden_states = kwargs.image_features.view(-1, vision_hidden_size);\n return default_merge_input_ids_with_image_features({\n // @ts-ignore\n image_token_id: this.config.image_token_id,\n ...kwargs,\n image_features: reshaped_image_hidden_states,\n });\n }\n _merge_input_ids_with_audio_features(kwargs) {\n const audio_hidden_size = kwargs.audio_features.dims.at(-1);\n const reshaped_audio_features = kwargs.audio_features.view(-1, audio_hidden_size);\n\n return default_merge_input_ids_with_audio_features({\n // @ts-ignore\n audio_token_id: this.config.audio_token_id,\n ...kwargs,\n audio_features: reshaped_audio_features,\n })\n }\n}\n \n\n//////////////////////////////////////////////////\n// Idefics3 Models\nexport class Idefics3PreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n 'attention_mask',\n 'pixel_values',\n 'pixel_attention_mask',\n 'position_ids',\n 'past_key_values',\n ];\n}\n\n/**\n * The Idefics3 model which consists of a vision backbone and a language model.\n */\nexport class Idefics3ForConditionalGeneration extends Idefics3PreTrainedModel {\n\n async encode_image({ pixel_values, pixel_attention_mask }) {\n const features = (await sessionRun(this.sessions['vision_encoder'], { pixel_values, pixel_attention_mask })).image_features;\n return features;\n }\n\n _merge_input_ids_with_image_features(kwargs) {\n const vision_hidden_size = kwargs.image_features.dims.at(-1);\n const reshaped_image_hidden_states = kwargs.image_features.view(-1, vision_hidden_size);\n\n return default_merge_input_ids_with_image_features({\n // @ts-ignore\n image_token_id: this.config.image_token_id,\n ...kwargs,\n image_features: reshaped_image_hidden_states,\n })\n }\n}\n//////////////////////////////////////////////////\n\n/**\n * The SmolVLM Model with a language modeling head.\n * It is made up a SigLIP vision encoder, with a language modeling head on top.\n */\nexport class SmolVLMForConditionalGeneration extends Idefics3ForConditionalGeneration { }\n\n//////////////////////////////////////////////////\nexport class Phi3VPreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n 'inputs_embeds',\n 'attention_mask',\n 'position_ids',\n 'pixel_values',\n 'image_sizes',\n 'past_key_values',\n ];\n}\nexport class Phi3VForCausalLM extends Phi3VPreTrainedModel {\n\n async forward({\n // Produced by the tokenizer/processor:\n input_ids = null,\n attention_mask = null,\n pixel_values = null,\n image_sizes = 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 if (!inputs_embeds) {\n let image_features;\n if (pixel_values && input_ids.dims[1] !== 1) {\n if (!image_sizes) {\n throw new Error('`image_sizes` must be provided when `pixel_values` is provided.');\n }\n\n // Encode the image\n ({ image_features } = await sessionRun(this.sessions['vision_encoder'], {\n pixel_values,\n image_sizes,\n }));\n } else {\n const hidden_size = this.config.normalized_config.hidden_size;\n image_features = new Tensor(\n 'float32',\n [],\n [0, hidden_size],\n );\n }\n\n ({ inputs_embeds } = await sessionRun(this.sessions['prepare_inputs_embeds'], {\n input_ids,\n image_features,\n }));\n }\n\n const outputs = await decoderForward(this, {\n inputs_embeds,\n past_key_values,\n attention_mask,\n position_ids,\n generation_config,\n logits_processor,\n }, false);\n return outputs;\n }\n}\n\n//////////////////////////////////////////////////\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 '@huggingface/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 * The text model from CLIP without any head or projection on top.\n */\nexport class CLIPTextModel extends CLIPPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'text_model',\n });\n }\n}\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 '@huggingface/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 /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'text_model',\n });\n }\n}\n\n/**\n * The vision model from CLIP without any head or projection on top.\n */\nexport class CLIPVisionModel extends CLIPPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'vision_model',\n });\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 '@huggingface/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 {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'vision_model',\n });\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 '@huggingface/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 '@huggingface/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 /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'text_model',\n });\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 '@huggingface/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 {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'vision_model',\n });\n }\n}\n//////////////////////////////////////////////////\n// ChineseCLIP models\nexport class ChineseCLIPPreTrainedModel extends PreTrainedModel { }\n\nexport class ChineseCLIPModel extends ChineseCLIPPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// JinaCLIP models\nexport class JinaCLIPPreTrainedModel extends PreTrainedModel { }\n\nexport class JinaCLIPModel extends JinaCLIPPreTrainedModel {\n async forward(model_inputs) {\n const missing_text_inputs = !model_inputs.input_ids;\n const missing_image_inputs = !model_inputs.pixel_values;\n\n if (missing_text_inputs && missing_image_inputs) {\n throw new Error('Either `input_ids` or `pixel_values` should be provided.');\n }\n\n // If either `input_ids` or `pixel_values` aren't passed, we need to create dummy input since the model requires a value to be specified.\n if (missing_text_inputs) {\n // NOTE: We cannot pass zero-dimension tensor as input for input_ids.\n // Fortunately, the majority of time is spent in the vision encoder, so this shouldn't significantly impact performance.\n model_inputs.input_ids = ones([model_inputs.pixel_values.dims[0], 1]);\n }\n\n if (missing_image_inputs) {\n // NOTE: Since we create a zero-sized tensor, this does not increase computation time.\n // @ts-ignore\n const { image_size } = this.config.vision_config;\n model_inputs.pixel_values = full([0, 3, image_size, image_size], 0.0); // (pass zero-dimension tensor)\n }\n\n const { text_embeddings, image_embeddings, l2norm_text_embeddings, l2norm_image_embeddings } = await super.forward(model_inputs);\n\n const result = {};\n if (!missing_text_inputs) {\n result.text_embeddings = text_embeddings;\n result.l2norm_text_embeddings = l2norm_text_embeddings;\n }\n if (!missing_image_inputs) {\n result.image_embeddings = image_embeddings;\n result.l2norm_image_embeddings = l2norm_image_embeddings;\n }\n return result\n }\n}\n\nexport class JinaCLIPTextModel extends JinaCLIPPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'text_model',\n });\n }\n}\n\nexport class JinaCLIPVisionModel extends JinaCLIPPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'vision_model',\n });\n }\n}\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 '@huggingface/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\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// JAIS models\nexport class JAISPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare JAIS Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class JAISModel extends JAISPreTrainedModel { }\n\n/**\n * The JAIS Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nexport class JAISLMHeadModel extends JAISPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPTNeo models\nexport class GPTNeoPreTrainedModel extends PreTrainedModel { }\nexport class GPTNeoModel extends GPTNeoPreTrainedModel { }\n\nexport class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeoX models\nexport class GPTNeoXPreTrainedModel extends PreTrainedModel { }\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\nexport class GPTJModel extends GPTJPreTrainedModel { }\n\nexport class GPTJForCausalLM extends GPTJPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPTBigCode models\nexport class GPTBigCodePreTrainedModel extends PreTrainedModel { }\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 * 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 * 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//////////////////////////////////////////////////\nexport class Llama4PreTrainedModel extends PreTrainedModel { }\nexport class Llama4ForCausalLM extends Llama4PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// NanoChat models\nexport class NanoChatPreTrainedModel extends PreTrainedModel { }\nexport class NanoChatModel extends NanoChatPreTrainedModel { }\nexport class NanoChatForCausalLM extends NanoChatPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Arcee models\nexport class ArceePreTrainedModel extends PreTrainedModel { }\nexport class ArceeModel extends ArceePreTrainedModel { }\nexport class ArceeForCausalLM extends ArceePreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// LFM2 models\nexport class Lfm2PreTrainedModel extends PreTrainedModel { }\nexport class Lfm2Model extends Lfm2PreTrainedModel { }\nexport class Lfm2ForCausalLM extends Lfm2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// SmolLM3 models\nexport class SmolLM3PreTrainedModel extends PreTrainedModel { }\nexport class SmolLM3Model extends SmolLM3PreTrainedModel { }\nexport class SmolLM3ForCausalLM extends SmolLM3PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Helium models\nexport class HeliumPreTrainedModel extends PreTrainedModel { }\nexport class HeliumModel extends HeliumPreTrainedModel { }\nexport class HeliumForCausalLM extends HeliumPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Glm models\nexport class GlmPreTrainedModel extends PreTrainedModel { }\nexport class GlmModel extends GlmPreTrainedModel { }\nexport class GlmForCausalLM extends GlmPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// EXAONE models\nexport class ExaonePreTrainedModel extends PreTrainedModel { }\nexport class ExaoneModel extends ExaonePreTrainedModel { }\nexport class ExaoneForCausalLM extends ExaonePreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MobileLLM models\nexport class MobileLLMPreTrainedModel extends PreTrainedModel { }\nexport class MobileLLMModel extends MobileLLMPreTrainedModel { }\nexport class MobileLLMForCausalLM extends MobileLLMPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// OLMo models\nexport class OlmoPreTrainedModel extends PreTrainedModel { }\nexport class OlmoModel extends OlmoPreTrainedModel { }\nexport class OlmoForCausalLM extends OlmoPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// OLMo2 models\nexport class Olmo2PreTrainedModel extends PreTrainedModel { }\nexport class Olmo2Model extends Olmo2PreTrainedModel { }\nexport class Olmo2ForCausalLM extends Olmo2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Granite models\nexport class GranitePreTrainedModel extends PreTrainedModel { }\nexport class GraniteModel extends GranitePreTrainedModel { }\nexport class GraniteForCausalLM extends GranitePreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GraniteMoeHybrid models\nexport class GraniteMoeHybridPreTrainedModel extends PreTrainedModel { }\nexport class GraniteMoeHybridModel extends GraniteMoeHybridPreTrainedModel { }\nexport class GraniteMoeHybridForCausalLM extends GraniteMoeHybridPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Cohere models\n\n/**\n * The bare Cohere Model outputting raw hidden-states without any specific head on top.\n */\nexport class CoherePreTrainedModel extends PreTrainedModel { }\nexport class CohereModel extends CoherePreTrainedModel { }\n\nexport class CohereForCausalLM extends CoherePreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Gemma models\n\n/**\n * The bare Gemma Model outputting raw hidden-states without any specific head on top.\n */\nexport class GemmaPreTrainedModel extends PreTrainedModel { }\n/**\n * The bare Gemma Model outputting raw hidden-states without any specific head on top.\n */\nexport class GemmaModel extends GemmaPreTrainedModel { }\n\nexport class GemmaForCausalLM extends GemmaPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Gemma2 models\n\n/**\n * The bare Gemma2 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Gemma2PreTrainedModel extends PreTrainedModel { }\n/**\n * The bare Gemma2 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Gemma2Model extends Gemma2PreTrainedModel { }\n\nexport class Gemma2ForCausalLM extends Gemma2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// VaultGemma models\nexport class VaultGemmaPreTrainedModel extends PreTrainedModel { }\nexport class VaultGemmaModel extends VaultGemmaPreTrainedModel { }\nexport class VaultGemmaForCausalLM extends VaultGemmaPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Gemma3 models\n\n/**\n * The bare Gemma3 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Gemma3PreTrainedModel extends PreTrainedModel { }\n/**\n * The bare Gemma3 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Gemma3Model extends Gemma3PreTrainedModel { }\n\nexport class Gemma3ForCausalLM extends Gemma3PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class OpenELMPreTrainedModel extends PreTrainedModel { }\nexport class OpenELMModel extends OpenELMPreTrainedModel { }\n\nexport class OpenELMForCausalLM extends OpenELMPreTrainedModel { }\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 * 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// Qwen3 models\n\n/**\n * The bare Qwen3 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Qwen3PreTrainedModel extends PreTrainedModel { }\n/**\n * The bare Qwen3 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Qwen3Model extends Qwen3PreTrainedModel { }\n\nexport class Qwen3ForCausalLM extends Qwen3PreTrainedModel { }\n//////////////////////////////////////////////////\n\nexport class Qwen2VLPreTrainedModel extends PreTrainedModel {\n forward_params = [\n // Text inputs\n 'input_ids',\n 'attention_mask',\n 'position_ids',\n 'past_key_values',\n\n // Vision inputs\n 'pixel_values',\n 'image_grid_thw',\n ];\n}\nexport class Qwen2VLForConditionalGeneration extends Qwen2VLPreTrainedModel {\n\n /**\n * Calculate the 3D rope index based on image and video's temporal, height and width in LLM.\n *\n * Explanation:\n * Each embedding sequence contains vision embedding and text embedding or just contains text embedding.\n *\n * For pure text embedding sequence, the rotary position embedding has no difference with mordern LLMs.\n * Examples:\n * input_ids: [T T T T T], here T is for text.\n * temporal position_ids: [0, 1, 2, 3, 4]\n * height position_ids: [0, 1, 2, 3, 4]\n * width position_ids: [0, 1, 2, 3, 4]\n *\n * For vision and text embedding sequence, we calculate 3D rotary position embedding for vision part\n * and 1D rotary position embeddin for text part.\n * Examples:\n * Assume we have a video input with 3 temporal patches, 2 height patches and 2 width patches.\n * input_ids: [V V V V V V V V V V V V T T T T T], here V is for vision.\n * vision temporal position_ids: [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]\n * vision height position_ids: [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1]\n * vision width position_ids: [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]\n * text temporal position_ids: [3, 4, 5, 6, 7]\n * text height position_ids: [3, 4, 5, 6, 7]\n * text width position_ids: [3, 4, 5, 6, 7]\n * Here we calculate the text start position_ids as the max vision position_ids plus 1.\n * \n * @param {Tensor} input_ids Indices of input sequence tokens in the vocabulary. Tensor of shape `(batch_size, sequence_length)`.\n * @param {Tensor} image_grid_thw (Optional) The temporal, height and width of feature shape of each image in LLM. Tensor of shape `(num_images, 3)`.\n * @param {Tensor} video_grid_thw (Optional) The temporal, height and width of feature shape of each video in LLM. Tensor of shape `(num_videos, 3)`.\n * @param {Tensor} attention_mask (Optional) Mask to avoid performing attention on padding token indices. Tensor of shape `(batch_size, sequence_length)`. Mask values selected in `[0, 1]`:\n * - 1 for tokens that are **not masked**,\n * - 0 for tokens that are **masked**.\n * @returns {[Tensor, Tensor]} [position_ids, mrope_position_deltas] with:\n * - position_ids: Tensor of shape `(3, batch_size, sequence_length)`.\n * - mrope_position_deltas: Tensor of shape `(batch_size)`.\n */\n get_rope_index(input_ids, image_grid_thw, video_grid_thw, attention_mask) {\n // @ts-ignore\n const { vision_config, image_token_id, video_token_id, vision_start_token_id } = this.config;\n const spatial_merge_size = vision_config.spatial_merge_size ?? 2;\n\n const mrope_position_deltas = [];\n if (image_grid_thw || video_grid_thw) {\n let total_input_ids = input_ids.tolist();\n if (!attention_mask) {\n attention_mask = ones_like(input_ids);\n }\n\n const attention_mask_list = attention_mask.tolist();\n const position_ids_list = Array.from({ length: 3 }, _ => Array.from({ length: input_ids.dims[0] }, _ => Array.from({ length: input_ids.dims[1] }, _ => 1)));\n\n const image_grid_thw_list = image_grid_thw ? image_grid_thw.tolist() : [];\n const video_grid_thw_list = video_grid_thw ? video_grid_thw.tolist() : [];\n\n let image_index = 0;\n let video_index = 0;\n for (let i = 0; i < total_input_ids.length; ++i) {\n const ids = total_input_ids[i].filter((_, j) => attention_mask_list[i][j] == 1);\n\n const vision_start_indices = ids.reduce((acc, x, idx) => {\n if (x == vision_start_token_id) acc.push(idx);\n return acc;\n }, []);\n\n const vision_tokens = vision_start_indices.map(x => ids[x + 1]);\n const image_nums = vision_tokens.filter(x => x == image_token_id).length;\n const video_nums = vision_tokens.filter(x => x == video_token_id).length;\n\n /** @type {number[][]} */\n let llm_pos_ids_list = [];\n let st = 0;\n let remain_images = image_nums;\n let remain_videos = video_nums;\n for (let j = 0; j < vision_tokens.length; ++j) {\n const next_image_token = ids.findIndex((x, i) => i > st && x == image_token_id);\n const next_video_token = ids.findIndex((x, i) => i > st && x == video_token_id);\n\n const ed_image = (remain_images > 0 && next_image_token !== -1)\n ? next_image_token\n : ids.length + 1;\n\n const ed_video = (remain_videos > 0 && next_video_token !== -1)\n ? next_video_token\n : ids.length + 1;\n\n let ed;\n let t, h, w;\n if (ed_image < ed_video) {\n ([t, h, w] = image_grid_thw_list[image_index]);\n ++image_index;\n --remain_images;\n ed = ed_image;\n } else {\n ([t, h, w] = video_grid_thw_list[video_index]);\n ++video_index;\n --remain_videos;\n ed = ed_video;\n }\n\n const [llm_grid_t, llm_grid_h, llm_grid_w] = [\n Number(t),\n Math.floor(Number(h) / spatial_merge_size),\n Math.floor(Number(w) / spatial_merge_size)\n ]\n const text_len = ed - st;\n const st_idx = llm_pos_ids_list.length > 0\n ? max(llm_pos_ids_list.at(-1))[0] + 1\n : 0;\n\n llm_pos_ids_list.push(\n Array.from({ length: 3 * text_len }, (_, i) => st_idx + (i % text_len))\n )\n\n const offset = text_len + st_idx;\n const grid_size = llm_grid_t * llm_grid_h * llm_grid_w;\n const t_index = Array.from({ length: grid_size }, (_, i) => offset + Math.floor(i / (llm_grid_h * llm_grid_w)))\n const h_index = Array.from({ length: grid_size }, (_, i) => offset + Math.floor(i / llm_grid_w) % llm_grid_h)\n const w_index = Array.from({ length: grid_size }, (_, i) => offset + i % llm_grid_w)\n\n llm_pos_ids_list.push([t_index, h_index, w_index].flat())\n\n st = ed + grid_size;\n }\n\n if (st < ids.length) {\n const st_idx = llm_pos_ids_list.length > 0\n ? max(llm_pos_ids_list.at(-1))[0] + 1\n : 0;\n const text_len = ids.length - st;\n\n llm_pos_ids_list.push(\n Array.from({ length: 3 * text_len }, (_, i) => (st_idx + (i % text_len)))\n )\n }\n\n // NOTE: Each item in llm_pos_ids_list is an array of shape (3, text_len),\n // meaning to perform concatenation along dim=1, we can do the following:\n const num_items = llm_pos_ids_list.reduce((acc, x) => acc + x.length, 0);\n /** @type {number[]} */\n const llm_positions = new Array(num_items);\n let index = 0;\n for (let x = 0; x < 3; ++x) {\n for (let y = 0; y < llm_pos_ids_list.length; ++y) {\n const val = llm_pos_ids_list[y];\n const text_len = val.length / 3;\n for (let z = x * text_len; z < (x + 1) * text_len; ++z) {\n llm_positions[index++] = val[z];\n }\n }\n }\n\n let count = 0;\n const attn_mask = attention_mask_list[i];\n for (let y = 0; y < attn_mask.length; ++y) {\n if (attn_mask[y] == 1) {\n for (let x = 0; x < 3; ++x) {\n position_ids_list[x][i][y] = llm_positions[x * num_items / 3 + count];\n }\n ++count;\n }\n }\n\n const max_llm_positions = max(llm_positions)[0];\n mrope_position_deltas.push(max_llm_positions + 1 - total_input_ids[i].length);\n }\n\n return [\n new Tensor('int64', position_ids_list.flat(Infinity), [3, input_ids.dims[0], input_ids.dims[1]]),\n new Tensor('int64', mrope_position_deltas, [mrope_position_deltas.length, 1]),\n ];\n\n } else { // Text-only\n if (attention_mask) {\n const { data, dims } = cumsum_masked_fill(attention_mask);\n\n const position_ids = BigInt64Array.from(\n { length: 3 * data.length },\n (_, i) => data[i % data.length]\n );\n /** @type {bigint[]} */\n const mrope_position_deltas = Array.from(\n { length: dims[0] },\n (_, i) => max(data.subarray(dims[1] * i, dims[1] * (i + 1)))[0] + 1n + BigInt(dims[1])\n );\n\n return [\n new Tensor('int64', position_ids, [3, ...dims]),\n new Tensor('int64', mrope_position_deltas, [mrope_position_deltas.length, 1]),\n ]\n } else {\n const [batch_size, seq_length] = input_ids.dims;\n const position_ids = BigInt64Array.from(\n { length: 3 * batch_size * seq_length },\n (_, i) => BigInt(Math.floor(i % seq_length / batch_size)),\n );\n\n return [\n new Tensor('int64', position_ids, [3, ...input_ids.dims]),\n zeros([batch_size, 1]),\n ]\n }\n }\n }\n\n async encode_image({ pixel_values, image_grid_thw }) {\n const features = (await sessionRun(this.sessions['vision_encoder'], { pixel_values, grid_thw: image_grid_thw })).image_features;\n return features;\n }\n\n _merge_input_ids_with_image_features(kwargs) {\n return default_merge_input_ids_with_image_features({\n // @ts-ignore\n image_token_id: this.config.image_token_id,\n ...kwargs\n })\n }\n\n prepare_inputs_for_generation(input_ids, model_inputs, generation_config) {\n // Overwritten -- in specific circumstances we don't want to forward image inputs to the model\n if (model_inputs.attention_mask && !model_inputs.position_ids) {\n // Calculate position_ids and rope_deltas\n if (!model_inputs.past_key_values) {\n ([model_inputs.position_ids, model_inputs.rope_deltas] = this.get_rope_index(\n model_inputs.input_ids,\n model_inputs.image_grid_thw,\n model_inputs.video_grid_thw,\n model_inputs.attention_mask,\n ));\n\n } else {\n model_inputs.pixel_values = null;\n // model_inputs.pixel_values_videos = null;\n\n const delta = BigInt(Object.values(model_inputs.past_key_values)[0].dims.at(-2));\n const rope_deltas_list = model_inputs.rope_deltas.map(x => delta + x);\n model_inputs.position_ids = stack([rope_deltas_list, rope_deltas_list, rope_deltas_list], 0)\n }\n }\n\n return model_inputs;\n }\n}\n\n\n//////////////////////////////////////////////////\n// Phi models\nexport class PhiPreTrainedModel extends PreTrainedModel { }\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// Phi3 models\nexport class Phi3PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Phi3 Model outputting raw hidden-states without any specific head on top.\n */\nexport class Phi3Model extends Phi3PreTrainedModel { }\n\nexport class Phi3ForCausalLM extends Phi3PreTrainedModel { }\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/**\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/**\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/**\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\n//////////////////////////////////////////////////\nexport class IJepaPreTrainedModel extends PreTrainedModel { }\nexport class IJepaModel extends IJepaPreTrainedModel { }\nexport class IJepaForImageClassification extends IJepaPreTrainedModel {\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 VitPosePreTrainedModel extends PreTrainedModel { }\n\n/**\n * The VitPose model with a pose estimation head on top.\n */\nexport class VitPoseForPoseEstimation extends VitPosePreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class PvtPreTrainedModel extends PreTrainedModel { }\nexport class PvtModel extends PvtPreTrainedModel { }\nexport class PvtForImageClassification extends PvtPreTrainedModel {\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 ViTMAEPreTrainedModel extends PreTrainedModel { }\nexport class ViTMAEModel extends ViTMAEPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class ViTMSNPreTrainedModel extends PreTrainedModel { }\nexport class ViTMSNModel extends ViTMSNPreTrainedModel { }\nexport class ViTMSNForImageClassification extends ViTMSNPreTrainedModel {\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 GroupViTPreTrainedModel extends PreTrainedModel { }\nexport class GroupViTModel extends GroupViTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nexport class FastViTPreTrainedModel extends PreTrainedModel { }\nexport class FastViTModel extends FastViTPreTrainedModel { }\nexport class FastViTForImageClassification extends FastViTPreTrainedModel {\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 '@huggingface/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 '@huggingface/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 MobileViTV2PreTrainedModel extends PreTrainedModel { }\nexport class MobileViTV2Model extends MobileViTV2PreTrainedModel { }\nexport class MobileViTV2ForImageClassification extends MobileViTV2PreTrainedModel {\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: MobileViTV2ForSemanticSegmentation\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<DetrSegmentationOutput>} 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 RTDetrPreTrainedModel extends PreTrainedModel { }\nexport class RTDetrModel extends RTDetrPreTrainedModel { }\nexport class RTDetrForObjectDetection extends RTDetrPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new RTDetrObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nexport class RTDetrObjectDetectionOutput 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//////////////////////////////////////////////////\nexport class RTDetrV2PreTrainedModel extends PreTrainedModel { }\nexport class RTDetrV2Model extends RTDetrV2PreTrainedModel { }\nexport class RTDetrV2ForObjectDetection extends RTDetrV2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new RTDetrV2ObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nexport class RTDetrV2ObjectDetectionOutput extends RTDetrObjectDetectionOutput { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class RFDetrPreTrainedModel extends PreTrainedModel { }\nexport class RFDetrModel extends RFDetrPreTrainedModel { }\nexport class RFDetrForObjectDetection extends RFDetrPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new RFDetrObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nexport class RFDetrObjectDetectionOutput extends RTDetrObjectDetectionOutput { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class DFinePreTrainedModel extends PreTrainedModel { }\nexport class DFineModel extends DFinePreTrainedModel { }\nexport class DFineForObjectDetection extends DFinePreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new RTDetrObjectDetectionOutput(await super._call(model_inputs));\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//////////////////////////////////////////////////\nexport class HieraPreTrainedModel extends PreTrainedModel { }\nexport class HieraModel extends HieraPreTrainedModel { }\nexport class HieraForImageClassification extends HieraPreTrainedModel {\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}\nexport class SwinForSemanticSegmentation extends SwinPreTrainedModel { }\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 '@huggingface/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_4d } from '@huggingface/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.read(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 = (await interpolate_4d(predicted_depth.unsqueeze(1), {\n * size: image.size.reverse(),\n * mode: 'bilinear',\n * })).squeeze(1);\n * \n * // Visualize the prediction\n * const min = prediction.min().item();\n * const max = prediction.max().item();\n * const formatted = prediction.sub_(min).div_(max - min).mul_(255).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 SapiensPreTrainedModel extends PreTrainedModel { }\nexport class SapiensForSemanticSegmentation extends SapiensPreTrainedModel { }\nexport class SapiensForDepthEstimation extends SapiensPreTrainedModel { }\nexport class SapiensForNormalEstimation extends SapiensPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class DepthProPreTrainedModel extends PreTrainedModel { }\nexport class DepthProForDepthEstimation extends DepthProPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class Metric3DPreTrainedModel extends PreTrainedModel { }\nexport class Metric3DForDepthEstimation extends Metric3DPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class Metric3Dv2PreTrainedModel extends PreTrainedModel { }\nexport class Metric3Dv2ForDepthEstimation extends Metric3Dv2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class MaskFormerPreTrainedModel extends PreTrainedModel { }\nexport class MaskFormerModel extends MaskFormerPreTrainedModel { }\nexport class MaskFormerForInstanceSegmentation extends MaskFormerPreTrainedModel { }\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 * import { GLPNForDepthEstimation, AutoProcessor, RawImage, interpolate_4d } from '@huggingface/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.read(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 = (await interpolate_4d(predicted_depth.unsqueeze(1), {\n * size: image.size.reverse(),\n * mode: 'bilinear',\n * })).squeeze(1);\n * \n * // Visualize the prediction\n * const min = prediction.min().item();\n * const max = prediction.max().item();\n * const formatted = prediction.sub_(min).div_(max - min).mul_(255).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 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 '@huggingface/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 = '<s_cord-v2>';\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 * // <s_cord-v2><s_menu><s_nm> CINNAMON SUGAR</s_nm><s_unitprice> 17,000</s_unitprice><s_cnt> 1 x</s_cnt><s_price> 17,000</s_price></s_menu><s_sub_total><s_subtotal_price> 17,000</s_subtotal_price></s_sub_total><s_total><s_total_price> 17,000</s_total_price><s_cashprice> 20,000</s_cashprice><s_changeprice> 3,000</s_changeprice></s_total></s>\n * ```\n * \n * **Example:** Step-by-step Document Visual Question Answering (DocVQA)\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@huggingface/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 = `<s_docvqa><s_question>${question}</s_question><s_answer>`;\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 * // <s_docvqa><s_question> What is the invoice number?</s_question><s_answer> us-001</s_answer></s>\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//////////////////////////////////////////////////\nexport class Dinov2WithRegistersPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Dinov2WithRegisters Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class Dinov2WithRegistersModel extends Dinov2WithRegistersPreTrainedModel { }\n\n/**\n * Dinov2WithRegisters 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 Dinov2WithRegistersForImageClassification extends Dinov2WithRegistersPreTrainedModel {\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 DINOv3ViTPreTrainedModel extends PreTrainedModel { }\nexport class DINOv3ViTModel extends DINOv3ViTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class DINOv3ConvNextPreTrainedModel extends PreTrainedModel { }\nexport class DINOv3ConvNextModel extends DINOv3ConvNextPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class GroundingDinoPreTrainedModel extends PreTrainedModel { }\nexport class GroundingDinoForObjectDetection extends GroundingDinoPreTrainedModel { }\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 '@huggingface/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<Object>} 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 } else {\n model_inputs = { ...model_inputs };\n }\n\n // Set default input labels if they are missing\n model_inputs.input_labels ??= ones(model_inputs.input_points.dims.slice(0, -1));\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<SamImageSegmentationOutput>} 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//////////////////////////////////////////////////\nexport class Sam2ImageSegmentationOutput 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 * @param {Tensor} output.object_score_logits Logits for the object score, indicating if an object is present.\n */\n constructor({ iou_scores, pred_masks, object_score_logits }) {\n super();\n this.iou_scores = iou_scores;\n this.pred_masks = pred_masks;\n this.object_score_logits = object_score_logits;\n }\n}\n\nexport class Sam2PreTrainedModel extends PreTrainedModel { }\nexport class Sam2Model extends Sam2PreTrainedModel {\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 `Sam2Processor`.\n * @returns {Promise<Record<String, Tensor>>} The 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.0: tensor.float32[batch_size,32,256,256]\n // - image_embeddings.1: tensor.float32[batch_size,64,128,128]\n // - image_embeddings.2: tensor.float32[batch_size,256,64,64]\n return await encoderForward(this, { pixel_values });\n }\n\n async forward(model_inputs) {\n // @ts-expect-error ts(2339)\n const { num_feature_levels } = this.config.vision_config;\n const image_embeddings_name = Array.from({ length: num_feature_levels }, (_, i) => `image_embeddings.${i}`);\n\n if (image_embeddings_name.some(name => !model_inputs[name])) {\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 } else {\n model_inputs = { ...model_inputs };\n }\n\n if (model_inputs.input_points) {\n if (model_inputs.input_boxes && model_inputs.input_boxes.dims[1] !== 1) {\n throw new Error('When both `input_points` and `input_boxes` are provided, the number of boxes per image must be 1.');\n }\n const shape = model_inputs.input_points.dims;\n model_inputs.input_labels ??= ones(shape.slice(0, -1));\n model_inputs.input_boxes ??= full([shape[0], 0, 4], 0.0);\n\n } else if (model_inputs.input_boxes) { // only boxes\n const shape = model_inputs.input_boxes.dims;\n model_inputs.input_labels = full([shape[0], shape[1], 0], -1n);\n model_inputs.input_points = full([shape[0], 1, 0, 2], 0.0);\n\n } else {\n throw new Error('At least one of `input_points` or `input_boxes` must be provided.');\n }\n\n const prompt_encoder_mask_decoder_session = this.sessions['prompt_encoder_mask_decoder'];\n const decoder_inputs = pick(model_inputs, prompt_encoder_mask_decoder_session.inputNames);\n\n // Returns:\n // - iou_scores: tensor.float32[batch_size,num_boxes_or_points,3]\n // - pred_masks: tensor.float32[batch_size,num_boxes_or_points,3,256,256]\n // - object_score_logits: tensor.float32[batch_size,num_boxes_or_points,1]\n return await sessionRun(prompt_encoder_mask_decoder_session, decoder_inputs);\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise<Sam2ImageSegmentationOutput>} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new Sam2ImageSegmentationOutput(await super._call(model_inputs));\n }\n}\nexport class EdgeTamModel extends Sam2Model { } // NOTE: extends Sam2Model\nexport class Sam3TrackerModel extends Sam2Model { } // NOTE: extends Sam2Model\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MarianMT models\nexport class MarianPreTrainedModel extends PreTrainedModel { };\n\nexport class MarianModel extends MarianPreTrainedModel { }\n\nexport class MarianMTModel extends MarianPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// M2M100 models\nexport class M2M100PreTrainedModel extends PreTrainedModel { };\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 '@huggingface/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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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// Parakeet models\nexport class ParakeetPreTrainedModel extends PreTrainedModel { };\nexport class ParakeetForCTC extends ParakeetPreTrainedModel {\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\n//////////////////////////////////////////////////\n// PyAnnote models\nexport class PyAnnotePreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare PyAnnote Model transformer outputting raw hidden-states without any specific head on top.\n */\nexport class PyAnnoteModel extends PyAnnotePreTrainedModel { }\n\n/**\n * PyAnnote Model with a frame classification head on top for tasks like Speaker Diarization.\n * \n * **Example:** Load and run a `PyAnnoteForAudioFrameClassification` for speaker diarization.\n * \n * ```javascript\n * import { AutoProcessor, AutoModelForAudioFrameClassification, read_audio } from '@huggingface/transformers';\n * \n * // Load model and processor\n * const model_id = 'onnx-community/pyannote-segmentation-3.0';\n * const model = await AutoModelForAudioFrameClassification.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Read and preprocess audio\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/mlk.wav';\n * const audio = await read_audio(url, processor.feature_extractor.config.sampling_rate);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const { logits } = await model(inputs);\n * // {\n * // logits: Tensor {\n * // dims: [ 1, 767, 7 ], // [batch_size, num_frames, num_classes]\n * // type: 'float32',\n * // data: Float32Array(5369) [ ... ],\n * // size: 5369\n * // }\n * // }\n * \n * const result = processor.post_process_speaker_diarization(logits, audio.length);\n * // [\n * // [\n * // { id: 0, start: 0, end: 1.0512535626298245, confidence: 0.8220156481664611 },\n * // { id: 2, start: 1.0512535626298245, end: 2.3398869619825127, confidence: 0.9008811707860472 },\n * // ...\n * // ]\n * // ]\n * \n * // Display result\n * console.table(result[0], ['start', 'end', 'id', 'confidence']);\n * // ┌─────────┬────────────────────┬────────────────────┬────┬─────────────────────┐\n * // │ (index) │ start │ end │ id │ confidence │\n * // ├─────────┼────────────────────┼────────────────────┼────┼─────────────────────┤\n * // │ 0 │ 0 │ 1.0512535626298245 │ 0 │ 0.8220156481664611 │\n * // │ 1 │ 1.0512535626298245 │ 2.3398869619825127 │ 2 │ 0.9008811707860472 │\n * // │ 2 │ 2.3398869619825127 │ 3.5946089560890773 │ 0 │ 0.7521651315796233 │\n * // │ 3 │ 3.5946089560890773 │ 4.578039708226655 │ 2 │ 0.8491978128022479 │\n * // │ 4 │ 4.578039708226655 │ 4.594995410849717 │ 0 │ 0.2935352600416393 │\n * // │ 5 │ 4.594995410849717 │ 6.121008646925269 │ 3 │ 0.6788051309866024 │\n * // │ 6 │ 6.121008646925269 │ 6.256654267909762 │ 0 │ 0.37125512393851134 │\n * // │ 7 │ 6.256654267909762 │ 8.630452635138397 │ 2 │ 0.7467035186353542 │\n * // │ 8 │ 8.630452635138397 │ 10.088643060721703 │ 0 │ 0.7689364814666032 │\n * // │ 9 │ 10.088643060721703 │ 12.58113134631177 │ 2 │ 0.9123324509131324 │\n * // │ 10 │ 12.58113134631177 │ 13.005023911888312 │ 0 │ 0.4828358177572041 │\n * // └─────────┴────────────────────┴────────────────────┴────┴─────────────────────┘\n * ```\n */\nexport class PyAnnoteForAudioFrameClassification extends PyAnnotePreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise<TokenClassifierOutput>} 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// WeSpeakerResNet models\nexport class WeSpeakerResNetPreTrainedModel extends PreTrainedModel { };\nexport class WeSpeakerResNetModel extends WeSpeakerResNetPreTrainedModel { }\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<SequenceClassifierOutput>} 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<SequenceClassifierOutput>} 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<TokenClassifierOutput>} 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<SequenceClassifierOutput>} 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 '@huggingface/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<SequenceClassifierOutput>} 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 '@huggingface/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<SequenceClassifierOutput>} 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 '@huggingface/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<XVectorOutput>} 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 '@huggingface/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<TokenClassifierOutput>} 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\nexport class StyleTextToSpeech2PreTrainedModel extends PreTrainedModel { }\nexport class StyleTextToSpeech2Model extends StyleTextToSpeech2PreTrainedModel { }\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 * 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 '@huggingface/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<SpeechOutput>} 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 // @ts-expect-error TS2339\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 // @ts-expect-error TS2339\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\nexport class SupertonicPreTrainedModel extends PreTrainedModel { }\nexport class SupertonicForConditionalGeneration extends SupertonicPreTrainedModel {\n\n async generate_speech({\n // Required inputs\n input_ids,\n attention_mask,\n style,\n\n // Optional inputs\n num_inference_steps = 5,\n speed = 1.05,\n }) {\n // @ts-expect-error TS2339\n const { sampling_rate, chunk_compress_factor, base_chunk_size, latent_dim } = this.config;\n\n // 1. Text Encoder\n const { last_hidden_state, durations } = await sessionRun(this.sessions['text_encoder'], {\n input_ids, attention_mask, style,\n });\n durations.div_(speed); // Apply speed factor to duration\n\n // 2. Latent Denoiser\n const wav_len_max = durations.max().item() * sampling_rate;\n const chunk_size = base_chunk_size * chunk_compress_factor;\n const latent_len = Math.floor((wav_len_max + chunk_size - 1) / chunk_size);\n const batch_size = input_ids.dims[0];\n const latent_mask = ones([batch_size, latent_len]);\n const num_steps = full([batch_size], num_inference_steps);\n\n let noisy_latents = randn([batch_size, latent_dim * chunk_compress_factor, latent_len]);\n for (let step = 0; step < num_inference_steps; ++step) {\n const timestep = full([batch_size], step);\n ({ denoised_latents: noisy_latents } = await sessionRun(this.sessions['latent_denoiser'], {\n style,\n noisy_latents,\n latent_mask,\n encoder_outputs: last_hidden_state,\n attention_mask,\n timestep,\n num_inference_steps: num_steps,\n }));\n }\n\n // 3. Voice Decoder\n const { waveform } = await sessionRun(this.sessions['voice_decoder'], {\n latents: noisy_latents,\n });\n return {\n waveform,\n durations,\n }\n }\n}\n\n\n//////////////////////////////////////////////////\n// TrOCR models\nexport class TrOCRPreTrainedModel extends PreTrainedModel { }\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\nexport class MistralModel extends MistralPreTrainedModel { }\n\nexport class MistralForCausalLM extends MistralPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Ministral models\nexport class MinistralPreTrainedModel extends PreTrainedModel { }\nexport class MinistralModel extends MinistralPreTrainedModel { }\nexport class MinistralForCausalLM extends MinistralPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Ministral3 models\nexport class Ministral3PreTrainedModel extends PreTrainedModel { }\nexport class Ministral3Model extends Ministral3PreTrainedModel { }\nexport class Ministral3ForCausalLM extends Ministral3PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// ERNIE-4.5 models\nexport class Ernie4_5PreTrainedModel extends PreTrainedModel { }\n\nexport class Ernie4_5Model extends Ernie4_5PreTrainedModel { }\n\nexport class Ernie4_5ForCausalLM extends Ernie4_5PreTrainedModel { }\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\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\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 '@huggingface/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 /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'text_model',\n });\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 '@huggingface/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 {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'audio_model',\n });\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 '@huggingface/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<VitsModelOutput>} 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/**\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 '@huggingface/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 = [\n 'input_ids',\n 'attention_mask',\n 'encoder_outputs',\n 'decoder_input_ids',\n 'decoder_attention_mask',\n 'past_key_values',\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 // @ts-expect-error TS2339\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 // @ts-expect-error TS2339\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 // @ts-expect-error TS2339\n if ((i % this.config.decoder.num_codebooks) >= j) {\n // @ts-expect-error TS2339\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<ModelOutput|Tensor>} 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//////////////////////////////////////////////////\n// MobileNetV1 models\nexport class MobileNetV1PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MobileNetV1 model outputting raw hidden-states without any specific head on top.\n */\nexport class MobileNetV1Model extends MobileNetV1PreTrainedModel { }\n\n/**\n * MobileNetV1 model with an image classification head on top (a linear layer on top of the pooled features),\n * e.g. for ImageNet.\n */\nexport class MobileNetV1ForImageClassification extends MobileNetV1PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\nexport class MobileNetV1ForSemanticSegmentation extends MobileNetV1PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MobileNetV2 models\nexport class MobileNetV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MobileNetV2 model outputting raw hidden-states without any specific head on top.\n */\nexport class MobileNetV2Model extends MobileNetV2PreTrainedModel { }\n\n/**\n * MobileNetV2 model with an image classification head on top (a linear layer on top of the pooled features),\n * e.g. for ImageNet.\n */\nexport class MobileNetV2ForImageClassification extends MobileNetV2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nexport class MobileNetV2ForSemanticSegmentation extends MobileNetV2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MobileNetV3 models\nexport class MobileNetV3PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MobileNetV3 model outputting raw hidden-states without any specific head on top.\n */\nexport class MobileNetV3Model extends MobileNetV3PreTrainedModel { }\n\n/**\n * MobileNetV3 model with an image classification head on top (a linear layer on top of the pooled features),\n * e.g. for ImageNet.\n */\nexport class MobileNetV3ForImageClassification extends MobileNetV3PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nexport class MobileNetV3ForSemanticSegmentation extends MobileNetV3PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MobileNetV4 models\nexport class MobileNetV4PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MobileNetV4 model outputting raw hidden-states without any specific head on top.\n */\nexport class MobileNetV4Model extends MobileNetV4PreTrainedModel { }\n\n/**\n * MobileNetV4 model with an image classification head on top (a linear layer on top of the pooled features),\n * e.g. for ImageNet.\n */\nexport class MobileNetV4ForImageClassification extends MobileNetV4PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nexport class MobileNetV4ForSemanticSegmentation extends MobileNetV4PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Decision Transformer models\nexport class DecisionTransformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The model builds upon the GPT2 architecture to perform autoregressive prediction of actions in an offline RL setting.\n * Refer to the paper for more details: https://huggingface.co/papers/2106.01345\n */\nexport class DecisionTransformerModel extends DecisionTransformerPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\nexport class MultiModalityPreTrainedModel extends PreTrainedModel { }\nexport class MultiModalityCausalLM extends MultiModalityPreTrainedModel {\n forward_params = [\n // prepare_inputs_embeds\n 'input_ids',\n 'pixel_values',\n 'images_seq_mask',\n 'images_emb_mask',\n\n // language_model\n 'attention_mask',\n 'position_ids',\n 'past_key_values',\n ];\n\n /**\n * @param {ConstructorParameters<typeof MultiModalityPreTrainedModel>} args\n */\n constructor(...args) {\n super(...args);\n\n // State-based approach to switch out which heads to use during generation\n this._generation_mode = 'text';\n }\n\n async forward(model_inputs) {\n const mode = this._generation_mode ?? 'text';\n\n // TODO support re-using PKVs for input_ids.dims[1] !== 1\n // if (model_inputs.past_key_values) {\n // // && model_inputs.input_ids.dims[1] === 1\n // }\n\n let output_1;\n if (mode === 'text' || !model_inputs.past_key_values) {\n const session = this.sessions['prepare_inputs_embeds'];\n const prep_inputs = pick(model_inputs, session.inputNames);\n output_1 = await sessionRun(session, prep_inputs);\n } else {\n const session = this.sessions['gen_img_embeds'];\n const prep_inputs = pick({\n image_ids: model_inputs.input_ids,\n }, session.inputNames);\n output_1 = await sessionRun(session, prep_inputs);\n }\n\n const input_2 = { ...model_inputs, ...output_1 }\n const output_2 = await decoderForward(this, input_2);\n\n const head = this.sessions[\n mode === 'text'\n ? 'lm_head'\n : 'gen_head'\n ];\n if (!head) {\n throw new Error(`Unable to find \"${head}\" generation head`);\n }\n\n const output_3 = await sessionRun(head, pick(output_2, head.inputNames))\n\n return {\n ...output_1,\n ...output_2,\n ...output_3,\n };\n }\n\n /**\n * @param {import('./generation/parameters.js').GenerationFunctionParameters} options\n */\n async generate(options) {\n this._generation_mode = 'text';\n return super.generate(options);\n }\n\n /**\n * @param {import('./generation/parameters.js').GenerationFunctionParameters} options\n */\n async generate_images(options) {\n this._generation_mode = 'image';\n\n const start_num_tokens = (options.inputs ?? options[this.main_input_name]).dims[1];\n const all_tokens = await super.generate(options);\n\n const generated_tokens = (/** @type {Tensor} */(all_tokens)).slice(null, [start_num_tokens, null])\n\n const image_decode = this.sessions['image_decode'];\n const { decoded_image } = await sessionRun(image_decode, {\n generated_tokens,\n });\n\n // Equivalent to `np.clip((dec + 1) / 2 * 255, 0, 255)`\n const clamped = decoded_image\n .add_(1)\n .mul_(255 / 2)\n .clamp_(0, 255)\n .to('uint8');\n\n // Return as a list of images\n const images = [];\n for (const tensor of clamped) {\n const img = RawImage.fromTensor(tensor);\n images.push(img);\n }\n return images;\n }\n}\n\nexport class MgpstrModelOutput extends ModelOutput {\n constructor({ char_logits, bpe_logits, wp_logits }) {\n super();\n this.char_logits = char_logits;\n this.bpe_logits = bpe_logits;\n this.wp_logits = wp_logits;\n }\n\n get logits() {\n return [this.char_logits, this.bpe_logits, this.wp_logits];\n }\n}\n\nexport class MgpstrPreTrainedModel extends PreTrainedModel { }\n\n/**\n * MGP-STR Model transformer with three classification heads on top\n * (three A^3 modules and three linear layer on top of the transformer encoder output) for scene text recognition (STR).\n */\nexport class MgpstrForSceneTextRecognition extends MgpstrPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new MgpstrModelOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n// PatchTST Transformer models\nexport class PatchTSTPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare PatchTST Model outputting raw hidden-states without any specific head.\n */\nexport class PatchTSTModel extends PatchTSTPreTrainedModel { }\n\n/**\n * The PatchTST for prediction model.\n */\nexport class PatchTSTForPrediction extends PatchTSTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// PatchTSMixer Transformer models\nexport class PatchTSMixerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare PatchTSMixer Model outputting raw hidden-states without any specific head.\n */\nexport class PatchTSMixerModel extends PatchTSMixerPreTrainedModel { }\n\n/**\n * The PatchTSMixer for prediction model.\n */\nexport class PatchTSMixerForPrediction extends PatchTSMixerPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nexport class UltravoxPreTrainedModel extends PreTrainedModel {\n forward_params = [\n 'input_ids',\n 'attention_mask',\n 'position_ids',\n 'audio_values',\n 'past_key_values',\n ];\n}\n\nexport class UltravoxModel extends UltravoxPreTrainedModel {\n\n _merge_input_ids_with_audio_features(kwargs) {\n const audio_hidden_size = kwargs.audio_features.dims.at(-1);\n const reshaped_audio_features = kwargs.audio_features.view(-1, audio_hidden_size);\n\n return default_merge_input_ids_with_audio_features({\n // @ts-ignore\n audio_token_id: this.config.ignore_index ?? this.config.audio_token_id,\n ...kwargs,\n audio_features: reshaped_audio_features,\n })\n }\n}\n//////////////////////////////////////////////////\n\nexport class VoxtralForConditionalGeneration extends UltravoxModel { }\n\n//////////////////////////////////////////////////\n// Mimi models\nexport class MimiPreTrainedModel extends PreTrainedModel {\n main_input_name = 'input_values';\n forward_params = ['input_values'];\n}\n\nexport class MimiEncoderOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.audio_codes Discrete code embeddings, of shape `(batch_size, num_quantizers, codes_length)`.\n */\n constructor({ audio_codes }) {\n super();\n this.audio_codes = audio_codes;\n }\n}\n\nexport class MimiDecoderOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.audio_values Decoded audio values, of shape `(batch_size, num_channels, sequence_length)`.\n */\n constructor({ audio_values }) {\n super();\n this.audio_values = audio_values;\n }\n}\n\n/**\n * The Mimi neural audio codec model.\n */\nexport class MimiModel extends MimiPreTrainedModel {\n /**\n * Encodes the input audio waveform into discrete codes.\n * @param {Object} inputs Model inputs\n * @param {Tensor} [inputs.input_values] Float values of the input audio waveform, of shape `(batch_size, channels, sequence_length)`).\n * @returns {Promise<MimiEncoderOutput>} The output tensor of shape `(batch_size, num_codebooks, sequence_length)`.\n */\n async encode(inputs) {\n return new MimiEncoderOutput(await sessionRun(this.sessions['encoder_model'], inputs));\n }\n\n /**\n * Decodes the given frames into an output audio waveform.\n * @param {MimiEncoderOutput} inputs The encoded audio codes.\n * @returns {Promise<MimiDecoderOutput>} The output tensor of shape `(batch_size, num_channels, sequence_length)`.\n */\n async decode(inputs) {\n return new MimiDecoderOutput(await sessionRun(this.sessions['decoder_model'], inputs));\n }\n}\n\nexport class MimiEncoderModel extends MimiPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'encoder_model',\n });\n }\n}\nexport class MimiDecoderModel extends MimiPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'decoder_model',\n });\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Dac models\nexport class DacPreTrainedModel extends PreTrainedModel {\n main_input_name = 'input_values';\n forward_params = ['input_values'];\n}\n\nexport class DacEncoderOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.audio_codes Discrete code embeddings, of shape `(batch_size, num_quantizers, codes_length)`.\n */\n constructor({ audio_codes }) {\n super();\n this.audio_codes = audio_codes;\n }\n}\n\nexport class DacDecoderOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.audio_values Decoded audio values, of shape `(batch_size, num_channels, sequence_length)`.\n */\n constructor({ audio_values }) {\n super();\n this.audio_values = audio_values;\n }\n}\n\n/**\n * The DAC (Descript Audio Codec) model.\n */\nexport class DacModel extends DacPreTrainedModel {\n /**\n * Encodes the input audio waveform into discrete codes.\n * @param {Object} inputs Model inputs\n * @param {Tensor} [inputs.input_values] Float values of the input audio waveform, of shape `(batch_size, channels, sequence_length)`).\n * @returns {Promise<DacEncoderOutput>} The output tensor of shape `(batch_size, num_codebooks, sequence_length)`.\n */\n async encode(inputs) {\n return new DacEncoderOutput(await sessionRun(this.sessions['encoder_model'], inputs));\n }\n\n /**\n * Decodes the given frames into an output audio waveform.\n * @param {DacEncoderOutput} inputs The encoded audio codes.\n * @returns {Promise<DacDecoderOutput>} The output tensor of shape `(batch_size, num_channels, sequence_length)`.\n */\n async decode(inputs) {\n return new DacDecoderOutput(await sessionRun(this.sessions['decoder_model'], inputs));\n }\n}\n\nexport class DacEncoderModel extends DacPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'encoder_model',\n });\n }\n}\nexport class DacDecoderModel extends DacPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'decoder_model',\n });\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Snac models\nexport class SnacPreTrainedModel extends PreTrainedModel {\n main_input_name = 'input_values';\n forward_params = ['input_values'];\n}\n\n/**\n * The SNAC (Multi-Scale Neural Audio Codec) model.\n */\nexport class SnacModel extends SnacPreTrainedModel {\n /**\n * Encodes the input audio waveform into discrete codes.\n * @param {Object} inputs Model inputs\n * @param {Tensor} [inputs.input_values] Float values of the input audio waveform, of shape `(batch_size, channels, sequence_length)`).\n * @returns {Promise<Record<string, Tensor>>} The output tensors of shape `(batch_size, num_codebooks, sequence_length)`.\n */\n async encode(inputs) {\n return await sessionRun(this.sessions['encoder_model'], inputs);\n }\n\n /**\n * Decodes the given frames into an output audio waveform.\n * @param {Record<string, Tensor>} inputs The encoded audio codes.\n * @returns {Promise<{audio_values: Tensor}>} The output tensor of shape `(batch_size, num_channels, sequence_length)`.\n */\n async decode(inputs) {\n return await sessionRun(this.sessions['decoder_model'], inputs);\n }\n}\n\nexport class SnacEncoderModel extends SnacPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'encoder_model',\n });\n }\n}\nexport class SnacDecoderModel extends SnacPreTrainedModel {\n /** @type {typeof PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n return super.from_pretrained(pretrained_model_name_or_path, {\n ...options,\n // Update default model file name if not provided\n model_file_name: options.model_file_name ?? 'decoder_model',\n });\n }\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<string, Object>[]}\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 use_external_data_format = null,\n session_options = {},\n } = {}) {\n\n const 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 use_external_data_format,\n session_options,\n }\n options.config = await AutoConfig.from_pretrained(pretrained_model_name_or_path, options);\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 const model_type = options.config.model_type;\n for (const MODEL_CLASS_MAPPING of this.MODEL_CLASS_MAPPINGS) {\n let modelInfo = MODEL_CLASS_MAPPING.get(model_type);\n if (!modelInfo) {\n // As a fallback, we check if model_type is specified as the exact class\n for (const cls of MODEL_CLASS_MAPPING.values()) {\n if (cls[0] === model_type) {\n modelInfo = cls;\n break;\n }\n }\n if (!modelInfo) 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 if (!(CUSTOM_ARCHITECTURES.has(model_type))) {\n console.warn(`Unknown model class \"${model_type}\", attempting to construct from base class.`);\n }\n return await PreTrainedModel.from_pretrained(pretrained_model_name_or_path, options);\n } else {\n throw Error(`Unsupported model type: ${model_type}`)\n }\n }\n}\n\nconst MODEL_MAPPING_NAMES_ENCODER_ONLY = new Map([\n ['bert', ['BertModel', BertModel]],\n ['neobert', ['NeoBertModel', NeoBertModel]],\n ['modernbert', ['ModernBertModel', ModernBertModel]],\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 ['jina_clip', ['JinaCLIPModel', JinaCLIPModel]],\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 ['pyannote', ['PyAnnoteModel', PyAnnoteModel]],\n ['wespeaker-resnet', ['WeSpeakerResNetModel', WeSpeakerResNetModel]],\n\n ['detr', ['DetrModel', DetrModel]],\n ['rt_detr', ['RTDetrModel', RTDetrModel]],\n ['rt_detr_v2', ['RTDetrV2Model', RTDetrV2Model]],\n ['rf_detr', ['RFDetrModel', RFDetrModel]],\n ['d_fine', ['DFineModel', DFineModel]],\n ['table-transformer', ['TableTransformerModel', TableTransformerModel]],\n ['vit', ['ViTModel', ViTModel]],\n ['ijepa', ['IJepaModel', IJepaModel]],\n ['pvt', ['PvtModel', PvtModel]],\n ['vit_msn', ['ViTMSNModel', ViTMSNModel]],\n ['vit_mae', ['ViTMAEModel', ViTMAEModel]],\n ['groupvit', ['GroupViTModel', GroupViTModel]],\n ['fastvit', ['FastViTModel', FastViTModel]],\n ['mobilevit', ['MobileViTModel', MobileViTModel]],\n ['mobilevitv2', ['MobileViTV2Model', MobileViTV2Model]],\n ['owlvit', ['OwlViTModel', OwlViTModel]],\n ['owlv2', ['Owlv2Model', Owlv2Model]],\n ['beit', ['BeitModel', BeitModel]],\n ['deit', ['DeiTModel', DeiTModel]],\n ['hiera', ['HieraModel', HieraModel]],\n ['convnext', ['ConvNextModel', ConvNextModel]],\n ['convnextv2', ['ConvNextV2Model', ConvNextV2Model]],\n ['dinov2', ['Dinov2Model', Dinov2Model]],\n ['dinov2_with_registers', ['Dinov2WithRegistersModel', Dinov2WithRegistersModel]],\n ['dinov3_vit', ['DINOv3ViTModel', DINOv3ViTModel]],\n ['dinov3_convnext', ['DINOv3ConvNextModel', DINOv3ConvNextModel]],\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 ['decision_transformer', ['DecisionTransformerModel', DecisionTransformerModel]],\n ['patchtst', ['PatchTSTForPrediction', PatchTSTModel]],\n ['patchtsmixer', ['PatchTSMixerForPrediction', PatchTSMixerModel]],\n\n ['mobilenet_v1', ['MobileNetV1Model', MobileNetV1Model]],\n ['mobilenet_v2', ['MobileNetV2Model', MobileNetV2Model]],\n ['mobilenet_v3', ['MobileNetV3Model', MobileNetV3Model]],\n ['mobilenet_v4', ['MobileNetV4Model', MobileNetV4Model]],\n\n ['maskformer', ['MaskFormerModel', MaskFormerModel]],\n ['mgp-str', ['MgpstrForSceneTextRecognition', MgpstrForSceneTextRecognition]],\n\n ['style_text_to_speech_2', ['StyleTextToSpeech2Model', StyleTextToSpeech2Model]],\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\nconst MODEL_MAPPING_NAMES_AUTO_ENCODER = new Map([\n ['mimi', ['MimiModel', MimiModel]],\n ['dac', ['DacModel', DacModel]],\n ['snac', ['SnacModel', SnacModel]],\n]);\n\nconst MODEL_MAPPING_NAMES_DECODER_ONLY = new Map([\n ['bloom', ['BloomModel', BloomModel]],\n ['jais', ['JAISModel', JAISModel]],\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 ['nanochat', ['NanoChatModel', NanoChatModel]],\n ['arcee', ['ArceeModel', ArceeModel]],\n ['lfm2', ['Lfm2Model', Lfm2Model]],\n ['smollm3', ['SmolLM3Model', SmolLM3Model]],\n ['exaone', ['ExaoneModel', ExaoneModel]],\n ['olmo', ['OlmoModel', OlmoModel]],\n ['olmo2', ['Olmo2Model', Olmo2Model]],\n ['mobilellm', ['MobileLLMModel', MobileLLMModel]],\n ['granite', ['GraniteModel', GraniteModel]],\n ['granitemoehybrid', ['GraniteMoeHybridModel', GraniteMoeHybridModel]],\n ['cohere', ['CohereModel', CohereModel]],\n ['gemma', ['GemmaModel', GemmaModel]],\n ['gemma2', ['Gemma2Model', Gemma2Model]],\n ['vaultgemma', ['VaultGemmaModel', VaultGemmaModel]],\n ['gemma3_text', ['Gemma3Model', Gemma3Model]],\n ['helium', ['HeliumModel', HeliumModel]],\n ['glm', ['GlmModel', GlmModel]],\n ['openelm', ['OpenELMModel', OpenELMModel]],\n ['qwen2', ['Qwen2Model', Qwen2Model]],\n ['qwen3', ['Qwen3Model', Qwen3Model]],\n ['phi', ['PhiModel', PhiModel]],\n ['phi3', ['Phi3Model', Phi3Model]],\n ['mpt', ['MptModel', MptModel]],\n ['opt', ['OPTModel', OPTModel]],\n ['mistral', ['MistralModel', MistralModel]],\n ['ministral', ['MinistralModel', MinistralModel]],\n ['ministral3', ['Ministral3Model', Ministral3Model]],\n ['ernie4_5', ['Ernie4_5Model', Ernie4_5Model]],\n ['starcoder2', ['Starcoder2Model', Starcoder2Model]],\n ['falcon', ['FalconModel', FalconModel]],\n ['stablelm', ['StableLmModel', StableLmModel]],\n ['modernbert-decoder', ['ModernBertDecoderModel', ModernBertDecoderModel]],\n]);\n\nconst MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForSpeechToText', SpeechT5ForSpeechToText]],\n ['whisper', ['WhisperForConditionalGeneration', WhisperForConditionalGeneration]],\n ['lite-whisper', ['LiteWhisperForConditionalGeneration', LiteWhisperForConditionalGeneration]],\n ['moonshine', ['MoonshineForConditionalGeneration', MoonshineForConditionalGeneration]],\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 ['supertonic', ['SupertonicForConditionalGeneration', SupertonicForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForSequenceClassification', BertForSequenceClassification]],\n ['neobert', ['NeoBertForSequenceClassification', NeoBertForSequenceClassification]],\n ['modernbert', ['ModernBertForSequenceClassification', ModernBertForSequenceClassification]],\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 ['neobert', ['NeoBertForTokenClassification', NeoBertForTokenClassification]],\n ['modernbert', ['ModernBertForTokenClassification', ModernBertForTokenClassification]],\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 ['jais', ['JAISLMHeadModel', JAISLMHeadModel]],\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 ['nanochat', ['NanoChatForCausalLM', NanoChatForCausalLM]],\n ['llama4_text', ['Llama4ForCausalLM', Llama4ForCausalLM]],\n ['arcee', ['ArceeForCausalLM', ArceeForCausalLM]],\n ['lfm2', ['Lfm2ForCausalLM', Lfm2ForCausalLM]],\n ['smollm3', ['SmolLM3ForCausalLM', SmolLM3ForCausalLM]],\n ['exaone', ['ExaoneForCausalLM', ExaoneForCausalLM]],\n ['olmo', ['OlmoForCausalLM', OlmoForCausalLM]],\n ['olmo2', ['Olmo2ForCausalLM', Olmo2ForCausalLM]],\n ['mobilellm', ['MobileLLMForCausalLM', MobileLLMForCausalLM]],\n ['granite', ['GraniteForCausalLM', GraniteForCausalLM]],\n ['granitemoehybrid', ['GraniteMoeHybridForCausalLM', GraniteMoeHybridForCausalLM]],\n ['cohere', ['CohereForCausalLM', CohereForCausalLM]],\n ['gemma', ['GemmaForCausalLM', GemmaForCausalLM]],\n ['gemma2', ['Gemma2ForCausalLM', Gemma2ForCausalLM]],\n ['vaultgemma', ['VaultGemmaForCausalLM', VaultGemmaForCausalLM]],\n ['gemma3_text', ['Gemma3ForCausalLM', Gemma3ForCausalLM]],\n ['helium', ['HeliumForCausalLM', HeliumForCausalLM]],\n ['glm', ['GlmForCausalLM', GlmForCausalLM]],\n ['openelm', ['OpenELMForCausalLM', OpenELMForCausalLM]],\n ['qwen2', ['Qwen2ForCausalLM', Qwen2ForCausalLM]],\n ['qwen3', ['Qwen3ForCausalLM', Qwen3ForCausalLM]],\n ['phi', ['PhiForCausalLM', PhiForCausalLM]],\n ['phi3', ['Phi3ForCausalLM', Phi3ForCausalLM]],\n ['mpt', ['MptForCausalLM', MptForCausalLM]],\n ['opt', ['OPTForCausalLM', OPTForCausalLM]],\n ['mbart', ['MBartForCausalLM', MBartForCausalLM]],\n ['mistral', ['MistralForCausalLM', MistralForCausalLM]],\n ['ministral', ['MinistralForCausalLM', MinistralForCausalLM]],\n ['ministral3', ['Ministral3ForCausalLM', Ministral3ForCausalLM]],\n ['ernie4_5', ['Ernie4_5ForCausalLM', Ernie4_5ForCausalLM]],\n ['starcoder2', ['Starcoder2ForCausalLM', Starcoder2ForCausalLM]],\n ['falcon', ['FalconForCausalLM', FalconForCausalLM]],\n ['trocr', ['TrOCRForCausalLM', TrOCRForCausalLM]],\n ['stablelm', ['StableLmForCausalLM', StableLmForCausalLM]],\n ['modernbert-decoder', ['ModernBertDecoderForCausalLM', ModernBertDecoderForCausalLM]],\n\n // Also image-text-to-text\n ['phi3_v', ['Phi3VForCausalLM', Phi3VForCausalLM]],\n]);\n\nconst MODEL_FOR_MULTIMODALITY_MAPPING_NAMES = new Map([\n ['multi_modality', ['MultiModalityCausalLM', MultiModalityCausalLM]],\n]);\n\n\nconst MODEL_FOR_MASKED_LM_MAPPING_NAMES = new Map([\n ['bert', ['BertForMaskedLM', BertForMaskedLM]],\n ['neobert', ['NeoBertForMaskedLM', NeoBertForMaskedLM]],\n ['modernbert', ['ModernBertForMaskedLM', ModernBertForMaskedLM]],\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 ['neobert', ['NeoBertForQuestionAnswering', NeoBertForQuestionAnswering]],\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 ['idefics3', ['Idefics3ForConditionalGeneration', Idefics3ForConditionalGeneration]],\n ['smolvlm', ['SmolVLMForConditionalGeneration', SmolVLMForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES = new Map([\n ['llava', ['LlavaForConditionalGeneration', LlavaForConditionalGeneration]],\n ['llava_onevision', ['LlavaOnevisionForConditionalGeneration', LlavaOnevisionForConditionalGeneration]],\n ['moondream1', ['Moondream1ForConditionalGeneration', Moondream1ForConditionalGeneration]],\n ['florence2', ['Florence2ForConditionalGeneration', Florence2ForConditionalGeneration]],\n ['qwen2-vl', ['Qwen2VLForConditionalGeneration', Qwen2VLForConditionalGeneration]],\n ['idefics3', ['Idefics3ForConditionalGeneration', Idefics3ForConditionalGeneration]],\n ['smolvlm', ['SmolVLMForConditionalGeneration', SmolVLMForConditionalGeneration]],\n ['paligemma', ['PaliGemmaForConditionalGeneration', PaliGemmaForConditionalGeneration]],\n ['llava_qwen2', ['LlavaQwen2ForCausalLM', LlavaQwen2ForCausalLM]],\n ['gemma3n', ['Gemma3nForConditionalGeneration', Gemma3nForConditionalGeneration]],\n ['mistral3', ['Mistral3ForConditionalGeneration', Mistral3ForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES = new Map([\n ['ultravox', ['UltravoxModel', UltravoxModel]],\n ['voxtral', ['VoxtralForConditionalGeneration', VoxtralForConditionalGeneration]],\n]);\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 ['ijepa', ['IJepaForImageClassification', IJepaForImageClassification]],\n ['pvt', ['PvtForImageClassification', PvtForImageClassification]],\n ['vit_msn', ['ViTMSNForImageClassification', ViTMSNForImageClassification]],\n ['fastvit', ['FastViTForImageClassification', FastViTForImageClassification]],\n ['mobilevit', ['MobileViTForImageClassification', MobileViTForImageClassification]],\n ['mobilevitv2', ['MobileViTV2ForImageClassification', MobileViTV2ForImageClassification]],\n ['beit', ['BeitForImageClassification', BeitForImageClassification]],\n ['deit', ['DeiTForImageClassification', DeiTForImageClassification]],\n ['hiera', ['HieraForImageClassification', HieraForImageClassification]],\n ['convnext', ['ConvNextForImageClassification', ConvNextForImageClassification]],\n ['convnextv2', ['ConvNextV2ForImageClassification', ConvNextV2ForImageClassification]],\n ['dinov2', ['Dinov2ForImageClassification', Dinov2ForImageClassification]],\n ['dinov2_with_registers', ['Dinov2WithRegistersForImageClassification', Dinov2WithRegistersForImageClassification]],\n ['resnet', ['ResNetForImageClassification', ResNetForImageClassification]],\n ['swin', ['SwinForImageClassification', SwinForImageClassification]],\n ['segformer', ['SegformerForImageClassification', SegformerForImageClassification]],\n ['efficientnet', ['EfficientNetForImageClassification', EfficientNetForImageClassification]],\n ['mobilenet_v1', ['MobileNetV1ForImageClassification', MobileNetV1ForImageClassification]],\n ['mobilenet_v2', ['MobileNetV2ForImageClassification', MobileNetV2ForImageClassification]],\n ['mobilenet_v3', ['MobileNetV3ForImageClassification', MobileNetV3ForImageClassification]],\n ['mobilenet_v4', ['MobileNetV4ForImageClassification', MobileNetV4ForImageClassification]],\n]);\n\nconst MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForObjectDetection', DetrForObjectDetection]],\n ['rt_detr', ['RTDetrForObjectDetection', RTDetrForObjectDetection]],\n ['rt_detr_v2', ['RTDetrV2ForObjectDetection', RTDetrV2ForObjectDetection]],\n ['rf_detr', ['RFDetrForObjectDetection', RFDetrForObjectDetection]],\n ['d_fine', ['DFineForObjectDetection', DFineForObjectDetection]],\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 ['grounding-dino', ['GroundingDinoForObjectDetection', GroundingDinoForObjectDetection]],\n]);\n\nconst MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES = new Map([\n // TODO: Do not add new models here\n ['detr', ['DetrForSegmentation', DetrForSegmentation]],\n ['clipseg', ['CLIPSegForImageSegmentation', CLIPSegForImageSegmentation]],\n]);\n\nconst MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES = new Map([\n ['segformer', ['SegformerForSemanticSegmentation', SegformerForSemanticSegmentation]],\n ['sapiens', ['SapiensForSemanticSegmentation', SapiensForSemanticSegmentation]],\n\n ['swin', ['SwinForSemanticSegmentation', SwinForSemanticSegmentation]],\n ['mobilenet_v1', ['MobileNetV1ForSemanticSegmentation', MobileNetV1ForSemanticSegmentation]],\n ['mobilenet_v2', ['MobileNetV2ForSemanticSegmentation', MobileNetV2ForSemanticSegmentation]],\n ['mobilenet_v3', ['MobileNetV3ForSemanticSegmentation', MobileNetV3ForSemanticSegmentation]],\n ['mobilenet_v4', ['MobileNetV4ForSemanticSegmentation', MobileNetV4ForSemanticSegmentation]],\n]);\n\nconst MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForSegmentation', DetrForSegmentation]],\n ['maskformer', ['MaskFormerForInstanceSegmentation', MaskFormerForInstanceSegmentation]],\n]);\n\nconst MODEL_FOR_MASK_GENERATION_MAPPING_NAMES = new Map([\n ['sam', ['SamModel', SamModel]],\n ['sam2', ['Sam2Model', Sam2Model]],\n ['edgetam', ['EdgeTamModel', EdgeTamModel]],\n ['sam3_tracker', ['Sam3TrackerModel', Sam3TrackerModel]],\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 ['parakeet_ctc', ['ParakeetForCTC', ParakeetForCTC]],\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 ['pyannote', ['PyAnnoteForAudioFrameClassification', PyAnnoteForAudioFrameClassification]],\n]);\n\nconst MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES = new Map([\n ['vitmatte', ['VitMatteForImageMatting', VitMatteForImageMatting]],\n]);\n\nconst MODEL_FOR_TIME_SERIES_PREDICTION_MAPPING_NAMES = new Map([\n ['patchtst', ['PatchTSTForPrediction', PatchTSTForPrediction]],\n ['patchtsmixer', ['PatchTSMixerForPrediction', PatchTSMixerForPrediction]],\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 ['sapiens', ['SapiensForDepthEstimation', SapiensForDepthEstimation]],\n ['depth_pro', ['DepthProForDepthEstimation', DepthProForDepthEstimation]],\n ['metric3d', ['Metric3DForDepthEstimation', Metric3DForDepthEstimation]],\n ['metric3dv2', ['Metric3Dv2ForDepthEstimation', Metric3Dv2ForDepthEstimation]],\n])\n\nconst MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES = new Map([\n ['sapiens', ['SapiensForNormalEstimation', SapiensForNormalEstimation]],\n])\n\nconst MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES = new Map([\n ['vitpose', ['VitPoseForPoseEstimation', VitPoseForPoseEstimation]],\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 ['jina_clip', ['JinaCLIPVisionModel', JinaCLIPVisionModel]],\n])\n\nconst MODEL_CLASS_TYPE_MAPPING = [\n // MODEL_MAPPING_NAMES:\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_MAPPING_NAMES_AUTO_ENCODER, MODEL_TYPES.AutoEncoder],\n\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_MULTIMODALITY_MAPPING_NAMES, MODEL_TYPES.MultiModality],\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_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES, MODEL_TYPES.AudioTextToText],\n [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_UNIVERSAL_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_TIME_SERIES_PREDICTION_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_NORMAL_ESTIMATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_POSE_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 ['Phi3VForCausalLM', Phi3VForCausalLM, MODEL_TYPES.Phi3V],\n\n ['CLIPTextModelWithProjection', CLIPTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['SiglipTextModel', SiglipTextModel, MODEL_TYPES.EncoderOnly],\n ['JinaCLIPTextModel', JinaCLIPTextModel, MODEL_TYPES.EncoderOnly],\n ['ClapTextModelWithProjection', ClapTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['ClapAudioModelWithProjection', ClapAudioModelWithProjection, MODEL_TYPES.EncoderOnly],\n\n ['DacEncoderModel', DacEncoderModel, MODEL_TYPES.EncoderOnly],\n ['DacDecoderModel', DacDecoderModel, MODEL_TYPES.EncoderOnly],\n ['MimiEncoderModel', MimiEncoderModel, MODEL_TYPES.EncoderOnly],\n ['MimiDecoderModel', MimiDecoderModel, MODEL_TYPES.EncoderOnly],\n ['SnacEncoderModel', SnacEncoderModel, MODEL_TYPES.EncoderOnly],\n ['SnacDecoderModel', SnacDecoderModel, MODEL_TYPES.EncoderOnly],\n\n ['Gemma3nForConditionalGeneration', Gemma3nForConditionalGeneration, MODEL_TYPES.ImageAudioTextToText],\n ['SupertonicForConditionalGeneration', SupertonicForConditionalGeneration, MODEL_TYPES.Supertonic],\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\nconst CUSTOM_ARCHITECTURES = new Map([\n ['modnet', MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES],\n ['birefnet', MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES],\n ['isnet', MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES],\n ['ben', MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES],\n]);\nfor (const [name, mapping] of CUSTOM_ARCHITECTURES.entries()) {\n mapping.set(name, ['PreTrainedModel', PreTrainedModel])\n MODEL_TYPE_MAPPING.set(name, MODEL_TYPES.EncoderOnly);\n MODEL_CLASS_TO_NAME_MAPPING.set(PreTrainedModel, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, PreTrainedModel);\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<string, Object>[]} */\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 universal 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 AutoModelForUniversalSegmentation.from_pretrained('hf-internal-testing/tiny-random-MaskFormerForInstanceSegmentation');\n */\nexport class AutoModelForUniversalSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_UNIVERSAL_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 AutoModelForNormalEstimation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES];\n}\n\nexport class AutoModelForPoseEstimation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES];\n}\n\nexport class AutoModelForImageFeatureExtraction extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES];\n}\n\nexport class AutoModelForImageTextToText extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES];\n}\n\nexport class AutoModelForAudioTextToText extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_TEXT_TO_TEXT_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 * @param {Record<string, Tensor>} [output.attentions] Object of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, sequence_length)`.\n * Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads.\n */\n constructor({ logits, ...attentions }) {\n super();\n this.logits = logits;\n const attentions_list = Object.values(attentions);\n if (attentions_list.length > 0) {\n // Only set attentions if they are not empty\n this.attentions = attentions_list;\n }\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 { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\n\n\nexport class ASTFeatureExtractor 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 257, // 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 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 {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _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 = await 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: features.unsqueeze_(0)\n };\n }\n}\n","\nimport { FEATURE_EXTRACTOR_NAME, GITHUB_ISSUE_URL } from '../../utils/constants.js';\nimport { getModelJSON } from '../../utils/hub.js';\nimport { FeatureExtractor } from '../../base/feature_extraction_utils.js';\nimport * as AllFeatureExtractors from '../feature_extractors.js';\n\nexport class AutoFeatureExtractor {\n\n /** @type {typeof FeatureExtractor.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options={}) {\n\n const preprocessorConfig = await getModelJSON(pretrained_model_name_or_path, FEATURE_EXTRACTOR_NAME, true, options);\n\n // Determine feature extractor class\n const key = preprocessorConfig.feature_extractor_type;\n const feature_extractor_class = AllFeatureExtractors[key];\n\n if (!feature_extractor_class) {\n throw new Error(`Unknown feature_extractor_type: '${key}'. Please report this at ${GITHUB_ISSUE_URL}.`);\n }\n\n // Instantiate feature extractor\n return new feature_extractor_class(preprocessorConfig);\n }\n}\n","\nimport { GITHUB_ISSUE_URL, IMAGE_PROCESSOR_NAME } from '../../utils/constants.js';\nimport { getModelJSON } from '../../utils/hub.js';\nimport { ImageProcessor } from '../../base/image_processors_utils.js';\nimport * as AllImageProcessors from '../image_processors.js';\n\nexport class AutoImageProcessor {\n\n /** @type {typeof ImageProcessor.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options={}) {\n\n const preprocessorConfig = await getModelJSON(pretrained_model_name_or_path, IMAGE_PROCESSOR_NAME, true, options);\n\n // Determine image processor class\n const key = preprocessorConfig.image_processor_type ?? preprocessorConfig.feature_extractor_type;\n let image_processor_class = AllImageProcessors[key?.replace(/Fast$/, '')];\n\n if (!image_processor_class) {\n if (key !== undefined) {\n // Only log a warning if the class is not found and the key is set.\n console.warn(`Image processor type '${key}' not found, assuming base ImageProcessor. Please report this at ${GITHUB_ISSUE_URL}.`)\n }\n image_processor_class = ImageProcessor;\n }\n\n // Instantiate image processor\n return new image_processor_class(preprocessorConfig);\n }\n}\n","\n\nimport { IMAGE_PROCESSOR_NAME } from '../../utils/constants.js';\nimport { getModelJSON } from '../../utils/hub.js';\nimport { Processor } from '../../base/processing_utils.js';\n\nimport * as AllProcessors from '../processors.js';\nimport * as AllImageProcessors from '../image_processors.js';\nimport * as AllFeatureExtractors from '../feature_extractors.js';\n\n/**\n * @typedef {import('../../base/processing_utils.js').PretrainedProcessorOptions} PretrainedProcessorOptions\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\n /** @type {typeof Processor.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options={}) {\n\n // TODO: first check for processor.json \n const preprocessorConfig = await getModelJSON(pretrained_model_name_or_path, IMAGE_PROCESSOR_NAME, true, options);\n\n const { image_processor_type, feature_extractor_type, processor_class } = preprocessorConfig;\n if (processor_class && AllProcessors[processor_class]) {\n return AllProcessors[processor_class].from_pretrained(pretrained_model_name_or_path, options);\n }\n\n if (!image_processor_type && !feature_extractor_type) {\n throw new Error('No `image_processor_type` or `feature_extractor_type` found in the config.');\n }\n\n const components = {};\n if (image_processor_type) {\n // Some image processors are saved with the \"Fast\" suffix, so we remove that if present.\n const image_processor_class = AllImageProcessors[image_processor_type.replace(/Fast$/, '')];\n if (!image_processor_class) {\n throw new Error(`Unknown image_processor_type: '${image_processor_type}'.`);\n }\n components.image_processor = new image_processor_class(preprocessorConfig);\n }\n\n if (feature_extractor_type) {\n const image_processor_class = AllImageProcessors[feature_extractor_type];\n if (image_processor_class) {\n // Handle legacy case where image processors were specified as feature extractors\n components.image_processor = new image_processor_class(preprocessorConfig);\n } else {\n const feature_extractor_class = AllFeatureExtractors[feature_extractor_type];\n if (!feature_extractor_class) {\n throw new Error(`Unknown feature_extractor_type: '${feature_extractor_type}'.`);\n }\n components.feature_extractor = new feature_extractor_class(preprocessorConfig);\n }\n }\n\n const config = {};\n return new Processor(config, components, null);\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class BeitFeatureExtractor extends ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class BitImageProcessor extends ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class ChineseCLIPFeatureExtractor extends ImageProcessor { }\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\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 {Promise<Tensor>} 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 * @private\n */\n async _get_input_mel(waveform, max_length, truncation, padding) {\n\n /** @type {Tensor} */\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 = await this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\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 = await this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n }\n\n return input_mel.unsqueeze_(0);\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 {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _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 = await 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 return {\n input_features: padded_inputs.unsqueeze_(0),\n }\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class CLIPImageProcessor extends ImageProcessor { }\nexport class CLIPFeatureExtractor extends CLIPImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class ConvNextImageProcessor extends ImageProcessor {\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 // @ts-expect-error TS2339\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 ConvNextFeatureExtractor extends ConvNextImageProcessor { }\n","import { EncodecFeatureExtractor } from '../encodec/feature_extraction_encodec.js';\n\nexport class DacFeatureExtractor extends EncodecFeatureExtractor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class DeiTImageProcessor extends ImageProcessor { }\nexport class DeiTFeatureExtractor extends DeiTImageProcessor { }","import { \n ImageProcessor,\n post_process_object_detection,\n post_process_panoptic_segmentation,\n post_process_instance_segmentation,\n} from \"../../base/image_processors_utils.js\";\n\nimport { full } from '../../utils/tensor.js';\n\n\n/**\n * @typedef {object} DetrFeatureExtractorResultProps\n * @property {import('../../utils/tensor.js').Tensor} pixel_mask\n * @typedef {import('../../base/image_processors_utils.js').ImageProcessorResult & DetrFeatureExtractorResultProps} DetrFeatureExtractorResult\n */\n\nexport class DetrImageProcessor extends ImageProcessor {\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 {import('../../utils/image.js').RawImage[]} images The image(s) to extract features from.\n * @returns {Promise<DetrFeatureExtractorResult>} 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 = full(maskSize, 1n);\n\n return { ...result, pixel_mask };\n }\n\n /** @type {typeof post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n\n /** @type {typeof post_process_panoptic_segmentation} */\n post_process_panoptic_segmentation(...args) {\n return post_process_panoptic_segmentation(...args);\n }\n\n /** @type {typeof post_process_instance_segmentation} */\n post_process_instance_segmentation(...args) {\n return post_process_instance_segmentation(...args);\n }\n}\n\nexport class DetrFeatureExtractor extends DetrImageProcessor { } // NOTE: extends DetrImageProcessor \n","\nimport { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class DINOv3ViTImageProcessor extends ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class DonutImageProcessor extends ImageProcessor {\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,\n ...options,\n });\n }\n}\nexport class DonutFeatureExtractor extends DonutImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class DPTImageProcessor extends ImageProcessor { }\nexport class DPTFeatureExtractor extends DPTImageProcessor { } // NOTE: extends DPTImageProcessor\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class EfficientNetImageProcessor extends ImageProcessor {\n constructor(config) {\n super(config);\n // @ts-expect-error TS2339\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","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\n\n\nexport class EncodecFeatureExtractor extends FeatureExtractor {\n /**\n * Asynchronously extracts input values 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; }>} The extracted input values.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'EncodecFeatureExtractor');\n\n if (audio instanceof Float64Array) {\n audio = new Float32Array(audio);\n }\n\n const num_channels = this.config.feature_size;\n if (audio.length % num_channels !== 0) {\n throw new Error(`The length of the audio data must be a multiple of the number of channels (${num_channels}).`);\n }\n\n const shape = [\n 1, /* batch_size */\n num_channels, /* num_channels */\n audio.length / num_channels, /* num_samples */\n ];\n return {\n input_values: new Tensor('float32', audio, shape),\n };\n }\n}\n","\nexport * from './audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js';\nexport * from './encodec/feature_extraction_encodec.js';\nexport * from './clap/feature_extraction_clap.js';\nexport * from './dac/feature_extraction_dac.js';\nexport * from './gemma3n/feature_extraction_gemma3n.js';\nexport * from './moonshine/feature_extraction_moonshine.js';\nexport * from './parakeet/feature_extraction_parakeet.js';\nexport * from './pyannote/feature_extraction_pyannote.js';\nexport * from './seamless_m4t/feature_extraction_seamless_m4t.js';\nexport * from './snac/feature_extraction_snac.js';\nexport * from './speecht5/feature_extraction_speecht5.js';\nexport * from './wav2vec2/feature_extraction_wav2vec2.js';\nexport * from './wespeaker/feature_extraction_wespeaker.js';\nexport * from './whisper/feature_extraction_whisper.js';\n\n// For legacy support, ImageFeatureExtractor is an alias for ImageProcessor\nexport { ImageProcessor as ImageFeatureExtractor } from \"../base/image_processors_utils.js\";\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\n\nexport class Florence2Processor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n\n constructor(config, components, chat_template) {\n super(config, components, chat_template);\n\n const {\n // @ts-expect-error TS2339\n tasks_answer_post_processing_type,\n // @ts-expect-error TS2339\n task_prompts_without_inputs,\n // @ts-expect-error TS2339\n task_prompts_with_input,\n } = this.image_processor.config;\n\n /** @type {Map<string, string>} */\n this.tasks_answer_post_processing_type = new Map(Object.entries(tasks_answer_post_processing_type ?? {}));\n\n /** @type {Map<string, string>} */\n this.task_prompts_without_inputs = new Map(Object.entries(task_prompts_without_inputs ?? {}));\n\n /** @type {Map<string, string>} */\n this.task_prompts_with_input = new Map(Object.entries(task_prompts_with_input ?? {}));\n\n this.regexes = {\n quad_boxes: /(.+?)<loc_(\\d+)><loc_(\\d+)><loc_(\\d+)><loc_(\\d+)><loc_(\\d+)><loc_(\\d+)><loc_(\\d+)><loc_(\\d+)>/gm,\n bboxes: /([^<]+)?<loc_(\\d+)><loc_(\\d+)><loc_(\\d+)><loc_(\\d+)>/gm,\n }\n this.size_per_bin = 1000;\n }\n\n /**\n * Helper function to construct prompts from input texts\n * @param {string|string[]} text\n * @returns {string[]}\n */\n construct_prompts(text) {\n if (typeof text === 'string') {\n text = [text];\n }\n\n const prompts = [];\n for (const t of text) {\n // 1. fixed task prompts without additional inputs\n if (this.task_prompts_without_inputs.has(t)) {\n prompts.push(this.task_prompts_without_inputs.get(t));\n }\n // 2. task prompts with additional inputs \n else {\n for (const [task, prompt] of this.task_prompts_with_input) {\n if (t.includes(task)) {\n prompts.push(prompt.replaceAll('{input}', t).replaceAll(task, ''));\n break;\n }\n }\n\n // 3. default prompt\n if (prompts.length !== text.length) {\n prompts.push(t);\n }\n }\n }\n return prompts;\n }\n\n /**\n * Post-process the output of the model to each of the task outputs.\n * @param {string} text The text to post-process.\n * @param {string} task The task to post-process the text for.\n * @param {[number, number]} image_size The size of the image. height x width.\n */\n post_process_generation(text, task, image_size) {\n const task_answer_post_processing_type = this.tasks_answer_post_processing_type.get(task) ?? 'pure_text';\n\n // remove the special tokens\n text = text.replaceAll('<s>', '').replaceAll('</s>', '');\n\n let final_answer;\n switch (task_answer_post_processing_type) {\n case 'pure_text':\n final_answer = text;\n break;\n\n case 'description_with_bboxes':\n case 'bboxes':\n case 'phrase_grounding':\n case 'ocr':\n const key = task_answer_post_processing_type === 'ocr' ? 'quad_boxes' : 'bboxes';\n const matches = text.matchAll(this.regexes[key]);\n const labels = [];\n const items = [];\n for (const [_, label, ...locations] of matches) {\n // Push new label, or duplicate the last label\n labels.push(label ? label.trim() : labels.at(-1) ?? '');\n items.push(locations.map((x, i) =>\n // NOTE: Add 0.5 to use the center position of the bin as the coordinate.\n (Number(x) + 0.5) / this.size_per_bin * image_size[i % 2])\n );\n }\n final_answer = { labels, [key]: items };\n break;\n\n default:\n throw new Error(`Task \"${task}\" (of type \"${task_answer_post_processing_type}\") not yet implemented.`);\n }\n\n return { [task]: final_answer }\n }\n\n // NOTE: images and text are switched from the python version\n // `images` is required, `text` is optional\n async _call(images, text=null, kwargs = {}) {\n\n if (!images && !text){\n throw new Error('Either text or images must be provided');\n }\n\n const image_inputs = await this.image_processor(images, kwargs);\n const text_inputs = text ? this.tokenizer(this.construct_prompts(text), kwargs) : {};\n\n return {\n ...image_inputs,\n ...text_inputs,\n }\n }\n}\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { full, Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\n\nexport class Gemma3nAudioFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n const {\n fft_length, feature_size, min_frequency, max_frequency, sampling_rate, frame_length\n } = this.config;\n\n const mel_filters = mel_filter_bank(\n Math.floor(1 + fft_length / 2), // num_frequency_bins\n feature_size, // num_mel_filters\n min_frequency, // min_frequency\n max_frequency, // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"htk\", // mel_scale\n false, // triangularize_in_mel_space\n );\n this.mel_filters = mel_filters;\n\n this.window = window_function(frame_length, '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 * @param {number} max_length The maximum number of frames to return.\n * @returns {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _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 this.config.frame_length, // frame_length\n this.config.hop_length, // hop_length\n {\n fft_length: this.config.fft_length,\n center: false,\n onesided: true,\n preemphasis: this.config.preemphasis,\n preemphasis_htk_flavor: this.config.preemphasis_htk_flavor,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: this.config.mel_floor,\n remove_dc_offset: false,\n\n // Custom\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 {number} [options.max_length=480_000] If provided, defines the maximum length of the audio to allow.\n * Audio longer than this will be truncated if `truncation=True`.\n * @param {boolean} [options.truncation=true] Whether or not to truncate audio above `max_length`.\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=128] The number to pad the sequence to a multiple of.\n * @returns {Promise<{ input_features: Tensor, input_features_mask: Tensor }>} A Promise resolving to an object containing the extracted input features and attention masks as Tensors.\n */\n async _call(audio, {\n max_length = 480_000,\n truncation=true,\n padding = true,\n pad_to_multiple_of = 128,\n } = {}) {\n validate_audio_inputs(audio, 'Gemma3nAudioFeatureExtractor');\n if (truncation && audio.length > max_length) {\n audio = audio.slice(0, max_length);\n }\n if (padding && audio.length % pad_to_multiple_of !== 0) {\n const padding_length = pad_to_multiple_of - (audio.length % pad_to_multiple_of);\n const padded_audio = new Float64Array(audio.length + padding_length);\n padded_audio.set(audio);\n if (this.config.padding_value !== 0) {\n padded_audio.fill(this.config.padding_value, audio.length);\n }\n audio = padded_audio;\n }\n\n const features = await this._extract_fbank_features(audio, this.config.max_length);\n const padded_attention_mask = full([1, features.dims[0]], true);\n return {\n input_features: features.unsqueeze_(0),\n input_features_mask: padded_attention_mask,\n }\n }\n}\n","\nimport { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { RawImage } from \"../../utils/image.js\";\nimport { RawAudio } from \"../../utils/audio.js\";\n\nexport class Gemma3nProcessor extends Processor {\n static image_processor_class = AutoImageProcessor;\n static feature_extractor_class = AutoFeatureExtractor;\n static tokenizer_class = AutoTokenizer;\n static uses_processor_config = true;\n static uses_chat_template_file = true;\n\n constructor(config, components, chat_template) {\n super(config, components, chat_template);\n this.audio_seq_length = this.config.audio_seq_length;\n this.image_seq_length = this.config.image_seq_length;\n\n const {\n // Audio tokens\n audio_token_id, boa_token, audio_token, eoa_token,\n\n // Image tokens\n image_token_id, boi_token, image_token, eoi_token\n } = this.tokenizer.config;\n\n this.audio_token_id = audio_token_id\n this.boa_token = boa_token\n this.audio_token = audio_token\n const audio_tokens_expanded = audio_token.repeat(this.audio_seq_length);\n this.full_audio_sequence = `\\n\\n${boa_token}${audio_tokens_expanded}${eoa_token}\\n\\n`\n\n this.image_token_id = image_token_id\n this.boi_token = boi_token\n this.image_token = image_token\n const image_tokens_expanded = image_token.repeat(this.image_seq_length);\n this.full_image_sequence = `\\n\\n${boi_token}${image_tokens_expanded}${eoi_token}\\n\\n`\n }\n\n /**\n * \n * @param {string|string[]} text \n * @param {RawImage|RawImage[]|RawImage[][]} images\n * @param {RawAudio|RawAudio[]|RawAudio[][]} audio\n * @returns {Promise<any>}\n */\n async _call(text, images = null, audio = null, options = {}) {\n\n if (typeof text === 'string') {\n text = [text];\n }\n\n let audio_inputs;\n if (audio) {\n audio_inputs = await this.feature_extractor(audio, options);\n\n text = text.map(prompt => prompt.replaceAll(this.audio_token, this.full_audio_sequence));\n }\n let image_inputs;\n if (images) {\n image_inputs = await this.image_processor(images, options);\n text = text.map(prompt => prompt.replaceAll(this.image_token, this.full_image_sequence));\n }\n\n let text_inputs = this.tokenizer(text, options);\n return {\n ...text_inputs,\n ...image_inputs,\n ...audio_inputs,\n }\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class GLPNFeatureExtractor extends ImageProcessor { }\n","\nimport { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\nimport { ones } from '../../utils/tensor.js';\n\n\n/**\n * @typedef {object} GroundingDinoFeatureExtractorResultProps\n * @property {import('../../utils/tensor.js').Tensor} pixel_mask\n * @typedef {import('../../base/image_processors_utils.js').ImageProcessorResult & GroundingDinoFeatureExtractorResultProps} GroundingDinoFeatureExtractorResult\n */\n\nexport class GroundingDinoImageProcessor extends ImageProcessor {\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 {import('../../utils/image.js').RawImage[]} images The image(s) to extract features from.\n * @returns {Promise<GroundingDinoFeatureExtractorResult>} 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 const dims = result.pixel_values.dims;\n const pixel_mask = ones([dims[0], dims[2], dims[3]]);\n\n return { ...result, pixel_mask };\n }\n}\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { center_to_corners_format } from \"../../base/image_processors_utils.js\";\n\n/**\n * Get token ids of phrases from posmaps and input_ids.\n * @param {import('../../utils/tensor.js').Tensor} posmaps A boolean tensor of unbatched text-thresholded logits related to the detected bounding boxes of shape `(hidden_size, )`.\n * @param {import('../../utils/tensor.js').Tensor} input_ids A tensor of token ids of shape `(sequence_length, )`.\n */\nfunction get_phrases_from_posmap(posmaps, input_ids) {\n\n const left_idx = 0;\n const right_idx = posmaps.dims.at(-1) - 1;\n\n const posmaps_list = posmaps.tolist();\n posmaps_list.fill(false, 0, left_idx + 1);\n posmaps_list.fill(false, right_idx);\n\n const input_ids_list = input_ids.tolist();\n return posmaps_list\n .map((val, idx) => val ? idx : null)\n .filter(idx => idx !== null)\n .map(i => input_ids_list[i]);\n}\n\nexport class GroundingDinoProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n\n /**\n * @typedef {import('../../utils/image.js').RawImage} RawImage\n */\n /**\n * \n * @param {RawImage|RawImage[]|RawImage[][]} images \n * @param {string|string[]} text \n * @returns {Promise<any>}\n */\n async _call(images, text, options = {}) {\n\n const image_inputs = images ? await this.image_processor(images, options) : {};\n const text_inputs = text ? this.tokenizer(text, options) : {};\n\n return {\n ...text_inputs,\n ...image_inputs,\n }\n }\n post_process_grounded_object_detection(outputs, input_ids, {\n box_threshold = 0.25,\n text_threshold = 0.25,\n target_sizes = null\n } = {}) {\n const { logits, pred_boxes } = outputs;\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 const num_queries = logits.dims.at(1);\n\n const probs = logits.sigmoid(); // (batch_size, num_queries, 256)\n const scores = probs.max(-1).tolist(); // (batch_size, num_queries)\n\n // Convert to [x0, y0, x1, y1] format\n const boxes = pred_boxes.tolist() // (batch_size, num_queries, 4)\n .map(batch => batch.map(box => center_to_corners_format(box)));\n\n const results = [];\n for (let i = 0; i < batch_size; ++i) {\n const target_size = target_sizes !== null ? target_sizes[i] : null;\n\n // Convert from relative [0, 1] to absolute [0, height] coordinates\n if (target_size !== null) {\n boxes[i] = boxes[i].map(box => box.map((x, j) => x * target_size[(j + 1) % 2]));\n }\n\n const batch_scores = scores[i];\n const final_scores = [];\n const final_phrases = [];\n const final_boxes = [];\n for (let j = 0; j < num_queries; ++j) {\n const score = batch_scores[j];\n if (score <= box_threshold) {\n continue;\n }\n const box = boxes[i][j];\n const prob = probs[i][j];\n\n final_scores.push(score);\n final_boxes.push(box);\n\n const phrases = get_phrases_from_posmap(prob.gt(text_threshold), input_ids[i]);\n final_phrases.push(phrases);\n }\n results.push({ scores: final_scores, boxes: final_boxes, labels: this.batch_decode(final_phrases) });\n }\n return results;\n }\n}\n","\n\nimport {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\nimport { cat, full, interpolate_4d, slice, stack } from \"../../utils/tensor.js\";\n\nexport class Idefics3ImageProcessor extends ImageProcessor {\n constructor(config) {\n super(config);\n\n this.do_image_splitting = config.do_image_splitting ?? true;\n this.max_image_size = config.max_image_size;\n }\n\n /**\n * @typedef {import('../../utils/image.js').RawImage} RawImage\n * @typedef {import('../../utils/tensor.js').Tensor} Tensor\n */\n\n /**\n * Calculate size to resize images to, to be multiples of `vision_encoder_max_size` while preserving the aspect ratio.\n * @param {Tensor} pixel_values Tensor of the image to resize.\n * @param {number} vision_encoder_max_size Maximum size of the output image. If the image is larger than this size,\n * it will be split into patches of this size, and the original image will be concatenated with the patches, resized to max_size.\n */\n get_resize_for_vision_encoder(pixel_values, vision_encoder_max_size) {\n let [height, width] = pixel_values.dims.slice(-2);\n\n const aspect_ratio = width / height;\n if (width >= height) {\n width = Math.ceil(width / vision_encoder_max_size) * vision_encoder_max_size;\n height = Math.floor(width / aspect_ratio);\n height = Math.ceil(height / vision_encoder_max_size) * vision_encoder_max_size;\n } else {\n height = Math.ceil(height / vision_encoder_max_size) * vision_encoder_max_size;\n width = Math.floor(height * aspect_ratio);\n width = Math.ceil(width / vision_encoder_max_size) * vision_encoder_max_size;\n }\n return { height, width };\n }\n\n /** @param {RawImage|RawImage[]|RawImage[][]} images */\n async _call(images, {\n do_image_splitting = null,\n return_row_col_info = false,\n } = {}) {\n\n /** @type {RawImage[][]} */\n let batched_2d_images;\n if (!Array.isArray(images)) {\n batched_2d_images = [[images]];\n } else {\n if (images.length === 0 || !images[0]) {\n throw new Error(\"No images provided.\");\n }\n if (!Array.isArray(images[0])) {\n batched_2d_images = [/** @type {RawImage[]} */(images)];\n } else {\n batched_2d_images = /** @type {RawImage[][]} */(images);\n }\n }\n\n // List of tensors, each with shape [patches, channels, height, width]\n let all_pixel_values = [];\n let images_list_rows = [];\n let images_list_cols = [];\n\n const original_sizes = [];\n const reshaped_input_sizes = [];\n for (const image_batch of batched_2d_images) {\n\n let images_list = await Promise.all(image_batch.map(x => this.preprocess(x)));\n\n // Original sizes of images\n original_sizes.push(...images_list.map(x => x.original_size));\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes.push(...images_list.map(x => x.reshaped_input_size));\n\n // Convert images to 4D tensors for easier processing\n images_list.forEach(x => x.pixel_values.unsqueeze_(0));\n\n const { longest_edge } = this.max_image_size;\n\n /** @type {Tensor[]} */\n let images_tensor;\n if (do_image_splitting ?? this.do_image_splitting) {\n let image_rows = new Array(images_list.length);\n let image_cols = new Array(images_list.length);\n\n // We first resize both height and width of each image to the nearest max_image_size multiple, disregarding the aspect ratio\n images_tensor = await Promise.all(images_list.map(async (x, i) => {\n const new_size = this.get_resize_for_vision_encoder(x.pixel_values, longest_edge);\n\n const resized = await interpolate_4d(x.pixel_values, {\n size: [new_size.height, new_size.width],\n });\n\n const { frames, num_splits_h, num_splits_w } = await this.split_image(resized, this.max_image_size);\n image_rows[i] = num_splits_h;\n image_cols[i] = num_splits_w;\n return cat(frames, 0);\n }));\n\n images_list_rows.push(image_rows);\n images_list_cols.push(image_cols);\n\n } else {\n /** @type {[number, number]} */\n const size = [longest_edge, longest_edge];\n images_tensor = await Promise.all(\n images_list.map(x => interpolate_4d(x.pixel_values, { size }))\n );\n\n images_list_rows.push(new Array(images_list.length).fill(0));\n images_list_cols.push(new Array(images_list.length).fill(0));\n }\n\n all_pixel_values.push(cat(images_tensor, 0));\n }\n\n const batch_size = all_pixel_values.length;\n const [n, c, h, w] = all_pixel_values[0].dims;\n\n // Stack pixel values\n let pixel_values;\n let pixel_attention_mask;\n if (batch_size === 1) {\n pixel_values = all_pixel_values[0].unsqueeze_(0);\n pixel_attention_mask = full([batch_size, n, h, w], true);\n } else {\n // Add padding (if necessary) to images with less patches than the maximum number of patches\n const max_num_patches = Math.max(...all_pixel_values.map(x => x.dims.at(0)));\n\n pixel_attention_mask = full([batch_size, max_num_patches, h, w], true);\n const pixel_attention_mask_data = pixel_attention_mask.data;\n const pixel_attention_mask_stride = max_num_patches * h * w;\n for (let i = 0; i < batch_size; ++i) {\n const num_patches = all_pixel_values[i].dims[0];\n if (num_patches < max_num_patches) {\n all_pixel_values[i] = cat([\n all_pixel_values[i],\n full([max_num_patches - num_patches, c, h, w], 0),\n ], 0);\n\n const start_offset = i * pixel_attention_mask_stride + num_patches * h * w;\n const end_offset = (i + 1) * pixel_attention_mask_stride;\n\n // @ts-ignore\n pixel_attention_mask_data.fill(false, start_offset, end_offset);\n }\n }\n pixel_values = stack(all_pixel_values, 0);\n }\n\n return {\n pixel_values,\n pixel_attention_mask,\n\n original_sizes,\n reshaped_input_sizes,\n ...(\n return_row_col_info\n ? { rows: images_list_rows, cols: images_list_cols }\n : {}\n ),\n }\n }\n\n async split_image(pixel_values, { longest_edge }) {\n const max_height = longest_edge;\n const max_width = longest_edge;\n\n const frames = [];\n\n const [height, width] = pixel_values.dims.slice(-2);\n\n let num_splits_h = 0, num_splits_w = 0;\n\n if (height > max_height || width > max_width) {\n // Calculate the number of splits\n num_splits_h = Math.ceil(height / max_height);\n num_splits_w = Math.ceil(width / max_width);\n\n // Calculate the optimal width and height for the sub-images\n const optimal_height = Math.ceil(height / num_splits_h);\n const optimal_width = Math.ceil(width / num_splits_w);\n\n // Iterate through each row and column\n for (let r = 0; r < num_splits_h; ++r) {\n for (let c = 0; c < num_splits_w; ++c) {\n let start_x, start_y, end_x, end_y;\n if (r === num_splits_h - 1) { // At bottom\n start_y = height - optimal_height;\n end_y = height;\n } else {\n start_y = r * optimal_height;\n end_y = (r + 1) * optimal_height;\n }\n if (c === num_splits_w - 1) { // At right\n start_x = width - optimal_width;\n end_x = width;\n } else {\n start_x = c * optimal_width;\n end_x = (c + 1) * optimal_width;\n }\n\n const starts = [start_y, start_x];\n const ends = [end_y, end_x];\n\n const patch = await slice(pixel_values, starts, ends, [2, 3]);\n frames.push(patch);\n }\n }\n\n // Resize the global image to match max dimensions for memory efficiency\n const global_image_height = max_height;\n const global_image_width = max_width;\n\n if (height !== global_image_height || width !== global_image_width) {\n pixel_values = await interpolate_4d(pixel_values, {\n size: [global_image_height, global_image_width],\n })\n }\n }\n\n frames.push(pixel_values);\n\n return { frames, num_splits_h, num_splits_w };\n }\n}\n","\nimport { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { RawImage } from \"../../utils/image.js\";\nimport { count } from \"../../utils/core.js\";\n\n/**\n * Prompt with expanded image tokens for when the image is split into patches.\n * @private\n */\nfunction _prompt_split_image(image_seq_len, image_rows, image_cols, fake_token_around_image, image_token, global_img_token) {\n let text_split_images = \"\";\n for (let n_h = 0; n_h < image_rows; ++n_h) {\n for (let n_w = 0; n_w < image_cols; ++n_w) {\n text_split_images += (\n fake_token_around_image +\n `<row_${n_h + 1}_col_${n_w + 1}>` +\n image_token.repeat(image_seq_len)\n );\n }\n text_split_images += \"\\n\";\n }\n\n text_split_images += (\n `\\n${fake_token_around_image}` +\n `${global_img_token}` +\n image_token.repeat(image_seq_len) +\n `${fake_token_around_image}`\n );\n return text_split_images;\n}\n\n/**\n * Prompt with expanded image tokens for a single image.\n * @private\n */\nfunction _prompt_single_image(image_seq_len, fake_token_around_image, image_token, global_img_token) {\n return (\n `${fake_token_around_image}` +\n `${global_img_token}` +\n image_token.repeat(image_seq_len) +\n `${fake_token_around_image}`\n );\n}\n\nfunction get_image_prompt_string(image_rows, image_cols, image_seq_len, fake_token_around_image, image_token, global_img_token) {\n if (image_rows === 0 && image_cols === 0) {\n return _prompt_single_image(\n image_seq_len,\n fake_token_around_image,\n image_token,\n global_img_token\n );\n }\n return _prompt_split_image(\n image_seq_len, image_rows, image_cols, fake_token_around_image, image_token, global_img_token\n );\n}\n\n\nexport class Idefics3Processor extends Processor {\n static image_processor_class = AutoImageProcessor\n static tokenizer_class = AutoTokenizer\n static uses_processor_config = true;\n\n fake_image_token = \"<fake_token_around_image>\";\n image_token = \"<image>\";\n global_img_token = \"<global-img>\";\n\n /**\n * \n * @param {string|string[]} text \n * @param {RawImage|RawImage[]|RawImage[][]} images \n * @returns {Promise<any>}\n */\n async _call(text, images = null, options = {}) {\n options.return_row_col_info ??= true;\n\n let image_inputs;\n\n if (images) {\n image_inputs = await this.image_processor(images, options);\n }\n\n // NOTE: We assume text is present\n if (!Array.isArray(text)) {\n text = [text];\n }\n\n const image_rows = image_inputs.rows ?? [new Array(text.length).fill(0)];\n const image_cols = image_inputs.cols ?? [new Array(text.length).fill(0)];\n\n const image_seq_len = this.config.image_seq_len;\n const n_images_in_text = []\n const prompt_strings = [];\n for (let i = 0; i < text.length; ++i) {\n const sample = text[i];\n const sample_rows = image_rows[i];\n const sample_cols = image_cols[i];\n\n n_images_in_text.push(count(sample, this.image_token));\n\n // Replace the image token with fake tokens around the expanded image token sequence of length `image_seq_len`\n const image_prompt_strings = sample_rows.map(\n (n_rows, j) => get_image_prompt_string(\n n_rows,\n sample_cols[j],\n image_seq_len,\n this.fake_image_token,\n this.image_token,\n this.global_img_token,\n )\n );\n\n const split_sample = sample.split(this.image_token);\n if (split_sample.length === 0) {\n throw new Error(\"The image token should be present in the text.\");\n }\n\n // Place in the image prompt strings where the image tokens are\n let new_sample = split_sample[0];\n for (let j = 0; j < image_prompt_strings.length; ++j) {\n new_sample += image_prompt_strings[j] + split_sample[j + 1];\n }\n prompt_strings.push(new_sample);\n }\n\n const text_inputs = this.tokenizer(prompt_strings);\n\n return {\n ...text_inputs,\n ...image_inputs,\n }\n }\n}\n","\nexport * from './beit/image_processing_beit.js'\nexport * from './bit/image_processing_bit.js'\nexport * from './chinese_clip/image_processing_chinese_clip.js'\nexport * from './clip/image_processing_clip.js'\nexport * from './convnext/image_processing_convnext.js'\nexport * from './deit/image_processing_deit.js'\nexport * from './detr/image_processing_detr.js'\nexport * from './dinov3_vit/image_processing_dinov3_vit.js'\nexport * from './donut/image_processing_donut.js'\nexport * from './dpt/image_processing_dpt.js'\nexport * from './efficientnet/image_processing_efficientnet.js'\nexport * from './glpn/image_processing_glpn.js'\nexport * from './grounding_dino/image_processing_grounding_dino.js'\nexport * from './idefics3/image_processing_idefics3.js'\nexport * from './janus/image_processing_janus.js'\nexport * from './jina_clip/image_processing_jina_clip.js'\nexport * from './llava_onevision/image_processing_llava_onevision.js'\nexport * from './mask2former/image_processing_mask2former.js'\nexport * from './maskformer/image_processing_maskformer.js'\nexport * from './mobilenet_v1/image_processing_mobilenet_v1.js'\nexport * from './mobilenet_v2/image_processing_mobilenet_v2.js'\nexport * from './mobilenet_v3/image_processing_mobilenet_v3.js'\nexport * from './mobilenet_v4/image_processing_mobilenet_v4.js'\nexport * from './mobilevit/image_processing_mobilevit.js'\nexport * from './nougat/image_processing_nougat.js'\nexport * from './owlv2/image_processing_owlv2.js'\nexport * from './owlvit/image_processing_owlvit.js'\nexport * from './phi3_v/image_processing_phi3_v.js'\nexport * from './pixtral/image_processing_pixtral.js'\nexport * from './pvt/image_processing_pvt.js'\nexport * from './qwen2_vl/image_processing_qwen2_vl.js'\nexport * from './rt_detr/image_processing_rt_detr.js'\nexport * from './sam/image_processing_sam.js'\nexport * from './sam2/image_processing_sam2.js'\nexport * from './sam3/image_processing_sam3.js'\nexport * from './segformer/image_processing_segformer.js'\nexport * from './siglip/image_processing_siglip.js'\nexport * from './smolvlm/image_processing_smolvlm.js'\nexport * from './swin2sr/image_processing_swin2sr.js'\nexport * from './vit/image_processing_vit.js'\nexport * from './vitmatte/image_processing_vitmatte.js'\nexport * from './vitpose/image_processing_vitpose.js'\nexport * from './yolos/image_processing_yolos.js'\n","\nimport {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class VLMImageProcessor extends ImageProcessor {\n constructor(config) {\n super({\n do_pad: true,\n pad_size: {\n width: config.image_size,\n height: config.image_size,\n },\n ...config,\n });\n // @ts-expect-error TS2339\n this.constant_values = this.config.background_color.map(x => x * this.rescale_factor)\n }\n\n pad_image(pixelData, imgDims, padSize, options) {\n return super.pad_image(pixelData, imgDims, padSize, {\n constant_values: this.constant_values,\n center: true,\n ...options,\n });\n }\n}\n","\nimport { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { mergeArrays } from \"../../utils/core.js\";\nimport { Tensor } from \"../../utils/tensor.js\";\nimport { RawImage } from \"../../utils/image.js\";\n\nexport class VLChatProcessor extends Processor {\n static image_processor_class = AutoImageProcessor\n static tokenizer_class = AutoTokenizer\n static uses_processor_config = true;\n\n constructor(config, components, chat_template) {\n super(config, components, chat_template);\n\n this.image_tag = this.config.image_tag;\n this.image_start_tag = this.config.image_start_tag;\n this.image_end_tag = this.config.image_end_tag;\n this.num_image_tokens = this.config.num_image_tokens;\n }\n\n /**\n * @typedef {Object} MultimodalMessageProperties Additional properties for multimodal messages.\n * @property {(RawImage | string | URL)[]} [images] The images in the message.\n * @typedef {(import('../../tokenizers.js').Message & MultimodalMessageProperties)[]} MultimodalConversation The conversation possibly containing multimodal inputs.\n */\n\n /**\n * @typedef {Object} VLCChatProcessorResult The processed input.\n * @property {Tensor} input_ids The input IDs.\n * @property {Tensor} attention_mask The attention mask.\n * @property {Tensor} images_seq_mask The image sequence mask.\n * @property {Tensor} images_emb_mask The image embedding mask.\n */\n\n /**\n * @param {MultimodalConversation} conversation The chat messages to process.\n * @param {Object} options Additional options for processing.\n * @param {RawImage|RawImage[]} [options.images] The images to process, if not set in the conversation.\n * @param {string} [options.chat_template=\"default\"] The chat template to use.\n * @returns {Promise<VLCChatProcessorResult | VLCChatProcessorResult & import('../../base/image_processors_utils.js').ImageProcessorResult>} The processed input.\n */\n async _call(conversation, {\n images = null,\n chat_template = \"default\",\n }={}) {\n if (!images) {\n images = await Promise.all(\n conversation\n .filter((msg) => msg.images)\n .flatMap((msg) => msg.images)\n .map((img) => RawImage.read(img))\n );\n } else if (!Array.isArray(images)) {\n images = [images];\n }\n\n const tokenizer = this.tokenizer;\n const result = tokenizer.apply_chat_template(conversation, {\n tokenize: false,\n add_generation_prompt: true,\n chat_template,\n });\n\n const encode = (text) => tokenizer.encode(text, { add_special_tokens: false });\n const parts = (/** @type {string} */(result))\n .split(this.image_tag);\n const num_images = parts.length - 1;\n if (images.length !== num_images) {\n throw new Error(`Number of images provided (${images.length}) does not match number of \"${this.image_tag}\" image tags (${num_images})`);\n }\n\n const [\n image_placeholder_tag_id,\n image_start_tag_id,\n image_end_tag_id,\n ] = tokenizer.model.convert_tokens_to_ids([\n this.image_tag,\n this.image_start_tag,\n this.image_end_tag,\n ]);\n\n let input_ids = encode(parts[0]);\n let images_seq_mask = new Array(input_ids.length).fill(false);\n for (let i = 1; i < parts.length; ++i) {\n const placeholder_image_tokens = new Array(this.num_image_tokens).fill(image_placeholder_tag_id);\n const tokens = encode(parts[i]);\n input_ids = mergeArrays(\n input_ids,\n [image_start_tag_id], placeholder_image_tokens, [image_end_tag_id],\n tokens,\n );\n const image_mask = new Array(this.num_image_tokens).fill(true);\n images_seq_mask = mergeArrays(\n images_seq_mask,\n [false], image_mask, [false],\n new Array(tokens.length).fill(false),\n );\n }\n\n const dims = [1, input_ids.length];\n const final = {\n input_ids: new Tensor('int64', input_ids, dims),\n attention_mask: new Tensor('int64', new Array(input_ids.length).fill(1), dims),\n images_seq_mask: new Tensor('bool', images_seq_mask, dims),\n images_emb_mask: new Tensor(\n 'bool',\n new Array(num_images * this.num_image_tokens).fill(true),\n [1, num_images, this.num_image_tokens],\n ),\n }\n\n if (images && images.length > 0) {\n const image_inputs = await this.image_processor(images);\n // Set the batch_size dimension to 1\n image_inputs.pixel_values.unsqueeze_(0);\n return { ...final, ...image_inputs };\n }\n\n return final;\n }\n}\n","import {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class JinaCLIPImageProcessor extends ImageProcessor {\n constructor(config) {\n // JinaCLIPImageProcessor uses a custom preprocessor_config.json, so we configure it here\n const { resize_mode, fill_color, interpolation, size, ...other } = config;\n\n const new_size = resize_mode === 'squash'\n ? { width: size, height: size }\n : resize_mode === 'shortest'\n ? { shortest_edge: size }\n : { longest_edge: size };\n\n const resample = interpolation === 'bicubic' ? 3 : 2;\n super({\n ...other,\n size: new_size,\n resample,\n do_center_crop: true,\n crop_size: size,\n do_normalize: true,\n });\n }\n}\n","\nimport { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\n\nexport class JinaCLIPProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n\n async _call(text=null, images=null, kwargs = {}) {\n\n if (!text && !images){\n throw new Error('Either text or images must be provided');\n }\n\n const text_inputs = text ? this.tokenizer(text, kwargs) : {};\n const image_inputs = images ? await this.image_processor(images, kwargs) : {};\n\n return {\n ...text_inputs,\n ...image_inputs,\n }\n }\n}\n","\nimport { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\n\nexport class LlavaProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n static uses_processor_config = true;\n\n /**\n * @typedef {import('../../utils/image.js').RawImage} RawImage\n */\n\n // `images` is required, `text` is optional\n async _call(/** @type {RawImage|RawImage[]} */ images, text = null, kwargs = {}) {\n \n const image_inputs = await this.image_processor(images, kwargs);\n\n if (text) {\n const [height, width] = image_inputs.pixel_values.dims.slice(-2);\n\n const {image_token, patch_size, num_additional_image_tokens} = this.config;\n const num_image_tokens = Math.floor(\n height / patch_size\n ) * Math.floor(width / patch_size) + num_additional_image_tokens;\n\n text = structuredClone(text); // Avoid modifying the original text input\n if (!Array.isArray(text)) {\n text = [text];\n }\n for (let i = 0; i < text.length; ++i) {\n text[i] = text[i].replace(image_token, image_token.repeat(num_image_tokens));\n }\n }\n \n const text_inputs = text ? this.tokenizer(text, kwargs) : {};\n\n return {\n ...image_inputs,\n ...text_inputs,\n }\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class LlavaOnevisionImageProcessor extends ImageProcessor {}\n","\nimport { MaskFormerImageProcessor } from \"../maskformer/image_processing_maskformer.js\";\n\n// NOTE: extends MaskFormerImageProcessor\nexport class Mask2FormerImageProcessor extends MaskFormerImageProcessor { }\n","import { \n ImageProcessor,\n post_process_panoptic_segmentation,\n post_process_instance_segmentation,\n} from \"../../base/image_processors_utils.js\";\n\nexport class MaskFormerImageProcessor extends ImageProcessor {\n\n /** @type {typeof post_process_panoptic_segmentation} */\n post_process_panoptic_segmentation(...args) {\n return post_process_panoptic_segmentation(...args);\n }\n /** @type {typeof post_process_instance_segmentation} */\n post_process_instance_segmentation(...args) {\n return post_process_instance_segmentation(...args);\n }\n}\nexport class MaskFormerFeatureExtractor extends MaskFormerImageProcessor { }\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { max, softmax } from \"../../utils/maths.js\";\n\nconst DECODE_TYPE_MAPPING = {\n 'char': ['char_decode', 1],\n 'bpe': ['bpe_decode', 2],\n 'wp': ['wp_decode', 102],\n}\nexport class MgpstrProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n\n /**\n * @returns {import('../../tokenizers.js').MgpstrTokenizer} The character tokenizer.\n */\n get char_tokenizer() {\n return this.components.char_tokenizer;\n }\n\n /**\n * @returns {import('../../tokenizers.js').GPT2Tokenizer} The BPE tokenizer.\n */\n get bpe_tokenizer() {\n return this.components.bpe_tokenizer;\n }\n\n /**\n * @returns {import('../../tokenizers.js').BertTokenizer} The WordPiece tokenizer.\n */\n get wp_tokenizer() {\n return this.components.wp_tokenizer;\n }\n\n /**\n * Helper function to decode the model prediction logits.\n * @param {import('../../utils/tensor.js').Tensor} pred_logits Model prediction logits.\n * @param {string} format Type of model prediction. Must be one of ['char', 'bpe', 'wp'].\n * @returns {[string[], number[]]} The decoded sentences and their confidence scores.\n */\n _decode_helper(pred_logits, format) {\n if (!DECODE_TYPE_MAPPING.hasOwnProperty(format)) {\n throw new Error(`Format ${format} is not supported.`);\n }\n\n const [decoder_name, eos_token] = DECODE_TYPE_MAPPING[format];\n const decoder = this[decoder_name].bind(this);\n\n const [batch_size, batch_max_length] = pred_logits.dims;\n const conf_scores = [];\n const all_ids = [];\n\n /** @type {number[][][]} */\n const pred_logits_list = pred_logits.tolist();\n for (let i = 0; i < batch_size; ++i) {\n const logits = pred_logits_list[i];\n const ids = [];\n const scores = [];\n\n // Start and index=1 to skip the first token\n for (let j = 1; j < batch_max_length; ++j) {\n // NOTE: == to match bigint and number\n const [max_prob, max_prob_index] = max(softmax(logits[j]));\n scores.push(max_prob);\n if (max_prob_index == eos_token) {\n break;\n }\n ids.push(max_prob_index);\n }\n\n const confidence_score = scores.length > 0\n ? scores.reduce((a, b) => a * b, 1)\n : 0;\n\n all_ids.push(ids);\n conf_scores.push(confidence_score);\n }\n\n const decoded = decoder(all_ids);\n return [decoded, conf_scores];\n }\n\n /**\n * Convert a list of lists of char token ids into a list of strings by calling char tokenizer.\n * @param {number[][]} sequences List of tokenized input ids.\n * @returns {string[]} The list of char decoded sentences.\n */\n char_decode(sequences) {\n return this.char_tokenizer.batch_decode(sequences).map(str => str.replaceAll(' ', ''));\n }\n\n /**\n * Convert a list of lists of BPE token ids into a list of strings by calling BPE tokenizer.\n * @param {number[][]} sequences List of tokenized input ids.\n * @returns {string[]} The list of BPE decoded sentences.\n */\n bpe_decode(sequences) {\n return this.bpe_tokenizer.batch_decode(sequences)\n }\n\n /**\n * Convert a list of lists of word piece token ids into a list of strings by calling word piece tokenizer.\n * @param {number[][]} sequences List of tokenized input ids.\n * @returns {string[]} The list of wp decoded sentences.\n */\n wp_decode(sequences) {\n return this.wp_tokenizer.batch_decode(sequences).map(str => str.replaceAll(' ', ''));\n }\n\n /**\n * Convert a list of lists of token ids into a list of strings by calling decode.\n * @param {[import('../../utils/tensor.js').Tensor, import('../../utils/tensor.js').Tensor, import('../../utils/tensor.js').Tensor]} sequences List of tokenized input ids.\n * @returns {{generated_text: string[], scores: number[], char_preds: string[], bpe_preds: string[], wp_preds: string[]}}\n * Dictionary of all the outputs of the decoded results.\n * - generated_text: The final results after fusion of char, bpe, and wp.\n * - scores: The final scores after fusion of char, bpe, and wp.\n * - char_preds: The list of character decoded sentences.\n * - bpe_preds: The list of BPE decoded sentences.\n * - wp_preds: The list of wp decoded sentences.\n */\n // @ts-expect-error The type of this method is not compatible with the one in the base class.\n batch_decode([char_logits, bpe_logits, wp_logits]) {\n const [char_preds, char_scores] = this._decode_helper(char_logits, 'char');\n const [bpe_preds, bpe_scores] = this._decode_helper(bpe_logits, 'bpe');\n const [wp_preds, wp_scores] = this._decode_helper(wp_logits, 'wp');\n\n const generated_text = [];\n const scores = [];\n for (let i = 0; i < char_preds.length; ++i) {\n const [max_score, max_score_index] = max([char_scores[i], bpe_scores[i], wp_scores[i]]);\n generated_text.push([char_preds[i], bpe_preds[i], wp_preds[i]][max_score_index]);\n scores.push(max_score);\n }\n\n return {\n generated_text,\n scores,\n char_preds,\n bpe_preds,\n wp_preds,\n }\n }\n /** @type {typeof Processor.from_pretrained} */\n static async from_pretrained(...args) {\n const base = await super.from_pretrained(...args);\n\n // Load Transformers.js-compatible versions of the BPE and WordPiece tokenizers\n const bpe_tokenizer = await AutoTokenizer.from_pretrained(\"Xenova/gpt2\") // openai-community/gpt2\n const wp_tokenizer = await AutoTokenizer.from_pretrained(\"Xenova/bert-base-uncased\") // google-bert/bert-base-uncased\n\n // Update components\n base.components = {\n image_processor: base.image_processor,\n char_tokenizer: base.tokenizer,\n bpe_tokenizer: bpe_tokenizer,\n wp_tokenizer: wp_tokenizer,\n }\n return base;\n }\n\n async _call(images, text = null) {\n const result = await this.image_processor(images);\n\n if (text) {\n result.labels = this.tokenizer(text).input_ids\n }\n\n return result;\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\n\nexport class MobileNetV1ImageProcessor extends ImageProcessor { }\nexport class MobileNetV1FeatureExtractor extends MobileNetV1ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\n\nexport class MobileNetV2ImageProcessor extends ImageProcessor { }\nexport class MobileNetV2FeatureExtractor extends MobileNetV2ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\n\nexport class MobileNetV3ImageProcessor extends ImageProcessor { }\nexport class MobileNetV3FeatureExtractor extends MobileNetV3ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\n\nexport class MobileNetV4ImageProcessor extends ImageProcessor { }\nexport class MobileNetV4FeatureExtractor extends MobileNetV4ImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class MobileViTImageProcessor extends ImageProcessor { }\nexport class MobileViTFeatureExtractor extends MobileViTImageProcessor { }\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\n\n\nexport class MoonshineFeatureExtractor extends FeatureExtractor {\n /**\n * Asynchronously extracts input values 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; }>} The extracted input values.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'MoonshineFeatureExtractor');\n\n if (audio instanceof Float64Array) {\n audio = new Float32Array(audio);\n }\n\n const shape = [\n 1, /* batch_size */\n audio.length, /* num_samples */\n ];\n return {\n input_values: new Tensor('float32', audio, shape),\n };\n }\n}\n","import { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\"\nimport { AutoTokenizer } from \"../../tokenizers.js\"\nimport { Processor } from \"../../base/processing_utils.js\"\n\n/**\n * Represents a MoonshineProcessor that extracts features from an audio input.\n */\nexport class MoonshineProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n\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<any>} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio);\n }\n}\n","\nimport { DonutImageProcessor } from \"../donut/image_processing_donut.js\";\n\n// NOTE: extends DonutImageProcessor\nexport class NougatImageProcessor extends DonutImageProcessor { }\n","\nimport { OwlViTImageProcessor } from \"../owlvit/image_processing_owlvit.js\";\n\n// NOTE: extends OwlViTImageProcessor\nexport class Owlv2ImageProcessor extends OwlViTImageProcessor { }\n","import { \n ImageProcessor,\n post_process_object_detection,\n} from \"../../base/image_processors_utils.js\";\n\nexport class OwlViTImageProcessor extends ImageProcessor {\n /** @type {typeof post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\nexport class OwlViTFeatureExtractor extends OwlViTImageProcessor { }\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nexport class OwlViTProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n}\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\n\nconst IMAGE_TOKEN = \"<image>\";\n\nfunction build_string_from_input(\n prompt,\n bos_token,\n image_seq_len,\n image_token,\n num_images,\n) {\n return `${image_token.repeat(image_seq_len * num_images)}${bos_token}${prompt}\\n`\n}\n\nexport class PaliGemmaProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n static uses_processor_config = false;\n\n /**\n * @typedef {import('../../utils/image.js').RawImage} RawImage\n */\n\n // `images` is required, `text` is optional\n async _call(/** @type {RawImage|RawImage[]} */ images, text = null, kwargs = {}) {\n if (!text) {\n console.warn(\n \"You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.\"\n )\n text = \"\"\n }\n\n if (!Array.isArray(images)) {\n images = [images]\n }\n\n if (!Array.isArray(text)) {\n text = [text]\n }\n\n const bos_token = this.tokenizer.bos_token;\n // @ts-expect-error TS2339\n const image_seq_length = this.image_processor.config.image_seq_length;\n let input_strings;\n if (text.some((t) => t.includes(IMAGE_TOKEN))) {\n input_strings = text.map(\n sample => {\n const expanded_sample = sample.replaceAll(IMAGE_TOKEN, IMAGE_TOKEN.repeat(image_seq_length));\n const bos_rfind_index = expanded_sample.lastIndexOf(IMAGE_TOKEN);\n const bos_index = bos_rfind_index === -1 ? 0 : bos_rfind_index + IMAGE_TOKEN.length;\n return expanded_sample.slice(0, bos_index) + bos_token + expanded_sample.slice(bos_index) + \"\\n\";\n }\n )\n } else {\n console.warn(\n \"You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special \" +\n \"image tokens in the text, as many tokens as there are images per each text. It is recommended to \" +\n \"add `<image>` tokens in the very beginning of your text. For this call, we will infer how many images \" +\n \"each text has and add special tokens.\"\n )\n\n input_strings = text.map(\n sample => build_string_from_input(\n sample,\n bos_token,\n image_seq_length,\n IMAGE_TOKEN,\n images.length,\n )\n )\n }\n\n const text_inputs = this.tokenizer(input_strings, kwargs);\n const image_inputs = await this.image_processor(images, kwargs);\n\n return {\n ...image_inputs,\n ...text_inputs,\n }\n }\n}\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\n\nconst EPSILON = 1e-5;\n\nexport class ParakeetFeatureExtractor 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 this.config.sampling_rate / 2, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n const window = window_function(this.config.win_length, 'hann', {\n periodic: false,\n });\n\n this.window = new Float64Array(this.config.n_fft);\n const offset = Math.floor((this.config.n_fft - this.config.win_length) / 2);\n this.window.set(window, offset);\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 {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _extract_fbank_features(waveform) {\n // Parakeet uses a custom preemphasis strategy: Apply preemphasis to entire waveform at once\n const preemphasis = this.config.preemphasis;\n waveform = new Float64Array(waveform); // Clone to avoid destructive changes\n for (let j = waveform.length - 1; j >= 1; --j) {\n waveform[j] -= preemphasis * waveform[j - 1];\n }\n\n const features = await spectrogram(\n waveform,\n this.window, // window\n this.window.length, // frame_length\n this.config.hop_length, // hop_length\n {\n fft_length: this.config.n_fft,\n power: 2.0,\n mel_filters: this.config.mel_filters,\n log_mel: 'log',\n mel_floor: -Infinity,\n pad_mode: 'constant',\n center: true,\n\n // Custom\n transpose: true,\n mel_offset: 2 ** -24,\n }\n )\n\n return features;\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; attention_mask: 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, 'ParakeetFeatureExtractor');\n\n const features = await this._extract_fbank_features(audio);\n\n const features_length = Math.floor(\n (audio.length + Math.floor(this.config.n_fft / 2) * 2 - this.config.n_fft) / this.config.hop_length\n );\n\n const features_data = /** @type {Float32Array} */ (features.data);\n features_data.fill(0, features_length * features.dims[1]);\n\n // normalize mel features, ignoring padding\n const [num_frames, num_features] = features.dims;\n const sum = new Float64Array(num_features);\n const sum_sq = new Float64Array(num_features);\n\n for (let i = 0; i < features_length; ++i) {\n const offset = i * num_features;\n for (let j = 0; j < num_features; ++j) {\n const val = features_data[offset + j];\n sum[j] += val;\n sum_sq[j] += val * val;\n }\n }\n\n // Calculate mean and standard deviation, then normalize\n const divisor = features_length > 1 ? features_length - 1 : 1;\n for (let j = 0; j < num_features; ++j) {\n const mean = sum[j] / features_length;\n const variance = (sum_sq[j] - features_length * mean * mean) / divisor;\n const std = Math.sqrt(variance) + EPSILON;\n const inv_std = 1 / std;\n\n for (let i = 0; i < features_length; ++i) {\n const index = i * num_features + j;\n features_data[index] = (features_data[index] - mean) * inv_std;\n }\n }\n\n const mask_data = new BigInt64Array(num_frames);\n mask_data.fill(1n, 0, features_length);\n\n return {\n input_features: features.unsqueeze_(0),\n attention_mask: new Tensor('int64', mask_data, [1, num_frames]),\n };\n }\n}","import {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\nimport { cat, interpolate_4d, slice, stack, Tensor } from \"../../utils/tensor.js\";\n\nconst IMAGE_SIZE = 336;\nconst SLICE_AXES = [2, 3]; // axes to slice on\nconst { ceil, floor, sqrt } = Math;\n\nexport class Phi3VImageProcessor extends ImageProcessor {\n constructor(config) {\n super({\n ...config,\n do_normalize: true,\n do_pad: true,\n pad_size: 'custom',\n do_convert_rgb: true,\n do_resize: true, // Smart resizing \"hd_transform\"\n });\n\n this._num_crops = config.num_crops;\n }\n calc_num_image_tokens_from_image_size(width, height) {\n // @ts-expect-error\n const { num_img_tokens } = this.config;\n return floor(((floor((height / IMAGE_SIZE)) * floor((width / IMAGE_SIZE)) + 1) * num_img_tokens) + 1 + (floor(height / IMAGE_SIZE) + 1) * sqrt(num_img_tokens));\n }\n\n /** @type {ImageProcessor['get_resize_output_image_size']} */\n get_resize_output_image_size(image, size) {\n const hd_num = this._num_crops;\n const [width, height] = image.size\n\n let ratio = width / height;\n let scale = 1;\n\n // Calculate the scaling factor\n while (scale * Math.ceil(scale / ratio) <= hd_num) {\n scale += 1;\n }\n scale -= 1;\n\n // Compute the new dimensions\n const new_w = Math.floor(scale * 336);\n const new_h = Math.floor(new_w / ratio);\n\n return [new_w, new_h]\n }\n\n\n /** @type {ImageProcessor['pad_image']} */\n pad_image(pixelData, imgDims, padSize, options = {}) {\n // Phi3V uses a custom padding strategy:\n // - Pad to a multiple of 336\n // - Pad with white pixels\n const [imageHeight, imageWidth] = imgDims;\n const height = IMAGE_SIZE * ceil(imageHeight / IMAGE_SIZE);\n const width = IMAGE_SIZE * ceil(imageWidth / IMAGE_SIZE);\n\n // NOTE: Since padding is done after normalization, we need to fill with the normalized values\n const constant_values = [1, 1, 1].map((x, i) => (x - this.image_mean[i]) / this.image_std[i]);\n return super.pad_image(pixelData, imgDims, { width, height }, {\n center: true,\n constant_values,\n ...options,\n });\n }\n\n async _call(images, {\n num_crops = null,\n } = {}) {\n // @ts-expect-error\n this._num_crops = num_crops ??= this.config.num_crops;\n if (num_crops < 4 || sqrt(num_crops) % 1 !== 0) {\n throw new Error(\"num_crops must be a square number >= 4\");\n }\n\n if (!Array.isArray(images)) {\n images = [images];\n }\n\n const num_images = images.length;\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n\n const original_sizes = imageData.map(x => x.original_size);\n const reshaped_input_sizes = imageData.map(x => x.reshaped_input_size);\n\n // Process each image in batch\n const all_pixel_values = [];\n for (const { pixel_values } of imageData) {\n pixel_values.unsqueeze_(0); // Easier processing as 4D tensor\n\n const [height, width] = pixel_values.dims.slice(-2);\n\n // Global image (Tensor of shape [num_channels, height, width])\n const batch_pixel_values = await interpolate_4d(pixel_values, {\n size: [IMAGE_SIZE, IMAGE_SIZE],\n mode: 'bicubic',\n });\n\n if (num_crops > 0) {\n const patches = [];\n const sqrt_patches = sqrt(num_crops);\n const patch_width = floor(width / sqrt_patches);\n const patch_height = floor(height / sqrt_patches);\n for (let y = 0; y < sqrt_patches; ++y) {\n for (let x = 0; x < sqrt_patches; ++x) {\n let start_x, start_y, end_x, end_y;\n if (y === sqrt_patches - 1) { // At bottom\n start_y = height - patch_height;\n end_y = height;\n } else {\n start_y = y * patch_height;\n end_y = (y + 1) * patch_height;\n }\n if (x === sqrt_patches - 1) { // At right\n start_x = width - patch_width;\n end_x = width;\n } else {\n start_x = x * patch_width;\n end_x = (x + 1) * patch_width;\n }\n\n const starts = [start_y, start_x];\n const ends = [end_y, end_x];\n const patch = await slice(pixel_values, starts, ends, SLICE_AXES);\n patches.push(patch);\n }\n }\n\n const resized_tensors = await interpolate_4d(cat(patches, 0), {\n size: [IMAGE_SIZE, IMAGE_SIZE],\n mode: 'bicubic',\n }); // [num_crops, 3, 336, 336]\n\n // Concatenate the global image with the patches\n all_pixel_values.push(cat([batch_pixel_values, resized_tensors], 0));\n } else {\n // Only use the global image\n // NOTE: Not currently supported in modelling code\n all_pixel_values.push(batch_pixel_values);\n }\n }\n\n // [num_images, 1 + num_crops, num_channels=3, height, width]\n const pixel_values = stack(all_pixel_values, 0);\n\n // Calculate padded image sizes\n const sizes = reshaped_input_sizes.map(x => x.map(y => IMAGE_SIZE * ceil(y / IMAGE_SIZE)));\n\n const image_sizes = new Tensor(\n 'int64',\n sizes.flat(),\n [num_images, 2],\n );\n\n const num_img_tokens = sizes.map(\n ([height, width]) => this.calc_num_image_tokens_from_image_size(width, height),\n );\n\n return { pixel_values, original_sizes, reshaped_input_sizes, image_sizes, num_img_tokens };\n }\n}\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { RawImage } from \"../../utils/image.js\";\n\nconst IMAGE_TOKEN = \"<|image|>\";\nconst IMAGE_TOKEN_PATTERN = /<\\|image_\\d+\\|>/g;\n\nexport class Phi3VProcessor extends Processor {\n static image_processor_class = AutoImageProcessor\n static tokenizer_class = AutoTokenizer\n\n /**\n * \n * @param {string|string[]} text \n * @param {RawImage|RawImage[]} images \n * @param { { padding?: boolean, truncation?: boolean, num_crops?: number } | undefined } options\n * @returns {Promise<any>}\n */\n async _call(text, images = null, {\n padding = true,\n truncation = true,\n num_crops = null,\n } = {}) {\n\n if (!Array.isArray(text)) {\n text = [text];\n }\n\n let text_inputs, image_inputs;\n if (images) {\n image_inputs = await this.image_processor(images, { num_crops });\n const { num_img_tokens } = image_inputs;\n\n // The original implementation adds a bos_token before the image tokens\n // TODO: Check if this affects performance, since it looks like a bug in the original implementation\n const prompt_chunks = text.map((t, i) => t.split(IMAGE_TOKEN_PATTERN).join(IMAGE_TOKEN.repeat(num_img_tokens[i])));\n\n text_inputs = this.tokenizer(prompt_chunks, { padding, truncation });\n\n // The model expects image tokens to be negative, so we negate the image token ids\n const image_token_id = this.tokenizer.model.convert_tokens_to_ids([IMAGE_TOKEN])[0];\n text_inputs.input_ids.map_(id => (id == image_token_id) ? -id : id);\n } else {\n text_inputs = this.tokenizer(text);\n }\n\n return {\n ...text_inputs,\n ...image_inputs,\n }\n }\n}\n","import {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class PixtralImageProcessor extends ImageProcessor {\n\n /** @type {ImageProcessor['get_resize_output_image_size']} */\n get_resize_output_image_size(image, size) {\n const { longest_edge } = size;\n if (longest_edge === undefined) {\n throw new Error(\"size must contain 'longest_edge'\");\n }\n\n const [srcWidth, srcHeight] = image.size;\n\n const ratio = Math.max(srcWidth, srcHeight) / longest_edge;\n\n let newWidth = srcWidth;\n let newHeight = srcHeight;\n if (ratio > 1) {\n newWidth = Math.floor(srcWidth / ratio);\n newHeight = Math.floor(srcHeight / ratio);\n }\n\n // @ts-expect-error TS2339\n const { patch_size, spatial_merge_size } = this.config;\n if (!spatial_merge_size) {\n throw new Error(\"config must contain 'spatial_merge_size'\");\n }\n const real_patch_size = patch_size * spatial_merge_size;\n\n // Calculate number of tokens\n const num_width_tokens = Math.floor((newWidth - 1) / real_patch_size) + 1;\n const num_height_tokens = Math.floor((newHeight - 1) / real_patch_size) + 1;\n\n return [num_width_tokens * real_patch_size, num_height_tokens * real_patch_size];\n }\n}\n","\nimport { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\n\nexport class PixtralProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static image_processor_class = AutoImageProcessor\n static uses_processor_config = true;\n\n /**\n * @typedef {import('../../utils/image.js').RawImage} RawImage\n */\n\n // `images` is required, `text` is optional\n async _call(/** @type {RawImage|RawImage[]} */ images, text = null, kwargs = {}) {\n \n const image_inputs = await this.image_processor(images, kwargs);\n\n if (text) {\n const [height, width] = image_inputs.pixel_values.dims.slice(-2);\n\n const { image_token, image_break_token, image_end_token, patch_size, spatial_merge_size } = this.config;\n const real_patch_size = patch_size * spatial_merge_size;\n const num_height_tokens = Math.floor(height / real_patch_size);\n const num_width_tokens = Math.floor(width / real_patch_size);\n\n text = structuredClone(text); // Avoid modifying the original text input\n if (!Array.isArray(text)) {\n text = [text];\n }\n for (let i = 0; i < text.length; ++i) {\n const width_tokens = image_token.repeat(num_width_tokens);\n const row = width_tokens + image_break_token;\n const finalRow = width_tokens + image_end_token;\n const full = row.repeat(num_height_tokens - 1) + finalRow;\n text[i] = text[i].replace(image_token, full);\n }\n }\n \n const text_inputs = text ? this.tokenizer(text, kwargs) : {};\n\n return {\n ...image_inputs,\n ...text_inputs,\n }\n }\n}\n","export * from './florence2/processing_florence2.js';\nexport * from './gemma3n/processing_gemma3n.js';\nexport * from './grounding_dino/processing_grounding_dino.js';\nexport * from './idefics3/processing_idefics3.js';\nexport * from './janus/processing_janus.js';\nexport * from './jina_clip/processing_jina_clip.js';\nexport * from './llava/processing_llava.js';\nexport * from './mgp_str/processing_mgp_str.js';\nexport * from './moonshine/processing_moonshine.js';\nexport * from './owlvit/processing_owlvit.js';\nexport * from './paligemma/processing_paligemma.js';\nexport * from './phi3_v/processing_phi3_v.js';\nexport * from './pixtral/processing_pixtral.js';\nexport * from './pyannote/processing_pyannote.js';\nexport * from './qwen2_vl/processing_qwen2_vl.js';\nexport * from './sam/processing_sam.js';\nexport * from './sam2/processing_sam2.js';\nexport * from './smolvlm/processing_smolvlm.js';\nexport * from './speecht5/processing_speecht5.js';\nexport * from './ultravox/processing_ultravox.js';\nexport * from './voxtral/processing_voxtral.js';\nexport * from './wav2vec2/processing_wav2vec2.js';\nexport * from './wav2vec2_with_lm/processing_wav2vec2_with_lm.js';\nexport * from './whisper/processing_whisper.js';\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class PvtImageProcessor extends ImageProcessor { }\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { max, softmax } from '../../utils/maths.js';\n\n\nexport class PyAnnoteFeatureExtractor extends FeatureExtractor {\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; }>} The extracted input features.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'PyAnnoteFeatureExtractor');\n\n if (audio instanceof Float64Array) {\n audio = new Float32Array(audio);\n }\n\n const shape = [\n 1, /* batch_size */\n 1, /* num_channels */\n audio.length, /* num_samples */\n ];\n return {\n input_values: new Tensor('float32', audio, shape),\n };\n }\n\n /**\n * NOTE: Can return fractional values. `Math.ceil` will ensure correct value.\n * @param {number} samples The number of frames in the audio.\n * @returns {number} The number of frames in the audio.\n */\n samples_to_frames(samples) {\n return ((samples - this.config.offset) / this.config.step);\n }\n\n /**\n * Post-processes the speaker diarization logits output by the model.\n * @param {import('../../utils/tensor.js').Tensor} logits The speaker diarization logits output by the model.\n * @param {number} num_samples Number of samples in the input audio.\n * @returns {Array<Array<{ id: number, start: number, end: number, confidence: number }>>} The post-processed speaker diarization results.\n */\n post_process_speaker_diarization(logits, num_samples) {\n const ratio = (\n num_samples / this.samples_to_frames(num_samples)\n ) / this.config.sampling_rate;\n\n const results = [];\n for (const scores of logits.tolist()) {\n const accumulated_segments = [];\n\n let current_speaker = -1;\n for (let i = 0; i < scores.length; ++i) {\n /** @type {number[]} */\n const probabilities = softmax(scores[i]);\n const [score, id] = max(probabilities);\n const [start, end] = [i, i + 1];\n\n if (id !== current_speaker) {\n // Speaker has changed\n current_speaker = id;\n accumulated_segments.push({ id, start, end, score });\n } else {\n // Continue the current segment\n accumulated_segments.at(-1).end = end;\n accumulated_segments.at(-1).score += score;\n }\n }\n\n results.push(accumulated_segments.map(\n // Convert frame-space to time-space\n // and compute the confidence\n ({ id, start, end, score }) => ({\n id,\n start: start * ratio,\n end: end * ratio,\n confidence: score / (end - start),\n })\n ));\n }\n return results;\n }\n\n}\n","import { Processor } from '../../base/processing_utils.js';\nimport { PyAnnoteFeatureExtractor } from './feature_extraction_pyannote.js';\n\nexport class PyAnnoteProcessor extends Processor {\n static feature_extractor_class = PyAnnoteFeatureExtractor\n\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<any>} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n\n /** @type {PyAnnoteFeatureExtractor['post_process_speaker_diarization']} */\n post_process_speaker_diarization(...args) {\n return /** @type {PyAnnoteFeatureExtractor} */(this.feature_extractor).post_process_speaker_diarization(...args);\n }\n\n get sampling_rate() {\n return this.feature_extractor.config.sampling_rate;\n }\n}\n","import {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\nimport { cat, Tensor } from \"../../utils/tensor.js\";\n\nexport class Qwen2VLImageProcessor extends ImageProcessor {\n async _call(images, ...args) {\n const { pixel_values, original_sizes, reshaped_input_sizes } = await super._call(images, ...args);\n\n let patches = pixel_values;\n\n // @ts-ignore\n const { temporal_patch_size, merge_size, patch_size } = this.config;\n if (patches.dims[0] === 1) {\n // Equivalent to np.tile(patches, (self.temporal_patch_size, 1, 1, 1))\n patches = cat(Array.from({ length: temporal_patch_size }, () => patches), 0);\n }\n\n const grid_t = patches.dims[0] / temporal_patch_size;\n const channel = patches.dims[1];\n const grid_h = Math.floor(patches.dims[2] / patch_size);\n const grid_w = Math.floor(patches.dims[3] / patch_size);\n\n const flatten_patches = patches\n .view(\n grid_t,\n temporal_patch_size,\n channel,\n Math.floor(grid_h / merge_size),\n merge_size,\n patch_size,\n Math.floor(grid_w / merge_size),\n merge_size,\n patch_size,\n )\n .permute(0, 3, 6, 4, 7, 2, 1, 5, 8)\n .view(\n grid_t * grid_h * grid_w,\n channel * temporal_patch_size * patch_size * patch_size,\n )\n\n const image_grid_thw = new Tensor('int64', [grid_t, grid_h, grid_w], [1, 3]);\n\n return {\n pixel_values: flatten_patches,\n image_grid_thw,\n original_sizes,\n reshaped_input_sizes,\n }\n }\n}\n\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { RawImage } from \"../../utils/image.js\";\n\nexport class Qwen2VLProcessor extends Processor {\n static image_processor_class = AutoImageProcessor\n static tokenizer_class = AutoTokenizer\n\n /**\n * \n * @param {string|string[]} text \n * @param {RawImage|RawImage[]} images \n * @param {...any} args \n * @returns {Promise<any>}\n */\n async _call(text, images = null, ...args) {\n\n if (!Array.isArray(text)) {\n text = [text];\n }\n\n let image_inputs, image_grid_thw;\n\n if (images) {\n image_inputs = await this.image_processor(images);\n image_grid_thw = image_inputs.image_grid_thw;\n }\n\n if (image_grid_thw) {\n // @ts-expect-error TS2551\n let merge_length = this.image_processor.config.merge_size ** 2;\n let index = 0;\n\n const image_grid_thw_list = image_grid_thw.tolist();\n text = text.map(t => {\n while (t.includes(\"<|image_pad|>\")) {\n const prod = Number(image_grid_thw_list[index++].reduce((a, b) => a * b, 1n));\n t = t.replace(\"<|image_pad|>\", \"<|placeholder|>\".repeat(Math.floor(prod / merge_length)));\n }\n return t.replaceAll(\"<|placeholder|>\", \"<|image_pad|>\");\n });\n }\n\n const text_inputs = this.tokenizer(text);\n\n return {\n ...text_inputs,\n ...image_inputs,\n // TODO: ...videos_inputs,\n }\n }\n}\n","import { \n ImageProcessor,\n post_process_object_detection,\n} from \"../../base/image_processors_utils.js\";\n\n\nexport class RTDetrImageProcessor extends ImageProcessor {\n /** @type {typeof post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\nimport { calculateDimensions } from \"../../utils/core.js\";\n\nimport {\n interpolate_4d,\n Tensor,\n} from \"../../utils/tensor.js\";\n\n\n/**\n * @typedef {object} SamImageProcessorResult\n * @property {Tensor} pixel_values\n * @property {import(\"../../base/image_processors_utils.js\").HeightWidth[]} original_sizes\n * @property {import(\"../../base/image_processors_utils.js\").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 ImageProcessor {\n\n /**\n * \n * @param {any} input_points \n * @param {import(\"../../base/image_processors_utils.js\").HeightWidth[]} original_sizes \n * @param {import(\"../../base/image_processors_utils.js\").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 const [originalHeight, originalWidth] = original_sizes[i];\n const [reshapedHeight, reshapedWidth] = reshaped_input_sizes[i];\n\n const resizeFactors = [\n reshapedWidth / originalWidth,\n reshapedHeight / originalHeight,\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 {Object} [options] Additional options for the processor.\n * @param {any} [options.input_points=null] 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} [options.input_labels=null] 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 {number[][][]} [options.input_boxes=null] 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<SamImageProcessorResult>}\n */\n async _call(images, {\n input_points = null,\n input_labels = null,\n input_boxes = null\n } = {}) {\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<Tensor[]>} 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 ?? this.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 {import(\"../../utils/image.js\").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\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoImageProcessor } from \"../auto/image_processing_auto.js\";\n\nexport class SamProcessor extends Processor {\n static image_processor_class = AutoImageProcessor\n\n async _call(...args) {\n return await this.image_processor(...args);\n }\n\n post_process_masks(...args) {\n // @ts-ignore\n return this.image_processor.post_process_masks(...args);\n }\n\n reshape_input_points(...args) {\n // @ts-ignore\n return this.image_processor.reshape_input_points(...args);\n }\n}","\nexport { SamImageProcessor as Sam2ImageProcessor } from '../sam/image_processing_sam.js';\n","import { SamProcessor } from \"../sam/processing_sam.js\";\n\nexport class Sam2Processor extends SamProcessor { }\nexport class Sam2VideoProcessor extends Sam2Processor { }\n","\nexport { Sam2ImageProcessor as Sam3ImageProcessor } from '../sam2/image_processing_sam2.js';\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\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 257, // 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 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 {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _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 = await this._extract_fbank_features(audio, this.config.max_length);\n\n if (do_normalize_per_mel_bins) {\n const [num_features, feature_size] = features.dims;\n const data = features.data;\n for (let i = 0; i < feature_size; ++i) {\n let sum = 0;\n for (let j = 0; j < num_features; ++j) {\n sum += 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 += (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 data[index] = (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 const data = /** @type {Float32Array} */(features.data);\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(data)\n padded_data.fill(this.config.padding_value, data.length)\n\n const numPaddedFrames = num_frames + pad_size;\n features = new Tensor(\n features.type,\n padded_data,\n [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 /** @type {BigInt64Array} */ (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 = features.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","import { \n ImageProcessor,\n post_process_semantic_segmentation,\n} from \"../../base/image_processors_utils.js\";\n\n\nexport class SegformerImageProcessor extends ImageProcessor {\n /** @type {typeof post_process_semantic_segmentation} */\n post_process_semantic_segmentation(...args) {\n return post_process_semantic_segmentation(...args);\n }\n}\nexport class SegformerFeatureExtractor extends SegformerImageProcessor { }\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class SiglipImageProcessor extends ImageProcessor { }\n","\nexport { Idefics3ImageProcessor as SmolVLMImageProcessor } from \"../idefics3/image_processing_idefics3.js\";\n","\nexport { Idefics3Processor as SmolVLMProcessor } from \"../idefics3/processing_idefics3.js\";\n","import { DacFeatureExtractor } from '../dac/feature_extraction_dac.js';\n\nexport class SnacFeatureExtractor extends DacFeatureExtractor { }\n","\nimport { FeatureExtractor } from \"../../base/feature_extraction_utils.js\";\n\nexport class SpeechT5FeatureExtractor extends FeatureExtractor { }\n","import { Processor } from \"../../base/processing_utils.js\";\nimport { AutoTokenizer } from \"../../tokenizers.js\";\nimport { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\";\n\nexport class SpeechT5Processor extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @returns {Promise<any>} A Promise that resolves with the extracted features.\n */\n async _call(input) {\n return await this.feature_extractor(input)\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class Swin2SRImageProcessor extends ImageProcessor {\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}","import { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\"\nimport { AutoTokenizer } from \"../../tokenizers.js\"\nimport { Processor } from \"../../base/processing_utils.js\"\n\n/**\n * Represents a UltravoxProcessor that extracts features from an audio input.\n */\nexport class UltravoxProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n static uses_processor_config = true;\n\n /**\n * @param {string} text The text input to process.\n * @param {Float32Array} audio The audio input to process.\n */\n async _call(text, audio = null, kwargs = {}) {\n // TODO: Support batched inputs\n if (Array.isArray(text)) {\n throw new Error(\"Batched inputs are not supported yet.\");\n }\n\n let audio_inputs = {};\n if (audio) {\n const audio_len = audio.length;\n const { input_features } = await this.feature_extractor(audio, {\n ...kwargs,\n max_length: audio_len,\n });\n const nb_encoder_frames = Math.round(audio_len / this.config.encoder_ds_factor + 1e-4);\n\n // NOTE: The python version appears to have an off-by-one error.\n const audio_embed_frames = 1 + Math.ceil(nb_encoder_frames / this.config.stack_factor);\n audio_inputs[\"audio_token_len\"] = [audio_embed_frames];\n audio_inputs[\"audio_values\"] = input_features;\n\n const image_token = this.config.audio_placeholder;\n if (!text.includes(image_token)) {\n throw new Error(`The input text does not contain the image token ${image_token}.`);\n }\n text = text.replaceAll(image_token, image_token.repeat(audio_embed_frames));\n }\n\n const text_inputs = this.tokenizer(text, {\n add_special_tokens: false,\n ...kwargs,\n });\n\n return {\n ...text_inputs,\n ...audio_inputs,\n }\n }\n}\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class ViTImageProcessor extends ImageProcessor { }\nexport class ViTFeatureExtractor extends ViTImageProcessor { }\n\n","import { \n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nimport {\n stack,\n cat,\n} from \"../../utils/tensor.js\";\n\nexport class VitMatteImageProcessor extends ImageProcessor {\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 {import(\"../../utils/image.js\").RawImage[]} images The image(s) to extract features from.\n * @param {import(\"../../utils/image.js\").RawImage[]} trimaps The trimaps(s) to extract features from.\n * @returns {Promise<import(\"../../base/image_processors_utils.js\").ImageProcessorResult>} 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","import {\n ImageProcessor,\n} from \"../../base/image_processors_utils.js\";\n\nexport class VitPoseImageProcessor extends ImageProcessor {\n\n /**\n * Transform the heatmaps into keypoint predictions and transform them back to the image.\n * NOTE: This is a naive implementation and does not include advanced post-processing techniques,\n * so the results may not be as accurate as the original implementation.\n * @param {import('../../utils/tensor.js').Tensor} outputs The model outputs.\n * @param {[number, number, number, number][][]} boxes List or array of bounding boxes for each image.\n * Each box should be a list of 4 floats representing the bounding box coordinates in COCO format (top_left_x, top_left_y, width, height).\n * @returns {{\n * bbox: [number, number, number, number],\n * scores: number[],\n * labels: number[],\n * keypoints: [number, number][]\n * }[][]} List of keypoints predictions for each image.\n */\n post_process_pose_estimation(outputs, boxes, {\n threshold = null,\n // TODO:\n // kernel_size = 11,\n // target_sizes = null,\n } = {}) {\n // NOTE: boxes are 3D (batch_size, num_boxes, 4)\n const heatmaps = outputs.tolist();\n const [batch_size, num_classes, height, width] = outputs.dims;\n\n const results = [];\n for (let b = 0; b < batch_size; ++b) {\n const heatmap = heatmaps[b];\n const bboxes = boxes[b];\n\n const batch_results = [];\n for (let n = 0; n < bboxes.length; ++n) {\n const bbox = bboxes[n];\n\n const keypoints = [];\n const scores = [];\n const labels = [];\n\n const xScale = bbox.at(-2) / width;\n const yScale = bbox.at(-1) / height;\n for (let c = 0; c < heatmap.length; ++c) {\n let [xWeightedSum, yWeightedSum] = [0, 0];\n let sum = 0;\n let score = -Infinity;\n const row = heatmap[c];\n for (let y = 0; y < row.length; ++y) {\n const col = row[y];\n for (let x = 0; x < col.length; ++x) {\n const value = col[x];\n sum += value;\n\n score = Math.max(score, value);\n\n // Get weighted sum of positions\n // TODO: Determine best offsets\n xWeightedSum += (x + 0.5) * value;\n yWeightedSum += (y) * value;\n }\n }\n\n // Ignore low scores, if threshold is set\n if (threshold != null && score < threshold) continue;\n\n /** @type {[number, number]} */\n const keypoint = [\n xScale * xWeightedSum / sum,\n yScale * yWeightedSum / sum,\n ]\n keypoints.push(keypoint);\n labels.push(c);\n scores.push(score);\n }\n batch_results.push({\n bbox,\n scores,\n labels,\n keypoints,\n });\n }\n results.push(batch_results);\n }\n return results;\n }\n}\n","import { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\"\nimport { AutoTokenizer } from \"../../tokenizers.js\"\nimport { Processor } from \"../../base/processing_utils.js\"\nimport { cat } from \"../../utils/tensor.js\";\n\nconst AUDIO_TOKEN = \"[AUDIO]\";\nconst BEGIN_AUDIO_TOKEN = \"[BEGIN_AUDIO]\";\nconst NUM_AUDIO_TOKENS = 375;\n\n/**\n * Helper function to split audio into non-overlapping chunks of n_samples\n * @param {Float32Array} audio \n * @param {number} n_samples \n * @returns {Float32Array[]}\n */\nfunction chunk(audio, n_samples) {\n const chunks = [];\n for (let i = 0; i < audio.length; i += n_samples) {\n chunks.push(audio.subarray(i, Math.min(i + n_samples, audio.length)));\n }\n return chunks;\n}\n\n/**\n * Represents a VoxtralProcessor that extracts features from an audio input.\n */\nexport class VoxtralProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n static uses_processor_config = false;\n\n /**\n * @param {string} text The text input to process.\n * @param {Float32Array|Float32Array[]} audio The audio input(s) to process.\n */\n async _call(text, audio = null, kwargs = {}) {\n if (Array.isArray(text)) {\n throw new Error(\"Batched inputs are not supported yet.\");\n }\n\n const audio_inputs = {};\n if (audio) {\n if (!text.includes(AUDIO_TOKEN)) {\n throw new Error(`The input text does not contain the audio token ${AUDIO_TOKEN}.`);\n }\n if (!Array.isArray(audio)) {\n audio = [audio];\n }\n const text_parts = text.split(AUDIO_TOKEN);\n const num_audio_tokens = text_parts.length - 1;\n if (num_audio_tokens !== audio.length) {\n throw new Error(`The number of audio inputs (${audio.length}) does not match the number of audio tokens in the text (${num_audio_tokens}).`);\n }\n\n const n_samples = this.feature_extractor.config.n_samples;\n\n // Split each audio input into chunks and keep track of chunk counts\n const audio_chunks = audio.map(a => chunk(a, n_samples));\n const chunk_counts = audio_chunks.map(chunks => chunks.length);\n\n // Flatten all chunks for feature extraction\n const all_chunks = audio_chunks.flat();\n const features = (await Promise.all(\n all_chunks.map((audio_input) => this.feature_extractor(audio_input, kwargs))\n )).map(x => x.input_features);\n\n audio_inputs[\"audio_values\"] = features.length > 1 ? cat(features, 0) : features[0];\n\n // Replace text tokens for each audio input, expanding for chunk count\n let new_text = text_parts[0];\n for (let i = 0; i < chunk_counts.length; ++i) {\n new_text += BEGIN_AUDIO_TOKEN;\n for (let j = 0; j < chunk_counts[i]; ++j) {\n new_text += AUDIO_TOKEN.repeat(NUM_AUDIO_TOKENS);\n }\n new_text += text_parts[i + 1];\n }\n text = new_text;\n }\n\n const text_inputs = this.tokenizer(text, {\n add_special_tokens: false,\n ...kwargs,\n });\n\n return {\n ...text_inputs,\n ...audio_inputs,\n }\n }\n}\n","import { FeatureExtractor, validate_audio_inputs } from \"../../base/feature_extraction_utils.js\";\nimport { Tensor } from \"../../utils/tensor.js\";\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","import { AutoTokenizer } from \"../../tokenizers.js\";\nimport { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\";\nimport { Processor } from \"../../base/processing_utils.js\";\n\nexport class Wav2Vec2Processor extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n\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<any>} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n","import { AutoTokenizer } from \"../../tokenizers.js\";\nimport { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\";\nimport { Processor } from \"../../base/processing_utils.js\";\n\nexport class Wav2Vec2ProcessorWithLM extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n\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<any>} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\n\n\nexport class WeSpeakerFeatureExtractor 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 257, // 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 this.mel_filters = mel_filters;\n\n this.window = window_function(400, 'hamming', {\n periodic: false,\n })\n this.min_num_frames = this.config.min_num_frames;\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 {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _extract_fbank_features(waveform) {\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 transpose: true,\n min_num_frames: this.min_num_frames,\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 validate_audio_inputs(audio, 'WeSpeakerFeatureExtractor');\n\n const features = (await this._extract_fbank_features(audio)).unsqueeze_(0);\n\n if (this.config.fbank_centering_span === null) {\n // center features with global average\n const meanData = /** @type {Float32Array} */ (features.mean(1).data);\n const featuresData = /** @type {Float32Array} */(features.data);\n const [batch_size, num_frames, feature_size] = features.dims;\n\n for (let i = 0; i < batch_size; ++i) {\n const offset1 = i * num_frames * feature_size;\n const offset2 = i * feature_size;\n for (let j = 0; j < num_frames; ++j) {\n const offset3 = offset1 + j * feature_size;\n for (let k = 0; k < feature_size; ++k) {\n featuresData[offset3 + k] -= meanData[offset2 + k];\n }\n }\n }\n }\n\n return {\n input_features: features\n };\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\nexport const WHISPER_LANGUAGE_MAPPING = new Map(WHISPER_LANGUAGES);\n// @ts-ignore\nexport const 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 * @param {string} language The language name or code\n * @returns {string} The language code\n */\nexport function whisper_language_to_code(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 // Perhaps the user passed the special token itself\n const language_special_token = language.match(/^<\\|([a-z]{2})\\|>$/);\n if (language_special_token) {\n language = language_special_token[1];\n }\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(Array.from(langs))}`);\n }\n }\n return language_code;\n}\n","import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';\nimport { Tensor } from '../../utils/tensor.js';\nimport { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';\nimport { max } from '../../utils/maths.js';\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 {Promise<Tensor>} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n async _extract_fbank_features(waveform) {\n const features = await 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: Math.min(\n Math.floor(waveform.length / this.config.hop_length),\n this.config.nb_max_frames, // 3000\n )\n }\n )\n\n const data = features.data;\n const maxValue = max(/** @type {Float32Array} */(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 features;\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, 'WhisperFeatureExtractor');\n\n let waveform;\n const length = max_length ?? this.config.n_samples;\n if (audio.length > length) {\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 }\n waveform = audio.slice(0, length);\n } else {\n // pad with zeros\n waveform = new Float32Array(length);\n waveform.set(audio);\n }\n\n const features = await this._extract_fbank_features(waveform);\n\n return {\n input_features: features.unsqueeze_(0)\n };\n }\n}\n","import { GenerationConfig } from \"../../generation/configuration_utils.js\";\n\nexport class 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 * The id of the `\"<|notimestamps|>\"` token.\n * @type {number}\n */\n no_timestamps_token_id = null;\n\n /**\n * Rank-1 list of token IDs created by passing text to [`~WhisperProcessor.get_prompt_ids`] that is\n * provided as a prompt to each chunk. This can be used to provide or \"prompt-engineer\" a context for\n * transcription, e.g. custom vocabularies or proper nouns to make it more likely to predict those words\n * correctly. It cannot be used in conjunction with `decoder_start_token_id` as it overwrites this value.\n * @type {number[]}\n */\n prompt_ids = null;\n\n /**\n * Whether the model is multilingual or not.\n * @type {boolean}\n */\n is_multilingual = null;\n\n /**\n * (Optional) A mapping from language tokens to their corresponding IDs.\n * Only required if the model is multilingual.\n * @type {Record<string, number>|null}\n */\n lang_to_id = null;\n\n /**\n * (Optional) A mapping from task tokens to their corresponding IDs.\n * @type {Record<string, number>|null}\n */\n task_to_id = null;\n\n /**\n * Used to set the maximum value of the initial timestamp. This is used to prevent the model from\n * predicting timestamps that are too far in the future.\n * @type {number}\n */\n max_initial_timestamp_index = 1;\n}\n\n/**\n * @typedef {import('../../generation/parameters.js').GenerationFunctionParameters & {generation_config: WhisperGenerationConfig} & WhisperGenerationConfig} WhisperGenerationFunctionParameters\n */\n","import { AutoFeatureExtractor } from \"../auto/feature_extraction_auto.js\"\nimport { AutoTokenizer } from \"../../tokenizers.js\"\nimport { Processor } from \"../../base/processing_utils.js\"\n\n/**\n * Represents a WhisperProcessor that extracts features from an audio input.\n */\nexport class WhisperProcessor extends Processor {\n static tokenizer_class = AutoTokenizer\n static feature_extractor_class = AutoFeatureExtractor\n\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<any>} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio);\n }\n}\n\n","import { \n ImageProcessor,\n post_process_object_detection,\n} from \"../../base/image_processors_utils.js\";\n\nexport class YolosImageProcessor extends ImageProcessor {\n /** @type {typeof post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\nexport class YolosFeatureExtractor extends YolosImageProcessor { }\n","import { createInferenceSession, runInferenceSession, isONNXProxy } from \"../backends/onnx.js\";\nimport { Tensor } from \"../utils/tensor.js\";\n\n/**\n * Asynchronously creates a wrapper function for running an ONNX inference session.\n *\n * @param {number[]} session_bytes The session data in bytes.\n * @param {import('onnxruntime-common').InferenceSession.SessionOptions} session_options The options for the ONNX session.\n * @template {string | [string] | string[]} T\n * @param {T} names The name(s) of the output tensor(s).\n * \n * @returns {Promise<function(Record<string, Tensor>): Promise<T extends string ? Tensor : T extends string[] ? { [K in keyof T]: Tensor } : never>>}\n * The wrapper function for running the ONNX inference session.\n */\nconst wrap = async (session_bytes, session_options, names) => {\n const session = await createInferenceSession(\n new Uint8Array(session_bytes), session_options,\n );\n\n return /** @type {any} */(async (/** @type {Record<string, Tensor>} */ inputs) => {\n const proxied = isONNXProxy();\n const ortFeed = Object.fromEntries(Object.entries(inputs).map(([k, v]) => [k, (proxied ? v.clone() : v).ort_tensor]));\n const outputs = await runInferenceSession(session, ortFeed);\n if (Array.isArray(names)) {\n return names.map((n) => new Tensor(outputs[n]));\n } else {\n return new Tensor(outputs[/** @type {string} */(names)]);\n }\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 nearest_interpolate_4d() {\n if (!this._nearest_interpolate_4d) {\n this._nearest_interpolate_4d = wrap(\n [8, 10, 18, 0, 58, 129, 1, 10, 41, 10, 1, 120, 10, 0, 10, 0, 10, 1, 115, 18, 1, 121, 34, 6, 82, 101, 115, 105, 122, 101, 42, 18, 10, 4, 109, 111, 100, 101, 34, 7, 110, 101, 97, 114, 101, 115, 116, 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, 21],\n this.session_options,\n 'y',\n );\n }\n return this._nearest_interpolate_4d;\n }\n static get bilinear_interpolate_4d() {\n if (!this._bilinear_interpolate_4d) {\n this._bilinear_interpolate_4d = wrap(\n [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 [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 static get matmul() {\n if (!this._matmul) {\n this._matmul = wrap(\n [8, 9, 18, 0, 58, 55, 10, 17, 10, 1, 97, 10, 1, 98, 18, 1, 99, 34, 6, 77, 97, 116, 77, 117, 108, 18, 1, 114, 90, 9, 10, 1, 97, 18, 4, 10, 2, 8, 1, 90, 9, 10, 1, 98, 18, 4, 10, 2, 8, 1, 98, 9, 10, 1, 99, 18, 4, 10, 2, 8, 1, 66, 2, 16, 20],\n this.session_options,\n 'c',\n );\n }\n return this._matmul;\n }\n\n static get stft() {\n if (!this._stft) {\n this._stft = wrap(\n [8, 7, 18, 0, 58, 148, 1, 10, 38, 10, 1, 115, 10, 1, 106, 10, 1, 119, 10, 1, 108, 18, 1, 111, 34, 4, 83, 84, 70, 84, 42, 15, 10, 8, 111, 110, 101, 115, 105, 100, 101, 100, 24, 1, 160, 1, 2, 18, 1, 115, 90, 26, 10, 1, 115, 18, 21, 10, 19, 8, 1, 18, 15, 10, 3, 18, 1, 98, 10, 3, 18, 1, 115, 10, 3, 18, 1, 99, 90, 11, 10, 1, 106, 18, 6, 10, 4, 8, 7, 18, 0, 90, 16, 10, 1, 119, 18, 11, 10, 9, 8, 1, 18, 5, 10, 3, 18, 1, 119, 90, 11, 10, 1, 108, 18, 6, 10, 4, 8, 7, 18, 0, 98, 31, 10, 1, 111, 18, 26, 10, 24, 8, 1, 18, 20, 10, 3, 18, 1, 98, 10, 3, 18, 1, 102, 10, 3, 18, 1, 100, 10, 3, 18, 1, 99, 66, 2, 16, 17],\n this.session_options,\n 'o',\n )\n }\n return this._stft;\n }\n\n static get rfft() {\n if (!this._rfft) {\n this._rfft = wrap(\n [8, 9, 18, 0, 58, 97, 10, 33, 10, 1, 120, 10, 0, 10, 1, 97, 18, 1, 121, 34, 3, 68, 70, 84, 42, 15, 10, 8, 111, 110, 101, 115, 105, 100, 101, 100, 24, 1, 160, 1, 2, 18, 1, 100, 90, 21, 10, 1, 120, 18, 16, 10, 14, 8, 1, 18, 10, 10, 3, 18, 1, 115, 10, 3, 18, 1, 99, 90, 11, 10, 1, 97, 18, 6, 10, 4, 8, 7, 18, 0, 98, 21, 10, 1, 121, 18, 16, 10, 14, 8, 1, 18, 10, 10, 3, 18, 1, 115, 10, 3, 18, 1, 99, 66, 2, 16, 20],\n this.session_options,\n 'y',\n )\n }\n return this._rfft;\n }\n\n static get top_k() {\n if (!this._top_k) {\n this._top_k = wrap(\n [8, 10, 18, 0, 58, 73, 10, 18, 10, 1, 120, 10, 1, 107, 18, 1, 118, 18, 1, 105, 34, 4, 84, 111, 112, 75, 18, 1, 116, 90, 9, 10, 1, 120, 18, 4, 10, 2, 8, 1, 90, 15, 10, 1, 107, 18, 10, 10, 8, 8, 7, 18, 4, 10, 2, 8, 1, 98, 9, 10, 1, 118, 18, 4, 10, 2, 8, 1, 98, 9, 10, 1, 105, 18, 4, 10, 2, 8, 7, 66, 2, 16, 21],\n this.session_options,\n [ /* Values */ 'v', /* Indices */ 'i']\n )\n }\n return this._top_k;\n }\n\n static get slice() {\n if (!this._slice) {\n this._slice = wrap(\n [8, 7, 18, 0, 58, 96, 10, 25, 10, 1, 120, 10, 1, 115, 10, 1, 101, 10, 1, 97, 10, 1, 116, 18, 1, 121, 34, 5, 83, 108, 105, 99, 101, 18, 1, 114, 90, 9, 10, 1, 120, 18, 4, 10, 2, 8, 1, 90, 9, 10, 1, 115, 18, 4, 10, 2, 8, 7, 90, 9, 10, 1, 101, 18, 4, 10, 2, 8, 7, 90, 9, 10, 1, 97, 18, 4, 10, 2, 8, 7, 90, 9, 10, 1, 116, 18, 4, 10, 2, 8, 7, 98, 9, 10, 1, 121, 18, 4, 10, 2, 8, 1, 66, 2, 16, 13],\n this.session_options,\n 'y',\n )\n }\n return this._slice;\n }\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 '@huggingface/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 AutoModelForUniversalSegmentation,\n AutoModelForObjectDetection,\n AutoModelForZeroShotObjectDetection,\n AutoModelForDocumentQuestionAnswering,\n AutoModelForImageToImage,\n AutoModelForDepthEstimation,\n AutoModelForImageFeatureExtraction,\n PreTrainedModel,\n} from './models.js';\nimport {\n AutoProcessor,\n} from './models/auto/processing_auto.js';\nimport {\n Processor,\n} from './base/processing_utils.js';\n\nimport {\n Callable,\n} from './utils/generic.js';\n\nimport {\n dispatchCallback,\n product,\n} from './utils/core.js';\nimport {\n softmax,\n max,\n round,\n} from './utils/maths.js';\nimport {\n read_audio,\n RawAudio\n} from './utils/audio.js';\nimport {\n Tensor,\n mean_pooling,\n interpolate_4d,\n quantize_embeddings,\n topk,\n} from './utils/tensor.js';\nimport { RawImage } from './utils/image.js';\n\n\n/**\n * @typedef {string | RawImage | URL | Blob | HTMLCanvasElement | OffscreenCanvas} 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<RawImage[]>} 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<Float32Array[]>} 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<void>} 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 */\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} [top_k=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<TextClassificationOutput|TextClassificationOutput[]>} 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.', { top_k: 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!', { top_k: 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 top_k = 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 // @ts-expect-error TS2339\n this.model.config.problem_type === 'multi_label_classification'\n ? batch => batch.sigmoid()\n : batch => new Tensor(\n 'float32',\n softmax(batch.data),\n batch.dims,\n ); // single_label_classification (default)\n\n // @ts-expect-error TS2339\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\n const scores = await topk(output, top_k);\n\n const values = scores[0].tolist();\n const indices = scores[1].tolist();\n const vals = indices.map((x, i) => ({\n label: id2label ? id2label[x] : `LABEL_${x}`,\n score: values[i],\n }));\n if (top_k === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return Array.isArray(texts) || top_k === 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<TokenClassificationOutput|TokenClassificationOutput[]>} 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 // @ts-expect-error TS2339\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: Add support for start and end\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} [top_k=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<QuestionAnsweringOutput|QuestionAnsweringOutput[]>} 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 top_k = 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 { start_logits, end_logits } = await this.model(inputs);\n const input_ids = inputs.input_ids.tolist();\n const attention_mask = inputs.attention_mask.tolist();\n\n // TODO: add support for `return_special_tokens_mask`\n const special_tokens = this.tokenizer.all_special_ids;\n\n /** @type {QuestionAnsweringOutput[]} */\n const toReturn = [];\n for (let j = 0; j < start_logits.dims[0]; ++j) {\n const ids = input_ids[j];\n const sepIndex = ids.findIndex(x =>\n // We use == to match bigint with number\n // @ts-ignore\n x == this.tokenizer.sep_token_id\n );\n\n\n const valid_mask = attention_mask[j].map((y, ix) => (\n y == 1\n && (\n ix === 0 // is cls_token\n || (\n ix > sepIndex\n && special_tokens.findIndex(x => x == ids[ix]) === -1 // token is not a special token (special_tokens_mask == 0)\n )\n )\n ));\n\n const start = start_logits[j].tolist();\n const end = end_logits[j].tolist();\n\n // Now, we mask out values that can't be in the answer\n // NOTE: We keep the cls_token unmasked (some models use it to indicate unanswerable questions)\n for (let i = 1; i < start.length; ++i) {\n if (\n attention_mask[j] == 0 // is part of padding\n || i <= sepIndex // is before the sep_token\n || special_tokens.findIndex(x => x == ids[i]) !== -1 // Is a special token\n ) {\n // Make sure non-context indexes in the tensor cannot contribute to the softmax\n start[i] = -Infinity;\n end[i] = -Infinity;\n }\n }\n\n // Normalize logits and spans to retrieve the answer\n const start_scores = softmax(start).map((x, i) => [x, i]);\n const end_scores = softmax(end).map((x, i) => [x, i]);\n\n // Mask CLS\n start_scores[0][0] = 0;\n end_scores[0][0] = 0;\n\n // Generate all valid spans and select best ones\n const options = product(start_scores, end_scores)\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, top_k); ++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 top_k\n return (top_k === 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} [top_k=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<FillMaskOutput|FillMaskOutput[]>} 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.', { top_k: 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 top_k = 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 { logits } = await this.model(model_inputs)\n\n const toReturn = [];\n\n /** @type {bigint[][]} */\n const input_ids = model_inputs.input_ids.tolist();\n for (let i = 0; i < input_ids.length; ++i) {\n const ids = input_ids[i];\n const mask_token_index = ids.findIndex(x =>\n // We use == to match bigint with number\n // @ts-ignore\n x == 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 itemLogits = logits[i][mask_token_index];\n\n const scores = await topk(new Tensor(\n 'float32',\n softmax(itemLogits.data),\n itemLogits.dims,\n ), top_k);\n const values = scores[0].tolist();\n const indices = scores[1].tolist();\n\n toReturn.push(indices.map((x, i) => {\n const sequence = ids.slice();\n sequence[mask_token_index] = x;\n\n return {\n score: values[i],\n token: Number(x),\n token_str: this.tokenizer.decode([x]),\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 {Partial<import('./generation/configuration_utils.js').GenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise<Text2TextGenerationOutput|Text2TextGenerationOutput[]>}\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 if (!Array.isArray(texts)) {\n texts = [texts];\n }\n\n\n // Add global prefix, if present\n // @ts-expect-error TS2339\n if (this.model.config.prefix) {\n // @ts-expect-error TS2339\n texts = texts.map(x => this.model.config.prefix + x)\n }\n\n // Handle task specific params:\n // @ts-expect-error TS2339\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 inputs;\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 inputs = tokenizer._build_translation_inputs(texts, tokenizer_options, generate_kwargs);\n\n } else {\n inputs = tokenizer(texts, tokenizer_options);\n }\n\n const outputTokenIds = await this.model.generate({ ...inputs, ...generate_kwargs });\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<SummarizationOutput|SummarizationOutput[]>}\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<TranslationOutput|TranslationOutput[]>}\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 {Partial<TextGenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise<TextGenerationOutput|TextGenerationOutput[]>} 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 let isBatched = false;\n let isChatInput = false;\n\n // By default, do not add special tokens, unless the tokenizer specifies otherwise\n let add_special_tokens = generate_kwargs.add_special_tokens\n ?? (this.tokenizer.add_bos_token || this.tokenizer.add_eos_token)\n ?? 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 add_special_tokens = false; // Chat template handles this already\n }\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 ...text_inputs,\n ...generate_kwargs\n }));\n\n const decoded = this.tokenizer.batch_decode(outputTokenIds, {\n skip_special_tokens: true,\n });\n\n let promptLengths;\n if (!return_full_text && text_inputs.input_ids.dims.at(-1) > 0) {\n promptLengths = this.tokenizer.batch_decode(text_inputs.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.dims[0] * 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<ZeroShotClassificationOutput|ZeroShotClassificationOutput[]>} 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'|'first_token'|'eos'|'last_token'} [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<Tensor>} 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 ?? outputs.token_embeddings;\n\n switch (pooling) {\n case 'none':\n // Skip pooling\n break;\n case 'mean':\n result = mean_pooling(result, model_inputs.attention_mask);\n break;\n case 'first_token':\n case 'cls':\n result = result.slice(null, 0);\n break;\n case 'last_token':\n case 'eos':\n result = result.slice(null, -1);\n break;\n default:\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<Tensor>} 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} [top_k=5] 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<AudioClassificationOutput|AudioClassificationOutput[]>} 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, { top_k: 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 top_k = 5\n } = {}) {\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n // @ts-expect-error TS2339\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 = await topk(new Tensor(\n 'float32',\n softmax(logits.data),\n logits.dims,\n ), top_k);\n\n const values = scores[0].tolist();\n const indices = scores[1].tolist();\n\n const vals = indices.map((x, i) => ({\n label: /** @type {string} */ (id2label ? id2label[x] : `LABEL_${x}`),\n score: /** @type {number} */ (values[i]),\n }));\n\n toReturn.push(vals);\n };\n return Array.isArray(audio) ? toReturn : 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<ZeroShotAudioClassificationOutput[]|ZeroShotAudioClassificationOutput[][]>} 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 {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'} [return_timestamps] Whether to return timestamps or not. Default is `false`.\n * @property {number} [chunk_length_s] The length of audio chunks to process in seconds. Default is 0 (no chunking).\n * @property {number} [stride_length_s] The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to `chunk_length_s / 6`.\n * @property {boolean} [force_full_sequences] Whether to force outputting full sequences or not. Default is `false`.\n * @property {string} [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} [task] The task to perform. Default is `null`, meaning it should be auto-detected.\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 {Partial<AutomaticSpeechRecognitionConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise<AutomaticSpeechRecognitionOutput|AutomaticSpeechRecognitionOutput[]>} 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 switch (this.model.config.model_type) {\n case 'whisper':\n case 'lite-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 case 'parakeet_ctc':\n return this._call_wav2vec2(audio, kwargs)\n case 'moonshine':\n return this._call_moonshine(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, { skip_special_tokens: true }).trim();\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 const return_timestamps = kwargs.return_timestamps ?? false;\n const chunk_length_s = kwargs.chunk_length_s ?? 0;\n const force_full_sequences = kwargs.force_full_sequences ?? false;\n let stride_length_s = kwargs.stride_length_s ?? null;\n\n const generation_config = { ...kwargs }\n\n if (return_timestamps === 'word') {\n generation_config['return_token_timestamps'] = true;\n generation_config['return_timestamps'] = false; // Do not predict timestamp tokens\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n // @ts-expect-error TS2339\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 {{stride: number[], input_features: Tensor, is_last: boolean, tokens?: bigint[], token_timestamps?: number[]}[]} */\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 while (true) {\n const offset_end = offset + window;\n const subarr = aud.subarray(offset, offset_end);\n const feature = await this.processor(subarr);\n\n const is_first = offset === 0;\n const is_last = offset_end >= aud.length;\n chunks.push({\n stride: [\n subarr.length,\n is_first ? 0 : stride,\n is_last ? 0 : stride\n ],\n input_features: feature.input_features,\n is_last,\n })\n if (is_last) break;\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 generation_config.num_frames = Math.floor(chunk.stride[0] / hop_length);\n\n // NOTE: doing sequentially for now\n const data = await this.model.generate({\n inputs: chunk.input_features,\n ...generation_config\n });\n\n // TODO: Right now we only get top beam\n if (return_timestamps === 'word') {\n // @ts-expect-error TS2339\n chunk.tokens = data.sequences.tolist()[0];\n // @ts-expect-error TS2339\n chunk.token_timestamps = data.token_timestamps.tolist()[0].map(\n (/** @type {number} */ x) => round(x, 2)\n );\n\n } else {\n chunk.tokens = (/** @type {Tensor} */(data))[0].tolist();\n }\n\n // convert stride to seconds\n chunk.stride = chunk.stride.map(x => x / sampling_rate);\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 * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_moonshine(audio, kwargs) {\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n\n // According to the [paper](https://huggingface.co/papers/2410.15608):\n // \"We use greedy decoding, with a heuristic limit of 6 output tokens\n // per second of audio to avoid repeated output sequences.\"\n const max_new_tokens = Math.floor(aud.length / sampling_rate) * 6;\n const outputs = await this.model.generate({ max_new_tokens, ...kwargs, ...inputs });\n\n const text = this.processor.batch_decode(/** @type {Tensor} */(outputs), { skip_special_tokens: true })[0];\n toReturn.push({ text });\n }\n return single ? toReturn[0] : toReturn;\n }\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 {Partial<import('./generation/configuration_utils.js').GenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise<ImageToTextOutput|ImageToTextOutput[]>} 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\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} [top_k=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<ImageClassificationOutput|ImageClassificationOutput[]>} 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, { top_k: 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, { top_k: 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 top_k = 5\n } = {}) {\n\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 // @ts-expect-error TS2339\n const id2label = this.model.config.id2label;\n\n /** @type {ImageClassificationOutput[]} */\n const toReturn = [];\n for (const batch of output.logits) {\n const scores = await topk(new Tensor(\n 'float32',\n softmax(batch.data),\n batch.dims,\n ), top_k);\n\n const values = scores[0].tolist();\n const indices = scores[1].tolist();\n\n const vals = indices.map((x, i) => ({\n label: /** @type {string} */ (id2label ? id2label[x] : `LABEL_${x}`),\n score: /** @type {number} */ (values[i]),\n }));\n toReturn.push(vals);\n }\n\n return Array.isArray(images) ? toReturn : toReturn[0];\n }\n\n}\n\n/**\n * @typedef {Object} ImageSegmentationPipelineOutput\n * @property {string|null} 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<ImageSegmentationPipelineOutput[]>} 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 inputs = await this.processor(preparedImages);\n\n const { inputNames, outputNames } = this.model.sessions['model'];\n if (!inputNames.includes('pixel_values')) {\n if (inputNames.length !== 1) {\n throw Error(`Expected a single input name, but got ${inputNames.length} inputs: ${inputNames}.`);\n }\n\n const newName = inputNames[0];\n if (newName in inputs) {\n throw Error(`Input name ${newName} already exists in the inputs.`);\n }\n // To ensure compatibility with certain background-removal models,\n // we may need to perform a mapping of input to output names\n inputs[newName] = inputs.pixel_values;\n }\n\n const output = await this.model(inputs);\n\n let fn = null;\n if (subtask !== null) {\n fn = this.subtasks_mapping[subtask];\n } else if (this.processor.image_processor) {\n for (const [task, func] of Object.entries(this.subtasks_mapping)) {\n if (func in this.processor.image_processor) {\n fn = this.processor.image_processor[func].bind(this.processor.image_processor);\n subtask = task;\n break;\n }\n }\n }\n\n // @ts-expect-error TS2339\n const id2label = this.model.config.id2label;\n\n /** @type {ImageSegmentationPipelineOutput[]} */\n const annotation = [];\n if (!subtask) {\n // We define an epsilon to safeguard against numerical/precision issues when detecting\n // the normalization mode of the output (i.e., sigmoid already applied, or not).\n // See https://github.com/microsoft/onnxruntime/issues/23943 for more information.\n const epsilon = 1e-5;\n\n // Perform standard image segmentation\n const result = output[outputNames[0]];\n for (let i = 0; i < imageSizes.length; ++i) {\n const size = imageSizes[i];\n const item = result[i];\n if (item.data.some(x => x < -epsilon || x > 1 + epsilon)) {\n item.sigmoid_();\n }\n const mask = await RawImage.fromTensor(item.mul_(255).to('uint8')).resize(size[1], size[0]);\n annotation.push({\n label: null,\n score: null,\n mask\n });\n }\n } else 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/**\n * @typedef {Object} BackgroundRemovalPipelineOptions Parameters specific to image segmentation pipelines.\n *\n * @callback BackgroundRemovalPipelineCallback Segment the input images.\n * @param {ImagePipelineInputs} images The input images.\n * @param {BackgroundRemovalPipelineOptions} [options] The options to use for image segmentation.\n * @returns {Promise<RawImage[]>} The images with the background removed.\n *\n * @typedef {ImagePipelineConstructorArgs & BackgroundRemovalPipelineCallback & Disposable} BackgroundRemovalPipelineType\n */\n\n/**\n * Background removal pipeline using certain `AutoModelForXXXSegmentation`.\n * This pipeline removes the backgrounds of images.\n *\n * **Example:** Perform background removal with `Xenova/modnet`.\n * ```javascript\n * const segmenter = await pipeline('background-removal', 'Xenova/modnet');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/portrait-of-woman_small.jpg';\n * const output = await segmenter(url);\n * // [\n * // RawImage { data: Uint8ClampedArray(648000) [ ... ], width: 360, height: 450, channels: 4 }\n * // ]\n * ```\n */\nexport class BackgroundRemovalPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => BackgroundRemovalPipelineType} */ (/** @type {any} */(ImageSegmentationPipeline))) {\n /**\n * Create a new BackgroundRemovalPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {BackgroundRemovalPipelineCallback} */\n async _call(images, options = {}) {\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Background removal pipeline currently only supports a batch size of 1.\");\n }\n\n const preparedImages = await prepareImages(images);\n\n // @ts-expect-error TS2339\n const masks = await super._call(images, options);\n const result = preparedImages.map((img, i) => {\n const cloned = img.clone();\n cloned.putAlpha(masks[i].mask);\n return cloned;\n });\n\n return result;\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<ZeroShotImageClassificationOutput[]|ZeroShotImageClassificationOutput[][]>} 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<ObjectDetectionPipelineOutput|ObjectDetectionPipelineOutput[]>} 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.image_processor.post_process_object_detection(output, threshold, imageSizes);\n\n // Add labels\n // @ts-expect-error TS2339\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} [top_k=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<ZeroShotObjectDetectionOutput[]|ZeroShotObjectDetectionOutput[][]>} 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, { top_k: 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 top_k = 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 let result;\n if ('post_process_grounded_object_detection' in this.processor) {\n // @ts-ignore\n const processed = this.processor.post_process_grounded_object_detection(\n output,\n text_inputs.input_ids,\n {\n // TODO: support separate threshold values\n box_threshold: threshold,\n text_threshold: threshold,\n target_sizes: imageSize,\n },\n )[0];\n result = processed.boxes.map((box, i) => ({\n score: processed.scores[i],\n label: processed.labels[i],\n box: get_bounding_box(box, !percentage),\n }))\n } else {\n // @ts-ignore\n const processed = this.processor.image_processor.post_process_object_detection(output, threshold, imageSize, true)[0];\n 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 }))\n }\n result.sort((a, b) => b.score - a.score);\n\n if (top_k !== null) {\n result = result.slice(0, top_k);\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 {Partial<import('./generation/configuration_utils.js').GenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise<DocumentQuestionAnsweringOutput|DocumentQuestionAnsweringOutput[]>} 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\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 = `<s_docvqa><s_question>${question}</s_question><s_answer>`;\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 // @ts-expect-error TS2339\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>(.*?)<\\/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 * @property {number} [num_inference_steps] The number of denoising steps (if the model supports it).\n * More denoising steps usually lead to higher quality audio but slower inference.\n * @property {number} [speed] The speed of the generated audio (if the model supports 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<TextToAudioOutput>} 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 `onnx-community/Supertonic-TTS-ONNX`.\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'onnx-community/Supertonic-TTS-ONNX');\n * const speaker_embeddings = 'https://huggingface.co/onnx-community/Supertonic-TTS-ONNX/resolve/main/voices/F1.bin';\n * const output = await synthesizer('Hello there, how are you doing?', { speaker_embeddings });\n * // RawAudio {\n * // audio: Float32Array(95232) [-0.000482565927086398, -0.0004853440332226455, ...],\n * // sampling_rate: 44100\n * // }\n * \n * // Optional: Save the audio to a .wav file or Blob\n * await output.save('output.wav'); // You can also use `output.toBlob()` to access the audio as a Blob\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 output = await synthesizer('Bonjour');\n * // RawAudio {\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 async _prepare_speaker_embeddings(speaker_embeddings) {\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 [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 return speaker_embeddings;\n }\n\n /** @type {TextToAudioPipelineCallback} */\n async _call(text_inputs, {\n speaker_embeddings = null,\n num_inference_steps,\n speed,\n } = {}) {\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 if (\n this.model.config.model_type === \"supertonic\"\n ) {\n return this._call_supertonic(text_inputs, { speaker_embeddings, num_inference_steps, speed });\n } else {\n return this._call_text_to_waveform(text_inputs);\n }\n }\n\n async _call_supertonic(text_inputs, { speaker_embeddings, num_inference_steps, speed }) {\n if (!speaker_embeddings) {\n throw new Error(\"Speaker embeddings must be provided for Supertonic models.\");\n }\n speaker_embeddings = await this._prepare_speaker_embeddings(speaker_embeddings);\n\n // @ts-expect-error TS2339\n const { sampling_rate, style_dim } = this.model.config;\n\n speaker_embeddings = (/** @type {Tensor} */ (speaker_embeddings)).view(1, -1, style_dim);\n const inputs = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // @ts-expect-error TS2339\n const { waveform } = await this.model.generate_speech({\n ...inputs,\n style: speaker_embeddings,\n num_inference_steps,\n speed,\n });\n\n return new RawAudio(\n waveform.data,\n sampling_rate,\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 // @ts-expect-error TS2339\n const sampling_rate = this.model.config.sampling_rate;\n return new RawAudio(\n 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 // Run tokenization\n const { input_ids } = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n speaker_embeddings = await this._prepare_speaker_embeddings(speaker_embeddings);\n speaker_embeddings = speaker_embeddings.view(1, -1);\n\n // @ts-expect-error TS2339\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 new RawAudio(\n 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<RawImage|RawImage[]>} 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<DepthEstimationPipelineOutput|DepthEstimationPipelineOutput[]>} 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 batch = predicted_depth[i];\n const [height, width] = batch.dims.slice(-2);\n const [new_width, new_height] = preparedImages[i].size;\n\n // Interpolate to original size\n const prediction = (await interpolate_4d(batch.view(1, 1, height, width), {\n size: [new_height, new_width],\n mode: 'bilinear',\n })).view(new_height, new_width);\n\n const minval = /** @type {number} */(prediction.min().item());\n const maxval = /** @type {number} */(prediction.max().item());\n const formatted = prediction.sub(minval).div_(maxval - minval).mul_(255).to('uint8').unsqueeze(0);\n const depth = RawImage.fromTensor(formatted);\n toReturn.push({\n predicted_depth: prediction,\n depth,\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, AutoModelForUniversalSegmentation],\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 \"background-removal\": {\n // no tokenizer\n \"pipeline\": BackgroundRemovalPipeline,\n \"model\": [AutoModelForImageSegmentation, AutoModelForSemanticSegmentation, AutoModelForUniversalSegmentation],\n \"processor\": AutoProcessor,\n \"default\": {\n \"model\": \"Xenova/modnet\",\n },\n \"type\": \"image\",\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<typeof SUPPORTED_TASKS[K][\"pipeline\"]>}} SupportedTasks A mapping of pipeline names to their corresponding pipeline classes.\n * @typedef {{[K in AliasType]: InstanceType<typeof SUPPORTED_TASKS[TASK_ALIASES[K]][\"pipeline\"]>}} 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<AllTasks[T]>} 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 subfolder = 'onnx',\n use_external_data_format = 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 subfolder,\n use_external_data_format,\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<string, any>} 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 (const [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 (const 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 if (err.message?.includes('Could not locate file')) {\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 (const [name, promise] of Object.entries(result)) {\n result[name] = await promise;\n }\n\n return result;\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 '@huggingface/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 len,\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 DictionarySplitter,\n LRUCache,\n} from './utils/data-structures.js';\n\nimport { Template } from '@huggingface/jinja';\n\nimport {\n WHISPER_LANGUAGE_MAPPING\n} from './models/whisper/common_whisper.js';\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<any[]>} 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<string, any>} 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(/\\p{M}/gu, '');\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/**\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|bigint} cp The Unicode codepoint to check.\n * @returns {boolean} True if the codepoint represents a CJK character, false otherwise.\n */\nexport function 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/**\n * Helper function to fuse consecutive unknown tokens.\n * @param {string[]} arr The list of input tokens\n * @param {Map<string, any>} tokens_to_ids The mapping from tokens to token ids.\n * @param {number} unk_token_id The value to fuse on.\n * @private\n */\nfunction fuse_unk(arr, tokens_to_ids, unk_token_id) {\n const fused = [];\n let i = 0;\n while (i < arr.length) {\n fused.push(arr[i])\n if ((tokens_to_ids.get(arr[i]) ?? unk_token_id) !== unk_token_id) {\n ++i;\n continue;\n }\n\n while (++i < arr.length && (tokens_to_ids.get(arr[i]) ?? unk_token_id) === unk_token_id) {\n if (tokens_to_ids.get(fused.at(-1)) !== unk_token_id) {\n fused[fused.length - 1] += arr[i];\n }\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';\nconst PUNCTUATION_ONLY_REGEX = new RegExp(`^[${PUNCTUATION_REGEX}]+$`, 'gu');\nconst BLOOM_SPLIT_CHARS = '.,!?\\u2026\\u3002\\uff0c\\u3001\\u0964\\u06d4\\u060c';\n\n// A mapping of regex patterns to their equivalent (but possibly longer) JS-compatible versions.\nconst PROBLEMATIC_REGEX_MAP = new Map([\n // These use 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 [\"(?i:[sdmt]|ll|ve|re)\", \"(?:[sS]|[dD]|[mM]|[tT]|[lL][lL]|[vV][eE]|[rR][eE])\"],\n\n // JS doesn't support possessive quantifiers (these are used in recent OpenAI tokenizers).\n [\"[^\\\\r\\\\n\\\\p{L}\\\\p{N}]?+\", \"[^\\\\r\\\\n\\\\p{L}\\\\p{N}]?\"],\n [\"[^\\\\s\\\\p{L}\\\\p{N}]++\", \"[^\\\\s\\\\p{L}\\\\p{N}]+\"],\n\n // Used to override the default (invalid) regex of the bloom pretokenizer.\n // For more information, see https://github.com/huggingface/transformers.js/issues/94\n [` ?[^(\\\\s|[${BLOOM_SPLIT_CHARS}])]+`, ` ?[^\\\\s${BLOOM_SPLIT_CHARS}]+`],\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<string, number>}\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 case 'BPE':\n return new BPE(config);\n\n default:\n // Some older tokenizers, like `google-t5/t5-small`, `openai-community/gpt2`, and `distilbert/distilbert-base-uncased`, do not have a `type` field.\n // In this case, we can infer the tokenizer type based on the structure of the `vocab` field and other properties.\n if (config.vocab) {\n if (Array.isArray(config.vocab)) {\n // config.vocab is of type `[string, number][]`\n // @ts-ignore\n return new Unigram(config, ...args);\n } else if (Object.hasOwn(config, 'continuing_subword_prefix') && Object.hasOwn(config, 'unk_token')) {\n if (Object.hasOwn(config, 'merges')) {\n return new BPE(config);\n } else {\n return new WordPieceTokenizer(config);\n }\n } else {\n // @ts-ignore\n return new LegacyTokenizerModel(config, ...args);\n }\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 tokens.\n */\n _call(tokens) {\n tokens = this.encode(tokens);\n if (this.fuse_unk) {\n // Fuse unknown tokens\n tokens = fuse_unk(tokens, this.tokens_to_ids, this.unk_token_id);\n }\n return tokens;\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[]|bigint[]} 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<string, number>}\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 {[string, number][]} 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 /** @type {number[]} */\n this.scores = new Array(vocabSize);\n for (let i = 0; i < vocabSize; ++i) {\n [this.vocab[i], this.scores[i]] = config.vocab[i];\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.bos_token = ' '; // beginning of a sentence token\n\n this.bos_token_id = this.tokens_to_ids.get(this.bos_token); // NOTE: may be undefined\n this.eos_token = moreConfig.eos_token;\n\n this.eos_token_id = this.tokens_to_ids.get(this.eos_token);\n this.unk_token = this.vocab[this.unk_token_id];\n\n this.minScore = min(this.scores)[0];\n\n this.unk_score = this.minScore - 10.0;\n this.scores[this.unk_token_id] = this.unk_score;\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 chars = lattice.chars;\n const mblen = 1;\n let beginPos = 0;\n while (beginPos < chars.length) {\n let hasSingleNode = false;\n\n const tokens = [];\n const sliced = chars.slice(beginPos).join('');\n const prefixedTokens = this.trie.commonPrefixSearch(sliced);\n for (const token of prefixedTokens) {\n tokens.push(token);\n const tokenId = this.tokens_to_ids.get(token);\n const tokenScore = this.scores[tokenId];\n const n = len(token);\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.unk_score, 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.bos_token_id, this.eos_token_id);\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[]|[string, string][]} config.merges An array of BPE merges as strings.\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 {boolean} [config.byte_fallback=false] Whether to use spm byte-fallback trick (defaults to False)\n * @param {boolean} [config.ignore_merges=false] Whether or not to match tokens with the vocab before using merges.\n */\n constructor(config) {\n super(config);\n\n /** @type {Map<string, number>} */\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 // Tokenizers >= 0.20.0 serializes BPE merges as a [string, string][] instead of a string[],\n // which resolves the ambiguity for merges containing spaces.\n const use_new_merge_format = Array.isArray(config.merges[0]);\n\n /** @type {[string, string][]} */\n this.merges = use_new_merge_format\n ? /** @type {[string, string][]} */(config.merges)\n : (/** @type {string[]} */(config.merges)).map(x => /** @type {[string, string]} */(x.split(' ', 2)));\n this.bpe_ranks = new Map(this.merges.map((x, i) => [JSON.stringify(x), i]));\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 this.ignore_merges = this.config.ignore_merges ?? false;\n\n /**\n * The maximum length we should cache in a model.\n * Strings that are too long have minimal chances to cache hit anyway\n */\n this.max_length_to_cache = 256;\n\n /**\n * The default capacity for a `BPE`'s internal cache.\n */\n this.cache_capacity = 10000;\n this.cache = new LRUCache(this.cache_capacity);\n }\n\n /**\n * Clears the cache.\n */\n clear_cache() {\n this.cache.clear();\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 if (token.length < this.max_length_to_cache) {\n // Save the result to the cache\n this.cache.put(token, result);\n }\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(JSON.stringify([node.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 if (this.ignore_merges && this.tokens_to_ids.has(token)) {\n outputTokens.push(token);\n continue;\n }\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 if (this.byte_fallback) {\n const byteTokens = Array.from(this.text_encoder.encode(t))\n .map(x => `<0x${x.toString(16).toUpperCase().padStart(2, '0')}>`);\n if (byteTokens.every(x => this.tokens_to_ids.has(x))) {\n // Ensure the byte tokens are actually in the vocabulary, otherwise\n // we fall back to the unknown token. For more information, see\n // https://github.com/huggingface/transformers/issues/28096.\n outputTokens.push(...byteTokens);\n } else {\n outputTokens.push(this.unk_token);\n }\n } else {\n outputTokens.push(this.unk_token);\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<string, number>} */\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 'NFD':\n return new NFD(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 to the input text.\n * @extends Normalizer\n * @abstract\n */\nclass UnicodeNormalizer extends Normalizer {\n /**\n * @type {string} The Unicode normalization form to apply.\n * Should be one of: 'NFC', 'NFD', 'NFKC', or 'NFKD'.\n */\n form = undefined;\n\n /**\n * Normalize the input text by applying Unicode normalization.\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize(this.form)\n return text;\n }\n}\n\n/**\n * A normalizer that applies Unicode normalization form C (NFC) to the input text.\n * Canonical Decomposition, followed by Canonical Composition.\n * @extends UnicodeNormalizer\n */\nclass NFC extends UnicodeNormalizer {\n form = 'NFC';\n}\n\n/**\n * A normalizer that applies Unicode normalization form D (NFD) to the input text.\n * Canonical Decomposition.\n * @extends UnicodeNormalizer\n */\nclass NFD extends UnicodeNormalizer {\n form = 'NFD';\n}\n\n/**\n * A normalizer that applies Unicode normalization form KC (NFKC) to the input text.\n * Compatibility Decomposition, followed by Canonical Composition.\n * @extends UnicodeNormalizer\n */\nclass NFKC extends UnicodeNormalizer {\n form = 'NFKC';\n}\n\n/**\n * A normalizer that applies Unicode normalization form KD (NFKD) to the input text.\n * Compatibility Decomposition.\n * @extends UnicodeNormalizer\n */\nclass NFKD extends UnicodeNormalizer {\n form = 'NFKD';\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 (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 * 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 // \"Mark, Nonspacing\" (Mn)\n return text.normalize('NFD').replace(/\\p{Mn}/gu, '');\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 case 'FixedLength':\n return new FixedLengthPreTokenizer(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 if (this.config.behavior?.toLowerCase() === 'removed') {\n return text.split(this.pattern).filter(x => x);\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 case 'Sequence':\n return new PostProcessorSequence(config);\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/**\n * A post-processor that applies multiple post-processors in sequence.\n */\nclass PostProcessorSequence extends PostProcessor {\n\n /**\n * Creates a new instance of PostProcessorSequence.\n * @param {Object} config The configuration object.\n * @param {Object[]} config.processors The list of post-processors to apply.\n */\n constructor(config) {\n super(config);\n\n this.processors = config.processors.map(x => PostProcessor.fromConfig(x));\n }\n\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, options = {}) {\n let token_type_ids;\n for (const processor of this.processors) {\n if (processor instanceof ByteLevelPostProcessor) {\n // Special case where we need to pass the tokens_pair to the post-processor\n const output = processor.post_process(tokens);\n tokens = output.tokens;\n if (tokens_pair) {\n const pair_output = processor.post_process(tokens_pair);\n tokens_pair = pair_output.tokens;\n }\n } else {\n const output = processor.post_process(tokens, tokens_pair, options);\n tokens = output.tokens;\n token_type_ids = output.token_type_ids;\n }\n }\n return { tokens, token_type_ids };\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 {Object[]} 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 {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.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 normalized token does not already start with the replacement character.\n !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 {string} config.replacement The string to replace spaces with.\n */\n constructor(config) {\n super(config);\n\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 (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\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u2581\\u3000\\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\nclass FixedLengthPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {number} config.length The fixed length to split the text into.\n */\n constructor(config) {\n super();\n this._length = config.length;\n }\n\n /**\n * Pre-tokenizes the input text by splitting it into fixed-length tokens.\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 into fixed-length tokens.\n */\n pre_tokenize_text(text, options) {\n const tokens = [];\n for (let i = 0; i < text.length; i += this._length) {\n tokens.push(text.slice(i, i + this._length));\n }\n return tokens;\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<string, any[]>} 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<string, any[]>} 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 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.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/huggingface/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 this.added_tokens_splitter = new DictionarySplitter(\n this.added_tokens.map(x => x.content),\n );\n\n /** @type {Map<string, AddedToken>} */\n this.added_tokens_map = new Map(this.added_tokens.map(x => [x.content, x]))\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.bos_token = this.getToken('bos_token');\n this.bos_token_id = this.model.tokens_to_ids.get(this.bos_token);\n\n this.eos_token = this.getToken('eos_token');\n this.eos_token_id = this.model.tokens_to_ids.get(this.eos_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.add_bos_token = tokenizerConfig.add_bos_token;\n this.add_eos_token = tokenizerConfig.add_eos_token;\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.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<PreTrainedTokenizer>} 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 * @param {boolean} [options.return_token_type_ids=null] Whether to return the token type ids.\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 return_token_type_ids = null,\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, return_token_type_ids })\n )\n\n } else {\n encodedTokens = text.map(x => this._encode_plus(x, { add_special_tokens, return_token_type_ids }));\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, return_token_type_ids })];\n }\n // At this point, `encodedTokens` is batched, of shape [batch_size, tokens].\n // However, array may be jagged. So, we may need pad to max_length.\n if (max_length === null) {\n max_length = this.model_max_length;\n } else if (truncation === null) {\n if (padding === true) {\n console.warn(\n \"`max_length` is ignored when `padding: true` and there is no truncation strategy. \" +\n \"To pad to max length, use `padding: 'max_length'`.\"\n )\n max_length = this.model_max_length;\n } else if (padding === false) {\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 truncation = true;\n }\n }\n\n // padding: 'max_length' doesn't require any additional calculation\n // but padding: true has to calculate max_length from the sequences\n if (padding === true) {\n max_length = Math.min(max(encodedTokens.map(x => x.input_ids.length))[0], max_length ?? Infinity);\n }\n\n // Ensure it is less than model max length\n max_length = Math.min(max_length, this.model_max_length ?? Infinity);\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_splitter.split(text);\n\n // Process left/right stripping of added tokens\n for (let i = 0; i < sections.length; ++i) {\n const addedToken = this.added_tokens_map.get(sections[i]);\n if (addedToken) {\n if (addedToken.lstrip && i > 0) {\n sections[i - 1] = sections[i - 1].trimEnd();\n }\n if (addedToken.rstrip && i < sections.length - 1) {\n sections[i + 1] = sections[i + 1].trimStart();\n }\n }\n }\n\n const tokens = sections.flatMap((x, section_index) => {\n if (x.length === 0) return [];\n if (this.added_tokens_map.has(x)) return [x]; // Return added tokens unchanged\n\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\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 * @param {boolean} [options.return_token_type_ids=null] Whether to return token_type_ids.\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 return_token_type_ids = null,\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 ((return_token_type_ids ?? 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 * @param {boolean} [options.return_token_type_ids=null] Whether to return token_type_ids.\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 return_token_type_ids = null,\n } = {}) {\n return this._encode_plus(text, {\n text_pair,\n add_special_tokens,\n return_token_type_ids,\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[]|bigint[]|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[]|bigint[]} 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 /**\n * Retrieve the chat template string used for tokenizing chat messages. This template is used\n * internally by the `apply_chat_template` method and can also be used externally to retrieve the model's chat\n * template for better generation tracking.\n * \n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.chat_template=null]\n * A Jinja template or the name of a template to use for this conversion.\n * It is usually not necessary to pass anything to this argument,\n * as the model's template will be used by default.\n * @param {Object[]} [options.tools=null]\n * A list of tools (callable functions) that will be accessible to the model. If the template does not\n * support function calling, this argument will have no effect. Each tool should be passed as a JSON Schema,\n * giving the name, description and argument types for the tool. See our\n * [chat templating guide](https://huggingface.co/docs/transformers/main/en/chat_templating#automated-function-conversion-for-tool-use)\n * for more information.\n * @returns {string} The chat template string.\n */\n get_chat_template({\n chat_template = null,\n tools = null,\n } = {}) {\n\n // First, handle the cases when the model has a dict of multiple templates\n if (this.chat_template && typeof this.chat_template === 'object') {\n const template_dict = this.chat_template;\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) {\n if (tools !== null && 'tool_use' in template_dict) {\n chat_template = template_dict['tool_use'];\n } else if ('default' in template_dict) {\n chat_template = template_dict['default'];\n } else {\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 }\n } else if (chat_template === null) {\n // These are the cases when the model has a single template\n // priority: `chat_template` argument > `tokenizer.chat_template`\n if (this.chat_template) {\n chat_template = this.chat_template;\n } else {\n throw Error(\n \"Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template \" +\n \"argument was passed! For information about writing templates and setting the \" +\n \"tokenizer.chat_template attribute, please see the documentation at \" +\n \"https://huggingface.co/docs/transformers/main/en/chat_templating\"\n )\n }\n }\n return 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.\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 \"@huggingface/transformers\";\n * \n * const tokenizer = await AutoTokenizer.from_pretrained(\"Xenova/mistral-tokenizer-v1\");\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 * // \"<s>[INST] Hello, how are you? [/INST]I'm doing great. How can I help you today?</s> [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 * representing the chat history so far.\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 chat template will be used instead.\n * @param {Object[]} [options.tools=null]\n * A list of tools (callable functions) that will be accessible to the model. If the template does not\n * support function calling, this argument will have no effect. Each tool should be passed as a JSON Schema,\n * giving the name, description and argument types for the tool. See our\n * [chat templating guide](https://huggingface.co/docs/transformers/main/en/chat_templating#automated-function-conversion-for-tool-use)\n * for more information.\n * @param {Record<string, string>[]} [options.documents=null]\n * A list of dicts representing documents that will be accessible to the model if it is performing RAG\n * (retrieval-augmented generation). If the template does not support RAG, this argument will have no\n * effect. We recommend that each document should be a dict containing \"title\" and \"text\" keys. Please\n * see the RAG section of the [chat templating guide](https://huggingface.co/docs/transformers/main/en/chat_templating#arguments-for-RAG)\n * for examples of passing documents with chat templates.\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 {boolean} [options.return_dict=true] Whether to return a dictionary with named outputs. 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[][]|BatchEncoding} The tokenized output.\n */\n apply_chat_template(conversation, {\n tools = null,\n documents = null,\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 return_dict = false,\n tokenizer_kwargs = {},\n ...kwargs\n } = {}) {\n\n chat_template = this.get_chat_template({ chat_template, tools });\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,\n tools,\n documents,\n ...special_tokens_map,\n ...kwargs,\n });\n\n if (tokenize) {\n const out = this._call(rendered, {\n add_special_tokens: false,\n padding,\n truncation,\n max_length,\n return_tensor,\n ...tokenizer_kwargs,\n });\n return return_dict ? out : out.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 { }\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 PreTrainedTokenizer { }\n\nconst SPIECE_UNDERLINE = \"▁\";\n\nexport class LlamaTokenizer extends PreTrainedTokenizer {\n\n padding_side = 'left';\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\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 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}\nexport class CodeLlamaTokenizer extends PreTrainedTokenizer { }\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\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://huggingface.co/papers/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://huggingface.co/papers/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/**\n * WhisperTokenizer tokenizer\n * @extends PreTrainedTokenizer\n */\nexport class WhisperTokenizer extends PreTrainedTokenizer {\n\n get timestamp_begin() {\n return this.model.convert_tokens_to_ids([\"<|notimestamps|>\"])[0] + 1;\n }\n\n /**\n * Decodes automatic speech recognition (ASR) sequences.\n * @param {Array<{tokens: bigint[], token_timestamps?: number[], stride: number[]}>} sequences The sequences to decode.\n * @param {Object} options The options to use for decoding.\n * @returns {Array<string|{chunks?: undefined|Array<{language: string|null, timestamp: Array<number|null>, 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.timestamp_begin;\n // Whisper timestamp tokens start from 0.00 and go to timestamp 30.00 in 0.02 increments. \n // We can calculate the last time stamp token as timestamp_begin plus the number of tokens \n // tokens from 0.00 to 30.00 which is 1500. \n const total_timestamp_tokens = 1500; // (30.00 - 0.00) / 0.02\n const timestamp_end = timestamp_begin + total_timestamp_tokens;\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 = Number(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 = Number(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 && token <= timestamp_end) {\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\n // Do not allow punctuation-only tokens to have a duration.\n // This prevents long pauses from messing up the timestamps.\n const decoded_text = this.decode([token]);\n if (PUNCTUATION_ONLY_REGEX.test(decoded_text)) {\n // Add `time_precision` to avoid overlapping timestamps\n end_time = round(Math.min(start_time + time_precision, end_time), 2);\n }\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 // Slightly convoluted because we don't want out of bound indices\n // This will be necessary for a small conflict resolution optimization\n // later\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\n let matches;\n if (use_token_timestamp_sequences) {\n // Get length of longest subsequence of tokens that match\n // and have timestamps that are in order\n matches = left.filter((elem, idx) => (\n elem === right[idx]\n && left_token_timestamp_sequence[leftStart + idx] <= token_timestamp_sequences[i][rightStart + idx]\n )).length;\n } else {\n matches = left.filter((elem, idx) => elem === right[idx]).length;\n }\n\n // epsilon to favor long perfect matches\n const eps = j / 10000.0;\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_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[]|bigint[]} 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 (let token of token_ids) {\n token = Number(token);\n if (token >= timestamp_begin) {\n const timestamp = ((token - timestamp_begin) * time_precision).toFixed(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 => typeof s === 'string' ? s : super.decode(s, decode_args)\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}\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 { }\nexport class BlenderbotSmallTokenizer extends PreTrainedTokenizer { }\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\nexport class MgpstrTokenizer 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 MgpstrTokenizer,\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<PreTrainedTokenizer>} 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, saveBlob,\n} from './core.js';\nimport { apis } from '../env.js';\nimport { Tensor, matmul } from './tensor.js';\nimport fs from 'node:fs';\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<Float32Array>} 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 * Helper function to generate windows that are special cases of the generalized cosine window.\n * See https://www.mathworks.com/help/signal/ug/generalized-cosine-windows.html for more information.\n * @param {number} M Number of points in the output window. If zero or less, an empty array is returned.\n * @param {number} a_0 Offset for the generalized cosine window.\n * @returns {Float64Array} The generated window.\n */\nfunction generalized_cosine_window(M, a_0) {\n if (M < 1) {\n return new Float64Array();\n }\n if (M === 1) {\n return new Float64Array([1]);\n }\n\n const a_1 = 1 - a_0;\n const factor = 2 * Math.PI / (M - 1);\n\n const cos_vals = new Float64Array(M);\n for (let i = 0; i < M; ++i) {\n cos_vals[i] = a_0 - a_1 * Math.cos(i * factor);\n }\n return cos_vals;\n}\n\n/**\n * Generates a Hanning window of length M.\n * See https://numpy.org/doc/stable/reference/generated/numpy.hanning.html for more information.\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 return generalized_cosine_window(M, 0.5);\n}\n\n\n/**\n * Generates a Hamming window of length M.\n * See https://numpy.org/doc/stable/reference/generated/numpy.hamming.html for more information.\n *\n * @param {number} M The length of the Hamming window to generate.\n * @returns {Float64Array} The generated Hamming window.\n */\nexport function hamming(M) {\n return generalized_cosine_window(M, 0.54);\n}\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 // @ts-expect-error ts(2322)\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 // @ts-expect-error ts(2322)\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 frequency bins (should be the same as `n_fft // 2 + 1`\n * where `n_fft` is the size of the Fourier Transform used to compute the spectrogram).\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 if (num_frequency_bins < 2) {\n throw new Error(`Require num_frequency_bins: ${num_frequency_bins} >= 2`);\n }\n\n if (min_frequency > max_frequency) {\n throw new Error(`Require min_frequency: ${min_frequency} <= max_frequency: ${max_frequency}`);\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 - 1) * 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 {boolean} [options.preemphasis_htk_flavor=true] Whether to apply the pre-emphasis filter in the HTK flavor.\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 {number} [options.min_num_frames=null] If provided, ensures the number of frames to compute is at least 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 * @param {number} [options.mel_offset=0] Offset to add to the mel spectrogram to avoid taking the log of zero.\n * @returns {Promise<Tensor>} Spectrogram of shape `(num_frequency_bins, length)` (regular spectrogram) or shape `(num_mel_filters, length)` (mel spectrogram).\n */\nexport async 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 preemphasis_htk_flavor = true,\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 min_num_frames = null,\n max_num_frames = null,\n do_pad = true,\n transpose = false,\n mel_offset = 0,\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 (power === null && mel_filters !== null) {\n throw new Error(\n \"You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. \" +\n \"Specify `power` to fix this issue.\"\n );\n }\n\n if (!preemphasis_htk_flavor) {\n throw new Error(\n \"`preemphasis_htk_flavor=false` is not currently supported.\"\n );\n }\n\n if (center) {\n switch (pad_mode) {\n case 'reflect': {\n const half_window = Math.floor((fft_length - 1) / 2) + 1;\n waveform = padReflect(waveform, half_window, half_window);\n break;\n }\n case 'constant': {\n const padding = Math.floor(fft_length / 2);\n // @ts-expect-error ts(2351)\n const padded = new waveform.constructor(waveform.length + 2 * padding);\n padded.set(waveform, padding);\n waveform = padded;\n break;\n }\n default:\n throw new Error(`pad_mode=\"${pad_mode}\" not implemented yet.`);\n }\n }\n\n // split waveform into frames of frame_length size\n let num_frames = Math.floor(1 + Math.floor((waveform.length - frame_length) / hop_length))\n if (min_num_frames !== null && num_frames < min_num_frames) {\n num_frames = min_num_frames\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 transposedMagnitudeData = new Float32Array(num_frequency_bins * d1Max);\n\n for (let i = 0; i < d1; ++i) {\n // Populate buffer with waveform data\n const offset = i * hop_length;\n const buffer_size = Math.min(waveform.length - offset, frame_length);\n if (buffer_size !== frame_length) {\n // The full buffer is not needed, so we need to reset it (avoid overflow from previous iterations)\n // NOTE: We don't need to reset the buffer if it's full since we overwrite the first\n // `frame_length` values and the rest (`fft_length - frame_length`) remains zero.\n inputBuffer.fill(0, 0, frame_length);\n }\n\n for (let j = 0; j < buffer_size; ++j) {\n inputBuffer[j] = waveform[offset + j];\n }\n\n if (remove_dc_offset) {\n let sum = 0;\n for (let j = 0; j < buffer_size; ++j) {\n sum += inputBuffer[j];\n }\n const mean = sum / buffer_size;\n for (let j = 0; j < buffer_size; ++j) {\n inputBuffer[j] -= mean;\n }\n }\n\n if (preemphasis !== null) {\n // Done in reverse to avoid copies and destructive modification\n for (let j = buffer_size - 1; j >= 1; --j) {\n inputBuffer[j] -= preemphasis * inputBuffer[j - 1];\n }\n inputBuffer[0] *= 1 - preemphasis;\n }\n\n // Apply window function\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 for (let j = 0; j < num_frequency_bins; ++j) {\n const j2 = j << 1;\n\n // NOTE: We transpose the data here to avoid doing it later\n transposedMagnitudeData[j * d1Max + i] = outputBuffer[j2] ** 2 + outputBuffer[j2 + 1] ** 2;\n }\n }\n\n if (power !== null && power !== 2) {\n // slight optimization to not sqrt\n const pow = power / 2; // we use 2 since we already squared\n for (let i = 0; i < transposedMagnitudeData.length; ++i) {\n transposedMagnitudeData[i] **= pow;\n }\n }\n\n // TODO: What if `mel_filters` is null?\n const num_mel_filters = mel_filters.length;\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 let mel_spec = await matmul(\n // TODO: Make `mel_filters` a Tensor during initialization\n new Tensor('float32', mel_filters.flat(), [num_mel_filters, num_frequency_bins]),\n new Tensor('float32', transposedMagnitudeData, [num_frequency_bins, d1Max]),\n );\n if (transpose) {\n mel_spec = mel_spec.transpose(1, 0);\n }\n\n const mel_spec_data = /** @type {Float32Array} */(mel_spec.data);\n for (let i = 0; i < mel_spec_data.length; ++i) {\n mel_spec_data[i] = mel_offset + Math.max(mel_floor, mel_spec_data[i]);\n }\n\n if (power !== null && log_mel !== null) {\n const o = Math.min(mel_spec_data.length, d1 * num_mel_filters);\n // NOTE: operates in-place\n switch (log_mel) {\n case 'log':\n for (let i = 0; i < o; ++i) {\n mel_spec_data[i] = Math.log(mel_spec_data[i]);\n }\n break;\n case 'log10':\n for (let i = 0; i < o; ++i) {\n mel_spec_data[i] = Math.log10(mel_spec_data[i]);\n }\n break;\n case 'dB':\n if (power === 1.0) {\n amplitude_to_db(mel_spec_data, reference, min_value, db_range);\n } else if (power === 2.0) {\n power_to_db(mel_spec_data, 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 mel_spec;\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 'hamming':\n window = hamming(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 * Encode audio data to a WAV file.\n * WAV file specs : https://en.wikipedia.org/wiki/WAV#WAV_File_header\n * \n * Adapted from https://www.npmjs.com/package/audiobuffer-to-wav\n * @param {Float32Array} samples The audio samples.\n * @param {number} rate The sample rate.\n * @returns {ArrayBuffer} The WAV audio buffer.\n */\nfunction encodeWAV(samples, rate) {\n let offset = 44;\n const buffer = new ArrayBuffer(offset + samples.length * 4);\n const view = new DataView(buffer);\n\n /* RIFF identifier */\n writeString(view, 0, \"RIFF\");\n /* RIFF chunk length */\n view.setUint32(4, 36 + samples.length * 4, true);\n /* RIFF type */\n writeString(view, 8, \"WAVE\");\n /* format chunk identifier */\n writeString(view, 12, \"fmt \");\n /* format chunk length */\n view.setUint32(16, 16, true);\n /* sample format (raw) */\n view.setUint16(20, 3, true);\n /* channel count */\n view.setUint16(22, 1, true);\n /* sample rate */\n view.setUint32(24, rate, true);\n /* byte rate (sample rate * block align) */\n view.setUint32(28, rate * 4, true);\n /* block align (channel count * bytes per sample) */\n view.setUint16(32, 4, true);\n /* bits per sample */\n view.setUint16(34, 32, true);\n /* data chunk identifier */\n writeString(view, 36, \"data\");\n /* data chunk length */\n view.setUint32(40, samples.length * 4, true);\n\n for (let i = 0; i < samples.length; ++i, offset += 4) {\n view.setFloat32(offset, samples[i], true);\n }\n\n return buffer;\n}\n\nfunction writeString(view, offset, string) {\n for (let i = 0; i < string.length; ++i) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n}\n\n\nexport class RawAudio {\n\n /**\n * Create a new `RawAudio` object.\n * @param {Float32Array} audio Audio data\n * @param {number} sampling_rate Sampling rate of the audio data\n */\n constructor(audio, sampling_rate) {\n this.audio = audio\n this.sampling_rate = sampling_rate\n }\n\n /**\n * Convert the audio to a wav file buffer.\n * @returns {ArrayBuffer} The WAV file.\n */\n toWav() {\n return encodeWAV(this.audio, this.sampling_rate)\n }\n\n /**\n * Convert the audio to a blob.\n * @returns {Blob}\n */\n toBlob() {\n const wav = this.toWav();\n const blob = new Blob([wav], { type: 'audio/wav' });\n return blob;\n }\n\n /**\n * Save the audio to a wav file.\n * @param {string} path\n */\n async save(path) {\n let fn;\n\n if (apis.IS_BROWSER_ENV) {\n if (apis.IS_WEBWORKER_ENV) {\n throw new Error('Unable to save a file from a Web Worker.')\n }\n fn = saveBlob;\n } else if (apis.IS_FS_AVAILABLE) {\n fn = async (/** @type {string} */ path, /** @type {Blob} */ blob) => {\n let buffer = await blob.arrayBuffer();\n fs.writeFileSync(path, Buffer.from(buffer));\n }\n } else {\n throw new Error('Unable to save because filesystem is disabled in this environment.')\n }\n\n await fn(path, this.toBlob())\n }\n}\n","\nexport const GITHUB_ISSUE_URL = 'https://github.com/huggingface/transformers.js/issues/new/choose';\n\nexport const CONFIG_NAME = \"config.json\"\nexport const FEATURE_EXTRACTOR_NAME = \"preprocessor_config.json\"\nexport const IMAGE_PROCESSOR_NAME = FEATURE_EXTRACTOR_NAME\nexport const PROCESSOR_NAME = \"processor_config.json\"\nexport const CHAT_TEMPLATE_NAME = \"chat_template.jinja\"\nexport const GENERATION_CONFIG_NAME = \"generation_config.json\"\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 * @typedef {Object} InitiateProgressInfo\n * @property {'initiate'} status\n * @property {string} name The model id or directory path.\n * @property {string} file The name of the file.\n */\n\n/**\n * @typedef {Object} DownloadProgressInfo\n * @property {'download'} status\n * @property {string} name The model id or directory path.\n * @property {string} file The name of the file.\n */\n\n/**\n * @typedef {Object} ProgressStatusInfo\n * @property {'progress'} status\n * @property {string} name The model id or directory path.\n * @property {string} file The name of the file.\n * @property {number} progress A number between 0 and 100.\n * @property {number} loaded The number of bytes loaded.\n * @property {number} total The total number of bytes to be loaded.\n */\n\n/**\n * @typedef {Object} DoneProgressInfo\n * @property {'done'} status\n * @property {string} name The model id or directory path.\n * @property {string} file The name of the file.\n */\n\n/**\n * @typedef {Object} ReadyProgressInfo\n * @property {'ready'} status\n * @property {string} task The loaded task.\n * @property {string} model The loaded model.\n */\n\n/**\n * @typedef {InitiateProgressInfo | DownloadProgressInfo | ProgressStatusInfo | DoneProgressInfo | ReadyProgressInfo} ProgressInfo\n */\n\n/**\n * A callback function that is called with progress information.\n * @callback ProgressCallback\n * @param {ProgressInfo} progressInfo\n * @returns {void}\n */\n\n/**\n * Helper function to dispatch progress callbacks.\n *\n * @param {ProgressCallback | null | undefined} progress_callback The progress callback function to dispatch.\n * @param {ProgressInfo} 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 * Determine if a provided width or height is nullish.\n * @param {*} x The value to check.\n * @returns {boolean} True if the value is `null`, `undefined` or `-1`, false otherwise.\n */\nexport function isNullishDimension(x) {\n return x === null || x === undefined || x === -1;\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 * Save blob file on the web.\n * @param {string} path The path to save the blob to\n * @param {Blob} blob The blob to save\n */\nexport function saveBlob(path, blob){\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 // Revoke the Object URL to free up memory\n URL.revokeObjectURL(dataURL);\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 * Calculate the length of a string, taking multi-byte characters into account.\n * This mimics the behavior of Python's `len` function.\n * @param {string} s The string to calculate the length of.\n * @returns {number} The length of the string.\n */\nexport function len(s) {\n let length = 0;\n for (const c of s) ++length;\n return length;\n}\n\n/**\n * Count the occurrences of a value in an array or string.\n * This mimics the behavior of Python's `count` method.\n * @param {any[]|string} arr The array or string to search.\n * @param {any} value The value to count.\n */\nexport function count(arr, value) {\n let count = 0;\n for (const v of arr) {\n if (v === value) ++count;\n }\n return count;\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(any, any): boolean} comparator Comparator function to determine priority. Defaults to a MaxHeap.\n */\n constructor(comparator = (a, b) => a > b, maxSize = Infinity) {\n this._heap = [];\n this._comparator = comparator;\n this._maxSize = maxSize;\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 if (this.size < this._maxSize) {\n this._heap.push(value);\n this._siftUp();\n } else {\n // Get index of value with the lowest priority\n const smallest = this._smallest();\n\n // If the new value has higher priority than the smallest value in the heap\n // then replace the smallest value with the new value and update the heap\n if (this._comparator(value, this._heap[smallest])) {\n this._heap[smallest] = value;\n this._siftUpFrom(smallest);\n }\n }\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 this._siftUpFrom(this.size - 1);\n }\n\n /**\n * Helper function to sift up from a given node.\n * @param {number} node The index of the node to start sifting up from.\n */\n _siftUpFrom(node) {\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 /**\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 * Get the index of the smallest element in the heap. Since we use an array-based heap,\n * the index can be computed without needing to traverse the heap.\n * @private\n */\n _smallest() {\n return (2 ** (Math.floor(Math.log2(this.size))) - 1);\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 (const 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 (const 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 if (node === undefined) return;\n\n let prefix = \"\";\n for (const ch of text) {\n prefix += ch;\n node = node.children.get(ch);\n if (node === undefined) return;\n if (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<string, CharTrieNode>} 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.chars = Array.from(sentence);\n this.len = this.chars.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 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.chars.slice(node.pos, node.pos + node.length).join('');\n }\n\n /**\n * @returns {string[]} 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 {number[]} The most likely sequence of token ids.\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\n/**\n * A data structure which uses a trie to split a string into tokens based on a dictionary.\n * It can also use a regular expression to preprocess the input text before splitting.\n * \n * NOTE: To ensure multi-byte characters are handled correctly, we operate at byte-level instead of character-level.\n */\nexport class DictionarySplitter {\n /**\n * @param {string[]} dictionary The dictionary of words to use for splitting.\n */\n constructor(dictionary) {\n this.trie = this._buildTrie(dictionary);\n }\n\n /**\n * Builds a trie from the given dictionary.\n * @param {string[]} dictionary The dictionary of words to build the trie from.\n * @returns {Object} The root node of the trie.\n * @private\n */\n _buildTrie(dictionary) {\n const trie = Object.create(null);\n for (const word of dictionary) {\n let node = trie;\n for (let i = 0; i < word.length; ++i) {\n node = (node[word[i]] ??= Object.create(null));\n }\n node.end = word;\n }\n return trie;\n }\n\n /**\n * Splits the input text into tokens based on the dictionary.\n * @param {string} text The input text to split.\n * @returns {string[]} An array of tokens.\n */\n split(text) {\n const result = [];\n const n = text.length;\n let start = 0;\n let i = 0;\n\n while (i < n) {\n let node = this.trie;\n let match = null;\n let j = i;\n\n while (j < n && (node = node[text[j]])) {\n if (node.end) {\n // Always keep the last (i.e., longest) match.\n match = node.end;\n }\n ++j;\n }\n\n if (match) {\n if (i > start) {\n result.push(text.slice(start, i));\n }\n result.push(match);\n i += match.length;\n start = i;\n } else {\n ++i;\n }\n }\n if (start < n) {\n result.push(text.slice(start));\n }\n return result;\n }\n}\n\n/**\n* A simple Least Recently Used (LRU) cache implementation in JavaScript.\n* This cache stores key-value pairs and evicts the least recently used item\n* when the capacity is exceeded.\n*/\nexport class LRUCache {\n /**\n * Creates an LRUCache instance.\n * @param {number} capacity The maximum number of items the cache can hold.\n */\n constructor(capacity) {\n this.capacity = capacity;\n this.cache = new Map();\n }\n\n /**\n * Retrieves the value associated with the given key and marks the key as recently used.\n * @param {any} key The key to retrieve.\n * @returns {any} The value associated with the key, or undefined if the key does not exist.\n */\n get(key) {\n if (!this.cache.has(key)) return undefined;\n const value = this.cache.get(key);\n this.cache.delete(key);\n this.cache.set(key, value);\n return value;\n }\n\n /**\n * Inserts or updates the key-value pair in the cache.\n * If the key already exists, it is updated and marked as recently used.\n * If the cache exceeds its capacity, the least recently used item is evicted.\n * @param {any} key The key to add or update.\n * @param {any} value The value to associate with the key.\n */\n put(key, value) {\n if (this.cache.has(key)) {\n this.cache.delete(key);\n }\n this.cache.set(key, value);\n if (this.cache.size > this.capacity) {\n this.cache.delete(this.cache.keys().next().value);\n }\n }\n\n /**\n * Clears the cache.\n */\n clear() {\n this.cache.clear();\n }\n}\n","\n/**\n * The list of devices supported by Transformers.js\n */\nexport const DEVICE_TYPES = Object.freeze({\n auto: 'auto', // Auto-detect based on device and environment\n gpu: 'gpu', // Auto-detect GPU\n cpu: 'cpu', // CPU\n wasm: 'wasm', // WebAssembly\n webgpu: 'webgpu', // WebGPU\n cuda: 'cuda', // CUDA\n dml: 'dml', // DirectML\n\n webnn: 'webnn', // WebNN (default)\n 'webnn-npu': 'webnn-npu', // WebNN NPU\n 'webnn-gpu': 'webnn-gpu', // WebNN GPU\n 'webnn-cpu': 'webnn-cpu', // WebNN CPU\n});\n\n/**\n * @typedef {keyof typeof DEVICE_TYPES} DeviceType\n */\n","/// <reference types=\"@webgpu/types\" />\n\nimport { 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 WebGPU fp16 support is available in the current environment.\n */\nexport const isWebGpuFp16Supported = (function () {\n /** @type {boolean} */\n let cachedResult;\n\n return async function () {\n if (cachedResult === undefined) {\n 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 auto: 'auto', // Auto-detect based on environment\n fp32: 'fp32',\n fp16: 'fp16',\n q8: 'q8',\n int8: 'int8',\n uint8: 'uint8',\n q4: 'q4',\n bnb4: 'bnb4',\n q4f16: 'q4f16', // fp16 model with int4 block weight quantization\n});\n/** @typedef {keyof typeof DATA_TYPES} DataType */\n\nexport const DEFAULT_DEVICE_DTYPE_MAPPING = Object.freeze({\n // NOTE: If not specified, will default to fp32\n [DEVICE_TYPES.wasm]: DATA_TYPES.q8,\n});\n\n/** @type {Record<Exclude<DataType, \"auto\">, string>} */\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 [DATA_TYPES.q4]: '_q4',\n [DATA_TYPES.q4f16]: '_q4f16',\n [DATA_TYPES.bnb4]: '_bnb4',\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 'node:fs';\nimport path from 'node:path';\n\nimport { apis, env } from '../env.js';\nimport { dispatchCallback } from './core.js';\n\n/**\n * @typedef {boolean|number} ExternalData Whether to load the model using the external data format (used for models >= 2GB in size).\n * If `true`, the model will be loaded using the external data format.\n * If a number, this many chunks will be loaded using the external data format (of the form: \"model.onnx_data[_{chunk_number}]\").\n */\nexport const MAX_EXTERNAL_DATA_CHUNKS = 100;\n\n/**\n * @typedef {Object} PretrainedOptions Options for loading a pretrained model.\n * @property {import('./core.js').ProgressCallback} [progress_callback=null] If specified, this function will be called during model construction, to provide the user with progress updates.\n * @property {import('../configs.js').PretrainedConfig} [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<string, import(\"./devices.js\").DeviceType>} [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<string, import(\"./dtypes.js\").DataType>} [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 {ExternalData|Record<string, ExternalData>} [use_external_data_format=false] Whether to load the model using the external data format (used for models >= 2GB in size).\n * @property {import('onnxruntime-common').InferenceSession.SessionOptions} [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\n/**\n * Mapping from file extensions to MIME types.\n */\nconst 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}\nclass FileResponse {\n\n /**\n * Creates a new `FileResponse` object.\n * @param {string} 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 const stream = fs.createReadStream(filePath);\n this.body = new ReadableStream({\n start(controller) {\n stream.on('data', (chunk) => controller.enqueue(chunk));\n stream.on('end', () => controller.close());\n stream.on('error', (err) => controller.error(err));\n },\n cancel() {\n stream.destroy();\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', 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<ArrayBuffer>} 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 /** @type {ArrayBuffer} */ (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<Blob>} 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<string>} 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<Object>} 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 URL.\n * @param {string|URL} string The string to test for validity as an URL.\n * @param {string[]} [protocols=null] A list of valid protocols. If specified, the protocol must be in this list.\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 URL, false otherwise.\n */\nfunction isValidUrl(string, protocols = null, validHosts = null) {\n let url;\n try {\n url = new URL(string);\n } catch (_) {\n return false;\n }\n if (protocols && !protocols.includes(url.protocol)) {\n return false;\n }\n if (validHosts && !validHosts.includes(url.hostname)) {\n return false;\n }\n return true;\n}\n\nconst REPO_ID_REGEX = /^(\\b[\\w\\-.]+\\b\\/)?\\b[\\w\\-.]{1,96}\\b$/;\n\n/**\n * Tests whether a string is a valid Hugging Face model ID or not.\n * Adapted from https://github.com/huggingface/huggingface_hub/blob/6378820ebb03f071988a96c7f3268f5bdf8f9449/src/huggingface_hub/utils/_validators.py#L119-L170\n *\n * @param {string} string The string to test\n * @returns {boolean} True if the string is a valid model ID, false otherwise.\n */\nfunction isValidHfModelId(string) {\n if (!REPO_ID_REGEX.test(string)) return false;\n if (string.includes(\"..\") || string.includes(\"--\")) return false;\n if (string.endsWith(\".git\") || string.endsWith(\".ipynb\")) return false;\n return true;\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<FileResponse|Response>} 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 && !isValidUrl(urlOrPath, [\"http:\", \"https:\", \"blob:\"])) {\n return new FileResponse(\n urlOrPath instanceof URL\n ? urlOrPath.protocol === \"file:\"\n ? urlOrPath.pathname\n : urlOrPath.toString()\n : 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 = isValidUrl(urlOrPath, ['http:', 'https:'], ['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<FileResponse | undefined>}\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} response\n * @param {(data: {progress: number, loaded: number, total: number}) => void} [progress_callback] Optional.\n * The function to call with progress updates\n * @returns {Promise<void>}\n */\n async put(request, response, progress_callback = undefined) {\n let filePath = path.join(this.path, request);\n\n try {\n const contentLength = response.headers.get('Content-Length');\n const total = parseInt(contentLength ?? '0');\n let loaded = 0;\n\n await fs.promises.mkdir(path.dirname(filePath), { recursive: true });\n const fileStream = fs.createWriteStream(filePath);\n const reader = response.body.getReader();\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n\n await new Promise((resolve, reject) => {\n fileStream.write(value, (err) => {\n if (err) {\n reject(err);\n return;\n }\n resolve();\n });\n });\n\n loaded += value.length;\n const progress = total ? (loaded / total) * 100 : 0;\n\n progress_callback?.({ progress, loaded, total });\n }\n\n fileStream.close();\n } catch (error) {\n // Clean up the file if an error occurred during download\n try {\n await fs.promises.unlink(filePath);\n } catch { }\n throw error;\n }\n }\n\n // TODO add the rest?\n // addAll(requests: RequestInfo[]): Promise<void>;\n // delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;\n // keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;\n // match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;\n // matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;\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<FileResponse|Response|undefined>} 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 * 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 * @param {boolean} [return_path=false] Whether to return the path of the file instead of the file content.\n *\n * @throws Will throw an error if the file is not found and `fatal` is true.\n * @returns {Promise<string|Uint8Array>} A Promise that resolves with the file content as a Uint8Array if `return_path` is false, or the file path as a string if `return_path` is true.\n */\nexport async function getModelFile(path_or_repo_id, filename, fatal = true, options = {}, return_path = false) {\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.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 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 if (!apis.IS_FS_AVAILABLE) {\n throw Error('File System Cache is not available in this environment.');\n }\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 const revision = options.revision ?? 'main';\n const requestURL = pathJoin(path_or_repo_id, filename);\n\n const validModelId = isValidHfModelId(path_or_repo_id);\n const localPath = validModelId\n ? pathJoin(env.localModelPath, requestURL)\n : requestURL;\n const 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 /** @type {string} */\n let cacheKey;\n const proposedCacheKey = cache instanceof FileCache\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 ? revision === 'main' ? requestURL : pathJoin(path_or_repo_id, revision, filename)\n : 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 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 = isValidUrl(requestURL, ['http:', 'https:']);\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 if (!validModelId) {\n // Before making any requests to the remote server, we check if the model ID is valid.\n // This prevents unnecessary network requests for invalid model IDs.\n throw Error(`Local file missing at \"${localPath}\" and download aborted due to invalid model ID \"${path_or_repo_id}\".`);\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 let result;\n if (!(apis.IS_NODE_ENV && return_path)) {\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 status: 'progress',\n name: path_or_repo_id,\n file: filename,\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 status: 'progress',\n name: path_or_repo_id,\n file: filename,\n ...data,\n })\n })\n }\n result = buffer;\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 if (!result) {\n // We haven't yet read the response body, so we need to do so now.\n // Ensure progress updates include consistent metadata.\n const wrapped_progress = options.progress_callback\n ? (data) => dispatchCallback(options.progress_callback, {\n status: 'progress',\n name: path_or_repo_id,\n file: filename,\n ...data,\n })\n : undefined;\n await cache.put(cacheKey, /** @type {Response} */(response), wrapped_progress);\n } else {\n // NOTE: We use `new Response(buffer, ...)` instead of `response.clone()` to handle LFS files\n await cache.put(cacheKey, new Response(result, {\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 dispatchCallback(options.progress_callback, {\n status: 'done',\n name: path_or_repo_id,\n file: filename\n });\n\n if (result) {\n if (!apis.IS_NODE_ENV && return_path) {\n throw new Error(\"Cannot return path in a browser environment.\")\n }\n return result;\n }\n if (response instanceof FileResponse) {\n return response.filePath;\n }\n\n // Otherwise, return the cached response (most likely a `FileResponse`).\n // NOTE: A custom cache may return a Response, or a string (file path)\n const cachedResponse = await cache?.match(cacheKey);\n if (cachedResponse instanceof FileResponse) {\n return cachedResponse.filePath;\n } else if (cachedResponse instanceof Response) {\n return new Uint8Array(await cachedResponse.arrayBuffer());\n } else if (typeof cachedResponse === 'string') {\n return cachedResponse;\n }\n\n throw new Error(\"Unable to get model file path or buffer.\");\n}\n\n/**\n * Fetches a text 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<string|null>} The text content of the file.\n * @throws Will throw an error if the file is not found and `fatal` is true.\n */\nexport async function getModelText(modelPath, fileName, fatal = true, options = {}) {\n const buffer = await getModelFile(modelPath, fileName, fatal, options, false);\n if (buffer === null) {\n return null;\n }\n\n const decoder = new TextDecoder('utf-8');\n return decoder.decode(/** @type {Uint8Array} */(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<Object>} 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 const text = await getModelText(modelPath, fileName, fatal, options);\n if (text === null) {\n // Return empty object\n return {};\n }\n\n return JSON.parse(text);\n}\n/**\n * Read and track progress when reading a Response object\n *\n * @param {Response|FileResponse} response The Response object to read\n * @param {(data: {progress: number, loaded: number, total: number}) => void} progress_callback The function to call with progress updates\n * @returns {Promise<Uint8Array>} 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 const 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 const 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({ progress, loaded, total });\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 { isNullishDimension, saveBlob } from './core.js';\nimport { getFile } from './hub.js';\nimport { apis } 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\nlet createCanvasFunction;\nlet ImageDataClass;\nlet loadImageFunction;\nconst IS_BROWSER_OR_WEBWORKER = apis.IS_BROWSER_ENV || apis.IS_WEBWORKER_ENV;\nif (IS_BROWSER_OR_WEBWORKER) {\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.rotate().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|Blob|HTMLCanvasElement|OffscreenCanvas} 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 if (input instanceof Blob) {\n return await this.fromBlob(input);\n } else if (\n (typeof HTMLCanvasElement !== \"undefined\" && input instanceof HTMLCanvasElement)\n ||\n (typeof OffscreenCanvas !== \"undefined\" && input instanceof OffscreenCanvas)\n ) {\n return this.fromCanvas(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 (!IS_BROWSER_OR_WEBWORKER) {\n throw new Error('fromCanvas() is only supported in browser environments.')\n }\n\n const ctx = /** @type {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} */ (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<RawImage>} 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<RawImage>} The image object.\n */\n static async fromBlob(blob) {\n if (IS_BROWSER_OR_WEBWORKER) {\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 * Apply an alpha mask to the image. Operates in place.\n * @param {RawImage} mask The mask to apply. It should have a single channel.\n * @returns {RawImage} The masked image.\n * @throws {Error} If the mask is not the same size as the image.\n * @throws {Error} If the image does not have 4 channels.\n * @throws {Error} If the mask is not a single channel.\n */\n putAlpha(mask) {\n if (mask.width !== this.width || mask.height !== this.height) {\n throw new Error(`Expected mask size to be ${this.width}x${this.height}, but got ${mask.width}x${mask.height}`);\n }\n if (mask.channels !== 1) {\n throw new Error(`Expected mask to have 1 channel, but got ${mask.channels}`);\n }\n\n const this_data = this.data;\n const mask_data = mask.data;\n const num_pixels = this.width * this.height;\n if (this.channels === 3) {\n // Convert to RGBA and simultaneously apply mask to alpha channel\n const newData = new Uint8ClampedArray(num_pixels * 4);\n for (let i = 0, in_offset = 0, out_offset = 0; i < num_pixels; ++i) {\n newData[out_offset++] = this_data[in_offset++];\n newData[out_offset++] = this_data[in_offset++];\n newData[out_offset++] = this_data[in_offset++];\n newData[out_offset++] = mask_data[i];\n }\n return this._update(newData, this.width, this.height, 4);\n\n } else if (this.channels === 4) {\n // Apply mask to alpha channel in place\n for (let i = 0; i < num_pixels; ++i) {\n this_data[4 * i + 3] = mask_data[i];\n }\n return this;\n }\n throw new Error(`Expected image to have 3 or 4 channels, but got ${this.channels}`);\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. `null` or `-1` will preserve the aspect ratio.\n * @param {number} height The height of the new image. `null` or `-1` will preserve the aspect ratio.\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<RawImage>} `this` to support chaining.\n */\n async resize(width, height, {\n resample = 2,\n } = {}) {\n\n // Do nothing if the image already has the desired size\n if (this.width === width && this.height === height) {\n return this;\n }\n\n // Ensure resample method is a string\n let resampleMethod = RESAMPLING_MAPPING[resample] ?? resample;\n\n // Calculate width / height to maintain aspect ratio, in the event that\n // the user passed a null value in.\n // This allows users to pass in something like `resize(320, null)` to\n // resize to 320 width, but maintain aspect ratio.\n const nullish_width = isNullishDimension(width);\n const nullish_height = isNullishDimension(height);\n if (nullish_width && nullish_height) {\n return this;\n } else if (nullish_width) {\n width = (height / this.height) * this.width;\n } else if (nullish_height) {\n height = (width / this.width) * this.height;\n }\n\n if (IS_BROWSER_OR_WEBWORKER) {\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 (IS_BROWSER_OR_WEBWORKER) {\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, this.width, this.height\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\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 (IS_BROWSER_OR_WEBWORKER) {\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 (IS_BROWSER_OR_WEBWORKER) {\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 (!IS_BROWSER_OR_WEBWORKER) {\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 (!IS_BROWSER_OR_WEBWORKER) {\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 * Split this image into individual bands. This method returns an array of individual image bands from an image.\n * For example, splitting an \"RGB\" image creates three new images each containing a copy of one of the original bands (red, green, blue).\n * \n * Inspired by PIL's `Image.split()` [function](https://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.split).\n * @returns {RawImage[]} An array containing bands.\n */\n split() {\n const { data, width, height, channels } = this;\n\n /** @type {typeof Uint8Array | typeof Uint8ClampedArray} */\n const data_type = /** @type {any} */(data.constructor);\n const per_channel_length = data.length / channels;\n\n // Pre-allocate buffers for each channel\n const split_data = Array.from(\n { length: channels },\n () => new data_type(per_channel_length),\n );\n\n // Write pixel data\n for (let i = 0; i < per_channel_length; ++i) {\n const data_offset = channels * i;\n for (let j = 0; j < channels; ++j) {\n split_data[j][i] = data[data_offset + j];\n }\n }\n return split_data.map((data) => new RawImage(data, width, height, 1));\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 (IS_BROWSER_OR_WEBWORKER) {\n if (apis.IS_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 saveBlob(path, blob)\n\n } else if (!apis.IS_FS_AVAILABLE) {\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 (IS_BROWSER_OR_WEBWORKER) {\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/**\n * Helper function to load an image from a URL, path, etc.\n */\nexport const load_image = RawImage.read.bind(RawImage);\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 | Float16Array | 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 maximum value in the array\n const maxVal = max(arr)[0];\n\n // Compute the sum of the exponentials\n let sumExps = 0;\n for(let i = 0; i < arr.length; ++i) {\n sumExps += Math.exp(arr[i] - maxVal);\n }\n\n // Compute the log of the sum\n const logSum = Math.log(sumExps);\n\n // Compute the softmax values\n const logSoftmaxArr = arr.map(x => x - maxVal - logSum);\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 * 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 * @template {number[]|bigint[]|AnyTypedArray} T\n * @param {T} arr array of numbers.\n * @returns {T extends bigint[]|BigTypedArray ? [bigint, number] : [number, 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 /** @type {T extends bigint[]|BigTypedArray ? [bigint, number] : [number, number]} */([min, indexOfMin]);\n}\n\n\n/**\n * Returns the value and index of the maximum element in an array.\n * @template {number[]|bigint[]|AnyTypedArray} T\n * @param {T} arr array of numbers.\n * @returns {T extends bigint[]|BigTypedArray ? [bigint, number] : [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 /** @type {T extends bigint[]|BigTypedArray ? [bigint, number] : [number, 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 * 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 const table = this.table;\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 = table[k];\n const tableBi = inv * table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = table[2 * k];\n const tableCi = inv * table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = table[3 * k];\n const tableDi = inv * 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 // Loop through steps in decreasing order\n const table = this.table;\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const halfLen = len >>> 1;\n const quarterLen = halfLen >>> 1;\n const hquarterLen = quarterLen >>> 1;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n for (let i = 0, k = 0; i <= hquarterLen; i += 2, k += step) {\n const A = outOff + 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 // Middle values\n const MAr = Ar;\n const MAi = Ai;\n\n const tableBr = table[k];\n const tableBi = inv * table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = table[2 * k];\n const tableCi = inv * table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = table[3 * k];\n const tableDi = inv * 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 = MAr + MCr;\n const T0i = MAi + MCi;\n const T1r = MAr - MCr;\n const T1i = MAi - 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\n // Output final middle point\n if (i === 0) {\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n continue;\n }\n\n // Do not overwrite ourselves\n if (i === hquarterLen)\n continue;\n\n const SA = outOff + quarterLen - i;\n const SB = outOff + halfLen - i;\n\n out[SA] = T1r - inv * T3i;\n out[SA + 1] = -T1i - inv * T3r;\n out[SB] = T0r - inv * T2r;\n out[SB + 1] = -T0i + inv * T2i;\n }\n }\n }\n\n // Complete the spectrum by adding its mirrored negative frequency components.\n const half = size >>> 1;\n for (let i = 2; i < half; i += 2) {\n out[size - i] = out[i];\n out[size - i + 1] = -out[i + 1];\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\n/**\n * Measures similarity between two temporal sequences (e.g., input audio and output tokens\n * to generate token-level timestamps).\n * @param {number[][]} matrix \n * @returns {number[][]}\n */\nexport function dynamic_time_warping(matrix) {\n const output_length = matrix.length;\n const input_length = matrix[0].length;\n\n const outputShape = [output_length + 1, input_length + 1];\n\n const cost = Array.from(\n { length: outputShape[0] },\n () => Array(outputShape[1]).fill(Infinity)\n );\n cost[0][0] = 0;\n\n const trace = Array.from(\n { length: outputShape[0] },\n () => Array(outputShape[1]).fill(-1)\n );\n\n for (let j = 1; j < outputShape[1]; ++j) {\n for (let i = 1; i < outputShape[0]; ++i) {\n const c0 = cost[i - 1][j - 1];\n const c1 = cost[i - 1][j];\n const c2 = cost[i][j - 1];\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 cost[i][j] = matrix[i - 1][j - 1] + c;\n trace[i][j] = t;\n }\n }\n\n for (let i = 0; i < outputShape[1]; ++i) { // trace[0, :] = 2\n trace[0][i] = 2;\n }\n for (let i = 0; i < outputShape[0]; ++i) { // trace[:, 0] = 1\n trace[i][0] = 1;\n }\n\n // backtrace\n let i = output_length;\n let j = input_length;\n let text_indices = [];\n let time_indices = [];\n while (i > 0 || j > 0) {\n text_indices.push(i - 1);\n time_indices.push(j - 1);\n\n switch (trace[i][j]) {\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","/**\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 max,\n min,\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\nexport const DataTypeMap = Object.freeze({\n float32: Float32Array,\n // @ts-ignore ts(2552) Limited availability of Float16Array across browsers:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array\n float16: typeof Float16Array !== \"undefined\" ? Float16Array: 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 uint4: Uint8Array,\n int4: Int8Array,\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 /** @type {string} The location of the tensor data. */\n get location() {\n return this.ort_tensor.location;\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 // @ts-expect-error ts(2769) Type 'number' is not assignable to type 'bigint'.\n /** @type {Exclude<import('./maths.js').AnyTypedArray, Uint8ClampedArray>} */(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 a callback function applied to each element.\n * @param {Function} callback - The function to apply to each element. It should take three arguments:\n * the current element, its index, and the tensor's data array.\n * @returns {Tensor} A new Tensor with the callback function applied to each element.\n */\n map(callback) {\n return this.clone().map_(callback);\n }\n\n /**\n * Apply a callback function to each element of the tensor in place.\n * @param {Function} callback - The function to apply to each element. It should take three arguments:\n * the current element, its index, and the tensor's data array.\n * @returns {Tensor} Returns `this`.\n */\n map_(callback) {\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n this_data[i] = callback(this_data[i], i, this_data);\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 divided by a constant.\n * @param {number} val The value to divide by.\n * @returns {Tensor} The new tensor.\n */\n div(val) {\n return this.clone().div_(val);\n }\n\n /**\n * Divide the tensor by a constant in place.\n * @param {number} val The value to divide by.\n * @returns {Tensor} Returns `this`.\n */\n div_(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 /**\n * Return a new Tensor with every element subtracted by a constant.\n * @param {number} val The value to subtract by.\n * @returns {Tensor} The new tensor.\n */\n sub(val) {\n return this.clone().sub_(val);\n }\n\n /**\n * Subtract the tensor by a constant in place.\n * @param {number} val The value to subtract by.\n * @returns {Tensor} Returns `this`.\n */\n sub_(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 * Creates a deep copy of the current Tensor.\n * @returns {Tensor} A new Tensor with the same type, data, and dimensions as the original.\n */\n clone() {\n return new Tensor(this.type, this.data.slice(), this.dims.slice());\n }\n\n /**\n * Performs a slice operation on the Tensor along specified dimensions.\n *\n * Consider a Tensor that has a dimension of [4, 7]:\n * ```\n * [ 1, 2, 3, 4, 5, 6, 7]\n * [ 8, 9, 10, 11, 12, 13, 14]\n * [15, 16, 17, 18, 19, 20, 21]\n * [22, 23, 24, 25, 26, 27, 28]\n * ```\n * We can slice against the two dims of row and column, for instance in this\n * case we can start at the second element, and return to the second last,\n * like this:\n * ```\n * tensor.slice([1, -1], [1, -1]);\n * ```\n * which would return:\n * ```\n * [ 9, 10, 11, 12, 13 ]\n * [ 16, 17, 18, 19, 20 ]\n * ```\n *\n * @param {...(number|number[]|null)} slices The slice specifications for each dimension.\n * - If a number is given, then a single element is selected.\n * - If an array of two numbers is given, then a range of elements [start, end (exclusive)] is selected.\n * - If null is given, then the entire dimension is selected.\n * @returns {Tensor} A new Tensor containing the selected elements.\n * @throws {Error} If the slice input is invalid.\n */\n slice(...slices) {\n // This allows for slicing with ranges and numbers\n const newTensorDims = [];\n const 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 let [start, end] = slice;\n start = start === null\n ? 0\n : safeIndex(start, this.dims[sliceIndex], sliceIndex, false);\n end = end === null\n ? this.dims[sliceIndex]\n : safeIndex(end, this.dims[sliceIndex], sliceIndex, false);\n\n if (start > end) {\n throw new Error(`Invalid slice: ${slice}`);\n }\n\n const offsets = [\n Math.max(start, 0),\n Math.min(end, 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 const newDims = newOffsets.map(([start, end]) => end - start);\n const newBufferSize = newDims.reduce((a, b) => a * b);\n\n const this_data = this.data;\n // Allocate memory\n // @ts-ignore\n const data = new this_data.constructor(newBufferSize);\n\n // Precompute strides\n const stride = this.stride();\n\n // Detect if the slice is contiguous\n let isContiguous = true;\n for (let i = 1; i < newDims.length; ++i) {\n if (newOffsets[i][0] !== 0 || newOffsets[i][1] !== this.dims[i]) {\n isContiguous = false;\n break;\n }\n }\n\n if (isContiguous) {\n // Perform bulk copy for contiguous slices to improve performance\n const start = newOffsets[0][0] * stride[0];\n const end = newOffsets[0][1] * stride[0];\n\n if (ArrayBuffer.isView(this_data)) {\n // If this.data is a TypedArray, use subarray\n // @ts-ignore\n data.set(this_data.subarray(start, end));\n } else if (Array.isArray(this_data)) {\n // If this.data is a plain array, use slice\n const slicedData = this_data.slice(start, end);\n for (let i = 0; i < slicedData.length; ++i) {\n data[i] = slicedData[i];\n }\n } else {\n throw new Error(\"Unsupported data type for slicing\");\n }\n } else {\n // Fallback to manual copying for non-contiguous slices\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 }\n\n return new Tensor(this.type, data, newTensorDims);\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 /**\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 const fn = (a, b) => a + (b ** p);\n\n if (dim === null) {\n // @ts-ignore\n const val = this_data.reduce(fn, 0) ** (1 / p);\n return new Tensor(this.type, [val], []);\n }\n\n const [type, result, resultDims] = reduce_helper(fn, this, dim, keepdim);\n\n if (p !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] ** (1 / p);\n }\n }\n return new Tensor(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 const norm_data = norm.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|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 const this_data = this.data;\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 * Computes input > val element-wise.\n * @param {number} val The value to compare with.\n * @returns {Tensor} A boolean tensor that is `true` where input is greater than other and `false` elsewhere.\n */\n gt(val) {\n const mask = new Uint8Array(this.data.length);\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n mask[i] = this_data[i] > val ? 1 : 0;\n }\n return new Tensor('bool', mask, this.dims);\n }\n\n /**\n * Computes input < val element-wise.\n * @param {number} val The value to compare with.\n * @returns {Tensor} A boolean tensor that is `true` where input is less than other and `false` elsewhere.\n */\n lt(val) {\n const mask = new Uint8Array(this.data.length);\n const this_data = this.data;\n for (let i = 0; i < this_data.length; ++i) {\n mask[i] = this_data[i] < val ? 1 : 0;\n }\n return new Tensor('bool', mask, this.dims);\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 min(dim = null, keepdim = false) {\n if (dim === null) {\n // None to reduce over all dimensions.\n const val = min(this.data)[0];\n return new Tensor(this.type, [val], [/* scalar */]);\n }\n const [type, result, resultDims] = reduce_helper((a, b) => Math.min(a, b), this, dim, keepdim, Infinity);\n return new Tensor(type, result, resultDims);\n }\n\n max(dim = null, keepdim = false) {\n if (dim === null) {\n // None to reduce over all dimensions.\n const val = max(this.data)[0];\n return new Tensor(this.type, [val], [/* scalar */]);\n }\n const [type, result, resultDims] = reduce_helper((a, b) => Math.max(a, b), this, dim, keepdim, -Infinity);\n return new Tensor(type, result, resultDims);\n }\n\n argmin(dim = null, keepdim = false) {\n if (dim !== null) {\n throw new Error(\"`dim !== null` not yet implemented.\");\n }\n const index = min(this.data)[1];\n return new Tensor('int64', [BigInt(index)], []);\n }\n argmax(dim = null, keepdim = false) {\n if (dim !== null) {\n throw new Error(\"`dim !== null` not yet implemented.\");\n }\n const index = max(this.data)[1];\n return new Tensor('int64', [BigInt(index)], []);\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\n // Handle special cases where a mapping function is needed (e.g., where one type is a bigint and the other is a number)\n let map_fn;\n const is_source_bigint = ['int64', 'uint64'].includes(this.type);\n const is_dest_bigint = ['int64', 'uint64'].includes(type);\n if (is_source_bigint && !is_dest_bigint) {\n // TypeError: Cannot convert a BigInt value to a number\n map_fn = Number;\n } else if (!is_source_bigint && is_dest_bigint) {\n // TypeError: Cannot convert [x] to a BigInt\n if (['float16', 'float32', 'float64'].includes(this.type)) {\n map_fn = (x) => BigInt(Math.floor(x));\n } else {\n map_fn = BigInt;\n }\n }\n\n // @ts-ignore\n return new Tensor(type, DataTypeMap[type].from(this.data, map_fn), 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, 1>; // string[]\n * @example\n * NestArray<number, 2>; // number[][]\n * @example\n * NestArray<string, 3>; // string[][][] etc.\n * @template T\n * @template {number} Depth\n * @template {never[]} [Acc=[]]\n * @typedef {Acc['length'] extends Depth ? T : NestArray<T[], Depth, [...Acc, never]>} 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<T, DIM[\"length\"]>} 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 {\"nearest\"|\"bilinear\"|\"bicubic\"} [options.mode='bilinear'] algorithm used for upsampling\n * @returns {Promise<Tensor>} 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 === 'nearest') {\n op = await TensorOpRegistry.nearest_interpolate_4d;\n } else 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 * Matrix product of two tensors.\n * Inspired by https://pytorch.org/docs/stable/generated/torch.matmul.html\n * @param {Tensor} a the first tensor to be multiplied\n * @param {Tensor} b the second tensor to be multiplied\n * @returns {Promise<Tensor>} The matrix product of the two tensors.\n */\nexport async function matmul(a, b) {\n const op = await TensorOpRegistry.matmul;\n return await op({ a, b });\n}\n\n/**\n * Computes the one dimensional Fourier transform of real-valued input.\n * Inspired by https://pytorch.org/docs/stable/generated/torch.fft.rfft.html\n * @param {Tensor} x the real input tensor\n * @param {Tensor} a The dimension along which to take the one dimensional real FFT.\n * @returns {Promise<Tensor>} the output tensor.\n */\nexport async function rfft(x, a) {\n const op = await TensorOpRegistry.rfft;\n return await op({ x, a });\n}\n\n\n/**\n * Returns the k largest elements of the given input tensor.\n * Inspired by https://pytorch.org/docs/stable/generated/torch.topk.html\n * @param {Tensor} x the input tensor\n * @param {number} [k] the k in \"top-k\"\n * @returns {Promise<[Tensor, Tensor]>} the output tuple of (Tensor, LongTensor) of top-k elements and their indices.\n */\nexport async function topk(x, k) {\n const op = await TensorOpRegistry.top_k;\n\n if (k == null) {\n k = x.dims.at(-1);\n } else {\n k = Math.min(k, x.dims.at(-1));\n }\n return await op({\n x,\n k: new Tensor(\n 'int64',\n [BigInt(k)],\n [1]\n )\n });\n}\n\n\nconst arrayToIndexTensor = (array) => new Tensor('int64', array, [array.length]);\n/**\n * Slice a multidimensional float32 tensor.\n * @param {Tensor} data: Tensor of data to extract slices from\n * @param {number[]} starts: 1-D array of starting indices of corresponding axis in axes\n * @param {number[]} ends: 1-D array of ending indices (exclusive) of corresponding axis in axes\n * @param {number[]} axes: 1-D array of axes that starts and ends apply to\n * @param {number[]} [steps]: 1-D array of slice step of corresponding axis in axes.\n * @returns {Promise<Tensor>} Sliced data tensor.\n */\nexport async function slice(data, starts, ends, axes, steps) {\n const op = await TensorOpRegistry.slice;\n return await op({\n x: data,\n s: arrayToIndexTensor(starts),\n e: arrayToIndexTensor(ends),\n a: arrayToIndexTensor(axes),\n t: arrayToIndexTensor(steps ?? new Array(axes.length).fill(1)),\n });\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 const lastHiddenStateData = last_hidden_state.data;\n const attentionMaskData = attention_mask.data;\n\n const shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]];\n\n // @ts-ignore\n const returnedData = new lastHiddenStateData.constructor(shape[0] * shape[1]);\n const [batchSize, seqLength, embedDim] = last_hidden_state.dims;\n\n let outIndex = 0;\n for (let i = 0; i < batchSize; ++i) {\n const offset = i * embedDim * seqLength;\n\n for (let k = 0; k < embedDim; ++k) {\n let sum = 0;\n let count = 0;\n\n const attnMaskOffset = i * seqLength;\n const offset2 = offset + k;\n // Pool over all words in sequence\n for (let j = 0; j < seqLength; ++j) {\n // index into attention mask\n const attn = Number(attentionMaskData[attnMaskOffset + j]);\n\n count += attn;\n sum += lastHiddenStateData[offset2 + j * embedDim] * attn;\n }\n\n const 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 const stdData = /** @type {Float32Array} */(std.data);\n const meanData = /** @type {Float32Array} */(mean.data);\n\n const inputData = /** @type {Float32Array} */(input.data);\n\n // @ts-ignore\n const returnedData = new inputData.constructor(inputData.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] = (inputData[offset2] - meanData[i]) / (stdData[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, boundsCheck = true) {\n if (index < -size || index >= size) {\n if (boundsCheck) {\n throw new Error(`IndexError: index ${index} is out of bounds for dimension${dimension === null ? '' : ' ' + dimension} with size ${size}`);\n } else {\n return index < -size ? 0 : size;\n }\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 (const tensor of tensors) {\n const tensorData = tensor.data;\n result.set(tensorData, offset);\n offset += tensorData.length;\n }\n\n } else {\n\n let currentDim = 0;\n\n for (let t = 0; t < tensors.length; ++t) {\n const { data, dims } = tensors[t];\n\n // Iterate over the data array\n for (let i = 0; i < data.length; ++i) {\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = 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] = data[i];\n }\n\n currentDim += 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 * @param {(previousValue: any, currentValue: any, currentIndex?: number, resultIndex?: number) => any} callbackfn\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 {[DataType, any, number[]]} The reduced tensor data.\n */\nfunction reduce_helper(callbackfn, input, dim = null, keepdim = false, initialValue = null) {\n const inputData = input.data;\n const inputDims = input.dims;\n\n // Negative indexing\n dim = safeIndex(dim, inputDims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = inputDims.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 inputData.constructor(inputData.length / inputDims[dim]);\n if (initialValue !== null) {\n result.fill(initialValue);\n }\n\n // Iterate over the data array\n for (let i = 0; i < inputData.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = inputDims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = inputDims[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] = callbackfn(result[resultIndex], inputData[i], i, resultIndex);\n }\n\n if (!keepdim) resultDims.splice(dim, 1);\n\n return [input.type, result, resultDims];\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 const inputData = /** @type {Float32Array} */(input.data);\n const inputDims = input.dims;\n\n if (dim === null) {\n // None to reduce over all dimensions.\n const sum = inputData.reduce((a, b) => a + b, 0);\n const mean = sum / inputData.length;\n const std = Math.sqrt(inputData.reduce((a, b) => a + (b - mean) ** 2, 0) / (inputData.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 dim = safeIndex(dim, inputDims.length);\n const meanTensor = mean(input, dim, keepdim);\n const meanTensorData = meanTensor.data;\n\n // Compute squared sum\n const [type, result, resultDims] = reduce_helper((a, b, i, j) => a + (b - meanTensorData[j]) ** 2, input, dim, keepdim);\n\n // Square root of the squared sum\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.sqrt(result[i] / (inputDims[dim] - correction));\n }\n\n const stdTensor = new Tensor(type, result, resultDims);\n\n return [stdTensor, meanTensor];\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 const inputDims = input.dims;\n const inputData = /** @type {Float32Array} */(input.data);\n\n if (dim === null) {\n // None to reduce over all dimensions.\n const val = inputData.reduce((a, b) => a + b, 0);\n return new Tensor(input.type, [val / inputData.length], [/* scalar */]);\n }\n dim = safeIndex(dim, inputDims.length);\n\n // Compute sum\n const [type, result, resultDims] = reduce_helper((a, b) => a + b, input, dim, keepdim);\n\n // Divide by number of elements in the dimension\n if (inputDims[dim] !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] /= inputDims[dim];\n }\n }\n\n return new Tensor(type, result, resultDims);\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|boolean} 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 if (typeof fill_value === 'boolean') {\n dtype = 'bool';\n typedArrayCls = Uint8Array;\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 * Returns a tensor filled with random numbers from a uniform distribution on the interval [0, 1)\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n * @returns {Tensor} The random tensor.\n */\nexport function rand(size) {\n const length = size.reduce((a, b) => a * b, 1);\n return new Tensor(\n \"float32\",\n Float32Array.from({ length }, () => Math.random()),\n size,\n )\n}\n\n/**\n * Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution).\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n * @returns {Tensor} The random tensor.\n */\nexport function randn(size) {\n const length = size.reduce((a, b) => a * b, 1);\n\n // Box-Muller transform\n function boxMullerRandom() {\n // NOTE: 1 - Math.random() is used to avoid log(0)\n const u = 1 - Math.random();\n const v = 1 - Math.random();\n return Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);\n }\n\n return new Tensor(\n \"float32\",\n Float32Array.from({ length }, () => boxMullerRandom()),\n size,\n )\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","import { RawImage } from \"./image.js\";\nimport { apis } from \"../env.js\";\n\nexport class RawVideoFrame {\n\n /**\n * @param {RawImage} image\n * @param {number} timestamp\n */\n constructor(image, timestamp) {\n this.image = image;\n this.timestamp = timestamp;\n }\n}\n\nexport class RawVideo {\n /**\n * @param {RawVideoFrame[]|RawImage[]} frames\n * @param {number} duration\n */\n constructor(frames, duration) {\n if (frames.length > 0 && frames[0] instanceof RawImage) {\n // Assume uniform timestamps\n frames = frames.map((image, i) => new RawVideoFrame(image, (i + 1) / (frames.length + 1) * duration));\n }\n this.frames = /** @type {RawVideoFrame[]} */ (frames);\n this.duration = duration;\n }\n\n get width() {\n return this.frames[0].image.width;\n }\n get height() {\n return this.frames[0].image.height;\n }\n\n get fps() {\n return this.frames.length / this.duration;\n }\n}\n\n\n/**\n * Loads a video.\n *\n * @param {string|Blob|HTMLVideoElement} src The video to process.\n * @param {Object} [options] Optional parameters.\n * @param {number} [options.num_frames=null] The number of frames to sample uniformly.\n * @param {number} [options.fps=null] The number of frames to sample per second.\n *\n * @returns {Promise<RawVideo>} The loaded video.\n */\nexport async function load_video(src, { num_frames = null, fps = null } = {}) {\n if (!apis.IS_BROWSER_ENV) {\n throw new Error(\"`load_video` is currently only supported in browser environments.\");\n }\n\n // TODO: Support efficiently loading all frames using the WebCodecs API.\n // Specfically, https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder\n if (num_frames == null && fps == null) {\n throw new Error(\"Either num_frames or fps must be provided.\");\n }\n\n const frames = [];\n\n const video = document.createElement(\"video\");\n video.crossOrigin = \"anonymous\";\n video.muted = true; // mute to allow autoplay and seeking\n\n if (typeof src === 'string') {\n video.src = src;\n } else if (src instanceof Blob) {\n video.src = URL.createObjectURL(src);\n } else if (src instanceof HTMLVideoElement) {\n video.src = src.src;\n } else {\n throw new Error(\"Invalid URL or video element provided.\");\n }\n // Wait for metadata to load to obtain duration\n await new Promise((resolve) => video.onloadedmetadata = resolve);\n\n if (video.seekable.start(0) === video.seekable.end(0)) {\n // Fallback: Download entire video if not seekable\n const response = await fetch(video.src);\n const blob = await response.blob();\n video.src = URL.createObjectURL(blob);\n await new Promise((resolve) => video.onloadedmetadata = resolve);\n }\n\n const duration = video.duration;\n\n let count, step;\n if (num_frames != null) {\n count = num_frames;\n step = num_frames === 1 ? 0 : duration / (num_frames - 1);\n } else {\n step = 1 / fps;\n count = Math.floor(duration / step);\n }\n\n // Build an array of sample times based on num_frames or fps\n let sampleTimes = [];\n for (let i = 0; i < count; ++i) {\n sampleTimes.push(num_frames === 1 ? duration / 2 : i * step);\n }\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n for (const t of sampleTimes) {\n video.currentTime = t;\n await new Promise((resolve) => {\n video.onseeked = resolve;\n });\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n const frameData = new RawImage(imageData.data, canvas.width, canvas.height, 4);\n\n const frame = new RawVideoFrame(frameData, t);\n frames.push(frame);\n }\n\n // Clean up video element.\n video.remove();\n\n return new RawVideo(frames, duration);\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","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};","// 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};","/**\n * @file Entry point for the Transformers.js library. Only the exports from this file\n * are available to the end user, and are grouped as follows:\n * \n * 1. [Pipelines](./pipelines)\n * 2. [Environment variables](./env)\n * 3. [Models](./models)\n * 4. [Tokenizers](./tokenizers)\n * 5. [Processors](./processors)\n * \n * @module transformers\n */\n\nexport { env } from './env.js';\n\nexport * from './pipelines.js';\nexport * from './models.js';\nexport * from './tokenizers.js';\nexport * from './configs.js';\n\nexport * from './utils/audio.js';\nexport * from './utils/image.js';\nexport * from './utils/video.js';\nexport * from './utils/tensor.js';\nexport * from './utils/maths.js';\n\n\nexport { FeatureExtractor } from './base/feature_extraction_utils.js';\nexport * from './models/feature_extractors.js';\nexport * from './models/auto/feature_extraction_auto.js';\n\nexport { ImageProcessor } from './base/image_processors_utils.js';\nexport * from './models/image_processors.js';\nexport * from './models/auto/image_processing_auto.js';\n\nexport { Processor } from './base/processing_utils.js';\nexport * from './models/processors.js';\nexport * from './models/auto/processing_auto.js';\n\nexport * from './generation/streamers.js';\nexport * from './generation/stopping_criteria.js';\nexport * from './generation/logits_process.js';\n\n// Expose common types used across the library for developers to access\n/**\n * @typedef {import('./utils/hub.js').PretrainedModelOptions} PretrainedModelOptions\n * @typedef {import('./base/processing_utils.js').PretrainedProcessorOptions} PretrainedProcessorOptions\n * @typedef {import('./utils/dtypes.js').DataType} DataType\n * @typedef {import('./utils/devices.js').DeviceType} DeviceType\n */\n"],"mappings":";;;;;;;;;;;;;;;AAAA,aAAA,UAAA;;;;;;;;;;ACAA,aAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AQCA,UAAA,cAAA,OAAA,OAAA;QACA,MAAA;;QAEA,gBAAA;;QAEA,eAAA;;QAEA,YAAA;;QAEA,QAAA;;QAEA,WAAA;;QAEA,YAAA;;QAEA,eAAA;;QAEA,gBAAA;;QAEA,gBAAA;;QAEA,iBAAA;;QAEA,mBAAA;;QAEA,oBAAA;;QAEA,kBAAA;;QAEA,mBAAA;;QAEA,OAAA;;QAEA,KAAA;;QAEA,OAAA;;QAEA,MAAA;;QAEA,cAAA;;QAEA,wBAAA;;QAEA,8BAAA;;QAEA,0BAAA;;QAEA,eAAA;;QAEA,SAAA;;MAEA,CAAC;AACD,UAAA,QAAA,MAAA;;;;;;QAMA,YAAA,OAAA,MAAA;AACA,eAAA,QAAA;AACA,eAAA,OAAA;QACA;MACA;AACA,eAAA,OAAA,MAAA;AACA,eAAA,KAAA,KAAA,IAAA;MACA;AACA,eAAA,UAAA,MAAA;AACA,eAAA,QAAA,KAAA,IAAA;MACA;AACA,eAAA,aAAA,MAAA;AACA,eAAA,KAAA,KAAA,IAAA;MACA;AACA,UAAA,wBAAA;;QAEA,CAAA,MAAK,YAAA,aAAA;QACL,CAAA,MAAM,YAAA,cAAA;QACN,CAAA,MAAM,YAAA,cAAA;QACN,CAAA,MAAM,YAAA,eAAA;;QAEN,CAAA,KAAA,YAAA,SAAA;QACA,CAAA,KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__webpack_require__","i","segmentation","bannedTokens","self","input_ids","_","mrope_position_deltas","window","pixel_values","num_frames","num_channels","start","end","x","n","tokens","chunk","leftStart","leftStop","rightStart","rightStop","text","spectrogram","path","a","count","data","min","max","j","slice","mean","meanTensor","stdTensor"]}
|