diff --git a/.github/workflows/delete-doc-comment.yml b/.github/workflows/delete-doc-comment.yml new file mode 100644 index 000000000..8f76bade9 --- /dev/null +++ b/.github/workflows/delete-doc-comment.yml @@ -0,0 +1,12 @@ +name: Delete dev documentation + +on: + pull_request: + types: [closed] + +jobs: + delete: + uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main + with: + pr_number: ${{ github.event.number }} + package: transformers.js diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..4479d60bf --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,17 @@ +name: Build documentation + +on: + workflow_dispatch: + push: + branches: [ main, docs ] + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main + with: + repo_owner: xenova + commit_sha: ${{ github.sha }} + package: transformers.js + path_to_docs: transformers.js/docs/source + pre_command: cd transformers.js && npm install && npm run docs-api + additional_args: --not_python_module diff --git a/.github/workflows/pr-documentation.yml b/.github/workflows/pr-documentation.yml new file mode 100644 index 000000000..5ac60b4fb --- /dev/null +++ b/.github/workflows/pr-documentation.yml @@ -0,0 +1,20 @@ +name: Build PR Documentation + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main + with: + repo_owner: xenova + commit_sha: ${{ github.sha }} + pr_number: ${{ github.event.number }} + package: transformers.js + path_to_docs: transformers.js/docs/source + pre_command: cd transformers.js && npm install && npm run docs-api + additional_args: --not_python_module diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..734cc06ac --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: Unit tests + +on: + push: + branches: [ main, docs ] + pull_request: + branches: [ main, docs ] + +env: + TESTING_REMOTELY: true + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, latest, node] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build + - run: pip install -r scripts/requirements.txt + + # Setup the testing environment + - run: npm run generate-tests + - run: git lfs install && git clone https://huggingface.co/Xenova/t5-small ./models/t5-small + + # Actually run tests + - run: npm run test diff --git a/.gitignore b/.gitignore index 56af692d7..f3e6fafbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ __pycache__ .vscode node_modules +.cache + +# Do not track build artifacts/generated files +/dist +/types +/models + +# Do not track coverage reports +/coverage diff --git a/LICENSE b/LICENSE index 29288d957..d64569567 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,202 @@ -MIT License - -Copyright (c) 2023 Xenova - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index a31fde69f..2eb9a383a 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,48 @@ -# Transformers.js -[![npm](https://img.shields.io/npm/v/@xenova/transformers)](https://www.npmjs.com/package/@xenova/transformers) -[![downloads](https://img.shields.io/npm/dw/@xenova/transformers)](https://www.npmjs.com/package/@xenova/transformers) -[![license](https://img.shields.io/github/license/xenova/transformers.js)](https://github.com/xenova/transformers.js/blob/main/LICENSE) +

+
+ + + + transformers.js javascript library logo + +
+

+

+ + NPM + + + Downloads + + + License + + + Documentation + +

-Run 🤗 Transformers in your browser! We currently support [BERT](https://huggingface.co/docs/transformers/model_doc/bert), [ALBERT](https://huggingface.co/docs/transformers/model_doc/albert), [DistilBERT](https://huggingface.co/docs/transformers/model_doc/distilbert), [MobileBERT](https://huggingface.co/docs/transformers/model_doc/mobilebert), [SqueezeBERT](https://huggingface.co/docs/transformers/model_doc/squeezebert), [T5](https://huggingface.co/docs/transformers/model_doc/t5), [T5v1.1](https://huggingface.co/docs/transformers/model_doc/t5v1.1), [FLAN-T5](https://huggingface.co/docs/transformers/model_doc/flan-t5), [mT5](https://huggingface.co/docs/transformers/model_doc/mt5), [BART](https://huggingface.co/docs/transformers/model_doc/bart), [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian), [GPT2](https://huggingface.co/docs/transformers/model_doc/gpt2), [GPT Neo](https://huggingface.co/docs/transformers/model_doc/gpt_neo), [CodeGen](https://huggingface.co/docs/transformers/model_doc/codegen), [Whisper](https://huggingface.co/docs/transformers/model_doc/whisper), [CLIP](https://huggingface.co/docs/transformers/model_doc/clip), [Vision Transformer](https://huggingface.co/docs/transformers/model_doc/vit), [VisionEncoderDecoder](https://huggingface.co/docs/transformers/model_doc/vision-encoder-decoder), and [DETR](https://huggingface.co/docs/transformers/model_doc/detr) models, for a variety of tasks including: masked language modelling, text classification, token classification, zero-shot classification, text-to-text generation, translation, summarization, question answering, text generation, automatic speech recognition, image classification, zero-shot image classification, image-to-text, image segmentation, and object detection. -![teaser](https://user-images.githubusercontent.com/26504141/221056008-e906614e-e6f0-4e10-b0a8-7d5c99e955b4.gif) +State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server! -Check out our demo at [https://xenova.github.io/transformers.js/](https://xenova.github.io/transformers.js/). As you'll see, everything runs inside the browser! +Transformers.js is designed to be functionally equivalent to Hugging Face's [transformers](https://github.com/huggingface/transformers) python library, meaning you can run the same pretrained models using a very similar API. These models support common tasks in different modalities, such as: + - 📝 **Natural Language Processing**: text classification, named entity recognition, question answering, language modeling, summarization, translation, multiple choice, and text generation. + - 🖼️ **Computer Vision**: image classification, object detection, and segmentation. + - 🗣️ **Audio**: automatic speech recognition and audio classification. + - 🐙 **Multimodal**: zero-shot image classification. -## Getting Started +Transformers.js uses [ONNX Runtime](https://onnxruntime.ai/) to run models in the browser. The best part about it, is that you can easily [convert](#convert-your-models-to-onnx) your pretrained PyTorch, TensorFlow, or JAX models to ONNX using [🤗 Optimum](https://github.com/huggingface/optimum#onnx--onnx-runtime). -### Installation -If you use [npm](https://www.npmjs.com/package/@xenova/transformers), you can install it using: -```bash -npm i @xenova/transformers -``` +For more information, check out the full [documentation](https://huggingface.co/docs/transformers.js). -Alternatively, you can use it in a ` - - -``` +## Quick tour + -### Basic example -It's super easy to translate from existing code! +It's super simple to translate from existing code! Just like the python library, we support the `pipeline` API. Pipelines group together a pretrained model with preprocessing of inputs and postprocessing of outputs, making it the easiest way to run models with the library. @@ -54,7 +66,7 @@ out = pipe('I love transformers!')
```javascript -import { pipeline } from "@xenova/transformers"; +import { pipeline } from '@xenova/transformers'; // Allocate a pipeline for sentiment-analysis let pipe = await pipeline('sentiment-analysis'); @@ -68,67 +80,189 @@ let out = await pipe('I love transformers!');
-In the same way as the Python library, you can use a different model by providing its name as the second argument to the pipeline function. For example: +You can also use a different model by specifying the model id or path as the second argument to the `pipeline` function. For example: ```javascript // Use a different model for sentiment-analysis let pipe = await pipeline('sentiment-analysis', 'nlptown/bert-base-multilingual-uncased-sentiment'); ``` -### Custom setup -By default, Transformers.js uses [hosted models](https://huggingface.co/Xenova/transformers.js/tree/main/quantized) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/), which should work out-of-the-box. You can override this behaviour as follows: -```javascript -import { env } from "@xenova/transformers"; +## Installation -// Use a different host for models. -// - `remoteURL` defaults to use the HuggingFace Hub -// - `localURL` defaults to '/models/onnx/quantized/' -env.remoteURL = 'https://www.example.com/'; -env.localURL = '/path/to/models/'; -// Set whether to use remote or local models. Defaults to true. -// - If true, use the path specified by `env.remoteURL`. -// - If false, use the path specified by `env.localURL`. -env.remoteModels = false; +To install via [NPM](https://www.npmjs.com/package/@xenova/transformers), run: +```bash +npm i @xenova/transformers +``` -// Set parent path of .wasm files. Defaults to use a CDN. -env.onnx.wasm.wasmPaths = '/path/to/files/'; +Alternatively, you can use it in vanilla JS, without any bundler, by using a CDN or static hosting. For example, using [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), you can import the library with: +```html + ``` -#### Node.js -This library uses `onnxruntime-web` as its default backend. However, if your application runs with Node.js, you can install `onnxruntime-node` in your project (using `npm i onnxruntime-node`) to obtain a massive boost in performance (>5x in some cases). The CPU execution provider is much faster than WASM executor provider, most likely due to [this issue](https://github.com/microsoft/onnxruntime/issues/10311). +## Examples + +Want to jump straight in? Get started with one of our sample applications/templates: +| Platform | Description | Source code | +|-------------------|----------------------------------|-------------------------------| +| React | Multilingual translation website | [link](./examples/react-translator/) | +| Browser extension | Text classification extension | [link](./examples/extension/) | +| Electron | Text classification application | [link](./examples/electron/) | +| Next.js | *Coming soon* | [link](./examples/next/) | +| Node.js | *Coming soon* | [link](./examples/node/) | -## Usage -### Convert your PyTorch models to ONNX -We use [ONNX Runtime](https://onnxruntime.ai/) to run the models in the browser, so you must first convert your PyTorch model to ONNX (which can be done using our conversion script). In general, the command will look something like this: -``` -python -m scripts.convert --model_id --from_hub --quantize --task -``` +## Custom usage -For example, to use `bert-base-uncased` for masked language modelling, you can use the command: -``` -python -m scripts.convert --model_id bert-base-uncased --from_hub --quantize --task masked-lm + + +By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/), which should work out-of-the-box. You can customize this as follows: + + +### Settings + +```javascript +import { env } from '@xenova/transformers'; + +// Specify a custom location for models (defaults to '/models/'). +env.localModelPath = '/path/to/models/'; + +// Disable the loading of remote models from the Hugging Face Hub: +env.allowRemoteModels = false; + +// Set location of .wasm files. Defaults to use a CDN. +env.backends.onnx.wasm.wasmPaths = '/path/to/files/'; ``` -If you want to use a local model, remove the `--from_hub` flag from above and place your PyTorch model in the `./models/pytorch/` folder. You can also choose a different location by specifying the parent input folder with `--input_parent_dir /path/to/parent_dir/` (note: without the model id). +For a full list of available settings, check out the [API Reference](https://huggingface.co/docs/transformers.js/api/env). +### Convert your models to ONNX -Alternatively, you can find some of the models we have already converted [here](https://huggingface.co/Xenova/transformers.js). For example, to use `bert-base-uncased` for masked language modelling, you can use the model found at [https://huggingface.co/Xenova/transformers.js/tree/main/quantized/bert-base-uncased/masked-lm](https://huggingface.co/Xenova/transformers.js/tree/main/quantized/bert-base-uncased/masked-lm). +We recommend using our [conversion script](https://github.com/xenova/transformers.js/blob/main/scripts/convert.py) to convert your PyTorch, TensorFlow, or JAX models to ONNX in a single command. Behind the scenes, it uses [🤗 Optimum](https://huggingface.co/docs/optimum) to perform conversion and quantization of your model. -*Note:* We recommend quantizing the model (`--quantize`) to reduce model size and improve inference speeds (at the expense of a slight decrease in accuracy). For more information, run the help command: `python -m scripts.convert -h`. +```bash +python -m scripts.convert --quantize --model_id +``` +For example, convert and quantize [bert-base-uncased](https://huggingface.co/bert-base-uncased) using: +```bash +python -m scripts.convert --quantize --model_id bert-base-uncased +``` -### Options -*Coming soon...* +This will save the following files to `./models/`: +``` +bert-base-uncased/ +├── config.json +├── tokenizer.json +├── tokenizer_config.json +└── onnx/ + ├── model.onnx + └── model_quantized.onnx +``` -## Examples -*Coming soon... In the meantime, check out the source code for the demo [here](https://github.com/xenova/transformers.js/blob/main/assets/js/worker.js).* -## Credit -Inspired by https://github.com/praeclarum/transformers-js +## Supported tasks/models + +Here is the list of all tasks and models currently supported by Transformers.js. +If you don't see your task/model listed here or it is not yet supported, feel free +to open up a feature request [here](https://github.com/xenova/transformers.js/issues/new/choose). + + +### Tasks + +#### Natual Language Processing + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Conversational](https://huggingface.co/tasks/conversational) | `conversational` | Generating conversational text that is relevant, coherent and knowledgable given a prompt. | ❌ | +| [Fill-Mask](https://huggingface.co/tasks/fill-mask) | `fill-mask` | Masking some of the words in a sentence and predicting which words should replace those masks. | ✅ | +| [Question Answering](https://huggingface.co/tasks/question-answering) | `question-answering` | Retrieve the answer to a question from a given text. | ✅ | +| [Sentence Similarity](https://huggingface.co/tasks/sentence-similarity) | `sentence-similarity` | Determining how similar two texts are. | ✅ | +| [Summarization](https://huggingface.co/tasks/summarization) | `summarization` | Producing a shorter version of a document while preserving its important information. | ✅ | +| [Table Question Answering](https://huggingface.co/tasks/table-question-answering) | `table-question-answering` | Answering a question about information from a given table. | ❌ | +| [Text Classification](https://huggingface.co/tasks/text-classification) | `text-classification` or `sentiment-analysis` | Assigning a label or class to a given text. | ✅ | +| [Text Generation](https://huggingface.co/tasks/text-generation#completion-generation-models) | `text-generation` | Producing new text by predicting the next word in a sequence. | ✅ | +| [Text-to-text Generation](https://huggingface.co/tasks/text-generation#text-to-text-generation-models) | `text2text-generation` | Converting one text sequence into another text sequence. | ✅ | +| [Token Classification](https://huggingface.co/tasks/token-classification) | `token-classification` or `ner` | Assigning a label to each token in a text. | ✅ | +| [Translation](https://huggingface.co/tasks/translation) | `translation` | Converting text from one language to another. | ✅ | +| [Zero-Shot Classification](https://huggingface.co/tasks/zero-shot-classification) | `zero-shot-classification` | Classifying text into classes that are unseen during training. | ✅ | + +#### Vision + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Depth Estimation](https://huggingface.co/tasks/depth-estimation) | `depth-estimation` | Predicting the depth of objects present in an image. | ❌ | +| [Image Classification](https://huggingface.co/tasks/image-classification) | `image-classification` | Assigning a label or class to an entire image. | ✅ | +| [Image Segmentation](https://huggingface.co/tasks/image-segmentation) | `image-segmentation` | Divides an image into segments where each pixel is mapped to an object. This task has multiple variants such as instance segmentation, panoptic segmentation and semantic segmentation. | ✅ | +| [Image-to-Image](https://huggingface.co/tasks/image-to-image) | `image-to-image` | Transforming a source image to match the characteristics of a target image or a target image domain. | ❌ | +| [Mask Generation](https://huggingface.co/tasks/mask-generation) | `mask-generation` | Generate masks for the objects in an image. | ❌ | +| [Object Detection](https://huggingface.co/tasks/object-detection) | `object-detection` | Identify objects of certain defined classes within an image. | ✅ | +| [Video Classification](https://huggingface.co/tasks/video-classification) | n/a | Assigning a label or class to an entire video. | ❌ | +| [Unconditional Image Generation](https://huggingface.co/tasks/unconditional-image-generation) | n/a | Generating images with no condition in any context (like a prompt text or another image). | ❌ | + +#### Audio + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Audio Classification](https://huggingface.co/tasks/audio-classification) | `audio-classification` | Assigning a label or class to a given audio. | ❌ | +| [Audio-to-Audio](https://huggingface.co/tasks/audio-to-audio) | n/a | Generating audio from an input audio source. | ❌ | +| [Automatic Speech Recognition](https://huggingface.co/tasks/automatic-speech-recognition) | `automatic-speech-recognition` | Transcribing a given audio into text. | ✅ | +| [Text-to-Speech](https://huggingface.co/tasks/text-to-speech) | n/a | Generating natural-sounding speech given text input. | ❌ | + + +#### Tabular + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Tabular Classification](https://huggingface.co/tasks/tabular-classification) | n/a | Classifying a target category (a group) based on set of attributes. | ❌ | +| [Tabular Regression](https://huggingface.co/tasks/tabular-regression) | n/a | Predicting a numerical value given a set of attributes. | ❌ | + + +#### Multimodal + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Document Question Answering](https://huggingface.co/tasks/document-question-answering) | `document-question-answering` | Answering questions on document images. | ❌ | +| [Feature Extraction](https://huggingface.co/tasks/feature-extraction) | `feature-extraction` | Transforming raw data into numerical features that can be processed while preserving the information in the original dataset. | ✅ | +| [Image-to-Text](https://huggingface.co/tasks/image-to-text) | `image-to-text` | Output text from a given image. | ✅ | +| [Text-to-Image](https://huggingface.co/tasks/text-to-image) | `text-to-image` | Generates images from input text. | ❌ | +| [Visual Question Answering](https://huggingface.co/tasks/visual-question-answering) | `visual-question-answering` | Answering open-ended questions based on an image. | ❌ | +| [Zero-Shot Image Classification](https://huggingface.co/tasks/zero-shot-image-classification) | `zero-shot-image-classification` | Classifying images into classes that are unseen during training. | ✅ | + + +#### Reinforcement Learning + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Reinforcement Learning](https://huggingface.co/tasks/reinforcement-learning) | n/a | Learning from actions by interacting with an environment through trial and error and receiving rewards (negative or positive) as feedback. | ❌ | + + + +### Models + +1. **[ALBERT](https://huggingface.co/docs/transformers/model_doc/albert)** (from Google Research and the Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut. +1. **[BART](https://huggingface.co/docs/transformers/model_doc/bart)** (from Facebook) released with the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer. +1. **[BERT](https://huggingface.co/docs/transformers/model_doc/bert)** (from Google) released with the paper [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. +1. **[CLIP](https://huggingface.co/docs/transformers/model_doc/clip)** (from OpenAI) released with the paper [Learning Transferable Visual Models From Natural Language Supervision](https://arxiv.org/abs/2103.00020) by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. +1. **[CodeGen](https://huggingface.co/docs/transformers/model_doc/codegen)** (from Salesforce) released with the paper [A Conversational Paradigm for Program Synthesis](https://arxiv.org/abs/2203.13474) by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, Caiming Xiong. +1. **[DETR](https://huggingface.co/docs/transformers/model_doc/detr)** (from Facebook) released with the paper [End-to-End Object Detection with Transformers](https://arxiv.org/abs/2005.12872) by Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, Sergey Zagoruyko. +1. **[DistilBERT](https://huggingface.co/docs/transformers/model_doc/distilbert)** (from HuggingFace), released together with the paper [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter](https://arxiv.org/abs/1910.01108) by Victor Sanh, Lysandre Debut and Thomas Wolf. The same method has been applied to compress GPT2 into [DistilGPT2](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation), RoBERTa into [DistilRoBERTa](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation), Multilingual BERT into [DistilmBERT](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) and a German version of DistilBERT. +1. **[FLAN-T5](https://huggingface.co/docs/transformers/model_doc/flan-t5)** (from Google AI) released in the repository [google-research/t5x](https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints) by Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei +1. **[GPT Neo](https://huggingface.co/docs/transformers/model_doc/gpt_neo)** (from EleutherAI) released in the repository [EleutherAI/gpt-neo](https://github.com/EleutherAI/gpt-neo) by Sid Black, Stella Biderman, Leo Gao, Phil Wang and Connor Leahy. +1. **[GPT-2](https://huggingface.co/docs/transformers/model_doc/gpt2)** (from OpenAI) released with the paper [Language Models are Unsupervised Multitask Learners](https://blog.openai.com/better-language-models/) by Alec Radford*, Jeffrey Wu*, Rewon Child, David Luan, Dario Amodei** and Ilya Sutskever**. +1. **[MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)** Machine translation models trained using [OPUS](http://opus.nlpl.eu/) data by Jörg Tiedemann. The [Marian Framework](https://marian-nmt.github.io/) is being developed by the Microsoft Translator Team. +1. **[MobileBERT](https://huggingface.co/docs/transformers/model_doc/mobilebert)** (from CMU/Google Brain) released with the paper [MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices](https://arxiv.org/abs/2004.02984) by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. +1. **[MT5](https://huggingface.co/docs/transformers/model_doc/mt5)** (from Google AI) released with the paper [mT5: A massively multilingual pre-trained text-to-text transformer](https://arxiv.org/abs/2010.11934) by Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, Colin Raffel. +1. **[NLLB](https://huggingface.co/docs/transformers/model_doc/nllb)** (from Meta) released with the paper [No Language Left Behind: Scaling Human-Centered Machine Translation](https://arxiv.org/abs/2207.04672) by the NLLB team. +1. **[SqueezeBERT](https://huggingface.co/docs/transformers/model_doc/squeezebert)** (from Berkeley) released with the paper [SqueezeBERT: What can computer vision teach NLP about efficient neural networks?](https://arxiv.org/abs/2006.11316) by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W. Keutzer. +1. **[T5](https://huggingface.co/docs/transformers/model_doc/t5)** (from Google AI) released with the paper [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/abs/1910.10683) by Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu. +1. **[T5v1.1](https://huggingface.co/docs/transformers/model_doc/t5v1.1)** (from Google AI) released in the repository [google-research/text-to-text-transfer-transformer](https://github.com/google-research/text-to-text-transfer-transformer/blob/main/released_checkpoints.md#t511) by Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu. +1. **[Vision Transformer (ViT)](https://huggingface.co/docs/transformers/model_doc/vit)** (from Google AI) released with the paper [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929) by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby. +1. **[Whisper](https://huggingface.co/docs/transformers/model_doc/whisper)** (from OpenAI) released with the paper [Robust Speech Recognition via Large-Scale Weak Supervision](https://cdn.openai.com/papers/whisper.pdf) by Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, Ilya Sutskever. diff --git a/dist/ort-wasm-simd-threaded.wasm b/dist/ort-wasm-simd-threaded.wasm deleted file mode 100644 index fd14f597d..000000000 Binary files a/dist/ort-wasm-simd-threaded.wasm and /dev/null differ diff --git a/dist/ort-wasm-simd.wasm b/dist/ort-wasm-simd.wasm deleted file mode 100644 index b4985f027..000000000 Binary files a/dist/ort-wasm-simd.wasm and /dev/null differ diff --git a/dist/ort-wasm-threaded.wasm b/dist/ort-wasm-threaded.wasm deleted file mode 100644 index b29841bab..000000000 Binary files a/dist/ort-wasm-threaded.wasm and /dev/null differ diff --git a/dist/ort-wasm.wasm b/dist/ort-wasm.wasm deleted file mode 100644 index 5b2dd9abf..000000000 Binary files a/dist/ort-wasm.wasm and /dev/null differ diff --git a/dist/transformers.js b/dist/transformers.js deleted file mode 100644 index 2ff49973a..000000000 --- a/dist/transformers.js +++ /dev/null @@ -1,11742 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/onnxruntime-common/dist/lib/backend-impl.js": -/*!******************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/backend-impl.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerBackend": () => (/* binding */ registerBackend), -/* harmony export */ "resolveBackend": () => (/* binding */ resolveBackend) -/* harmony export */ }); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -const backends = {}; -const backendsSortedByPriority = []; -/** - * Register a backend. - * - * @param name - the name as a key to lookup as an execution provider. - * @param backend - the backend object. - * @param priority - an integer indicating the priority of the backend. Higher number means higher priority. if priority - * < 0, it will be considered as a 'beta' version and will not be used as a fallback backend by default. - * - * @internal - */ -const registerBackend = (name, backend, priority) => { - if (backend && typeof backend.init === 'function' && typeof backend.createSessionHandler === 'function') { - const currentBackend = backends[name]; - if (currentBackend === undefined) { - backends[name] = { backend, priority }; - } - else if (currentBackend.priority > priority) { - // same name is already registered with a higher priority. skip registeration. - return; - } - else if (currentBackend.priority === priority) { - if (currentBackend.backend !== backend) { - throw new Error(`cannot register backend "${name}" using priority ${priority}`); - } - } - if (priority >= 0) { - const i = backendsSortedByPriority.indexOf(name); - if (i !== -1) { - backendsSortedByPriority.splice(i, 1); - } - for (let i = 0; i < backendsSortedByPriority.length; i++) { - if (backends[backendsSortedByPriority[i]].priority <= priority) { - backendsSortedByPriority.splice(i, 0, name); - return; - } - } - backendsSortedByPriority.push(name); - } - return; - } - throw new TypeError('not a valid backend'); -}; -/** - * Resolve backend by specified hints. - * - * @param backendHints - a list of execution provider names to lookup. If omitted use registered backends as list. - * @returns a promise that resolves to the backend. - * - * @internal - */ -const resolveBackend = async (backendHints) => { - const backendNames = backendHints.length === 0 ? backendsSortedByPriority : backendHints; - const errors = []; - for (const backendName of backendNames) { - const backendInfo = backends[backendName]; - if (backendInfo) { - if (backendInfo.initialized) { - return backendInfo.backend; - } - else if (backendInfo.aborted) { - continue; // current backend is unavailable; try next - } - const isInitializing = !!backendInfo.initPromise; - try { - if (!isInitializing) { - backendInfo.initPromise = backendInfo.backend.init(); - } - await backendInfo.initPromise; - backendInfo.initialized = true; - return backendInfo.backend; - } - catch (e) { - if (!isInitializing) { - errors.push({ name: backendName, err: e }); - } - backendInfo.aborted = true; - } - finally { - delete backendInfo.initPromise; - } - } - } - throw new Error(`no available backend found. ERR: ${errors.map(e => `[${e.name}] ${e.err}`).join(', ')}`); -}; -//# sourceMappingURL=backend-impl.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/backend.js": -/*!*************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/backend.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerBackend": () => (/* reexport safe */ _backend_impl__WEBPACK_IMPORTED_MODULE_0__.registerBackend) -/* harmony export */ }); -/* harmony import */ var _backend_impl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./backend-impl */ "./node_modules/onnxruntime-common/dist/lib/backend-impl.js"); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -//# sourceMappingURL=backend.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/env-impl.js": -/*!**************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/env-impl.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "EnvImpl": () => (/* binding */ EnvImpl) -/* harmony export */ }); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -class EnvImpl { - constructor() { - this.wasm = {}; - this.webgl = {}; - this.logLevelInternal = 'warning'; - } - // TODO standadize the getter and setter convention in env for other fields. - set logLevel(value) { - if (value === undefined) { - return; - } - if (typeof value !== 'string' || ['verbose', 'info', 'warning', 'error', 'fatal'].indexOf(value) === -1) { - throw new Error(`Unsupported logging level: ${value}`); - } - this.logLevelInternal = value; - } - get logLevel() { - return this.logLevelInternal; - } -} -//# sourceMappingURL=env-impl.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/env.js": -/*!*********************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/env.js ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "env": () => (/* binding */ env) -/* harmony export */ }); -/* harmony import */ var _env_impl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env-impl */ "./node_modules/onnxruntime-common/dist/lib/env-impl.js"); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * Represent a set of flags as a global singleton. - */ -const env = new _env_impl__WEBPACK_IMPORTED_MODULE_0__.EnvImpl(); -//# sourceMappingURL=env.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/index.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "InferenceSession": () => (/* reexport safe */ _inference_session__WEBPACK_IMPORTED_MODULE_2__.InferenceSession), -/* harmony export */ "Tensor": () => (/* reexport safe */ _tensor__WEBPACK_IMPORTED_MODULE_3__.Tensor), -/* harmony export */ "env": () => (/* reexport safe */ _env__WEBPACK_IMPORTED_MODULE_1__.env), -/* harmony export */ "registerBackend": () => (/* reexport safe */ _backend__WEBPACK_IMPORTED_MODULE_0__.registerBackend) -/* harmony export */ }); -/* harmony import */ var _backend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./backend */ "./node_modules/onnxruntime-common/dist/lib/backend.js"); -/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env */ "./node_modules/onnxruntime-common/dist/lib/env.js"); -/* harmony import */ var _inference_session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inference-session */ "./node_modules/onnxruntime-common/dist/lib/inference-session.js"); -/* harmony import */ var _tensor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tensor */ "./node_modules/onnxruntime-common/dist/lib/tensor.js"); -/* harmony import */ var _onnx_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./onnx-value */ "./node_modules/onnxruntime-common/dist/lib/onnx-value.js"); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -/** - * # ONNX Runtime JavaScript API - * - * ONNX Runtime JavaScript API is a unified API for all JavaScript usages, including the following NPM packages: - * - * - [onnxruntime-node](https://www.npmjs.com/package/onnxruntime-node) - * - [onnxruntime-web](https://www.npmjs.com/package/onnxruntime-web) - * - [onnxruntime-react-native](https://www.npmjs.com/package/onnxruntime-react-native) - * - * See also: - * - [Get Started](https://onnxruntime.ai/docs/get-started/with-javascript.html) - * - [Inference examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js) - * - * @packageDocumentation - */ - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js": -/*!****************************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "InferenceSession": () => (/* binding */ InferenceSession) -/* harmony export */ }); -/* harmony import */ var _backend_impl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./backend-impl */ "./node_modules/onnxruntime-common/dist/lib/backend-impl.js"); -/* harmony import */ var _tensor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tensor */ "./node_modules/onnxruntime-common/dist/lib/tensor.js"); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - - -class InferenceSession { - constructor(handler) { - this.handler = handler; - } - async run(feeds, arg1, arg2) { - const fetches = {}; - let options = {}; - // check inputs - if (typeof feeds !== 'object' || feeds === null || feeds instanceof _tensor__WEBPACK_IMPORTED_MODULE_1__.Tensor || Array.isArray(feeds)) { - throw new TypeError('\'feeds\' must be an object that use input names as keys and OnnxValue as corresponding values.'); - } - let isFetchesEmpty = true; - // determine which override is being used - if (typeof arg1 === 'object') { - if (arg1 === null) { - throw new TypeError('Unexpected argument[1]: cannot be null.'); - } - if (arg1 instanceof _tensor__WEBPACK_IMPORTED_MODULE_1__.Tensor) { - throw new TypeError('\'fetches\' cannot be a Tensor'); - } - if (Array.isArray(arg1)) { - if (arg1.length === 0) { - throw new TypeError('\'fetches\' cannot be an empty array.'); - } - isFetchesEmpty = false; - // output names - for (const name of arg1) { - if (typeof name !== 'string') { - throw new TypeError('\'fetches\' must be a string array or an object.'); - } - if (this.outputNames.indexOf(name) === -1) { - throw new RangeError(`'fetches' contains invalid output name: ${name}.`); - } - fetches[name] = null; - } - if (typeof arg2 === 'object' && arg2 !== null) { - options = arg2; - } - else if (typeof arg2 !== 'undefined') { - throw new TypeError('\'options\' must be an object.'); - } - } - else { - // decide whether arg1 is fetches or options - // if any output name is present and its value is valid OnnxValue, we consider it fetches - let isFetches = false; - const arg1Keys = Object.getOwnPropertyNames(arg1); - for (const name of this.outputNames) { - if (arg1Keys.indexOf(name) !== -1) { - const v = arg1[name]; - if (v === null || v instanceof _tensor__WEBPACK_IMPORTED_MODULE_1__.Tensor) { - isFetches = true; - isFetchesEmpty = false; - fetches[name] = v; - } - } - } - if (isFetches) { - if (typeof arg2 === 'object' && arg2 !== null) { - options = arg2; - } - else if (typeof arg2 !== 'undefined') { - throw new TypeError('\'options\' must be an object.'); - } - } - else { - options = arg1; - } - } - } - else if (typeof arg1 !== 'undefined') { - throw new TypeError('Unexpected argument[1]: must be \'fetches\' or \'options\'.'); - } - // check if all inputs are in feed - for (const name of this.inputNames) { - if (typeof feeds[name] === 'undefined') { - throw new Error(`input '${name}' is missing in 'feeds'.`); - } - } - // if no fetches is specified, we use the full output names list - if (isFetchesEmpty) { - for (const name of this.outputNames) { - fetches[name] = null; - } - } - // feeds, fetches and options are prepared - const results = await this.handler.run(feeds, fetches, options); - const returnValue = {}; - for (const key in results) { - if (Object.hasOwnProperty.call(results, key)) { - returnValue[key] = new _tensor__WEBPACK_IMPORTED_MODULE_1__.Tensor(results[key].type, results[key].data, results[key].dims); - } - } - return returnValue; - } - static async create(arg0, arg1, arg2, arg3) { - // either load from a file or buffer - let filePathOrUint8Array; - let options = {}; - if (typeof arg0 === 'string') { - filePathOrUint8Array = arg0; - if (typeof arg1 === 'object' && arg1 !== null) { - options = arg1; - } - else if (typeof arg1 !== 'undefined') { - throw new TypeError('\'options\' must be an object.'); - } - } - else if (arg0 instanceof Uint8Array) { - filePathOrUint8Array = arg0; - if (typeof arg1 === 'object' && arg1 !== null) { - options = arg1; - } - else if (typeof arg1 !== 'undefined') { - throw new TypeError('\'options\' must be an object.'); - } - } - else if (arg0 instanceof ArrayBuffer || - (typeof SharedArrayBuffer !== 'undefined' && arg0 instanceof SharedArrayBuffer)) { - const buffer = arg0; - let byteOffset = 0; - let byteLength = arg0.byteLength; - if (typeof arg1 === 'object' && arg1 !== null) { - options = arg1; - } - else if (typeof arg1 === 'number') { - byteOffset = arg1; - if (!Number.isSafeInteger(byteOffset)) { - throw new RangeError('\'byteOffset\' must be an integer.'); - } - if (byteOffset < 0 || byteOffset >= buffer.byteLength) { - throw new RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`); - } - byteLength = arg0.byteLength - byteOffset; - if (typeof arg2 === 'number') { - byteLength = arg2; - if (!Number.isSafeInteger(byteLength)) { - throw new RangeError('\'byteLength\' must be an integer.'); - } - if (byteLength <= 0 || byteOffset + byteLength > buffer.byteLength) { - throw new RangeError(`'byteLength' is out of range (0, ${buffer.byteLength - byteOffset}].`); - } - if (typeof arg3 === 'object' && arg3 !== null) { - options = arg3; - } - else if (typeof arg3 !== 'undefined') { - throw new TypeError('\'options\' must be an object.'); - } - } - else if (typeof arg2 !== 'undefined') { - throw new TypeError('\'byteLength\' must be a number.'); - } - } - else if (typeof arg1 !== 'undefined') { - throw new TypeError('\'options\' must be an object.'); - } - filePathOrUint8Array = new Uint8Array(buffer, byteOffset, byteLength); - } - else { - throw new TypeError('Unexpected argument[0]: must be \'path\' or \'buffer\'.'); - } - // get backend hints - const eps = options.executionProviders || []; - const backendHints = eps.map(i => typeof i === 'string' ? i : i.name); - const backend = await (0,_backend_impl__WEBPACK_IMPORTED_MODULE_0__.resolveBackend)(backendHints); - const handler = await backend.createSessionHandler(filePathOrUint8Array, options); - return new InferenceSession(handler); - } - startProfiling() { - this.handler.startProfiling(); - } - endProfiling() { - this.handler.endProfiling(); - } - get inputNames() { - return this.handler.inputNames; - } - get outputNames() { - return this.handler.outputNames; - } -} -//# sourceMappingURL=inference-session-impl.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/inference-session.js": -/*!***********************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/inference-session.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "InferenceSession": () => (/* binding */ InferenceSession) -/* harmony export */ }); -/* harmony import */ var _inference_session_impl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inference-session-impl */ "./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js"); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// eslint-disable-next-line @typescript-eslint/naming-convention -const InferenceSession = _inference_session_impl__WEBPACK_IMPORTED_MODULE_0__.InferenceSession; -//# sourceMappingURL=inference-session.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/onnx-value.js": -/*!****************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/onnx-value.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -//# sourceMappingURL=onnx-value.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/tensor-impl.js": -/*!*****************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/tensor-impl.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Tensor": () => (/* binding */ Tensor) -/* harmony export */ }); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -const isBigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined' && typeof BigInt64Array.from === 'function'; -const isBigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined' && typeof BigUint64Array.from === 'function'; -// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap. -const NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP = new Map([ - ['float32', Float32Array], - ['uint8', Uint8Array], - ['int8', Int8Array], - ['uint16', Uint16Array], - ['int16', Int16Array], - ['int32', Int32Array], - ['bool', Uint8Array], - ['float64', Float64Array], - ['uint32', Uint32Array], -]); -// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap. -const NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP = new Map([ - [Float32Array, 'float32'], - [Uint8Array, 'uint8'], - [Int8Array, 'int8'], - [Uint16Array, 'uint16'], - [Int16Array, 'int16'], - [Int32Array, 'int32'], - [Float64Array, 'float64'], - [Uint32Array, 'uint32'], -]); -if (isBigInt64ArrayAvailable) { - NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('int64', BigInt64Array); - NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array, 'int64'); -} -if (isBigUint64ArrayAvailable) { - NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('uint64', BigUint64Array); - NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array, 'uint64'); -} -/** - * calculate size from dims. - * - * @param dims the dims array. May be an illegal input. - */ -const calculateSize = (dims) => { - let size = 1; - for (let i = 0; i < dims.length; i++) { - const dim = dims[i]; - if (typeof dim !== 'number' || !Number.isSafeInteger(dim)) { - throw new TypeError(`dims[${i}] must be an integer, got: ${dim}`); - } - if (dim < 0) { - throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${dim}`); - } - size *= dim; - } - return size; -}; -class Tensor { - constructor(arg0, arg1, arg2) { - let type; - let data; - let dims; - // check whether arg0 is type or data - if (typeof arg0 === 'string') { - // - // Override: constructor(type, data, ...) - // - type = arg0; - dims = arg2; - if (arg0 === 'string') { - // string tensor - if (!Array.isArray(arg1)) { - throw new TypeError('A string tensor\'s data must be a string array.'); - } - // we don't check whether every element in the array is string; this is too slow. we assume it's correct and - // error will be populated at inference - data = arg1; - } - else { - // numeric tensor - const typedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(arg0); - if (typedArrayConstructor === undefined) { - throw new TypeError(`Unsupported tensor type: ${arg0}.`); - } - if (Array.isArray(arg1)) { - // use 'as any' here because TypeScript's check on type of 'SupportedTypedArrayConstructors.from()' produces - // incorrect results. - // 'typedArrayConstructor' should be one of the typed array prototype objects. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data = typedArrayConstructor.from(arg1); - } - else if (arg1 instanceof typedArrayConstructor) { - data = arg1; - } - else { - throw new TypeError(`A ${type} tensor's data must be type of ${typedArrayConstructor}`); - } - } - } - else { - // - // Override: constructor(data, ...) - // - dims = arg1; - if (Array.isArray(arg0)) { - // only boolean[] and string[] is supported - if (arg0.length === 0) { - throw new TypeError('Tensor type cannot be inferred from an empty array.'); - } - const firstElementType = typeof arg0[0]; - if (firstElementType === 'string') { - type = 'string'; - data = arg0; - } - else if (firstElementType === 'boolean') { - type = 'bool'; - // 'arg0' is of type 'boolean[]'. Uint8Array.from(boolean[]) actually works, but typescript thinks this is - // wrong type. We use 'as any' to make it happy. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data = Uint8Array.from(arg0); - } - else { - throw new TypeError(`Invalid element type of data array: ${firstElementType}.`); - } - } - else { - // get tensor type from TypedArray - const mappedType = NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(arg0.constructor); - if (mappedType === undefined) { - throw new TypeError(`Unsupported type for tensor data: ${arg0.constructor}.`); - } - type = mappedType; - data = arg0; - } - } - // type and data is processed, now processing dims - if (dims === undefined) { - // assume 1-D tensor if dims omitted - dims = [data.length]; - } - else if (!Array.isArray(dims)) { - throw new TypeError('A tensor\'s dims must be a number array'); - } - // perform check - const size = calculateSize(dims); - if (size !== data.length) { - throw new Error(`Tensor's size(${size}) does not match data length(${data.length}).`); - } - this.dims = dims; - this.type = type; - this.data = data; - this.size = size; - } - // #endregion - /** - * Create a new tensor object from image object - * - * @param buffer - Extracted image buffer data - assuming RGBA format - * @param imageFormat - input image configuration - required configurations height, width, format - * @param tensorFormat - output tensor configuration - Default is RGB format - */ - static bufferToTensor(buffer, options) { - if (buffer === undefined) { - throw new Error('Image buffer must be defined'); - } - if (options.height === undefined || options.width === undefined) { - throw new Error('Image height and width must be defined'); - } - const { height, width } = options; - const norm = options.norm; - let normMean; - let normBias; - if (norm === undefined || norm.mean === undefined) { - normMean = 255; - } - else { - normMean = norm.mean; - } - if (norm === undefined || norm.bias === undefined) { - normBias = 0; - } - else { - normBias = norm.bias; - } - const inputformat = options.bitmapFormat !== undefined ? options.bitmapFormat : 'RGBA'; - // default value is RGBA since imagedata and HTMLImageElement uses it - const outputformat = options.tensorFormat !== undefined ? - (options.tensorFormat !== undefined ? options.tensorFormat : 'RGB') : - 'RGB'; - const offset = height * width; - const float32Data = outputformat === 'RGBA' ? new Float32Array(offset * 4) : new Float32Array(offset * 3); - // Default pointer assignments - let step = 4, rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3; - let rTensorPointer = 0, gTensorPointer = offset, bTensorPointer = offset * 2, aTensorPointer = -1; - // Updating the pointer assignments based on the input image format - if (inputformat === 'RGB') { - step = 3; - rImagePointer = 0; - gImagePointer = 1; - bImagePointer = 2; - aImagePointer = -1; - } - // Updating the pointer assignments based on the output tensor format - if (outputformat === 'RGBA') { - aTensorPointer = offset * 3; - } - else if (outputformat === 'RBG') { - rTensorPointer = 0; - bTensorPointer = offset; - gTensorPointer = offset * 2; - } - else if (outputformat === 'BGR') { - bTensorPointer = 0; - gTensorPointer = offset; - rTensorPointer = offset * 2; - } - for (let i = 0; i < offset; i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step) { - float32Data[rTensorPointer++] = (buffer[rImagePointer] + normBias) / normMean; - float32Data[gTensorPointer++] = (buffer[gImagePointer] + normBias) / normMean; - float32Data[bTensorPointer++] = (buffer[bImagePointer] + normBias) / normMean; - if (aTensorPointer !== -1 && aImagePointer !== -1) { - float32Data[aTensorPointer++] = (buffer[aImagePointer] + normBias) / normMean; - } - } - // Float32Array -> ort.Tensor - const outputTensor = outputformat === 'RGBA' ? new Tensor('float32', float32Data, [1, 4, height, width]) : - new Tensor('float32', float32Data, [1, 3, height, width]); - return outputTensor; - } - static async fromImage(image, options) { - // checking the type of image object - const isHTMLImageEle = typeof (HTMLImageElement) !== 'undefined' && image instanceof HTMLImageElement; - const isImageDataEle = typeof (ImageData) !== 'undefined' && image instanceof ImageData; - const isImageBitmap = typeof (ImageBitmap) !== 'undefined' && image instanceof ImageBitmap; - const isURL = typeof (String) !== 'undefined' && (image instanceof String || typeof image === 'string'); - let data; - let tensorConfig = {}; - // filling and checking image configuration options - if (isHTMLImageEle) { - // HTMLImageElement - image object - format is RGBA by default - const canvas = document.createElement('canvas'); - const pixels2DContext = canvas.getContext('2d'); - if (pixels2DContext != null) { - let height = image.naturalHeight; - let width = image.naturalWidth; - if (options !== undefined && options.resizedHeight !== undefined && options.resizedWidth !== undefined) { - height = options.resizedHeight; - width = options.resizedWidth; - } - if (options !== undefined) { - tensorConfig = options; - if (options.tensorFormat !== undefined) { - throw new Error('Image input config format must be RGBA for HTMLImageElement'); - } - else { - tensorConfig.tensorFormat = 'RGBA'; - } - if (options.height !== undefined && options.height !== height) { - throw new Error('Image input config height doesn\'t match HTMLImageElement height'); - } - else { - tensorConfig.height = height; - } - if (options.width !== undefined && options.width !== width) { - throw new Error('Image input config width doesn\'t match HTMLImageElement width'); - } - else { - tensorConfig.width = width; - } - } - else { - tensorConfig.tensorFormat = 'RGBA'; - tensorConfig.height = height; - tensorConfig.width = width; - } - canvas.width = width; - canvas.height = height; - pixels2DContext.drawImage(image, 0, 0, width, height); - data = pixels2DContext.getImageData(0, 0, width, height).data; - } - else { - throw new Error('Can not access image data'); - } - } - else if (isImageDataEle) { - // ImageData - image object - format is RGBA by default - const format = 'RGBA'; - let height; - let width; - if (options !== undefined && options.resizedWidth !== undefined && options.resizedHeight !== undefined) { - height = options.resizedHeight; - width = options.resizedWidth; - } - else { - height = image.height; - width = image.width; - } - if (options !== undefined) { - tensorConfig = options; - if (options.bitmapFormat !== undefined && options.bitmapFormat !== format) { - throw new Error('Image input config format must be RGBA for ImageData'); - } - else { - tensorConfig.bitmapFormat = 'RGBA'; - } - } - else { - tensorConfig.bitmapFormat = 'RGBA'; - } - tensorConfig.height = height; - tensorConfig.width = width; - if (options !== undefined) { - const tempCanvas = document.createElement('canvas'); - tempCanvas.width = width; - tempCanvas.height = height; - const pixels2DContext = tempCanvas.getContext('2d'); - if (pixels2DContext != null) { - pixels2DContext.putImageData(image, 0, 0); - data = pixels2DContext.getImageData(0, 0, width, height).data; - } - else { - throw new Error('Can not access image data'); - } - } - else { - data = image.data; - } - } - else if (isImageBitmap) { - // ImageBitmap - image object - format must be provided by user - if (options === undefined) { - throw new Error('Please provide image config with format for Imagebitmap'); - } - if (options.bitmapFormat !== undefined) { - throw new Error('Image input config format must be defined for ImageBitmap'); - } - const pixels2DContext = document.createElement('canvas').getContext('2d'); - if (pixels2DContext != null) { - const height = image.height; - const width = image.width; - pixels2DContext.drawImage(image, 0, 0, width, height); - data = pixels2DContext.getImageData(0, 0, width, height).data; - if (options !== undefined) { - // using square brackets to avoid TS error - type 'never' - if (options.height !== undefined && options.height !== height) { - throw new Error('Image input config height doesn\'t match ImageBitmap height'); - } - else { - tensorConfig.height = height; - } - // using square brackets to avoid TS error - type 'never' - if (options.width !== undefined && options.width !== width) { - throw new Error('Image input config width doesn\'t match ImageBitmap width'); - } - else { - tensorConfig.width = width; - } - } - else { - tensorConfig.height = height; - tensorConfig.width = width; - } - return Tensor.bufferToTensor(data, tensorConfig); - } - else { - throw new Error('Can not access image data'); - } - } - else if (isURL) { - return new Promise((resolve, reject) => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('2d'); - if (!image || !context) { - return reject(); - } - const newImage = new Image(); - newImage.crossOrigin = 'Anonymous'; - newImage.src = image; - newImage.onload = () => { - canvas.width = newImage.width; - canvas.height = newImage.height; - context.drawImage(newImage, 0, 0, canvas.width, canvas.height); - const img = context.getImageData(0, 0, canvas.width, canvas.height); - if (options !== undefined) { - // using square brackets to avoid TS error - type 'never' - if (options.height !== undefined && options.height !== canvas.height) { - throw new Error('Image input config height doesn\'t match ImageBitmap height'); - } - else { - tensorConfig.height = canvas.height; - } - // using square brackets to avoid TS error - type 'never' - if (options.width !== undefined && options.width !== canvas.width) { - throw new Error('Image input config width doesn\'t match ImageBitmap width'); - } - else { - tensorConfig.width = canvas.width; - } - } - else { - tensorConfig.height = canvas.height; - tensorConfig.width = canvas.width; - } - resolve(Tensor.bufferToTensor(img.data, tensorConfig)); - }; - }); - } - else { - throw new Error('Input data provided is not supported - aborted tensor creation'); - } - if (data !== undefined) { - return Tensor.bufferToTensor(data, tensorConfig); - } - else { - throw new Error('Input data provided is not supported - aborted tensor creation'); - } - } - toImageData(options) { - var _a, _b; - const pixels2DContext = document.createElement('canvas').getContext('2d'); - let image; - if (pixels2DContext != null) { - // Default values for height and width & format - const width = this.dims[3]; - const height = this.dims[2]; - const channels = this.dims[1]; - const inputformat = options !== undefined ? (options.format !== undefined ? options.format : 'RGB') : 'RGB'; - const normMean = options !== undefined ? (((_a = options.norm) === null || _a === void 0 ? void 0 : _a.mean) !== undefined ? options.norm.mean : 255) : 255; - const normBias = options !== undefined ? (((_b = options.norm) === null || _b === void 0 ? void 0 : _b.bias) !== undefined ? options.norm.bias : 0) : 0; - const offset = height * width; - if (options !== undefined) { - if (options.height !== undefined && options.height !== height) { - throw new Error('Image output config height doesn\'t match tensor height'); - } - if (options.width !== undefined && options.width !== width) { - throw new Error('Image output config width doesn\'t match tensor width'); - } - if (options.format !== undefined && (channels === 4 && options.format !== 'RGBA') || - (channels === 3 && (options.format !== 'RGB' && options.format !== 'BGR'))) { - throw new Error('Tensor format doesn\'t match input tensor dims'); - } - } - // Default pointer assignments - const step = 4; - let rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3; - let rTensorPointer = 0, gTensorPointer = offset, bTensorPointer = offset * 2, aTensorPointer = -1; - // Updating the pointer assignments based on the input image format - if (inputformat === 'RGBA') { - rTensorPointer = 0; - gTensorPointer = offset; - bTensorPointer = offset * 2; - aTensorPointer = offset * 3; - } - else if (inputformat === 'RGB') { - rTensorPointer = 0; - gTensorPointer = offset; - bTensorPointer = offset * 2; - } - else if (inputformat === 'RBG') { - rTensorPointer = 0; - bTensorPointer = offset; - gTensorPointer = offset * 2; - } - image = pixels2DContext.createImageData(width, height); - for (let i = 0; i < height * width; rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++) { - image.data[rImagePointer] = (this.data[rTensorPointer++] - normBias) * normMean; // R value - image.data[gImagePointer] = (this.data[gTensorPointer++] - normBias) * normMean; // G value - image.data[bImagePointer] = (this.data[bTensorPointer++] - normBias) * normMean; // B value - image.data[aImagePointer] = - aTensorPointer === -1 ? 255 : (this.data[aTensorPointer++] - normBias) * normMean; // A value - } - } - else { - throw new Error('Can not access image data'); - } - return image; - } - // #endregion - // #region tensor utilities - reshape(dims) { - return new Tensor(this.type, this.data, dims); - } -} -//# sourceMappingURL=tensor-impl.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-common/dist/lib/tensor.js": -/*!************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/tensor.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Tensor": () => (/* binding */ Tensor) -/* harmony export */ }); -/* harmony import */ var _tensor_impl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tensor-impl */ "./node_modules/onnxruntime-common/dist/lib/tensor-impl.js"); -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// eslint-disable-next-line @typescript-eslint/naming-convention -const Tensor = _tensor_impl__WEBPACK_IMPORTED_MODULE_0__.Tensor; -//# sourceMappingURL=tensor.js.map - -/***/ }), - -/***/ "./node_modules/onnxruntime-web/dist/ort-web.min.js": -/*!**********************************************************!*\ - !*** ./node_modules/onnxruntime-web/dist/ort-web.min.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/*! -* ONNX Runtime Web v1.14.0 -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. -*/ -!function(t,e){if(true)module.exports=e(__webpack_require__(/*! onnxruntime-common */ "./node_modules/onnxruntime-common/dist/lib/index.js"));else { var r, n; }}(self,(__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return $.buffer!=C&&H($.buffer),F}function r(){return $.buffer!=C&&H($.buffer),N}function i(){return $.buffer!=C&&H($.buffer),L}function o(){return $.buffer!=C&&H($.buffer),R}function a(){return $.buffer!=C&&H($.buffer),j}var s,u,c;t=t||{},s||(s=void 0!==t?t:{}),s.ready=new Promise((function(t,e){u=t,c=e}));var l,p,f,d,h,g,b=Object.assign({},s),m="./this.program",y=(t,e)=>{throw e},_="object"==typeof window,v="function"==typeof importScripts,w="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,x=s.ENVIRONMENT_IS_PTHREAD||!1,T="";function S(t){return s.locateFile?s.locateFile(t,T):T+t}if(w){let e;T=v?n(908).dirname(T)+"/":"//",g=()=>{h||(d=n(1384),h=n(908))},l=function(t,e){return g(),t=h.normalize(t),d.readFileSync(t,e?void 0:"utf8")},f=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),p=(t,e,n)=>{g(),t=h.normalize(t),d.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(J())throw process.exitCode=t,e;e instanceof ut||P("exiting due to exception: "+e),process.exit(t)},s.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(t){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),t}n.g.Worker=e.Worker}else(_||v)&&(v?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),_scriptDir&&(T=_scriptDir),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},v&&(f=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),p=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));w&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var O=console.log.bind(console),A=console.warn.bind(console);w&&(g(),O=t=>d.writeSync(1,t+"\n"),A=t=>d.writeSync(2,t+"\n"));var E,I=s.print||O,P=s.printErr||A;Object.assign(s,b),b=null,s.thisProgram&&(m=s.thisProgram),s.quit&&(y=s.quit),s.wasmBinary&&(E=s.wasmBinary);var D=s.noExitRuntime||!1;"object"!=typeof WebAssembly&&it("no native wasm support detected");var $,k,C,F,N,L,R,j,M=!1,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function V(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function B(t,e){return(t>>>=0)?V(r(),t,e):""}function z(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-i}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function H(t){C=t,s.HEAP8=F=new Int8Array(t),s.HEAP16=new Int16Array(t),s.HEAP32=L=new Int32Array(t),s.HEAPU8=N=new Uint8Array(t),s.HEAPU16=new Uint16Array(t),s.HEAPU32=R=new Uint32Array(t),s.HEAPF32=new Float32Array(t),s.HEAPF64=j=new Float64Array(t)}x&&(C=s.buffer);var W=s.INITIAL_MEMORY||16777216;if(x)$=s.wasmMemory,C=s.buffer;else if(s.wasmMemory)$=s.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),w&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");$&&(C=$.buffer),W=C.byteLength,H(C);var q,X=[],Y=[],K=[],Z=[];function J(){return D||!1}function Q(){var t=s.preRun.shift();X.unshift(t)}var tt,et=0,nt=null,rt=null;function it(t){throw x?postMessage({cmd:"onAbort",arg:t}):s.onAbort&&s.onAbort(t),P(t="Aborted("+t+")"),M=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),c(t),t}function ot(){return tt.startsWith("data:application/octet-stream;base64,")}function at(){var t=tt;try{if(t==tt&&E)return new Uint8Array(E);if(f)return f(t);throw"both async and sync fetching of the wasm failed"}catch(t){it(t)}}tt="ort-wasm-threaded.wasm",ot()||(tt=S(tt));var st={};function ut(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function ct(t){(t=dt.Vb[t])||it(),dt.mc(t)}function lt(t){var e=dt.Cc();if(!e)return 6;dt.ac.push(e),dt.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function pt(t){if(x)return qt(1,1,t);J()||(dt.oc(),s.onExit&&s.onExit(t),M=!0),y(t,new ut(t))}function ft(t,e){if(!e&&x)throw bt(t),"unwind";J()||x||(me(),ht(K),be(0),re[1].length&&ie(1,10),re[2].length&&ie(2,10),dt.oc()),pt(t)}var dt={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&dt.Ec()},Pc:function(){},Ec:function(){dt.receiveObjectTransfer=dt.Gc,dt.threadInitTLS=dt.pc,dt.setExitStatus=dt.nc,D=!1},nc:function(){},oc:function(){for(var t of Object.values(dt.Vb))dt.mc(t);for(t of dt.Yb)t.terminate();dt.Yb=[]},mc:function(t){var e=t.Ub;delete dt.Vb[e],dt.Yb.push(t),dt.ac.splice(dt.ac.indexOf(t),1),t.Ub=0,xe(e)},Gc:function(){},pc:function(){dt.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(dt.Bc=t.Ub),n.targetThread&&n.targetThread!=de()){var i=dt.Vb[n.Qc];i?i.postMessage(n,n.transferList):P('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Vt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?ct(n.thread):"killThread"===r?(n=n.thread,r=dt.Vb[n],delete dt.Vb[n],r.terminate(),xe(n),dt.ac.splice(dt.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?dt.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?I("Thread "+n.threadId+": "+n.text):"printErr"===r?P("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?s.onAbort&&s.onAbort(n.arg):r&&P("worker sent an unknown command "+r);dt.Bc=void 0},t.onerror=t=>{throw P("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},w&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:$,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");dt.Yb.push(new Worker(t))},Cc:function(){return 0==dt.Yb.length&&(dt.yc(),dt.Fc(dt.Yb[0])),dt.Yb.pop()}};function ht(t){for(;0>2>>>0];t=i()[t+48>>2>>>0],Oe(e,e-t),Ee(e)};var mt=[];function yt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=q.get(t)),e}s.invokeEntryPoint=function(t,e){t=yt(t)(e),J()?dt.nc(t):Te(t)};var _t,vt,wt=[],xt=0,Tt=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){o()[this.Sb+4>>2>>>0]=t},this.bc=function(){return o()[this.Sb+4>>2>>>0]},this.wc=function(t){o()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return o()[this.Sb+8>>2>>>0]},this.rc=function(){i()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(i(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(i(),this.Sb>>2,1)},this.cc=function(t){o()[this.Sb+16>>2>>>0]=t},this.tc=function(){return o()[this.Sb+16>>2>>>0]},this.vc=function(){if(De(this.bc()))return o()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Ot(t){return ge(new St(t).Sb)}function At(t,e,n,r){return x?qt(3,1,t,e,n,r):Et(t,e,n,r)}function Et(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return P("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var i=[];return x&&0===i.length?At(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:i},x?(t.Oc="spawnThread",postMessage(t,i),0):lt(t))}function It(t,e,n){return x?qt(4,1,t,e,n):0}function Pt(t,e){if(x)return qt(5,1,t,e)}function Dt(t,e){if(x)return qt(6,1,t,e)}function $t(t,e,n){if(x)return qt(7,1,t,e,n)}function kt(t,e,n){return x?qt(8,1,t,e,n):0}function Ct(t,e){if(x)return qt(9,1,t,e)}function Ft(t,e,n){if(x)return qt(10,1,t,e,n)}function Nt(t,e,n,r){if(x)return qt(11,1,t,e,n,r)}function Lt(t,e,n,r){if(x)return qt(12,1,t,e,n,r)}function Rt(t,e,n,r){if(x)return qt(13,1,t,e,n,r)}function jt(t){if(x)return qt(14,1,t)}function Mt(t,e){if(x)return qt(15,1,t,e)}function Ut(t,e,n){if(x)return qt(16,1,t,e,n)}function Vt(t){Atomics.store(i(),t>>2,1),de()&&we(t),Atomics.compareExchange(i(),t>>2,1,0)}function Bt(t){return o()[t>>>2]+4294967296*i()[t+4>>>2]}function zt(t,e,n,r,i,o){return x?qt(17,1,t,e,n,r,i,o):-52}function Gt(t,e,n,r,i,o){if(x)return qt(18,1,t,e,n,r,i,o)}function Ht(t){var n=G(t)+1,r=he(n);return r&&z(t,e(),r,n),r}function Wt(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}if(x)return qt(19,1,t,e,n);var a=(new Date).getFullYear(),s=new Date(a,0,1),u=new Date(a,6,1);a=s.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(a,c);i()[t>>2>>>0]=60*l,i()[e>>2>>>0]=Number(a!=c),t=r(s),e=r(u),t=Ht(t),e=Ht(e),c>2>>>0]=t,o()[n+4>>2>>>0]=e):(o()[n>>2>>>0]=e,o()[n+4>>2>>>0]=t)}function qt(t,e){var n=arguments.length-2,r=arguments;return gt((()=>{for(var i=Ie(8*n),o=i>>3,s=0;s>>0]=u}return ve(t,n,i,e)}))}s.executeNotifiedProxyingQueue=Vt,vt=w?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:x?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Xt,Yt=[],Kt={};function Zt(){if(!Xt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Kt)void 0===Kt[t]?delete e[t]:e[t]=Kt[t];var n=[];for(t in e)n.push(t+"="+e[t]);Xt=n}return Xt}function Jt(t,n){if(x)return qt(20,1,t,n);var r=0;return Zt().forEach((function(i,a){var s=n+r;for(a=o()[t+4*a>>2>>>0]=s,s=0;s>0>>>0]=i.charCodeAt(s);e()[a>>0>>>0]=0,r+=i.length+1})),0}function Qt(t,e){if(x)return qt(21,1,t,e);var n=Zt();o()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),o()[e>>2>>>0]=r,0}function te(t){return x?qt(22,1,t):52}function ee(t,e,n,r){return x?qt(23,1,t,e,n,r):52}function ne(t,e,n,r,i){return x?qt(24,1,t,e,n,r,i):70}var re=[null,[],[]];function ie(t,e){var n=re[t];0===e||10===e?((1===t?I:P)(V(n,0)),n.length=0):n.push(e)}function oe(t,e,n,i){if(x)return qt(25,1,t,e,n,i);for(var a=0,s=0;s>2>>>0],c=o()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);a+=c}return o()[i>>2>>>0]=a,0}var ae=0;function se(t){return 0==t%4&&(0!=t%100||0==t%400)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,o){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=c(new Date(t.getFullYear(),0,4)),n=c(n),0>=u(e,t)?0>=u(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var p=i()[o+40>>2>>>0];for(var f in o={Lc:i()[o>>2>>>0],Kc:i()[o+4>>2>>>0],dc:i()[o+8>>2>>>0],jc:i()[o+12>>2>>>0],ec:i()[o+16>>2>>>0],Xb:i()[o+20>>2>>>0],Tb:i()[o+24>>2>>>0],Wb:i()[o+28>>2>>>0],Rc:i()[o+32>>2>>>0],Jc:i()[o+36>>2>>>0],Mc:p?B(p):""},r=B(r),p={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(f,"g"),p[f]);var d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(f in p={"%a":function(t){return d[t.Tb].substring(0,3)},"%A":function(t){return d[t.Tb]},"%b":function(t){return h[t.ec].substring(0,3)},"%B":function(t){return h[t.ec]},"%C":function(t){return s((t.Xb+1900)/100|0,2)},"%d":function(t){return s(t.jc,2)},"%e":function(t){return a(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return s(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return s(t.Lc,2)},"%t":function(){return"\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return s(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&se(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&se(t.Xb%400-1))&&e++}return s(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return s(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),p)r.includes(f)&&(r=r.replace(new RegExp(f,"g"),p[f](o)));return f=function(t){var e=Array(G(t)+1);return z(t,e,0,e.length),e}(r=r.replace(/\0\0/g,"%")),f.length>n?0:(function(t,n){e().set(t,n>>>0)}(f,t),f.length-1)}dt.fc();var pe=[null,pt,bt,At,It,Pt,Dt,$t,kt,Ct,Ft,Nt,Lt,Rt,jt,Mt,Ut,zt,Gt,Wt,Jt,Qt,te,ee,ne,oe],fe={b:function(t){return he(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),xt--),t.ic(!1),wt.push(t),t.sc(),t.vc()},ma:function(t){throw P("Unexpected exception thrown, this is not properly supported - aborting"),M=!0,t},x:function(){Se(0);var t=wt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&yt(e)(t.Zb),Ot(t.Zb)}Tt=0},e:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;iVt(r)));else if(x)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=dt.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Bt(t)),i()[e>>2>>>0]=t.getUTCSeconds(),i()[e+4>>2>>>0]=t.getUTCMinutes(),i()[e+8>>2>>>0]=t.getUTCHours(),i()[e+12>>2>>>0]=t.getUTCDate(),i()[e+16>>2>>>0]=t.getUTCMonth(),i()[e+20>>2>>>0]=t.getUTCFullYear()-1900,i()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,i()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Bt(t)),i()[e>>2>>>0]=t.getSeconds(),i()[e+4>>2>>>0]=t.getMinutes(),i()[e+8>>2>>>0]=t.getHours(),i()[e+12>>2>>>0]=t.getDate(),i()[e+16>>2>>>0]=t.getMonth(),i()[e+20>>2>>>0]=t.getFullYear()-1900,i()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;i()[e+28>>2>>>0]=r,i()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),i()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(i()[t+20>>2>>>0]+1900,i()[t+16>>2>>>0],i()[t+12>>2>>>0],i()[t+8>>2>>>0],i()[t+4>>2>>>0],i()[t>>2>>>0],0),n=i()[t+32>>2>>>0],r=e.getTimezoneOffset(),o=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),u=Math.min(s,a);return 0>n?i()[t+32>>2>>>0]=Number(a!=s&&u==r):0>2>>>0]=e.getDay(),n=(e.getTime()-o.getTime())/864e5|0,i()[t+28>>2>>>0]=n,i()[t>>2>>>0]=e.getSeconds(),i()[t+4>>2>>>0]=e.getMinutes(),i()[t+8>>2>>>0]=e.getHours(),i()[t+12>>2>>>0]=e.getDate(),i()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:zt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Wt(e,n,r))},y:function(){it("")},U:function(){if(!w&&!v){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";_t||(_t={}),_t[t]||(_t[t]=1,w&&(t="warning: "+t),P(t))}},ra:function(){return 4294901760},B:vt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return w?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Yt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?st[-t-1]:pe[t]).apply(null,Yt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var i=e*(1+.2/n);i=Math.min(i,t+100663296);var o=Math;i=Math.max(t,i),o=o.min.call(o,4294901760,i+(65536-i%65536)%65536);t:{try{$.grow(o-C.byteLength+65535>>>16),H($.buffer);var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Na:function(){throw"unwind"},Ga:Jt,Ha:Qt,J:ft,I:te,S:ee,ga:ne,R:oe,d:function(){return ae},na:function t(r,i){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(w)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>it("randomDevice")}());for(var o=0;o>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ae();try{return yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ae();try{return yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var i=Ae();try{return yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,i){var o=Ae();try{return yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,i,o){var a=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,i,o){var a=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,i,o,a){var s=Ae();try{return yt(t)(e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,i,o,a,s){var u=Ae();try{return yt(t)(e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Ae();try{return yt(t)(e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,i,o,a,s){var u=Ae();try{return Me(t,e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,i,o,a){var s=Ae();try{return ke(t,e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,i){var o=Ae();try{return Ue(t,e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var i=Ae();try{return Re(t,e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ae();try{return $e(t)}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ae();try{return je(t,e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ae();try{return Ce(t,e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ae();try{yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ae();try{yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ae();try{yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,i){var o=Ae();try{yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,i,o){var a=Ae();try{yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,i,o,a){var s=Ae();try{yt(t)(e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,i,o,a,s){var u=Ae();try{yt(t)(e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,i,o,a,s,u){var c=Ae();try{yt(t)(e,n,r,i,o,a,s,u)}catch(t){if(Ee(c),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,i,o,a,s,u,c,l){var p=Ae();try{yt(t)(e,n,r,i,o,a,s,u,c,l)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,i,o,a,s,u,c,l,p,f,d,h,g){var b=Ae();try{yt(t)(e,n,r,i,o,a,s,u,c,l,p,f,d,h,g)}catch(t){if(Ee(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,i,o,a,s){var u=Ae();try{Fe(t,e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Ae();try{Le(t,e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,i,o){var a=Ae();try{Ne(t,e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:$||s.wasmMemory,G:function(t){ae=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){s.asm=t.exports,dt.qc.push(s.asm.sb),q=s.asm.ub,Y.unshift(s.asm.Va),k=e,x||(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!E&&(_||v)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+tt+"'";return t.arrayBuffer()})).catch((function(){return at()}));if(p)return new Promise((function(t,e){p(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return at()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){P("failed to asynchronously prepare wasm: "+t),it(t)}))}var r={a:fe};if(x||(et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(t){return P("Module.instantiateWasm callback failed with error: "+t),!1}(E||"function"!=typeof WebAssembly.instantiateStreaming||ot()||tt.startsWith("file://")||w||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return P("wasm streaming compile failed: "+t),P("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(c)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Va).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Wa).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Xa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Ya).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Za).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm._a).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.$a).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.ab).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.bb).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.cb).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.db).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.eb).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.fb).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.gb).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.hb).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.ib).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.jb).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.kb).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.lb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.mb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.nb).apply(null,arguments)};var de=s._pthread_self=function(){return(de=s._pthread_self=s.asm.ob).apply(null,arguments)},he=s._malloc=function(){return(he=s._malloc=s.asm.pb).apply(null,arguments)},ge=s._free=function(){return(ge=s._free=s.asm.qb).apply(null,arguments)},be=s._fflush=function(){return(be=s._fflush=s.asm.rb).apply(null,arguments)};s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.sb).apply(null,arguments)};var me=s.___funcs_on_exit=function(){return(me=s.___funcs_on_exit=s.asm.tb).apply(null,arguments)},ye=s.__emscripten_thread_init=function(){return(ye=s.__emscripten_thread_init=s.asm.vb).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.wb).apply(null,arguments)};var _e,ve=s._emscripten_run_in_main_runtime_thread_js=function(){return(ve=s._emscripten_run_in_main_runtime_thread_js=s.asm.xb).apply(null,arguments)},we=s.__emscripten_proxy_execute_task_queue=function(){return(we=s.__emscripten_proxy_execute_task_queue=s.asm.yb).apply(null,arguments)},xe=s.__emscripten_thread_free_data=function(){return(xe=s.__emscripten_thread_free_data=s.asm.zb).apply(null,arguments)},Te=s.__emscripten_thread_exit=function(){return(Te=s.__emscripten_thread_exit=s.asm.Ab).apply(null,arguments)},Se=s._setThrew=function(){return(Se=s._setThrew=s.asm.Bb).apply(null,arguments)},Oe=s._emscripten_stack_set_limits=function(){return(Oe=s._emscripten_stack_set_limits=s.asm.Cb).apply(null,arguments)},Ae=s.stackSave=function(){return(Ae=s.stackSave=s.asm.Db).apply(null,arguments)},Ee=s.stackRestore=function(){return(Ee=s.stackRestore=s.asm.Eb).apply(null,arguments)},Ie=s.stackAlloc=function(){return(Ie=s.stackAlloc=s.asm.Fb).apply(null,arguments)},Pe=s.___cxa_can_catch=function(){return(Pe=s.___cxa_can_catch=s.asm.Gb).apply(null,arguments)},De=s.___cxa_is_pointer_type=function(){return(De=s.___cxa_is_pointer_type=s.asm.Hb).apply(null,arguments)},$e=s.dynCall_j=function(){return($e=s.dynCall_j=s.asm.Ib).apply(null,arguments)},ke=s.dynCall_iiiiij=function(){return(ke=s.dynCall_iiiiij=s.asm.Jb).apply(null,arguments)},Ce=s.dynCall_jii=function(){return(Ce=s.dynCall_jii=s.asm.Kb).apply(null,arguments)},Fe=s.dynCall_viiiiij=function(){return(Fe=s.dynCall_viiiiij=s.asm.Lb).apply(null,arguments)},Ne=s.dynCall_vjji=function(){return(Ne=s.dynCall_vjji=s.asm.Mb).apply(null,arguments)},Le=s.dynCall_viiijjjii=function(){return(Le=s.dynCall_viiijjjii=s.asm.Nb).apply(null,arguments)},Re=s.dynCall_iij=function(){return(Re=s.dynCall_iij=s.asm.Ob).apply(null,arguments)},je=s.dynCall_ji=function(){return(je=s.dynCall_ji=s.asm.Pb).apply(null,arguments)},Me=s.dynCall_iiiiiij=function(){return(Me=s.dynCall_iiiiiij=s.asm.Qb).apply(null,arguments)},Ue=s.dynCall_iiij=function(){return(Ue=s.dynCall_iiij=s.asm.Rb).apply(null,arguments)};function Ve(){function t(){if(!_e&&(_e=!0,s.calledRun=!0,!M)&&(x||ht(Y),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!x)){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var t=s.postRun.shift();Z.unshift(t)}ht(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,i;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,i=e}));var o,a,s,u,c,l,p=Object.assign({},e),f="./this.program",d=(t,e)=>{throw e},h="object"==typeof window,g="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=g?n(908).dirname(m)+"/":"//",l=()=>{c||(u=n(1384),c=n(908))},o=function(t,e){return l(),t=c.normalize(t),u.readFileSync(t,e?void 0:"utf8")},s=t=>((t=o(t,!0)).buffer||(t=new Uint8Array(t)),t),a=(t,e,n)=>{l(),t=c.normalize(t),u.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(w||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},g&&(s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),a=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var y,_=e.print||console.log.bind(console),v=e.printErr||console.warn.bind(console);Object.assign(e,p),p=null,e.thisProgram&&(f=e.thisProgram),e.quit&&(d=e.quit),e.wasmBinary&&(y=e.wasmBinary);var w=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&W("no native wasm support detected");var x,T,S,O,A,E,I=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function $(t,e){return(t>>>=0)?D(O,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-i}function C(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function F(){var t=x.buffer;T=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=A=new Int32Array(t),e.HEAPU8=O=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=E=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var N,L=[],R=[],j=[],M=[],U=0;function V(){var t=e.preRun.shift();L.unshift(t)}var B,z=0,G=null,H=null;function W(t){throw e.onAbort&&e.onAbort(t),v(t="Aborted("+t+")"),I=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),i(t),t}function q(){return B.startsWith("data:application/octet-stream;base64,")}if(B="ort-wasm.wasm",!q()){var X=B;B=e.locateFile?e.locateFile(X,m):m+X}function Y(){var t=B;try{if(t==B&&y)return new Uint8Array(y);if(s)return s(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function K(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return E[this.zb+4>>2>>>0]},this.Sb=function(t){E[this.zb+8>>2>>>0]=t},this.Wb=function(){return E[this.zb+8>>2>>>0]},this.Tb=function(){A[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){A[this.zb>>2>>>0]+=1},this.Xb=function(){var t=A[this.zb>>2>>>0];return A[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){E[this.zb+16>>2>>>0]=t},this.Ob=function(){return E[this.zb+16>>2>>>0]},this.Qb=function(){if(Et(this.Eb()))return E[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return _t(new et(t).zb)}var rt=[];function it(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=N.get(t)),e}function ot(t){var e=C(t)+1,n=yt(e);return n&&k(t,S,n,e),n}var at={};function st(){if(!ut){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var n=[];for(t in e)n.push(t+"="+e[t]);ut=n}return ut}var ut,ct=[null,[],[]];function lt(t,e){var n=ct[t];0===e||10===e?((1===t?_:v)(D(n,0)),n.length=0):n.push(e)}var pt=0;function ft(t){return 0==t%4&&(0!=t%100||0==t%400)}var dt=[31,29,31,30,31,30,31,31,30,31,30,31],ht=[31,28,31,30,31,30,31,31,30,31,30,31];function gt(t,e,n,r){function i(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=a(e,t)?0>=a(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=A[r+40>>2>>>0];for(var l in r={$b:A[r>>2>>>0],Zb:A[r+4>>2>>>0],Gb:A[r+8>>2>>>0],Kb:A[r+12>>2>>>0],Hb:A[r+16>>2>>>0],Cb:A[r+20>>2>>>0],Ab:A[r+24>>2>>>0],Bb:A[r+28>>2>>>0],bc:A[r+32>>2>>>0],Yb:A[r+36>>2>>>0],ac:c?$(c):""},n=$(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),c[l]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),f="January February March April May June July August September October November December".split(" ");for(l in c={"%a":function(t){return p[t.Ab].substring(0,3)},"%A":function(t){return p[t.Ab]},"%b":function(t){return f[t.Hb].substring(0,3)},"%B":function(t){return f[t.Hb]},"%C":function(t){return o((t.Cb+1900)/100|0,2)},"%d":function(t){return o(t.Kb,2)},"%e":function(t){return i(t.Kb,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return o(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return o(t.$b,2)},"%t":function(){return"\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return o(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&ft(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&ft(t.Cb%400-1))&&e++}return o(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return o(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),c)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),c[l](r)));return l=function(t){var e=Array(C(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\0\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return yt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),Q--),t.Jb(!1),J.push(t),t.Nb(),t.Qb()},ia:function(t){throw v("Unexpected exception thrown, this is not properly supported - aborting"),I=!0,t},w:function(){xt(0);var t=J.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&it(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return pt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return pt=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;i>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getUTCSeconds(),A[e+4>>2>>>0]=t.getUTCMinutes(),A[e+8>>2>>>0]=t.getUTCHours(),A[e+12>>2>>>0]=t.getUTCDate(),A[e+16>>2>>>0]=t.getUTCMonth(),A[e+20>>2>>>0]=t.getUTCFullYear()-1900,A[e+24>>2>>>0]=t.getUTCDay(),A[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(E[t>>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getSeconds(),A[e+4>>2>>>0]=t.getMinutes(),A[e+8>>2>>>0]=t.getHours(),A[e+12>>2>>>0]=t.getDate(),A[e+16>>2>>>0]=t.getMonth(),A[e+20>>2>>>0]=t.getFullYear()-1900,A[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);A[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,A[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),A[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(A[t+20>>2>>>0]+1900,A[t+16>>2>>>0],A[t+12>>2>>>0],A[t+8>>2>>>0],A[t+4>>2>>>0],A[t>>2>>>0],0),n=A[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=i.getTimezoneOffset(),s=Math.min(a,o);return 0>n?A[t+32>>2>>>0]=Number(o!=a&&s==r):0>2>>>0]=e.getDay(),A[t+28>>2>>>0]=(e.getTime()-i.getTime())/864e5|0,A[t>>2>>>0]=e.getSeconds(),A[t+4>>2>>>0]=e.getMinutes(),A[t+8>>2>>>0]=e.getHours(),A[t+12>>2>>>0]=e.getDate(),A[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var i=(new Date).getFullYear(),o=new Date(i,0,1),a=new Date(i,6,1);i=o.getTimezoneOffset();var s=a.getTimezoneOffset();A[t>>2>>>0]=60*Math.max(i,s),A[e>>2>>>0]=Number(i!=s),t=r(o),e=r(a),t=ot(t),e=ot(e),s>2>>>0]=t,E[n+4>>2>>>0]=e):(E[n>>2>>>0]=e,E[n+4>>2>>>0]=t)}(e,n,r))},B:function(){W("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){O.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=O.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var i=Math;r=Math.max(t,r),i=i.min.call(i,4294901760,r+(65536-r%65536)%65536);t:{try{x.grow(i-T.byteLength+65535>>>16),F();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},va:function(t,e){var n=0;return st().forEach((function(r,i){var o=e+n;for(i=E[t+4*i>>2>>>0]=o,o=0;o>0>>>0]=r.charCodeAt(o);S[i>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=st();E[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),E[e>>2>>>0]=r,0},ba:function(t){w||0>2>>>0],s=E[e+4>>2>>>0];e+=8;for(var u=0;u>>0]);i+=s}return E[r>>2>>>0]=i,0},c:function(){return pt},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>W("randomDevice")}());for(var i=0;i>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},fa:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},J:function(t){var e=Tt();try{return it(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},e:function(t,e){var n=Tt();try{return it(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},N:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},O:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},j:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},o:function(t,e,n,r){var i=Tt();try{return it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},p:function(t,e,n,r,i){var o=Tt();try{return it(t)(e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},M:function(t,e,n,r,i,o){var a=Tt();try{return it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},r:function(t,e,n,r,i,o){var a=Tt();try{return it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},v:function(t,e,n,r,i,o,a){var s=Tt();try{return it(t)(e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},K:function(t,e,n,r,i,o,a,s){var u=Tt();try{return it(t)(e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},D:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Tt();try{return it(t)(e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},X:function(t,e,n,r,i,o,a,s){var u=Tt();try{return Lt(t,e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},V:function(t,e,n,r,i,o,a){var s=Tt();try{return Pt(t,e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},U:function(t,e,n,r,i){var o=Tt();try{return Rt(t,e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},Z:function(t,e,n,r){var i=Tt();try{return Ft(t,e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},W:function(t){var e=Tt();try{return It(t)}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},Y:function(t,e){var n=Tt();try{return Nt(t,e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},T:function(t,e,n){var r=Tt();try{return Dt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},f:function(t){var e=Tt();try{it(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},q:function(t,e){var n=Tt();try{it(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},h:function(t,e,n){var r=Tt();try{it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},da:function(t,e,n,r){var i=Tt();try{it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},l:function(t,e,n,r){var i=Tt();try{it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},t:function(t,e,n,r,i){var o=Tt();try{it(t)(e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},u:function(t,e,n,r,i,o){var a=Tt();try{it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},x:function(t,e,n,r,i,o,a){var s=Tt();try{it(t)(e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},z:function(t,e,n,r,i,o,a,s){var u=Tt();try{it(t)(e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},ga:function(t,e,n,r,i,o,a,s,u){var c=Tt();try{it(t)(e,n,r,i,o,a,s,u)}catch(t){if(St(c),t!==t+0)throw t;xt(1,0)}},A:function(t,e,n,r,i,o,a,s,u,c,l){var p=Tt();try{it(t)(e,n,r,i,o,a,s,u,c,l)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},C:function(t,e,n,r,i,o,a,s,u,c,l,p,f,d,h,g){var b=Tt();try{it(t)(e,n,r,i,o,a,s,u,c,l,p,f,d,h,g)}catch(t){if(St(b),t!==t+0)throw t;xt(1,0)}},aa:function(t,e,n,r,i,o,a,s){var u=Tt();try{$t(t,e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},_:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Tt();try{Ct(t,e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},$:function(t,e,n,r,i,o){var a=Tt();try{kt(t,e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},n:function(t){return t},F:function(t){pt=t},ha:gt,y:function(t,e,n,r){return gt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,x=e.asm.Ka,F(),N=e.asm.ib,R.unshift(e.asm.La),z--,e.monitorRunDependencies&&e.monitorRunDependencies(z),0==z&&(null!==G&&(clearInterval(G),G=null),H&&(t=H,H=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!y&&(h||g)){if("function"==typeof fetch&&!B.startsWith("file://"))return fetch(B,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+B+"'";return t.arrayBuffer()})).catch((function(){return Y()}));if(a)return new Promise((function(t,e){a(B,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Y()}))}().then((function(t){return WebAssembly.instantiate(t,o)})).then((function(t){return t})).then(t,(function(t){v("failed to asynchronously prepare wasm: "+t),W(t)}))}var o={a:bt};if(z++,e.monitorRunDependencies&&e.monitorRunDependencies(z),e.instantiateWasm)try{return e.instantiateWasm(o,t)}catch(t){return v("Module.instantiateWasm callback failed with error: "+t),!1}(y||"function"!=typeof WebAssembly.instantiateStreaming||q()||B.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(B,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,o).then(n,(function(t){return v("wasm streaming compile failed: "+t),v("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(i)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,yt=e._malloc=function(){return(yt=e._malloc=e.asm.eb).apply(null,arguments)},_t=e._free=function(){return(_t=e._free=e.asm.fb).apply(null,arguments)},vt=e._fflush=function(){return(vt=e._fflush=e.asm.gb).apply(null,arguments)},wt=e.___funcs_on_exit=function(){return(wt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},xt=e._setThrew=function(){return(xt=e._setThrew=e.asm.jb).apply(null,arguments)},Tt=e.stackSave=function(){return(Tt=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Ot=e.stackAlloc=function(){return(Ot=e.stackAlloc=e.asm.mb).apply(null,arguments)},At=e.___cxa_can_catch=function(){return(At=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Et=e.___cxa_is_pointer_type=function(){return(Et=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},It=e.dynCall_j=function(){return(It=e.dynCall_j=e.asm.pb).apply(null,arguments)},Pt=e.dynCall_iiiiij=function(){return(Pt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Dt=e.dynCall_jii=function(){return(Dt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},$t=e.dynCall_viiiiij=function(){return($t=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Ct=e.dynCall_viiijjjii=function(){return(Ct=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Ft=e.dynCall_iij=function(){return(Ft=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Nt=e.dynCall_ji=function(){return(Nt=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Lt=e.dynCall_iiiiiij=function(){return(Lt=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},Rt=e.dynCall_iiij=function(){return(Rt=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function jt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!I)){if(Z(R),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();M.unshift(t)}Z(M)}}if(!(0{"use strict";t.exports=function(t,e){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i{"use strict";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t,e,n){for(var i,o=null,a=[],s=0,u=0;e>2],i=(3&c)<<4,u=1;break;case 1:a[s++]=r[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[s++]=r[i|c>>6],a[s++]=r[63&c],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(t,e,n){for(var r,o=n,s=0,u=0;u1)break;if(void 0===(c=i[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:e[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:e[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:e[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-o},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},9211:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r{"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(t,r,i){e[0]=t,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function s(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?i:o,t.writeFloatBE=r?o:i,t.readFloatLE=r?a:s,t.readFloatBE=r?s:a}():function(){function e(t,e,n,r){var i=e<0?1:0;if(i&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((i<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((i<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((i<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,n,r)}}function a(t,e,n){var r=t(e,n),i=2*(r>>31)+1,o=r>>>23&255,a=8388607&r;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=a.bind(null,i),t.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(t,r,i){e[0]=t,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function s(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?i:o,t.writeDoubleBE=r?o:i,t.readDoubleLE=r?a:s,t.readDoubleBE=r?s:a}():function(){function e(t,e,n,r,i,o){var a=r<0?1:0;if(a&&(r=-r),0===r)t(0,i,o+e),t(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))t(0,i,o+e),t(2146959360,i,o+n);else if(r>17976931348623157e292)t(0,i,o+e),t((a<<31|2146435072)>>>0,i,o+n);else{var s;if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,i,o+e),t((a<<31|s/4294967296)>>>0,i,o+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(s=r*Math.pow(2,-u))>>>0,i,o+e),t((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+n)}}}function a(t,e,n,r,i){var o=t(r,i+e),a=t(r,i+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=a.bind(null,i,0,4),t.readDoubleBE=a.bind(null,o,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:t=>{"use strict";t.exports=function(t,e,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){if(n<1||n>i)return t(n);a+n>r&&(o=t(r),a=0);var s=e.call(o,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4997:(t,e)=>{"use strict";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r191&&r<224?o[a++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(t,e,n){for(var r,i,o=n,a=0;a>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=t.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-o}},3442:(t,e)=>{"use strict";e.__esModule=!0;var n=function(){function t(e){if(!e)throw new TypeError("Invalid argument; `value` has no value.");this.value=t.EMPTY,e&&t.isGuid(e)&&(this.value=e)}return t.isGuid=function(e){var n=e.toString();return e&&(e instanceof t||t.validator.test(n))},t.create=function(){return new t([t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-"))},t.createEmpty=function(){return new t("emptyguid")},t.parse=function(e){return new t(e)},t.raw=function(){return[t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-")},t.gen=function(t){for(var e="",n=0;n{t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var i={},o={};function a(t,e){var n,r,a;return e?(a=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(o[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=i[t])?r:(n=u(t,t<0?-1:0,!1),a&&(i[t]=n),n)}function s(t,e){if(isNaN(t))return e?m:b;if(e){if(t<0)return m;if(t>=d)return x}else{if(t<=-h)return T;if(t+1>=h)return w}return t<0?s(-t,e).neg():u(t%f|0,t/f|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return b;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return l(t.substring(1),e,n).neg();for(var i=s(c(n,8)),o=b,a=0;a>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((o=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(t){return r(t)||(t=p(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(r(t)||(t=p(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(y)},S.neg=S.negate,S.add=function(t){r(t)||(t=p(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,l=0,f=0,d=0,h=0;return d+=(h+=o+(65535&t.low))>>>16,f+=(d+=i+c)>>>16,l+=(f+=n+s)>>>16,l+=e+a,u((d&=65535)<<16|(h&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},S.subtract=function(t){return r(t)||(t=p(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return b;if(r(t)||(t=p(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return b;if(this.eq(T))return t.isOdd()?T:b;if(t.eq(T))return this.isOdd()?T:b;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,a=65535&this.low,c=t.high>>>16,l=65535&t.high,f=t.low>>>16,d=65535&t.low,h=0,m=0,y=0,_=0;return y+=(_+=a*d)>>>16,m+=(y+=o*d)>>>16,y&=65535,m+=(y+=a*f)>>>16,h+=(m+=i*d)>>>16,m&=65535,h+=(m+=o*f)>>>16,m&=65535,h+=(m+=a*l)>>>16,h+=n*d+i*f+o*l+a*c,u((y&=65535)<<16|(_&=65535),(h&=65535)<<16|(m&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(r(t)||(t=p(t)),t.isZero())throw Error("division by zero");var n,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:b;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return _;o=m}else{if(this.eq(T))return t.eq(y)||t.eq(v)?T:t.eq(T)?y:(n=this.shr(1).div(t).shl(1)).eq(b)?t.isNegative()?y:v:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(T))return this.unsigned?m:b;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=b}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:c(2,a-48),f=s(n),d=f.mul(t);d.isNegative()||d.gt(i);)d=(f=s(n-=l,this.unsigned)).mul(t);f.isZero()&&(f=y),o=o.add(f),i=i.sub(d)}return o},S.div=S.divide,S.modulo=function(t){return r(t)||(t=p(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t){return r(t)||(t=p(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return r(t)||(t=p(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return r(t)||(t=p(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},1446:(t,e,n)=>{"use strict";var r,i,o,a=n(2100),s=a.Reader,u=a.Writer,c=a.util,l=a.roots.default||(a.roots.default={});l.onnx=((o={}).Version=(r={},(i=Object.create(r))[r[0]="_START_VERSION"]=0,i[r[1]="IR_VERSION_2017_10_10"]=1,i[r[2]="IR_VERSION_2017_10_30"]=2,i[r[3]="IR_VERSION_2017_11_3"]=3,i[r[4]="IR_VERSION_2019_1_22"]=4,i[r[5]="IR_VERSION"]=5,i),o.AttributeProto=function(){function t(t){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.name=t.string();break;case 21:r.refAttrName=t.string();break;case 13:r.docString=t.string();break;case 20:r.type=t.int32();break;case 2:r.f=t.float();break;case 3:r.i=t.int64();break;case 4:r.s=t.bytes();break;case 5:r.t=l.onnx.TensorProto.decode(t,t.uint32());break;case 6:r.g=l.onnx.GraphProto.decode(t,t.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.i.high>>>0).toNumber())),null!=t.s&&("string"==typeof t.s?c.base64.decode(t.s,e.s=c.newBuffer(c.base64.length(t.s)),0):t.s.length&&(e.s=t.s)),null!=t.t){if("object"!=typeof t.t)throw TypeError(".onnx.AttributeProto.t: object expected");e.t=l.onnx.TensorProto.fromObject(t.t)}if(null!=t.g){if("object"!=typeof t.g)throw TypeError(".onnx.AttributeProto.g: object expected");e.g=l.onnx.GraphProto.fromObject(t.g)}if(t.floats){if(!Array.isArray(t.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");e.floats=[];for(var n=0;n>>0,t.ints[n].high>>>0).toNumber())}if(t.strings){if(!Array.isArray(t.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(e.strings=[],n=0;n>>0,t.i.high>>>0).toNumber():t.i),null!=t.s&&t.hasOwnProperty("s")&&(n.s=e.bytes===String?c.base64.encode(t.s,0,t.s.length):e.bytes===Array?Array.prototype.slice.call(t.s):t.s),null!=t.t&&t.hasOwnProperty("t")&&(n.t=l.onnx.TensorProto.toObject(t.t,e)),null!=t.g&&t.hasOwnProperty("g")&&(n.g=l.onnx.GraphProto.toObject(t.g,e)),t.floats&&t.floats.length){n.floats=[];for(var i=0;i>>0,t.ints[i].high>>>0).toNumber():t.ints[i];if(t.strings&&t.strings.length)for(n.strings=[],i=0;i>>3){case 1:r.name=t.string();break;case 2:r.type=l.onnx.TypeProto.decode(t,t.uint32());break;case 3:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.type&&t.hasOwnProperty("type")){var e=l.onnx.TypeProto.verify(t.type);if(e)return"type."+e}return null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString)?"docString: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.ValueInfoProto)return t;var e=new l.onnx.ValueInfoProto;if(null!=t.name&&(e.name=String(t.name)),null!=t.type){if("object"!=typeof t.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");e.type=l.onnx.TypeProto.fromObject(t.type)}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name="",n.type=null,n.docString=""),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.type&&t.hasOwnProperty("type")&&(n.type=l.onnx.TypeProto.toObject(t.type,e)),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o.NodeProto=function(){function t(t){if(this.input=[],this.output=[],this.attribute=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(t.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(t.string());break;case 3:r.name=t.string();break;case 4:r.opType=t.string();break;case 7:r.domain=t.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(l.onnx.AttributeProto.decode(t,t.uint32()));break;case 6:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.input&&t.hasOwnProperty("input")){if(!Array.isArray(t.input))return"input: array expected";for(var e=0;e>>3){case 1:r.irVersion=t.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t,t.uint32()));break;case 2:r.producerName=t.string();break;case 3:r.producerVersion=t.string();break;case 4:r.domain=t.string();break;case 5:r.modelVersion=t.int64();break;case 6:r.docString=t.string();break;case 7:r.graph=l.onnx.GraphProto.decode(t,t.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.irVersion&&t.hasOwnProperty("irVersion")&&!(c.isInteger(t.irVersion)||t.irVersion&&c.isInteger(t.irVersion.low)&&c.isInteger(t.irVersion.high)))return"irVersion: integer|Long expected";if(null!=t.opsetImport&&t.hasOwnProperty("opsetImport")){if(!Array.isArray(t.opsetImport))return"opsetImport: array expected";for(var e=0;e>>0,t.irVersion.high>>>0).toNumber())),t.opsetImport){if(!Array.isArray(t.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");e.opsetImport=[];for(var n=0;n>>0,t.modelVersion.high>>>0).toNumber())),null!=t.docString&&(e.docString=String(t.docString)),null!=t.graph){if("object"!=typeof t.graph)throw TypeError(".onnx.ModelProto.graph: object expected");e.graph=l.onnx.GraphProto.fromObject(t.graph)}if(t.metadataProps){if(!Array.isArray(t.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(e.metadataProps=[],n=0;n>>0,t.irVersion.high>>>0).toNumber():t.irVersion),null!=t.producerName&&t.hasOwnProperty("producerName")&&(n.producerName=t.producerName),null!=t.producerVersion&&t.hasOwnProperty("producerVersion")&&(n.producerVersion=t.producerVersion),null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.modelVersion&&t.hasOwnProperty("modelVersion")&&("number"==typeof t.modelVersion?n.modelVersion=e.longs===String?String(t.modelVersion):t.modelVersion:n.modelVersion=e.longs===String?c.Long.prototype.toString.call(t.modelVersion):e.longs===Number?new c.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber():t.modelVersion),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),null!=t.graph&&t.hasOwnProperty("graph")&&(n.graph=l.onnx.GraphProto.toObject(t.graph,e)),t.opsetImport&&t.opsetImport.length){n.opsetImport=[];for(var i=0;i>>3){case 1:r.key=t.string();break;case 2:r.value=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.key&&t.hasOwnProperty("key")&&!c.isString(t.key)?"key: string expected":null!=t.value&&t.hasOwnProperty("value")&&!c.isString(t.value)?"value: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.StringStringEntryProto)return t;var e=new l.onnx.StringStringEntryProto;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key="",n.value=""),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(n.value=t.value),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o.TensorAnnotation=function(){function t(t){if(this.quantParameterTensorNames=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorName=t.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorName&&t.hasOwnProperty("tensorName")&&!c.isString(t.tensorName))return"tensorName: string expected";if(null!=t.quantParameterTensorNames&&t.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(t.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var e=0;e>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(l.onnx.NodeProto.decode(t,t.uint32()));break;case 2:r.name=t.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(l.onnx.TensorProto.decode(t,t.uint32()));break;case 10:r.docString=t.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.node&&t.hasOwnProperty("node")){if(!Array.isArray(t.node))return"node: array expected";for(var e=0;e>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.dims[n].high>>>0).toNumber())}if(null!=t.dataType&&(e.dataType=0|t.dataType),null!=t.segment){if("object"!=typeof t.segment)throw TypeError(".onnx.TensorProto.segment: object expected");e.segment=l.onnx.TensorProto.Segment.fromObject(t.segment)}if(t.floatData){if(!Array.isArray(t.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(e.floatData=[],n=0;n>>0,t.int64Data[n].high>>>0).toNumber())}if(null!=t.name&&(e.name=String(t.name)),null!=t.docString&&(e.docString=String(t.docString)),null!=t.rawData&&("string"==typeof t.rawData?c.base64.decode(t.rawData,e.rawData=c.newBuffer(c.base64.length(t.rawData)),0):t.rawData.length&&(e.rawData=t.rawData)),t.externalData){if(!Array.isArray(t.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(e.externalData=[],n=0;n>>0,t.uint64Data[n].high>>>0).toNumber(!0))}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),e.defaults&&(n.dataType=0,n.segment=null,n.name="",e.bytes===String?n.rawData="":(n.rawData=[],e.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString="",n.dataLocation=e.enums===String?"DEFAULT":0),t.dims&&t.dims.length){n.dims=[];for(var r=0;r>>0,t.dims[r].high>>>0).toNumber():t.dims[r]}if(null!=t.dataType&&t.hasOwnProperty("dataType")&&(n.dataType=t.dataType),null!=t.segment&&t.hasOwnProperty("segment")&&(n.segment=l.onnx.TensorProto.Segment.toObject(t.segment,e)),t.floatData&&t.floatData.length)for(n.floatData=[],r=0;r>>0,t.int64Data[r].high>>>0).toNumber():t.int64Data[r];if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.rawData&&t.hasOwnProperty("rawData")&&(n.rawData=e.bytes===String?c.base64.encode(t.rawData,0,t.rawData.length):e.bytes===Array?Array.prototype.slice.call(t.rawData):t.rawData),t.doubleData&&t.doubleData.length)for(n.doubleData=[],r=0;r>>0,t.uint64Data[r].high>>>0).toNumber(!0):t.uint64Data[r];if(null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),t.externalData&&t.externalData.length)for(n.externalData=[],r=0;r>>3){case 1:r.begin=t.int64();break;case 2:r.end=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.begin&&t.hasOwnProperty("begin")&&!(c.isInteger(t.begin)||t.begin&&c.isInteger(t.begin.low)&&c.isInteger(t.begin.high))?"begin: integer|Long expected":null!=t.end&&t.hasOwnProperty("end")&&!(c.isInteger(t.end)||t.end&&c.isInteger(t.end.low)&&c.isInteger(t.end.high))?"end: integer|Long expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorProto.Segment)return t;var e=new l.onnx.TensorProto.Segment;return null!=t.begin&&(c.Long?(e.begin=c.Long.fromValue(t.begin)).unsigned=!1:"string"==typeof t.begin?e.begin=parseInt(t.begin,10):"number"==typeof t.begin?e.begin=t.begin:"object"==typeof t.begin&&(e.begin=new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber())),null!=t.end&&(c.Long?(e.end=c.Long.fromValue(t.end)).unsigned=!1:"string"==typeof t.end?e.end=parseInt(t.end,10):"number"==typeof t.end?e.end=t.end:"object"==typeof t.end&&(e.end=new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.begin=e.longs===String?"0":0;c.Long?(r=new c.Long(0,0,!1),n.end=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.end=e.longs===String?"0":0}return null!=t.begin&&t.hasOwnProperty("begin")&&("number"==typeof t.begin?n.begin=e.longs===String?String(t.begin):t.begin:n.begin=e.longs===String?c.Long.prototype.toString.call(t.begin):e.longs===Number?new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber():t.begin),null!=t.end&&t.hasOwnProperty("end")&&("number"==typeof t.end?n.end=e.longs===String?String(t.end):t.end:n.end=e.longs===String?c.Long.prototype.toString.call(t.end):e.longs===Number?new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber():t.end),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t.DataLocation=function(){var t={},e=Object.create(t);return e[t[0]="DEFAULT"]=0,e[t[1]="EXTERNAL"]=1,e}(),t}(),o.TensorShapeProto=function(){function t(t){if(this.dim=[],t)for(var e=Object.keys(t),n=0;n>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t,t.uint32()))):t.skipType(7&i)}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.dim&&t.hasOwnProperty("dim")){if(!Array.isArray(t.dim))return"dim: array expected";for(var e=0;e>>3){case 1:r.dimValue=t.int64();break;case 2:r.dimParam=t.string();break;case 3:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e={};if(null!=t.dimValue&&t.hasOwnProperty("dimValue")&&(e.value=1,!(c.isInteger(t.dimValue)||t.dimValue&&c.isInteger(t.dimValue.low)&&c.isInteger(t.dimValue.high))))return"dimValue: integer|Long expected";if(null!=t.dimParam&&t.hasOwnProperty("dimParam")){if(1===e.value)return"value: multiple values";if(e.value=1,!c.isString(t.dimParam))return"dimParam: string expected"}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!c.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorShapeProto.Dimension)return t;var e=new l.onnx.TensorShapeProto.Dimension;return null!=t.dimValue&&(c.Long?(e.dimValue=c.Long.fromValue(t.dimValue)).unsigned=!1:"string"==typeof t.dimValue?e.dimValue=parseInt(t.dimValue,10):"number"==typeof t.dimValue?e.dimValue=t.dimValue:"object"==typeof t.dimValue&&(e.dimValue=new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber())),null!=t.dimParam&&(e.dimParam=String(t.dimParam)),null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.dimValue&&t.hasOwnProperty("dimValue")&&("number"==typeof t.dimValue?n.dimValue=e.longs===String?String(t.dimValue):t.dimValue:n.dimValue=e.longs===String?c.Long.prototype.toString.call(t.dimValue):e.longs===Number?new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber():t.dimValue,e.oneofs&&(n.value="dimValue")),null!=t.dimParam&&t.hasOwnProperty("dimParam")&&(n.dimParam=t.dimParam,e.oneofs&&(n.value="dimParam")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),o.TypeProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorType=l.onnx.TypeProto.Tensor.decode(t,t.uint32());break;case 6:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorType&&t.hasOwnProperty("tensorType")){var e=l.onnx.TypeProto.Tensor.verify(t.tensorType);if(e)return"tensorType."+e}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!c.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto)return t;var e=new l.onnx.TypeProto;if(null!=t.tensorType){if("object"!=typeof t.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");e.tensorType=l.onnx.TypeProto.Tensor.fromObject(t.tensorType)}return null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.tensorType&&t.hasOwnProperty("tensorType")&&(n.tensorType=l.onnx.TypeProto.Tensor.toObject(t.tensorType,e),e.oneofs&&(n.value="tensorType")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.Tensor=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.elemType=t.int32();break;case 2:r.shape=l.onnx.TensorShapeProto.decode(t,t.uint32());break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.elemType&&t.hasOwnProperty("elemType")&&!c.isInteger(t.elemType))return"elemType: integer expected";if(null!=t.shape&&t.hasOwnProperty("shape")){var e=l.onnx.TensorShapeProto.verify(t.shape);if(e)return"shape."+e}return null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto.Tensor)return t;var e=new l.onnx.TypeProto.Tensor;if(null!=t.elemType&&(e.elemType=0|t.elemType),null!=t.shape){if("object"!=typeof t.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");e.shape=l.onnx.TensorShapeProto.fromObject(t.shape)}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.elemType=0,n.shape=null),null!=t.elemType&&t.hasOwnProperty("elemType")&&(n.elemType=t.elemType),null!=t.shape&&t.hasOwnProperty("shape")&&(n.shape=l.onnx.TensorShapeProto.toObject(t.shape,e)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),o.OperatorSetIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.domain=t.string();break;case 2:r.version=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.domain&&t.hasOwnProperty("domain")&&!c.isString(t.domain)?"domain: string expected":null!=t.version&&t.hasOwnProperty("version")&&!(c.isInteger(t.version)||t.version&&c.isInteger(t.version.low)&&c.isInteger(t.version.high))?"version: integer|Long expected":null},t.fromObject=function(t){if(t instanceof l.onnx.OperatorSetIdProto)return t;var e=new l.onnx.OperatorSetIdProto;return null!=t.domain&&(e.domain=String(t.domain)),null!=t.version&&(c.Long?(e.version=c.Long.fromValue(t.version)).unsigned=!1:"string"==typeof t.version?e.version=parseInt(t.version,10):"number"==typeof t.version?e.version=t.version:"object"==typeof t.version&&(e.version=new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults)if(n.domain="",c.Long){var r=new c.Long(0,0,!1);n.version=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.version=e.longs===String?"0":0;return null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.version&&t.hasOwnProperty("version")&&("number"==typeof t.version?n.version=e.longs===String?String(t.version):t.version:n.version=e.longs===String?c.Long.prototype.toString.call(t.version):e.longs===Number?new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber():t.version),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o),t.exports=l},2100:(t,e,n)=>{"use strict";t.exports=n(9482)},9482:(t,e,n)=>{"use strict";var r=e;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=i,i()},1408:(t,e,n)=>{"use strict";t.exports=u;var r,i=n(9693),o=i.LongBits,a=i.utf8;function s(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var c,l="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},p=function(){return i.Buffer?function(t){return(u.create=function(t){return i.Buffer.isBuffer(t)?new r(t):l(t)})(t)}:l};function f(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)},u.prototype.string=function(){var t=this.bytes();return a.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){r=t,u.create=p(),r._configure();var e=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return f.call(this)[e](!1)},uint64:function(){return f.call(this)[e](!0)},sint64:function(){return f.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},593:(t,e,n)=>{"use strict";t.exports=o;var r=n(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(t){r.call(this,t)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},5054:t=>{"use strict";t.exports={}},5994:(t,e,n)=>{"use strict";e.Service=n(7948)},7948:(t,e,n)=>{"use strict";t.exports=i;var r=n(9693);function i(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function t(e,n,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(t,s,e,n,i,o);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(t,n){if(t)return s.emit("error",t,e),a(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),a(t)}return s.emit("data",n,e),a(null,n)}s.end(!0)}))}catch(t){return s.emit("error",t,e),void setTimeout((function(){a(t)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(t,e,n)=>{"use strict";t.exports=i;var r=n(9693);function i(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(t){if("number"==typeof t)return i.fromNumber(t);if(r.isString(t)){if(!r.Long)return i.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new i(t.low>>>0,t.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;i.fromHash=function(t){return t===a?o:new i((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},9693:function(t,e,n){"use strict";var r=e;function i(t,e,n){for(var r=Object.keys(e),i=0;i0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=i,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(t){for(var e={},n=0;n-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n{"use strict";t.exports=p;var r,i=n(9693),o=i.LongBits,a=i.base64,s=i.utf8;function u(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function c(){}function l(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function p(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function d(t,e,n){e[n]=255&t}function h(t,e){this.len=t,this.next=void 0,this.val=e}function g(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function b(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}p.create=f(),p.alloc=function(t){return new i.Array(t)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(t,e,n){return this.tail=this.tail.next=new u(t,e,n),this.len+=e,this},h.prototype=Object.create(u.prototype),h.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},p.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new h((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},p.prototype.int32=function(t){return t<0?this._push(g,10,o.fromNumber(t)):this.uint32(t)},p.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},p.prototype.uint64=function(t){var e=o.from(t);return this._push(g,e.length(),e)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(g,e.length(),e)},p.prototype.bool=function(t){return this._push(d,1,t?1:0)},p.prototype.fixed32=function(t){return this._push(b,4,t>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(t){var e=o.from(t);return this._push(b,4,e.lo)._push(b,4,e.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(t){return this._push(i.float.writeFloatLE,4,t)},p.prototype.double=function(t){return this._push(i.float.writeDoubleLE,8,t)};var m=i.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r>>0;if(!e)return this._push(d,1,0);if(i.isString(t)){var n=p.alloc(e=a.length(t));a.decode(t,n,0),t=n}return this.uint32(e)._push(m,e,t)},p.prototype.string=function(t){var e=s.length(t);return e?this.uint32(e)._push(s.write,e,t):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},p.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},p._configure=function(t){r=t,p.create=f(),r._configure()}},3155:(t,e,n)=>{"use strict";t.exports=o;var r=n(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(){r.call(this)}function a(t,e,n){t.length<40?i.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=i.Buffer.byteLength(t);return this.uint32(e),e&&this._push(a,e,t),this},o._configure()},7714:(t,e,n)=>{"use strict";e.R=void 0;const r=n(6919),i=n(7448);e.R=new class{async init(){}async createSessionHandler(t,e){const n=new r.Session(e);return await n.loadModel(t),new i.OnnxjsSessionHandler(n)}}},4200:(t,e,n)=>{"use strict";e.c8=e.rX=void 0;const r=n(1670),i=n(5381),o=n(2157),a=n(2306);e.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const t="undefined"==typeof navigator?(0,i.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,o.initWasm)()}async createSessionHandler(t,e){const n=new a.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(t,e),Promise.resolve(n)}}},6018:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(1670),e);const o=n(1670);{const t=n(7714).R;(0,o.registerBackend)("webgl",t,-10)}{const t=n(4200).c8;(0,o.registerBackend)("cpu",t,10),(0,o.registerBackend)("wasm",t,10),(0,o.registerBackend)("xnnpack",t,9)}},246:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAttributeWithCacheKey=void 0;class n{constructor(t){Object.assign(this,t)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((t=>`${this[t]}`)).join(";")),this._cacheKey}}e.createAttributeWithCacheKey=t=>new n(t)},7778:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;const r=n(1446),i=n(9395),o=n(9162),a=n(2517);var s=i.onnxruntime.experimental.fbs;class u{constructor(t){if(this._attributes=new Map,null!=t){for(const e of t)e instanceof r.onnx.AttributeProto?this._attributes.set(e.name,[u.getValue(e),u.getType(e)]):e instanceof s.Attribute&&this._attributes.set(e.name(),[u.getValue(e),u.getType(e)]);if(this._attributes.sizeo.Tensor.fromProto(t)));if(t instanceof s.Attribute)return n.map((t=>o.Tensor.fromOrtTensor(t)))}if(e===r.onnx.AttributeProto.AttributeType.STRING&&t instanceof r.onnx.AttributeProto){const t=n;return(0,a.decodeUtf8String)(t)}return e===r.onnx.AttributeProto.AttributeType.STRINGS&&t instanceof r.onnx.AttributeProto?n.map(a.decodeUtf8String):n}static getValueNoCheck(t){return t instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(t):this.getValueNoCheckFromOrtFormat(t)}static getValueNoCheckFromOnnxFormat(t){switch(t.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return t.f;case r.onnx.AttributeProto.AttributeType.INT:return t.i;case r.onnx.AttributeProto.AttributeType.STRING:return t.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return t.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return t.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return t.floats;case r.onnx.AttributeProto.AttributeType.INTS:return t.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return t.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return t.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return t.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t.type]}`)}}static getValueNoCheckFromOrtFormat(t){switch(t.type()){case s.AttributeType.FLOAT:return t.f();case s.AttributeType.INT:return t.i();case s.AttributeType.STRING:return t.s();case s.AttributeType.TENSOR:return t.t();case s.AttributeType.GRAPH:return t.g();case s.AttributeType.FLOATS:return t.floatsArray();case s.AttributeType.INTS:{const e=[];for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveBackend=e.backend=void 0;const r=n(5038),i=new Map;async function o(t){const n=e.backend;if(void 0!==n[t]&&function(t){const e=t;return"initialize"in e&&"function"==typeof e.initialize&&"createSessionHandler"in e&&"function"==typeof e.createSessionHandler&&"dispose"in e&&"function"==typeof e.dispose}(n[t])){const e=n[t];let r=e.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return i.set(t,e),e}}e.backend={webgl:new r.WebGLBackend},e.resolveBackend=async function t(e){if(!e)return t(["webgl"]);{const t="string"==typeof e?[e]:e;for(const e of t){const t=i.get(e);if(t)return t;const n=await o(e);if(n)return n}}throw new Error("no available backend to use")}},5038:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLBackend=void 0;const r=n(1670),i=n(6231),o=n(6416),a=n(7305);e.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(t){r.env.webgl.contextId=t}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(t){r.env.webgl.matmulMaxBatchSize=t}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(t){r.env.webgl.textureCacheMode=t}get pack(){return r.env.webgl.pack}set pack(t){r.env.webgl.pack=t}get async(){return r.env.webgl.async}set async(t){r.env.webgl.async=t}initialize(){try{return this.glContext=(0,a.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),i.Logger.setWithEnv(r.env),i.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(t){return i.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${t}`),!1}}createSessionHandler(t){return new o.WebGLSessionHandler(this,t)}dispose(){this.glContext.dispose()}}},5107:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CoordsGlslLib=void 0;const r=n(2517),i=n(8520),o=n(5060),a=n(7859),s=n(9390);class u extends i.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new i.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new i.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const t=this.context.outputTextureLayout;return t.isPacked?this.getPackedOutputSamplingSnippet(t):this.getUnpackedOutputSamplingSnippet(t)}getPackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},a="getOutputCoords";switch(e.length){case 0:r[a]=this.getOutputScalarCoords();break;case 1:r[a]=this.getOutputPacked1DCoords(e,n);break;case 2:r[a]=this.getOutputPacked2DCoords(e,n);break;case 3:r[a]=this.getOutputPacked3DCoords(e,n);break;default:r[a]=this.getOutputPackedNDCoords(e,n)}const s=`\n void setOutput(vec4 val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new i.GlslLibRoutine(s),r}getUnpackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},a="getOutputCoords";switch(e.length){case 0:r[a]=this.getOutputScalarCoords();break;case 1:r[a]=this.getOutputUnpacked1DCoords(e,n);break;case 2:r[a]=this.getOutputUnpacked2DCoords(e,n);break;case 3:r[a]=this.getOutputUnpacked3DCoords(e,n);break;case 4:r[a]=this.getOutputUnpacked4DCoords(e,n);break;case 5:r[a]=this.getOutputUnpacked5DCoords(e,n);break;case 6:r[a]=this.getOutputUnpacked6DCoords(e,n);break;default:throw new Error(`Unsupported output dimensionality: ${e.length}`)}const s=`\n void setOutput(float val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new i.GlslLibRoutine(s),r}getOutputScalarCoords(){return new i.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(t,e){const n=e;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new i.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new i.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new i.GlslLibRoutine(r))}getOutputPacked2DCoords(t,e){let n="";if(r.ArrayUtil.arraysEqual(t,e))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${e[0]}, ${e[1]}));\n }\n `,new i.GlslLibRoutine(n);const o=e,a=Math.ceil(t[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${o[0]}, ${o[1]}));\n\n int index = resTexRC.y * ${o[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${a}) * 2;\n int c = 2 * (index / ${a});\n\n return ivec2(r, c);\n }\n `,new i.GlslLibRoutine(n)}getOutputPacked3DCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[2]/2),o=r*Math.ceil(t[1]/2),a=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${o};\n index -= b * ${o};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new i.GlslLibRoutine(a)}getOutputPackedNDCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[t.length-1]/2),o=r*Math.ceil(t[t.length-2]/2);let a=o,s="",u="b, r, c";for(let e=2;e=0;--e)o[e]=o[e+1]*t[e+1];const a=["r","c","d"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${s}\n return ivec3(r, c, d);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked4DCoords(t,e){let n="";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=["r","c","d","d2"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${s}\n return ivec4(r, c, d, d2);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked5DCoords(t,e){let n="";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=["r","c","d","d2","d3"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${s}\n return ivec5(r, c, d, d2, d3);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked6DCoords(t,e){let n="";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=["r","c","d","d2","d3","d4"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${s}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new i.GlslLibRoutine(n)}getCommonUtilFuncs(){const t={};let e="uvFromFlat";t[e]=new i.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),e="packedUVfrom1D",t[e]=new i.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="packedUVfrom2D",t[e]=new i.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="packedUVfrom3D",t[e]=new i.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="sampleTexture";const n=(0,o.getGlsl)(this.context.glContext.version);return t[e]=new i.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),t}getInputsSamplingSnippets(){const t={},e=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach(((n,r)=>{const i=this.context.inputTextureLayouts[r],o=(0,s.generateShaderFuncNameFromInputSamplerName)(n);i.isPacked?t[o]=this.getPackedSamplerFromInput(o,n,i):t[o]=this.getUnpackedSamplerFromInput(o,n,i);const a=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);i.unpackedShape.length<=e.unpackedShape.length&&(i.isPacked?t[a]=this.getPackedSamplerAtOutputCoords(a,i,e,n):t[a]=this.getUnpackedSamplerAtOutputCoords(a,i,e,n))})),t}getPackedSamplerAtOutputCoords(t,e,n,o){const a=e.unpackedShape,u=n.unpackedShape,c=o,l=(0,s.generateShaderFuncNameFromInputSamplerName)(c),p=a.length,f=u.length,d=r.BroadcastUtil.getBroadcastDims(a,u),h=(0,s.getCoordsDataType)(f),g=f-p;let b;const m=(0,s.getGlChannels)();b=0===p?"":f<2&&d.length>=1?"coords = 0;":d.map((t=>`coords.${m[t+g]} = 0;`)).join("\n");let y="";y=f<2&&p>0?"coords":a.map(((t,e)=>`coords.${m[e+g]}`)).join(", ");let _="return outputValue;";const v=1===r.ShapeUtil.size(a),w=1===r.ShapeUtil.size(u);if(1!==p||v||w){if(v&&!w)_=1===f?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(d.length){const t=p-2,e=p-1;d.indexOf(t)>-1&&d.indexOf(e)>-1?_="return vec4(outputValue.x);":d.indexOf(t)>-1?_="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":d.indexOf(e)>-1&&(_="return vec4(outputValue.xx, outputValue.zz);")}}else _="\n return vec4(outputValue.xy, outputValue.xy);\n ";const x=`\n vec4 ${t}() {\n ${h} coords = getOutputCoords();\n \n int lastDim = coords.${m[f-1]};\n coords.${m[f-1]} = coords.${m[f-2]};\n coords.${m[f-2]} = lastDim;\n \n ${b}\n vec4 outputValue = ${l}(${y});\n ${_}\n }\n `;return new i.GlslLibRoutine(x,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(t,e,n,o){const a=[n.width,n.height],u=[e.width,e.height],c=e.unpackedShape.length,l=n.unpackedShape.length,p=e.unpackedShape,f=n.unpackedShape,d=(0,s.generateShaderFuncNameFromInputSamplerName)(o);if(c===l&&r.ArrayUtil.arraysEqual(u,a)){const e=`\n float ${t}() {\n return sampleTexture(${o}, TexCoords);\n }\n `;return new i.GlslLibRoutine(e,["coordinates.sampleTexture"])}const h=(0,s.getCoordsDataType)(l),g=r.BroadcastUtil.getBroadcastDims(p,f),b=l-c;let m;const y=(0,s.getGlChannels)();m=0===c?"":l<2&&g.length>=1?"coords = 0;":g.map((t=>`coords.${y[t+b]} = 0;`)).join("\n");let _="";_=l<2&&c>0?"coords":e.unpackedShape.map(((t,e)=>`coords.${y[e+b]}`)).join(", ");const v=`\n float ${t}() {\n ${h} coords = getOutputCoords();\n ${m}\n return ${d}(${_});\n }\n `;return new i.GlslLibRoutine(v,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(t,e,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t,e);case 1:return this.getPackedSampler1D(t,e,n);case 2:return this.getPackedSampler2D(t,e,n);case 3:return this.getPackedSampler3D(t,e,n);default:return this.getPackedSamplerND(t,e,n)}}getUnpackedSamplerFromInput(t,e,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(t,e,n);case 1:return this.getUnpackedSampler1D(t,e,n);case 2:return this.getUnpackedSampler2D(t,e,n);case 3:return this.getUnpackedSampler3D(t,e,n);case 4:return this.getUnpackedSampler4D(t,e,n);case 5:return this.getUnpackedSampler5D(t,e,n);case 6:return this.getUnpackedSampler6D(t,e,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(t,e){const n=`\n vec4 ${t}() {\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e}, halfCR);\n }\n `;return new i.GlslLibRoutine(n)}getPackedSampler1D(t,e,n){const r=[n.width,n.height],a=[r[1],r[0]],s=(0,o.getGlsl)(this.context.glContext.version),u=`vec4 ${t}(int index) {\n vec2 uv = packedUVfrom1D(\n ${a[0]}, ${a[1]}, index);\n return ${s.texture2D}(${e}, uv);\n }`;return new i.GlslLibRoutine(u,["coordinates.packedUVfrom1D"])}getPackedSampler2D(t,e,n){const a=n.unpackedShape,s=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=s[0],l=s[1];if(null!=s&&r.ArrayUtil.arraysEqual(a,s)){const n=`vec4 ${t}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${c}.0);\n return ${u.texture2D}(${e}, uv);\n }`;return new i.GlslLibRoutine(n)}const p=s,f=Math.ceil(a[1]/2),d=`vec4 ${t}(int row, int col) {\n vec2 uv = packedUVfrom2D(${p[1]}, ${p[0]}, ${f}, row, col);\n return ${u.texture2D}(${e}, uv);\n }`;return new i.GlslLibRoutine(d,["coordinates.packedUVfrom2D"])}getPackedSampler3D(t,e,n){const r=n.unpackedShape,a=[n.width,n.height],u=[a[0],a[1]],c=(0,o.getGlsl)(this.context.glContext.version);if(1===r[0]){const o=r.slice(1),a=[1,2],u=(0,s.squeezeInputShape)(r,o),c=["b","row","col"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=u;const p=this.getPackedSamplerFromInput(t,e,l),f=`${p.routineBody}\n vec4 ${t}(int b, int row, int col) {\n return ${t}(${(0,s.getSqueezedParams)(c,a)});\n } `;return new i.GlslLibRoutine(f,p.dependencies)}const l=u[0],p=u[1],f=Math.ceil(r[2]/2),d=`vec4 ${t}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${p}, ${l}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\n return ${c.texture2D}(${e}, uv);}`;return new i.GlslLibRoutine(d,["coordinates.packedUVfrom3D"])}getPackedSamplerND(t,e,n){const r=n.unpackedShape,a=r.length,s=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=[s[0],s[1]],l=c[1],p=c[0],f=Math.ceil(r[a-1]/2);let d=f*Math.ceil(r[a-2]/2),h="int b, int row, int col",g=`b * ${d} + (row / 2) * ${f} + (col / 2)`;for(let t=2;t{const r=this.context.inputTextureLayouts[n],o=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let a=`_${e}`;t[a]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!1),[`shapeUtils.indicesToOffset${a}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),a+="_T",t[a]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!0),[`shapeUtils.indicesToOffset${a}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])})),t}getValueFromSingle(t,e,n,r,i){let a=`_${t}`;return i&&(a+="_T"),`\n float ${a}(int m[${e}]) {\n int offset = indicesToOffset${a}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords));\n return value;\n }\n `}getPackedValueFrom(t,e,n,r,i){let a=`_${t}_Pack`;return i&&(a+="_T"),`\n vec4 ${a}(int m[${e}]) {\n int offset = indicesToOffset_${t}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords);\n }\n `}}e.CoordsGlslLib=u},8520:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||(e.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",e.GlslContext=class{constructor(t,e,n,r){this.glContext=t,this.programInfo=e,this.inputTextureLayouts=n,this.outputTextureLayout=r}},e.GlslLib=class{constructor(t){this.context=t}},e.GlslLibRoutine=class{constructor(t,e){this.routineBody=t,this.dependencies=e}},e.GlslLibRoutineNode=class{constructor(t,e,n){this.name=t,this.dependencies=n||[],e&&(this.routineBody=e)}addDependency(t){t&&this.dependencies.push(t)}},e.TopologicalSortGlslRoutines=class{static returnOrderedNodes(t){if(!t||0===t.length)return[];if(1===t.length)return t;const e=new Set,n=new Set,r=new Array;return this.createOrderedNodes(t,e,n,r),r}static createOrderedNodes(t,e,n,r){for(let i=0;i0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodingGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const t=i.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${t}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const t=i.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${t}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const t=new ArrayBuffer(4),e=new Uint32Array(t),n=new Uint8Array(t);if(e[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}e.EncodingGlslLib=i},9894:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FragColorGlslLib=void 0;const r=n(8520),i=n(5060);class o extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const t=(0,i.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${t.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}e.FragColorGlslLib=o},2848:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;e.replaceInlines=function(t){const e={};let r;for(;null!==(r=n.exec(t));){const t=r[3].split(",").map((t=>{const e=t.trim().split(" ");return e&&2===e.length?{type:e[0],name:e[1]}:null})).filter((t=>null!==t));e[r[2]]={params:t,body:r[4]}}for(const n in e){const i="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),o=new RegExp(i,"gm");for(;null!==(r=o.exec(t));){const i=r[1],o=r[2],a=r[3].split(","),s=i?`${i} ${o};`:"";let u=e[n].body,c="";e[n].params.forEach(((t,e)=>{t&&(c+=`${t.type} ${t.name} = ${a[e]};\n`)})),u=`${c}\n ${u}`,u=u.replace("return",`${o} = `);const l=`\n ${s}\n {\n ${u}\n }\n `;t=t.replace(r[0],l)}}return t.replace(n,"")}},8879:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlslPreprocessor=void 0;const r=n(8520),i=n(2848),o=n(5483),a=n(5060);e.GlslPreprocessor=class{constructor(t,e,n,i){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(t,e,n,i),Object.keys(o.glslRegistry).forEach((t=>{const e=new o.glslRegistry[t](this.context);this.libs[t]=e}));const a=this.glslLibRoutineDependencyGraph;for(const t in this.libs){const e=this.libs[t].getFunctions();for(const n in e){const i=t+"."+n;let o;a[i]?(o=a[i],o.routineBody=e[n].routineBody):(o=new r.GlslLibRoutineNode(i,e[n].routineBody),a[i]=o);const s=e[n].dependencies;if(s)for(let t=0;t{const r=n.split(".")[1];-1!==t.indexOf(r)&&e.push(this.glslLibRoutineDependencyGraph[n])})),r.TopologicalSortGlslRoutines.returnOrderedNodes(e)}getUniforms(t,e){const n=[];if(t)for(const e of t)n.push(`uniform sampler2D ${e};`);if(e)for(const t of e)n.push(`uniform ${t.type} ${t.name}${t.arrayLength?`[${t.arrayLength}]`:""};`);return n.join("\n")}}},5483:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.glslRegistry=void 0;const r=n(5107),i=n(7341),o=n(9894),a=n(2655),s=n(3891);e.glslRegistry={encoding:i.EncodingGlslLib,fragcolor:o.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:a.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeUtilsGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const t=this.context.outputTextureLayout.shape.length,e={};return this.context.programInfo.inputNames.forEach(((n,i)=>{const o=this.context.inputTextureLayouts[i].unpackedShape;if(o.length<=t){const i=o.length,a=t-i,s=`bcastIndices_${n}`;let u="";for(let t=0;t{const o=this.context.inputTextureLayouts[i].shape;if(!(o.length<2||o.length>t)){const i=o.length,a=t-i,s=`bcastMatmulIndices_${n}`;let u="";for(let t=0;t{const o=this.context.inputTextureLayouts[n].shape,a=this.context.inputTextureLayouts[n].strides,s=o.length;let u=`indicesToOffset_${e}`;t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a)),u=`indicesToOffset_${e}_T`,t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a.slice().reverse()))})),t}static indexToOffsetSingle(t,e,n){let r="";for(let t=e-1;t>=0;--t)r+=`\n offset += indices[${t}] * ${n[t]};\n `;return`\n int ${t}(int indices[${e}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const t={};return this.context.programInfo.inputNames.forEach(((e,n)=>{const o=this.context.inputTextureLayouts[n].shape,a=this.context.inputTextureLayouts[n].strides,s=o.length;let u=`offsetToIndices_${e}`;t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a)),u=`offsetToIndices_${e}_T`,t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a.slice().reverse()))})),t}static offsetToIndicesSingle(t,e,n){const r=[];for(let t=0;t{const i=this.context.inputTextureLayouts[n].shape,o=i.length,a=`incrementIndices_${e}`;let s="";for(let t=0;t= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;t[a]=new r.GlslLibRoutine(u)})),t}}e.ShapeUtilsGlslLib=i},5060:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function i(t){return 1===t?n:r}e.getGlsl=i,e.getVertexShaderSource=function(t){const e=i(t);return`${e.version}\n precision highp float;\n ${e.attribute} vec3 position;\n ${e.attribute} vec2 textureCoord;\n\n ${e.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},e.getFragShaderPreamble=function(t){const e=i(t);return`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFrag} vec2 TexCoords;\n ${e.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},e.getDefaultFragShaderMain=function(t,e){return`\n void main() {\n int indices[${e}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${i(t).output} = result;\n }\n `}},3891:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VecGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const t=this.context.outputTextureLayout.shape.length,e={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const i in e){const o=`${i}Vec`;let a="";for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLInferenceHandler=void 0;const r=n(6231),i=n(9162),o=n(2517),a=n(2403),s=n(7019),u=n(8710),c=n(5611),l=n(4057),p=n(2039);e.WebGLInferenceHandler=class{constructor(t){this.session=t,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(t,e){return(0,l.calculateTextureWidthAndHeight)(this.session.layoutStrategy,t,e)}executeProgram(t,e){if(e.length{const n=e.map((t=>`${t.unpackedShape.join(",")};${t.width}x${t.height}`)).join("_");let r=t.name;return t.cacheHint&&(r+="["+t.cacheHint+"]"),r+=":"+n,r})(t,n);let i=this.session.programManager.getArtifact(r);const o=i?i.programInfo:"function"==typeof t.get?t.get():t,a=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o.output.dims,o.output.textureType),s=this.createTextureData(a,o.output.type);return i||(i=this.session.programManager.build(o,n,s),this.session.programManager.setArtifact(r,i)),this.runProgram(i,n,s),s}run(t,e){return this.executeProgram(t,e).tensor}runProgram(t,e,n){for(let n=0;nthis.readTexture(a)),(async t=>this.readTextureAsync(a)),void 0,o),texture:n});return this.setTextureData(a.tensor.dataId,a,t.isPacked),a}getTextureData(t,e=!1){return this.session.isInitializer(t)?this.session.getTextureData(t,e):e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){this.session.isInitializer(t)?this.session.setTextureData(t,e,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(t,e)}isTextureLayoutCached(t,e=!1){return!!this.getTextureData(t.dataId,e)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.unpackedTextureDataCache=new Map}readTexture(t){return t.isPacked?this.readTexture(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}async readTextureAsync(t){return t.isPacked?this.readTextureAsync(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}pack(t){return this.executeProgram((0,a.createPackProgramInfoLoader)(this,t.tensor),[t.tensor])}unpack(t){return this.executeProgram((0,c.createUnpackProgramInfoLoader)(this,t.tensor),[t.tensor])}}},1640:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.WEBGL_OP_RESOLVE_RULES=void 0;const a=n(2898),s=o(n(7839)),u=n(4196),c=n(2069),l=n(8138),p=n(9663),f=n(5193),d=n(7992),h=n(1253),g=n(4776),b=n(6572),m=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),x=n(718),T=n(2268),S=n(8117),O=n(2278),A=n(5524),E=n(5975),I=n(3933),P=n(6558),D=n(5723),$=n(3738),k=o(n(4909)),C=n(8428),F=n(9793);e.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",k.abs],["Acos","","7+",k.acos],["Add","","7+",s.add],["And","","7+",s.and],["Asin","","7+",k.asin],["Atan","","7+",k.atan],["AveragePool","","7+",v.averagePool,v.parseAveragePoolAttributes],["BatchNormalization","","7+",a.batchNormalization,a.parseBatchNormalizationAttributes],["Cast","","6+",u.cast,u.parseCastAttributes],["Ceil","","6+",k.ceil],["Clip","","6-10",k.clip,k.parseClipAttributes],["Clip","","11+",k.clipV11],["Concat","","4+",c.concat,c.parseConcatAttributes],["Conv","","1+",l.conv,l.parseConvAttributes],["ConvTranspose","","1+",p.convTranspose,p.parseConvTransposeAttributes],["Cos","","7+",k.cos],["Div","","7+",s.div],["Dropout","","7+",k.identity],["DepthToSpace","","1+",f.depthToSpace,f.parseDepthToSpaceAttributes],["Equal","","7+",s.equal],["Elu","","6+",k.elu,k.parseEluAttributes],["Exp","","6+",k.exp],["Flatten","","1+",d.flatten,d.parseFlattenAttributes],["Floor","","6+",k.floor],["FusedConv","com.microsoft","1+",l.conv,l.parseConvAttributes],["Gather","","1+",h.gather,h.parseGatherAttributes],["Gemm","","7-10",g.gemm,g.parseGemmAttributesV7],["Gemm","","11+",g.gemm,g.parseGemmAttributesV11],["GlobalAveragePool","","1+",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",v.globalMaxPool],["Greater","","7+",s.greater],["Identity","","1+",k.identity],["ImageScaler","","1+",b.imageScaler,b.parseImageScalerAttributes],["InstanceNormalization","","6+",m.instanceNormalization,m.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",k.leakyRelu,k.parseLeakyReluAttributes],["Less","","7+",s.less],["Log","","6+",k.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",v.maxPool,v.parseMaxPoolAttributes],["Mul","","7+",s.mul],["Neg","","6+",k.neg],["Not","","1+",k.not],["Or","","7+",s.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",s.pow],["PRelu","","7+",s.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",k.relu],["Reshape","","5+",x.reshape],["Resize","","10",T.resize,T.parseResizeAttributesV10],["Resize","","11+",T.resize,T.parseResizeAttributesV11],["Shape","","1+",S.shape],["Sigmoid","","6+",k.sigmoid],["Sin","","7+",k.sin],["Slice","","10+",O.sliceV10],["Slice","","1-9",O.slice,O.parseSliceAttributes],["Softmax","","1-12",A.softmax,A.parseSoftmaxAttributes],["Softmax","","13+",A.softmaxV13,A.parseSoftmaxAttributesV13],["Split","","2-12",E.split,E.parseSplitAttributes],["Sqrt","","6+",k.sqrt],["Squeeze","","1-12",I.squeeze,I.parseSqueezeAttributes],["Squeeze","","13+",I.squeezeV13],["Sub","","7+",s.sub],["Sum","","6+",P.sum],["Tan","","7+",k.tan],["Tanh","","6+",k.tanh],["Tile","","6+",D.tile],["Transpose","","1+",$.transpose,$.parseTransposeAttributes],["Upsample","","7-8",F.upsample,F.parseUpsampleAttributesV7],["Upsample","","9",F.upsample,F.parseUpsampleAttributesV9],["Unsqueeze","","1-12",C.unsqueeze,C.parseUnsqueezeAttributes],["Unsqueeze","","13+",C.unsqueezeV13],["Xor","","7+",s.xor]]},2898:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;const r=n(246),i=n(5060),o=n(2039),a={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};e.batchNormalization=(t,e,n)=>(u(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>s(t,e,n)}),e)]),e.parseBatchNormalizationAttributes=t=>{const e=t.attributes.getFloat("epsilon",1e-5),n=t.attributes.getFloat("momentum",.9),i=t.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:e,momentum:n,spatial:i})};const s=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),s=e[0].dims.length,[u,c]=t.calculateTextureWidthAndHeight(e[1].dims,o.TextureType.unpacked),l=`\n float process(int[${s}] indices) {\n vec2 position = offsetToCoords(indices[1], ${u}, ${c});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},a),{output:{dims:e[0].dims,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},u=t=>{if(!t||5!==t.length)throw new Error("BatchNormalization requires 5 inputs.");const e=t[0],n=t[1],r=t[2],i=t[3],o=t[4];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==i.dims.length||1!==o.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1]||i.dims[0]!==e.dims[1]||o.dims[0]!==e.dims[1])throw new Error("invalid input shape.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==i.type&&"float64"!==i.type||"float32"!==o.type&&"float64"!==o.type)throw new Error("invalid input tensor types.")}},7839:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;const r=n(2517),i=n(8520),o=n(5060),a=n(2039);function s(){const t="add_";return{body:`\n float ${t}(float a, float b) {\n return a + b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function u(){const t="div_";return{body:`\n float ${t}(float a, float b) {\n return a / b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function c(){const t="mul_";return{body:`\n float ${t}(float a, float b) {\n return a * b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function l(){const t="sub_";return{body:`\n float ${t}(float a, float b) {\n return a - b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function p(){const t="equal_";return{body:`\n float ${t}(float a, float b) {\n return float(a == b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:t,type:i.FunctionType.ValueBased}}function f(){const t="greater_";return{body:`\n float ${t}(float a, float b) {\n return float(a > b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function d(){const t="less_";return{body:`\n float ${t}(float a, float b) {\n return float(a < b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function h(){const t="and_";return{body:`\n float ${t}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function g(){const t="or_";return{body:`\n float ${t}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function b(){const t="xor_";return{body:`\n float ${t}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function m(){return function(t){const e=`${t}_`;return{body:`\n float ${e}(float a, float b) {\n return ${t}(a, b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return ${t}(v1, v2);\n }\n `,name:e,type:i.FunctionType.ValueBased}}("pow")}function y(){const t="prelu_";return{body:`\n float ${t}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:t,type:i.FunctionType.ValueBased}}e.glslAdd=s,e.glslDiv=u,e.glslMul=c,e.glslSub=l,e.glslEqual=p,e.glslGreater=f,e.glslLess=d,e.glslAnd=h,e.glslOr=g,e.glslXor=b,e.glslPow=m,e.glslPRelu=y;const _=(t,e,n,r=e[0].type,i)=>{const o=t.session.pack?a.TextureType.packed:a.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[o,o],cacheHint:i,get:()=>v(t,e,n,r)}},v=(t,e,n,i=e[0].type)=>{const s=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,u=!r.ShapeUtil.areEqual(e[0].dims,e[1].dims);let c=e[0].dims;const l=t.session.pack;if(u){const a=r.BroadcastUtil.calcShape(e[0].dims,e[1].dims,!1);if(!a)throw new Error("Can't perform binary op on the given tensors");c=a;const u=c.length,p=0!==e[0].dims.length?e[0].dims.length:1,f=0!==e[1].dims.length?e[1].dims.length:1,d=0!==e[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",h=0!==e[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",g=(0,o.getGlsl)(t.session.backend.glContext.version),b=l?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${g.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${u}]) {\n int aindices[${p}];\n int bindices[${f}];\n ${d}\n ${h}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:c,type:i,textureType:s},shaderSource:b,hasMain:l}}const p=(0,o.getGlsl)(t.session.backend.glContext.version),f=`\n ${n.body}\n void main() {\n vec4 v1 = ${p.texture2D}(A, TexCoords);\n vec4 v2 = ${p.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${p.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:e[0].dims,type:i,textureType:s},shaderSource:f,hasMain:!0}};e.add=(t,e)=>[t.run(_(t,e,s()),e)],e.and=(t,e)=>[t.run(_(t,e,h(),"bool"),e)],e.div=(t,e)=>[t.run(_(t,e,u()),e)],e.equal=(t,e)=>[t.run(_(t,e,p(),"bool"),e)],e.greater=(t,e)=>[t.run(_(t,e,f(),"bool"),e)],e.less=(t,e)=>[t.run(_(t,e,d(),"bool"),e)],e.mul=(t,e)=>[t.run(_(t,e,c()),e)],e.or=(t,e)=>[t.run(_(t,e,g(),"bool"),e)],e.pow=(t,e)=>[t.run(_(t,e,m()),e)],e.pRelu=(t,e)=>[t.run(_(t,e,y()),e)],e.sub=(t,e)=>[t.run(_(t,e,l()),e)],e.xor=(t,e)=>[t.run(_(t,e,b(),"bool"),e)]},4196:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseCastAttributes=e.cast=void 0;const r=n(2517);e.cast=(t,e,n)=>(i(e),[t.cast(e[0],n)]),e.parseCastAttributes=t=>r.ProtoUtil.tensorDataTypeFromProto(t.attributes.getInt("to"));const i=t=>{if(!t||1!==t.length)throw new Error("Cast requires 1 input.");if("string"===t[0].type)throw new Error("Invalid input type.")}},1163:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827);e.createPackedConcatProgramInfoLoader=(t,e,n)=>{const u=(c=e.length,l=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:c},((t,e)=>`X${e}`)),inputTypes:Array(c).fill(i.TextureType.packed),cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const c=n[0].dims.slice();if(u>=c.length||u<-1*c.length)throw new Error("axis specified for concat doesn't match input dimensionality");u<0&&(u=c.length+u);const l=c.slice(0);for(let t=1;tt.dims)),b=(0,o.getGlChannels)(p),m=new Array(g.length-1);m[0]=g[0][u];for(let t=1;t= ${m[t-1]}) {\n return getChannel(\n getX${t}(${s(b,y,e)}),\n vec2(${s(_,y,e)}));\n }`}const x=m.length,T=m[m.length-1];w+=`\n return getChannel(\n getX${x}(${s(b,y,T)}),\n vec2(${s(_,y,T)}));`;const S=(0,r.getGlsl)(t.session.backend.glContext.version),O=`\n ${h}\n float getValue(${b.map((t=>"int "+t))}) {\n ${w}\n }\n\n void main() {\n ${d} coords = getOutputCoords();\n int lastDim = coords.${b[p-1]};\n coords.${b[p-1]} = coords.${b[p-2]};\n coords.${b[p-2]} = lastDim;\n\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\n\n ${f[p-1]} = ${f[p-1]} + 1;\n if (${f[p-1]} < ${l[p-1]}) {\n result.g = getValue(${f});\n }\n\n ${f[p-2]} = ${f[p-2]} + 1;\n if (${f[p-2]} < ${l[p-2]}) {\n result.a = getValue(${f});\n }\n\n ${f[p-1]} = ${f[p-1]} - 1;\n if (${f[p-2]} < ${l[p-2]} &&\n ${f[p-1]} < ${l[p-1]}) {\n result.b = getValue(${f});\n }\n ${S.output} = result;\n }\n `;return Object.assign(Object.assign({},e),{output:{dims:l,type:n[0].type,textureType:i.TextureType.packed},shaderSource:O,hasMain:!0})})(t,u,e,n.axis)})};const s=(t,e,n)=>{const r=t.indexOf(e);return t.map(((t,e)=>e===r?`${t} - ${n}`:t)).join()}},2069:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseConcatAttributes=e.concat=void 0;const r=n(246),i=n(2039),o=n(1163);e.concat=(t,e,n)=>(p(e),t.session.pack&&e[0].dims.length>1?[t.run((0,o.createPackedConcatProgramInfoLoader)(t,e,n),e)]:[t.run(a(t,e,n),e)]);const a=(t,e,n)=>{const r=(o=e.length,a=n.cacheKey,{name:"Concat",inputNames:Array.from({length:o},((t,e)=>`X${e}`)),inputTypes:Array(o).fill(i.TextureType.unpacked),cacheHint:a});var o,a;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice();if(r>=o.length||r<-1*o.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=o.length+r);const a=o.slice(0);for(let t=1;t`int getTextureWhereDataResides(int index) {\n ${t.map(((t,e)=>`if(index<${t}) {return ${e};}\n`)).join("")}\n }`,u=t=>s(t),c=(t,e)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${e}]) {`];for(let e=0;e{const e=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis")});const p=t=>{if(!t||t.length<1)throw new Error("too few inputs");const e=t[0].type,n=t[0].dims.length;if("string"===e)throw new Error("string tensor is not supported yet");for(const r of t){if(r.type!==e)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},4770:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),i=n(5060),o=n(2039),a=n(8138),s=n(2823);e.createUnpackedGroupedConvProgramInfoLoader=(t,e,n)=>{const u=(c=e.length>2,l=n.cacheKey,{name:"GroupedConv",inputNames:c?["X","W","Bias"]:["X","W"],inputTypes:c?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const c=e.length>2?"value += getBias(output_channel);":"",l=e[0].dims.slice(),p=e[1].dims.slice(),f=p[0]/u.group;r.Logger.verbose("GroupedConv",`autpPad:${u.autoPad}, dilations:${u.dilations}, group:${u.group}, kernelShape:${u.kernelShape}, pads:${u.pads}, strides:${u.strides}`);const d=(0,a.calculateOutputShape)(l,p,u.dilations,u.pads,u.strides),h=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:g,applyActivation:b}=(0,s.getActivationSnippet)(u),m=`\n const ivec2 strides = ivec2(${u.strides[0]}, ${u.strides[1]});\n const ivec2 pads = ivec2(${u.pads[0]}, ${u.pads[1]});\n ${g}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${f};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${p[1]}; wInChannel++) {\n int input_channel = group_id * ${p[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${p[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${u.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${l[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${p[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${u.dilations[1]};\n if (xWidth < 0 || xWidth >= ${l[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${c}\n ${b}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:d,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,hasMain:!0})})(t,e,u,n)})}},1386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;const r=n(8138),i=n(8555),o=n(708);e.conv2DPackedPointwise=(t,e,n)=>{const i=e[0].dims,a=e[1].dims,s=(0,r.calculateOutputShape)(i,a,n.dilations,n.pads,n.strides),u=t.reshapePacked(e[0],[i[1],i[2]*i[3]]),c=t.reshapePacked(e[1],[a[0],a[1]]),l=e.length>2?[c,u,e[2]]:[c,u],p=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,l,n),l);return t.reshapePacked(p,s)},e.conv2DPacked=(t,e,n)=>{const a=e[0].dims,s=e[1].dims,u=(0,r.calculateOutputShape)(a,s,n.dilations,n.pads,n.strides),c=t.run((0,i.createPackedIm2ColProgramInfoLoader)(t,e[0],e[1],u,n),[e[0]]),l=t.reshapePacked(e[1],[s[0],s[1]*s[2]*s[3]]),p=3===e.length?[l,c,e[2]]:[l,c],f=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,p,n),p);return t.reshapePacked(f,u)}},9663:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseConvTransposeAttributes=e.convTranspose=void 0;const r=n(246),i=n(5060),o=n(2039),a=n(2823),s=(t,e,n,r,i,o)=>(t-1)*e+n+(r-1)*i+1-o,u=(t,e,n,r,i)=>{const o=Math.floor(t/2);"SAME_UPPER"===e?(n[r]=o,n[i]=t-o):"SAME_LOWER"===e&&(n[r]=t-o,n[i]=o)};e.convTranspose=(t,e,n)=>(f(e,n),c(t,e,n));const c=(t,e,n)=>{const r=p(n,e);return[l(t,e,r)]},l=(t,e,n)=>t.run(((t,e,n)=>{const r=(s=e.length>2,u=n.cacheKey,{name:"ConvTranspose",inputNames:s?["X","W","B"]:["X","W"],inputTypes:s?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:u});var s,u;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const s=e.length>2?"getB(output_channel)":"0.0",u=e[0].dims,c=e[1].dims,l=c[1],p=c[0]/r.group,f=[e[0].dims[0],e[1].dims[1]*r.group,...r.outputShape],d=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:h,applyActivation:g}=(0,a.getActivationSnippet)(r),b=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${h}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${l};\n int wOutChannel = output_channel - group_id * ${l};\n\n float value = ${s};\n for (int inChannelOffset = 0; inChannelOffset < ${p}; inChannelOffset++) {\n int input_channel = group_id * ${p} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${c[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${c[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${u[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${u[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${g}\n ${d.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:b,hasMain:!0})})(t,e,r,n)})})(t,e,n),e),p=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const l=t.length-2,p=0===c.length;for(let f=0;f{const e=t.attributes,n=(0,a.parseInternalActivationAttributes)(e),i=e.getString("auto_pad","NOTSET"),o=e.getInts("dilations",[1,1]),s=e.getInt("group",1),u=e.getInts("kernel_shape",[]),c=e.getInts("output_padding",[0,0]),l=e.getInts("output_shape",[]),p=e.getInts("pads",[0,0,0,0]),f=e.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:s,kernelShape:u,outputPadding:c,outputShape:l,pads:p,strides:f},n))};const f=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(t[0].dims[1]!==t[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=t[1].dims[1]*e.group;if(3===t.length&&(1!==t[2].dims.length||t[2].dims[0]!==n))throw new Error("invalid bias");const r=t[0].dims.length-2;if(e.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(e.strides.length!==r)throw new Error(`strides should be ${r}D`);if(e.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(e.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==e.outputShape.length&&e.outputShape.length!==t[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==t[0].type||"float32"!==t[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===t.length&&"float32"!==t[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseConvAttributes=e.conv=e.calculateOutputShape=void 0;const r=n(246),i=n(2517),o=n(4770),a=n(1386),s=n(9828),u=n(2823),c=n(3248),l=n(5623);e.calculateOutputShape=(t,e,n,r,i)=>{const o=t[0],a=t.slice(2),s=a.length,u=e[0],c=e.slice(2).map(((t,e)=>t+(t-1)*(n[e]-1))),l=a.map(((t,e)=>t+r[e]+r[e+s])).map(((t,e)=>Math.floor((t-c[e]+i[e])/i[e])));return[o,u].concat(...l)},e.conv=(t,e,n)=>(g(e,n),p(t,e,n));const p=(t,e,n)=>{const r=h(n,e),i=t.session.pack,s=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[t.run((0,o.createUnpackedGroupedConvProgramInfoLoader)(t,e,r),e)]:s&&i?[f(t,e,r)]:i&&4===e[0].dims.length&&1===e[0].dims[0]&&!s?[(0,a.conv2DPacked)(t,e,r)]:[d(t,e,r)]},f=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,a=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),s=t.reshapeUnpacked(n[0],[i[1],i[2]*i[3]]),u=t.reshapeUnpacked(n[1],[o[0],o[1]]),c=n.length>2?[u,s,n[2]]:[u,s],p=t.run((0,l.createMatmulProgramInfoLoader)(c,r),c);return t.reshapeUnpacked(p,a)},d=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,a=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),u=t.run((0,c.createIm2ColProgramInfoLoader)(t,n[0],n[1],a,r),[n[0]]),l=3===n.length?[u,n[1],n[2]]:[u,n[1]];return t.run((0,s.createDotProductProgramInfoLoader)(t,n,a,r),l)},h=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const e=t.attributes,n=(0,u.parseInternalActivationAttributes)(e),i=e.getString("auto_pad","NOTSET"),o=e.getInts("dilations",[1,1]),a=e.getInt("group",1),s=e.getInts("kernel_shape",[]),c=e.getInts("pads",[0,0,0,0]),l=e.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:a,kernelShape:s,pads:c,strides:l},n))};const g=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(t[0].dims[1]!==t[1].dims[1]*e.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===t.length&&(1!==t[2].dims.length||t[1].dims[0]!==t[2].dims[0]))throw new Error("invalid bias");const n=t[0].dims.length-2;if(e.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(e.strides.length!==n)throw new Error(`strides should be ${n}D`);if(e.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==t[0].type||"float32"!==t[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===t.length&&"float32"!==t[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;const r=n(3738);e.depthToSpace=(t,e,n)=>{i(e);const o=n.blocksize,a=o*o,s="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],u="DCR"===n.mode?[e[0].dims[0],o,o,e[0].dims[1]/a,e[0].dims[2],e[0].dims[3]]:[e[0].dims[0],e[0].dims[1]/a,o,o,e[0].dims[2],e[0].dims[3]],c=t.reshapeUnpacked(e[0],u),l={perm:s,cacheKey:`${s}`},[p]=(0,r.transpose)(t,[c],l),f=[e[0].dims[0],e[0].dims[1]/a,e[0].dims[2]*o,e[0].dims[3]*o];return[t.reshapeUnpacked(p,f)]},e.parseDepthToSpaceAttributes=t=>{const e=t.attributes.getInt("blocksize");if(e<1)throw new Error(`blocksize must be >= 1, but got : ${e} for DepthToSpace`);const n=t.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:e}};const i=t=>{if(1!==t.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${t.length}`);if("string"===t[0].type||4!==t[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDotProductProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(2823),s=n(3248);e.createDotProductProgramInfoLoader=(t,e,n,u)=>{const c=((t,e)=>({name:"ConvDotProduct",inputNames:t?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:t?[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.packedLastDimension],cacheKey:e.activationCacheKey}))(e.length>2,u);return Object.assign(Object.assign({},c),{get:()=>((t,e,n,u,c)=>{const l=n[0].dims,p=n[1].dims,f=[p[0],Math.ceil(l[1]*p[2]*p[3]/4)],d=(0,s.calculateIm2ColDims)(l,p,u),[h,g]=t.calculateTextureWidthAndHeight(f,o.TextureType.packedLastDimension),b=r.ShapeUtil.computeStrides(d),[m,y]=t.calculateTextureWidthAndHeight(d,o.TextureType.packedLastDimension),_=u.length,v=n.length<3?"0.0":"_B(b)",w=Math.ceil(l[1]*p[2]*p[3]/4),{activationFunction:x,applyActivation:T}=(0,a.getActivationSnippet)(c),S=(0,i.getGlsl)(t.session.backend.glContext.version),O=`\n${x}\nfloat process(int indices[${_}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${b[0]} + im2col[1] * ${b[1]} + im2col[2] * ${b[2]};\n int kernelOffset = indices[1] * ${f[1]};\n float value = ${v};\n for (int i = 0; i < ${w}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${m}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${g});\n value += dot(${S.texture2D}(Im2Col, im2colCoords), ${S.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${T}\n return value;\n}`;return Object.assign(Object.assign({},e),{output:{dims:u,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:O})})(t,c,e,n,u)})}},7992:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;const r=n(2517);e.flatten=(t,e,n)=>{i(e,n);const o=r.ShapeUtil.flattenShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.parseFlattenAttributes=t=>t.attributes.getInt("axis",1);const i=(t,e)=>{if(!t||1!==t.length)throw new Error("Flatten requires 1 input.");const n=t[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(e<-n||e>n)throw new Error("Invalid axis");if("string"===t[0].type)throw new Error("string tensor is not supported.")}},2823:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;const r=n(2517),i=n(4909);e.getActivationSnippet=function(t){let e;switch(t.activation){case"Relu":e=(0,i.glslRelu)();break;case"Sigmoid":e=(0,i.glslSigmoid)();break;case"Clip":e=(0,i.glslClip)(t.clipMin,t.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=e.name;return{activationFunction:e.body,applyActivation:`value = ${n}_(value);`}},e.parseInternalActivationAttributes=t=>{const e=t.getString("activation","");if("Clip"===e){const[n,i]=t.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:e,clipMax:i,clipMin:n,activationCacheKey:`${e}:${n},${i}`}}return{activation:e,activationCacheKey:e}}},1253:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseGatherAttributes=e.gather=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039);e.gather=(t,e,n)=>(c(e,n.axis),[t.run(u(t,e,n),e)]),e.parseGatherAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",0)});const s={name:"Gather",inputNames:["A","B"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},u=(t,e,n)=>{const r=Object.assign(Object.assign({},s),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const i=n[0].dims.slice(),s=n[1].dims.slice(),u=new Array(i.length+s.length-1);r=o.ShapeUtil.normalizeAxis(r,i.length);const c=[];for(let t=0;t{if(!t||2!==t.length)throw new Error("Gather requires 2 inputs.");const n=t[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(e<-n||e>n-1)throw new Error("Invalid axis.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invaid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invaid input type.")}},4776:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;const r=n(246),i=n(2517),o=n(2039);e.gemm=(t,e,n)=>(c(e,n),[t.run(s(e,n),e)]);const a=(t,e)=>{const n=0!==t.attributes.getInt("transA",0),i=0!==t.attributes.getInt("transB",0),o=t.attributes.getFloat("alpha",1),a=t.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:i,alpha:o,beta:a,isOptionalC:e})};e.parseGemmAttributesV7=t=>a(t,!1),e.parseGemmAttributesV11=t=>a(t,!0);const s=(t,e)=>{const n={name:"Gemm",inputNames:3===t.length?["A","B","C"]:["A","B"],inputTypes:3===t.length?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],key:e.cacheKey};return Object.assign(Object.assign({},n),{get:()=>u(n,t,e)})},u=(t,e,n)=>{const r=e[0].dims.slice(),a=e[1].dims.slice(),[s,u]=i.GemmUtil.getShapeOfGemmResult(r,n.transA,a,n.transB,3===e.length?e[2].dims:void 0),c=[s,u];if(!c)throw new Error("Can't use gemm on the given tensors");let l=r[r.length-1],p="";n.transA&&(l=r[0]),n.transA&&n.transB?p="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?p="value += _A_T(a) * _B(b);":!n.transA&&n.transB?p="value += _A(a) * _B_T(b);":n.transA||n.transB||(p="value += _A(a) * _B(b);");const f=c.length,d=`\n float process(int indices[${f}]) {\n int a[${f}];\n int b[${f}];\n ${3===e.length?`int c[${e[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===e.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${l}; ++k) {\n a[${f-1}] = k;\n b[${f-2}] = k;\n ${p}\n }\n\n value = value * alpha;\n ${3===e.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:c,type:e[0].type,textureType:o.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:d})},c=(t,e)=>{if(!t)throw new Error("Input is missing");if(e.isOptionalC&&(t.length<2||t.length>3))throw new Error("Invaid input shape.");if(!e.isOptionalC&&3!==t.length)throw new Error("Gemm requires 3 inputs");if(3===t.length&&1!==t[2].dims.length&&2!==t[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type||3===t.length&&"float32"!==t[2].type&&"float64"!==t[2].type)throw new Error("Invalid input type.");if(t[0].type!==t[1].type||3===t.length&&t[0].type!==t[2].type)throw new Error("Input types are mismatched")}},8555:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(2827);e.createPackedIm2ColProgramInfoLoader=(t,e,n,a,s)=>{const u=(c=s.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[i.TextureType.packed],cacheHint:c});var c;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,a,s,u)=>{const c=n.dims,l=a.dims,p=s.length,f=[l[1]*l[2]*l[3],s[2]*s[3]],d=l[2]*l[3],h=(0,o.unpackFromChannel)(),g=(0,r.getGlsl)(t.session.backend.glContext.version);let b="";for(let t=0;t<=1;t++)for(let e=0;e<=1;e++)b+=`\n blockIndex = rc.x + ${e};\n pos = rc.y + ${t};\n\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\n offsetY = int(blockIndex / (${s[p-1]})) * ${u.strides[0]} -\n ${u.pads[0]};\n d0 = offsetY + ${u.dilations[0]} * (imod(pos, ${d}) / ${l[2]});\n\n if(d0 < ${c[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${s[p-1]}) * ${u.strides[1]} -\n ${u.pads[1]};\n d1 = offsetX + ${u.dilations[1]} * imod(imod(pos, ${d}), ${l[2]});\n\n if(d1 < ${c[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${d}.);\n innerDims = vec2(d0, d1);\n result[${2*t+e}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const m=`\n ${h}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${b}\n ${g.output} = result;\n }\n `;return Object.assign(Object.assign({},e),{output:{dims:f,type:n.type,textureType:i.TextureType.packed},shaderSource:m,hasMain:!0})})(t,u,e,n,a,s)})}},3248:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.calculateIm2ColDims=e.createIm2ColProgramInfoLoader=void 0;const r=n(2039);e.createIm2ColProgramInfoLoader=(t,n,i,o,a)=>{const s=(u=a.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:u});var u;return Object.assign(Object.assign({},s),{get:()=>((t,n,i,o,a,s)=>{const u=i.dims,c=o.dims,l=a.length,p=(0,e.calculateIm2ColDims)(u,c,a,4),f=`\n const int XC = ${u[1]};\n const int XH = ${u[2]};\n const int XW = ${u[3]};\n const int KH = ${s.kernelShape[0]};\n const int KW = ${s.kernelShape[1]};\n const int dilationH = ${s.dilations[0]};\n const int dilationW = ${s.dilations[1]};\n const int strideH = ${s.strides[0]};\n const int strideW = ${s.strides[1]};\n const int padH = ${s.pads[0]};\n const int padW = ${s.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${l}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${u.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:p,type:i.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n,i,o,a)})},e.calculateIm2ColDims=(t,e,n,r=4)=>[n[0],n[2],n[3],Math.ceil(t[1]*e[2]*e[3]/r)]},6572:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseImageScalerAttributes=e.imageScaler=void 0;const r=n(246),i=n(2039);e.imageScaler=(t,e,n)=>(u(e),[t.run(a(t,e,n),e)]),e.parseImageScalerAttributes=t=>{const e=t.attributes.getFloat("scale"),n=t.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:e,bias:n})};const o={name:"ImageScaler",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},a=(t,e,n)=>{const r=Object.assign(Object.assign({},o),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice(),a=o.length,u=`\n ${s(r.bias.length)}\n float process(int indices[${a}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},e),{output:{dims:o,type:n[0].type,textureType:i.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:u})})(0,r,e,n)})},s=t=>{const e=[`float getBias(float bias[${t}], int channel) {`];for(let n=0;n{if(!t||1!==t.length)throw new Error("ImageScaler requires 1 input.");if(4!==t[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")}},3346:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;const r=n(5060),i=n(2039);e.instanceNormalization=(t,e,n)=>{c(e);const r=t.run(a(e[0]),e);return[t.run(u(t,e[0],n,r.dims),[e[0],r,e[1],e[2]])]},e.parseInstanceNormalizationAttributes=t=>t.attributes.getFloat("epsilon",1e-5);const o={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},a=t=>Object.assign(Object.assign({},o),{get:()=>((t,e)=>{const n=e.dims.slice(),r=n[1],o=n[2]*n[3],a=[n[0],r],s=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${o});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${o});\n\n return v;\n }`;return Object.assign(Object.assign({},t),{output:{dims:a,type:e.type,textureType:i.TextureType.packedLastDimension},shaderSource:s})})(o,t)}),s={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked,i.TextureType.unpacked]},u=(t,e,n,o)=>{const a=Object.assign(Object.assign({},s),{cacheHint:`${n}`});return Object.assign(Object.assign({},a),{get:()=>((t,e,n,o,a)=>{const s=(0,r.getGlsl)(t.session.backend.glContext.version),[u,c]=t.calculateTextureWidthAndHeight(a,i.TextureType.packedLastDimension),[l,p]=[u/4,c],f=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${l}, ${p});\n return ${s.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:o}],shaderSource:f})})(t,a,e,n,o)})},c=t=>{if(!t||3!==t.length)throw new Error("InstanceNormalization requires 3 inputs.");const e=t[0],n=t[1],r=t[2];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==t[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(9390),s=n(2823),u=n(5623);e.createPackedMatmulProgramInfoLoader=(t,e,n)=>{const c=(l=e.length>2,p=n.activationCacheKey,{name:"MatMul (packed)",inputNames:l?["A","B","Bias"]:["A","B"],inputTypes:l?[o.TextureType.packed,o.TextureType.packed,o.TextureType.packed]:[o.TextureType.packed,o.TextureType.packed],cacheHint:p});var l,p;return Object.assign(Object.assign({},c),{get:()=>((t,e,n,c)=>{const l=n.length>2,p=l?"value += getBiasForMatmul();":"",f=n[0].dims,d=n[1].dims,h=r.BroadcastUtil.calcShape(f,d,!0),g=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error("Can't use matmul on the given tensors");const b=f[f.length-1],m=Math.ceil(b/2),y=f.length,_=d.length,v=(0,i.getGlsl)(t.session.backend.glContext.version),w=(0,a.getCoordsDataType)(h.length),x=h.length,T=(0,a.getGlChannels)(),{activationFunction:S,applyActivation:O}=(0,s.getActivationSnippet)(c),A=l?`${(0,u.getBiasForMatmul)(w,T,n[2].dims,h,!0)}`:"",E=g?`${function(t,e,n,i){let o=[],a=[];const s=n[0].dims,u=n[1].dims,c=s.length,l=u.length,p=i.length,f=p-c,d=p-l;o=s.map(((t,n)=>`coords.${e[n+f]}`)),o[c-1]="i*2",o.join(", "),a=u.map(((t,n)=>`coords.${e[n+d]}`)),a[l-2]="i*2",a.join(", ");const h=r.BroadcastUtil.getBroadcastDims(s,i),g=r.BroadcastUtil.getBroadcastDims(u,i),b=h.map((t=>`coords.${e[t+f]} = 0;`)).join("\n"),m=g.map((t=>`coords.${e[t+d]} = 0;`)).join("\n"),y=`int lastDim = coords.${e[p-1]};\n coords.${e[p-1]} = coords.${e[p-2]};\n coords.${e[p-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${t} coords = getOutputCoords();\n ${y}\n ${b}\n vec4 outputValue = getA(${o});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${t} coords = getOutputCoords();\n ${y}\n ${m}\n vec4 outputValue = getB(${a});\n return outputValue;\n}`}(w,T,n,h)}`:"",I=g?"getAAtOutCoordsMatmul(i)":`getA(${function(t,e){let n="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBiasForMatmul=e.createMatmulProgramInfoLoader=e.parseMatMulAttributes=e.matMul=void 0;const r=n(2517),i=n(2039),o=n(9390),a=n(2823),s=n(708);function u(t,e){const n=(s=t.length>2,u=e.activationCacheKey,{name:"MatMul",inputNames:s?["A","B","Bias"]:["A","B"],inputTypes:s?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});var s,u;return Object.assign(Object.assign({},n),{get:()=>function(t,e,n){const s=e[0].dims,u=e[1].dims,c=r.BroadcastUtil.calcShape(s,u,!0);if(!c)throw new Error("Can't use matmul on the given tensors");const p=(0,o.getCoordsDataType)(c.length),f=(0,o.getGlChannels)(),{activationFunction:d,applyActivation:h}=(0,a.getActivationSnippet)(n),g=e.length>2,b=g?"value += getBiasForMatmul();":"",m=g?`${l(p,f,e[2].dims,c,!1)}`:"",y=c.length,_=s.length,v=u.length,w=`\n ${d}\n ${m}\n float process(int indices[${y}]) {\n int a[${_}];\n int b[${v}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${s[s.length-1]}; ++k) {\n a[${_-1}] = k;\n b[${v-2}] = k;\n value += _A(a) * _B(b);\n }\n ${b}\n ${h}\n return value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:c,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:w})}(n,t,e)})}e.matMul=(t,e,n)=>(c(e),t.session.pack?[t.run((0,s.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(u(e,n),e)]),e.parseMatMulAttributes=t=>(0,a.parseInternalActivationAttributes)(t.attributes),e.createMatmulProgramInfoLoader=u;const c=t=>{if(!t||2!==t.length)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type)throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function l(t,e,n,i,o){let a="";const s=n.length,u=i.length,c=u-s;a=u<2&&s>0?"coords":n.map(((t,n)=>`coords.${e[n+c]}`)).join(", ");const l=r.BroadcastUtil.getBroadcastDims(n,i).map((t=>`coords.${e[t+c]} = 0;`)).join("\n");let p="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(p="vec4(outputValue.x)"),o?`\nvec4 getBiasForMatmul() {\n ${t} coords = getOutputCoords();\n ${l}\n vec4 outputValue = getBias(${a});\n return ${p};\n}`:`\nfloat getBiasForMatmul() {\n ${t} coords = getOutputCoords();\n ${l}\n return getBias(coords.x);\n}`}e.getBiasForMatmul=l},2403:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:"pack",inputNames:["A"],inputTypes:[i.TextureType.unpackedReversed]};e.createPackProgramInfoLoader=(t,e)=>Object.assign(Object.assign({},s),{get:()=>((t,e)=>{const n=(0,r.getGlsl)(t.session.backend.glContext.version),u=e.dims,c=u.length,l=e.dims.length,p=(0,o.getCoordsDataType)(l),f=(0,a.getChannels)("rc",l),d=(h=l,g=f,b=u[u.length-2],m=u[u.length-1],0===h||1===h?"":`\n int r = ${g[h-2]};\n int c = ${g[h-1]};\n int rp1 = ${g[h-2]} + 1;\n int cp1 = ${g[h-1]} + 1;\n bool rEdge = rp1 >= ${m};\n bool cEdge = cp1 >= ${b};\n `);var h,g,b,m;let y;y=0===c?[1,1]:1===c?[u[0],1]:[u[l-1],u[l-2]];const _=function(t,e,n){if(0===t)return"false";if(1===t)return`rc > ${e[0]}`;let r="";for(let i=t-2;i= ${e[i-t+2]}`,i= ${t[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unpackFromChannel=e.getChannels=e.getVecChannels=void 0;const r=n(9390);function i(t,e){return(0,r.getGlChannels)(e).map((e=>`${t}.${e}`))}e.getVecChannels=i,e.getChannels=function(t,e){return 1===e?[t]:i(t,e)},e.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "}},2870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;const r=n(246),i=n(2517),o=n(5060),a=n(2039),s={name:"Pad",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};e.padV2=(t,e,n)=>(l(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>c(t,e[0],n)}),e)]),e.parsePadAttributesV2=t=>{const e=t.attributes.getString("mode","constant"),n=t.attributes.getFloat("value",0),i=t.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:e,value:n,pads:i})},e.padV11=(t,n,r)=>{p(n);const i=u(t,n,r);return(0,e.padV2)(t,[n[0]],i)},e.parsePadAttributesV11=t=>t.attributes.getString("mode","constant");const u=(t,e,n)=>{if(!t.session.isInitializer(e[1].dataId)||e.length>=3&&!t.session.isInitializer(e[2].dataId))throw new Error("dynamic pad attributes are not allowed");const i=Array.from(e[1].integerData),o=e.length>=3?e[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:i,value:o})},c=(t,e,n)=>{const r=i.ShapeUtil.padShape(e.dims.slice(),n.pads),o=r.length,s=`\n ${f(t,e,n)}\n float process(int[${o}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[a.TextureType.unpacked],output:{dims:r,type:e.type,textureType:a.TextureType.unpacked},shaderSource:s}},l=t=>{if(!t||1!==t.length)throw new Error("Pad requires 1 input");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},p=t=>{if(!t||2!==t.length&&3!==t.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==t[1].type)throw new Error("Invalid input type.");if(t.length>=3&&"string"===t[2].type)throw new Error("Invalid input type.")},f=(t,e,n)=>{const r=(0,o.getGlsl)(t.session.backend.glContext.version),[s,u]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),c=i.ShapeUtil.computeStrides(e.dims);switch(n.mode){case"constant":return d(r,e.dims,c,s,u,n.pads,n.value);case"reflect":return h(r,e.dims,c,s,u,n.pads);case"edge":return g(r,e.dims,c,s,u,n.pads);default:throw new Error("Invalid mode")}},d=(t,e,n,r,i,o,a)=>{const s=e.length;let u="";for(let t=s-1;t>=0;--t)u+=`\n k = m[${t}] - ${o[t]};\n if (k < 0) return constant;\n if (k >= ${e[t]}) return constant;\n offset += k * ${n[t]};\n `;return`\n float padA(int m[${s}]) {\n const float constant = float(${a});\n int offset = 0;\n int k = 0;\n ${u}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${t.texture2D}(A, coords));\n return value;\n }\n `},h=(t,e,n,r,i,o)=>{const a=e.length;let s="";for(let t=a-1;t>=0;--t)s+=`\n k = m[${t}] - ${o[t]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(e[t]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${e[t]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[t]};\n `;return`\n float padA(int m[${a}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${t.texture2D}(A, coords));\n return value;\n }\n `},g=(t,e,n,r,i,o)=>{const a=e.length;let s="";for(let t=a-1;t>=0;--t)s+=`\n k = m[${t}] - ${o[t]};\n if (k < 0) k = 0;\n if (k >= ${e[t]}) k = ${e[t]-1};\n offset += k * ${n[t]};\n `;return`\n float padA(int m[${a}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${t.texture2D}(A, coords));\n return value;\n }\n `}},2143:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;const r=n(246),i=n(2517),o=n(2039);e.averagePool=(t,e,n)=>{p(e);const r={name:"AveragePool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!1,n)}),e)]},e.parseAveragePoolAttributes=t=>{const e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),i=0!==t.attributes.getInt("count_include_pad",0),o=t.attributes.getInts("kernel_shape"),a=t.attributes.getInts("strides",[]),s=t.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:i,kernelShape:o,strides:a,pads:s})};const a=(t,e,n,r)=>{const[a,s]=u(t,r,n),c=i.ShapeUtil.size(a.kernelShape);let l="";a.countIncludePad?l+=`value /= float(${c});`:l+=`value /= float(${c} - pad);`;const p=`\n ${f(t[0].dims,a,"value += _X(x);",l,"0.0")}\n `;return Object.assign(Object.assign({},e),{output:{dims:s,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:p})};e.globalAveragePool=(t,e,n)=>{p(e);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!0,n)}),e)]},e.parseGlobalAveragePoolAttributes=t=>{const e=0!==t.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:e,kernelShape:[],strides:[],pads:[]})},e.maxPool=(t,e,n)=>{p(e);const r={name:"MaxPool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>s(e,r,!1,n)}),e)]},e.parseMaxPoolAttributes=t=>{const e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),i=t.attributes.getInts("kernel_shape"),o=t.attributes.getInts("strides",[]),a=t.attributes.getInts("pads",[]),s=t.attributes.getInt("storage_order",0),u=t.attributes.getInts("dilations",[]);if(0!==s)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:!1,kernelShape:i,strides:o,pads:a,storageOrder:s,dilations:u})};const s=(t,e,n,r)=>{const[i,a]=u(t,r,n),s=`\n ${f(t[0].dims,i,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},e),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:s})},u=(t,e,n)=>{const r=t[0].dims.slice(),o=Object.hasOwnProperty.call(e,"dilations"),a=e.kernelShape.slice(),s=e.strides.slice(),u=o?e.dilations.slice():[],c=e.pads.slice();i.PoolConvUtil.adjustPoolAttributes(n,r,a,s,u,c);const l=i.PoolConvUtil.computePoolOutputShape(n,r,s,u,a,c,e.autoPad),p=Object.assign({},e);return o?Object.assign(p,{kernelShape:a,strides:s,pads:c,dilations:u,cacheKey:e.cacheKey}):Object.assign(p,{kernelShape:a,strides:s,pads:c,cacheKey:e.cacheKey}),[p,l]},c={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},l={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[o.TextureType.unpacked]};e.globalMaxPool=(t,e)=>(p(e),[t.run(Object.assign(Object.assign({},l),{get:()=>s(e,l,!0,c)}),e)]);const p=t=>{if(!t||1!==t.length)throw new Error("Pool ops requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},f=(t,e,n,r,o)=>{const a=t.length;if(e.kernelShape.length<=2){const i=e.kernelShape[e.kernelShape.length-1],s=e.strides[e.strides.length-1],u=e.pads[e.pads.length/2-1],c=e.pads[e.pads.length-1],l=t[a-1];let p="",f="",d="";if(p=u+c!==0?`\n for (int i = 0; i < ${i}; i++) {\n x[${a} - 1] = indices[${a} - 1] * ${s} - ${u} + i;\n if (x[${a} - 1] < 0 || x[${a} - 1] >= ${l}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${i}; i++) {\n x[${a} - 1] = indices[${a} - 1] * ${s} - ${u} + i;\n ${n}\n }`,2===e.kernelShape.length){const n=e.kernelShape[e.kernelShape.length-2],r=e.strides[e.strides.length-2],o=e.pads[e.pads.length/2-2],s=e.pads[e.pads.length-2],u=t[a-2];f=o+s!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${a} - 2] = indices[${a} - 2] * ${r} - ${o} + j;\n if (x[${a} - 2] < 0 || x[${a} - 2] >= ${u}) {\n pad+= ${i};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${a} - 2] = indices[${a} - 2] * ${r} - ${o} + j;\n `,d="\n }\n "}return`\n float process(int indices[${a}]) {\n int x[${a}];\n copyVec(indices, x);\n\n float value = ${o};\n int pad = 0;\n ${f}\n ${p}\n ${d}\n ${r}\n return value;\n }\n `}{const s=i.ShapeUtil.size(e.kernelShape),u=i.ShapeUtil.computeStrides(e.kernelShape),c=u.length,l=e.pads.length,p=h(c),f=d(t,"inputDims"),g=d(e.pads,"pads"),b=d(u,"kernelStrides"),m=d(e.strides,"strides");let y="";return y=e.pads.reduce(((t,e)=>t+e))?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${p}\n float process(int indices[${a}]) {\n int x[${a}];\n copyVec(indices, x);\n int offset[${c}];\n int pads[${l}];\n int inputDims[${a}];\n int kernelStrides[${c}];\n int strides[${c}];\n ${g}\n ${f}\n ${m}\n ${b}\n\n float value = ${o};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${s}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${a} - ${c}; j < ${a}; j++) {\n x[j] = indices[j] * strides[j - ${a} + ${c}]\n + offset[j - ${a} + ${c}] - pads[j - 2];\n ${y}\n }\n ${r}\n\n return value;\n }\n `}},d=(t,e)=>{let n="";for(let r=0;r`\n void offsetToIndices(int offset, int[${t}] strides, out int[${t}] indices) {\n if (${t} == 0) {\n return;\n }\n for (int i = 0; i < ${t} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${t} - 1] = offset;\n }`},4939:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reduceLogSumSquare=e.reduceLogSum=e.reduceProd=e.reduceMin=e.reduceMax=e.reduceMean=e.reduceSum=e.parseReduceAttributes=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039),s=(t,e,n,r,i)=>{c(e);const o={name:r,inputNames:["A"],inputTypes:[a.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},o),{cacheHint:n.cacheKey,get:()=>u(t,e,n,r,i,o)}),e)]};e.parseReduceAttributes=t=>{const e=t.attributes.getInts("axes",[]),n=1===t.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:e,keepDims:n})};const u=(t,e,n,r,i,s)=>{const u=[],c=e[0].dims.length||1,l=[],p=o.ShapeUtil.normalizeAxes(n.axes,e[0].dims.length),f=i(e,p);let d=f[1];for(let t=0;t=0||0===p.length?(n.keepDims&&u.push(1),d=`\n for(int j${t} = 0; j${t} < ${e[0].dims[t]}; j${t}++) {\n inputIdx[${t}] = j${t};\n ${d}\n }`):(l.push(`inputIdx[${t}] = outputIdx[${u.length}];`),u.push(e[0].dims[t]));const h=`\n float process(int outputIdx[${u.length||1}]) {\n float value; // final result\n int inputIdx[${c}]; // addressing input data\n ${l.join("\n")}\n ${f[0]} // init ops for reduce max/min\n ${d}\n ${f[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},s),{output:{dims:u,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:h})},c=t=>{if(!t||1!==t.length)throw new Error("Reduce op requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.reduceSum=(t,e,n)=>s(t,e,n,"ReduceSum",(()=>["value = 0.0;","value += _A(inputIdx);",""])),e.reduceMean=(t,e,n)=>s(t,e,n,"ReduceMean",((t,e)=>{let n=1;for(let r=0;r=0||0===e.length)&&(n*=t[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]})),e.reduceMax=(t,e,n)=>s(t,e,n,"ReduceMax",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]})),e.reduceMin=(t,e,n)=>s(t,e,n,"ReduceMin",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]})),e.reduceProd=(t,e,n)=>s(t,e,n,"ReduceProd",(()=>["value = 1.0;","value *= _A(inputIdx);",""])),e.reduceLogSum=(t,e,n)=>s(t,e,n,"ReduceLogSum",(()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"])),e.reduceLogSumSquare=(t,e,n)=>s(t,e,n,"ReduceLogSumSquare",(()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""]))},7019:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isReshapeCheap=e.processDims3D=e.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(2827);e.createPackedReshape3DProgramInfoLoader=(t,e,n)=>{const s=(t=>({name:"Reshape (packed)",inputTypes:[o.TextureType.packed],inputNames:["A"],cacheHint:`${t}`}))(n);return Object.assign(Object.assign({},s),{get:()=>((t,e,n,s)=>{const u=e.dims,c=s;let l="";for(let t=0;t<4;t++){let e="";switch(t){case 0:e="outputCoords = rc;";break;case 1:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:e="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}l+=`\n ${e}\n ${t>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${t}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${t>0?"}":""}\n `}const p=(0,i.getGlsl)(t.session.backend.glContext.version),f=`\n ${function(t){const e=r.ShapeUtil.computeStrides(t),n=["b","r","c"],i="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${e.map(((t,r)=>`int ${n[r]} = ${i} / ${t}; ${r===e.length-1?`int ${n[r+1]} = ${i} - ${n[r]} * ${t}`:`index -= ${n[r]} * ${t}`};`)).join("")}\n return ivec3(b, r, c);\n }\n `}(u)}\n ${function(t){const e=r.ShapeUtil.computeStrides(t);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${e[0]} + coords.z * ${e[1]} + coords.y;\n }\n`}(c)}\n ${(0,a.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${c[2]};\n int cols = ${c[1]};\n\n ${l}\n ${p.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:c,type:e.type,textureType:o.TextureType.packed},shaderSource:f,hasMain:!0})})(t,e,s,n)})},e.processDims3D=function(t){if(0===t.length)return[1,1,1];let e=1;for(let n=0;n1?t[t.length-2]:1,t[t.length-1]]},e.isReshapeCheap=function(t,e){let n=!1;return n=0===t.length||0===e.length||(t.length<2||e.length<2?t[t.length-1]===e[e.length-1]:t[t.length-1]===e[e.length-1]&&t[t.length-2]===e[e.length-2]),n}},718:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reshape=void 0;const r=n(2517);e.reshape=(t,e)=>{const n=r.ShapeUtil.calculateReshapedDims(e[0].dims,e[1].integerData);return t.session.pack?[t.reshapePacked(e[0],n)]:[t.reshapeUnpacked(e[0],n)]}},2268:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s=n(9793),u={name:"Resize",inputNames:["A"],inputTypes:[i.TextureType.packed]};e.resize=(t,e,n)=>((0,s.validateInputs)(e,n),[t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>c(t,e,n)}),e)]),e.parseResizeAttributesV10=t=>(0,s.parseUpsampleAttributes)(t,10),e.parseResizeAttributesV11=t=>(0,s.parseUpsampleAttributes)(t,11);const c=(t,e,n)=>{const s=(0,r.getGlsl)(t.session.backend.glContext.version),[c,p]=l(e,n);if(c.every((t=>1===t))&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},u),{output:{dims:p,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${s.texture2D}(X, TexCoords);\n ${s.output} = v;\n }`});const f=p.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const d=p[f-2],h=p[f-1],g=e[0].dims;if(f!==g.length)throw new Error(`output dimension should match input ${g.length}, but got ${f}`);const b=g[f-2],m=g[f-1],y=c[f-2],_=c[f-1];let v="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${d}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${d}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${h}.0 - 1.0, ${d}.0 - 1.0, ${h}.0 - 1.0,\n ${d}.0 - 1.0);\n vec4 original = vec4(${m}.0 - 1.0, ${b}.0 - 1.0, ${m}.0 - 1.0,\n ${b}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,o.getCoordsDataType)(f),x=`\n const vec2 inputWH = vec2(${b}.0, ${m}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\n ${(0,a.unpackFromChannel)()}\n ${v}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${w} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${d-1};\n bool hasNextCol = rc.z < ${h-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${s.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},u),{output:{dims:p,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:x})},l=(t,e)=>{const n=t[0].dims;let r,i=e.scales;if(0===i.length){const o=t[e.scalesInputIdx];if(o&&0!==o.size){if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");i=p(o,e.mode,e.isResize)}else{const o=t[e.sizesInputIdx];if(!o||0===o.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(o.integerData),i=f(r,n,e.mode,e.isResize)}}else if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const o=r||n.map(((t,e)=>Math.floor(t*i[e])));return[i,o]},p=(t,e,n)=>{const r=Array.from(t.floatData);return(0,s.scalesValidation)(r,e,n),r},f=(t,e,n,r)=>{const i=e.length,o=new Array(i);for(let n=0,r=i;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shape=void 0;const r=n(9162);e.shape=(t,e)=>(i(e),[new r.Tensor([e[0].dims.length],"int32",void 0,void 0,new Int32Array(e[0].dims))]);const i=t=>{if(!t||1!==t.length)throw new Error("Shape requires 1 input.")}},2278:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sliceV10=e.parseSliceAttributes=e.slice=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039),s={name:"Slice",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};e.slice=(t,e,n)=>(c(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),e)]),e.parseSliceAttributes=t=>{const e=t.attributes.getInts("starts"),n=t.attributes.getInts("ends"),i=t.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:e,ends:n,axes:i})};const u=(t,e,n)=>{const r=0===n.axes.length?e.dims.slice(0).map(((t,e)=>e)):n.axes,i=o.ShapeUtil.normalizeAxes(r,e.dims.length),u=n.starts.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),c=n.ends.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),l=e.dims.slice(),p=[];for(let t=0;t0&&p.push(`outputIdx[${i[t]}] += ${u[t]};`);const f=`\n float process(int outputIdx[${l.length}]) {\n ${p.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},c=t=>{if(!t||1!==t.length)throw new Error("Slice requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.sliceV10=(t,e)=>{p(e);const n=l(t,e);return[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),[e[0]])]};const l=(t,e)=>{if(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)||e.length>=4&&!t.session.isInitializer(e[3].dataId)||e.length>=5&&!t.session.isInitializer(e[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(e.length>=5&&e[4].integerData.some((t=>1!==t)))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(e[1].integerData),r=Array.from(e[2].integerData),i=e.length>=4?Array.from(e[3].integerData):[];return{starts:n,ends:r,axes:i,cacheKey:`${i};${n};${r}`}},p=t=>{if(!t||t.length<3||t.length>5)throw new Error("Invalid input number.");if("int32"!==t[1].type||1!==t[1].dims.length)throw new Error("Invalid input type.");if("int32"!==t[2].type||1!==t[2].dims.length)throw new Error("Invalid input type.");if(t.length>=4&&("int32"!==t[3].type||1!==t[3].dims.length))throw new Error("Invalid input type.");if(t.length>=5&&("int32"!==t[4].type||1!==t[4].dims.length))throw new Error("Invalid input type.")}},5524:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;const r=n(246),i=n(2517),o=n(5060),a=n(2039),s=n(3738),u={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[a.TextureType.unpacked]},c={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},l={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};e.softmax=(t,e,n)=>{g(e);const r=e[0].dims.slice(),o=i.ShapeUtil.normalizeAxis(n.axis,r.length),a=i.ShapeUtil.sizeToDimension(r,o),s=i.ShapeUtil.sizeFromDimension(r,o);return p(t,e,n,a,s)},e.parseSoftmaxAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",1)}),e.parseSoftmaxAttributesV13=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",-1)}),e.softmaxV13=(t,e,n)=>{g(e);const o=e[0].dims.slice(),a=i.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,c=a!==u-1,l=[];let f,d=[],h=[];c&&(d=Array.from({length:u}).map(((t,e)=>e)),d[a]=u-1,d[u-1]=a,d.map((t=>l.push(o[t]))),f=(0,r.createAttributeWithCacheKey)({perm:d}),h=(0,s.transpose)(t,e,f));const b=c?i.ShapeUtil.sizeToDimension(l,u-1):i.ShapeUtil.sizeToDimension(o,u-1),m=c?i.ShapeUtil.sizeFromDimension(l,u-1):i.ShapeUtil.sizeFromDimension(o,u-1),y=p(t,c?h:e,n,b,m);return c?(0,s.transpose)(t,y,f):y};const p=(t,e,n,r,i)=>{const o=f(t,e[0],r,i,[r]),a=t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>o}),e),s=d(t,e[0],r,i,o.output.dims,[r]),p=t.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>s}),[e[0],a]),g=h(t,e[0],r,i,o.output.dims,s.output.dims);return[t.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>g}),[e[0],a,p])]},f=(t,e,n,r,i)=>{const[s,c]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),l=i.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==i.length)throw new Error("Dimensionality of the output should be 1");if(i[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const p=(0,o.getGlsl)(t.session.backend.glContext.version),f=`\n float process(int[${l}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s},\n ${c} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${s}, ${c})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},u),{output:{dims:i,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},d=(t,e,n,r,i,s)=>{const[u,l]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),p=s.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==s.length)throw new Error("Dimensionality of the output should be 1");if(s[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==i.length)throw new Error("Dimensionality of the intermediate results should be 1");if(i[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const f=`\n float process(int[${p}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,o.getGlsl)(t.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${u}, ${l}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:s,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},h=(t,e,n,r,i,o)=>{const[s,u]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),c=e.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==i.length||1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(i[0]!==n||o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const p=`\n float process(int[${c}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${s}, ${u});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},l),{output:{dims:e.dims,type:e.type,textureType:a.TextureType.unpacked},shaderSource:p})},g=t=>{if(!t||1!==t.length)throw new Error("Softmax requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type")}},5975:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSplitAttributes=e.split=void 0;const r=n(246),i=n(2517),o=n(2039),a={name:"Split",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};e.split=(t,e,n)=>{c(e);const r=i.ShapeUtil.normalizeAxis(n.axis,e[0].dims.length),o=s(t,e,r,n),l=[];for(let i=0;iu(t,e[0],n,r,i)}),e));return l},e.parseSplitAttributes=t=>{const e=t.attributes.getInt("axis",0),n=t.attributes.getInts("split",[]),i=t.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:e,split:n,numOutputs:i})};const s=(t,e,n,r)=>{const[,o]=i.SplitUtil.splitShape(e[0].dims,n,r.split,r.numOutputs);return o.length},u=(t,e,n,r,s)=>{const[u,c]=i.SplitUtil.splitShape(e.dims,r,n.split,n.numOutputs),l=c[s],p=u[s],f=`\n float process(int indices[${p.length}]) {\n indices[${r}] += ${l};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},a),{cacheHint:`${n.cacheKey}:${s}`,output:{dims:p,type:e.type,textureType:o.TextureType.unpacked},shaderSource:f})},c=t=>{if(!t||1!==t.length)throw new Error("Split requires one input.");if("int8"!==t[0].type&&"uint8"!==t[0].type&&"int16"!==t[0].type&&"uint16"!==t[0].type&&"int32"!==t[0].type&&"uint32"!==t[0].type&&"float32"!==t[0].type&&"float64"!==t[0].type&&"bool"!==t[0].type)throw new Error("Invalid input type.")}},3933:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSqueezeAttributes=e.squeezeV13=e.squeeze=void 0;const r=n(2517);e.squeeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.squeezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.squeezeV13=(t,n)=>(o(n),(0,e.squeeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseSqueezeAttributes=t=>t.attributes.getInts("axes");const i=t=>{if(!t||1!==t.length)throw new Error("Squeeze requires 1 input.");if("string"===t[0].type)throw new Error("invalid input tensor types.")},o=t=>{if(!t||2!==t.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==t[1].type)throw new Error("Invalid input type.")}},6558:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sum=void 0;const r=n(5060),i=n(2039);e.sum=(t,e)=>{a(e);const n={name:"Sum",inputNames:e.map(((t,e)=>`X${e}`)),inputTypes:new Array(e.length).fill(i.TextureType.unpacked)};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const o=(0,r.getGlsl)(t.session.backend.glContext.version),a=e[0].dims.slice(),s=`\n void main() {\n vec4 result = ${e.map(((t,e)=>`${o.texture2D}(X${e},TexCoords)`)).join(" + ")};\n ${o.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:a,type:e[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:s})},a=t=>{if(!t||0===t.length)throw new Error("Sum requires inputs.");const e=t[0].dims.length;for(let n=1;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tile=void 0;const r=n(782),i=n(2039);e.tile=(t,e)=>{a(e);const n={name:"Tile",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const r=e[0].dims.slice(),o=new Array(r.length),a=[];for(let t=0;t{if(!t||2!==t.length)throw new Error("Tile requires 2 input.");if(1!==t[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(t[1].dims[0]!==t[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invalid repeat type.")}},3738:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTransposeAttributes=e.transpose=void 0;const r=n(246),i=n(2517),o=n(2039),a={name:"Transpose",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};e.transpose=(t,e,n)=>(p(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>s(t,e[0],n.perm)}),e)]),e.parseTransposeAttributes=t=>(0,r.createAttributeWithCacheKey)({perm:t.attributes.getInts("perm",[])});const s=(t,e,n)=>{const r=e.dims;n=u(r,n);const i=c(r,n),s=r.length,p=`\n ${l("perm",n,s)}\n float process(int indices[${s}]) {\n int a[${s}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},a),{output:{dims:i,type:e.type,textureType:o.TextureType.unpacked},shaderSource:p})},u=(t,e)=>(e&&e.length!==t.length&&(e=[...t.keys()].reverse()),e),c=(t,e)=>(e=u(t,e),i.ShapeUtil.sortBasedOnPerm(t,e)),l=(t,e,n)=>{const r=[];r.push(`void ${t}(out int a[${n}], int src[${n}]) {`);for(let t=0;t{if(!t||1!==t.length)throw new Error("Transpose requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("input should be float tensor")}},8710:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeAsUint8=void 0;const r=n(5060),i=n(2039);e.encodeAsUint8=(t,e)=>{const n=e.shape,o=(0,r.getGlsl)(t.session.backend.glContext.version),a=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${o.texture2D}(X,TexCoords).r;\n ${o.output} = encodeAsUint8(value);\n }`,s={name:"Uint8Encode",inputTypes:[i.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:e.tensor.type,textureType:i.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return t.executeProgram(s,[e.tensor])}},4909:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tanh=e.tan=e.sqrt=e.sin=e.sigmoid=e.relu=e.not=e.neg=e.log=e.parseLeakyReluAttributes=e.leakyRelu=e.identity=e.floor=e.exp=e.parseEluAttributes=e.elu=e.cos=e.ceil=e.clipV11=e.parseClipAttributes=e.clip=e.atan=e.asin=e.acos=e.abs=e.glslTanh=e.glslTan=e.glslSqrt=e.glslSigmoid=e.glslRelu=e.glslSin=e.glslNot=e.glslNeg=e.glslLog=e.glslLeakyRelu=e.glslIdentity=e.glslClip=e.glslFloor=e.glslExp=e.glslElu=e.glslCos=e.glslCeil=e.glslAtan=e.glslAsin=e.glslAcos=e.glslAbs=void 0;const r=n(246),i=n(2517),o=n(8520),a=n(5060),s=n(2039);function u(){return P("abs")}function c(){return P("acos")}function l(){return P("asin")}function p(){return P("atan")}function f(){return P("ceil")}function d(){return P("cos")}function h(t){const e="elu";return{body:`\n const float alpha = float(${t});\n\n float ${e}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function g(){return P("exp")}function b(){return P("floor")}function m(t,e){const n="clip";return{body:`\n const float min = float(${t});\n const float max = float(${e});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:o.FunctionType.ValueBased}}function y(){const t="indentity";return{body:`\n float ${t}_(float a) {\n return a;\n }\n vec4 ${t}_(vec4 v) {\n return v;\n }\n `,name:t,type:o.FunctionType.ValueBased}}function _(t){const e="leakyRelu";return{body:`\n const float alpha = float(${t});\n\n float ${e}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function v(){return P("log")}function w(){const t="neg";return{body:`\n float ${t}_(float a) {\n return -a;\n }\n vec4 ${t}_(vec4 v) {\n return -v;\n }\n `,name:t,type:o.FunctionType.ValueBased}}function x(){const t="not";return{body:`\n float ${t}_(float a) {\n return float( ! bool(a) );\n }\n bool ${t}_(bool a) {\n return !a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${t}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:t,type:o.FunctionType.ValueBased}}function T(){return P("sin")}function S(){const t="relu";return{body:`\n float ${t}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${t}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:t,type:o.FunctionType.ValueBased}}function O(){const t="sigmoid";return{body:`\n float ${t}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${t}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:t,type:o.FunctionType.ValueBased}}function A(){return P("sqrt")}function E(){return P("tan")}function I(){const t="tanh";return{body:`\n float ${t}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${t}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:t,type:o.FunctionType.ValueBased}}function P(t){return{body:`\n float ${t}_(float a) {\n return ${t}(a);\n }\n vec4 ${t}_(vec4 v) {\n return ${t}(v);\n }\n `,name:t,type:o.FunctionType.ValueBased}}e.glslAbs=u,e.glslAcos=c,e.glslAsin=l,e.glslAtan=p,e.glslCeil=f,e.glslCos=d,e.glslElu=h,e.glslExp=g,e.glslFloor=b,e.glslClip=m,e.glslIdentity=y,e.glslLeakyRelu=_,e.glslLog=v,e.glslNeg=w,e.glslNot=x,e.glslSin=T,e.glslRelu=S,e.glslSigmoid=O,e.glslSqrt=A,e.glslTan=E,e.glslTanh=I;const D=(t,e,n,r)=>{const i=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,o={name:n.name,inputTypes:[i],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},o),{get:()=>((t,e,n,r)=>{const i=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,o=(0,a.getGlsl)(t.session.backend.glContext.version);return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${o.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${o.output} = v;\n }\n `,hasMain:!0})})(t,o,e,n)})};e.abs=(t,e)=>[t.run(D(t,e[0],u()),e)],e.acos=(t,e)=>[t.run(D(t,e[0],c()),e)],e.asin=(t,e)=>[t.run(D(t,e[0],l()),e)],e.atan=(t,e)=>[t.run(D(t,e[0],p()),e)],e.clip=(t,e,n)=>[t.run(D(t,e[0],m(n.min,n.max),n.cacheKey),e)],e.parseClipAttributes=t=>(0,r.createAttributeWithCacheKey)({min:t.attributes.getFloat("min",i.MIN_CLIP),max:t.attributes.getFloat("max",i.MAX_CLIP)}),e.clipV11=(t,n)=>{const r=$(t,n);return(0,e.clip)(t,[n[0]],r)};const $=(t,e)=>{if(e.length>=3&&(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=e.length>=3?e[1].numberData[0]:i.MIN_CLIP,o=e.length>=3?e[2].numberData[0]:i.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:o})};e.ceil=(t,e)=>[t.run(D(t,e[0],f()),e)],e.cos=(t,e)=>[t.run(D(t,e[0],d()),e)],e.elu=(t,e,n)=>[t.run(D(t,e[0],h(n.alpha),n.cacheKey),e)],e.parseEluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",1)}),e.exp=(t,e)=>[t.run(D(t,e[0],g()),e)],e.floor=(t,e)=>[t.run(D(t,e[0],b()),e)],e.identity=(t,e)=>[t.run(D(t,e[0],y()),e)],e.leakyRelu=(t,e,n)=>[t.run(D(t,e[0],_(n.alpha),n.cacheKey),e)],e.parseLeakyReluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",.01)}),e.log=(t,e)=>[t.run(D(t,e[0],v()),e)],e.neg=(t,e)=>[t.run(D(t,e[0],w()),e)],e.not=(t,e)=>[t.run(D(t,e[0],x()),e)],e.relu=(t,e)=>[t.run(D(t,e[0],S()),e)],e.sigmoid=(t,e)=>[t.run(D(t,e[0],O()),e)],e.sin=(t,e)=>[t.run(D(t,e[0],T()),e)],e.sqrt=(t,e)=>[t.run(D(t,e[0],A()),e)],e.tan=(t,e)=>[t.run(D(t,e[0],E()),e)],e.tanh=(t,e)=>[t.run(D(t,e[0],I()),e)]},5611:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createUnpackProgramInfoLoader=e.createUnpackProgramInfo=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:"unpack",inputNames:["A"],inputTypes:[i.TextureType.packed]};e.createUnpackProgramInfo=(t,e)=>{const n=e.dims.length,u=(0,a.getChannels)("rc",n),c=u.slice(-2),l=(0,o.getCoordsDataType)(n),p=(0,a.unpackFromChannel)(),f=0===e.dims.length?"":function(t,e){if(1===t)return"rc";let n="";for(let r=0;rObject.assign(Object.assign({},s),{get:()=>(0,e.createUnpackProgramInfo)(t,n)})},8428:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseUnsqueezeAttributes=e.unsqueezeV13=e.unsqueeze=void 0;const r=n(2517);e.unsqueeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.unsqueezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.unsqueezeV13=(t,n)=>(o(n),(0,e.unsqueeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseUnsqueezeAttributes=t=>t.attributes.getInts("axes");const i=t=>{if(!t||1!==t.length)throw new Error("Unsqueeze requires 1 input.");if("string"===t[0].type)throw new Error("invalid input tensor types.")},o=t=>{if(!t||2!==t.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==t[1].type)throw new Error("Invalid input type.")}},9793:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;const r=n(246),i=n(5060),o=n(2039),a={name:"Upsample",inputNames:["X"],inputTypes:[o.TextureType.unpacked]};e.upsample=(t,n,r)=>((0,e.validateInputs)(n,r),[t.run(Object.assign(Object.assign({},a),{cacheHint:r.cacheKey,get:()=>s(t,n,r)}),n)]),e.parseUpsampleAttributesV7=t=>(0,e.parseUpsampleAttributes)(t,7),e.parseUpsampleAttributesV9=t=>(0,e.parseUpsampleAttributes)(t,9),e.parseUpsampleAttributes=(t,n)=>{const i=n>=10,o=t.attributes.getString("mode","nearest");if("nearest"!==o&&"linear"!==o&&(n<11||"cubic"!==o))throw new Error(`unrecognized mode: ${o}`);let a=[];n<9&&(a=t.attributes.getFloats("scales"),(0,e.scalesValidation)(a,o,i));const s=t.attributes.getFloat("extrapolation_value",0),u=n>10?t.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(u))throw new Error(`coordinate_transform_mode '${u}' is not supported`);const c="tf_crop_and_resize"===u,l=c,p="nearest"===o&&n>=11?t.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(p))throw new Error(`nearest_mode '${p}' is not supported`);const f=t.attributes.getFloat("cubic_coeff_a",-.75),d=0!==t.attributes.getInt("exclude_outside",0);if(d&&"cubic"!==o)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const h=n<11||"nearest"===o&&"asymmetric"===u&&"floor"===p;let g=0,b=0,m=0;return n>10?t.inputs.length>2?(g=1,b=2,m=3):(b=1,m=2):9===n&&(b=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:i,mode:o,scales:a,extrapolationValue:s,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:p,cubicCoefficientA:f,excludeOutside:d,useNearest2xOptimization:h,roiInputIdx:g,scalesInputIdx:b,sizesInputIdx:m})};const s=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),[s,u]=t.calculateTextureWidthAndHeight(e[0].dims,o.TextureType.unpacked),c=e[0].dims.map(((t,e)=>Math.floor(t*n.scales[e]))),[l,p]=t.calculateTextureWidthAndHeight(c,o.TextureType.unpacked),f=c.length,d=new Array(f),h=new Array(f);let g=`\n int output_pitches[${f}];\n int input_pitches[${f}];\n `;for(let t=f-1;t>=0;t--)d[t]=t===f-1?1:d[t+1]*c[t+1],h[t]=t===f-1?1:h[t+1]*e[0].dims[t+1],g+=`\n output_pitches[${t}] = ${d[t]};\n input_pitches[${t}] = ${h[t]};\n `;const b=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${s}, ${u});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,m="nearest"===n.mode?`\n ${b}\n float process(int indices[${f}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\n\n ${g}\n\n int d, m;\n for (int dim = 0; dim < ${f}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===f?`\n ${b}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${e[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${b}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${e[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},a),{output:{dims:c,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map((t=>Math.ceil(t)))}]})};e.validateInputs=(t,e)=>{if(!t||e.opset<9&&1!==t.length||e.opset>=9&&e.opset<11&&2!==t.length||e.opset>=11&&t.length<2)throw new Error("invalid inputs.");if(e.scales.length>0&&t[0].dims.length!==e.scales.length)throw new Error("Invalid input shape.");if("string"===t[0].type)throw new Error("Invalid input tensor types.")},e.scalesValidation=(t,e,n)=>{if(n){for(const e of t)if(e<=0)throw new Error("Scale value should be greater than 0.")}else for(const e of t)if(e<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==e&&"cubic"!==e||2===t.length||4===t.length&&1===t[0]&&1===t[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},1958:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProgramManager=void 0;const r=n(1670),i=n(6231),o=n(8879),a=n(5060);e.ProgramManager=class{constructor(t,e,n){this.profiler=t,this.glContext=e,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(t){return this.repo.get(t)}setArtifact(t,e){this.repo.set(t,e)}run(t,e,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=t.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,(()=>{var r;const o=this.glContext.gl,a=t.program;o.useProgram(a);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(t.attribLocations),this.bindUniforms(t.uniformLocations,null!==(r=t.programInfo.variables)&&void 0!==r?r:[],e)}catch(e){throw i.Logger.error("ProgramManager",t.programInfo.shaderSource),e}this.profiler.event("backend","GlContext.draw()",(()=>{this.glContext.draw()}))}),this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((t=>this.glContext.deleteProgram(t.program)))}build(t,e,n){return this.profiler.event("backend","ProgramManager.build",(()=>{const r=new o.GlslPreprocessor(this.glContext,t,e,n),i=r.preprocess(),a=this.compile(i);return{programInfo:t,program:a,uniformLocations:this.getUniformLocations(a,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(a)}}))}compile(t){if(!this.vertexShader){i.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const t=(0,a.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(t,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&i.Logger.verbose("ProrgramManager",`FragShader:\n${t}\n`);const e=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,e);return this.glContext.deleteShader(e),n}bindOutput(t){const e=t.width,n=t.height;i.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${e}/${n}, shape=${t.shape}, type=${t.tensor.type}`),this.glContext.attachFramebuffer(t.texture,e,n)}bindAttributes(t){const e=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(e,n),this.attributesBound=!0}bindUniforms(t,e,n){var r;const i=this.glContext.gl;let o=0;for(const{name:a,type:s,location:u,arrayLength:c}of t){const t=null===(r=e.find((t=>t.name===a)))||void 0===r?void 0:r.data;if("sampler2D"!==s&&!t)throw new Error(`variable '${a}' does not have data defined in program info`);switch(s){case"sampler2D":this.bindTexture(n[o],u,o),o++;break;case"float":c?i.uniform1fv(u,t):i.uniform1f(u,t);break;case"int":c?i.uniform1iv(u,t):i.uniform1i(u,t);break;default:throw new Error(`Uniform not implemented: ${s}`)}}}bindTexture(t,e,n){this.glContext.bindTextureToUniform(t.texture,n,e)}getAttribLocations(t){return{position:this.getAttribLocation(t,"position"),textureCoord:this.getAttribLocation(t,"textureCoord")}}getUniformLocations(t,e,n){const r=[];if(e)for(const n of e)r.push({name:n,type:"sampler2D",location:this.getUniformLocation(t,n)});if(n)for(const e of n)r.push(Object.assign(Object.assign({},e),{location:this.getUniformLocation(t,e.name)}));return r}getUniformLocation(t,e){const n=this.glContext.gl.getUniformLocation(t,e);if(null===n)throw new Error(`Uniform ${e} not found.`);return n}getAttribLocation(t,e){return this.glContext.gl.getAttribLocation(t,e)}}},6416:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLSessionHandler=void 0;const r=n(6231),i=n(1047),o=n(8316),a=n(1640),s=n(1958),u=n(7859),c=n(5702);e.WebGLSessionHandler=class{constructor(t,e){this.backend=t,this.context=e,this.layoutStrategy=new u.PreferLogicalStrategy(t.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===t.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new o.WebGLInferenceHandler(this)}onGraphInitialized(t){const e=t.getValues().filter((t=>-1===t.from&&t.tensor)).map((t=>t.tensor.dataId));this.initializers=new Set(e)}isInitializer(t){return!!this.initializers&&this.initializers.has(t)}addInitializer(t){this.initializers.add(t)}getTextureData(t,e){return e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(t,e):this.unpackedTextureDataCache.set(t,e)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.unpackedTextureDataCache=new Map}resolve(t,e,n){const r=(0,i.resolveOperator)(t,e,a.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(t,n):t}}}},7769:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;const r=n(6231);e.RedFloat32DataEncoder=class{constructor(t,e=1){if(1===e)this.internalFormat=t.R32F,this.format=t.RED,this.textureType=t.FLOAT,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA32F,this.format=t.RGBA,this.textureType=t.FLOAT,this.channelSize=e}}encode(t,e){let n,i;return t.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),i=new Float32Array(t)),e*this.channelSize>t.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),i=t,n=this.allocate(e*this.channelSize),i.forEach(((t,e)=>n[e]=t))):(i=t,n=i),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.RGBAFloatDataEncoder=class{constructor(t,e=1,n){if(1!==e&&4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.channelSize=e,this.textureType=n||t.FLOAT}encode(t,e){let n=t;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(e),t.forEach(((t,e)=>n[4*e]=t))),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.Uint8DataEncoder=class{constructor(t,e=1){if(this.channelSize=4,1===e)this.internalFormat=t.ALPHA,this.format=t.ALPHA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e}}encode(t,e){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}allocate(t){return new Uint8Array(t*this.channelSize)}decode(t,e){if(t instanceof Uint8Array)return t.subarray(0,e);throw new Error(`Invalid array type: ${t.constructor}`)}}},7859:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),i=n(2517);function o(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,o=null==e||i?null:a(e,t).sort();let s=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),r.push(e)),o[s]<=e&&s++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}}function a(t,e){const n=e.length;return t=null==t?e.map(((t,e)=>e)):[].concat(t),(0,i.assert)(t.every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),(0,i.assert)(t.every(s),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function s(t){return t%1==0}function u(t){if(0===t.length)return 1;let e=t[0];for(let n=1;n=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(i>n||o>n))return[i,o];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}const i=t.reduce(((t,e)=>t*e));let o=Math.floor(Math.sqrt(i));for(;o=n||i%o!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${t}`);return[o,i/o]}},e.PreferLogicalStrategy=class{constructor(t){this.maxTextureSize=t}computeTextureWH(t,e){const n=this.computeTexture(t,e);return e&&e.isPacked&&(n[0]/=2,n[1]/=2),e&&e.reverseWH?[n[1],n[0]]:n}computeTexture(t,e){const n=e&&e.isPacked;if(0===t.length)return n?[2,2]:[1,1];let i=this.maxTextureSize;if(e&&void 0!==e.breakAxis){const n=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(n>i||o>i))return[n,o];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}let a=t.slice(0);if(n&&(i*=2,a=a.map(((t,e)=>e>=a.length-2?a[e]%2==0?a[e]:a[e]+1:a[e])),1===a.length&&(a=[2,a[0]])),2!==a.length){const t=o(a);a=t.newShape}const s=u(a);return a.length<=1&&s<=i?[1,s]:2===a.length&&a[0]<=i&&a[1]<=i?a:3===a.length&&a[0]*a[1]<=i&&a[2]<=i?[a[0]*a[1],a[2]]:3===a.length&&a[0]<=i&&a[1]*a[2]<=i?[a[0],a[1]*a[2]]:4===a.length&&a[0]*a[1]*a[2]<=i&&a[3]<=i?[a[0]*a[1]*a[2],a[3]]:4===a.length&&a[0]<=i&&a[1]*a[2]*a[3]<=i?[a[0],a[1]*a[2]*a[3]]:n?c(s/4).map((t=>2*t)):c(s)}},e.squeezeShape=o,e.parseAxisParam=a,e.isInt=s,e.sizeFromShape=u,e.getRowsCols=function(t){if(0===t.length)throw Error("Cannot get rows and columns of an empty shape array.");return[t.length>1?t[t.length-2]:1,t[t.length-1]]},e.sizeToSquarishShape=c,e.getBatchDim=function(t,e=2){return u(t.slice(0,t.length-e))}},4057:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;const r=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=(t,n,r)=>{const o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,a=r===i.TextureType.packed,s=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,c=r===i.TextureType.packedLastDimension?n.map(((t,e)=>e===n.length-1?4*t:t)):void 0;return(0,e.createTextureLayoutFromShape)(t,n,o,c,{isPacked:a,reverseWH:s,breakAxis:u})},e.calculateTextureWidthAndHeight=(t,n,r)=>{const i=(0,e.createTextureLayoutFromTextureType)(t,n,r);return[i.width,i.height]},e.createTextureLayoutFromShape=(t,e,n=1,i,o)=>{const a=!(!o||!o.isPacked),[s,u]=t.computeTextureWH(a&&i||e,o),c=e.length;let l=e.slice(0);if(0===c&&(l=[1]),1===n)i=e;else if(a){if(4!==n)throw new Error("a packed texture must be 4-channel");i=e,c>0&&(l[c-1]=Math.ceil(l[c-1]/2)),c>1&&(l[c-2]=Math.ceil(l[c-2]/2))}else if(!i)throw new Error("Unpacked shape is needed when using channels > 1");return{width:s,height:u,channels:n,isPacked:a,shape:l,strides:r.ShapeUtil.computeStrides(l),unpackedShape:i,reversedWH:o&&o.reverseWH}}},5702:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextureManager=void 0;const r=n(6231);e.TextureManager=class{constructor(t,e,n,r){this.glContext=t,this.layoutStrategy=e,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(t,e,n,i){const o=this.toEncoderType(t),a=this.glContext.getEncoder(o,e.channels||1,i);if(e.isPacked&&1===i)throw new Error("not implemented");const s=e.width,u=e.height;let c,l;if(this.config.reuseTextures){c=`${s}x${u}_${a.format}_${a.internalFormat}_${a.textureType}`,l=this.inUseTextures.get(c),l||(l=[],this.inUseTextures.set(c,l));const e=this.idleTextures.get(c);if(e&&e.length>0){const r=e.pop();return l.push(r),1===i&&this.glContext.updateTexture(r,s,u,a,this.toTextureData(t,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${e.width}x${e.height}`);const p=this.glContext.allocateTexture(s,u,a,this.toTextureData(t,n));return this.config.reuseTextures&&(l.push(p),this.textureLookup.set(p,c)),p}readTexture(t,e,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",(()=>{const r=t.shape.reduce(((t,e)=>t*e))*n,i=this.glContext.readTexture(t.texture,t.width,t.height,r,this.toEncoderType(e),n);return this.toTensorData(e,i)}))}async readTextureAsync(t,e,n){const r=t.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const t=this.pendingRead.get(r);return new Promise((e=>null==t?void 0:t.push(e)))}return this.profiler.event("backend","TextureManager.readTextureAsync",(async()=>{this.pendingRead.set(r,[]);const i=t.shape.reduce(((t,e)=>t*e))*n;await this.glContext.createAndWaitForFence();const o=this.glContext.readTexture(t.texture,t.width,t.height,i,this.toEncoderType(e),n),a=this.toTensorData(e,o),s=this.pendingRead.get(r);return this.pendingRead.delete(r),null==s||s.forEach((t=>t(a))),a}))}readUint8TextureAsFloat(t){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",(()=>{const e=t.shape.reduce(((t,e)=>t*e)),n=this.glContext.readTexture(t.texture,t.width,t.height,4*e,"byte",4);return new Float32Array(n.buffer,n.byteOffset,e)}))}releaseTexture(t,e){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture),n)){e&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const e=r.indexOf(t.texture);if(-1!==e){r.splice(e,1);let i=this.idleTextures.get(n);i||(i=[],this.idleTextures.set(n,i)),i.push(t.texture)}}}n&&!e||(r.Logger.verbose("TextureManager",`Deleting texture of size ${t.width}x${t.height}`),this.glContext.deleteTexture(t.texture))}toTensorData(t,e){switch(t){case"int16":return e instanceof Int16Array?e:Int16Array.from(e);case"int32":return e instanceof Int32Array?e:Int32Array.from(e);case"int8":return e instanceof Int8Array?e:Int8Array.from(e);case"uint16":return e instanceof Uint16Array?e:Uint16Array.from(e);case"uint32":return e instanceof Uint32Array?e:Uint32Array.from(e);case"uint8":case"bool":return e instanceof Uint8Array?e:Uint8Array.from(e);case"float32":return e instanceof Float32Array?e:Float32Array.from(e);case"float64":return e instanceof Float64Array?e:Float64Array.from(e);default:throw new Error(`TensorData type ${t} is not supported`)}}toTextureData(t,e){if(e)return e instanceof Float32Array?e:new Float32Array(e)}toEncoderType(t){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TextureType=void 0,(n=e.TextureType||(e.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;const r=n(2517);e.getPackedShape=function(t){const e=t.length;return t.slice(0,e-1).concat(t[e-1]/4)},e.repeatedTry=async function(t,e=(t=>0),n){return new Promise(((r,i)=>{let o=0;const a=()=>{if(t())return void r();o++;const s=e(o);null!=n&&o>=n?i():setTimeout(a,s)};a()}))},e.generateShaderFuncNameFromInputSamplerName=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>"empty string found for sampler name")),"get"+t.charAt(0).toUpperCase()+t.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>"empty string found for sampler name")),"get"+t.charAt(0).toUpperCase()+t.slice(1)+"AtOutCoords"},e.squeezeInputShape=function(t,e){let n=JSON.parse(JSON.stringify(t));return n=e,n},e.getSqueezedParams=function(t,e){return e.map((e=>t[e])).join(", ")},e.getCoordsDataType=function(t){if(t<=1)return"int";if(2===t)return"ivec2";if(3===t)return"ivec3";if(4===t)return"ivec4";if(5===t)return"ivec5";if(6===t)return"ivec6";throw Error(`GPU for rank ${t} is not yet supported`)},e.getGlChannels=function(t=6){return["x","y","z","w","u","v"].slice(0,t)}},7305:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;const r=n(6231),i=n(1713),o={};function a(t){const e=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const t=document.createElement("canvas");return t.width=1,t.height=1,t}();let n;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t||"webgl2"===t)&&(n=e.getContext("webgl2",o),n))try{return new i.WebGLContext(n,2)}catch(t){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!t||"webgl"===t)&&(n=e.getContext("webgl",o)||e.getContext("experimental-webgl",o),n))try{return new i.WebGLContext(n,1)}catch(t){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error("WebGL is not supported")}e.createWebGLContext=function t(e){let n;e&&"webgl2"!==e||!("webgl2"in o)?e&&"webgl"!==e||!("webgl"in o)||(n=o.webgl):n=o.webgl2,n=n||a(e),e=e||1===n.version?"webgl":"webgl2";const r=n.gl;return o[e]=n,r.isContextLost()?(delete o[e],t(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},e.createNewWebGLContext=a},1713:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;const a=n(1670),s=o(n(7769)),u=n(9390);function c(t){let e=0;for(;ethis.isTimerResultAvailable(t))),this.getTimerResult(t)}async createAndWaitForFence(){const t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e;const n=t,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),e=null===r?()=>!0:()=>{const t=n.clientWaitSync(r,0,0);return t===n.ALREADY_SIGNALED||t===n.CONDITION_SATISFIED},{query:r,isFencePassed:e}}async pollFence(t){return new Promise((e=>{this.addItemToPoll((()=>t.isFencePassed()),(()=>e()))}))}pollItems(){const t=c(this.itemsToPoll.map((t=>t.isDoneFn)));for(let e=0;e<=t;++e){const{resolveFn:t}=this.itemsToPoll[e];t()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}async addItemToPoll(t,e){this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||await(0,u.repeatedTry)((()=>(this.pollItems(),0===this.itemsToPoll.length)))}}},1036:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExecutionPlan=void 0;const r=n(6231);class i{constructor(t,e){this.op=t,this.node=e}}e.ExecutionPlan=class{constructor(t,e,n){this.graph=t,this.profiler=n,this.initialize(e)}initialize(t){this.profiler.event("session","ExecutionPlan.initialize",(()=>{const e=this.graph.getNodes();if(e.length!==t.length)throw new Error("The size of nodes and OPs do not match.");this._ops=t.map(((t,n)=>new i(t,e[n]))),this.reset(),this._starter=[],this._ops.forEach(((t,e)=>{let n=!0;for(const e of t.node.inputs)if(!this._values[e]&&-1===this.graph.getInputIndices().indexOf(e)){n=!1;break}n&&this._starter.push(e)}))}))}reset(){this._values=this.graph.getValues().map((t=>t.tensor))}async execute(t,e){return this.profiler.event("session","ExecutionPlan.execute",(async()=>{this.reset();const n=t.createInferenceHandler(),i=this.graph.getInputIndices();if(e.length!==i.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${e.length} expected: ${i.length}`);e.forEach(((t,e)=>{const n=i[e];this._values[n]=t}));const o=this._starter.slice(0),a=this.graph.getValues(),s=this.graph.getNodes();let u=0;for(;uthis._values[t]));if(-1!==i.indexOf(void 0))throw new Error(`unresolved input detected: op: ${e.node}`);const c=i;r.Logger.verbose("ExecPlan",`Runing op:${e.node.name} (${c.map(((t,n)=>`'${e.node.inputs[n]}': ${t.type}[${t.dims.join(",")}]`)).join(", ")})`);const l=await this.profiler.event("node",e.node.name,(async()=>e.op.impl(n,c,e.op.context)));if(l.length!==e.node.outputs.length)throw new Error("the size of output does not match model definition.");l.forEach(((t,n)=>{const r=e.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${e.node.name}`);this._values[r]=t}));const p=new Set;l.forEach(((t,n)=>{const r=e.node.outputs[n];for(const t of a[r].to){const e=s[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&p.add(t)}})),o.push(...p)}const c=[];for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;const r=n(1446),i=n(7778),o=n(9395),a=n(9162),s=n(2517);var u=o.onnxruntime.experimental.fbs;e.Graph={from:(t,e)=>new p(t,e)};class c{constructor(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(t.type.tensorType))}get from(){return this._from}get to(){return this._to}}class l{constructor(t,e){t instanceof r.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new i.Attribute(t.attribute)):t instanceof u.Node&&(this.name=null!=e?e:t.name(),this.opType=t.opType(),this.attributes=new i.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class p{constructor(t,e){if(!t)throw new TypeError("graph is empty");this.buildGraph(t),this.transformGraph(e),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(t){if(t instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else{if(!(t instanceof u.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(t)}}buildGraphFromOnnxFormat(t){const e=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!t.input)throw new Error("missing information in graph: input");const r=[];for(const n of t.input){if(e.has(n.name))throw new Error(`duplicated input name: ${n.name}`);const t=this._allData.push(new c(n))-1;e.set(n.name,t),r.push(n.name)}if(!t.initializer)throw new Error("missing information in graph: initializer");for(const n of t.initializer){let t=e.get(n.name);if(void 0===t){const r=new c;r.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(n.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(n.dataType)},t=this._allData.push(r)-1,e.set(n.name,t)}this._allData[t]._from=-1,this._allData[t].tensor=a.Tensor.fromProto(n)}for(let t=0;t{this._allData[e]._to.forEach((e=>{t.add(e)}))}));const e=Array.from(t),n=new Array(this._nodes.length).fill("white");for(;e.length>0;){const t=e.pop();"gray"===n[t]?n[t]="black":(e.push(t),n[t]="gray",this._nodes[t].outputs.forEach((r=>{const i=this._allData[r];if(void 0!==i.tensor)throw new Error("node outputs should not be initialized");if(i._from!==t)throw new Error("from property of the Value object doesn't match index of Node being processed");i._to.forEach((t=>{if("gray"===n[t])throw new Error("model graph is cyclic");"white"===n[t]&&e.push(t)}))})))}}transformGraph(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let t=0;for(let e=0;e0&&(this._nodes[e].inputs.forEach((n=>{const r=this._allData[n]._to.indexOf(e+t);-1!==r&&(this._allData[n]._to[r]=e)})),this._nodes[e].outputs.forEach((n=>{this._allData[n]._from&&this._allData[n]._from===e+t&&(this._allData[n]._from=e)}))):(t++,this._nodes[e].outputs.forEach((t=>{this._allData[t]._from=-2})),this._nodes.splice(e,1),e--);t=0;for(let e=0;e0){let n=-1;void 0!==this._allData[e].from&&-1!==this._allData[e].from?(n=this._nodes[this._allData[e].from].outputs.indexOf(e+t),-1!==n&&(this._nodes[this._allData[e].from].outputs[n]=e)):(n=this._allInputIndices.indexOf(e+t),-1!==n&&(this._allInputIndices[n]=e)),this._allData[e].to.forEach((r=>{n=this._nodes[r].inputs.indexOf(e+t),-1!==n&&(this._nodes[r].inputs[n]=e)})),0===this._allData[e].to.length&&(n=this._allOutputIndices.indexOf(e+t),-1!==n&&(this._allOutputIndices[n]=e))}}else t++,this._allData.splice(e,1),e--}deleteNode(t){const e=this._nodes[t];if(e.outputs.length>1)for(let t=1;t0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");e.executeNode=!1;const n=e.inputs[0],r=e.outputs[0],i=this._allData[r].to,o=this._allData[n].to.indexOf(t);if(-1===o)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[n].to.splice(o,1),this._allData[r]._to=[];const a=this._allOutputIndices.indexOf(r);if(-1!==a&&(this._allOutputIndices[a]=n),i&&i.length>0)for(const t of i){const e=this._nodes[t].inputs.indexOf(r);if(-1===e)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[t].inputs[e]=n,this._allData[n].to.push(t)}}removeAllDropoutNodes(){let t=0;for(const e of this._nodes){if("Dropout"===e.opType){if(1!==e.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==e.outputs.length&&2!==e.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===e.outputs.length&&0!==this._allData[e.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(t)}t++}}removeAllIdentityNodes(){let t=0;for(const e of this._nodes)"Identity"===e.opType&&this.deleteNode(t),t++}isActivation(t){switch(t.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if("Conv"===t.opType){const e=this._allData[t.outputs[0]]._to;if(1===e.length&&this.isActivation(this._nodes[e[0]])){const n=this._nodes[e[0]];if("Clip"===n.opType)if(1===n.inputs.length)try{t.attributes.set("activation_params","floats",[n.attributes.getFloat("min"),n.attributes.getFloat("max")])}catch(e){t.attributes.set("activation_params","floats",[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(n.inputs.length>=3&&void 0!==this._allData[n.inputs[1]].tensor&&void 0!==this._allData[n.inputs[2]].tensor))continue;t.attributes.set("activation_params","floats",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]])}t.attributes.set("activation","string",n.opType),this.deleteNode(e[0])}}}}},6231:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.now=e.Profiler=e.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(t,e,n){}},console:new class{log(t,e,n){console.log(`${this.color(t)} ${n?""+n+" ":""}${e}`)}color(t){switch(t){case"verbose":return"v";case"info":return"i";case"warning":return"w";case"error":return"e";case"fatal":return"f";default:throw new Error(`unsupported severity: ${t}`)}}}},i={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let o={"":i};function a(t,e,n,r){if(void 0===e)return i=t,{verbose:a.verbose.bind(null,i),info:a.info.bind(null,i),warning:a.warning.bind(null,i),error:a.error.bind(null,i),fatal:a.fatal.bind(null,i)};if(void 0===n)s(t,e);else if("number"==typeof n&&void 0===r)s(t,e);else if("string"==typeof n&&void 0===r)s(t,n,0,e);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");s(t,n,0,e)}var i}function s(t,e,i,a){const s=o[a||""]||o[""];n[t]{a.then((async e=>{i&&await i.end(),t(e)}),(async t=>{i&&await i.end(),e(t)}))}));if(!o&&i){const t=i.end();if(t&&"function"==typeof t.then)return new Promise(((e,n)=>{t.then((()=>{e(a)}),(t=>{n(t)}))}))}return a}begin(t,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,e.now)();return this.flush(r),new u(t,n,r,(t=>this.endSync(t)))}{const e=r.beginTimer();return new u(t,n,0,(async t=>this.end(t)),e,r)}}async end(t){const e=await t.checkTimer();this._timingEvents.length=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;const r=n(5686),i=n(1446),o=n(7070),a=n(9395),s=n(2517);var u=a.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(t,e,n){if(!n)try{return void this.loadFromOnnxFormat(t,e)}catch(t){if(void 0!==n)throw t}this.loadFromOrtFormat(t,e)}loadFromOnnxFormat(t,e){const n=i.onnx.ModelProto.decode(t);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map((t=>({domain:t.domain,version:s.LongUtil.longToNumber(t.version)}))),this._graph=o.Graph.from(n.graph,e)}loadFromOrtFormat(t,e){const n=new r.flatbuffers.ByteBuffer(t),i=u.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(i.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],e.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],e.FLOAT_TYPES=["float32","float64"]},1047:(t,e)=>{"use strict";function n(t,e){if(e.endsWith("+")){const n=Number.parseInt(e.substring(0,e.length-1),10);return!isNaN(n)&&n<=t}if(2===e.split("-").length){const n=e.split("-"),r=Number.parseInt(n[0],10),i=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(i)&&r<=t&&t<=i}return Number.parseInt(e,10)===t}Object.defineProperty(e,"__esModule",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t,e,r){for(const i of r){const r=i[0],o=i[1],a=i[2],s=i[3],u=i[4];if(t.opType===r)for(const t of e)if((t.domain===o||"ai.onnx"===t.domain&&""===o)&&n(t.version,a))return{opImpl:s,opInit:u}}throw new TypeError(`cannot resolve operator '${t.opType}' with opsets: ${e.map((t=>`${t.domain||"ai.onnx"} v${t.version}`)).join(", ")}`)}},9395:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onnxruntime=void 0;const r=n(5686);var i,o;i=e.onnxruntime||(e.onnxruntime={}),function(t){let e;!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.FLOAT=1]="FLOAT",t[t.INT=2]="INT",t[t.STRING=3]="STRING",t[t.TENSOR=4]="TENSOR",t[t.GRAPH=5]="GRAPH",t[t.FLOATS=6]="FLOATS",t[t.INTS=7]="INTS",t[t.STRINGS=8]="STRINGS",t[t.TENSORS=9]="TENSORS",t[t.GRAPHS=10]="GRAPHS",t[t.SPARSE_TENSOR=11]="SPARSE_TENSOR",t[t.SPARSE_TENSORS=12]="SPARSE_TENSORS"}(e=t.AttributeType||(t.AttributeType={}))}((o=i.experimental||(i.experimental={})).fbs||(o.fbs={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VALUE=1]="VALUE",t[t.PARAM=2]="PARAM"}(e=t.DimensionValueType||(t.DimensionValueType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.FLOAT=1]="FLOAT",t[t.UINT8=2]="UINT8",t[t.INT8=3]="INT8",t[t.UINT16=4]="UINT16",t[t.INT16=5]="INT16",t[t.INT32=6]="INT32",t[t.INT64=7]="INT64",t[t.STRING=8]="STRING",t[t.BOOL=9]="BOOL",t[t.FLOAT16=10]="FLOAT16",t[t.DOUBLE=11]="DOUBLE",t[t.UINT32=12]="UINT32",t[t.UINT64=13]="UINT64",t[t.COMPLEX64=14]="COMPLEX64",t[t.COMPLEX128=15]="COMPLEX128",t[t.BFLOAT16=16]="BFLOAT16"}(e=t.TensorDataType||(t.TensorDataType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.Primitive=0]="Primitive",t[t.Fused=1]="Fused"}(e=t.NodeType||(t.NodeType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]="NONE",t[t.tensor_type=1]="tensor_type",t[t.sequence_type=2]="sequence_type",t[t.map_type=3]="map_type"}(e=t.TypeInfoValue||(t.TypeInfoValue={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dim(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return n.startShape(t),n.addDim(t,e),n.endShape(t)}}e.Shape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}value(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,r){return n.startDimension(t),n.addValue(t,e),n.addDenotation(t,r),n.endDimension(t)}}e.Dimension=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):t.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(e,n){e.addFieldInt8(0,n,t.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,r,i){return n.startDimensionValue(t),n.addDimType(t,e),n.addDimValue(t,r),n.addDimParam(t,i),n.endDimensionValue(t)}}e.DimensionValue=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}shape(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,r){return n.startTensorTypeAndShape(t),n.addElemType(t,e),n.addShape(t,r),n.endTensorTypeAndShape(t)}}e.TensorTypeAndShape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}valueType(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,r){return n.startMapType(t),n.addKeyType(t,e),n.addValueType(t,r),n.endMapType(t)}}e.MapType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return n.startSequenceType(t),n.addElemType(t,e),n.endSequenceType(t)}}e.SequenceType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){(t.fbs||(t.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(t,e,n,r){return t.prep(4,12),t.writeInt32(r),t.writeInt32(n),t.writeInt32(e),t.offset()}}}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,r,i){return n.startNodeEdge(t),n.addNodeIndex(t,e),n.addInputEdges(t,r),n.addOutputEdges(t,i),n.endNodeEdge(t)}}e.NodeEdge=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(e,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(e,n){e.addFieldInt32(6,n,t.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,r,i,o,a,s,u,c,l,p,f,d,h){return n.startNode(t),n.addName(t,e),n.addDocString(t,r),n.addDomain(t,i),n.addSinceVersion(t,o),n.addIndex(t,a),n.addOpType(t,s),n.addType(t,u),n.addExecutionProviderType(t,c),n.addInputs(t,l),n.addOutputs(t,p),n.addAttributes(t,f),n.addInputArgCounts(t,d),n.addImplicitInputs(t,h),n.endNode(t)}}e.Node=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,r,i){return n.startValueInfo(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.endValueInfo(t)}}e.ValueInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(e,n){e.addFieldInt8(1,n,t.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,r,i){return n.startTypeInfo(t),n.addDenotation(t,e),n.addValueType(t,r),n.addValue(t,i),n.endTypeInfo(t)}}e.TypeInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,n,r){return e.startOperatorSetId(t),e.addDomain(t,n),e.addVersion(t,r),e.endOperatorSetId(t)}}t.OperatorSetId=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(e,n){e.addFieldInt32(3,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,r,i,o,a,s){return n.startTensor(t),n.addName(t,e),n.addDocString(t,r),n.addDims(t,i),n.addDataType(t,o),n.addRawData(t,a),n.addStringData(t,s),n.endTensor(t)}}e.Tensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}values(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,r,i){return n.startSparseTensor(t),n.addValues(t,e),n.addIndices(t,r),n.addDims(t,i),n.endSparseTensor(t)}}e.SparseTensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(e){let n=this.bb.__offset(this.bb_pos,16);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(e,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(e,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(e,n){e.addFieldInt32(2,n,t.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,r,i,o,a,s,u,c,l,p,f,d,h){return n.startAttribute(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.addF(t,o),n.addI(t,a),n.addS(t,s),n.addT(t,u),n.addG(t,c),n.addFloats(t,l),n.addInts(t,p),n.addStrings(t,f),n.addTensors(t,d),n.addGraphs(t,h),n.endAttribute(t)}}e.Attribute=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}initializers(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(e,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(e,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,r,i,o,a,s,u,c){return n.startGraph(t),n.addInitializers(t,e),n.addNodeArgs(t,r),n.addNodes(t,i),n.addMaxNodeIndex(t,o),n.addNodeEdges(t,a),n.addInputs(t,s),n.addOutputs(t,u),n.addSparseInitializers(t,c),n.endGraph(t)}}e.Graph=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,r,i,o,a,s,u,c,l){return n.startModel(t),n.addIrVersion(t,e),n.addOpsetImport(t,r),n.addProducerName(t,i),n.addProducerVersion(t,o),n.addDomain(t,a),n.addModelVersion(t,s),n.addDocString(t,u),n.addGraph(t,c),n.addGraphDocString(t,l),n.endModel(t)}}e.Model=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,n,r){return e.startKernelCreateInfos(t),e.addNodeIndices(t,n),e.addKernelDefHashes(t,r),e.endKernelCreateInfos(t)}}t.KernelCreateInfos=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,r){return n.startSubGraphSessionState(t),n.addGraphId(t,e),n.addSessionState(t,r),n.endSubGraphSessionState(t)}}e.SubGraphSessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}kernels(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,r){return n.startSessionState(t),n.addKernels(t,e),n.addSubGraphSessionStates(t,r),n.endSessionState(t)}}e.SessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier("ORTM")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,"ORTM",!0)}static createInferenceSession(t,e,r,i){return n.startInferenceSession(t),n.addOrtVersion(t,e),n.addModel(t,r),n.addSessionState(t,i),n.endInferenceSession(t)}}e.InferenceSession=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxjsSessionHandler=void 0;const r=n(1670),i=n(9162);e.OnnxjsSessionHandler=class{constructor(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t,e,n){const o=new Map;for(const e in t)if(Object.hasOwnProperty.call(t,e)){const n=t[e];o.set(e,new i.Tensor(n.dims,n.type,void 0,void 0,n.data))}const a=await this.session.run(o),s={};return a.forEach(((t,e)=>{s[e]=new r.Tensor(t.type,t.data,t.dims)})),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;const r=n(7067),i=n(1296),o=n(7091),a=n(1036),s=n(6231),u=n(2644);e.Session=class{constructor(t={}){this._initialized=!1,this.backendHint=t.backendHint,this.profiler=s.Profiler.create(t.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(t,e,n){await this.profiler.event("session","Session.loadModel",(async()=>{const a=await(0,o.resolveBackend)(this.backendHint);if(this.sessionHandler=a.createSessionHandler(this.context),this._model=new u.Model,"string"==typeof t){const e=t.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,i.promisify)(r.readFile)(t);this.initialize(n,e)}else{const n=await fetch(t),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),e)}}else if(ArrayBuffer.isView(t))this.initialize(t);else{const r=new Uint8Array(t,e||0,n||t.byteLength);this.initialize(r)}}))}initialize(t,e){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",(()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t,n,e),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new a.ExecutionPlan(this._model.graph,this._ops,this.profiler)})),this._initialized=!0}async run(t){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",(async()=>{const e=this.normalizeAndValidateInputs(t),n=await this._executionPlan.execute(this.sessionHandler,e);return this.createOutput(n)}))}normalizeAndValidateInputs(t){const e=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==e.length)throw new Error(`incorrect input array length: expected ${e.length} but got ${t.length}`)}else{if(t.size!==e.length)throw new Error(`incorrect input map size: expected ${e.length} but got ${t.size}`);const n=new Array(t.size);let r=0;for(let i=0;i"string"==typeof t))))throw new TypeError("cache should be a string array");c&&(this.cache=new Array(s))}else{if(void 0!==o){const t=f(e);if(!(o instanceof t))throw new TypeError(`cache should be type ${t.name}`)}if(c){const t=new ArrayBuffer(s*function(t){switch(t){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${t}`)}}(e));this.cache=function(t,e){return new(f(e))(t)}(t,e)}}}static fromProto(t){if(!t)throw new Error("cannot construct Value from an empty tensor");const e=u.ProtoUtil.tensorDataTypeFromProto(t.dataType),n=u.ProtoUtil.tensorDimsFromProto(t.dims),r=new l(n,e);if("string"===e)t.stringData.forEach(((t,e)=>{r.data[e]=(0,u.decodeUtf8String)(t)}));else if(t.rawData&&"number"==typeof t.rawData.byteLength&&t.rawData.byteLength>0){const e=r.data,n=new DataView(t.rawData.buffer,t.rawData.byteOffset,t.rawData.byteLength),i=p(t.dataType),o=t.rawData.byteLength/i;if(t.rawData.byteLength%i!=0)throw new Error("invalid buffer length");if(e.length!==o)throw new Error("buffer length mismatch");for(let r=0;r0){const e=r.data,n=new DataView(t.rawDataArray().buffer,t.rawDataArray().byteOffset,t.rawDataLength()),i=p(t.dataType()),o=t.rawDataLength()/i;if(t.rawDataLength()%i!=0)throw new Error("invalid buffer length");if(e.length!==o)throw new Error("buffer length mismatch");for(let r=0;r1&&u>1)return;a[o-s]=Math.max(n,u)}return a}static index(t,e){const n=new Array(e.length);return c.fillIndex(t,e,n),n}static fillIndex(t,e,n){const r=t.length-e.length;for(let i=0;i=0;t--)r[t]=l%o[t],l=Math.floor(l/o[t]);d||(c.fillIndex(r,t.dims,i),p=t.get(i)),h||(c.fillIndex(r,e.dims,s),f=e.get(s)),u.set(r,n(p,f))}}return u}}static isValidBroadcast(t,e){const n=t.length,r=e.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(1!==t[n-i]&&t[n-i]!==e[r-i])return!1;return!0}static getBroadcastDims(t,e){const n=t.length,r=[];for(let i=0;i1&&1===a&&r.unshift(o)}return r}}e.BroadcastUtil=c,e.arrayCopyHelper=function(t,e,n,r,i){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let o=0;oo.default.isLong(t)?t.toNumber():t))}static tensorValueTypeFromProto(t){return{tensorType:l.tensorDataTypeFromProto(t.elemType),shape:{dims:l.tensorDimsFromProto(t.shape.dim.map((t=>t.dimValue)))}}}static tensorDimsFromORTFormat(t){const e=[];for(let n=0;nt.length)throw new Error(`invalid dimension of ${e} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return f.getSizeFromDimensionRange(t,e,t.length)}static sizeToDimension(t,e){if(e<0||e>t.length)throw new Error(`invalid dimension of ${e} for sizeToDimension as Tensor has ${t.length} dimensions.`);return f.getSizeFromDimensionRange(t,0,e)}static getSizeFromDimensionRange(t,e,n){let r=1;for(let i=e;i=0;--r)n[r]=n[r+1]*t[r+1];return n}static transpose(t){return t.slice().reverse()}static indicesToOffset(t,e,n){void 0===n&&(n=t.length);let r=0;for(let i=0;i=e)throw new Error("unsupported axis for this operation.");return t<0?t+e:t}static normalizeAxes(t,e){return t.map((t=>this.normalizeAxis(t,e)))}static incrementIndex(t,e,n){if(0===e.length||0===t.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=e.length;else if(n<=0||n>e.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(t[r]++,!(t[r]=t.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[a]=t[a]}else r[a]=e[a];o*=r[a]}}const a=f.size(t);if(-1!==i){if(a%o!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t}] Output shape: [${e}]`);r[i]=a/o}else if(o!==a)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(t,e){return e?e.map((e=>t[e])):t.slice().reverse()}static padShape(t,e){const n=t.length;return t.map(((t,r)=>t+e[r]+e[r+n]))}static areEqual(t,e){return t.length===e.length&&t.every(((t,n)=>t===e[n]))}static validateDimsAndCalcSize(t){if(t.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let e=1;for(const n of t){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);e*=n}return e}static flattenShape(t,e){e<0&&(e+=t.length);const n=t.reduce(((t,e)=>t*e),1),r=t.slice(e).reduce(((t,e)=>t*e),1);return[n/r,r]}static squeezeShape(t,e){const n=new Array;e=f.normalizeAxes(e,t.length);for(let r=0;r=0;if(i&&1!==t[r])throw new Error("squeeze an axis of size different than 1");(0===e.length&&t[r]>1||e.length>0&&!i)&&n.push(t[r])}return n}static unsqueezeShape(t,e){const n=new Array(t.length+e.length);n.fill(0);for(let t=0;t=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[r])throw new Error("'axes' has a duplicate axis");n[r]=1}let r=0;for(let e=0;e=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let o=0;o=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let a=0;a=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let a=0;a=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let o=0;oe.push(n)));const a=h.calcReduceShape(o,e,!0),u=f.size(a),l=new s.Tensor(a,t.type),p=f.computeStrides(a),d=f.computeStrides(o),g=new Array(o.length);for(let n=0;n=e.length)return o(t[i]);const u=e[r],c=u>=n.length?1:f.size(n.slice(u+1));for(let l=0;l0!==t))}}e.ReduceUtil=h;class g{static adjustPoolAttributes(t,e,n,r,i,o){if(!t&&n.length!==e.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(t)for(let t=0;t=n.length?n.push(e[t+2]):n[t]=e[t+2];for(let t=0;t=n[t]||o[t+n.length]>=n[t])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(t,e,n,r,i,o){if(o){if(i.length!==2*(t.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(e.length!==t.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==t.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let a=0;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,i)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,o])=>{const a=n?n+t:t;if("object"==typeof o)(0,e.iterateExtraOptions)(o,a+".",r,i);else if("string"==typeof o||"number"==typeof o)i(a,o.toString());else{if("boolean"!=typeof o)throw new Error("Can't handle extra config type: "+typeof o);i(a,o?"1":"0")}}))}},2157:function(t,e,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;const s=n(1670),u=a(n(349)),c=n(6361),l=()=>!!s.env.wasm.proxy&&"undefined"!=typeof document;let p,f,d,h=!1,g=!1,b=!1;const m=[],y=[],_=[],v=[],w=[],x=[],T=()=>{if(h||!g||b||!p)throw new Error("worker not ready")},S=t=>{switch(t.data.type){case"init-wasm":h=!1,t.data.err?(b=!0,f[1](t.data.err)):(g=!0,f[0]());break;case"init-ort":t.data.err?d[1](t.data.err):d[0]();break;case"create_allocate":t.data.err?m.shift()[1](t.data.err):m.shift()[0](t.data.out);break;case"create_finalize":t.data.err?y.shift()[1](t.data.err):y.shift()[0](t.data.out);break;case"create":t.data.err?_.shift()[1](t.data.err):_.shift()[0](t.data.out);break;case"release":t.data.err?v.shift()[1](t.data.err):v.shift()[0]();break;case"run":t.data.err?w.shift()[1](t.data.err):w.shift()[0](t.data.out);break;case"end-profiling":t.data.err?x.shift()[1](t.data.err):x.shift()[0]()}},O="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;e.initWasm=async()=>{if(l()){if(g)return;if(h)throw new Error("multiple calls to 'initWasm()' detected.");if(b)throw new Error("previous call to 'initWasm()' failed.");return h=!0,void 0===s.env.wasm.wasmPaths&&O&&0!==O.indexOf("blob:")&&(s.env.wasm.wasmPaths=O.substr(0,+O.lastIndexOf("/")+1)),new Promise(((t,e)=>{null==p||p.terminate(),p=n(9710).Z(),p.onmessage=S,f=[t,e];const r={type:"init-wasm",in:s.env.wasm};p.postMessage(r)}))}return(0,c.initializeWebAssembly)(s.env.wasm)},e.initOrt=async(t,e)=>{if(l())return T(),new Promise(((n,r)=>{d=[n,r];const i={type:"init-ort",in:{numThreads:t,loggingLevel:e}};p.postMessage(i)}));u.initOrt(t,e)},e.createSessionAllocate=async t=>l()?(T(),new Promise(((e,n)=>{m.push([e,n]);const r={type:"create_allocate",in:{model:t}};p.postMessage(r,[t.buffer])}))):u.createSessionAllocate(t),e.createSessionFinalize=async(t,e)=>l()?(T(),new Promise(((n,r)=>{y.push([n,r]);const i={type:"create_finalize",in:{modeldata:t,options:e}};p.postMessage(i)}))):u.createSessionFinalize(t,e),e.createSession=async(t,e)=>l()?(T(),new Promise(((n,r)=>{_.push([n,r]);const i={type:"create",in:{model:t,options:e}};p.postMessage(i,[t.buffer])}))):u.createSession(t,e),e.releaseSession=async t=>{if(l())return T(),new Promise(((e,n)=>{v.push([e,n]);const r={type:"release",in:t};p.postMessage(r)}));u.releaseSession(t)},e.run=async(t,e,n,r,i)=>l()?(T(),new Promise(((o,a)=>{w.push([o,a]);const s={type:"run",in:{sessionId:t,inputIndices:e,inputs:n,outputIndices:r,options:i}};p.postMessage(s,u.extractTransferableBuffers(n))}))):u.run(t,e,n,r,i),e.endProfiling=async t=>{if(l())return T(),new Promise(((e,n)=>{x.push([e,n]);const r={type:"end-profiling",in:t};p.postMessage(r)}));u.endProfiling(t)}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setRunOptions=t=>{const e=(0,o.getInstance)();let n=0;const a=[],s=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(s.terminate=!1);let o=0;if(void 0!==(null==t?void 0:t.tag)&&(o=(0,i.allocWasmString)(t.tag,a)),n=e._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,o),0===n)throw new Error("Can't create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,a),s=(0,i.allocWasmString)(r,a);if(0!==e._OrtAddRunConfigEntry(n,o,s))throw new Error(`Can't set a run config entry: ${t} - ${r}`)})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),a.forEach(e._free),t}}},2306:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),i=n(1670),o=n(2850),a=n(2157);let s;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(t){const e=await fetch(t),n=await e.arrayBuffer();return(0,a.createSessionAllocate)(new Uint8Array(n))}async loadModel(t,e){if(s||(await(0,a.initOrt)(i.env.wasm.numThreads,(t=>{switch(t){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${t}`)}})(i.env.logLevel)),s=!0),"string"==typeof t)if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(n,e)}else{const n=await this.createSessionAllocate(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSessionFinalize)(n,e)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(t,e)}async dispose(){return(0,a.releaseSession)(this.sessionId)}async run(t,e,n){const r=[],o=[];Object.entries(t).forEach((t=>{const e=t[0],n=t[1],i=this.inputNames.indexOf(e);if(-1===i)throw new Error(`invalid input '${e}'`);r.push(n),o.push(i)}));const s=[];Object.entries(e).forEach((t=>{const e=t[0],n=this.outputNames.indexOf(e);if(-1===n)throw new Error(`invalid output '${e}'`);s.push(n)}));const u=await(0,a.run)(this.sessionId,o,r.map((t=>[t.type,t.dims,t.data])),s,n),c={};for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setSessionOptions=t=>{const e=(0,o.getInstance)();let n=0;const a=[],s=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(s);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(s.graphOptimizationLevel="all");const u=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(s.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(s.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(s.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(s.executionMode="sequential");const c=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(s.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,i.allocWasmString)(t.logId,a)),void 0===(null==t?void 0:t.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(s.enableProfiling=!1),n=e._OrtCreateSessionOptions(u,!!s.enableCpuMemArena,!!s.enableMemPattern,c,!!s.enableProfiling,0,l,s.logSeverityLevel,s.logVerbosityLevel),0===n)throw new Error("Can't create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const a=(0,i.allocWasmString)(e,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,a))throw new Error(`Can't append execution provider: ${e}`)}})(n,t.executionProviders,a),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,a),s=(0,i.allocWasmString)(r,a);if(0!==e._OrtAddSessionConfigEntry(n,o,s))throw new Error(`Can't set a session config entry: ${t} - ${r}`)})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),a.forEach(e._free),t}}},4983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(6361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),i=n.lengthBytesUTF8(t)+1,o=n._malloc(i);return n.stringToUTF8(t,o,i),e.push(o),o}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),i=n(4919),o=n(4983),a=n(6361);e.initOrt=(t,e)=>{const n=(0,a.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const s=new Map;e.createSessionAllocate=t=>{const e=(0,a.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,a.getInstance)();let r=0,o=0,u=[];try{if([o,u]=(0,i.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],o),0===r)throw new Error("Can't create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(o),u.forEach(n._free)}const c=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),p=[],f=[],d=[],h=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,a.getInstance)(),n=s.get(t);if(!n)throw new Error("invalid session id");const r=n[0],i=n[1],o=n[2];i.forEach(e._OrtFree),o.forEach(e._OrtFree),e._OrtReleaseSession(r),s.delete(t)};const u=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},c=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,i,p)=>{const f=(0,a.getInstance)(),d=s.get(t);if(!d)throw new Error("invalid session id");const h=d[0],g=d[1],b=d[2],m=e.length,y=i.length;let _=0,v=[];const w=[],x=[];try{[_,v]=(0,r.setRunOptions)(p);for(let t=0;tf.HEAP32[t++]=e));const n=f._OrtCreateTensor(u(e),a,s,l,r.length);if(0===n)throw new Error("Can't create a tensor");w.push(n)}finally{f.stackRestore(c)}}const t=f.stackSave(),a=f.stackAlloc(4*m),s=f.stackAlloc(4*m),d=f.stackAlloc(4*y),T=f.stackAlloc(4*y);try{let n=a/4,r=s/4,o=d/4,u=T/4;for(let t=0;tt*e));if(i=c(a),"string"===i){const t=[];let e=o/4;for(let n=0;n{const e=(0,a.getInstance)(),n=s.get(t);if(!n)throw new Error("invalid session id");const r=n[0],i=e._OrtEndProfiling(r);if(0===i)throw new Error("Can't get an profile file name");e._OrtFree(i)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},6361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const s=o(n(6449)),u=a(n(932)),c=n(3474);let l,p=!1,f=!1,d=!1;const h=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(p)return Promise.resolve();if(f)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(d)throw new Error("previous call to 'initializeWebAssembly()' failed.");f=!0;const e=t.initTimeout,r=t.numThreads,i=t.simd,o=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),a=i&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),g="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=h(!1,o),m=h(a,o),y="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let _=!1;const v=[];if(e>0&&v.push(new Promise((t=>{setTimeout((()=>{_=!0,t()}),e)}))),v.push(new Promise(((t,e)=>{const r=o?c:u.default,i={locateFile:(t,e)=>o&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):t===b?null!=y?y:(null!=g?g:e)+m:e+t};if(o)if("undefined"==typeof Blob)i.mainScriptUrlOrBlob=s.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;i.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(i).then((e=>{f=!1,p=!0,l=e,t()}),(t=>{f=!1,d=!0,e(t)}))}))),await Promise.race(v),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(p&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!p||f||d||(f=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,f=!1,p=!1,d=!0)}},9710:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:t=>{"use strict";t.exports=function(t,e,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([t])}catch(e){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(t),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),u=new i[e](s,n);return a.revokeObjectURL(s),u}catch(r){return new i[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error("Inline worker is not supported");return new i[e](r,n)}}},4154:t=>{"use strict";t.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},1670:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e,n)=>{"use strict";n.r(e),n.d(e,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(n+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;t:for(e=0;e=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},r.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+e))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n=56320?i:(i<<10)+t.charCodeAt(n++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),n=0;for(var o=this.space,a=this.bb.bytes();n>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return i},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return __nested_webpack_require_546802__.d(e,{a:e}),e},__nested_webpack_require_546802__.d=(t,e)=>{for(var n in e)__nested_webpack_require_546802__.o(e,n)&&!__nested_webpack_require_546802__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__nested_webpack_require_546802__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__nested_webpack_require_546802__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_546802__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__nested_webpack_require_546802__(6018);return __webpack_exports__})())); -//# sourceMappingURL=ort-web.min.js.map - -/***/ }), - -/***/ "./src/backends/onnx.js": -/*!******************************!*\ - !*** ./src/backends/onnx.js ***! - \******************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let ONNX; - -// TODO support more execution providers (e.g., webgpu) -const executionProviders = ['wasm']; - -if (typeof process !== 'undefined') { - // Running in a node-like environment. - // Try to import onnxruntime-node, using onnxruntime-web as a fallback - try { - ONNX = __webpack_require__(Object(function webpackMissingModule() { var e = new Error("Cannot find module 'onnxruntime-node'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); - } catch (err) { - console.warn( - "Node.js environment detected, but `onnxruntime-node` was not found. " + - "Using `onnxruntime-web` as a fallback. We recommend installing `onnxruntime-node` " + - "as it generally improves performance (up to 5X)." - ) - - // Fix "ReferenceError: self is not defined" bug when running directly with node - // https://github.com/microsoft/onnxruntime/issues/13072 - // @ts-ignore - __webpack_require__.g.self = __webpack_require__.g; - - ONNX = __webpack_require__(/*! onnxruntime-web */ "./node_modules/onnxruntime-web/dist/ort-web.min.js"); - - // Disable spawning worker threads for testing. - // This is done by setting numThreads to 1 - // https://github.com/microsoft/onnxruntime/issues/10311 - ONNX.env.wasm.numThreads = 1; - } - - // Add `cpu` execution provider, with higher precedence that `wasm`. - executionProviders.unshift('cpu'); - -} else { - // Running in a browser-environment, so we just import `onnxruntime-web` - ONNX = __webpack_require__(/*! onnxruntime-web */ "./node_modules/onnxruntime-web/dist/ort-web.min.js"); -} - -module.exports = { - ONNX, - executionProviders, -} - - -/***/ }), - -/***/ "./src/env.js": -/*!********************!*\ - !*** ./src/env.js ***! - \********************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var __dirname = "/"; -const fs = __webpack_require__(/*! fs */ "?569f"); -const path = __webpack_require__(/*! path */ "?3f59"); - -const { env: onnx_env } = (__webpack_require__(/*! ./backends/onnx.js */ "./src/backends/onnx.js").ONNX); - -// check if various APIs are available (depends on environment) -const CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self; -const FS_AVAILABLE = !isEmpty(fs); // check if file system is available -const PATH_AVAILABLE = !isEmpty(path); // check if path is available - -const RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE; - -// set local model path, based on available APIs -const DEFAULT_LOCAL_PATH = '/models/onnx/quantized/'; -const localURL = RUNNING_LOCALLY - ? path.join(path.dirname(__dirname), DEFAULT_LOCAL_PATH) - : DEFAULT_LOCAL_PATH; - -// First, set path to wasm files. This is needed when running in a web worker. -// https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths -// We use remote wasm files by default to make it easier for newer users. -// In practice, users should probably self-host the necessary .wasm files. -onnx_env.wasm.wasmPaths = RUNNING_LOCALLY - ? path.join(path.dirname(__dirname), '/dist/') - : 'https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/'; - - -// Global variable used to control exection, with suitable defaults -const env = { - // access onnxruntime-web's environment variables - onnx: onnx_env, - - // whether to support loading models from the HuggingFace hub - remoteModels: true, - - // URL to load models from - remoteURL: 'https://huggingface.co/Xenova/transformers.js/resolve/main/quantized/', - - // Local URL to load models from. - localURL: localURL, - - // Whether to use Cache API to cache models. By default, it is true if available. - useCache: CACHE_AVAILABLE, - - // Whether to use the file system to load files. By default, it is true available. - useFS: FS_AVAILABLE, -} - - -/** - * @param {object} obj - */ -function isEmpty(obj) { - return Object.keys(obj).length === 0; -} - -module.exports = { - env -} - - -/***/ }), - -/***/ "./src/fft.js": -/*!********************!*\ - !*** ./src/fft.js ***! - \********************/ -/***/ ((module) => { - - -/** - * FFT class provides functionality for performing Fast Fourier Transform on arrays - * Code adapted from https://www.npmjs.com/package/fft.js - */ -class FFT { - /** - * @param {number} size - The size of the input array. Must be a power of two and bigger than 1. - * @throws {Error} FFT size must be a power of two and bigger than 1. - */ - constructor(size) { - this.size = size | 0; // convert to a 32-bit signed integer - if (this.size <= 1 || (this.size & (this.size - 1)) !== 0) - throw new Error('FFT size must be a power of two and bigger than 1'); - - this._csize = size << 1; - - this.table = new Float64Array(this.size * 2); - for (let i = 0; i < this.table.length; i += 2) { - const angle = Math.PI * i / this.size; - this.table[i] = Math.cos(angle); - this.table[i + 1] = -Math.sin(angle); - } - - // Find size's power of two - let power = 0; - for (let t = 1; this.size > t; t <<= 1) - ++power; - - // Calculate initial step's width: - // * If we are full radix-4 - it is 2x smaller to give inital len=8 - // * Otherwise it is the same as `power` to give len=4 - this._width = power % 2 === 0 ? power - 1 : power; - - // Pre-compute bit-reversal patterns - this._bitrev = new Int32Array(1 << this._width); - for (let j = 0; j < this._bitrev.length; ++j) { - this._bitrev[j] = 0; - for (let shift = 0; shift < this._width; shift += 2) { - const revShift = this._width - shift - 2; - this._bitrev[j] |= ((j >>> shift) & 3) << revShift; - } - } - } - - /** - * Create a complex number array with size `2 * size` - * - * @returns {Float64Array} - A complex number array with size `2 * size` - */ - createComplexArray() { - return new Float64Array(this._csize); - } - - /** - * Converts a complex number representation stored in a Float64Array to an array of real numbers. - * - * @param {Float64Array} complex - The complex number representation to be converted. - * @param {number[]} [storage] - An optional array to store the result in. - * @returns {number[]} An array of real numbers representing the input complex number representation. - */ - fromComplexArray(complex, storage) { - const res = storage || new Array(complex.length >>> 1); - for (let i = 0; i < complex.length; i += 2) - res[i >>> 1] = complex[i]; - return res; - } - - /** - * Convert a real-valued input array to a complex-valued output array. - * @param {Float64Array} input - The real-valued input array. - * @param {Float64Array} [storage] - Optional buffer to store the output array. - * @returns {Float64Array} The complex-valued output array. - */ - toComplexArray(input, storage) { - const res = storage || this.createComplexArray(); - for (let i = 0; i < res.length; i += 2) { - res[i] = input[i >>> 1]; - res[i + 1] = 0; - } - return res; - } - - /** - * Completes the spectrum by adding its mirrored negative frequency components. - * @param {Float64Array} spectrum - The input spectrum. - * @returns {void} - */ - completeSpectrum(spectrum) { - const size = this._csize; - const half = size >>> 1; - for (let i = 2; i < half; i += 2) { - spectrum[size - i] = spectrum[i]; - spectrum[size - i + 1] = -spectrum[i + 1]; - } - } - - /** - * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer. - * - * @param {Float64Array} out - The output buffer to store the result. - * @param {Float64Array} data - The input data to transform. - * - * @throws {Error} Input and output buffers must be different. - * - * @returns {void} - */ - transform(out, data) { - if (out === data) - throw new Error('Input and output buffers must be different'); - - this._transform4(out, data, 1 /* DONE */); - } - - /** - * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer. - * The input buffer must contain real values only, while the output buffer will contain complex values. The input and - * output buffers must be different. - * - * @param {Float64Array} out - The output buffer. - * @param {Float64Array} data - The input buffer containing real values. - * - * @throws {Error} If the input and output buffers are the same. - */ - realTransform(out, data) { - if (out === data) - throw new Error('Input and output buffers must be different'); - - this._realTransform4(out, data, 1 /* DONE */); - } - - /** - * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`. - * The `out` array must be a different buffer than the `data` array. The `out` array will contain the - * result of the transformation. The `data` array will not be modified. - * - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {Float64Array} data - The input data to transform. - * @throws {Error} If `out` and `data` refer to the same buffer. - * @returns {void} - */ - inverseTransform(out, data) { - if (out === data) - throw new Error('Input and output buffers must be different'); - - this._transform4(out, data, -1 /* DONE */); - for (let i = 0; i < out.length; ++i) - out[i] /= this.size; - } - - /** - * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data. - * - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {Float64Array} data - The input buffer of data to be transformed. - * @param {number} inv - A scaling factor to apply to the transform. - * @returns {void} - */ - _transform4(out, data, inv) { - // radix-4 implementation - - const size = this._csize; - - // Initial step (permute and transform) - const width = this._width; - let step = 1 << width; - let len = (size / step) << 1; - - let outOff; - let t; - let bitrev = this._bitrev; - if (len === 4) { - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; - this._singleTransform2(data, out, outOff, off, step); - } - } else { - // len === 8 - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; - this._singleTransform4(data, out, outOff, off, step, inv); - } - } - - // Loop through steps in decreasing order - for (step >>= 2; step >= 2; step >>= 2) { - len = (size / step) << 1; - let quarterLen = len >>> 2; - - // Loop through offsets in the data - for (outOff = 0; outOff < size; outOff += len) { - // Full case - let limit = outOff + quarterLen; - for (let i = outOff, k = 0; i < limit; i += 2, k += step) { - const A = i; - const B = A + quarterLen; - const C = B + quarterLen; - const D = C + quarterLen; - - // Original values - const Ar = out[A]; - const Ai = out[A + 1]; - const Br = out[B]; - const Bi = out[B + 1]; - const Cr = out[C]; - const Ci = out[C + 1]; - const Dr = out[D]; - const Di = out[D + 1]; - - const tableBr = this.table[k]; - const tableBi = inv * this.table[k + 1]; - const MBr = Br * tableBr - Bi * tableBi; - const MBi = Br * tableBi + Bi * tableBr; - - const tableCr = this.table[2 * k]; - const tableCi = inv * this.table[2 * k + 1]; - const MCr = Cr * tableCr - Ci * tableCi; - const MCi = Cr * tableCi + Ci * tableCr; - - const tableDr = this.table[3 * k]; - const tableDi = inv * this.table[3 * k + 1]; - const MDr = Dr * tableDr - Di * tableDi; - const MDi = Dr * tableDi + Di * tableDr; - - // Pre-Final values - const T0r = Ar + MCr; - const T0i = Ai + MCi; - const T1r = Ar - MCr; - const T1i = Ai - MCi; - const T2r = MBr + MDr; - const T2i = MBi + MDi; - const T3r = inv * (MBr - MDr); - const T3i = inv * (MBi - MDi); - - // Final values - out[A] = T0r + T2r; - out[A + 1] = T0i + T2i; - out[B] = T1r + T3i; - out[B + 1] = T1i - T3r; - out[C] = T0r - T2r; - out[C + 1] = T0i - T2i; - out[D] = T1r - T3i; - out[D + 1] = T1i + T3r; - } - } - } - } - - /** - * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data. - * - * @param {Float64Array} data - The input buffer of data to be transformed. - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {number} outOff - The offset at which to write the output data. - * @param {number} off - The offset at which to begin reading the input data. - * @param {number} step - The step size for indexing the input data. - * @returns {void} - */ - _singleTransform2(data, out, outOff, off, step) { - // radix-2 implementation - // NOTE: Only called for len=4 - - const evenR = data[off]; - const evenI = data[off + 1]; - const oddR = data[off + step]; - const oddI = data[off + step + 1]; - - out[outOff] = evenR + oddR; - out[outOff + 1] = evenI + oddI; - out[outOff + 2] = evenR - oddR; - out[outOff + 3] = evenI - oddI; - } - - /** - * Performs radix-4 transformation on input data of length 8 - * - * @param {Float64Array} data - Input data array of length 8 - * @param {Float64Array} out - Output data array of length 8 - * @param {number} outOff - Index of output array to start writing from - * @param {number} off - Index of input array to start reading from - * @param {number} step - Step size between elements in input array - * @param {number} inv - Scaling factor for inverse transform - * - * @returns {void} - */ - _singleTransform4(data, out, outOff, off, step, inv) { - // radix-4 - // NOTE: Only called for len=8 - const step2 = step * 2; - const step3 = step * 3; - - // Original values - const Ar = data[off]; - const Ai = data[off + 1]; - const Br = data[off + step]; - const Bi = data[off + step + 1]; - const Cr = data[off + step2]; - const Ci = data[off + step2 + 1]; - const Dr = data[off + step3]; - const Di = data[off + step3 + 1]; - - // Pre-Final values - const T0r = Ar + Cr; - const T0i = Ai + Ci; - const T1r = Ar - Cr; - const T1i = Ai - Ci; - const T2r = Br + Dr; - const T2i = Bi + Di; - const T3r = inv * (Br - Dr); - const T3i = inv * (Bi - Di); - - // Final values - out[outOff] = T0r + T2r; - out[outOff + 1] = T0i + T2i; - out[outOff + 2] = T1r + T3i; - out[outOff + 3] = T1i - T3r; - out[outOff + 4] = T0r - T2r; - out[outOff + 5] = T0i - T2i; - out[outOff + 6] = T1r - T3i; - out[outOff + 7] = T1i + T3r; - } - - /** - * Real input radix-4 implementation - * @param {Float64Array} out - Output array for the transformed data - * @param {Float64Array} data - Input array of real data to be transformed - * @param {number} inv - The scale factor used to normalize the inverse transform - */ - _realTransform4(out, data, inv) { - // Real input radix-4 implementation - const size = this._csize; - - // Initial step (permute and transform) - const width = this._width; - let step = 1 << width; - let len = (size / step) << 1; - - var outOff; - var t; - var bitrev = this._bitrev; - if (len === 4) { - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; - this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1); - } - } else { - // len === 8 - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; - this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv); - } - } - - // Loop through steps in decreasing order - for (step >>= 2; step >= 2; step >>= 2) { - len = (size / step) << 1; - const halfLen = len >>> 1; - const quarterLen = halfLen >>> 1; - const hquarterLen = quarterLen >>> 1; - - // Loop through offsets in the data - for (outOff = 0; outOff < size; outOff += len) { - for (let i = 0, k = 0; i <= hquarterLen; i += 2, k += step) { - const A = outOff + i; - const B = A + quarterLen; - const C = B + quarterLen; - const D = C + quarterLen; - - // Original values - const Ar = out[A]; - const Ai = out[A + 1]; - const Br = out[B]; - const Bi = out[B + 1]; - const Cr = out[C]; - const Ci = out[C + 1]; - const Dr = out[D]; - const Di = out[D + 1]; - - const tableBr = this.table[k]; - const tableBi = inv * this.table[k + 1]; - const MBr = Br * tableBr - Bi * tableBi; - const MBi = Br * tableBi + Bi * tableBr; - - const tableCr = this.table[2 * k]; - const tableCi = inv * this.table[2 * k + 1]; - const MCr = Cr * tableCr - Ci * tableCi; - const MCi = Cr * tableCi + Ci * tableCr; - - const tableDr = this.table[3 * k]; - const tableDi = inv * this.table[3 * k + 1]; - const MDr = Dr * tableDr - Di * tableDi; - const MDi = Dr * tableDi + Di * tableDr; - - // Pre-Final values - const T0r = Ar + MCr; - const T0i = Ai + MCi; - const T1r = Ar - MCr; - const T1i = Ai - MCi; - const T2r = MBr + MDr; - const T2i = MBi + MDi; - const T3r = inv * (MBr - MDr); - const T3i = inv * (MBi - MDi); - - // Final values - out[A] = T0r + T2r; - out[A + 1] = T0i + T2i; - out[B] = T1r + T3i; - out[B + 1] = T1i - T3r; - - // Output final middle point - if (i === 0) { - out[C] = T0r - T2r; - out[C + 1] = T0i - T2i; - continue; - } - - // Do not overwrite ourselves - if (i === hquarterLen) - continue; - - const SA = outOff + quarterLen - i; - const SB = outOff + halfLen - i; - - out[SA] = T1r + -inv * T3i; - out[SA + 1] = -T1i - inv * T3r; - out[SB] = T0r + -inv * T2r; - out[SB + 1] = -T0i + inv * T2i; - } - } - } - } - - /** - * Performs a single real input radix-2 transformation on the provided data - * - * @param {Float64Array} data - The input data array - * @param {Float64Array} out - The output data array - * @param {number} outOff - The output offset - * @param {number} off - The input offset - * @param {number} step - The step - * - * @returns {void} - */ - _singleRealTransform2(data, out, outOff, off, step) { - // radix-2 implementation - // NOTE: Only called for len=4 - - const evenR = data[off]; - const oddR = data[off + step]; - - out[outOff] = evenR + oddR; - out[outOff + 1] = 0; - out[outOff + 2] = evenR - oddR; - out[outOff + 3] = 0; - } - - /** - * Computes a single real-valued transform using radix-4 algorithm. - * This method is only called for len=8. - * - * @param {Float64Array} data - The input data array. - * @param {Float64Array} out - The output data array. - * @param {number} outOff - The offset into the output array. - * @param {number} off - The offset into the input array. - * @param {number} step - The step size for the input array. - * @param {number} inv - The value of inverse. - */ - _singleRealTransform4(data, out, outOff, off, step, inv) { - // radix-4 - // NOTE: Only called for len=8 - const step2 = step * 2; - const step3 = step * 3; - - // Original values - const Ar = data[off]; - const Br = data[off + step]; - const Cr = data[off + step2]; - const Dr = data[off + step3]; - - // Pre-Final values - const T0r = Ar + Cr; - const T1r = Ar - Cr; - const T2r = Br + Dr; - const T3r = inv * (Br - Dr); - - // Final values - out[outOff] = T0r + T2r; - out[outOff + 1] = 0; - out[outOff + 2] = T1r; - out[outOff + 3] = -T3r; - out[outOff + 4] = T0r - T2r; - out[outOff + 5] = 0; - out[outOff + 6] = T1r; - out[outOff + 7] = T3r; - } -} - -module.exports = FFT - - -/***/ }), - -/***/ "./src/generation.js": -/*!***************************!*\ - !*** ./src/generation.js ***! - \***************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { Tensor } = __webpack_require__(/*! ./tensor_utils.js */ "./src/tensor_utils.js"); -const { - Callable, - exists, - log_softmax -} = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); - -/** - * A class representing a list of logits processors. A logits processor is a function that modifies the logits - * output of a language model. This class provides methods for adding new processors and applying all processors to a - * batch of logits. - * - * @extends Callable - */ -class LogitsProcessorList extends Callable { - /** - * Constructs a new instance of `LogitsProcessorList`. - */ - constructor() { - super(); - this.processors = []; - } - - /** - * Adds a new logits processor to the list. - * - * @param {function} item - The logits processor function to add. - */ - push(item) { - this.processors.push(item); - } - - /** - * Adds multiple logits processors to the list. - * - * @param {function[]} items - The logits processor functions to add. - */ - extend(items) { - this.processors.push(...items); - } - - /** - * Applies all logits processors in the list to a batch of logits, modifying them in-place. - * - * @param {number[]} input_ids - The input IDs for the language model. - * @param {number[][]} batchedLogits - A 2D array of logits, where each row corresponds to a single - * input sequence in the batch. - */ - _call(input_ids, batchedLogits) { - // NOTE: This is different from the Python code, since vanilla JS does not support vectorized operations. - // As a result, we apply each processor to each item in the batch. - for (let logits of batchedLogits) { - // Modifies logits inplace - this.processors.forEach( - func => func(input_ids, logits) - ) - } - } - - [Symbol.iterator]() { - return this.processors.values(); - } -} - -/** - * Base class for processing logits. - * @extends Callable - */ -class LogitsProcessor extends Callable { - /** - * Apply the processor to the input logits. - * - * @abstract - * @param {Array} input_ids The input ids. - * @param {Tensor} logits The logits to process. - * @throws {Error} Throws an error if `_call` is not implemented in the subclass. - */ - _call(input_ids, logits) { - throw Error("`_call` should be implemented in a subclass") - } -} - -/** - * A logits processor that forces a specific token to be generated by the decoder. - * - * @extends LogitsProcessor - */ -class ForceTokensLogitsProcessor extends LogitsProcessor { - /** - * Constructs a new instance of `ForceTokensLogitsProcessor`. - * - * @param {Array} forced_decoder_ids The ids of tokens that should be forced. - */ - constructor(forced_decoder_ids) { - super(); - this.force_token_map = Object.fromEntries(forced_decoder_ids ?? []); - } - - /** - * Apply the processor to the input logits. - * - * @param {Array} input_ids The input ids. - * @param {any} logits The logits to process. - * @returns {Array} The processed logits. - */ - _call(input_ids, logits) { - let map = this.force_token_map[input_ids.length]; - if (exists(map)) { // There exists a mapping - logits.data.fill(-Infinity) - logits.data[map] = 0; - } - return logits; - } -} - -/** - * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence. - * @extends LogitsProcessor - */ -class ForcedBOSTokenLogitsProcessor extends LogitsProcessor { - /** - * Create a ForcedBOSTokenLogitsProcessor. - * @param {number} bos_token_id - The ID of the beginning-of-sequence token to be forced. - */ - constructor(bos_token_id) { - super(); - this.bos_token_id = bos_token_id; - } - - /** - * Apply the BOS token forcing to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with BOS token forcing. - */ - _call(input_ids, logits) { - if (input_ids.length === 1) { - logits.data.fill(-Infinity) - logits.data[this.bos_token_id] = 0; - } - } -} - -/** - * A logits processor that forces end-of-sequence token probability to 1. - * - * @extends LogitsProcessor - */ -class ForcedEOSTokenLogitsProcessor extends LogitsProcessor { - /** - * Create a ForcedEOSTokenLogitsProcessor. - * @param {number} max_length - Max length of the sequence. - * @param {number} forced_eos_token_id - The ID of the end-of-sequence token to be forced. - */ - constructor(max_length, forced_eos_token_id) { - super(); - this.max_length = max_length; - this.forced_eos_token_id = forced_eos_token_id; - } - - /** - * Apply the processor to input_ids and logits. - * - * @param {number[]} input_ids - The input ids. - * @param {any} logits - The logits tensor. - */ - _call(input_ids, logits) { - // console.log('call ForcedEOSTokenLogitsProcessor') - // TODO - } -} - -/** - * A LogitsProcessor that handles adding timestamps to generated text. - * @extends LogitsProcessor - */ -class WhisperTimeStampLogitsProcessor extends LogitsProcessor { - /** - * Constructs a new WhisperTimeStampLogitsProcessor. - * @param {object} generate_config - The config object passed to the `generate()` method of a transformer model. - * @param {number} generate_config.eos_token_id - The ID of the end-of-sequence token. - * @param {number} generate_config.no_timestamps_token_id - The ID of the token used to indicate that a token should not have a timestamp. - * @param {number[][]} [generate_config.forced_decoder_ids] - An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp. - * @param {number} [generate_config.max_initial_timestamp_index] - The maximum index at which an initial timestamp can appear. - */ - constructor(generate_config) { - super(); - this.eos_token_id = generate_config.eos_token_id; - this.no_timestamps_token_id = generate_config.no_timestamps_token_id; - this.timestamp_begin = this.no_timestamps_token_id + 1; - - this.begin_index = (generate_config.forced_decoder_ids || []).length + 2; - if (generate_config.forced_decoder_ids.slice(-1)[0][1] === this.no_timestamps_token_id) { - this.begin_index -= 1; - } - this.max_initial_timestamp_index = generate_config.max_initial_timestamp_index; - - } - - /** - * Modify the logits to handle timestamp tokens. - * @param {Array} input_ids - The input sequence of tokens. - * @param {Tensor} logits - The logits output by the model. - * @returns {Tensor} - The modified logits. - */ - _call(input_ids, logits) { - // suppress <|notimestamps|> which is handled by without_timestamps - logits.data[this.no_timestamps_token_id] = -Infinity; - - if (input_ids.length === this.begin_index - 1) { - logits.data.fill(-Infinity); - logits.data[this.timestamp_begin] = 0; - return logits; - } - - // timestamps have to appear in pairs, except directly before eos_token; mask logits accordingly - const seq = input_ids.slice(this.begin_index); - const last_was_timestamp = seq.length >= 1 && seq[seq.length - 1] >= this.timestamp_begin; - const penultimate_was_timestamp = seq.length < 2 || seq[seq.length - 2] >= this.timestamp_begin; - - if (last_was_timestamp) { - if (penultimate_was_timestamp) { // has to be non-timestamp - logits.data.subarray(this.timestamp_begin).fill(-Infinity); - } else { // cannot be normal text tokens - logits.data.subarray(0, this.eos_token_id).fill(-Infinity); - } - } - - // apply the `max_initial_timestamp` option - if (input_ids.length === this.begin_index && this.max_initial_timestamp_index !== null) { - const last_allowed = this.timestamp_begin + this.max_initial_timestamp_index; - logits.data.subarray(last_allowed + 1).fill(-Infinity); - } - - // if sum of probability over timestamps is above any other token, sample timestamp - const logprobs = log_softmax(logits.data); - const timestamp_logprob = Math.log(logprobs.subarray(this.timestamp_begin).map(Math.exp).reduce((a, b) => a + b)); - const max_text_token_logprob = Math.max(...logprobs.subarray(0, this.timestamp_begin)); - if (timestamp_logprob > max_text_token_logprob) { - logits.data.subarray(0, this.timestamp_begin).fill(-Infinity); - } - - return logits; - } -} - -/** - * A logits processor that disallows ngrams of a certain size to be repeated. - * - * @extends LogitsProcessor - */ -class NoRepeatNGramLogitsProcessor extends LogitsProcessor { - /** - * Create a NoRepeatNGramLogitsProcessor. - * @param {number} no_repeat_ngram_size - The no-repeat-ngram size. All ngrams of this size can only occur once. - */ - constructor(no_repeat_ngram_size) { - super(); - this.no_repeat_ngram_size = no_repeat_ngram_size; - } - - /** - * Generate n-grams from a sequence of token ids. - * @param {number[]} prevInputIds - List of previous input ids - * @returns {Map} - Map of generated n-grams - */ - getNgrams(prevInputIds) { - const curLen = prevInputIds.length; - - /**@type {number[][]} */ - const ngrams = []; - for (let j = 0; j < curLen + 1 - this.no_repeat_ngram_size; ++j) { - const ngram = []; - for (let k = 0; k < this.no_repeat_ngram_size; ++k) { - ngram.push(prevInputIds[j + k]); - } - ngrams.push(ngram); - } - - /** @type {Map} */ - const generatedNgram = new Map(); - for (const ngram of ngrams) { - const prevNgram = ngram.slice(0, ngram.length - 1); - const prevNgramKey = JSON.stringify(prevNgram); - const prevNgramValue = generatedNgram.get(prevNgramKey) ?? []; - prevNgramValue.push(ngram[ngram.length - 1]); - generatedNgram.set(prevNgramKey, prevNgramValue); - } - return generatedNgram; - } - - /** - * Generate n-grams from a sequence of token ids. - * @param {Map} bannedNgrams - Map of banned n-grams - * @param {number[]} prevInputIds - List of previous input ids - * @returns {number[]} - Map of generated n-grams - */ - getGeneratedNgrams(bannedNgrams, prevInputIds) { - const ngramIdx = prevInputIds.slice(prevInputIds.length + 1 - this.no_repeat_ngram_size, prevInputIds.length); - const banned = bannedNgrams.get(JSON.stringify(ngramIdx)) ?? []; - return banned; - } - - /** - * Calculate banned n-gram tokens - * @param {number[]} prevInputIds - List of previous input ids - * @returns {number[]} - Map of generated n-grams - */ - calcBannedNgramTokens(prevInputIds) { - const bannedTokens = []; - if (prevInputIds.length + 1 < this.no_repeat_ngram_size) { - // return no banned tokens if we haven't generated no_repeat_ngram_size tokens yet - return bannedTokens; - - } else { - const generatedNgrams = this.getNgrams(prevInputIds); - const bannedTokens = this.getGeneratedNgrams(generatedNgrams, prevInputIds); - return bannedTokens; - } - } - - /** - * Apply the no-repeat-ngram processor to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with no-repeat-ngram processing. - */ - _call(input_ids, logits) { - const bannedTokens = this.calcBannedNgramTokens(input_ids); - - for (const token of bannedTokens) { - logits.data[token] = -Infinity; - } - return logits; - } -} - -/** - * A logits processor that penalises repeated output tokens. - * - * @extends LogitsProcessor - */ -class RepetitionPenaltyLogitsProcessor extends LogitsProcessor { - /** - * Create a RepetitionPenaltyLogitsProcessor. - * @param {number} penalty - The penalty to apply for repeated tokens. - */ - constructor(penalty) { - super(); - this.penalty = penalty; - } - - /** - * Apply the repetition penalty to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with repetition penalty processing. - */ - _call(input_ids, logits) { - // Modify the logits corresponding to each element in `input_ids`. - // As a consequence, the logits corresponding to tokens that appear - // many times in the output will be penalised more. - for (const input_id of input_ids) { - if (logits.data[input_id] < 0) { - logits.data[input_id] *= this.penalty; - } else { - logits.data[input_id] /= this.penalty; - } - } - return logits - } -} - - -class GenerationConfig { - constructor(kwargs = {}) { - // Parameters that control the length of the output - // TODO: extend the configuration with correct types - /** - * Create a GenerationConfig object - * @constructor - * @param {Object} [kwargs={}] - The configuration parameters - * @param {number} [kwargs.max_length=20] - The maximum length of the generated text - * @param {number} [kwargs.max_new_tokens=null] - The maximum number of new tokens to generate - * @param {number} [kwargs.min_length=0] - The minimum length of the generated text - * @param {number} [kwargs.min_new_tokens=null] - The minimum number of new tokens to generate - * @param {boolean} [kwargs.early_stopping=false] - Whether to stop generation early if a stop token is encountered - * @param {number} [kwargs.max_time=null] - The maximum amount of time to spend generating text - * @param {boolean} [kwargs.do_sample=false] - Whether to use sampling when generating text - * @param {number} [kwargs.num_beams=1] - The number of beams to use when generating text - * @param {number} [kwargs.num_beam_groups=1] - The number of beam groups to use when generating text - * @param {number} [kwargs.penalty_alpha=null] - The value of the alpha penalty to use when generating text - * @param {boolean} [kwargs.use_cache=true] - Whether to use cache when generating text - * @param {number} [kwargs.temperature=1.0] - The temperature to use when generating text - * @param {number} [kwargs.top_k=50] - The value of k to use when generating text - * @param {number} [kwargs.top_p=1.0] - The value of p to use when generating text - * @param {number} [kwargs.typical_p=1.0] - The typical value of p to use when generating text - * @param {number} [kwargs.epsilon_cutoff=0.0] - The value of epsilon cutoff to use when generating text - * @param {number} [kwargs.eta_cutoff=0.0] - The value of eta cutoff to use when generating text - * @param {number} [kwargs.diversity_penalty=0.0] - The value of diversity penalty to use when generating text - * @param {number} [kwargs.repetition_penalty=1.0] - The value of repetition penalty to use when generating text - * @param {number} [kwargs.encoder_repetition_penalty=1.0] - The value of encoder repetition penalty to use when generating text - * @param {number} [kwargs.length_penalty=1.0] - The value of length - * @param {number} [kwargs.no_repeat_ngram_size=0] - The size of the n-grams to avoid repeating in the generated output. - * @param {?number[]} [kwargs.bad_words_ids=null] - An array of IDs representing tokens that should not be generated. - * @param {?number[]} [kwargs.force_words_ids=null] - An array of IDs representing tokens that must be generated. - * @param {boolean} [kwargs.renormalize_logits=false] - Whether or not to renormalize the logits before generating new tokens. - * @param {?Object[]} [kwargs.constraints=null] - An array of constraint objects to apply during generation. - */ - this.max_length = kwargs.max_length ?? 20; - this.max_new_tokens = kwargs.max_new_tokens ?? null; - this.min_length = kwargs.min_length ?? 0; - this.min_new_tokens = kwargs.min_new_tokens ?? null; - this.early_stopping = kwargs.early_stopping ?? false; - this.max_time = kwargs.max_time ?? null; - - // Parameters that control the generation strategy used - this.do_sample = kwargs.do_sample ?? false; - this.num_beams = kwargs.num_beams ?? 1; - this.num_beam_groups = kwargs.num_beam_groups ?? 1; - this.penalty_alpha = kwargs.penalty_alpha ?? null; - this.use_cache = kwargs.use_cache ?? true; - - // Parameters for manipulation of the model output logits - this.temperature = kwargs.temperature ?? 1.0; - this.top_k = kwargs.top_k ?? 50; - this.top_p = kwargs.top_p ?? 1.0; - this.typical_p = kwargs.typical_p ?? 1.0; - this.epsilon_cutoff = kwargs.epsilon_cutoff ?? 0.0; - this.eta_cutoff = kwargs.eta_cutoff ?? 0.0; - this.diversity_penalty = kwargs.diversity_penalty ?? 0.0; - this.repetition_penalty = kwargs.repetition_penalty ?? 1.0; - this.encoder_repetition_penalty = kwargs.encoder_repetition_penalty ?? 1.0; - this.length_penalty = kwargs.length_penalty ?? 1.0; - this.no_repeat_ngram_size = kwargs.no_repeat_ngram_size ?? 0; - this.bad_words_ids = kwargs.bad_words_ids ?? null; - this.force_words_ids = kwargs.force_words_ids ?? null; - this.renormalize_logits = kwargs.renormalize_logits ?? false; - this.constraints = kwargs.constraints ?? null; - this.forced_bos_token_id = kwargs.forced_bos_token_id ?? null; - this.forced_eos_token_id = kwargs.forced_eos_token_id ?? null; - this.remove_invalid_values = kwargs.remove_invalid_values ?? false; - this.exponential_decay_length_penalty = kwargs.exponential_decay_length_penalty ?? null; - this.suppress_tokens = kwargs.suppress_tokens ?? null; - this.begin_suppress_tokens = kwargs.begin_suppress_tokens ?? null; - this.forced_decoder_ids = kwargs.forced_decoder_ids ?? null; - - // Parameters that define the output variables of `generate` - this.num_return_sequences = kwargs.num_return_sequences ?? 1; - this.output_attentions = kwargs.output_attentions ?? false; - this.output_hidden_states = kwargs.output_hidden_states ?? false; - this.output_scores = kwargs.output_scores ?? false; - this.return_dict_in_generate = kwargs.return_dict_in_generate ?? false; - - // Special tokens that can be used at generation time - this.pad_token_id = kwargs.pad_token_id ?? null; - this.bos_token_id = kwargs.bos_token_id ?? null; - this.eos_token_id = kwargs.eos_token_id ?? null; - - // Generation parameters exclusive to encoder-decoder models - this.encoder_no_repeat_ngram_size = kwargs.encoder_no_repeat_ngram_size ?? 0; - this.decoder_start_token_id = kwargs.decoder_start_token_id ?? null; - - // Wild card - this.generation_kwargs = kwargs.generation_kwargs ?? {}; - } -} - -module.exports = { - LogitsProcessor, - LogitsProcessorList, - GenerationConfig, - ForcedBOSTokenLogitsProcessor, - ForcedEOSTokenLogitsProcessor, - WhisperTimeStampLogitsProcessor, - ForceTokensLogitsProcessor, - NoRepeatNGramLogitsProcessor, - RepetitionPenaltyLogitsProcessor -}; - - -/***/ }), - -/***/ "./src/image_utils.js": -/*!****************************!*\ - !*** ./src/image_utils.js ***! - \****************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -const fs = __webpack_require__(/*! fs */ "?569f"); -const { getFile, isString } = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); -const { env } = __webpack_require__(/*! ./env.js */ "./src/env.js"); - -// Will be empty (or not used) if running in browser or web-worker -const sharp = __webpack_require__(/*! sharp */ "?36f4"); - -let CanvasClass; -let ImageDataClass; -let loadImageFunction; -if (typeof self !== 'undefined') { - // Running in browser or web-worker - CanvasClass = OffscreenCanvas; - loadImageFunction = self.createImageBitmap; - ImageDataClass = ImageData; - -} else if (sharp) { - // Running in Node.js, electron, or other non-browser environment - - loadImageFunction = async (/**@type {sharp.Sharp}*/img) => { - let { data, info } = await img.raw().toBuffer({ resolveWithObject: true }); - return new CustomImage(new Uint8ClampedArray(data), info.width, info.height, info.channels); - } - -} else { - throw new Error('Unable to load image processing library.'); -} - - -class CustomImage { - - /** - * Create a new CustomImage object. - * @param {Uint8ClampedArray} data - The pixel data. - * @param {number} width - The width of the image. - * @param {number} height - The height of the image. - * @param {1|2|3|4} channels - The number of channels. - */ - constructor(data, width, height, channels) { - this._update(data, width, height, channels); - } - - /** - * Helper method for reading an image from a variety of input types. - * @param {CustomImage|string|URL} input - * @returns The image object. - */ - static async read(input) { - if (input instanceof CustomImage) { - return input; - } else if (isString(input) || input instanceof URL) { - return await this.fromURL(input); - } else { - throw new Error(`Unsupported input type: ${typeof input}`); - } - } - - - /** - * Read an image from a URL or file path. - * @param {string|URL} url - The URL or file path to read the image from. - * @returns {Promise} - The image object. - */ - static async fromURL(url) { - let response = await getFile(url); - let blob = await response.blob(); - return this.fromBlob(blob); - } - - /** - * Helper method to create a new Image from a blob. - * @param {Blob} blob - The blob to read the image from. - * @returns {Promise} - The image object. - */ - static async fromBlob(blob) { - if (CanvasClass) { - // Running in environment with canvas - let img = await loadImageFunction(blob); - - const ctx = new CanvasClass(img.width, img.height).getContext('2d'); - - // Draw image to context - ctx.drawImage(img, 0, 0); - - return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4); - - } else { - // Use sharp.js to read (and possible resize) the image. - let img = sharp(await blob.arrayBuffer()); - - return await loadImageFunction(img); - } - } - - /** - * Convert the image to grayscale format. - * @returns {CustomImage} - `this` to support chaining. - */ - grayscale() { - if (this.channels === 1) { - return this; - } - - let newData = new Uint8ClampedArray(this.width * this.height * 3); - switch (this.channels) { - case 3: // rgb to grayscale - case 4: // rgba to grayscale - for (let i = 0, offset = 0; i < this.data.length; i += this.channels) { - const red = this.data[i]; - const green = this.data[i + 1]; - const blue = this.data[i + 2]; - - newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue); - } - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - return this._update(newData, this.width, this.height, 1); - } - - /** - * Convert the image to RGB format. - * @returns {CustomImage} - `this` to support chaining. - */ - rgb() { - if (this.channels === 3) { - return this; - } - - let newData = new Uint8ClampedArray(this.width * this.height * 3); - - switch (this.channels) { - case 1: // grayscale to rgb - for (let i = 0, offset = 0; i < this.data.length; ++i) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - } - break; - case 4: // rgba to rgb - for (let i = 0, offset = 0; i < this.data.length; i += 4) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i + 1]; - newData[offset++] = this.data[i + 2]; - } - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - return this._update(newData, this.width, this.height, 3); - - } - - /** - * Convert the image to RGBA format. - * @returns {CustomImage} - `this` to support chaining. - */ - rgba() { - if (this.channels === 4) { - return this; - } - - let newData = new Uint8ClampedArray(this.width * this.height * 4); - - switch (this.channels) { - case 1: // grayscale to rgba - for (let i = 0, offset = 0; i < this.data.length; ++i) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - newData[offset++] = 255; - } - break; - case 3: // rgb to rgba - for (let i = 0, offset = 0; i < this.data.length; i += 3) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i + 1]; - newData[offset++] = this.data[i + 2]; - newData[offset++] = 255; - } - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - - return this._update(newData, this.width, this.height, 4); - } - - /** - * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing. - * @param {number} width - The width of the new image. - * @param {number} height - The height of the new image. - * @returns {Promise} - `this` to support chaining. - */ - async resize(width, height) { - if (CanvasClass) { - // Store number of channels before resizing - let numChannels = this.channels; - - // Create canvas object for this image - let canvas = this.toCanvas(); - - // Actually perform resizing using the canvas API - const ctx = new CanvasClass(width, height).getContext('2d'); - - // Draw image to context, resizing in the process - ctx.drawImage(canvas, 0, 0, width, height); - - // Create image from the resized data - let resizedImage = new CustomImage(ctx.getImageData(0, 0, width, height).data, width, height, 4); - - // Convert back so that image has the same number of channels as before - return resizedImage.convert(numChannels); - - } else { - // Create sharp image from raw data, and resize - let img = sharp(this.data, { - raw: { - width: this.width, - height: this.height, - channels: this.channels - } - }).resize({ - // https://github.com/lovell/sharp/blob/main/docs/api-resize.md - width, height, - fit: 'fill', - kernel: 'cubic' - }); - return await loadImageFunction(img); - } - - } - - toCanvas() { - // Clone, and convert data to RGBA before drawing to canvas. - // This is because the canvas API only supports RGBA - let cloned = this.clone().rgba(); - - // Create canvas object for the cloned image - let clonedCanvas = new CanvasClass(cloned.width, cloned.height); - - // Draw image to context - let data = new ImageDataClass(cloned.data, cloned.width, cloned.height); - clonedCanvas.getContext('2d').putImageData(data, 0, 0); - - return clonedCanvas; - } - - /** - * Helper method to update the image data. - * @param {Uint8ClampedArray} data - The new image data. - * @param {number} width - The new width of the image. - * @param {number} height - The new height of the image. - * @param {1|2|3|4} channels - The new number of channels of the image. - */ - _update(data, width, height, channels = null) { - this.data = data; - this.width = width; - this.height = height; - if (channels !== null) { - this.channels = channels; - } - return this; - } - - /** - * Clone the image - * @returns {CustomImage} - The cloned image - */ - clone() { - return new CustomImage(this.data.slice(), this.width, this.height, this.channels); - } - - /** - * Helper method for converting image to have a certain number of channels - * @param {number} numChannels - The number of channels. Must be 1, 3, or 4. - * @returns {CustomImage} - `this` to support chaining. - */ - convert(numChannels) { - if (this.channels === numChannels) return this; // Already correct number of channels - - switch (numChannels) { - case 1: - this.grayscale(); - break; - case 3: - this.rgb(); - break; - case 4: - this.rgba(); - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - return this; - } - - /** - * Save the image to the given path. This method is only available in environments with access to the FileSystem. - * @param {string|Buffer|URL} path - The path to save the image to. - * @param {string} [mime='image/png'] - The mime type of the image. - */ - save(path, mime = 'image/png') { - if (!env.useFS) { - throw new Error('Unable to save the image because filesystem is disabled in this environment.') - } - - let canvas = this.toCanvas(); - const buffer = canvas.toBuffer(mime); - fs.writeFileSync(path, buffer); - } -} - -module.exports = { - CustomImage, -}; - - -/***/ }), - -/***/ "./src/math_utils.js": -/*!***************************!*\ - !*** ./src/math_utils.js ***! - \***************************/ -/***/ ((module) => { - - -/** - * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray - * @typedef {BigInt64Array | BigUint64Array} BigTypedArray - * @typedef {TypedArray | BigTypedArray} AnyTypedArray - */ - -/** - * @param {TypedArray} input - */ -function interpolate(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) { - // TODO use mode and align_corners - - // Output image dimensions - const x_scale = out_width / in_width; - const y_scale = out_height / in_height; - - // Output image - // @ts-ignore - const out_img = new input.constructor(out_height * out_width * in_channels); - - // Pre-calculate strides - const inStride = in_height * in_width; - const outStride = out_height * out_width; - - for (let i = 0; i < out_height; ++i) { - for (let j = 0; j < out_width; ++j) { - // Calculate output offset - const outOffset = i * out_width + j; - - // Calculate input pixel coordinates - const x = (j + 0.5) / x_scale - 0.5; - const y = (i + 0.5) / y_scale - 0.5; - - // Calculate the four nearest input pixels - // We also check if the input pixel coordinates are within the image bounds - let x1 = Math.floor(x); - let y1 = Math.floor(y); - const x2 = Math.min(x1 + 1, in_width - 1); - const y2 = Math.min(y1 + 1, in_height - 1); - - x1 = Math.max(x1, 0); - y1 = Math.max(y1, 0); - - - // Calculate the fractional distances between the input pixel and the four nearest pixels - const s = x - x1; - const t = y - y1; - - // Perform bilinear interpolation - const w1 = (1 - s) * (1 - t); - const w2 = s * (1 - t); - const w3 = (1 - s) * t; - const w4 = s * t; - - // Calculate the four nearest input pixel indices - const yStride = y1 * in_width; - const xStride = y2 * in_width; - const idx1 = yStride + x1; - const idx2 = yStride + x2; - const idx3 = xStride + x1; - const idx4 = xStride + x2; - - for (let k = 0; k < in_channels; ++k) { - // Calculate channel offset - const cOffset = k * inStride; - - out_img[k * outStride + outOffset] = - w1 * input[cOffset + idx1] + - w2 * input[cOffset + idx2] + - w3 * input[cOffset + idx3] + - w4 * input[cOffset + idx4]; - } - } - } - - return out_img; -} - - -/** - * Helper method to transpose a AnyTypedArray directly - * @param {T} array - * @template {AnyTypedArray} T - * @param {number[]} dims - * @param {number[]} axes - * @returns {[T, number[]]} The transposed array and the new shape. - */ -function transpose_data(array, dims, axes) { - // Calculate the new shape of the transposed array - // and the stride of the original array - const shape = new Array(axes.length); - const stride = new Array(axes.length); - - for (let i = axes.length - 1, s = 1; i >= 0; --i) { - stride[i] = s; - shape[i] = dims[axes[i]]; - s *= shape[i]; - } - - // Precompute inverse mapping of stride - const invStride = axes.map((_, i) => stride[axes.indexOf(i)]); - - // Create the transposed array with the new shape - // @ts-ignore - const transposedData = new array.constructor(array.length); - - // Transpose the original array to the new array - for (let i = 0; i < array.length; ++i) { - let newIndex = 0; - for (let j = dims.length - 1, k = i; j >= 0; --j) { - newIndex += (k % dims[j]) * invStride[j]; - k = Math.floor(k / dims[j]); - } - transposedData[newIndex] = array[i]; - } - - return [transposedData, shape]; -} - -module.exports = { - interpolate, - transpose: transpose_data, -} - - -/***/ }), - -/***/ "./src/models.js": -/*!***********************!*\ - !*** ./src/models.js ***! - \***********************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { - Callable, - getModelFile, - fetchJSON, - dispatchCallback, - isIntegralNumber, -} = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); - -const { - Sampler, -} = __webpack_require__(/*! ./samplers.js */ "./src/samplers.js"); - - -const { - LogitsProcessorList, - GenerationConfig, - ForceTokensLogitsProcessor, - ForcedBOSTokenLogitsProcessor, - ForcedEOSTokenLogitsProcessor, - WhisperTimeStampLogitsProcessor, - NoRepeatNGramLogitsProcessor, - RepetitionPenaltyLogitsProcessor -} = __webpack_require__(/*! ./generation.js */ "./src/generation.js"); - -const { executionProviders, ONNX } = __webpack_require__(/*! ./backends/onnx.js */ "./src/backends/onnx.js"); -const { - Tensor, - cat -} = __webpack_require__(/*! ./tensor_utils */ "./src/tensor_utils.js"); -const { InferenceSession, Tensor: ONNXTensor } = ONNX; - -////////////////////////////////////////////////// -// Helper functions -/** - * Constructs an InferenceSession using a model file located at the specified path. - * @param {string} modelPath - The path to the directory containing the model file. - * @param {string} fileName - The name of the model file. - * @param {function} [progressCallback=null] - An optional function to track progress during the creation of the session. - * @returns {Promise} - A Promise that resolves to an InferenceSession object. - */ -async function constructSession(modelPath, fileName, progressCallback = null) { - let buffer = await getModelFile(modelPath, fileName, progressCallback); - - // TODO add option for user to force specify their desired execution provider - try { - return await InferenceSession.create(buffer, { - executionProviders, - }); - } catch (err) { - console.warn(err); - console.warn( - 'Something went wrong during model construction (most likely a missing operation). ' + - 'Using `wasm` as a fallback. ' - ) - return await InferenceSession.create(buffer, { - executionProviders: ['wasm'] - }); - } -} - -/** - * Executes an InferenceSession using the specified inputs. - * @param {InferenceSession} session - The InferenceSession object to run. - * @param {Object} inputs - An object that maps input names to input tensors. - * @returns {Promise} - A Promise that resolves to an object that maps output names to output tensors. - */ -async function sessionRun(session, inputs) { - try { - let output = await session.run(inputs); - output = replaceTensors(output); - return output; - } catch (e) { - console.error(`An error occurred during model execution: "${e}".`); - console.error('Inputs given to model:', inputs); - throw e; - } -} - -/** - * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions. - * @param {Object} obj - The object to replace tensor objects in. - * @returns {Object} - The object with tensor objects replaced by custom Tensor objects. - */ -function replaceTensors(obj) { - // Convert ONNX Tensors with our custom Tensor class - // to support additional functions - for (let prop in obj) { - if (obj[prop] instanceof ONNXTensor) { - obj[prop] = new Tensor(obj[prop]); - } - } - return obj; -} - -/** - * Prepares an attention mask for a sequence of tokens based on configuration options. - * @param {Object} self - The calling object instance. - * @param {Tensor} tokens - The input tokens. - * @returns {Tensor} - The attention mask tensor. - */ -function _prepare_attention_mask(self, tokens) { - - // Prepare attention mask - let pad_token_id = self.config.pad_token_id ?? null; - let eos_token_id = self.config.eos_token_id ?? null; - if (isIntegralNumber(eos_token_id)) { - eos_token_id = [eos_token_id]; - } - - let is_pad_token_in_inputs = tokens.indexOf(pad_token_id) !== -1; - let is_pad_token_not_equal_to_eos_token_id = (eos_token_id === null) || !eos_token_id.includes(pad_token_id) - - if (is_pad_token_in_inputs && is_pad_token_not_equal_to_eos_token_id) { - let data = BigInt64Array.from( - // Note: != so that int matches bigint - tokens.data.map(x => x != pad_token_id) - ) - return new Tensor('int64', data, tokens.dims) - } else { - return new Tensor( - 'int64', - new BigInt64Array(tokens.data.length).fill(1n), - tokens.dims - ) - } -} - -/** - * Creates a boolean tensor with a single value. - * @param {boolean} value - The value of the tensor. - * @returns {Tensor} - The boolean tensor. - */ -function boolTensor(value) { - // Create boolean tensor - return new Tensor('bool', [value], [1]); -} - -// JS doesn't support mixins, so we define some reused functions here, and allow "this" to be passed in -/** - * Loads a sequence-to-sequence model from the specified path. - * @param {string} modelPath - The path to the model directory. - * @param {function} progressCallback - The optional progress callback function. - * @returns {Promise<[any, any, any, any]>} - A promise that resolves with information about the loaded model. - */ -async function seq2seqLoadModel(modelPath, progressCallback) { - let info = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'encoder_model.onnx', progressCallback), - constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback), - fetchJSON(modelPath, 'generation_config.json', progressCallback, false), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - return info; -} - -/** - * Perform forward pass on the seq2seq model. - * @async - * @function - * @param {Object} self - The seq2seq model object. - * @param {Object} model_inputs - The input object for the model containing encoder and decoder inputs. - * @param {Object} options - The options - * @param {string} [options.encoder_input_name='input_ids'] - The name of the input tensor for the encoder. - * @param {boolean} [options.add_decoder_pkv=true] - Flag to add the decoder past key values. - * @returns {Promise} - Promise that resolves with the output of the seq2seq model. - */ -async function seq2seq_forward(self, model_inputs, { - encoder_input_name = 'input_ids', - add_decoder_pkv = true -} = {}) { - let encoderOutputs = model_inputs.encoder_outputs; - let pastKeyValues = model_inputs.past_key_values; - - if (encoderOutputs === null) { - const encoderFeeds = { - [encoder_input_name]: model_inputs[encoder_input_name], - } - - if (self.session.inputNames.includes('attention_mask')) { - encoderFeeds.attention_mask = model_inputs.attention_mask - } - const encoderResults = await sessionRun(self.session, encoderFeeds); - encoderOutputs = encoderResults.last_hidden_state; - } - let decoderFeeds = { - input_ids: model_inputs.decoder_input_ids, - encoder_hidden_states: encoderOutputs, - use_cache_branch: boolTensor(pastKeyValues !== null) - }; - - if (self.decoder_merged_session.inputNames.includes('encoder_attention_mask')) { - decoderFeeds.encoder_attention_mask = model_inputs.attention_mask - } - self.addPastKeyValues(decoderFeeds, pastKeyValues, add_decoder_pkv); - - const decoderResults = await sessionRun(self.decoder_merged_session, decoderFeeds); - let logits = decoderResults.logits; - pastKeyValues = self.getPastKeyValues(decoderResults, pastKeyValues); - return new Seq2SeqLMOutput(logits, pastKeyValues, encoderOutputs); -} - -/** - * Start the beam search process for the seq2seq model. - * @function - * @param {Object} self - The seq2seq model object. - * @param {Object[]} inputTokenIds - Array of input token ids for each input sequence. - * @param {number} numOutputTokens - The maximum number of output tokens for the model. - * @param {boolean} [requires_attention_mask=true] - Flag to indicate if the model requires an attention mask. - * @returns {Object[]} - Array of beam search objects. - */ -function seq2seqStartBeams(self, inputTokenIds, numOutputTokens, requires_attention_mask = true) { - let beams = []; - let beamId = 0; - for (let tokens of inputTokenIds) { - // TODO: Improve - // Currently, just add back batch dimension. - // In future, allow for true parallel execution - tokens.dims = [1, ...tokens.dims] - - // Create beam - let start = { - inputs: tokens, - encoder_outputs: null, - past_key_values: null, - - // decoder_input_ids == output_token_ids - output_token_ids: [self.config.decoder_start_token_id], - done: false, - score: 0, - id: beamId++ // assign unique id to beams - } - - if (requires_attention_mask) { - start.attention_mask = _prepare_attention_mask(self, tokens); - } - - beams.push(start); - } - - return beams; -} - -/** - * Run beam search on the seq2seq model for a single beam. - * @async - * @function - * @param {Object} self - The seq2seq model object. - * @param {Object} beam - The beam search object for which to run the model. - * @param {Object} options - options - * @param {string} [options.input_name='input_ids'] - The name of the input tensor for the encoder. - * @returns {Promise} - Promise that resolves with the output of the seq2seq model for the given beam. - */ -async function seq2seqRunBeam(self, beam, { - input_name = 'input_ids', -} = {} -) { - // 1. Prepare - let model_inputs = { - [input_name]: beam.inputs, - decoder_input_ids: self.toI64Tensor(beam.output_token_ids.slice(-1)), - encoder_outputs: beam.encoder_outputs, - past_key_values: beam.past_key_values, - } - if (beam.attention_mask) { - model_inputs.attention_mask = beam.attention_mask - } - - // 2. Run - let output = await self.forward(model_inputs); - - // 3. Update - beam.past_key_values = output.past_key_values; - beam.encoder_outputs = output.encoder_outputs; - - return output; -} - -/** - * Forward pass of the text generation model. - * @async - * @function - * @param {Object} self - The text generation model object. - * @param {Object} model_inputs - The input data to be used for the forward pass. - * @returns {Promise} - Promise that resolves with an object containing the logits and past key values. - */ -async function textgen_forward(self, model_inputs) { - let past_key_values = model_inputs.past_key_values; - let decoderFeeds = { - input_ids: model_inputs.input_ids, - attention_mask: model_inputs.attention_mask, - use_cache_branch: boolTensor(past_key_values !== null) - } - self.addPastKeyValues(decoderFeeds, past_key_values) - - let decoderResults = await sessionRun(self.session, decoderFeeds); - let logits = decoderResults.logits; - - past_key_values = self.getPastKeyValues(decoderResults, past_key_values); - return { logits, past_key_values }; -} - -/** - * Starts the generation of text by initializing the beams for the given input token IDs. - * @param {Object} self - The text generation model object. - * @param {any} inputTokenIds - An array of input token IDs to generate text from. - * @param {number} numOutputTokens - The maximum number of tokens to generate for each beam. - * @param {Tensor} [inputs_attention_mask] - The attention mask tensor for the input token IDs. - * @returns {Object[]} An array of beams initialized with the given inputs and parameters. - */ -function textgenStartBeams(self, inputTokenIds, numOutputTokens, inputs_attention_mask) { - let beams = []; - - let beamId = 0; - for (let tokens of inputTokenIds) { - // TODO: Improve - // Currently, just add back batch dimension. - // In future, allow for true parallel execution - tokens.dims = [1, ...tokens.dims] - - let attn_mask; - if (inputs_attention_mask) { - attn_mask = inputs_attention_mask.get(beamId) - attn_mask.dims = [1, ...attn_mask.dims] - - } else { - attn_mask = _prepare_attention_mask(self, tokens) - } - - let start = { - input: tokens, - model_input_ids: tokens, - attention_mask: attn_mask, - past_key_values: null, - - output_token_ids: [], - num_output_tokens: numOutputTokens, - - done: false, - score: 0, - id: beamId++ // assign unique id to beams - } - - beams.push(start); - } - return beams; -} - -/** - * Runs a single step of the text generation process for a given beam. - * - * @async - * @function textgenRunBeam - * @param {Object} self - The textgen object. - * @param {Object} beam - The beam to run. - * @param {Tensor} beam.input - The input tensor. - * @param {Tensor} beam.model_input_ids - The input ids to the model. - * @param {Tensor} beam.attention_mask - The attention mask. - * @param {Object} beam.past_key_values - The past key values. - * @param {number[]} beam.output_token_ids - The output token ids. - * @returns {Promise} The output of the generation step. - */ -async function textgenRunBeam(self, beam) { - let attnMaskData = new BigInt64Array(beam.input.data.length + beam.output_token_ids.length).fill(1n) - - // 1. Prepare - let model_inputs = { - input_ids: beam.model_input_ids, - attention_mask: new Tensor( - 'int64', - attnMaskData, - [1, attnMaskData.length] - ), - past_key_values: beam.past_key_values, - } - - // 2. Run - let output = await self.forward(model_inputs); - - // 3. Update - beam.past_key_values = output.past_key_values; - - return output; -} - -/** - * Update a beam with a new token ID. - * @param {object} beam - The beam to update. - * @param {number} newTokenId - The new token ID to add to the beam's output. - */ -function textgenUpdatebeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - beam.model_input_ids = new Tensor('int64', [BigInt(newTokenId)], [1, 1]); -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// Base class -/** - * A base class for pre-trained models that provides the model configuration and an ONNX session. - * @extends Callable - */ -class PreTrainedModel extends Callable { - /** - * Creates a new instance of the `PreTrainedModel` class. - * @param {object} config - The model configuration. - * @param {any} session - session for the model. - */ - constructor(config, session) { - super(); - - this.config = config; - this.session = session; - } - - /** - * Disposes of all the ONNX sessions that were created during inference. - * @returns {Promise} - An array of promises, one for each ONNX session that is being disposed. - */ - async dispose() { - // Dispose of all ONNX sessions sessions - // TODO use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry - - let promises = []; - for (let key of Object.keys(this)) { - let item = this[key]; - if (item instanceof InferenceSession) { - promises.push(item.handler.dispose()) - } - } - return await Promise.all(promises); - } - - /** - * Loads a pre-trained model from the given modelPath. - * @static - * @async - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - A function to be called with progress updates. - * @returns {Promise} A new instance of the PreTrainedModel class. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let config = await fetchJSON(modelPath, 'config.json', progressCallback); - let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx'; - - // Load model - let session = await constructSession(modelPath, modelName, progressCallback); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - return new this(config, session); - } - - /** - * Converts an array or Tensor of integers to an int64 Tensor. - * @param {Array|Tensor} items - The input integers to be converted. - * @returns {Tensor} The int64 Tensor with the converted values. - * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length. - */ - toI64Tensor(items) { - if (items instanceof Tensor) { - return items; - } - // items is an array - if (items.length === 0) { - throw Error("items must be non-empty"); - } - - if (Array.isArray(items[0])) { - // batched - if (items.some(x => x.length !== items[0].length)) { - 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.") - } - - return new Tensor('int64', - BigInt64Array.from(items.flat().map(x => BigInt(x))), - [items.length, items[0].length] - ); - } else { - //flat - return new Tensor('int64', - BigInt64Array.from(items.map(x => BigInt(x))), - [1, items.length] - ); - } - } - - /** - * Runs the model with the provided inputs - * @param {Object} model_inputs - Object containing input tensors - * @returns {Promise} - Object containing output tensors - */ - async _call(model_inputs) { - return await sessionRun(this.session, model_inputs); - } - - /** - * Forward method should be implemented in subclasses. - * @abstract - * @param {object} model_inputs - The input data to the model in the format specified in the ONNX model. - * @returns {Promise} - The output data from the model in the format specified in the ONNX model. - * @throws {Error} - This method must be implemented in subclasses. - */ - async forward(model_inputs) { - throw Error("forward should be implemented in subclasses.") - } - - /** - * @param {GenerationConfig} generation_config - * @param {number} input_ids_seq_length - * @returns {LogitsProcessorList} - */ - _get_logits_processor( - generation_config, - input_ids_seq_length, - // encoder_input_ids, TODO - // prefix_allowed_tokens_fn, TODO - logits_processor = null - ) { - const processors = new LogitsProcessorList(); - - // if (generation_config.diversity_penalty !== null && generation_config.diversity_penalty > 0.0) { - // processors.push(new HammingDiversityLogitsProcessor( - // generation_config.diversity_penalty, - // generation_config.num_beams, - // generation_config.num_beam_groups - // )); - // } - - // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== 1.0) { - // processors.push(new EncoderRepetitionPenaltyLogitsProcessor( - // generation_config.encoder_repetition_penalty, - // encoder_input_ids - // )); - // } - - if (generation_config.repetition_penalty !== null && generation_config.repetition_penalty !== 1.0) { - processors.push(new RepetitionPenaltyLogitsProcessor(generation_config.repetition_penalty)); - } - - if (generation_config.no_repeat_ngram_size !== null && generation_config.no_repeat_ngram_size > 0) { - processors.push(new NoRepeatNGramLogitsProcessor(generation_config.no_repeat_ngram_size)); - } - - // if (generation_config.encoder_no_repeat_ngram_size !== null && generation_config.encoder_no_repeat_ngram_size > 0) { - // if (this.config.is_encoder_decoder) { - // processors.push(new EncoderNoRepeatNGramLogitsProcessor( - // generation_config.encoder_no_repeat_ngram_size, - // encoder_input_ids - // )); - // } else { - // throw new Error("It's impossible to use `encoder_no_repeat_ngram_size` with decoder-only architecture"); - // } - // } - - // if (generation_config.bad_words_ids !== null) { - // processors.push(new NoBadWordsLogitsProcessor(generation_config.bad_words_ids, generation_config.eos_token_id)); - // } - - // if (generation_config.min_length !== null && generation_config.eos_token_id !== null && generation_config.min_length > 0) { - // processors.push(new MinLengthLogitsProcessor(generation_config.min_length, generation_config.eos_token_id)); - // } - - // if (generation_config.min_new_tokens !== null && generation_config.eos_token_id !== null && generation_config.min_new_tokens > 0) { - // processors.push(new MinNewTokensLengthLogitsProcessor( - // input_ids_seq_length, - // generation_config.min_new_tokens, - // generation_config.eos_token_id - // )); - // } - - // if (prefix_allowed_tokens_fn !== null) { - // processors.push(new PrefixConstrainedLogitsProcessor( - // prefix_allowed_tokens_fn, - // generation_config.num_beams / generation_config.num_beam_groups - // )); - // } - - - if (generation_config.forced_bos_token_id !== null) { - processors.push(new ForcedBOSTokenLogitsProcessor(generation_config.forced_bos_token_id)); - } - - if (generation_config.forced_eos_token_id !== null) { - processors.push(new ForcedEOSTokenLogitsProcessor( - generation_config.max_length, - generation_config.forced_eos_token_id - )); - } - - // if (generation_config.remove_invalid_values === true) { - // processors.push(new InfNanRemoveLogitsProcessor()); - // } - - // if (generation_config.exponential_decay_length_penalty !== null) { - // processors.push(new ExponentialDecayLengthPenalty( - // generation_config.exponential_decay_length_penalty, - // generation_config.eos_token_id, - // input_ids_seq_length - // )); - // } - - // if (generation_config.suppress_tokens !== null) { - // processors.push(new SuppressTokensLogitsProcessor(generation_config.suppress_tokens)); - // } - - // if (generation_config.begin_suppress_tokens !== null) { - // let begin_index = input_ids_seq_length; - // begin_index = (input_ids_seq_length > 1 || generation_config.forced_bos_token_id === null) ? begin_index : begin_index + 1; - // if (generation_config.forced_decoder_ids !== null) { - // begin_index += generation_config.forced_decoder_ids[generation_config.forced_decoder_ids.length - 1][0]; - // } - // processors.push(new SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, begin_index)); - // } - - if (generation_config.forced_decoder_ids !== null) { - processors.push(new ForceTokensLogitsProcessor(generation_config.forced_decoder_ids)); - } - - if (logits_processor !== null) { - processors.extend(logits_processor) - } - - // `LogitNormalization` should always be the last logit processor, when present - // if (generation_config.renormalize_logits === true) { - // processors.push(new LogitNormalization()); - // } - - return processors; - } - - /** - * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation. - * 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. - * - * @param {GenerationConfig} generation_config - A `GenerationConfig` object containing generation parameters. - * @returns {GenerationConfig} The final generation config object to be used by the model for text generation. - */ - _get_generation_config(generation_config) { - // Create empty generation config (contains defaults) - let gen_config = new GenerationConfig(); - - // Apply model's generation config, if it exists - if ('generation_config' in this) { - Object.assign(gen_config, this.generation_config); - } - - // Finally, use any generation config specified by the user - // when calling `generate` - if (generation_config !== null) { - Object.assign(gen_config, generation_config); - } - return gen_config; - } - - /** - * Generates text based on the given inputs and generation configuration using the model. - * @param {Array} inputs - An array of input token IDs. - * @param {Object|null} generation_config - The generation configuration to use. If null, default configuration will be used. - * @param {Object|null} logits_processor - An optional logits processor to use. If null, a new LogitsProcessorList instance will be created. - * @param {Object} options - options - * @param {Object} [options.inputs_attention_mask=null] - An optional attention mask for the inputs. - * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs. - * @throws {Error} Throws an error if the inputs array is empty. - */ - async generate( - inputs, - generation_config = null, - logits_processor = null, - { - inputs_attention_mask = null - } = {}, - ) { - - if (inputs.length === 0) { - throw Error("Must supply a non-empty array of input token ids.") - } - - // Update generation config with defaults - generation_config = this._get_generation_config(generation_config); - - logits_processor = logits_processor ?? new LogitsProcessorList() - - // TODO Update generation config - // this.generation_config - - // Update logits processor - logits_processor = this._get_logits_processor( - generation_config, - inputs.length, - logits_processor - ) - - // TODO implement early_stopping - // https://huggingface.co/blog/how-to-generate - - let numOutputTokens = 1; - const maxOutputTokens = numOutputTokens + (generation_config.max_new_tokens ?? Infinity); - - let sampler = Sampler.getSampler(generation_config); - - let beams = this.getStartBeams(inputs, numOutputTokens, inputs_attention_mask); - - while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) { - let newest_beams = []; - for (let beam of beams) { - if (beam.done) { - // TODO add length penalty (for ending early) - // Add this beam back into the pool - newest_beams.push(beam); - continue - } - - let output = await this.runBeam(beam); - - // Logits are of the form [batch_size, out_seq_length, vocab_size] - // In most cases, this will be [batch_size, 1, vocab_size] - // So, we select the last token's logits: - // (equivalent to `logits = outputs.logits[:, -1, :]`) - let extractedLogits = []; - for (const batch of output.logits) { - // Extract logits corresponding to the last token - let lastLogits = batch.get(batch.dims[0] - 1); - - // Add back batch dimension (needed for `cat`) - lastLogits.dims = [1, ...lastLogits.dims]; - extractedLogits.push(lastLogits) - } - let logits = cat(extractedLogits); - logits_processor(beam.output_token_ids, logits) - - let sampledTokens = sampler(logits); - for (let [newTokenId, logProb] of sampledTokens) { - // use previous beam as a starting point - let newBeam = { ...beam }; - - // update new beam - this.updateBeam(newBeam, newTokenId); - - newBeam.score += logProb; - - if (newTokenId === this.config.eos_token_id) { - newBeam.done = true; - } - newest_beams.push(newBeam); - } - } - ++numOutputTokens; - - // Next, we get the best beams, per ID - newest_beams = this.groupBeams(newest_beams).map( - group => group - .sort((a, b) => b.score - a.score) // sort based on score - .slice(0, generation_config.num_beams) // remove outside beam width - ); - - // Flatten beams - beams = newest_beams.flat(); - - // Run callback - if (generation_config.callback_function) { - generation_config.callback_function(beams); - } - } - - return this.groupBeams(beams).map( - batch => { - if (generation_config.num_return_sequences > 1) { - return batch.slice(0, generation_config.num_return_sequences).map(x => x.output_token_ids); - } else { - return [batch[0].output_token_ids]; - } - } - ) - } - - /** - * Groups an array of beam objects by their ids. - * - * @param {Array} beams - The array of beam objects to group. - * @returns {Array} - An array of arrays, where each inner array contains beam objects with the same id. - */ - groupBeams(beams) { - // Group beams by their ids - const groups = {}; - for (const obj of beams) { - if (groups[obj.id] === undefined) { - groups[obj.id] = [obj]; - } else { - groups[obj.id].push(obj); - } - } - - return Object.values(groups); - } - - /** - * Returns an object containing past key values from the given decoder results object. - * - * @param {Object} decoderResults - The decoder results object. - * @param {Object} pastKeyValues - The previous past key values. - * @returns {Object} - An object containing past key values. - */ - getPastKeyValues(decoderResults, pastKeyValues) { - - const pkvs = {}; - - for (const name in decoderResults) { - if (name.startsWith('present')) { - let newName = name.replace('present', 'past_key_values'); - - if (pastKeyValues !== null && name.includes('encoder')) { - // Optimization introduced by optimum to reuse past key values. So, we just replace the constant - // outputs with the previous past key values. - // https://github.com/huggingface/optimum/blob/0bf2c05fb7e1182b52d21b703cfc95fd9e4ea3dc/optimum/onnxruntime/base.py#L677-L704 - pkvs[newName] = pastKeyValues[newName]; - } else { - pkvs[newName] = decoderResults[name]; - } - } - } - return pkvs; - } - - /** - * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values. - * - * @param {Object} decoderFeeds - The decoder feeds object to add past key values to. - * @param {Object} pastKeyValues - An object containing past key values. - * @param {boolean} [hasDecoder=false] - Whether the model has a decoder. - */ - addPastKeyValues(decoderFeeds, pastKeyValues, hasDecoder = false) { - if (pastKeyValues === null) { - // TODO support batches (i.e., batch_size > 1) - if (hasDecoder) { - let encoder_dims = [1, this.num_encoder_heads, 0, this.encoder_dim_kv]; - for (let i = 0; i < this.num_encoder_layers; ++i) { - decoderFeeds[`past_key_values.${i}.encoder.key`] = new Tensor('float32', [], encoder_dims) - decoderFeeds[`past_key_values.${i}.encoder.value`] = new Tensor('float32', [], encoder_dims) - } - - let decoder_dims = [1, this.num_decoder_heads, 0, this.decoder_dim_kv]; - for (let i = 0; i < this.num_decoder_layers; ++i) { - decoderFeeds[`past_key_values.${i}.decoder.key`] = new Tensor('float32', [], decoder_dims) - decoderFeeds[`past_key_values.${i}.decoder.value`] = new Tensor('float32', [], decoder_dims) - } - - } else { - let dims = [1, this.num_heads, 0, this.dim_kv] - for (let i = 0; i < this.num_layers; ++i) { - decoderFeeds[`past_key_values.${i}.key`] = new Tensor('float32', [], dims) - decoderFeeds[`past_key_values.${i}.value`] = new Tensor('float32', [], dims) - } - } - - } else { - Object.assign(decoderFeeds, pastKeyValues) - } - } -} -////////////////////////////////////////////////// -// Base model output class -class ModelOutput { } - - -////////////////////////////////////////////////// -// Bert models -class BertPreTrainedModel extends PreTrainedModel { } -class BertModel extends BertPreTrainedModel { } - -/** - * BertForMaskedLM is a class representing a BERT model for masked language modeling. - * @extends BertPreTrainedModel - */ -class BertForMaskedLM extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for masked language modeling. - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new MaskedLMOutput(logits) - } -} - -/** - * BertForSequenceClassification is a class representing a BERT model for sequence classification. - * @extends BertPreTrainedModel - */ -class BertForSequenceClassification extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} - -/** - * BertForTokenClassification is a class representing a BERT model for token classification. - * @extends BertPreTrainedModel - */ -class BertForTokenClassification extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for token classification. - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new TokenClassifierOutput(logits) - } -} - -/** - * BertForQuestionAnswering is a class representing a BERT model for question answering. - * @extends BertPreTrainedModel - */ -class BertForQuestionAnswering extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for question answering. - */ - async _call(model_inputs) { - let outputs = await super._call(model_inputs); - return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// DistilBert models -class DistilBertPreTrainedModel extends PreTrainedModel { } -class DistilBertModel extends DistilBertPreTrainedModel { } - -/** - * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification. - * @extends DistilBertPreTrainedModel - */ -class DistilBertForSequenceClassification extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} - -/** - * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification. - * @extends DistilBertPreTrainedModel - */ -class DistilBertForTokenClassification extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for token classification. - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new TokenClassifierOutput(logits) - } -} - - -/** - * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering. - * @extends DistilBertPreTrainedModel - */ -class DistilBertForQuestionAnswering extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for question answering. - */ - async _call(model_inputs) { - let outputs = await super._call(model_inputs); - return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); - } -} - -/** - * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task. - * @extends DistilBertPreTrainedModel - */ -class DistilBertForMaskedLM extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new MaskedLMOutput(logits) - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -// MobileBert models -class MobileBertPreTrainedModel extends PreTrainedModel { } -class MobileBertModel extends MobileBertPreTrainedModel { } - -/** - * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task. - * @extends MobileBertPreTrainedModel - */ -class MobileBertForMaskedLM extends MobileBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new MaskedLMOutput(logits) - } -} - -/** - * @extends MobileBertPreTrainedModel - */ -class MobileBertForSequenceClassification extends MobileBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} - -/** - * @extends MobileBertPreTrainedModel - */ -class MobileBertForQuestionAnswering extends MobileBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let outputs = await super._call(model_inputs); - return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -// SqueezeBert models -class SqueezeBertPreTrainedModel extends PreTrainedModel { } -class SqueezeBertModel extends SqueezeBertPreTrainedModel { } -class SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new MaskedLMOutput(logits) - } -} -class SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} -class SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let outputs = await super._call(model_inputs); - return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -// Albert models -class AlbertPreTrainedModel extends PreTrainedModel { } -class AlbertModel extends AlbertPreTrainedModel { } -class AlbertForSequenceClassification extends AlbertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} -class AlbertForQuestionAnswering extends AlbertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let outputs = await super._call(model_inputs); - return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); - } -} -class AlbertForMaskedLM extends AlbertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new MaskedLMOutput(logits) - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -// T5 models -class T5PreTrainedModel extends PreTrainedModel { }; - -class T5Model extends T5PreTrainedModel { - /** - * Generates text based on the provided arguments. - * @throws {Error} - Throws an error as the current model class (T5Model) is not compatible with `.generate()`. - * @returns {Promise} - * @param {any[]} args - */ - async generate(...args) { - throw Error( - "The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}" - ) - } -} - -/** - * T5Model is a class representing a T5 model for conditional generation. - * @extends T5PreTrainedModel - */ -class T5ForConditionalGeneration extends T5PreTrainedModel { - /** - * Creates a new instance of the `T5ForConditionalGeneration` class. - * @param {object} config - The model configuration. - * @param {any} session - session for the model. - * @param {any} decoder_merged_session - session for the decoder. - * @param {GenerationConfig} generation_config - The generation configuration. - */ - constructor(config, session, decoder_merged_session, generation_config) { - super(config, session); - this.decoder_merged_session = decoder_merged_session; - this.generation_config = generation_config; - - this.num_decoder_layers = this.config.num_decoder_layers; - this.num_decoder_heads = this.config.num_heads; - this.decoder_dim_kv = this.config.d_kv; - - this.num_encoder_layers = this.config.num_layers; - this.num_encoder_heads = this.config.num_heads; - this.encoder_dim_kv = this.config.d_kv; - } - - /** - * Loads the pre-trained model from a given path. - * @async - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - A function to call with progress updates (optional). - * @returns {Promise} The loaded model instance. - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - return new this(...info); - } - - /** - * Generates the start beams for a given set of inputs and output length. - * @param {number[][]} inputs - The input token IDs. - * @param {number} numOutputTokens - The desired output length. - * @returns {Array} The start beams. - */ - getStartBeams(inputs, numOutputTokens, ...args) { - return seq2seqStartBeams(this, inputs, numOutputTokens); - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await seq2seqRunBeam(this, beam); - } - - /** - * Updates the given beam with a new token ID. - * @param {any} beam - The current beam. - * @param {number} newTokenId - The new token ID to add to the output sequence. - */ - updateBeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - } - - /** - * Runs the forward pass of the model for a given set of inputs. - * @async - * @param {Object} model_inputs - The model inputs. - * @returns {Promise} The model output. - */ - async forward(model_inputs) { - return await seq2seq_forward(this, model_inputs); - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// MT5 models -class MT5PreTrainedModel extends PreTrainedModel { }; - -class MT5Model extends MT5PreTrainedModel { - /** - * - * @param {...any} args - * @returns {Promise} - * @throws {Error} - */ - async generate(...args) { - throw Error( - "The current model class (MT5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'MT5ForConditionalGeneration'}" - ) - } -} - -/** - * A class representing a conditional sequence-to-sequence model based on the MT5 architecture. - * - * @extends MT5PreTrainedModel - */ -class MT5ForConditionalGeneration extends MT5PreTrainedModel { - /** - * Creates a new instance of the `MT5ForConditionalGeneration` class. - * @param {any} config - The model configuration. - * @param {any} session - The ONNX session containing the encoder weights. - * @param {any} decoder_merged_session - The ONNX session containing the merged decoder weights. - * @param {GenerationConfig} generation_config - The generation configuration. - */ - constructor(config, session, decoder_merged_session, generation_config) { - super(config, session); - this.decoder_merged_session = decoder_merged_session; - this.generation_config = generation_config; - - this.num_decoder_layers = this.config.num_decoder_layers; - this.num_decoder_heads = this.config.num_heads; - this.decoder_dim_kv = this.config.d_kv; - - this.num_encoder_layers = this.config.num_layers; - this.num_encoder_heads = this.config.num_heads; - this.encoder_dim_kv = this.config.d_kv; - } - - /** - * Loads a pre-trained model from the given path. - * - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} [progressCallback=null] - A callback function that is called with the download progress percentage (0-100). - * @returns {Promise} - A Promise that resolves to a new `MT5ForConditionalGeneration` instance. - * @static - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - return new this(...info); - } - - /** - * Generates the start beams for the given input tokens and output sequence length. - * - * @param {any[]} inputs - The input sequence. - * @param {number} numOutputTokens - The desired length of the output sequence. - * @param {...*} args - Additional arguments to pass to the `seq2seqStartBeams` function. - * @returns {any[]} - An array of `Beam` objects representing the start beams. - */ - getStartBeams(inputs, numOutputTokens, ...args) { - return seq2seqStartBeams(this, inputs, numOutputTokens); - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await seq2seqRunBeam(this, beam); - } - - /** - * Updates the given beam with the new predicted token. - * @param {any} beam - The beam to update. - * @param {number} newTokenId - The index of the predicted token. - */ - updateBeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - } - - /** - * Runs the forward pass of the model on the given inputs. - * @param {any} model_inputs - The model inputs. - * @returns {Promise} - A Promise that resolves to the model outputs. - */ - async forward(model_inputs) { - return await seq2seq_forward(this, model_inputs); - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// Bart models -class BartPretrainedModel extends PreTrainedModel { }; - -/** - * BART encoder and decoder model. - * - * @hideconstructor - * @extends BartPretrainedModel - */ -class BartModel extends BartPretrainedModel { - /** - * Throws an error because the current model class (BartModel) is not compatible with `.generate()`. - * - * @async - * @throws {Error} The current model class (BartModel) is not compatible with `.generate()`. - * @returns {Promise} - */ - async generate(...args) { - throw Error( - "The current model class (BartModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'BartForConditionalGeneration'}" - ) - } -} - -/** - * BART model with a language model head for conditional generation. - * @extends BartPretrainedModel - */ -class BartForConditionalGeneration extends BartPretrainedModel { - /** - * Creates a new instance of the `BartForConditionalGeneration` class. - * @param {object} config - The configuration object for the Bart model. - * @param {object} session - The ONNX session used to execute the model. - * @param {object} decoder_merged_session - The ONNX session used to execute the decoder. - * @param {object} generation_config - The generation configuration object. - */ - constructor(config, session, decoder_merged_session, generation_config) { - super(config, session); - this.decoder_merged_session = decoder_merged_session; - this.generation_config = generation_config; - - this.num_decoder_layers = this.config.decoder_layers; - this.num_decoder_heads = this.config.decoder_attention_heads; - this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads; - - this.num_encoder_layers = this.config.encoder_layers; - this.num_encoder_heads = this.config.encoder_attention_heads; - this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads; - } - - /** - * Loads a BartForConditionalGeneration instance from a pretrained model stored on disk. - * @param {string} modelPath - The path to the directory containing the pretrained model. - * @param {function} [progressCallback=null] - An optional callback function to track the download progress. - * @returns {Promise} - The pretrained BartForConditionalGeneration instance. - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - return new this(...info); - } - - /** - * Returns the initial beam for generating output text. - * @param {object} inputs - The input object containing the encoded input text. - * @param {number} numOutputTokens - The maximum number of output tokens to generate. - * @param {...any} args - Additional arguments to pass to the sequence-to-sequence generation function. - * @returns {any} - The initial beam for generating output text. - */ - getStartBeams(inputs, numOutputTokens, ...args) { - return seq2seqStartBeams(this, inputs, numOutputTokens); - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await seq2seqRunBeam(this, beam); - } - - /** - * Updates the beam by appending the newly generated token ID to the list of output token IDs. - * @param {any} beam - The current beam being generated. - * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs. - */ - updateBeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - } - - /** - * Runs the forward pass of the model for a given set of inputs. - * @async - * @param {Object} model_inputs - The model inputs. - * @returns {Promise} The model output. - */ - async forward(model_inputs) { - return await seq2seq_forward(this, model_inputs); - } -} - -class BartForSequenceClassification extends BartPretrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} - -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// Roberta models -class RobertaPreTrainedModel extends PreTrainedModel { } -class RobertaModel extends RobertaPreTrainedModel { } - -/** - * RobertaForMaskedLM class for performing masked language modeling on Roberta models. - * @extends RobertaPreTrainedModel - */ -class RobertaForMaskedLM extends RobertaPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new MaskedLMOutput(logits) - } -} - -/** - * RobertaForSequenceClassification class for performing sequence classification on Roberta models. - * @extends RobertaPreTrainedModel - */ -class RobertaForSequenceClassification extends RobertaPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} - -/** - * RobertaForQuestionAnswering class for performing question answering on Roberta models. - * @extends RobertaPreTrainedModel - */ -class RobertaForQuestionAnswering extends RobertaPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - async _call(model_inputs) { - let outputs = await super._call(model_inputs); - return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// T5 models -class WhisperPreTrainedModel extends PreTrainedModel { }; - -/** - * WhisperModel class for training Whisper models without a language model head. - * @extends WhisperPreTrainedModel - */ -class WhisperModel extends WhisperPreTrainedModel { - /** - * Throws an error when attempting to generate output since this model doesn't have a language model head. - * @throws Error - * @returns {Promise} - * @param {any[]} args - */ - async generate(...args) { - throw Error( - "The current model class (WhisperModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'WhisperForConditionalGeneration'}" - ) - } -} - -/** - * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models. - * @extends WhisperPreTrainedModel - */ -class WhisperForConditionalGeneration extends WhisperPreTrainedModel { - /** - * Creates a new instance of the `WhisperForConditionalGeneration` class. - * @param {Object} config - Configuration object for the model. - * @param {Object} session - ONNX Session object for the model. - * @param {Object} decoder_merged_session - ONNX Session object for the decoder. - * @param {Object} generation_config - Configuration object for the generation process. - */ - constructor(config, session, decoder_merged_session, generation_config) { - super(config, session); - this.decoder_merged_session = decoder_merged_session; - this.generation_config = generation_config; - - this.num_decoder_layers = this.config.decoder_layers; - this.num_decoder_heads = this.config.decoder_attention_heads; - this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads; - - this.num_encoder_layers = this.config.encoder_layers; - this.num_encoder_heads = this.config.encoder_attention_heads; - this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads; - - - } - - /** - * Generates outputs based on input and generation configuration. - * @param {Object} inputs - Input data for the model. - * @param {Object} generation_config - Configuration object for the generation process. - * @param {Object} logits_processor - Optional logits processor object. - * @returns {Promise} Promise object represents the generated outputs. - */ - async generate( - inputs, - generation_config = null, - logits_processor = null, - ) { - // Create generation config object - generation_config = this._get_generation_config(generation_config); - - - // Whisper has additional options for returning timestamps - generation_config.return_timestamps ??= false; - - // TODO add language and task - - if (generation_config.return_timestamps) { - logits_processor = [new WhisperTimeStampLogitsProcessor(generation_config)] - } - - return super.generate(inputs, generation_config, logits_processor) - } - - /** - * Loads a pre-trained model from a saved model directory. - * @param {string} modelPath - Path to the saved model directory. - * @param {function} progressCallback - Optional function for tracking loading progress. - * @returns {Promise} Promise object represents the loaded model. - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - return new this(...info); - } - - /** - * Gets the start beams for generating outputs. - * @param {Array} inputTokenIds - Array of input token IDs. - * @param {number} numOutputTokens - Number of output tokens to generate. - * @returns {Array} Array of start beams. - */ - getStartBeams(inputTokenIds, numOutputTokens, ...args) { - // arguments ignored in this case - return seq2seqStartBeams(this, inputTokenIds, numOutputTokens, false); - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await seq2seqRunBeam(this, beam, { - input_name: 'input_features', - }); - } - - /** - * Updates the beam by appending the newly generated token ID to the list of output token IDs. - * @param {any} beam - The current beam being generated. - * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs. - */ - updateBeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - } - - /** - * Runs the forward pass of the model for a given set of inputs. - * @async - * @param {Object} model_inputs - The model inputs. - * @returns {Promise} The model output. - */ - async forward(model_inputs) { - return await seq2seq_forward(this, model_inputs, { - encoder_input_name: 'input_features', - }); - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -/** - * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks - * @extends PreTrainedModel - */ -class VisionEncoderDecoderModel extends PreTrainedModel { - /** - * Creates a new instance of the `VisionEncoderDecoderModel` class. - * @param {object} config - The configuration object specifying the hyperparameters and other model settings. - * @param {object} session - The ONNX session containing the encoder model. - * @param {any} decoder_merged_session - The ONNX session containing the merged decoder model. - */ - constructor(config, session, decoder_merged_session) { - super(config, session); - this.decoder_merged_session = decoder_merged_session; - - this.num_layers = this.config.decoder.n_layer; - this.num_heads = this.config.decoder.n_head; - this.dim_kv = this.config.decoder.n_embd / this.num_heads; - } - - /** - * Loads a VisionEncoderDecoderModel from the given path. - * - * @param {string} modelPath - The path to the folder containing the saved model files. - * @param {function} [progressCallback=null] - Optional callback function to track the progress of model loading. - * @returns {Promise} A Promise that resolves with the loaded VisionEncoderDecoderModel instance. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session, decoder_merged_session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'encoder_model.onnx', progressCallback), - constructSession(modelPath, 'decoder_merged_session.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - return new this(config, session, decoder_merged_session); - } - - /** - * Generate beam search outputs for the given input pixels and number of output tokens. - * - * @param {array} inputs - The input pixels as a Tensor. - * @param {number} numOutputTokens - The number of output tokens to generate. - * @param {...*} args - Optional additional arguments to pass to seq2seqStartBeams. - * @returns {any} An array of Beam objects representing the top-K output sequences. - */ - getStartBeams(inputs, numOutputTokens, ...args) { - return seq2seqStartBeams(this, inputs, numOutputTokens); - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return seq2seqRunBeam(this, beam, { - input_name: 'pixel_values', - }); - } - - /** - * Update the given beam with the additional predicted token ID. - * - * @param {any} beam - The current beam. - * @param {number} newTokenId - The new predicted token ID to add to the beam's output sequence. - */ - updateBeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - } - - /** - * Compute the forward pass of the model on the given input tensors. - * - * @param {object} model_inputs - The input tensors as an object with keys 'pixel_values' and 'decoder_input_ids'. - * @returns {Promise} The output tensor of the model. - */ - async forward(model_inputs) { - return await seq2seq_forward(this, model_inputs, { - encoder_input_name: 'pixel_values', - add_decoder_pkv: false - }) - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// CLIP models -class CLIPPreTrainedModel extends PreTrainedModel { } -class CLIPModel extends CLIPPreTrainedModel { - -} - -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -// GPT2 models -class GPT2PreTrainedModel extends PreTrainedModel { } -/** - * GPT2Model is not compatible with `.generate()`, as it doesn't have a language model head. - * @extends GPT2PreTrainedModel - */ -class GPT2Model extends GPT2PreTrainedModel { - /** - * - * @param {...any} args - * @throws {Error} - * @returns {Promise} - */ - async generate(...args) { - throw Error( - "The current model class (GPT2Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'GPT2LMHeadModel'}" - ) - } -} - -/** - * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks. - * @extends GPT2PreTrainedModel - */ -class GPT2LMHeadModel extends GPT2PreTrainedModel { - /** - * Creates a new instance of the `GPT2LMHeadModel` class. - * @param {object} config - The configuration of the model. - * @param {any} session - The ONNX session containing the model weights. - */ - constructor(config, session) { - super(config, session); - - // config doesn't contain pad_token_id, so we assume it is the eos_token_id - this.config.pad_token_id = this.config.eos_token_id - - this.num_heads = this.config.n_head - this.num_layers = this.config.n_layer - this.dim_kv = this.config.n_embd / this.num_heads; - } - - /** - * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. - * @returns {any} A Beam object representing the initialized beam. - */ - getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) { - return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask) - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await textgenRunBeam(this, beam); - } - - /** - * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. - */ - updateBeam(beam, newTokenId) { - return textgenUpdatebeam(beam, newTokenId); - } - - /** - * Forward pass for the model. - * @param {object} model_inputs - The inputs for the model. - * @returns {Promise} The output tensor of the model. - */ - async forward(model_inputs) { - return await textgen_forward(this, model_inputs) - } - -} -// class GPT2ForSequenceClassification extends GPT2PreTrainedModel { -// TODO -// } -////////////////////////////////////////////////// -class GPTNeoPreTrainedModel extends PreTrainedModel { } -class GPTNeoModel extends GPTNeoPreTrainedModel { - /** - * - * @param {...any} args - * @throws {Error} - * @returns {Promise} - */ - async generate(...args) { - throw Error( - "The current model class (GPTNeoModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'GPTNeoForCausalLM'}" - ) - } -} - -class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { - /** - * Creates a new instance of the `GPTNeoForCausalLM` class. - * @param {object} config - The configuration of the model. - * @param {any} session - The ONNX session containing the model weights. - */ - constructor(config, session) { - super(config, session); - - // config doesn't contain pad_token_id, so we assume it is the eos_token_id - this.config.pad_token_id = this.config.eos_token_id - - this.num_heads = this.config.num_heads; - this.num_layers = this.config.num_layers; - this.dim_kv = this.config.hidden_size / this.num_heads; - } - - /** - * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. - * @returns {any} A Beam object representing the initialized beam. - */ - getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) { - return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask) - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await textgenRunBeam(this, beam); - } - - /** - * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. - */ - updateBeam(beam, newTokenId) { - return textgenUpdatebeam(beam, newTokenId); - } - - /** - * Forward pass for the model. - * @param {object} model_inputs - The inputs for the model. - * @returns {Promise} The output tensor of the model. - */ - async forward(model_inputs) { - return await textgen_forward(this, model_inputs) - } -} - -////////////////////////////////////////////////// -// CodeGen models -class CodeGenPreTrainedModel extends PreTrainedModel { } -/** - * CodeGenModel is a class representing a code generation model without a language model head. - * - * @extends CodeGenPreTrainedModel - */ -class CodeGenModel extends CodeGenPreTrainedModel { - /** - * Throws an error indicating that the current model class is not compatible with `.generate()`, - * as it doesn't have a language model head. - * - * @throws {Error} The current model class is not compatible with `.generate()` - * - * @param {...any} args - Arguments passed to the generate function - * @returns {Promise} - */ - async generate(...args) { - throw Error( - "The current model class (CodeGenModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'CodeGenForCausalLM'}" - ) - } -} - -/** - * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class. - * @extends CodeGenPreTrainedModel - */ -class CodeGenForCausalLM extends CodeGenPreTrainedModel { - /** - * Creates a new instance of the `CodeGenForCausalLM` class. - * @param {object} config The model configuration object. - * @param {object} session The ONNX session object. - */ - constructor(config, session) { - super(config, session); - - // config doesn't contain pad_token_id, so we assume it is the eos_token_id - this.config.pad_token_id = this.config.eos_token_id - - this.num_heads = this.config.n_head - this.num_layers = this.config.n_layer - this.dim_kv = this.config.n_embd / this.num_heads; - } - - /** - * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. - * @returns {any} A Beam object representing the initialized beam. - */ - getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) { - return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask) - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await textgenRunBeam(this, beam); - } - - /** - * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. - */ - updateBeam(beam, newTokenId) { - return textgenUpdatebeam(beam, newTokenId); - } - - /** - * Forward pass for the model. - * @param {object} model_inputs - The inputs for the model. - * @returns {Promise} The output tensor of the model. - */ - async forward(model_inputs) { - return await textgen_forward(this, model_inputs) - } - -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -class ViTPreTrainedModel extends PreTrainedModel { } -class ViTForImageClassification extends ViTPreTrainedModel { - /** - * @param {any} model_inputs - */ - async _call(model_inputs) { - let logits = (await super._call(model_inputs)).logits; - return new SequenceClassifierOutput(logits) - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -class DetrPreTrainedModel extends PreTrainedModel { } -class DetrForObjectDetection extends DetrPreTrainedModel { - /** - * @param {any} model_inputs - */ - async _call(model_inputs) { - let output = (await super._call(model_inputs)); - return new DetrObjectDetectionOutput(output.logits, output.pred_boxes) - } -} - -class DetrForSegmentation extends DetrPreTrainedModel { - /** - * Runs the model with the provided inputs - * @param {Object} model_inputs - Model inputs - * @returns {Promise} - Object containing segmentation outputs - */ - async _call(model_inputs) { - let output = (await super._call(model_inputs)); - return new DetrSegmentationOutput(output.logits, output.pred_boxes, output.pred_masks); - } -} - -class DetrObjectDetectionOutput extends ModelOutput { - /** - * @param {any} logits - * @param {any} pred_boxes - */ - constructor(logits, pred_boxes) { - super(); - this.logits = logits; - this.pred_boxes = pred_boxes; - } -} - -class DetrSegmentationOutput extends ModelOutput { - - /** - * @param {Tensor} logits - The output logits of the model. - * @param {Tensor} pred_boxes - Predicted boxes. - * @param {Tensor} pred_masks - Predicted masks. - */ - constructor(logits, pred_boxes, pred_masks) { - super(); - this.logits = logits; - this.pred_boxes = pred_boxes; - this.pred_masks = pred_masks; - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -// MarianMT models -class MarianPreTrainedModel extends PreTrainedModel { }; - -class MarianModel extends MarianPreTrainedModel { - /** - * - * @param {...any} args - * @throws {Error} - * @returns {Promise} - */ - async generate(...args) { - throw Error( - "The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}" - ) - } -} - -class MarianMTModel extends MarianPreTrainedModel { - /** - * Creates a new instance of the `MarianMTModel` class. - * @param {object} config The model configuration object. - * @param {object} session The ONNX session object. - * @param {any} decoder_merged_session - * @param {any} generation_config - */ - constructor(config, session, decoder_merged_session, generation_config) { - super(config, session); - this.decoder_merged_session = decoder_merged_session; - this.generation_config = generation_config; - - this.num_decoder_layers = this.config.decoder_layers; - this.num_decoder_heads = this.config.decoder_attention_heads; - this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads; - - this.num_encoder_layers = this.config.encoder_layers; - this.num_encoder_heads = this.config.encoder_attention_heads; - this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads; - } - - /** - * @param {string} modelPath - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - return new this(...info); - } - - /** - * Initializes and returns the beam for text generation task - * @param {any[]} inputs - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @returns {any} A Beam object representing the initialized beam. - * @param {any[]} args - */ - getStartBeams(inputs, numOutputTokens, ...args) { - return seq2seqStartBeams(this, inputs, numOutputTokens); - } - - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - async runBeam(beam) { - return await seq2seqRunBeam(this, beam); - } - - /** - * @param {any} beam - * @param {any} newTokenId - */ - updateBeam(beam, newTokenId) { - beam.output_token_ids = [...beam.output_token_ids, newTokenId]; - } - - /** - * @param {any} model_inputs - * @returns {Promise} - */ - async forward(model_inputs) { - return await seq2seq_forward(this, model_inputs); - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -// AutoModels, used to simplify construction of PreTrainedModels -// (uses config to instantiate correct class) -/** - * Helper class to determine model type from config - */ -class AutoModel { - // Helper class to determine model type from config - static MODEL_CLASS_MAPPING = { - 'bert': BertModel, - 'albert': AlbertModel, - 'distilbert': DistilBertModel, - 't5': T5Model, - 'mt5': MT5Model, - 'gpt2': GPT2Model, - 'gpt_neo': GPTNeoModel, - 'codegen': CodeGenModel, - 'bart': BartModel, - 'roberta': RobertaModel, - 'whisper': WhisperModel, - 'clip': CLIPModel, - 'mobilebert': MobileBertModel, - 'squeezebert': SqueezeBertModel, - 'marian': MarianModel, - } - - /** - * Instantiates a pre-trained model based on the given model path and config. - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - Optional. A callback function that can be used to track loading progress. - * @returns {Promise} - A promise that resolves to an instance of a pre-trained model. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let config = await fetchJSON(modelPath, 'config.json', progressCallback); - let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx'; - - let session = await constructSession(modelPath, modelName, progressCallback); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - console.warn(`Unknown model class "${config.model_type}", attempting to construct from base class.`); - cls = PreTrainedModel; - } - return new cls(config, session) - } -} - -/** - * Helper class for loading sequence classification models from pretrained checkpoints - */ -class AutoModelForSequenceClassification { - - static MODEL_CLASS_MAPPING = { - 'bert': BertForSequenceClassification, - 'albert': AlbertForSequenceClassification, - 'distilbert': DistilBertForSequenceClassification, - 'roberta': RobertaForSequenceClassification, - 'bart': BartForSequenceClassification, - 'mobilebert': MobileBertForSequenceClassification, - 'squeezebert': SqueezeBertForSequenceClassification, - } - - /** - * Load a sequence classification model from a pretrained checkpoint - * @param {string} modelPath - The path to the model checkpoint directory - * @param {function} [progressCallback=null] - An optional callback function to receive progress updates - * @returns {Promise} A promise that resolves to a pre-trained sequence classification model - * @throws {Error} if an unsupported model type is encountered - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback) - ]); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} - - -/** - * Helper class for loading token classification models from pretrained checkpoints - */ -class AutoModelForTokenClassification { - - static MODEL_CLASS_MAPPING = { - 'bert': BertForTokenClassification, - 'distilbert': DistilBertForTokenClassification, - } - - /** - * Load a token classification model from a pretrained checkpoint - * @param {string} modelPath - The path to the model checkpoint directory - * @param {function} [progressCallback=null] - An optional callback function to receive progress updates - * @returns {Promise} A promise that resolves to a pre-trained token classification model - * @throws {Error} if an unsupported model type is encountered - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback) - ]); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} - - -/** - * Class representing an automatic sequence-to-sequence language model. - */ -class AutoModelForSeq2SeqLM { - static MODEL_CLASS_MAPPING = { - 't5': T5ForConditionalGeneration, - 'mt5': MT5ForConditionalGeneration, - 'bart': BartForConditionalGeneration, - 'whisper': WhisperForConditionalGeneration, - 'marian': MarianMTModel, - } - - /** - * Loads a pretrained sequence-to-sequence language model from a file path. - * @param {string} modelPath - The path to the model files. - * @param {function} [progressCallback=null] - A callback function to track loading progress. - * @returns {Promise} A Promise that resolves to an instance of the appropriate model class. - * @throws {Error} If the model type is unsupported. - * @static - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - let config = info[0]; - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(...info) - } -} - -/** - * A class for loading pre-trained models for causal language modeling tasks. - */ -class AutoModelForCausalLM { - static MODEL_CLASS_MAPPING = { - 'gpt2': GPT2LMHeadModel, - 'gpt_neo': GPTNeoForCausalLM, - 'codegen': CodeGenForCausalLM, - } - - /** - * Loads a pre-trained model from the given path and returns an instance of the appropriate class. - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} [progressCallback=null] - An optional callback function to track the progress of the loading process. - * @returns {Promise} An instance of the appropriate class for the loaded model. - * @throws {Error} If the loaded model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback) - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - - } -} - -/** - * A class to automatically select the appropriate model for Masked Language Modeling (MLM) tasks. - */ -class AutoModelForMaskedLM { - static MODEL_CLASS_MAPPING = { - 'bert': BertForMaskedLM, - 'albert': AlbertForMaskedLM, - 'distilbert': DistilBertForMaskedLM, - 'roberta': RobertaForMaskedLM, - 'mobilebert': MobileBertForMaskedLM, - 'squeezebert': SqueezeBertForMaskedLM, - } - - /** - * Loads a pre-trained model from a given directory and returns an instance of the appropriate model class. - * - * @async - * @param {string} modelPath - The path to the pre-trained model directory. - * @param {function} [progressCallback=null] - An optional callback function to track the loading progress. - * @returns {Promise} An instance of the appropriate model class for MLM tasks. - * @throws {Error} If an unsupported model type is encountered. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let config = await fetchJSON(modelPath, 'config.json', progressCallback); - let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx'; - - let session = await constructSession(modelPath, modelName, progressCallback); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} - -/** - * Automatic model class for question answering tasks. - */ -class AutoModelForQuestionAnswering { - static MODEL_CLASS_MAPPING = { - 'bert': BertForQuestionAnswering, - 'albert': AlbertForQuestionAnswering, - 'distilbert': DistilBertForQuestionAnswering, - 'roberta': RobertaForQuestionAnswering, - 'mobilebert': MobileBertForQuestionAnswering, - 'squeezebert': SqueezeBertForQuestionAnswering, - } - - /** - * Loads and returns a question answering model from a pretrained model path. - * @param {string} modelPath - The path to the pretrained model. - * @param {function} [progressCallback=null] - Optional callback function to track loading progress. - * @returns {Promise} - The loaded question answering model. - * @throws Will throw an error if an unsupported model type is encountered. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback) - ]); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} - -/** - * Class representing an autoencoder-decoder model for vision-to-sequence tasks. - */ -class AutoModelForVision2Seq { - static MODEL_CLASS_MAPPING = { - 'vision-encoder-decoder': VisionEncoderDecoderModel - } - - /** - * Loads a pretrained model from a given path. - * @param {string} modelPath - The path to the pretrained model. - * @param {function} progressCallback - Optional callback function to track progress of the model loading. - * @returns {Promise} - A Promise that resolves to a new instance of VisionEncoderDecoderModel. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session, decoder_merged_session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'encoder_model.onnx', progressCallback), - constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback) - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session, decoder_merged_session); - - } -} - -////////////////////////////////////////////////// -/** - * AutoModelForImageClassification is a class for loading pre-trained image classification models from ONNX format. - */ -class AutoModelForImageClassification { - static MODEL_CLASS_MAPPING = { - 'vit': ViTForImageClassification, - } - - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -/** - * AutoModelForImageSegmentation is a class for loading pre-trained image classification models from ONNX format. - */ -class AutoModelForImageSegmentation { - static MODEL_CLASS_MAPPING = { - 'detr': DetrForSegmentation, - } - - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} -////////////////////////////////////////////////// - - -////////////////////////////////////////////////// -class AutoModelForObjectDetection { - static MODEL_CLASS_MAPPING = { - 'detr': DetrForObjectDetection, - } - - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } -} -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -class Seq2SeqLMOutput extends ModelOutput { - /** - * @param {Tensor} logits - The output logits of the model. - * @param {Array} past_key_values - An array of key/value pairs that represent the previous state of the model. - * @param {Tensor} encoder_outputs - The output of the encoder in a sequence-to-sequence model. - */ - constructor(logits, past_key_values, encoder_outputs) { - super(); - this.logits = logits; - this.past_key_values = past_key_values; - this.encoder_outputs = encoder_outputs; - } -} - -class SequenceClassifierOutput extends ModelOutput { - /** - * @param {Tensor} logits - */ - constructor(logits) { - super(); - this.logits = logits; - } -} - -class TokenClassifierOutput extends ModelOutput { - /** - * @param {Tensor} logits - */ - constructor(logits) { - super(); - this.logits = logits; - } -} - - -class MaskedLMOutput extends ModelOutput { - /** - * @param {Tensor} logits - */ - constructor(logits) { - super(); - this.logits = logits; - } -} - -class QuestionAnsweringModelOutput extends ModelOutput { - /** - * @param {Float32Array} start_logits - The logits for start positions of the answer. - * @param {Float32Array} end_logits - The logits for end positions of the answer. - */ - constructor(start_logits, end_logits) { - super(); - this.start_logits = start_logits; - this.end_logits = end_logits; - } -} - -module.exports = { - AutoModel, - AutoModelForSeq2SeqLM, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForCausalLM, - AutoModelForMaskedLM, - AutoModelForQuestionAnswering, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForObjectDetection, - AutoModelForImageSegmentation, -}; - - -/***/ }), - -/***/ "./src/pipelines.js": -/*!**************************!*\ - !*** ./src/pipelines.js ***! - \**************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { - Callable, - softmax, - indexOfMax, - getTopItems, - cos_sim, - pathJoin, - isString, - getFile, - dot -} = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); - -const { - AutoTokenizer -} = __webpack_require__(/*! ./tokenizers.js */ "./src/tokenizers.js"); -const { - AutoModel, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForQuestionAnswering, - AutoModelForMaskedLM, - AutoModelForSeq2SeqLM, - AutoModelForCausalLM, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForImageSegmentation, - AutoModelForObjectDetection -} = __webpack_require__(/*! ./models.js */ "./src/models.js"); -const { - AutoProcessor, - Processor -} = __webpack_require__(/*! ./processors.js */ "./src/processors.js"); - - -const { - env -} = __webpack_require__(/*! ./env.js */ "./src/env.js"); - -const { Tensor, transpose_data } = __webpack_require__(/*! ./tensor_utils.js */ "./src/tensor_utils.js"); -const { CustomImage } = __webpack_require__(/*! ./image_utils.js */ "./src/image_utils.js"); - -/** - * Prepare images for further tasks. - * @param {any[]} images - images to prepare. - * @returns {Promise} - returns processed images. - * @async - */ -async function prepareImages(images) { - if (!Array.isArray(images)) { - images = [images]; - } - - // Possibly convert any non-images to images - images = await Promise.all(images.map(x => CustomImage.read(x))); - return images; -} - -/** - * Pipeline class for executing a natural language processing task. - * @extends Callable - */ -class Pipeline extends Callable { - /** - * Creates a new instance of Pipeline. - * @param {string} task - The natural language processing task to be performed. - * @param {object} tokenizer - The tokenizer object to be used for tokenizing input texts. - * @param {object} model - The model object to be used for processing input texts. - */ - constructor(task, tokenizer, model) { - super(); - this.task = task; - this.tokenizer = tokenizer; - this.model = model; - } - - /** - * Disposes the model. - * @returns {Promise} - A promise that resolves when the model has been disposed. - */ - async dispose() { - return await this.model.dispose(); - } - - /** - * Executes the natural language processing task. - * @param {any} texts - The input texts to be processed. - * @returns {Promise} - A promise that resolves to an array containing the inputs and outputs of the task. - */ - async _call(texts) { - // Run tokenization - let inputs = this.tokenizer(texts, { - padding: true, - truncation: true - }); - - // Run model - let outputs = await this.model(inputs) - - return [inputs, outputs]; - } -} - -/** - * TextClassificationPipeline class for executing a text classification task. - * @extends Pipeline - */ -class TextClassificationPipeline extends Pipeline { - /** - * Executes the text classification task. - * @param {any} texts - The input texts to be classified. - * @param {object} options - An optional object containing the following properties: - * @param {number} [options.topk=1] - The number of top predictions to be returned. - * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores. - */ - async _call(texts, { - topk = 1 - } = {}) { - - let [inputs, outputs] = await super._call(texts); - - let id2label = this.model.config.id2label; - let toReturn = []; - for (let batch of outputs.logits) { - let scores = getTopItems(softmax(batch.data), topk); - - let vals = scores.map(function (x) { - return { - label: id2label[x[0]], - score: x[1], - } - }); - if (topk === 1) { - toReturn.push(...vals); - } else { - toReturn.push(vals); - } - } - - return Array.isArray(texts) || topk === 1 ? toReturn : toReturn[0]; - } -} - - -/** - * TokenClassificationPipeline class for executing a token classification task. - * @extends Pipeline - */ -class TokenClassificationPipeline extends Pipeline { - /** - * Executes the token classification task. - * @param {any} texts - The input texts to be classified. - * @param {object} options - An optional object containing the following properties: - * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores. - */ - async _call(texts, { - ignore_labels = ['O'], // TODO init param? - } = {}) { - - let isBatched = Array.isArray(texts); - - if (!isBatched) { - texts = [texts]; - } - - let tokenizer = this.tokenizer; - let [inputs, outputs] = await super._call(texts); - - let logits = outputs.logits; - let id2label = this.model.config.id2label; - - let toReturn = []; - for (let i = 0; i < logits.dims[0]; ++i) { - let ids = inputs.input_ids.get(i); - let batch = logits.get(i); - - // List of tokens that aren't ignored - let tokens = []; - for (let j = 0; j < batch.dims[0]; ++j) { - let tokenData = batch.get(j); - let topScoreIndex = indexOfMax(tokenData.data); - - let entity = id2label[topScoreIndex]; - if (ignore_labels.includes(entity)) { - // We predicted a token that should be ignored. So, we skip it. - continue; - } - - // TODO add option to keep special tokens? - let word = tokenizer.decode([ids.get(j)], { skip_special_tokens: true }); - if (word === '') { - // Was a special token. So, we skip it. - continue; - } - - let scores = softmax(tokenData.data); - - tokens.push({ - entity: entity, - score: scores[topScoreIndex], - index: j, - word: word, - - // TODO: null for now, but will add - start: null, - end: null, - }); - } - toReturn.push(tokens); - } - return isBatched ? toReturn : toReturn[0]; - } -} -/** - * QuestionAnsweringPipeline class for executing a question answering task. - * @extends Pipeline - */ -class QuestionAnsweringPipeline extends Pipeline { - /** - * Executes the question answering task. - * @param {string|string[]} question - The question(s) to be answered. - * @param {string|string[]} context - The context(s) where the answer(s) can be found. - * @param {object} options - An optional object containing the following properties: - * @param {number} [options.topk=1] - The number of top answer predictions to be returned. - * @todo fix error below - * @returns {Promise} - A promise that resolves to an array or object containing the predicted answers and scores. - */ - async _call(question, context, { - topk = 1 - } = {}) { - - let inputs = this.tokenizer(question, { - text_pair: context - }) - - let output = await this.model(inputs); - - let toReturn = []; - for (let j = 0; j < output.start_logits.dims[0]; ++j) { - let ids = inputs.input_ids.get(j); - let sepIndex = ids.indexOf(this.tokenizer.sep_token_id); - - let s1 = Array.from(softmax(output.start_logits.get(j).data)) - .map((x, i) => [x, i]) - .filter(x => x[1] > sepIndex); - let e1 = Array.from(softmax(output.end_logits.get(j).data)) - .map((x, i) => [x, i]) - .filter(x => x[1] > sepIndex); - - let options = product(s1, e1) - .filter(x => x[0][1] <= x[1][1]) - .map(x => [x[0][1], x[1][1], x[0][0] * x[1][0]]) - .sort((a, b) => b[2] - a[2]); - - for (let k = 0; k < Math.min(options.length, topk); ++k) { - let [start, end, score] = options[k]; - - let answer_tokens = [...ids].slice(start, end + 1) - - let answer = this.tokenizer.decode(answer_tokens, { - skip_special_tokens: true, - }); - - // TODO add start and end? - // NOTE: HF returns character index - toReturn.push({ - answer, score - }); - } - } - - // Mimic HF's return type based on topk - return (topk === 1) ? toReturn[0] : toReturn; - - } -} - -/** - * Class representing a fill-mask pipeline for natural language processing. - * @extends Pipeline - */ -class FillMaskPipeline extends Pipeline { - /** - * @param {any} texts - */ - async _call(texts, { - topk = 5 - } = {}) { - // Fill the masked token in the text(s) given as inputs. - - // Run tokenization - let [inputs, outputs] = await super._call(texts); - - // Determine indices of mask tokens - // let mask_token_indices = inputs.input_ids.data.map(x => ) - - // let logits = reshape(outputs.logits.data, outputs.logits.dims); - - let tokenizer = this.tokenizer; - - let toReturn = []; - - for (let i = 0; i < inputs.input_ids.dims[0]; ++i) { - let ids = inputs.input_ids.get(i); - let mask_token_index = ids.indexOf(this.tokenizer.mask_token_id) - - if (mask_token_index === -1) { - throw Error(`Mask token (${tokenizer.mask_token}) not found in text.`) - } - let logits = outputs.logits.get(i); - let itemLogits = logits.get(mask_token_index); - - let scores = getTopItems(softmax(itemLogits.data), topk); - - toReturn.push(scores.map(x => { - let sequence = [...ids]; - sequence[mask_token_index] = x[0]; - - return { - score: x[1], - token: x[0], - token_str: tokenizer.model.vocab[x[0]], - sequence: tokenizer.decode(sequence, { skip_special_tokens: true }), - } - })); - } - return Array.isArray(texts) ? toReturn : toReturn[0]; - } -} - -/** - * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks. - * @extends Pipeline - */ -class Text2TextGenerationPipeline extends Pipeline { - _key = null; - - /** - * Fill the masked token in the text(s) given as inputs. - * @async - * @param {string|string[]} texts - The text or array of texts to be processed. - * @param {Object} [options={}] - Options for the fill-mask pipeline. - * @param {number} [options.topk=5] - The number of top-k predictions to return. - * @returns {Promise} An array of objects containing the score, predicted token, predicted token string, - * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text). - * If only one input text is given, the output will be an array of objects. - * @throws {Error} When the mask token is not found in the input text. - */ - async _call(texts, generate_kwargs = {}) { - if (!Array.isArray(texts)) { - texts = [texts]; - } - - // Add global prefix, if present - if (this.model.config.prefix) { - texts = texts.map(x => this.model.config.prefix + x) - } - - // Handle task specific params: - let task_specific_params = this.model.config.task_specific_params - if (task_specific_params && task_specific_params[this.task]) { - // Add prefixes, if present - if (task_specific_params[this.task].prefix) { - texts = texts.map(x => task_specific_params[this.task].prefix + x) - } - - // TODO update generation config - } - - let input_ids = this.tokenizer(texts, { - padding: true, - truncation: true - }).input_ids - - let outputTokenIds = (await this.model.generate(input_ids, generate_kwargs)).flat(); - - /** - * @type {any[]} - */ - let toReturn = this.tokenizer.batch_decode(outputTokenIds, { - skip_special_tokens: true, - }); - if (this._key !== null) { - toReturn = toReturn.map(text => { - return (this._key === null) ? text : { [this._key]: text } - }) - } - return toReturn - } -} - - -/** - * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline. - * @extends Text2TextGenerationPipeline - */ -class SummarizationPipeline extends Text2TextGenerationPipeline { - _key = 'summary_text'; -} - -/** - * TranslationPipeline class to translate text from one language to another using the provided model and tokenizer. - * @extends Text2TextGenerationPipeline - */ -class TranslationPipeline extends Text2TextGenerationPipeline { - _key = 'translation_text'; -} - -/** - * A pipeline for generating text based on an input prompt. - * @extends Pipeline - */ -class TextGenerationPipeline extends Pipeline { - /** - * Generates text based on an input prompt. - * @async - * @param {any} texts - The input prompt or prompts to generate text from. - * @param {object} [generate_kwargs={}] - Additional arguments for text generation. - * @returns {Promise} - The generated text or texts. - */ - async _call(texts, generate_kwargs = {}) { - let stringInput = typeof texts === 'string' || texts instanceof String; - if (stringInput) { - texts = [texts]; - } - - this.tokenizer.padding_side = 'left'; - let inputs = this.tokenizer(texts, { - padding: true, - truncation: true, - }); - - let input_ids = inputs.input_ids; - let attention_mask = inputs.attention_mask; - - /** - * @type {any[]} - */ - let outputTokenIds = await this.model.generate(input_ids, generate_kwargs, null, { - inputs_attention_mask: attention_mask - }); - - let toReturn = outputTokenIds.map((outTokens, i) => { - let startText = texts[i].trim(); - let decoded = this.tokenizer.batch_decode(outTokens, { - skip_special_tokens: true, - }).map(x => { - return { - generated_text: startText + x - } - }); - - return decoded - }); - - return (stringInput && toReturn.length === 1) ? toReturn[0] : toReturn; - } -} - -/** - * Class representing an Zero Shot Classification Pipeline that should only be used with zero shot classification tasks. - * @extends Pipeline - */ -class ZeroShotClassificationPipeline extends Pipeline { - - /** - * @param {string} task - * @param {any} tokenizer - * @param {any} model - */ - constructor(task, tokenizer, model) { - super(task, tokenizer, model); - - // Use model config to get label2id mapping - this.label2id = Object.fromEntries( - Object.entries(this.model.config.label2id).map( - ([k, v]) => [k.toLowerCase(), v] - ) - ); - - this.entailment_id = this.label2id['entailment']; - if (this.entailment_id === undefined) { - console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."); - this.entailment_id = 2; - } - - this.contradiction_id = this.label2id['contradiction']; - if (this.contradiction_id === undefined) { - console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."); - this.contradiction_id = 0; - } - } - /** - * @param {any[]} texts - * @param {string[]} candidate_labels - * @todo fix error below - * @return {Promise<*>} - */ - async _call(texts, candidate_labels, { - hypothesis_template = "This example is {}.", - multi_label = false, - } = {}) { - - let isBatched = Array.isArray(texts); - - if (!isBatched) { - texts = [texts]; - } - if (!Array.isArray(candidate_labels)) { - candidate_labels = [candidate_labels]; - } - - // Insert labels into hypothesis template - let hypotheses = candidate_labels.map( - x => hypothesis_template.replace('{}', x) - ); - - // How to perform the softmax over the logits: - // - true: softmax over the entailment vs. contradiction dim for each label independently - // - false: softmax the "entailment" logits over all candidate labels - let softmaxEach = multi_label || candidate_labels.length === 1; - - let toReturn = []; - for (let premise of texts) { - let entails_logits = []; - - for (let hypothesis of hypotheses) { - let inputs = this.tokenizer(premise, { - text_pair: hypothesis, - }) - let outputs = await this.model(inputs) - - if (softmaxEach) { - entails_logits.push([ - outputs.logits.data[this.contradiction_id], - outputs.logits.data[this.entailment_id] - ]) - } else { - entails_logits.push(outputs.logits.data[this.entailment_id]) - } - } - - let scores; - if (softmaxEach) { - scores = entails_logits.map(x => softmax(x)[1]); - } else { - scores = softmax(entails_logits); - } - - // Sort by scores (desc) and return scores with indices - let scores_sorted = scores - .map((x, i) => [x, i]) - .sort((a, b) => { - return b[0] - a[0]; - }); - - toReturn.push({ - sequence: premise, - labels: scores_sorted.map(x => candidate_labels[x[1]]), - scores: scores_sorted.map(x => x[0]), - }); - } - return isBatched ? toReturn : toReturn[0]; - } -} - - -/** - * Class representing an Embeddings Pipeline that should only be used with sentence-transformers. - * If you want to get the raw outputs from the model, use `AutoModel.from_pretrained(...)`. - * @extends Pipeline - */ -class EmbeddingsPipeline extends Pipeline { - // Should only be used with sentence-transformers - // If you want to get the raw outputs from the model, - // use `AutoModel.from_pretrained(...)` - /** - * Private method to perform mean pooling of the last hidden state followed by a normalization step. - * @param {Tensor} last_hidden_state - Tensor of shape [batchSize, seqLength, embedDim] - * @param {Tensor} attention_mask - Tensor of shape [batchSize, seqLength] - * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim]. - * @private - */ - _mean_pooling(last_hidden_state, attention_mask) { - // last_hidden_state: [batchSize, seqLength, embedDim] - // attention_mask: [batchSize, seqLength] - - let shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]]; - let returnedData = new last_hidden_state.data.constructor(shape[0] * shape[1]) - let [batchSize, seqLength, embedDim] = last_hidden_state.dims; - - let outIndex = 0; - for (let i = 0; i < batchSize; ++i) { - let offset = i * embedDim * seqLength; - - for (let k = 0; k < embedDim; ++k) { - let sum = 0; - let count = 0; - - let attnMaskOffset = i * seqLength; - let offset2 = offset + k; - // Pool over all words in sequence - for (let j = 0; j < seqLength; ++j) { - // index into attention mask - let attn = Number(attention_mask.data[attnMaskOffset + j]); - - count += attn; - sum += last_hidden_state.data[offset2 + j * embedDim] * attn; - } - - let avg = sum / count; - returnedData[outIndex++] = avg; - } - } - - return new Tensor( - last_hidden_state.type, - returnedData, - shape - ) - } - - /** - * Private method to normalize the input tensor along dim=1. - * NOTE: only works for tensors of shape [batchSize, embedDim]. Operates in-place. - * @param {any} tensor - Tensor of shape [batchSize, embedDim] - * @returns {any} Returns the same Tensor object after performing normalization. - * @private - */ - _normalize(tensor) { - for (let batch of tensor) { - let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b)) - - for (let i = 0; i < batch.data.length; ++i) { - batch.data[i] /= norm; - } - } - return tensor; - } - - /** - * Method to perform mean pooling and normalization of the input texts. - * @param {string[]} texts - An array of texts to embed. - * @returns {Promise} Returns a new Tensor of shape [batchSize, embedDim]. - */ - async _call(texts) { - let [inputs, outputs] = await super._call(texts); - - // Perform mean pooling, followed by a normalization step - return this._normalize(this._mean_pooling(outputs.last_hidden_state, inputs.attention_mask)); - } - - /** - * @param {number[]} arr1 - * @param {number[]} arr2 - */ - cos_sim(arr1, arr2, is_normalised = false) { - // Compute cosine similarity. If `is_normalised`, then - // use the dot product instead of the cosine similarity - return is_normalised ? dot(arr1, arr2) : cos_sim(arr1, arr2); - } -} - -/** - * A class representing an automatic speech recognition pipeline. - * @extends Pipeline - */ -class AutomaticSpeechRecognitionPipeline extends Pipeline { - - /** - * Creates an instance of AutomaticSpeechRecognitionPipeline. - * @param {string} task - The type of the task for this pipeline. Currently only "asr" is supported. - * @param {object} tokenizer - The tokenizer to be used for pre-processing inputs. - * @param {object} model - The model to be used for the task. - * @param {object} processor - The processor to be used for pre-processing audio inputs. - */ - constructor(task, tokenizer, model, processor) { - super(task, tokenizer, model); - this.processor = processor; - } - - /** - * Preprocesses the input audio for the AutomaticSpeechRecognitionPipeline. - * @param {any} audio - The audio to be preprocessed. - * @param {number} sampling_rate - The sampling rate of the audio. - * @returns {Promise} - A promise that resolves to the preprocessed audio data. - * @private - */ - async _preprocess(audio, sampling_rate) { - if (isString(audio)) { - // Attempting to load from path - - if (typeof AudioContext === 'undefined') { - // Running in node or an environment without AudioContext - throw Error( - "Unable to load audio from path/URL since `AudioContext` is not available in your environment. " + - "As a result, audio data must be passed directly to the processor. " + - "If you are running in node.js, you can use an external library (e.g., https://github.com/audiojs/web-audio-api) to do this." - ) - } - const response = await (await getFile(audio)).arrayBuffer(); - const audioCTX = new AudioContext({ sampleRate: sampling_rate }); - const decoded = await audioCTX.decodeAudioData(response); - - // We now replicate HuggingFace's `ffmpeg_read` method: - // - // When downmixing a stereo audio file to mono using the -ac 1 option in FFmpeg, - // the audio signal is summed across both channels to create a single mono channel. - // However, if the audio is at full scale (i.e. the highest possible volume level), - // the summing of the two channels can cause the audio signal to clip or distort. - - // To prevent this clipping, FFmpeg applies a scaling factor of 1/sqrt(2) (~ 0.707) - // to the audio signal before summing the two channels. This scaling factor ensures - // that the combined audio signal will not exceed the maximum possible level, even - // if both channels are at full scale. - - // After applying this scaling factor, the audio signal from both channels is summed - // to create a single mono channel. It's worth noting that this scaling factor is - // only applied when downmixing stereo audio to mono using the -ac 1 option in FFmpeg. - // If you're using a different downmixing method, or if you're not downmixing the - // audio at all, this scaling factor may not be needed. - const SCALING_FACTOR = Math.sqrt(2); - - let left = decoded.getChannelData(0); - let right = decoded.getChannelData(1); - - audio = new Float32Array(left.length); - for (let i = 0; i < decoded.length; i++) { - audio[i] = SCALING_FACTOR * (left[i] + right[i]) / 2; - } - } - - return audio; - } - - /** - * Asynchronously processes audio and generates text transcription using the model. - * @param {Array} audio - The audio to be transcribed. Can be a single Float32Array or an array of Float32Arrays. - * @param {Object} [kwargs={}] - Optional arguments. - * @param {boolean} [kwargs.return_timestamps] - Whether to return timestamps or not. Default is false. - * @param {number} [kwargs.chunk_length_s] - The length of audio chunks to process in seconds. Default is 0 (no chunking). - * @param {number} [kwargs.stride_length_s] - The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to chunk_length_s / 6. - * @param {function} [kwargs.chunk_callback] - Callback function to be called with each chunk processed. - * @param {boolean} [kwargs.force_full_sequences] - Whether to force outputting full sequences or not. Default is false. - * @returns {Promise} A Promise that resolves to an object containing the transcription text and optionally timestamps if return_timestamps is true. - */ - async _call(audio, kwargs = {}) { - let return_timestamps = kwargs.return_timestamps ?? false; - let chunk_length_s = kwargs.chunk_length_s ?? 0; - let stride_length_s = kwargs.stride_length_s ?? null; - let chunk_callback = kwargs.chunk_callback ?? null; - let force_full_sequences = kwargs.force_full_sequences ?? false; - - // TODO - // task = 'transcribe', - // language = 'en', - - let single = !Array.isArray(audio) - if (single) { - audio = [audio] - } - - const sampling_rate = this.processor.feature_extractor.config.sampling_rate; - const time_precision = this.processor.feature_extractor.config.chunk_length / this.model.config.max_source_positions; - - let toReturn = []; - for (let aud of audio) { - aud = await this._preprocess(aud, sampling_rate) - - /** @type {any[]} */ - let chunks = []; - if (chunk_length_s > 0) { - if (stride_length_s === null) { - stride_length_s = chunk_length_s / 6; - } else if (chunk_length_s <= stride_length_s) { - throw Error("`chunk_length_s` must be larger than `stride_length_s`.") - } - - // TODO support different stride_length_s (for left and right) - - const window = sampling_rate * chunk_length_s; - const stride = sampling_rate * stride_length_s; - const jump = window - 2 * stride; - let offset = 0; - - // Create subarrays of audio with overlaps - - while (offset < aud.length) { - let subarr = aud.subarray(offset, offset + window); - let feature = await this.processor(subarr); - - let isFirst = offset === 0; - let isLast = offset + jump >= aud.length; - chunks.push({ - stride: [ - subarr.length, - isFirst ? 0 : stride, - isLast ? 0 : stride - ], - input_features: feature.input_features, - is_last: isLast - }) - offset += jump; - } - - } else { - chunks = [{ - stride: [aud.length, 0, 0], - input_features: (await this.processor(aud)).input_features, - is_last: true - }] - } - - // Generate for each set of input features - for (let chunk of chunks) { - // NOTE: doing sequentially for now - let data = await this.model.generate(chunk.input_features, kwargs); - - // Get top beam - chunk.tokens = data[0].flat() - - // convert stride to seconds - chunk.stride = chunk.stride.map(x => x / sampling_rate); - - if (chunk_callback !== null) { - chunk_callback(chunk) - } - } - - // Merge text chunks - let [full_text, optional] = this.tokenizer._decode_asr(chunks, { - time_precision: time_precision, - return_timestamps: return_timestamps, - force_full_sequences: force_full_sequences - }); - - toReturn.push({ text: full_text, ...optional }) - } - return single ? toReturn[0] : toReturn; - } -} - -/** - * A pipeline for performing image-to-text tasks. - * @extends Pipeline - */ -class ImageToTextPipeline extends Pipeline { - /** - * Create an instance of ImageToTextPipeline. - * @param {string} task - The task name. - * @param {object} tokenizer - The tokenizer to use. - * @param {object} model - The generator model to use. - * @param {object} processor - The image processor to use. - */ - constructor(task, tokenizer, model, processor) { - super(task, tokenizer, model); - this.processor = processor; - } - - /** - * @param {any[]} images - */ - async _call(images, generate_kwargs = {}) { - let isBatched = Array.isArray(images); - - images = await prepareImages(images); - - let pixel_values = (await this.processor(images)).pixel_values; - - let toReturn = []; - for (let batch of pixel_values) { - batch.dims = [1, ...batch.dims] - let output = (await this.model.generate(batch, generate_kwargs)).flat(); - let decoded = this.tokenizer.batch_decode(output, { - skip_special_tokens: true, - }).map(x => { - return { generated_text: x.trim() } - }) - toReturn.push(decoded); - } - - return isBatched ? toReturn : toReturn[0]; - } -} - -/** - * A class representing an image classification pipeline. - * @extends Pipeline - */ -class ImageClassificationPipeline extends Pipeline { - /** - * Create a new ImageClassificationPipeline. - * @param {string} task - The task of the pipeline. - * @param {Object} model - The model to use for classification. - * @param {Function} processor - The function to preprocess images. - */ - constructor(task, model, processor) { - super(task, null, model); // TODO tokenizer - this.processor = processor; - } - - /** - * Classify the given images. - * @async - * @param {any} images - The images to classify. - * @param {Object} options - The options to use for classification. - * @param {number} [options.topk=1] - The number of top results to return. - * @returns {Promise} - The top classification results for the images. - */ - async _call(images, { - topk = 1 - } = {}) { - let isBatched = Array.isArray(images); - images = await prepareImages(images); - - let inputs = await this.processor(images); - let output = await this.model(inputs); - - let id2label = this.model.config.id2label; - let toReturn = []; - for (let batch of output.logits) { - let scores = getTopItems(softmax(batch.data), topk); - - let vals = scores.map(function (x) { - return { - label: id2label[x[0]], - score: x[1], - } - }); - if (topk === 1) { - toReturn.push(...vals); - } else { - toReturn.push(vals); - } - } - - return isBatched || topk === 1 ? toReturn : toReturn[0]; - } - -} - -/** - * ImageSegmentationPipeline class for executing an image-segmentation task. - * @extends Pipeline - */ -class ImageSegmentationPipeline extends Pipeline { - /** - * Create a new ImageSegmentationPipeline. - * @param {string} task - The task of the pipeline. - * @param {Object} model - The model to use for classification. - * @param {Processor} processor - The function to preprocess images. - */ - constructor(task, model, processor) { - super(task, null, model); // TODO tokenizer - this.processor = processor; - - this.subtasks_mapping = { - // Mapping of subtasks to their corresponding post-processing function names. - panoptic: 'post_process_panoptic_segmentation', - instance: 'post_process_instance_segmentation', - semantic: 'post_process_semantic_segmentation' - } - } - - /** - * Segment the input images. - * @param {Array} images - The input images. - * @param {Object} options - The options to use for segmentation. - * @param {number} [options.threshold=0.5] - Probability threshold to filter out predicted masks. - * @param {number} [options.mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values. - * @param {number} [options.overlap_mask_area_threshold=0.8] - Mask overlap threshold to eliminate small, disconnected segments. - * @param {null|string} [options.subtask=null] - Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`], depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order). - * @param {Array} [options.label_ids_to_fuse=null] - List of label ids to fuse. If not set, do not fuse any labels. - * @param {Array} [options.target_sizes=null] - List of target sizes for the input images. If not set, use the original image sizes. - * @returns {Promise} - The annotated segments. - */ - async _call(images, { - threshold = 0.5, - mask_threshold = 0.5, - overlap_mask_area_threshold = 0.8, - label_ids_to_fuse = null, - target_sizes = null, - subtask = null, // TODO use - } = {}) { - let isBatched = Array.isArray(images); - - if (isBatched && images.length !== 1) { - throw Error("Image segmentation pipeline currently only supports a batch size of 1."); - } - - images = await prepareImages(images); - let imageSizes = images.map(x => [x.height, x.width]); - - let inputs = await this.processor(images); - let output = await this.model(inputs); - - let fn = null; - if (subtask !== null) { - fn = this.subtasks_mapping[subtask]; - } else { - for (let [task, func] of Object.entries(this.subtasks_mapping)) { - if (func in this.processor.feature_extractor) { - fn = this.processor.feature_extractor[func].bind(this.processor.feature_extractor); - subtask = task; - break; - } - } - } - - // add annotations - let annotation = []; - - if (subtask === 'panoptic' || subtask === 'instance') { - - let processed = fn( - output, - threshold, - mask_threshold, - overlap_mask_area_threshold, - label_ids_to_fuse, - target_sizes ?? imageSizes, // TODO FIX? - )[0]; - - let segmentation = processed.segmentation; - let id2label = this.model.config.id2label; - - for (let segment of processed.segments_info) { - let maskData = new Uint8ClampedArray(segmentation.data.length); - for (let i = 0; i < segmentation.data.length; ++i) { - if (segmentation.data[i] === segment.id) { - maskData[i] = 255; - } - } - - let mask = new CustomImage(maskData, segmentation.dims[1], segmentation.dims[0], 1) - - annotation.push({ - score: segment.score, - label: id2label[segment.label_id], - mask: mask - }) - } - - } else if (subtask === 'semantic') { - throw Error(`semantic segmentation not yet supported.`); - - } else { - throw Error(`Subtask ${subtask} not supported.`); - } - - return annotation; - } -} - - -/** - * Class representing a zero-shot image classification pipeline. - * @extends Pipeline - */ -class ZeroShotImageClassificationPipeline extends Pipeline { - - /** - * Create a zero-shot image classification pipeline. - * @param {string} task - The task of the pipeline. - * @param {Object} tokenizer - The tokenizer to use. - * @param {Object} model - The model to use. - * @param {Function} processor - The image processing function. - */ - constructor(task, tokenizer, model, processor) { - super(task, tokenizer, model); - this.processor = processor; - } - - /** - * Classify the input images with candidate labels using a zero-shot approach. - * @param {Array} images - The input images. - * @param {Array} candidate_labels - The candidate labels. - * @param {Object} options - The options for the classification. - * @param {string} [options.hypothesis_template] - The hypothesis template to use for zero-shot classification. Default: "This is a photo of {}". - * @todo fix error below - * @returns {Promise} An array of classifications for each input image or a single classification object if only one input image is provided. - */ - async _call(images, candidate_labels, { - hypothesis_template = "This is a photo of {}" - } = {}) { - let isBatched = Array.isArray(images); - images = await prepareImages(images); - - // Insert label into hypothesis template - let texts = candidate_labels.map( - x => hypothesis_template.replace('{}', x) - ); - - // Run tokenization - let text_inputs = this.tokenizer(texts, { - padding: true, - truncation: true - }); - - // Compare each image with each candidate label - let image_inputs = await this.processor(images); - let output = await this.model({ ...text_inputs, ...image_inputs }); - - let toReturn = []; - for (let batch of output.logits_per_image) { - // Compute softmax per image - let probs = softmax(batch.data); - - toReturn.push([...probs].map((x, i) => { - return { - score: x, - label: candidate_labels[i] - } - })); - } - - return isBatched ? toReturn : toReturn[0]; - } -} - - -class ObjectDetectionPipeline extends Pipeline { - /** - * @param {string} task - * @param {any} model - * @param {any} processor - */ - constructor(task, model, processor) { - super(task, null, model); // TODO tokenizer - this.processor = processor; - } - - /** - * @param {any[]} images - */ - async _call(images, { - threshold = 0.5, - percentage = false, // get in percentage (true) or in pixels (false) - } = {}) { - let isBatched = Array.isArray(images); - - if (isBatched && images.length !== 1) { - throw Error("Object detection pipeline currently only supports a batch size of 1."); - } - images = await prepareImages(images); - - let imageSizes = percentage ? null : images.map(x => [x.height, x.width]); - - let inputs = await this.processor(images); - let output = await this.model(inputs); - - let processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes); - - // Add labels - let id2label = this.model.config.id2label; - processed.forEach(x => x.labels = x.classes.map(y => id2label[y])); - - return isBatched ? processed : processed[0]; - } -} - -const SUPPORTED_TASKS = { - "text-classification": { - "tokenizer": AutoTokenizer, - "pipeline": TextClassificationPipeline, - "model": AutoModelForSequenceClassification, - "default": { - "model": "distilbert-base-uncased-finetuned-sst-2-english", - }, - "type": "text", - }, - "token-classification": { - "tokenizer": AutoTokenizer, - "pipeline": TokenClassificationPipeline, - "model": AutoModelForTokenClassification, - "default": { - "model": "Davlan/bert-base-multilingual-cased-ner-hrl", - }, - "type": "text", - }, - "question-answering": { - "tokenizer": AutoTokenizer, - "pipeline": QuestionAnsweringPipeline, - "model": AutoModelForQuestionAnswering, - "default": { - "model": "distilbert-base-cased-distilled-squad" - }, - "type": "text", - }, - - "fill-mask": { - "tokenizer": AutoTokenizer, - "pipeline": FillMaskPipeline, - "model": AutoModelForMaskedLM, - "default": { - "model": "bert-base-uncased" - }, - "type": "text", - }, - "summarization": { - "tokenizer": AutoTokenizer, - "pipeline": SummarizationPipeline, - "model": AutoModelForSeq2SeqLM, - "default": { - "model": "sshleifer/distilbart-cnn-6-6" - }, - "type": "text", - }, - "translation": { - "tokenizer": AutoTokenizer, - "pipeline": TranslationPipeline, - "model": AutoModelForSeq2SeqLM, - "default": { - "model": "t5-small" - }, - "type": "text", - }, - "text2text-generation": { - "tokenizer": AutoTokenizer, - "pipeline": Text2TextGenerationPipeline, - "model": AutoModelForSeq2SeqLM, - "default": { - "model": "google/flan-t5-small" - }, - "type": "text", - }, - "text-generation": { - "tokenizer": AutoTokenizer, - "pipeline": TextGenerationPipeline, - "model": AutoModelForCausalLM, - "default": { - "model": "gpt2" - }, - "type": "text", - }, - "zero-shot-classification": { - "tokenizer": AutoTokenizer, - "pipeline": ZeroShotClassificationPipeline, - "model": AutoModelForSequenceClassification, - "default": { - "model": "typeform/distilbert-base-uncased-mnli", - }, - "type": "text", - }, - - "automatic-speech-recognition": { - "tokenizer": AutoTokenizer, - "pipeline": AutomaticSpeechRecognitionPipeline, - "model": AutoModelForSeq2SeqLM, - "processor": AutoProcessor, - "default": { - "model": "openai/whisper-tiny.en" - }, - "type": "multimodal", - }, - - "image-to-text": { - "tokenizer": AutoTokenizer, - "pipeline": ImageToTextPipeline, - "model": AutoModelForVision2Seq, - "processor": AutoProcessor, - "default": { - "model": "nlpconnect/vit-gpt2-image-captioning" - }, - "type": "multimodal", - }, - - "image-classification": { - // no tokenizer - "pipeline": ImageClassificationPipeline, - "model": AutoModelForImageClassification, - "processor": AutoProcessor, - "default": { - "model": "google/vit-base-patch16-224" - }, - "type": "multimodal", - }, - - "image-segmentation": { - // no tokenizer - "pipeline": ImageSegmentationPipeline, - "model": AutoModelForImageSegmentation, - "processor": AutoProcessor, - "default": { - "model": "facebook/detr-resnet-50-panoptic" - }, - "type": "multimodal", - }, - - "zero-shot-image-classification": { - // no tokenizer - "tokenizer": AutoTokenizer, - "pipeline": ZeroShotImageClassificationPipeline, - "model": AutoModel, - "processor": AutoProcessor, - "default": { - "model": "openai/clip-vit-base-patch32" - }, - "type": "multimodal", - }, - - "object-detection": { - // no tokenizer - "pipeline": ObjectDetectionPipeline, - "model": AutoModelForObjectDetection, - "processor": AutoProcessor, - "default": { - "model": "facebook/detr-resnet-50" - }, - "type": "multimodal", - }, - - // This task is not supported in HuggingFace transformers, but serves as a useful interface - // for dealing with sentence-transformers (https://huggingface.co/sentence-transformers) - "embeddings": { - "tokenizer": AutoTokenizer, - "pipeline": EmbeddingsPipeline, - "model": AutoModel, - "default": { - "model": "sentence-transformers/all-MiniLM-L6-v2" - }, - "type": "text", - }, -} - -const TASK_NAME_MAPPING = { - // Fix mismatch between pipeline's task name and exports (folder name) - 'text-classification': 'sequence-classification', - 'embeddings': 'default', - 'fill-mask': 'masked-lm', - - 'text2text-generation': 'seq2seq-lm-with-past', - 'summarization': 'seq2seq-lm-with-past', - 'text-generation': 'causal-lm-with-past', - - 'automatic-speech-recognition': 'speech2seq-lm-with-past', - 'image-to-text': 'vision2seq-lm-with-past', - - 'zero-shot-image-classification': 'default', - 'zero-shot-classification': 'sequence-classification' -} - -const TASK_PREFIX_MAPPING = { - // if task starts with one of these, set the corresponding folder name - 'translation': 'seq2seq-lm-with-past', -} - - -const TASK_ALIASES = { - "sentiment-analysis": "text-classification", - "ner": "token-classification", - "vqa": "visual-question-answering", -} - -/** - * Constructs a pipeline for a specified task with optional model and progress callback. - * - * @async - * @function - * @param {string} task - The task to perform, e.g. "text-generation". - * @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. - * @param {object} [options] - Optional parameters for the pipeline. - * @param {function} [options.progress_callback=null] - A function to call with progress updates. - * @returns {Promise} A Pipeline object for the specified task. - * @todo fix error below - * @throws {Error} If an unsupported pipeline is requested. - */ -async function pipeline( - task, - model = null, - { - progress_callback = null - } = {} -) { - // Helper method to construct pipeline - - // Apply aliases - task = TASK_ALIASES[task] ?? task; - - // Get pipeline info - let pipelineInfo = SUPPORTED_TASKS[task.split('_', 1)[0]]; - if (!pipelineInfo) { - throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`) - } - - - // Use model if specified, otherwise, use default - if (!model) { - model = pipelineInfo.default.model - console.log(`No model specified. Using default model: "${model}".`); - } - - // determine suffix - let suffix = TASK_NAME_MAPPING[task]; - if (!suffix) { - // try get from suffix - for (const [prefix, mapping] of Object.entries(TASK_PREFIX_MAPPING)) { - if (task.startsWith(prefix)) { - suffix = mapping; - break; - } - } - } - - if (!suffix) { - // Still not set... so, we default to the name given - suffix = task; - } - - // Construct model path - model = pathJoin( - (env.remoteModels) ? env.remoteURL : env.localURL, // host prefix - model, // model name - suffix, // task suffix - ) - - let tokenizerClass = pipelineInfo.tokenizer; - let modelClass = pipelineInfo.model; - let pipelineClass = pipelineInfo.pipeline; - let processorClass = pipelineInfo.processor; - - let promises = []; - - if (tokenizerClass) { - promises.push( - AutoTokenizer.from_pretrained(model, progress_callback), - ) - } - if (modelClass) { - promises.push( - modelClass.from_pretrained(model, progress_callback) - ) - } - - if (processorClass) { - promises.push( - processorClass.from_pretrained(model, progress_callback) - ) - } - - // Load tokenizer and model - let items = await Promise.all(promises) - // TODO: fix error below - return new pipelineClass(task, ...items); - -} - -/** - * Compute the Cartesian product of given arrays - * @param {...Array} a - Arrays to compute the product - * @returns {Array} - Returns the computed Cartesian product as an array - */ -function product(...a) { - // Cartesian product of items - // Adapted from https://stackoverflow.com/a/43053803 - return a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e]))); -} - -module.exports = { - pipeline -}; - - -/***/ }), - -/***/ "./src/processors.js": -/*!***************************!*\ - !*** ./src/processors.js ***! - \***************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -const { - Callable, - fetchJSON, - indexOfMax, - softmax, -} = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); - - -const FFT = __webpack_require__(/*! ./fft.js */ "./src/fft.js"); -const { Tensor, transpose, cat, interpolate } = __webpack_require__(/*! ./tensor_utils.js */ "./src/tensor_utils.js"); - -const { CustomImage } = __webpack_require__(/*! ./image_utils.js */ "./src/image_utils.js"); -/** - * Helper class to determine model type from config - */ -class AutoProcessor { - /** - * Returns a new instance of a Processor with a feature extractor - * based on the configuration file located at `modelPath`. - * - * @param {string} modelPath - The path to the model directory. - * @param {function} progressCallback - A callback function to track the loading progress (optional). - * @returns {Promise} A Promise that resolves with a new instance of a Processor. - * @throws {Error} If the feature extractor type specified in the configuration file is unknown. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let preprocessorConfig = await fetchJSON(modelPath, 'preprocessor_config.json', progressCallback) - - let processor_class; - let feature_extractor; - - switch (preprocessorConfig.feature_extractor_type) { - case 'WhisperFeatureExtractor': - feature_extractor = new WhisperFeatureExtractor(preprocessorConfig) - break; - case 'ViTFeatureExtractor': - feature_extractor = new ViTFeatureExtractor(preprocessorConfig) - break; - case 'DetrFeatureExtractor': - feature_extractor = new DetrFeatureExtractor(preprocessorConfig) - break; - default: - if (preprocessorConfig.size !== undefined) { - // Assume ImageFeatureExtractor - console.warn('Feature extractor type not specified, assuming ImageFeatureExtractor due to size parameter in config.') - feature_extractor = new ImageFeatureExtractor(preprocessorConfig) - - } else { - throw new Error(`Unknown Feature Extractor type: ${preprocessorConfig.feature_extractor_type}`); - - } - } - - switch (preprocessorConfig.processor_class) { - case 'WhisperProcessor': - processor_class = WhisperProcessor; - break; - default: - // No associated processor class, use default - processor_class = Processor; - } - - return new processor_class(feature_extractor); - } -} - -/** - * Base class for feature extractors. - * - * @extends Callable - */ -class FeatureExtractor extends Callable { - /** - * Constructs a new FeatureExtractor instance. - * - * @param {object} config - The configuration for the feature extractor. - */ - constructor(config) { - super(); - this.config = config - } -} - -/** - * Feature extractor for Vision Transformer (ViT) models. - * - * @extends FeatureExtractor - */ -class ImageFeatureExtractor extends FeatureExtractor { - - /** - * Constructs a new ViTFeatureExtractor instance. - * - * @param {object} config - The configuration for the feature extractor. - * @param {number[]} config.image_mean - The mean values for image normalization. - * @param {number[]} config.image_std - The standard deviation values for image normalization. - * @param {boolean} config.do_rescale - Whether to rescale the image pixel values to the [0,1] range. - * @param {boolean} config.do_normalize - Whether to normalize the image pixel values. - * @param {boolean} config.do_resize - Whether to resize the image. - * @param {number} config.size - The size to resize the image to. - */ - constructor(config) { - super(config); - - this.image_mean = this.config.image_mean; - if (!Array.isArray(this.image_mean)) { - this.image_mean = new Array(3).fill(this.image_mean); - } - - this.image_std = this.config.image_std; - if (!Array.isArray(this.image_std)) { - this.image_std = new Array(3).fill(this.image_std); - } - - this.do_rescale = this.config.do_rescale ?? true; - this.do_normalize = this.config.do_normalize; - - this.do_resize = this.config.do_resize; - this.size = this.config.size; - - this.max_size = this.config.max_size; - - // TODO use these - this.do_center_crop = this.config.do_center_crop; - this.crop_size = this.config.crop_size; - } - - /** - * Preprocesses the given image. - * - * @param {CustomImage} image - The image to preprocess. - * @returns {Promise} The preprocessed image as a Tensor. - */ - async preprocess(image) { - - const srcWidth = image.width; // original width - const srcHeight = image.height; // original height - - // First, resize all images - if (this.do_resize) { - // If `max_size` is set, maintain aspect ratio and resize to `size` - // while keeping the largest dimension <= `max_size` - if (this.max_size !== undefined) { - // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/ - // Try resize so that shortest edge is `this.size` (target) - const ratio = Math.max(this.size / srcWidth, this.size / srcHeight); - const newWidth = srcWidth * ratio; - const newHeight = srcHeight * ratio; - - // The new width and height might be greater than `this.max_size`, so - // we downscale again to ensure the largest dimension is `this.max_size` - const downscaleFactor = Math.min(this.max_size / newWidth, this.max_size / newHeight, 1); - - // Perform resize - image = await image.resize(Math.floor(newWidth * downscaleFactor), Math.floor(newHeight * downscaleFactor)); - - } else { - image = await image.resize(this.size, this.size); - } - } - - // Convert image to RGB - image = image.rgb(); - - const pixelData = Float32Array.from(image.data); - - if (this.do_rescale) { - for (let i = 0; i < pixelData.length; ++i) { - pixelData[i] = pixelData[i] / 255; - } - } - - if (this.do_normalize) { - for (let i = 0; i < pixelData.length; i += 3) { - for (let j = 0; j < 3; ++j) { - pixelData[i + j] = (pixelData[i + j] - this.image_mean[j]) / this.image_std[j]; - } - } - } - - let imgDims = [image.height, image.width, 3]; - let img = new Tensor('float32', pixelData, imgDims); - let transposed = transpose(img, [2, 0, 1]); // hwc -> chw - - return transposed; - } - - /** - * Calls the feature extraction process on an array of image - * URLs, preprocesses each image, and concatenates the resulting - * features into a single Tensor. - * @param {any} images - The URL(s) of the image(s) to extract features from. - * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images. - */ - async _call(images) { - if (!Array.isArray(images)) { - images = [images]; - } - images = await Promise.all(images.map(x => this.preprocess(x))); - - images.forEach(x => x.dims = [1, ...x.dims]); // add batch dimension - - images = cat(images); - // TODO concatenate on dim=0 - return { - pixel_values: images - } - } - -} - -class ViTFeatureExtractor extends ImageFeatureExtractor { } - -/** - * Detr Feature Extractor. - * - * @extends ImageFeatureExtractor - */ -class DetrFeatureExtractor extends ImageFeatureExtractor { - /** - * Calls the feature extraction process on an array of image - * URLs, preprocesses each image, and concatenates the resulting - * features into a single Tensor. - * @param {any} urls - The URL(s) of the image(s) to extract features from. - * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images. - */ - async _call(urls) { - let result = await super._call(urls); - - // TODO support differently-sized images, for now assume all images are the same size. - // TODO support different mask sizes (not just 64x64) - // Currently, just fill pixel mask with 1s - let maskSize = [result.pixel_values.dims[0], 64, 64]; - result.pixel_mask = new Tensor( - 'int64', - // TODO: fix error below - new BigInt64Array(maskSize.reduce((a, b) => a * b)).fill(1n), - maskSize - ); - - return result; - } - - /** - * @param {number[]} arr - The URL(s) of the image(s) to extract features from. - * @returns {number[]} An object containing the concatenated pixel values of the preprocessed images. - */ - center_to_corners_format([centerX, centerY, width, height]) { - return [ - centerX - width / 2, - centerY - height / 2, - centerX + width / 2, - centerY + height / 2 - ]; - } - - /** - * @param {{ logits: any; pred_boxes: any; }} outputs - * @return {any} - */ - post_process_object_detection(outputs, threshold = 0.5, target_sizes = null) { - const out_logits = outputs.logits; - const out_bbox = outputs.pred_boxes; - const [batch_size, num_boxes, num_classes] = out_logits.dims; - - if (target_sizes !== null && target_sizes.length !== batch_size) { - throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits") - } - let toReturn = []; - for (let i = 0; i < batch_size; ++i) { - let target_size = target_sizes !== null ? target_sizes[i] : null; - let info = { - boxes: [], - classes: [], - scores: [] - } - let logits = out_logits.get(i); - let bbox = out_bbox.get(i); - - for (let j = 0; j < num_boxes; ++j) { - let logit = logits.get(j); - - // Get most probable class - let maxIndex = indexOfMax(logit.data); - - if (maxIndex === num_classes - 1) { - // This is the background class, skip it - continue; - } - - // Compute softmax over classes - let probs = softmax(logit.data); - - let score = probs[maxIndex]; - if (score > threshold) { - // Some class has a high enough probability - /** @type {number[]} */ - let box = bbox.get(j); - - // convert to [x0, y0, x1, y1] format - box = this.center_to_corners_format(box) - if (target_size !== null) { - box = box.map((x, i) => x * target_size[(i + 1) % 2]) - } - - info.boxes.push(box); - info.classes.push(maxIndex); - info.scores.push(score); - } - } - toReturn.push(info); - } - return toReturn; - } - - /** - * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`. - * @param {Tensor} class_logits - The class logits. - * @param {Tensor} mask_logits - The mask logits. - * @param {number} object_mask_threshold - A number between 0 and 1 used to binarize the masks. - * @param {number} num_labels - The number of labels. - * @returns {[Tensor[], number[], number[]]} - The binarized masks, the scores, and the labels. - */ - remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) { - - let mask_probs_item = []; - let pred_scores_item = []; - let pred_labels_item = []; - - for (let j = 0; j < class_logits.dims[0]; ++j) { - let cls = class_logits.get(j); - let mask = mask_logits.get(j); - - let pred_label = indexOfMax(cls.data); - if (pred_label === num_labels) { - // Is the background, so we ignore it - continue; - } - - let scores = softmax(cls.data); - let pred_score = scores[pred_label]; - if (pred_score > object_mask_threshold) { - mask_probs_item.push(mask); - pred_scores_item.push(pred_score); - pred_labels_item.push(pred_label); - } - } - - return [mask_probs_item, pred_scores_item, pred_labels_item]; - - } - - /** - * Checks whether the segment is valid or not. - * @param {Int32Array} mask_labels - Labels for each pixel in the mask. - * @param {Tensor[]} mask_probs - Probabilities for each pixel in the masks. - * @param {number} k - The class id of the segment. - * @param {number} mask_threshold - The mask threshold. - * @param {number} overlap_mask_area_threshold - The overlap mask area threshold. - * @returns {[boolean, number[]]} - Whether the segment is valid or not, and the indices of the valid labels. - */ - check_segment_validity( - mask_labels, - mask_probs, - k, - mask_threshold = 0.5, - overlap_mask_area_threshold = 0.8 - ) { - // mask_k is a 1D array of indices, indicating where the mask is equal to k - let mask_k = []; - let mask_k_area = 0; - let original_area = 0; - - // Compute the area of all the stuff in query k - for (let i = 0; i < mask_labels.length; ++i) { - if (mask_labels[i] === k) { - mask_k.push(i); - ++mask_k_area; - } - - if (mask_probs[k].data[i] >= mask_threshold) { - ++original_area; - } - } - let mask_exists = mask_k_area > 0 && original_area > 0; - - // Eliminate disconnected tiny segments - if (mask_exists) { - // Perform additional check - let area_ratio = mask_k_area / original_area; - mask_exists = area_ratio > overlap_mask_area_threshold; - } - - return [mask_exists, mask_k] - } - - /** - * Computes the segments. - * @param {Tensor[]} mask_probs - The mask probabilities. - * @param {number[]} pred_scores - The predicted scores. - * @param {number[]} pred_labels - The predicted labels. - * @param {number} mask_threshold - The mask threshold. - * @param {number} overlap_mask_area_threshold - The overlap mask area threshold. - * @param {Set} label_ids_to_fuse - The label ids to fuse. - * @param {number[]} target_size - The target size of the image. - * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} - The computed segments. - */ - compute_segments( - mask_probs, - pred_scores, - pred_labels, - mask_threshold, - overlap_mask_area_threshold, - label_ids_to_fuse = null, - target_size = null, - ) { - let [height, width] = target_size ?? mask_probs[0].dims; - - let segmentation = new Tensor( - 'int32', - new Int32Array(height * width), - [height, width] - ); - let segments = []; - - // 1. If target_size is not null, we need to resize the masks to the target size - if (target_size !== null) { - // resize the masks to the target size - for (let i = 0; i < mask_probs.length; ++i) { - mask_probs[i] = interpolate(mask_probs[i], target_size, 'bilinear', false); - } - } - - // 2. Weigh each mask by its prediction score - // NOTE: `mask_probs` is updated in-place - // - // Temporary storage for the best label/scores for each pixel ([height, width]): - let mask_labels = new Int32Array(mask_probs[0].data.length); - let bestScores = new Float32Array(mask_probs[0].data.length); - - for (let i = 0; i < mask_probs.length; ++i) { - let score = pred_scores[i]; - - for (let j = 0; j < mask_probs[i].data.length; ++j) { - mask_probs[i].data[j] *= score - if (mask_probs[i].data[j] > bestScores[j]) { - mask_labels[j] = i; - bestScores[j] = mask_probs[i].data[j]; - } - } - } - - let current_segment_id = 0; - - // let stuff_memory_list = {} - for (let k = 0; k < pred_labels.length; ++k) { - let pred_class = pred_labels[k]; - - // TODO add `should_fuse` - // let should_fuse = pred_class in label_ids_to_fuse - - // Check if mask exists and large enough to be a segment - let [mask_exists, mask_k] = this.check_segment_validity( - mask_labels, - mask_probs, - k, - mask_threshold, - overlap_mask_area_threshold - ) - - if (!mask_exists) { - // Nothing to see here - continue; - } - - // TODO - // if (pred_class in stuff_memory_list) { - // current_segment_id = stuff_memory_list[pred_class] - // } else { - // current_segment_id += 1; - // } - ++current_segment_id; - - - // Add current object segment to final segmentation map - for (let index of mask_k) { - segmentation.data[index] = current_segment_id; - } - - segments.push({ - id: current_segment_id, - label_id: pred_class, - // was_fused: should_fuse, TODO - score: pred_scores[k], - }) - - // TODO - // if(should_fuse){ - // stuff_memory_list[pred_class] = current_segment_id - // } - } - - return [segmentation, segments]; - } - - /** - * Post-process the model output to generate the final panoptic segmentation. - * @param {*} outputs - The model output to post process - * @param {number} [threshold=0.5] - The probability score threshold to keep predicted instance masks. - * @param {number} [mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values. - * @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. - * @param {Set} [label_ids_to_fuse=null] - The labels in this state will have all their instances be fused together. - * @param {number[][]} [target_sizes=null] - The target sizes to resize the masks to. - * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>} - */ - post_process_panoptic_segmentation( - outputs, - threshold = 0.5, - mask_threshold = 0.5, - overlap_mask_area_threshold = 0.8, - label_ids_to_fuse = null, - target_sizes = null, - ) { - if (label_ids_to_fuse === null) { - console.warn("`label_ids_to_fuse` unset. No instance will be fused.") - label_ids_to_fuse = new Set(); - } - - const class_queries_logits = outputs.logits; // [batch_size, num_queries, num_classes+1] - const masks_queries_logits = outputs.pred_masks; // [batch_size, num_queries, height, width] - - const mask_probs = masks_queries_logits.sigmoid() // [batch_size, num_queries, height, width] - - let [batch_size, num_queries, num_labels] = class_queries_logits.dims; - num_labels -= 1; // Remove last class (background) - - if (target_sizes !== null && target_sizes.length !== batch_size) { - throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits") - } - - let toReturn = []; - for (let i = 0; i < batch_size; ++i) { - let target_size = target_sizes !== null ? target_sizes[i] : null; - - let class_logits = class_queries_logits.get(i); - let mask_logits = mask_probs.get(i); - - let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels); - - if (pred_labels_item.length === 0) { - // No mask found - let [height, width] = target_size ?? mask_logits.dims.slice(-2); - - let segmentation = new Tensor( - 'int32', - new Int32Array(height * width).fill(-1), - [height, width] - ) - toReturn.push({ - segmentation: segmentation, - segments_info: [] - }); - continue; - } - - - // Get segmentation map and segment information of batch item - let [segmentation, segments] = this.compute_segments( - mask_probs_item, - pred_scores_item, - pred_labels_item, - mask_threshold, - overlap_mask_area_threshold, - label_ids_to_fuse, - target_size, - ) - - toReturn.push({ - segmentation: segmentation, - segments_info: segments - }) - } - - return toReturn; - } - - post_process_instance_segmentation() { - // TODO - throw Error("Not implemented yet"); - } -} - - -class WhisperFeatureExtractor extends FeatureExtractor { - - /** - * Calculates the index offset for a given index and window size. - * @param {number} i - The index. - * @param {number} w - The window size. - * @returns {number} The index offset. - */ - calcOffset(i, w) { - return Math.abs((i + w) % (2 * w) - w); - } - - /** - * Pads an array with a reflected version of itself on both ends. - * @param {Float32Array} array - The array to pad. - * @param {number} left - The amount of padding to add to the left. - * @param {number} right - The amount of padding to add to the right. - * @returns {Float32Array} The padded array. - */ - padReflect(array, left, right) { - const padded = new Float32Array(array.length + left + right); - const w = array.length - 1; - - for (let i = 0; i < array.length; ++i) { - padded[left + i] = array[i]; - } - - for (let i = 1; i <= left; ++i) { - padded[left - i] = array[this.calcOffset(i, w)]; - } - - for (let i = 1; i <= right; ++i) { - padded[w + left + i] = array[this.calcOffset(w - i, w)]; - } - - return padded; - } - - /** - * Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal. - * - * @param {number[][]} frames - A 2D array representing the signal frames. - * @param {number[]} window - A 1D array representing the window to be applied to the frames. - * @returns {Object} An object with the following properties: - * - data: A 1D array representing the complex STFT of the signal. - * - dims: An array representing the dimensions of the STFT data, i.e. [num_frames, num_fft_bins]. - */ - stft(frames, window) { - // Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal. - // - // NOTE: Since the window width is not a power of 2, we must - // perform Fast Fourier Transform with chirp-z transform: - // https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156 - - // Helper variables - const fft_size = this.config.n_fft; - const a = 2 * (fft_size - 1); - const b = 2 * (2 * fft_size - 1); - const nextP2 = 2 ** (Math.ceil(Math.log2(b))) - const num_fft_bins = fft_size + 2; - - // Preallocate array to store output - // double since we store complex numbers - const data = new Float32Array(num_fft_bins * frames.length); - - // Define buffers - // Compute chirp for transform - const chirp = new Float32Array(b); - const ichirp = new Float32Array(nextP2); - const buffer1 = new Float32Array(nextP2); - const buffer2 = new Float32Array(nextP2); - const outBuffer = new Float32Array(nextP2); - const outBuffer2 = new Float32Array(nextP2); - const outBuffer3 = new Float32Array(nextP2); - - // Compute complex exponentiation - const theta = -2 * Math.PI / fft_size; - const baseR = Math.cos(theta); - const baseI = Math.sin(theta); - - // Precompute helper for chirp-z transform - for (let i = 0; i < b >> 1; ++i) { - // Compute complex power: - const e = (i + 1 - fft_size) ** 2 / 2.0; - - // Compute the modulus and argument of the result - const result_mod = Math.sqrt(baseR ** 2 + baseI ** 2) ** e; - const result_arg = e * Math.atan2(baseI, baseR); - - // Convert the result back to rectangular form - // and assign to chirp and ichirp - let i2 = 2 * i; - chirp[i2] = result_mod * Math.cos(result_arg); - chirp[i2 + 1] = result_mod * Math.sin(result_arg); - - // conjugate - ichirp[i2] = chirp[i2]; - ichirp[i2 + 1] = - chirp[i2 + 1]; - } - const slicedChirp = chirp.subarray(a, b); - - // create object to perform Fast Fourier Transforms - // with `nextP2` complex numbers - const f = new FFT(nextP2 >> 1); - // TODO: decide between Float32Array and Float64Array - f.transform(outBuffer, ichirp); - - for (let i = 0; i < frames.length; ++i) { - const frame = frames[i]; - - for (let j = 0; j < slicedChirp.length; j += 2) { - const j2 = j + 1 - const j3 = j >> 1; - - const a_real = frame[j3] * window[j3]; - buffer1[j] = a_real * slicedChirp[j]; - buffer1[j2] = a_real * slicedChirp[j2]; - } - // TODO: decide between Float32Array and Float64Array - f.transform(outBuffer2, buffer1); - - for (let j = 0; j < outBuffer.length; j += 2) { - const j2 = j + 1; - - buffer2[j] = outBuffer2[j] * outBuffer[j] - outBuffer2[j2] * outBuffer[j2] - buffer2[j2] = outBuffer2[j] * outBuffer[j2] + outBuffer2[j2] * outBuffer[j] - } - // TODO: decide between Float32Array and Float64Array - f.inverseTransform(outBuffer3, buffer2) - - const offset = i * num_fft_bins; - for (let j = 0; j < num_fft_bins; j += 2) { - const a_real = outBuffer3[j + a]; - const a_imag = outBuffer3[j + a + 1]; - const b_real = slicedChirp[j]; - const b_imag = slicedChirp[j + 1]; - - // TODO write as transpose - const o1 = offset + j; - data[o1] = a_real * b_real - a_imag * b_imag - data[o1 + 1] = a_real * b_imag + a_imag * b_real - } - } - - return { - data: data, - dims: [frames.length, num_fft_bins] // [3001, 402] - }; - } - - /** - * Creates an array of frames from a given waveform. - * - * @param {Float32Array} waveform - The waveform to create frames from. - * @param {boolean} [center=true] - Whether to center the frames on their corresponding positions in the waveform. Defaults to true. - * @returns {Array} An array of frames. - */ - fram_wave(waveform, center = true) { - const frames = []; - const half_window = Math.floor((this.config.n_fft - 1) / 2) + 1; - const waveformLength = waveform.length; - - for (let i = 0; i < waveformLength + 1; i += this.config.hop_length) { - - let frame; - if (center) { - - let frameStart = i > half_window ? i - half_window : 0; - let frameEnd = - i < waveformLength - half_window - ? i + half_window - : waveformLength; - - frame = waveform.subarray(frameStart, frameEnd) - - if (frameStart === 0) { - frame = this.padReflect( - frame, - -i + half_window, - 0 - ) - - } else if (frameEnd === waveformLength) { - frame = this.padReflect( - frame, - 0, - i - waveformLength + half_window - ) - } - - } else { - frame = new Float32Array(this.config.n_fft); - const frameArray = waveform.subarray(i, i + this.config.n_fft); - - if (frameArray.length < this.config.n_fft) { - frame.set(frameArray); - frame.fill(0, frameArray.length, this.config.n_fft) - } else { - frame = frameArray; - } - - } - frames.push(frame); - } - - return frames; - } - - /** - * Generates a Hanning window of length M. - * - * @param {number} M - The length of the Hanning window to generate. - * @returns {*} - The generated Hanning window. - */ - hanning(M) { - if (M < 1) { - return []; - } - if (M === 1) { - return [1]; - } - const denom = M - 1; - const cos_vals = new Float32Array(denom); - for (let i = 0; i < denom; ++i) { - const n = 2 * i - M + 1; - cos_vals[i] = 0.5 + 0.5 * Math.cos(Math.PI * n / denom); - } - return cos_vals; - } - - /** - * Computes the log-Mel spectrogram of the provided audio waveform. - * @param {Float32Array} waveform - The audio waveform to process. - * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers. - */ - _extract_fbank_features(waveform) { - // Compute the log-Mel spectrogram of the provided audio - - const buffer = new Float32Array(this.config.n_samples); - buffer.set(waveform) - - const window = this.hanning(this.config.n_fft + 1) - const frames = this.fram_wave(buffer) - - const stft = this.stft(frames, window) - - const stftData = stft.data; - const d1 = stft.dims[0] - 1; // Ignore last row - const d2 = stft.dims[1] >> 1; // Only need to store real numbers now - - // compute magnitudes - // NOTE: Unlinke the original implementation, we do not - // transpose since we perform matrix multiplication later - const magnitudes = new Float32Array(d1 * d2); - for (let i = 0; i < d1; ++i) { - for (let j = 0; j < d2; ++j) { - // let outOffset = (j * d1 + i); // transpose - let outOffset = i * d2 + j; - let inOffset = outOffset << 1; // * 2 since complex - let magnitude = stftData[inOffset] ** 2 + stftData[inOffset + 1] ** 2 - magnitudes[outOffset] = magnitude; - } - } - - const mel_filters = this.config.mel_filters - const num_mel_filters = mel_filters.length; - - const mel_spec = new Float32Array(num_mel_filters * d1); - let mIndex = 0; - - // Perform matrix muliplication: - // mel_spec = filters @ magnitudes - // - filters.shape=(80, 201) - // - magnitudes.shape=(201, 3000) - // - mel_spec.shape=(80, 3000) - for (let i = 0; i < num_mel_filters; ++i) { - const mel_filter = mel_filters[i]; - - for (let j = 0; j < d1; ++j) { - let sum = 0; - - // perform dot product - for (let k = 0; k < d2; ++k) { - sum += mel_filter[k] * magnitudes[j * d2 + k]; - } - - mel_spec[mIndex++] = sum; - } - } - - const a_min = 1e-10; - const log_spec = new Float32Array(mel_spec.length); - - let maxLogSpec = 0; - for (let i = 0; i < mel_spec.length; i++) { - const clipped = Math.max(a_min, mel_spec[i]); - const log10 = Math.log10(clipped); - log_spec[i] = log10; - maxLogSpec = Math.max(log10, maxLogSpec) - } - - for (let i = 0; i < log_spec.length; i++) { - log_spec[i] = Math.max(log_spec[i], maxLogSpec - 8); - log_spec[i] = (log_spec[i] + 4) / 4; - } - - return { - data: log_spec, - dims: [num_mel_filters, d1] - }; - } - - /** - * Asynchronously extracts features from a given audio using the provided configuration. - * @param {Float32Array} audio - The audio data as a Float32Array. - * @returns {Promise<{ input_features: Tensor }>} - A Promise resolving to an object containing the extracted input features as a Tensor. - * @async - */ - async _call(audio) { - // audio is a float32array - - if (audio.length > this.config.n_samples) { - console.warn( - "Attempting to extract features for audio longer than 30 seconds. " + - "If using a pipeline to extract transcript from a long audio clip, " + - "remember to specify `chunk_length_s` and/or `stride_length_s`." - ); - } - let waveform = audio.slice(0, this.config.n_samples) - - let features = this._extract_fbank_features(waveform); - - return { - input_features: new Tensor('float32', - features.data, - [1, ...features.dims] - ) - }; - } -} - -/** - * Represents a Processor that extracts features from an input. - * @extends Callable - */ -class Processor extends Callable { - /** - * Creates a new Processor with the given feature extractor. - * @param {function} feature_extractor - The function used to extract features from the input. - */ - constructor(feature_extractor) { - super(); - this.feature_extractor = feature_extractor; - // TODO use tokenizer here? - } - - /** - * Calls the feature_extractor function with the given input. - * @param {any} input - The input to extract features from. - * @returns {Promise} A Promise that resolves with the extracted features. - * @async - */ - async _call(input) { - return await this.feature_extractor(input); - } -} - -/** - * Represents a WhisperProcessor that extracts features from an audio input. - * @extends Processor - */ -class WhisperProcessor extends Processor { - /** - * Calls the feature_extractor function with the given audio input. - * @param {any} audio - The audio input to extract features from. - * @returns {Promise} A Promise that resolves with the extracted features. - * @async - */ - async _call(audio) { - return await this.feature_extractor(audio) - } -} - - -module.exports = { - AutoProcessor, - Processor, -} - - -/***/ }), - -/***/ "./src/samplers.js": -/*!*************************!*\ - !*** ./src/samplers.js ***! - \*************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { - Callable, - indexOfMax, - softmax, - log_softmax, - getTopItems -} = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); - -/** - * Sampler is a base class for all sampling methods used for text generation. - */ -class Sampler extends Callable { - /** - * Creates a new Sampler object with the specified temperature. - * @param {number} temperature - The temperature to use when sampling. Higher values result in more random samples. - */ - constructor(temperature) { - super(); - this.temperature = temperature; - } - - /** - * Executes the sampler, using the specified logits. - * @param {any} logits - * @param {number} index - * @returns {void} - */ - _call(logits, index = -1) { - // Sample from logits, of dims [batch, sequence_length, vocab_size]. - // If index is specified, sample from [batch, index, vocab_size]. - return this.sample(logits, index); - } - - /** - * Abstract method for sampling the logits. - * @param {any} logits - * @param {number} index - * @throws {Error} - */ - sample(logits, index) { - throw Error("sample should be implemented in subclasses.") - } - - /** - * Returns the specified logits as an array, with temperature applied. - * @param {any} logits - * @param {number} index - * @returns {Array} - */ - getLogits(logits, index) { - let vocabSize = logits.dims[2]; - - let logs = logits.data; - - if (index === -1) { - logs = logs.slice(-vocabSize); - } else { - let startIndex = index * vocabSize; - logs = logs.slice(startIndex, startIndex + vocabSize); - } - - // add temperature - if (this.temperature > 0) { - logs = logs.map(x => x / this.temperature) - } - return logs; - } - - /** - * Selects an item randomly based on the specified probabilities. - * @param {Array} probabilities - An array of probabilities to use for selection. - * @returns {number} The index of the selected item. - */ - randomSelect(probabilities) { - // Return index of chosen item - let sumProbabilities = probabilities.reduce((acc, curr) => acc + curr, 0); - - let r = Math.random() * sumProbabilities; - for (let i = 0; i < probabilities.length; ++i) { - r -= probabilities[i]; - if (r <= 0) { - return i; - } - } - return 0; // return first (most probable) as a fallback - } - - /** - * Returns a Sampler object based on the specified options. - * @param {object} generation_config - An object containing options for the sampler. - * @returns {Sampler} A Sampler object. - */ - static getSampler(generation_config) { - if (generation_config.num_beams > 1) { - return new BeamSearchSampler( - generation_config.temperature, - generation_config.num_beams, - generation_config.do_sample, - generation_config.top_k, - ); - - } else if (generation_config.do_sample) { - return new TopKSampler( - generation_config.temperature, - generation_config.top_k, - ); - - } else { - if (generation_config.num_return_sequences > 1) { - throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${generation_config.num_return_sequences}.`) - } - return new GreedySampler(generation_config.temperature); - } - } -} - -/** - * Class representing a Greedy Sampler. - * @extends Sampler - */ -class GreedySampler extends Sampler { - /** - * Sample the maximum probability of a given logits tensor. - * @param {any} logits - * @param {number} [index=-1] - * @returns {Array} - An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search). - */ - sample(logits, index = -1) { - // NOTE: no need to do log_softmax here since we only take the maximum - let logs = this.getLogits(logits, index); - let argmax = indexOfMax(logs); - - // Note: score is meaningless in this context, since we are performing - // greedy search (p = 1 => log(p) = 0) - return [ - [argmax, 0] - ]; - } -} - -/** - * Class representing a TopKSampler. - * @extends Sampler - */ -class TopKSampler extends Sampler { - /** - * Create a TopKSampler. - * @param {number} temperature - * @param {number} k - */ - constructor(temperature, k) { - super(temperature); - this.k = k; - } - - /** - * Sample from the logits using the top-k sampling strategy. - * @param {any} logits - * @param {number} index - * @returns {Array} - */ - sample(logits, index = -1) { - let [batchSize, seqLength, vocabSize] = logits.dims; - let k = vocabSize; - if (this.k > 0) { - k = Math.min(this.k, k); - } - - let logs = this.getLogits(logits, index); - - // Get top k tokens - let topLogits = getTopItems(logs, k); - - // Compute softmax over logits - let probabilities = softmax(topLogits.map(x => x[1])); - - let sampledIndex = this.randomSelect(probabilities); - - let tokenId = topLogits[sampledIndex][0]; - let score = Math.log(probabilities[sampledIndex]); - return [ - [tokenId, score] - ]; - } -} - -/** - * Class representing a beam search sampler for generating sequences. - * @extends Sampler - */ -class BeamSearchSampler extends Sampler { - /** - * Create a BeamSearchSampler. - * @param {number} temperature - * @param {number} num_beams - * @param {boolean} do_sample - * @param {number} top_k - */ - constructor(temperature, num_beams, do_sample, top_k) { - super(temperature); - this.num_beams = num_beams; // maximum number of beams - this.do_sample = do_sample; // if true, perform multinomial sampling - - this.top_k = top_k; // if do_sample, sample from top k items - } - - /** - * Samples from the logits to generate a sequence using beam search. - * @param {any} logits - The logits to sample from. - * @param {number} [index=-1] - The index to sample from, if applicable. - * @returns {Array} - An array of arrays containing tokens and scores. - */ - sample(logits, index = -1) { - - let logs = this.getLogits(logits, index); - - if (this.do_sample || this.top_k > 0) { - const [batchSize, seqLength, vocabSize] = logits.dims; - - let k = vocabSize; - if (this.top_k > 0) { - k = Math.min(this.top_k, k); - } - const topLogits = getTopItems(logs, k); - - // Compute softmax over top k logits - const probabilities = softmax(topLogits.map(x => x[1])); - - return Array.from({ length: this.num_beams }, () => { - const sampledIndex = this.randomSelect(probabilities); - const tokenId = topLogits[sampledIndex][0]; - return [tokenId, Math.log(probabilities[sampledIndex])]; - }); - - } else { - // first perform log softmax to get scores over whole distribution - const logProbabilities = log_softmax(logs); - const topLogits = getTopItems(logProbabilities, this.num_beams); - return topLogits; - } - } -} - -module.exports = { - Sampler, - GreedySampler, - TopKSampler, - BeamSearchSampler -} - - -/***/ }), - -/***/ "./src/tensor_utils.js": -/*!*****************************!*\ - !*** ./src/tensor_utils.js ***! - \*****************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { ONNX } = __webpack_require__(/*! ./backends/onnx.js */ "./src/backends/onnx.js"); - -const { interpolate: interpolate_data, transpose: transpose_data } = __webpack_require__(/*! ./math_utils.js */ "./src/math_utils.js"); - - -/** - * @typedef {import('./math_utils.js').AnyTypedArray} AnyTypedArray - */ - -const ONNXTensor = ONNX.Tensor; - -// TODO: fix error below -class Tensor extends ONNXTensor { - /** - * Create a new Tensor or copy an existing Tensor. - * @param {[string, Array|AnyTypedArray, number[]]|[ONNXTensor]} args - */ - constructor(...args) { - if (args[0] instanceof ONNX.Tensor) { - // Create shallow copy - super(args[0].type, args[0].data, args[0].dims); - - } else { - // Create new - super(...args) - } - } - - /** - * Returns an iterator object for iterating over the tensor data in row-major order. - * If the tensor has more than one dimension, the iterator will yield subarrays. - * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order. - */ - *[Symbol.iterator]() { - const [iterLength, ...iterDims] = this.dims; - - if (iterDims.length > 0) { - const iterSize = iterDims.reduce((a, b) => a * b); - for (let i = 0; i < iterLength; ++i) { - yield this._subarray(i, iterSize, iterDims); - } - } else { - yield* this.data - } - - } - - /** - * - * @param {number} index - * @returns {Tensor} - * @todo Set type based on dims - */ - get(index) { - const iterDims = this.dims.slice(1); - if (iterDims.length > 0) { - const iterSize = iterDims.reduce((a, b) => a * b); - return this._subarray(index, iterSize, iterDims); - } else { - return this.data[index]; - } - } - - /** - * @param {any} item - * @returns {number} - */ - indexOf(item) { - for (let index = 0; index < this.data.length; ++index) { - // Note: == instead of === so we can match Ints with BigInts - if (this.data[index] == item) { - return index; - } - } - return -1; - } - - /** - * @param {number} index - * @param {number} iterSize - * @param {any} iterDims - * @returns {Tensor} - */ - _subarray(index, iterSize, iterDims) { - let data = this.data.subarray(index * iterSize, (index + 1) * iterSize); - return new Tensor(this.type, data, iterDims); - } - - tolist() { - // Convert tensor data to a n-dimensional JS list - return reshape(this.data, this.dims) - } - - /** - * Return a new Tensor the sigmoid function applied to each element. - * @returns {Tensor} - The tensor with the sigmoid function applied. - */ - sigmoid() { - return this.clone().sigmoid_(); - } - - /** - * Applies the sigmoid function to the tensor in place. - * @returns {Tensor} - Returns `this`. - */ - sigmoid_() { - for (let i = 0; i < this.data.length; ++i) { - this.data[i] = 1 / (1 + Math.exp(-this.data[i])); - } - return this; - } - - clone() { - return new Tensor(this.type, this.data.slice(), this.dims.slice()); - } - - // TODO add .slice() - - /** - * Return a transposed version of this Tensor, according to the provided dimensions. - * @param {...number} dims - Dimensions to transpose. - * @returns {Tensor} - The transposed tensor. - */ - transpose(...dims) { - return transpose(this, dims); - } -} - -/** - * This creates a nested array of a given type and depth (see examples). - * - * @example - * NestArray; // string[] - * @example - * NestArray; // number[][] - * @example - * NestArray; // string[][][] etc. - * @template T - * @template {number} Depth - * @template {never[]} [Acc=[]] - * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray - */ - -/** - * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions. - * - * @example - * reshape([10 ], [1 ]); // Type: number[] Value: [10] - * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]] - * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] - * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]] - * @param {T[]} data - The input array to reshape. - * @param {DIM} dimensions - The target shape/dimensions. - * @template T - * @template {[number]|[number, number]|[number, number, number]|[number, number, number, number]} DIM - * @returns {NestArray} The reshaped array. - */ -function reshape(data, dimensions) { - - const totalElements = data.length; - const dimensionSize = dimensions.reduce((a, b) => a * b); - - if (totalElements !== dimensionSize) { - throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`); - } - - /** @type {any} */ - let reshapedArray = data; - - for (let i = dimensions.length - 1; i >= 0; i--) { - reshapedArray = reshapedArray.reduce((acc, val) => { - let lastArray = acc[acc.length - 1]; - - if (lastArray.length < dimensions[i]) { - lastArray.push(val); - } else { - acc.push([val]); - } - - return acc; - }, [[]]); - } - - return reshapedArray[0]; -} - -/** - * Transposes a tensor according to the provided axes. - * @param {any} tensor - The input tensor to transpose. - * @param {Array} axes - The axes to transpose the tensor along. - * @returns {Tensor} The transposed tensor. - */ -function transpose(tensor, axes) { - const [transposedData, shape] = transpose_data(tensor.data, tensor.dims, axes); - return new Tensor(tensor.type, transposedData, shape); -} - - -/** - * Concatenates an array of tensors along the 0th dimension. - * - * @param {any} tensors - The array of tensors to concatenate. - * @returns {Tensor} - The concatenated tensor. - */ -function cat(tensors) { - if (tensors.length === 0) { - return tensors[0]; - } - // NOTE: tensors must be batched - // NOTE: currently only supports dim=0 - // TODO: add support for dim != 0 - - - let tensorType = tensors[0].type; - let tensorShape = [...tensors[0].dims]; - tensorShape[0] = tensors.length; - - // Calculate total size to allocate - let total = 0; - for (let t of tensors) { - total += t.data.length; - } - - // Create output tensor of same type as first - let data = new tensors[0].data.constructor(total); - - let offset = 0; - for (let t of tensors) { - data.set(t.data, offset); - offset += t.data.length; - } - - return new Tensor(tensorType, data, tensorShape) -} - -/** - * Interpolates an Tensor to the given size. - * @param {Tensor} input - The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w]) - * @param {number[]} size - The output size of the image - * @param {string} mode - The interpolation mode - * @param {boolean} align_corners - Whether to align corners. - * @returns {Tensor} - The interpolated tensor. - */ -function interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) { - - // Input image dimensions - const in_channels = input.dims.at(-3) ?? 1; - const in_height = input.dims.at(-2); - const in_width = input.dims.at(-1); - - let output = interpolate_data( - input.data, - [in_channels, in_height, in_width], - [out_height, out_width], - mode, - align_corners - ); - return new Tensor(input.type, output, [in_channels, out_height, out_width]); -} - -module.exports = { - Tensor, - transpose, - cat, - interpolate, - transpose_data, -} - - -/***/ }), - -/***/ "./src/tokenizers.js": -/*!***************************!*\ - !*** ./src/tokenizers.js ***! - \***************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { - Callable, - fetchJSON, - reverseDictionary, - escapeRegExp, - isIntegralNumber, - min, -} = __webpack_require__(/*! ./utils.js */ "./src/utils.js"); - -const { Tensor } = __webpack_require__(/*! ./tensor_utils.js */ "./src/tensor_utils.js") - -/** - * Abstract base class for tokenizer models. - * - * @extends Callable - */ -class TokenizerModel extends Callable { - /** - * Creates a new instance of TokenizerModel. - * @param {object} config - The configuration object for the TokenizerModel. - */ - constructor(config) { - super(); - this.config = config; - } - /** - * Instantiates a new TokenizerModel instance based on the configuration object provided. - * @param {object} config - The configuration object for the TokenizerModel. - * @param {...*} args - Optional arguments to pass to the specific TokenizerModel constructor. - * @returns {TokenizerModel} A new instance of a TokenizerModel. - * @throws Will throw an error if the TokenizerModel type in the config is not recognized. - */ - static fromConfig(config, ...args) { - switch (config.type) { - case 'WordPiece': - return new WordPieceTokenizer(config); - case 'Unigram': - // TODO: fix error below - return new Unigram(config, ...args); - - case 'BPE': - // TODO: fix error below - return new BPE(config, ...args); - default: - throw new Error(`Unknown TokenizerModel type: ${config.type}`); - } - } - - /** - * Internal function to call the TokenizerModel instance. - * @param {string[]} tokens - The tokens to encode. - * @returns {number[]} The encoded token IDs. - */ - _call(tokens) { - return this.encode(tokens); - } - - /** - * Encodes a list of tokens into a list of token IDs. - * @param {string[]} tokens - The tokens to encode. - * @returns {number[]} The encoded token IDs. - * @throws Will throw an error if not implemented in a subclass. - */ - encode(tokens) { - throw Error("encode should be implemented in subclass.") - } - - /** - * Converts a list of tokens into a list of token IDs. - * @param {string[]} tokens - The tokens to convert. - * @returns {number[]} The converted token IDs. - */ - convert_tokens_to_ids(tokens) { - return tokens.map(t => this.tokens_to_ids[t] ?? this.unk_token_id); - } - - /** - * Converts a list of token IDs into a list of tokens. - * @param {number[]} ids - The token IDs to convert. - * @returns {string[]} The converted tokens. - */ - convert_ids_to_tokens(ids) { - return ids.map(i => this.vocab[i] ?? this.unk_token); - } -} - -/** - * A subclass of TokenizerModel that uses WordPiece encoding to encode tokens. - * @extends TokenizerModel - */ -class WordPieceTokenizer extends TokenizerModel { - /** - * @param {Object} config - The configuration object. - * @param {Object.} config.vocab - A mapping of tokens to ids. - * @param {string} config.unk_token - The unknown token string. - * @param {string} config.continuing_subword_prefix - The prefix to use for continuing subwords. - */ - constructor(config) { - super(config); - /** - * A mapping of tokens to ids. - * @type {Object.} - */ - this.tokens_to_ids = config.vocab; - - /** - * The id of the unknown token. - * @type {number} - */ - this.unk_token_id = this.tokens_to_ids[config.unk_token]; - - /** - * The unknown token string. - * @type {string} - */ - this.unk_token = config.unk_token; - - let e = Object.entries(this.tokens_to_ids); - - /** - * An array of tokens. - * @type {string[]} - */ - this.vocab = Array(e.length); - - for (const [key, value] of e) { - this.vocab[value] = key; - } - } - - /** - * Encodes an array of tokens using WordPiece encoding. - * @param {Array} tokens - The tokens to encode. - * @returns {Array} An array of encoded tokens. - */ - encode(tokens) { - let outputTokens = []; - for (let token of tokens) { - let chars = [...token]; - // TODO add - // if len(chars) > self.max_input_chars_per_word: - // output_tokens.append(self.unk_token) - // continue - - let isUnknown = false; - let start = 0; - let subTokens = []; - - while (start < chars.length) { - let end = chars.length; - let currentSubstring = null; - while (start < end) { - let substr = chars.slice(start, end).join(''); - - if (start > 0) { - substr = this.config.continuing_subword_prefix + substr; - } - if (this.vocab.includes(substr)) { - currentSubstring = substr; - break; - } - - --end; - } - if (currentSubstring == null) { - isUnknown = true; - break; - } - subTokens.push(currentSubstring); - start = end; - } - if (isUnknown) { - outputTokens.push(this.unk_token); - } else { - outputTokens.push(...subTokens); - } - } - - return outputTokens; - } - -} - -/** - * Class representing a Unigram tokenizer model. - * @extends TokenizerModel - */ -class Unigram extends TokenizerModel { - /** - * Create a new Unigram tokenizer model. - * @param {object} config - The configuration object for the Unigram model. - * @param {object} moreConfig - Additional configuration object for the Unigram model. - */ - constructor(config, moreConfig) { - super(config); - - this.vocab = config.vocab.map(x => x[0]); - this.scores = config.vocab.map(x => x[1]); - - this.unk_token_id = config.unk_id; - this.unk_token = this.vocab[config.unk_id]; - - this.tokens_to_ids = Object.fromEntries(this.vocab.map((x, i) => [x, i])); - this.bosToken = ' '; // beginning of a sentence token - - this.bosTokenId = this.tokens_to_ids[this.bosToken]; - this.eosToken = moreConfig.eos_token; - - this.eosTokenId = this.tokens_to_ids[this.eosToken]; - this.unkToken = this.vocab[this.unk_token_id]; - - this.minScore = min(this.scores); - - this.unkScore = this.minScore - 10.0; - this.scores[this.unk_token_id] = this.unkScore; - - this.trie = new CharTrie(); - this.trie.extend(this.vocab) - } - - /** - * Populates lattice nodes. - * @param {TokenLattice} lattice - The token lattice to populate with nodes. - */ - populateNodes(lattice) { - const sentence = lattice.sentence; - const len = sentence.length; - let beginPos = 0; - while (beginPos < len) { - const mblen = 1; - let hasSingleNode = false; - const tokens = []; - // TODO: fix error below - for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) { - tokens.push(token); - const tokenId = this.tokens_to_ids[token]; - const tokenScore = this.scores[tokenId]; - const n = token.length; - lattice.insert(beginPos, n, tokenScore, tokenId); - if (!hasSingleNode && n == mblen) { - hasSingleNode = true; - } - } - if (!hasSingleNode) { - lattice.insert(beginPos, mblen, this.unkScore, this.unk_token_id); - } - beginPos += mblen; - } - } - - /** - * Encodes an array of tokens into an array of subtokens using the unigram model. - * - * @param {string} normalized - The normalized string. - * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model. - */ - tokenize(normalized) { - const lattice = new TokenLattice(normalized, this.bosTokenId, this.eosTokenId); - this.populateNodes(lattice); - return lattice.tokens(); - } - - /** - * Encodes an array of tokens using WordPiece encoding. - * @param {Array} tokens - The tokens to encode. - * @returns {Array} An array of encoded tokens. - */ - encode(tokens) { - let toReturn = []; - for (let token of tokens) { - const tokenized = this.tokenize(token); - toReturn.push(...tokenized); - } - return toReturn; - } - -} - -/** - * Returns list of utf-8 byte and a mapping to unicode strings. - * Specifically avoids mapping to whitespace/control characters the BPE code barfs on. - * @returns {Object} Object with utf-8 byte keys and unicode string values. - */ -const BYTES_TO_UNICODE = (() => { - // Returns list of utf-8 byte and a mapping to unicode strings. - // We specifically avoids mapping to whitespace/control characters - // the bpe code barfs on. - - const bs = [ - ...Array.from({ length: "~".charCodeAt(0) - "!".charCodeAt(0) + 1 }, (_, i) => i + "!".charCodeAt(0)), - ...Array.from({ length: "¬".charCodeAt(0) - "¡".charCodeAt(0) + 1 }, (_, i) => i + "¡".charCodeAt(0)), - ...Array.from({ length: "ÿ".charCodeAt(0) - "®".charCodeAt(0) + 1 }, (_, i) => i + "®".charCodeAt(0)), - ]; - let cs = bs.slice(); - let n = 0; - for (let b = 0; b < 256; b++) { - if (!bs.includes(b)) { - bs.push(b); - cs.push(256 + n); - n += 1; - } - } - let ccs = cs.map(n => String.fromCharCode(n)); - return Object.fromEntries(bs.map((b, i) => [b, ccs[i]])); -})(); - -const UNICODE_TO_BYTES = reverseDictionary(BYTES_TO_UNICODE); - -/** - * BPE class for encoding text into Byte-Pair-Encoding (BPE) tokens. - * @extends TokenizerModel - */ -class BPE extends TokenizerModel { - /** - * Create a BPE instance. - * @param {Object} config - The configuration object for BPE. - * @param {Object} config.vocab - A dictionary containing the vocabulary with tokens as keys and their corresponding indices as values. - * @param {string} config.unk_token - The unknown token used for out of vocabulary words. - * @param {Array} config.merges - An array of BPE merges as strings. - */ - constructor(config) { - super(config); - - this.tokens_to_ids = config.vocab; - - this.unk_token_id = this.tokens_to_ids[config.unk_token]; - this.unk_token = config.unk_token; - - let e = Object.entries(this.tokens_to_ids); - this.vocab = Array(e.length); - - for (const [key, value] of e) { - this.vocab[value] = key; - } - - this.bpe_ranks = Object.fromEntries(config.merges.map((x, i) => [x, i])); - this.merges = config.merges.map(x => x.split(/\s+/)) - - this.end_of_word_suffix = config.end_of_word_suffix; - - this.byte_encoder = BYTES_TO_UNICODE; - this.text_encoder = new TextEncoder(); - - this.cache = {} - } - - /** - * Get all the possible pairs of characters in a word. - * @param {string[]} word - The word to get pairs from. - * @returns {Array} - An array of pairs. - */ - get_pairs(word) { - let pairs = new Set(); - let prev_char = word[0]; - for (let i = 1; i < word.length; i++) { - let char = word[i]; - pairs.add(`${prev_char} ${char}`); - prev_char = char; - } - // TODO: fix error below - return [...pairs]; - } - - /** - * Apply Byte-Pair-Encoding (BPE) to a given token. - * @param {string} token - The token to encode. - * @returns {string} - The BPE encoded token. - */ - bpe(token) { - if (token in this.cache) { - return this.cache[token]; - } - let word = Array.from(token); - if (this.end_of_word_suffix) { - word[word.length - 1] += this.end_of_word_suffix; - } - let pairs = this.get_pairs(word); - - if (!pairs.length) { - if (this.end_of_word_suffix) { - token += this.end_of_word_suffix; - } - return token; - } - - while (true) { - let bigram = pairs.reduce((a, b) => { - let c = this.bpe_ranks[a] ?? Infinity - let d = this.bpe_ranks[b] ?? Infinity - return c <= d ? a : b; - }); - if (!(bigram in this.bpe_ranks)) { - break; - } - let [first, second] = bigram.split(/\s+/g) - let new_word = []; - let i = 0; - let j = -1; - - while (i < word.length) { - try { - j = word.indexOf(first, i); - if (j === -1) throw "Error"; - } catch (e) { - new_word.push(...word.slice(i)); - break; - } - new_word.push(...word.slice(i, j)); - i = j; - - if (word[i] === first && i < word.length - 1 && word[i + 1] === second) { - new_word.push(first + second); - i += 2; - } else { - new_word.push(word[i]); - i += 1; - } - } - word = new_word - if (word.length === 1) { - break; - } else { - pairs = this.get_pairs(word); - } - } - let final_word = word.join(" "); - this.cache[token] = final_word; - return final_word; - } - - /** - * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens. - * @param {Array} tokens - The input sequence of tokens to encode. - * @returns {Array} - The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens. - */ - encode(tokens) { - let outputTokens = []; - - for (let token of tokens) { - token = Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join(''); - let bpe_token_list = this.bpe(token).split(' '); - outputTokens.push(...bpe_token_list); - } - - return outputTokens; - } - -} - -/** - * A base class for text normalization. - * @abstract - */ -class Normalizer extends Callable { - /** - * @param {object} config - The configuration object for the normalizer. - */ - constructor(config) { - super(); - this.config = config; - } - - /** - * Factory method for creating normalizers from config objects. - * @static - * @param {object} config - The configuration object for the normalizer. - * @returns {Normalizer} - A Normalizer object. - * @throws {Error} - If an unknown Normalizer type is specified in the config. - */ - static fromConfig(config) { - if (config === null) return null; - switch (config.type) { - case 'BertNormalizer': - return new BertNormalizer(config); - case 'Precompiled': - return new Precompiled(config); - case 'Sequence': - return new NormalizerSequence(config); - case 'Replace': - return new Replace(config); - case 'NFC': - return new NFC(config); - case 'NFKD': - return new NFKD(config); - case 'StripAccents': - return new StripAccents(config); - case 'Lowercase': - return new Lowercase(config); - default: - throw new Error(`Unknown Normalizer type: ${config.type}`); - } - } - - /** - * Normalize the input text. - * @abstract - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - * @throws {Error} - If this method is not implemented in a subclass. - */ - normalize(text) { - throw Error("normalize should be implemented in subclass.") - } - - /** - * Alias for {@link Normalizer#normalize}. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - */ - _call(text) { - return this.normalize(text); - } - -} - -/** - * Replace normalizer that replaces occurrences of a pattern with a given string or regular expression. - * @extends Normalizer - */ -class Replace extends Normalizer { - /** - * Normalize the input text by replacing the pattern with the content. - * @param {string} text - The input text to be normalized. - * @returns {string} The normalized text after replacing the pattern with the content. - */ - normalize(text) { - if (this.config.pattern.Regex) { - text = text.replace(new RegExp(this.config.pattern.Regex, 'g'), this.config.content) - - } else if (this.config.pattern.String) { - text = text.replace(this.config.pattern.String, this.config.content) - - } else { - console.warn('Unknown pattern type:', this.config.pattern) - } - - return text; - } -} - -/** - * A normalizer that applies Unicode normalization form C (NFC) to the input text. - * @extends Normalizer - */ -class NFC extends Normalizer { - /** - * Normalize the input text by applying Unicode normalization form C (NFC). - * @param {string} text - The input text to be normalized. - * @returns {string} The normalized text. - */ - normalize(text) { - text = text.normalize('NFC') - return text; - } -} - -/** - * NFKD Normalizer. - * @extends Normalizer - */ -class NFKD extends Normalizer { - /** - * Normalize text using NFKD normalization. - * @param {string} text - The text to be normalized. - * @returns {string} The normalized text. - */ - normalize(text) { - text = text.normalize('NFKD') - return text; - } -} - -/** - * StripAccents normalizer removes all accents from the text. - * @extends Normalizer - */ -class StripAccents extends Normalizer { - /** - * Remove all accents from the text. - * @param {string} text - The input text. - * @returns {string} The normalized text without accents. - */ - normalize(text) { - text = text.replace(/[\u0300-\u036f]/g, ''); - return text; - } -} - -/** - * A Normalizer that lowercases the input string. - * @extends Normalizer - */ -class Lowercase extends Normalizer { - /** - * Lowercases the input string. - * @param {string} text - The text to normalize. - * @returns {string} The normalized text. - */ - normalize(text) { - text = text.toLowerCase(); - return text; - } -} - -/** - * A Normalizer that applies a sequence of Normalizers. - * @extends Normalizer - */ -class NormalizerSequence extends Normalizer { - /** - * Create a new instance of NormalizerSequence. - * @param {object} config - The configuration object. - * @param {object[]} config.normalizers - An array of Normalizer configuration objects. - */ - constructor(config) { - super(config); - this.normalizers = config.normalizers.map(x => Normalizer.fromConfig(x)); - } - /** - * Apply a sequence of Normalizers to the input text. - * @param {string} text - The text to normalize. - * @returns {string} The normalized text. - */ - normalize(text) { - // TODO use reduce? - for (let normalizer of this.normalizers) { - text = normalizer.normalize(text); - } - return text; - } -} - -/** - * A class representing a normalizer used in BERT tokenization. - * @extends Normalizer - */ -class BertNormalizer extends Normalizer { - /** - * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text. - * - * @param {string} text - The input text to tokenize. - * @returns {string} - The tokenized text with whitespace added around CJK characters. - */ - _tokenize_chinese_chars(text) { - /* Adds whitespace around any CJK character. */ - let output = []; - for (let i = 0; i < text.length; ++i) { - let char = text[i]; - let cp = char.charCodeAt(0); - if (this._is_chinese_char(cp)) { - output.push(" "); - output.push(char); - output.push(" "); - } else { - output.push(char); - } - } - return output.join(""); - } - - /** - * Checks whether the given Unicode codepoint represents a CJK (Chinese, Japanese, or Korean) character. - * - * A "chinese character" is defined as anything in the CJK Unicode block: - * https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block) - * - * Note that the CJK Unicode block is NOT all Japanese and Korean characters, despite its name. - * The modern Korean Hangul alphabet is a different block, as is Japanese Hiragana and Katakana. - * Those alphabets are used to write space-separated words, so they are not treated specially - * and are handled like all other languages. - * - * @param {number} cp - The Unicode codepoint to check. - * @returns {boolean} - True if the codepoint represents a CJK character, false otherwise. - */ - _is_chinese_char(cp) { - return ( - (cp >= 0x4E00 && cp <= 0x9FFF) - || (cp >= 0x3400 && cp <= 0x4DBF) - || (cp >= 0x20000 && cp <= 0x2A6DF) - || (cp >= 0x2A700 && cp <= 0x2B73F) - || (cp >= 0x2B740 && cp <= 0x2B81F) - || (cp >= 0x2B820 && cp <= 0x2CEAF) - || (cp >= 0xF900 && cp <= 0xFAFF) - || (cp >= 0x2F800 && cp <= 0x2FA1F) - ) - } - /** - * Strips accents from the given text. - * @param {string} text - The text to strip accents from. - * @returns {string} - The text with accents removed. - */ - stripAccents(text) { - return text.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); - } - - /** - * Normalizes the given text based on the configuration. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - */ - normalize(text) { - // TODO use rest of config - // config.clean_text, - // config.handle_chinese_chars, - // config.strip_accents, - // config.lowercase, - - if (this.config.handle_chinese_chars) { - text = this._tokenize_chinese_chars(text); - } - - if (this.config.lowercase) { - text = text.toLowerCase(); - - if (this.config.strip_accents !== false) { - text = this.stripAccents(text); - } - } else if (this.config.strip_accents) { - text = this.stripAccents(text); - } - - return text; - } -} - -/** - * A callable class representing a pre-tokenizer used in tokenization. Subclasses - * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic. - * @extends Callable - */ -class PreTokenizer extends Callable { - /** - * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration. - * - * @static - * @param {Object} config - A configuration object for the pre-tokenizer. - * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`. - * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer. - */ - static fromConfig(config) { - switch (config.type) { - case 'BertPreTokenizer': - return new BertPreTokenizer(config); - case 'Sequence': - return new PreTokenizerSequence(config); - case 'WhitespaceSplit': - return new WhitespaceSplit(config); - case 'Metaspace': - return new MetaspacePreTokenizer(config); - - case 'ByteLevel': - return new ByteLevelPreTokenizer(config); - case 'Split': - return new SplitPreTokenizer(config); - - default: - throw new Error(`Unknown PreTokenizer type: ${config.type}`); - } - } - - /** - * Method that should be implemented by subclasses to define the specific pre-tokenization logic. - * - * @abstract - * @param {string} text - The text to pre-tokenize. - * @returns {string[]} The pre-tokenized text. - * @throws {Error} If the method is not implemented in the subclass. - */ - pre_tokenize_text(text) { - throw Error("pre_tokenize_text should be implemented in subclass.") - } - - /** - * Tokenizes the given text into pre-tokens. - * @param {string|string[]} text - The text or array of texts to pre-tokenize. - * @returns {string[]} An array of pre-tokens. - */ - pre_tokenize(text) { - let result = []; - if (Array.isArray(text)) { - result = text.map(x => this.pre_tokenize_text(x)) - } else { - result = this.pre_tokenize_text(text); - } - return result.flat(); - } - - /** - * Alias for {@link PreTokenizer#pre_tokenize}. - * @param {string|string[]} text - The text or array of texts to pre-tokenize. - * @returns {string[]} An array of pre-tokens. - */ - _call(text) { - return this.pre_tokenize(text); - } -} - -/** - * @extends PreTokenizer - */ -class BertPreTokenizer extends PreTokenizer { - /** - * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme - * similar to that used in the original implementation of BERT. - * - * @param {object} config - The configuration object. - */ - constructor(config) { - super(); - // TODO use config - this.pattern = /\b\p{L}+\b|[^\s\p{L}]+/gu - } - /** - * Tokenizes a single text using the BERT pre-tokenization scheme. - * - * @param {string} text - The text to tokenize. - * @returns {Array.} - An array of tokens. - */ - pre_tokenize_text(text) { - // Split on whitespace and punctuation - return text.trim().match(this.pattern) || []; - } -} - -/** - * A pre-tokenizer that splits text into Byte-Pair-Encoding (BPE) subwords. - * @extends PreTokenizer - */ -class ByteLevelPreTokenizer extends PreTokenizer { - /** - * Creates a new instance of the `ByteLevelPreTokenizer` class. - * @param {Object} config - The configuration object. - */ - constructor(config) { - super(); - // TODO use config - this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu; - } - - /** - * Tokenizes a single piece of text using byte-level tokenization. - * @param {string} text - The text to tokenize. - * @returns {string[]} - An array of tokens. - */ - pre_tokenize_text(text) { - // Split on whitespace and punctuation - return text.match(this.pattern) || []; - } -} - -/** - * Splits text using a given pattern. - * @extends PreTokenizer - */ -class SplitPreTokenizer extends PreTokenizer { - /** - * @param {Object} config - The configuration options for the pre-tokenizer. - * @param {Object} config.pattern - The pattern used to split the text. Can be a string or a regex object. - */ - constructor(config) { - super(); - this.config = config; - } - - /** - * Tokenizes text by splitting it using the given pattern. - * @param {string} text - The text to tokenize. - * @returns {string[]} An array of tokens. - */ - pre_tokenize_text(text) { - if (this.config.pattern.Regex) { - return text.match(new RegExp(this.config.pattern.Regex, 'gu')) || []; - - } else if (this.config.pattern.String) { - return text.match(this.config.pattern.String) || []; - - } else { - console.warn('Unknown pattern type:', this.config.pattern) - } - - return []; - } - -} - -/** - * @extends Callable - */ -class PostProcessor extends Callable { - - /** - * Factory method to create a PostProcessor object from a configuration object. - * - * @param {Object} config - Configuration object representing a PostProcessor. - * @returns {PostProcessor} A PostProcessor object created from the given configuration. - * @throws {Error} If an unknown PostProcessor type is encountered. - */ - static fromConfig(config) { - switch (config.type) { - case 'TemplateProcessing': - return new TemplateProcessing(config); - - case 'ByteLevel': - return new ByteLevelPostProcessor(config); - - case 'RobertaProcessing': - return new RobertaProcessing(config); - - default: - throw new Error(`Unknown PostProcessor type: ${config.type}`); - } - } - - /** - * Method to be implemented in subclass to apply post-processing on the given tokens. - * - * @param {Array} tokens - The input tokens to be post-processed. - * @param {...*} args - Additional arguments required by the post-processing logic. - * @returns {Array} The post-processed tokens. - * @throws {Error} If the method is not implemented in subclass. - */ - post_process(tokens, ...args) { - throw Error("post_process should be implemented in subclass.") - } - - /** - * Alias for {@link PostProcessor#post_process}. - * @param {Array} tokens - The text or array of texts to post-process. - * @param {...*} args - Additional arguments required by the post-processing logic. - * @returns {Array} An array of post-processed tokens. - */ - _call(tokens, ...args) { - return this.post_process(tokens, ...args); - } -} - -/** - * A post-processor that adds special tokens to the beginning and end of the input. - * @extends PostProcessor - */ -class RobertaProcessing extends PostProcessor { - /** - * @param {Object} config - The configuration for the post-processor. - * @param {string[]} config.cls - The special tokens to add to the beginning of the input. - * @param {string[]} config.sep - The special tokens to add to the end of the input. - */ - constructor(config) { - super(); - this.config = config; - - // TODO use all of config: - // add_prefix_space, cls, sep, trim_offsets - - } - - /** - * Adds the special tokens to the beginning and end of the input. - * @param {string[]} tokens - The input tokens. - * @param {string[]|null} tokens_pair - An optional second set of input tokens. - * @returns {string[]} The input tokens with the special tokens added to the beginning and end. - */ - post_process(tokens, tokens_pair = null) { - tokens = [this.config.cls[0], ...tokens, this.config.sep[0]] - - // NOTE: It is intended to add 2 EOS tokens after the first set of tokens - // https://github.com/huggingface/tokenizers/issues/983 - if (tokens_pair !== null) { - tokens = [...tokens, this.config.sep[0], ...tokens_pair, this.config.sep[0]] - } - return tokens; - } -} - -/** - * Post processor that replaces special tokens in a template with actual tokens. - * @extends PostProcessor - */ -class TemplateProcessing extends PostProcessor { - /** - * Creates a new instance of `TemplateProcessing`. - * @param {Object} config - The configuration options for the post processor. - * @param {Array} config.single - The template for a single sequence of tokens. - * @param {Array} config.pair - The template for a pair of sequences of tokens. - */ - constructor(config) { - super(); - this.config = config; - } - - /** - * Replaces special tokens in the template with actual tokens. - * @param {Array} tokens - The list of tokens for the first sequence. - * @param {Array} [tokens_pair=null] - The list of tokens for the second sequence (optional). - * @returns {Array} - The list of tokens with the special tokens replaced with actual tokens. - */ - post_process(tokens, tokens_pair = null) { - let type = tokens_pair === null ? this.config.single : this.config.pair - - let toReturn = []; - for (let item of type) { - if ('SpecialToken' in item) { - toReturn.push(item.SpecialToken.id); - - } else if ('Sequence' in item) { - if (item.Sequence.id === 'A') { - toReturn.push(...tokens); - - } else if (item.Sequence.id === 'B') { - toReturn.push(...tokens_pair); - } - } - } - return toReturn; - } -} - -/** - * A PostProcessor that returns the given tokens as is. - * @extends PostProcessor - */ -class ByteLevelPostProcessor extends PostProcessor { - /** - * Create a new instance of ByteLevelPostProcessor. - * @param {object} config - Configuration object. - */ - constructor(config) { - super(); - this.config = config; - } - - /** - * Post process the given tokens. - * @param {string[]} tokens - The tokens to be post processed. - * @returns {string[]} The post processed tokens. - */ - post_process(tokens) { - return tokens; - } -} - -/** - * The base class for token decoders. - * @extends Callable - */ -class Decoder extends Callable { - - /** - * Creates an instance of `Decoder`. - * - * @param {Object} config - The configuration object. - */ - constructor(config) { - super(); - this.config = config; - } - - /** - * Creates a decoder instance based on the provided configuration. - * - * @param {Object} config - The configuration object. - * @returns {Decoder} A decoder instance. - * @throws {Error} If an unknown decoder type is provided. - */ - static fromConfig(config) { - switch (config.type) { - case 'WordPiece': - return new WordPieceDecoder(config); - case 'Metaspace': - return new MetaspaceDecoder(config); - case 'ByteLevel': - return new ByteLevelDecoder(config); - default: - throw new Error(`Unknown Decoder type: ${config.type}`); - } - } - - /** - * Converts a list of tokens to a string. - * - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - */ - convert_tokens_to_string(tokens) { - return tokens.join('').trim(); - } - - /** - * Calls the `decode` method. - * - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - */ - _call(tokens) { - return this.decode(tokens); - } - - /** - * Decodes a list of tokens. - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - * @throws {Error} If the `decode` method is not implemented in the subclass. - */ - decode(tokens) { - throw Error("decode should be implemented in subclass.") - } - - -} - -/** - * A decoder that decodes a list of WordPiece tokens into a single string. - * @extends Decoder - */ -class WordPieceDecoder extends Decoder { - - /** - * Creates a new instance of WordPieceDecoder. - * @param {Object} config - The configuration object. - * @param {string} config.prefix - The prefix used for WordPiece encoding. - * @param {boolean} config.cleanup - Whether to cleanup the decoded string. - */ - constructor(config) { - super(config); - this.convertRegex = new RegExp(` ${config.prefix}`, 'g'); - this.cleanup = config.cleanup; - } - - /** - * Converts a list of WordPiece tokens to a single string. - * @param {Array} tokens - The list of WordPiece tokens. - * @returns {string} The decoded string. - */ - convert_tokens_to_string(tokens) { - return tokens.join(' ').replace(this.convertRegex, '').trim(); - } - - /** - * Decodes a list of WordPiece tokens into a single string. - * @param {Array} tokens - The list of WordPiece tokens. - * @returns {string} The decoded string. - */ - decode(tokens) { - return this.convert_tokens_to_string(tokens); - } -} - -/** - * Byte-level decoder for tokenization output. Inherits from the `Decoder` class. - * @extends Decoder - */ -class ByteLevelDecoder extends Decoder { - - /** - * Create a `ByteLevelDecoder` object. - * @param {object} config - Configuration object. - */ - constructor(config) { - super(config); - - this.byte_decoder = UNICODE_TO_BYTES; - this.text_decoder = new TextDecoder("utf-8", { - fatal: false, - ignoreBOM: true, - }); - - this.end_of_word_suffix = null; - } - - /** - * Convert an array of tokens to string by decoding each byte. - * @param {string[]} tokens - Array of tokens to be decoded. - * @returns {string} - The decoded string. - */ - convert_tokens_to_string(tokens) { - let text = tokens.join(''); - - if (this.config.trim_offsets) { - text = text.trim(); - } else if (this.config.add_prefix_space) { - text = ' ' + text; - } - - // @ts-ignore - let byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c])); - let decoded_text = this.text_decoder.decode(byteArray); - - if (this.end_of_word_suffix) { - decoded_text = decoded_text.replaceAll(this.end_of_word_suffix, ' ').trim(); - } - return decoded_text; - } - - /** - * Decode an array of tokens to string. - * @param {string[]} tokens - Array of tokens to be decoded. - * @returns {string} - The decoded string. - */ - decode(tokens) { - // TODO move to base class (like HF) - // tokens === filtered_tokens - - // To avoid mixing byte-level and unicode for byte-level BPT - // we need to build string separately for added tokens and byte-level tokens - // cf. https://github.com/huggingface/transformers/issues/1133 - let sub_texts = []; - let current_sub_text = []; - for (let token of tokens) { - // tokens sent here are already filtered, so we don't need to do this - // if (skip_special_tokens && this.all_special_ids.includes(token)) { - // continue; - // } - - if (this.added_tokens.includes(token)) { - if (current_sub_text.length > 0) { - sub_texts.push(this.convert_tokens_to_string(current_sub_text)); - current_sub_text = []; - } - sub_texts.push(token); - } else { - current_sub_text.push(token); - } - } - if (current_sub_text.length > 0) { - sub_texts.push(this.convert_tokens_to_string(current_sub_text)); - } - - // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options - let text = sub_texts.join(''); - - return text; - } -} - -/** - * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested, - * and returns a list of tokens. - * @extends PreTokenizer - */ -class MetaspacePreTokenizer extends PreTokenizer { - /** - * @param {Object} config - The configuration object for the MetaspacePreTokenizer. - * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the first token. - * @param {string} config.replacement - The character to replace spaces with. - * @param {string} [config.str_rep=config.replacement] - An optional string representation of the replacement character. - */ - constructor(config) { - super(); - - this.addPrefixSpace = config.add_prefix_space; - this.replacement = config.replacement; - this.strRep = config.str_rep || this.replacement; - } - - /** - * This method takes a list of normalized tokens, replaces spaces with the replacement character, - * adds a prefix space if requested, and returns a new list of tokens. - * @param {string[]|string} normalizedTokens - The list of normalized tokens to pre-tokenize. - * @returns {string[]} A new list of pre-tokenized tokens. - */ - pre_tokenize(normalizedTokens) { - if (typeof normalizedTokens === 'string' || normalizedTokens instanceof String) { - // Metaspace acts on a list of tokens. If passing in a string, first split on whitespace - normalizedTokens = normalizedTokens.split(/\s+/); - } - - const result = []; - for (let token of normalizedTokens) { - let normalized = token.replace(' ', this.strRep); - if (this.addPrefixSpace && !normalized.startsWith(this.replacement)) { - normalized = this.strRep + normalized; - } - result.push(normalized); - } - return result; - } -} - -/** - * MetaspaceDecoder class extends the Decoder class and decodes Metaspace tokenization. - * @extends Decoder - */ -class MetaspaceDecoder extends Decoder { - /** - * Constructs a new MetaspaceDecoder object. - * @param {Object} config - The configuration object for the MetaspaceDecoder. - * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the decoded string. - * @param {string} config.replacement - The string to replace spaces with. - */ - constructor(config) { - super(config); - - this.addPrefixSpace = config.add_prefix_space; - this.replacement = config.replacement; - } - - /** - * Decodes the given tokens back into a string. - * @param {Array} tokens - The tokens to decode. - * @returns {string} - The decoded string. - */ - decode(tokens) { - let result = []; - let i = 0; - for (let token of tokens) { - let normalized = token.replace(this.replacement, ' '); - if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) { - normalized = normalized.substring(1); - } - result.push(normalized); - ++i; - } - - return this.convert_tokens_to_string(result); - } -} - -/** - * A normalizer that applies a precompiled charsmap. - * This is useful for applying complex normalizations in C++ and exposing them to JavaScript. - * @extends Normalizer - * @param {Object} config - The configuration object for the Precompiled normalizer. - * @param {Object} config.precompiled_charsmap - The precompiled charsmap object. - */ -class Precompiled extends Normalizer { - /** - * Create a new instance of Precompiled normalizer. - * @param {object} config - The configuration object. - * @param {any} config.precompiled_charsmap - Precompiled chars mapping. - */ - constructor(config) { - super(config); - this.charsmap = config.precompiled_charsmap; - } - - /** - * Normalizes the given text by applying the precompiled charsmap. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - */ - normalize(text) { - // TODO use this.charsmap - return text; - } -} - -/** - * A pre-tokenizer that applies a sequence of pre-tokenizers to the input text. - * @extends PreTokenizer - */ -class PreTokenizerSequence extends PreTokenizer { - /** - * Creates an instance of PreTokenizerSequence. - * @param {object} config - The configuration object for the pre-tokenizer sequence. - * @param {object[]} config.pretokenizers - An array of pre-tokenizer configurations. - */ - constructor(config) { - super(); - this.tokenizers = config.pretokenizers.map(x => PreTokenizer.fromConfig(x)); - } - - /** - * Applies each pre-tokenizer in the sequence to the input text in turn. - * @param {string|string[]} text - The text(s) to pre-tokenize. - * @returns {string[]} The pre-tokenized text. - */ - pre_tokenize_text(text) { - if (typeof text === 'string') { - text = [text]; - } - // Use reduce to apply each tokenizer to the text - return this.tokenizers.reduce((preTokenizedText, tokenizer) => { - return tokenizer.pre_tokenize(preTokenizedText); - }, text); - } -} - -/** - * Splits a string of text by whitespace characters into individual tokens. - * @extends PreTokenizer - */ -class WhitespaceSplit extends PreTokenizer { - /** - * Creates an instance of WhitespaceSplit. - * @param {object} config - The configuration object for the pre-tokenizer sequence. - */ - constructor(config) { - super(); - } - /** - * Pre-tokenizes the input text by splitting it on whitespace characters. - * @param {string} text - The text to be pre-tokenized. - * @returns {string[]} An array of tokens produced by splitting the input text on whitespace. - */ - pre_tokenize_text(text) { - return text.split(/\s+/); - } -} - -class PreTrainedTokenizer extends Callable { - /** - * Create a new PreTrainedTokenizer instance. - * @param {Object} tokenizerJSON - The JSON of the tokenizer. - * @param {Object} tokenizerConfig - The config of the tokenizer. - */ - constructor(tokenizerJSON, tokenizerConfig) { - super(); - - this.tokenizerJSON = tokenizerJSON; - this.tokenizerConfig = tokenizerConfig; - - this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer); - this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer); - this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig); - this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor); - - // TODO - maybe, allow this to be null; in which case, we use model as decoder too? - this.decoder = Decoder.fromConfig(tokenizerJSON.decoder); - - // Slight hack, but it prevents code duplication: - // Add added_tokens to this.decoder - this.decoder.added_tokens = []; - - // Another slight hack to add `end_of_word_suffix` (if present) to the decoder - // This is needed for cases where BPE model and ByteLevel decoder are used - // For more information, see https://github.com/xenova/transformers.js/issues/74 - // TODO - save this to the decoder when exporting? - this.decoder.end_of_word_suffix = this.model.end_of_word_suffix; - - // Add added_tokens to model - this.special_tokens = []; - this.all_special_ids = []; - for (let addedToken of tokenizerJSON.added_tokens) { - let id = addedToken.id; - let content = addedToken.content; - this.decoder.added_tokens.push(content); - - this.model.tokens_to_ids[content] = id; - this.model.vocab[id] = content; - - if (addedToken.special) { - this.special_tokens.push(content); - this.all_special_ids.push(id); - } - } - this.special_tokens_regex = new RegExp( - '(' + this.special_tokens.map(escapeRegExp).join('|') + ')' - ); - - - // Set mask token if present (otherwise will be undefined, which is fine) - this.mask_token = this.getToken('mask_token'); - this.mask_token_id = this.model.tokens_to_ids[this.mask_token]; - - this.pad_token = this.getToken('pad_token', 'eos_token'); - this.pad_token_id = this.model.tokens_to_ids[this.pad_token]; - - this.sep_token = this.getToken('sep_token'); - this.sep_token_id = this.model.tokens_to_ids[this.sep_token]; - - this.model_max_length = this.tokenizerConfig.model_max_length; - - this.remove_space = this.tokenizerConfig.remove_space; - - // TODO allow user to change this - this.padding_side = 'right'; - } - - /** - * Returns the value of the first matching key in the tokenizer config object. - * @param {...string} keys - One or more keys to search for in the tokenizer config object. - * @returns {string|null} - The value associated with the first matching key, or null if no match is found. - * @throws {Error} - If an object is found for a matching key and its __type property is not "AddedToken". - */ - getToken(...keys) { - for (let key of keys) { - let item = this.tokenizerConfig[key]; - - if (!item) continue; - - if (typeof item === 'object') { - if (item.__type === 'AddedToken') { - return item.content; - } else { - throw Error(`Unknown token: ${item}`); - } - } else { - return item; - } - } - return null; - } - - /** - * Creates a new Tokenizer instance with the tokenizer configuration and files - * downloaded from a pretrained model located at the given model path. - * - * @param {string} modelPath - The path to the pretrained model. - * @param {function} [progressCallback=null] - Optional callback function that will be called with the current - * progress percentage (0 to 100) each time a file is downloaded. - * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the modelPath. - */ - static async from_pretrained(modelPath, progressCallback = null) { - // TODO get files in parallel - - let [tokenizerJSON, tokenizerConfig] = await Promise.all([ - fetchJSON(modelPath, 'tokenizer.json', progressCallback), - fetchJSON(modelPath, 'tokenizer_config.json', progressCallback), - ]) - - return new this(tokenizerJSON, tokenizerConfig); - } - - /** - * This function can be overridden by a subclass to apply additional preprocessing - * to a model's input data. - * @param {Object} inputs - An object containing input data as properties. - * @returns {Object} The modified inputs object. - */ - prepare_model_inputs(inputs) { - return inputs; - } - - /** - * Encode/tokenize the given text(s). - * @param {string|string[]} text - The text to tokenize. - * @param {object} options - An optional object containing the following properties: - * @param {string|string[]} [options.text_pair=null] - Optional second sequence to be encoded. If set, must be the same type as text. - * @param {boolean} [options.padding=false] - Whether to pad the input sequences. - * @param {boolean} [options.truncation=null] - Whether to truncate the input sequences. - * @param {number} [options.max_length=null] - Maximum length of the returned list and optionally padding length. - * @param {boolean} [options.return_tensor=true] - Whether to return the results as Tensors or arrays. - * @returns {{ input_ids: number[]|number[][]|Tensor; attention_mask: any[]|Tensor; }} Object to be passed to the model. - */ - _call( - // Required positional arguments - text, - - // Optional keyword arguments - { - text_pair = null, - // add_special_tokens = true, // TODO - padding = false, - truncation = null, - max_length = null, - return_tensor = true, // Different to HF - } = {}, - ) { - /** @type {number[]|number[][]|Tensor} */ - let tokens; - - if (Array.isArray(text)) { - if (text.length === 0) { - throw Error('text array must be non-empty') - } - - if (text_pair !== null) { - if (!Array.isArray(text_pair)) { - throw Error('text_pair must also be an array') - - } else if (text.length !== text_pair.length) { - throw Error('text and text_pair must have the same length') - } - - tokens = text.map( - (text, i) => this.encode(text, text_pair[i]) - ) - - } else { - tokens = text.map(x => this.encode(x)); - } - - } else { - if (text === null) { - throw Error('text may not be null') - } - - if (Array.isArray(text_pair)) { - throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).') - } - tokens = [this.encode(text, text_pair)]; - } - // At this point, tokens is batched: [batch_size, tokens] - // However, array may be jagged. So, we pad to max_length - - let maxLengthOfBatch = Math.max(...tokens.map(x => x.length)); - - // If null, we calculate max length from sequences - if (max_length === null) { - max_length = maxLengthOfBatch; - } - - // Ensure it is less than model max length - max_length = Math.min(max_length, this.model_max_length) - - /** @type {any[]|Tensor} */ - let attention_mask = []; - if (padding || truncation) { - // Perform padding and/or truncation - for (let i = 0; i < tokens.length; ++i) { - if (tokens[i].length === max_length) { - attention_mask.push(new Array(tokens[i].length).fill(1)) - continue; - - } else if (tokens[i].length > max_length) { - // possibly truncate - if (truncation) { - tokens[i] = tokens[i].slice(0, max_length); - } - attention_mask.push(new Array(tokens[i].length).fill(1)) - - } else { // t.length < max_length - if (padding) { - let diff = max_length - tokens[i].length; - - if (this.padding_side === 'right') { - attention_mask.push( - (new Array(tokens[i].length).fill(1)).concat(new Array(diff).fill(0)) - ) - tokens[i].push(...new Array(diff).fill(this.pad_token_id)) - } else { // left - attention_mask.push( - (new Array(diff).fill(0)).concat(new Array(tokens[i].length).fill(1)) - ) - tokens[i].unshift(...new Array(diff).fill(this.pad_token_id)) - } - - } else { - attention_mask.push(new Array(tokens[i].length).fill(1)) - } - } - } - } else { - attention_mask = tokens.map(x => new Array(x.length).fill(1)) - } - - if (return_tensor) { - if (!(padding && truncation)) { - // Not, guaranteed that all items have same length, so - // we perform additional check - - if (tokens.some(x => x.length !== tokens[0].length)) { - throw Error( - "Unable to create tensor, you should probably activate truncation and/or padding " + - "with 'padding=true' and 'truncation=true' to have batched tensors with the same length." - ) - } - } - - // Now we actually convert to tensor - let dims = [tokens.length, tokens[0].length]; - - tokens = new Tensor('int64', - BigInt64Array.from(tokens.flat().map(BigInt)), - dims - ); - - attention_mask = new Tensor( - 'int64', - BigInt64Array.from(attention_mask.flat().map(BigInt)), - dims - ) - } - - - // Finally, add attention mask, and possibly model-specific parameters - let modelInputs = { - input_ids: tokens, - attention_mask: attention_mask - } - - // Optional post-processing - modelInputs = this.prepare_model_inputs(modelInputs); - - return modelInputs - } - - /** - * Encodes a single text using the preprocessor pipeline of the tokenizer. - * - * @param {string|null} text - The text to encode. - * @returns {Array} The encoded tokens. - */ - _encode_text(text) { - if (text === null) return null; - - // Actual function which does encoding, for a single text - // First, we take care of special tokens. Needed to avoid issues arising from - // normalization and/or pretokenization (which may not preserve special tokens) - const sections = text.split(this.special_tokens_regex).filter(x => x); - - let tokens = sections.map(x => { - if (this.special_tokens.includes(x)) { - // Ignore special tokens - return x - } else { - if (this.remove_space === true) { - // remove_space - x = x.trim().split(/\s+/).join(' ') - } - // Actually perform encoding - if (this.normalizer !== null) { - x = this.normalizer(x); - } - let sectionTokens = this.pre_tokenizer(x); - return this.model(sectionTokens); - } - }).flat(); - - return tokens; - } - - /** - * Encodes a single text or a pair of texts using the model's tokenizer. - * - * @param {string} text - The text to encode. - * @param {string|null} text_pair - The optional second text to encode. - * @returns {number[]} An array of token IDs representing the encoded text(s). - */ - encode(text, text_pair = null) { - // Function called by users to encode possibly multiple texts - let tokens = this._encode_text(text); - let tokens2 = this._encode_text(text_pair); - - let combinedTokens = this.post_processor(tokens, tokens2); - let ids = this.model.convert_tokens_to_ids(combinedTokens); - - return ids - } - - /** - * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms - * @param {string} text - The text to clean up. - * @returns {string} - The cleaned up text. - */ - clean_up_tokenization(text) { - // Clean up a list of simple English tokenization artifacts - // like spaces before punctuations and abbreviated forms - return text.replace(/ \./g, '.') - .replace(/ \?/g, '?') - .replace(/ \!/g, '!') - .replace(/ ,/g, ',') - .replace(/ \' /g, "'") - .replace(/ n\'t/g, "n't") - .replace(/ \'m/g, "'m") - .replace(/ \'s/g, "'s") - .replace(/ \'ve/g, "'ve") - .replace(/ \'re/g, "'re"); - } - - /** - * Decode a batch of tokenized sequences. - * @param {number[][]} batch - List of tokenized input sequences. - * @param {Object} decode_args - (Optional) Object with decoding arguments. - * @returns {string[]} List of decoded sequences. - */ - batch_decode(batch, decode_args = {}) { - return batch.map(x => this.decode(x, decode_args)); - } - - /** - * Decodes a sequence of token IDs back to a string. - * - * @param {number[]} token_ids - List of token IDs to decode. - * @param {Object} [decode_args={}] - * @param {boolean} [decode_args.skip_special_tokens=false] - If true, special tokens are removed from the output string. - * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - If true, spaces before punctuations and abbreviated forms are removed. - * - * @returns {string} The decoded string. - * @throws {Error} If `token_ids` is not a non-empty array of integers. - */ - decode( - token_ids, - decode_args = {}, - ) { - if (!Array.isArray(token_ids) || token_ids.length === 0 || !isIntegralNumber(token_ids[0])) { - throw Error("token_ids must be a non-empty array of integers."); - } - - return this.decode_single( - token_ids, decode_args - ) - } - - /** - * Decode a single list of token ids to a string. - * @param {number[]} token_ids - List of token ids to decode - * @param {object} decode_args - Optional arguments for decoding - * @param {boolean} [decode_args.skip_special_tokens=false] - Whether to skip special tokens during decoding - * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - Whether to clean up tokenization spaces during decoding - * @returns {string} - The decoded string - */ - decode_single( - token_ids, - { - skip_special_tokens = false, - clean_up_tokenization_spaces = true, - } - ) { - let tokens = this.model.convert_ids_to_tokens(token_ids); - if (skip_special_tokens) { - tokens = tokens.filter(x => !this.special_tokens.includes(x)); - } - - let decoded = this.decoder(tokens); // tokens === filtered_tokens - - if ('cleanup' in this.decoder && this.decoder.cleanup !== clean_up_tokenization_spaces) { - console.warn(`clean_up_tokenization_spaces disagrees with decoder's cleanup setting. Overriding to use decoder's cleanup setting (${this.decoder.cleanup})`) - // @ts-ignore - clean_up_tokenization_spaces = this.decoder.cleanup; - } - - if (clean_up_tokenization_spaces) { - decoded = this.clean_up_tokenization(decoded); - } - - return decoded; - } - -} - -/** -* Prepare model inputs for a BERT model. -* @param {Object} inputs - An object containing the input ids and attention mask. -* @returns {Object} The prepared inputs object. -*/ -function bert_prepare_model_inputs(inputs) { - // Helper method for preparing token_type_ids for bert models - inputs.token_type_ids = new Tensor( - 'int64', - new BigInt64Array(inputs.input_ids.data.length), - inputs.input_ids.dims - ) - return inputs; -} - -/** - * BertTokenizer is a class used to tokenize text for BERT models. - * @extends PreTrainedTokenizer - */ -class BertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); - } -} -/** - * Albert tokenizer - * @extends PreTrainedTokenizer - */ -class AlbertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); - } -} -class MobileBertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); - } -} -class SqueezeBertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); - } -} -class DistilBertTokenizer extends PreTrainedTokenizer { } -class T5Tokenizer extends PreTrainedTokenizer { } -class GPT2Tokenizer extends PreTrainedTokenizer { } -class BartTokenizer extends PreTrainedTokenizer { } -class RobertaTokenizer extends PreTrainedTokenizer { } - - -/** - * WhisperTokenizer tokenizer - * @extends PreTrainedTokenizer - */ -class WhisperTokenizer extends PreTrainedTokenizer { - static LANGUAGES = { - "en": "english", - "zh": "chinese", - "de": "german", - "es": "spanish", - "ru": "russian", - "ko": "korean", - "fr": "french", - "ja": "japanese", - "pt": "portuguese", - "tr": "turkish", - "pl": "polish", - "ca": "catalan", - "nl": "dutch", - "ar": "arabic", - "sv": "swedish", - "it": "italian", - "id": "indonesian", - "hi": "hindi", - "fi": "finnish", - "vi": "vietnamese", - "he": "hebrew", - "uk": "ukrainian", - "el": "greek", - "ms": "malay", - "cs": "czech", - "ro": "romanian", - "da": "danish", - "hu": "hungarian", - "ta": "tamil", - "no": "norwegian", - "th": "thai", - "ur": "urdu", - "hr": "croatian", - "bg": "bulgarian", - "lt": "lithuanian", - "la": "latin", - "mi": "maori", - "ml": "malayalam", - "cy": "welsh", - "sk": "slovak", - "te": "telugu", - "fa": "persian", - "lv": "latvian", - "bn": "bengali", - "sr": "serbian", - "az": "azerbaijani", - "sl": "slovenian", - "kn": "kannada", - "et": "estonian", - "mk": "macedonian", - "br": "breton", - "eu": "basque", - "is": "icelandic", - "hy": "armenian", - "ne": "nepali", - "mn": "mongolian", - "bs": "bosnian", - "kk": "kazakh", - "sq": "albanian", - "sw": "swahili", - "gl": "galician", - "mr": "marathi", - "pa": "punjabi", - "si": "sinhala", - "km": "khmer", - "sn": "shona", - "yo": "yoruba", - "so": "somali", - "af": "afrikaans", - "oc": "occitan", - "ka": "georgian", - "be": "belarusian", - "tg": "tajik", - "sd": "sindhi", - "gu": "gujarati", - "am": "amharic", - "yi": "yiddish", - "lo": "lao", - "uz": "uzbek", - "fo": "faroese", - "ht": "haitian creole", - "ps": "pashto", - "tk": "turkmen", - "nn": "nynorsk", - "mt": "maltese", - "sa": "sanskrit", - "lb": "luxembourgish", - "my": "myanmar", - "bo": "tibetan", - "tl": "tagalog", - "mg": "malagasy", - "as": "assamese", - "tt": "tatar", - "haw": "hawaiian", - "ln": "lingala", - "ha": "hausa", - "ba": "bashkir", - "jw": "javanese", - "su": "sundanese", - } - - /** - * Decodes automatic speech recognition (ASR) sequences. - * @param {Array.<{tokens: Array., stride: [number, number, number]}>} sequences The sequences to decode. - * @param {Object} options - The options to use for decoding. - * @returns {[string, {chunks?:Array.<{language: string|null, timestamp: [number|null, number|null], text: string}>}]} The decoded sequences. - */ - _decode_asr(sequences, { - return_timestamps = false, - return_language = false, - time_precision = null, - force_full_sequences = true - } = {}) { - // Set force_full_sequences=false if you want streaming - // TODO add support for `return_language` - - // Internal method meant to only be used by asr pipeline. - // Handles all the little quirks specific to whisper to handle - // the various options not allowed in other seq2seq models - - // =========== Overview ============ - // - iterate over all outputs - // - all tokens within output - // - Each token can be - // - language token - // - special token - // - timestamp token - // - text token - // - We accumulate the text tokens. - // - We split on end timestamps - // - Lots of complexity comes from stride and timestamps - - if (time_precision === null) { - throw Error("Must specify time_precision") - } - let last_language = null; - - function new_chunk() { - return { "language": last_language, "timestamp": [null, null], "text": "" }; - } - - // Welcome to the state machine! - const chunks = []; - let chunk = new_chunk(); - let time_offset = 0.0; - const timestamp_begin = this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0] + 1; - - let previous_tokens = []; - let skip = false; - let right_stride_start = null; - - - const all_special_ids = new Set(this.all_special_ids); - - for (let output of sequences) { - // NOTE: python version has batches, so it uses [0] - const token_ids = output.tokens; - - // These keep track of timestamps within strides, which need - // to be skipped and resolve all tokens in a single chunk. - let last_timestamp = null; - let first_timestamp = timestamp_begin; - - if ("stride" in output) { - const [chunk_len, stride_left, stride_right] = output.stride; - - // Offset the timings to account for the other `model_outputs`. - time_offset -= stride_left; - right_stride_start = chunk_len - stride_right; - - // Keeping track of timestamps within strides - // We're going to NOT split on those, and delay until we're - // out of BOTH stride. Otherwise lots of issues occur and - // corner cases - if (stride_left) { - first_timestamp = stride_left / time_precision + timestamp_begin; - } - - if (stride_right) { - for (let i = token_ids.length - 1; i >= 0; --i) { - const token = token_ids[i]; - if (token >= timestamp_begin) { - // There can be several token in the right stride - // But the last one is ALWAYS going to be skipped - if (last_timestamp !== null && (token - timestamp_begin) * time_precision < right_stride_start) { - break; - } - last_timestamp = token; - } - } - } - } - - let current_tokens = []; - - // - all tokens within output - for (const token of token_ids) { - // 4 possible states for each token - // - 1/ Language code - // - 2/ all other special tokens (which we ignore) - // - 3/ Timestamp - // - 4/ Regular text - - if (all_special_ids.has(token)) { - const text = this.decode([token]); - if (text[0] === "[" && text[text.length - 1] === "]") { - const language = WhisperTokenizer.LANGUAGES[text.slice(1, -1)]; - - if (language !== undefined) { - // 1/ Indeed some language - // TODO Handle when language is different from the previous - // one, and we cannot use timestamped tokens to create chunks - if (last_language !== null && language !== last_language && !return_timestamps) { - previous_tokens.push(current_tokens); - const resolved_tokens = this.findLongestCommonSequence(previous_tokens); - const resolved_text = this.decode(resolved_tokens); - chunk.text = resolved_text; - chunks.push(chunk); - - // Flush all our temporary context - previous_tokens = []; - current_tokens = []; - chunk = new_chunk(); - } - - last_language = chunk.language = language; - } else { - // 2/ This is a regular special token, ignoring it - } - } - } else if (token >= timestamp_begin) { - // 3/ Timestamp token - const time = (token - timestamp_begin) * time_precision + time_offset; - const rounded_time = Math.round(time * 100) / 100; - - if (last_timestamp !== null && token >= last_timestamp) { - // Whisper outputted a timestamp token, but it falls within - // our stride, so we're going to skip it for the time being - // and resolve this later - // Skip is necessary because timestamp tokens always come - // by pair, so we need to skip the next one too (which would mark the start of another chunk). - skip = true; - } else if (skip || (previous_tokens.length > 0 && token < first_timestamp)) { - skip = false; - } else if (chunk.timestamp[0] === null) { - chunk.timestamp[0] = rounded_time; - } else { - // This is the end of the timestamp chunk - if (rounded_time === chunk.timestamp[0]) { - // This is a bug in timestamp token output - // where we're taking the duplicate token - // as a stop where it should be a start. - // This is an issue in the underlying model output - // Let's just skip it so it becomes - } else { - chunk.timestamp[1] = time; - - // Handling merges - previous_tokens.push(current_tokens) - const resolved_tokens = this.findLongestCommonSequence(previous_tokens) - const resolved_text = this.decode(resolved_tokens) - chunk.text = resolved_text - chunks.push(chunk) - - // Flush all our temporary context - previous_tokens = [] - current_tokens = [] - chunk = new_chunk() - } - } - - } else { - // 4/ Regular token - // We just append to the list of all tokens so we can handle - // merges later and decode into text. - current_tokens.push(token) - - } - } - - if ('stride' in output) { - const [chunk_len, stride_left, stride_right] = output.stride; - time_offset += chunk_len - stride_right - } - - // Leftover tokens - if (current_tokens.length > 0) { - previous_tokens.push(current_tokens) - } else if (previous_tokens.every(p => p.length === 0)) { - // Flushing previous tokens (END)" - chunk = new_chunk() - previous_tokens = [] - current_tokens = [] - } - - } - - if (previous_tokens.length > 0) { - if (force_full_sequences && return_timestamps) { - // Last token should always be timestamps, so there shouldn't be - // leftover - throw new Error("There was an error while processing timestamps, we haven't found a timestamp as last token."); - } - - // Happens when we don't use timestamps - const resolved_tokens = this.findLongestCommonSequence(previous_tokens); - - // Flushing previous tokens (FINAL) - const resolved_text = this.decode(resolved_tokens); - chunk.text = resolved_text; - chunks.push(chunk); - } - - let optional = {}; - - // Preparing and cleaning up the pipeline output - const full_text = chunks.map(chunk => chunk.text).join(''); - if (return_timestamps || return_language) { - for (let i = 0; i < chunks.length; i++) { - const chunk = chunks[i]; - if (!return_timestamps) { - delete chunk["timestamp"]; - } - - if (!return_language) { - delete chunk["language"]; - } - } - optional = { "chunks": chunks }; - } - return [full_text, optional]; - - } - - /** - * Finds the longest common sequence among the provided sequences. - * @param {number[][]} sequences - An array of sequences of token ids to compare. - * @returns {number[]} - The longest common sequence found. - * @throws {Error} - If there is a bug within the function. - */ - findLongestCommonSequence(sequences) { - // It would be much harder to do O(n) because of fault tolerance. - // We actually have a really good property which is that the total sequence - // MUST be those subsequences in order. - let leftSequence = sequences[0]; - let leftLength = leftSequence.length; - let totalSequence = []; - for (let i = 1; i < sequences.length; i++) { - const rightSequence = sequences[i]; - let max = 0.0; - let maxIndices = [leftLength, leftLength, 0, 0]; - // Here we're sliding matches - // [a, b, c, d] - // [c, d, f] - // = [c] == [d] - - // [a, b, c, d] - // [c, d, f] - // = [c, d] == [c, d] - - - // [a, b, c, d] - // [c, d, f] - - // = [b, c, d] == [c, d, f] - - // [a, b, c, d] - // [c, d, f] - - // [a, b, c] == [c, d, f] - - // [a, b, c, d] - // [d, f] - - // [a, b] == [d, f] - - // [a, b, c, d] - // [f] - - // [a] == [f] - - const rightLength = rightSequence.length; - for (let j = 1; j < leftLength + rightLength; j++) { - const eps = j / 10000.0; - const leftStart = Math.max(0, leftLength - j); - const leftStop = Math.min(leftLength, leftLength + rightLength - j); - const left = leftSequence.slice(leftStart, leftStop); - const rightStart = Math.max(0, j - leftLength); - const rightStop = Math.min(rightLength, j); - const right = rightSequence.slice(rightStart, rightStop); - if (left.length !== right.length) { - throw new Error("There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference."); - } - const matches = left.filter((elem, idx) => elem === right[idx]).length; - const matching = matches / j + eps; - if (matches > 1 && matching > max) { - max = matching; - maxIndices = [leftStart, leftStop, rightStart, rightStop]; - } - } - const [leftStart, leftStop, rightStart, rightStop] = maxIndices; - const leftMid = Math.floor((leftStop + leftStart) / 2); - const rightMid = Math.floor((rightStop + rightStart) / 2); - totalSequence.push(...leftSequence.slice(0, leftMid)); - leftSequence = rightSequence.slice(rightMid); - leftLength = leftSequence.length; - } - totalSequence.push(...leftSequence); - return totalSequence; - } -} -class CodeGenTokenizer extends PreTrainedTokenizer { } -class CLIPTokenizer extends PreTrainedTokenizer { } -class MarianTokenizer extends PreTrainedTokenizer { - /** - * Create a new MarianTokenizer instance. - * @param {Object} tokenizerJSON - The JSON of the tokenizer. - * @param {Object} tokenizerConfig - The config of the tokenizer. - */ - constructor(tokenizerJSON, tokenizerConfig) { - super(tokenizerJSON, tokenizerConfig); - - this.languageRegex = /^(>>\w+<<)\s*/g; - - this.supported_language_codes = this.model.vocab.filter( - x => this.languageRegex.test(x) - ); - } - - /** - * Encodes a single text. Overriding this method is necessary since the language codes - * must be removed before encoding with sentencepiece model. - * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213 - * - * @param {string|null} text - The text to encode. - * @returns {Array} The encoded tokens. - */ - _encode_text(text) { - if (text === null) return null; - - // Check if text starts with language code: - let [matchInfo, ...remainder] = text.trim().split(this.languageRegex); - - if (remainder.length === 0) { - // No language code, encode normally - return super._encode_text(matchInfo); - - } else if (remainder.length === 2) { - // Text starts with language code, so we do not encode it with sentencepiece. - let [language, text] = remainder; - - if (!this.supported_language_codes.includes(language)) { - console.warn(`Unsupported language code "${language}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`) - } - return [language, ...super._encode_text(text)] - } - } - -} - -/** - * A trie structure to efficiently store and search for strings. - */ -class CharTrie { - constructor() { - this.root = CharTrieNode.default(); - } - - /** - * Adds one or more `texts` to the trie. - * @param {string[]} texts - The strings to add to the trie. - */ - extend(texts) { - for (let text of texts) { - this.push(text); - } - } - - /** - * Adds one or more `texts` to the trie. - * @param {*} text - The strings to add to the trie. - */ - push(text) { - let node = this.root; - for (let ch of text) { - let child = node.children.get(ch); - if (child === undefined) { - child = CharTrieNode.default(); - node.children.set(ch, child); - } - node = child; - } - node.isLeaf = true; - } - - /** - * Searches the trie for all strings with a common prefix of `text`. - * @param {string} text - The common prefix to search for. - * @yields {string} - Each string in the trie that has `text` as a prefix. - */ - *commonPrefixSearch(text) { - let node = this.root; - let prefix = ""; - for (let i = 0; i < text.length && node !== undefined; i++) { - const ch = text[i]; - prefix += ch; - node = node.children.get(ch); - if (node !== undefined && node.isLeaf) { - yield prefix; - } - } - } -} - -/** - * Represents a node in a character trie. - * @param {boolean} isLeaf - Whether the node is a leaf node or not. - * @param {Map} children - A map containing the node's children, where the key is a character and the value is a `CharTrieNode`. - */ -class CharTrieNode { - constructor(isLeaf, children) { - this.isLeaf = isLeaf; - this.children = children; - } - - /** - * Returns a new `CharTrieNode` instance with default values. - * @returns {CharTrieNode} A new `CharTrieNode` instance with `isLeaf` set to `false` and an empty `children` map. - */ - static default() { - return new CharTrieNode(false, new Map()); - } -} - -class TokenLattice { - /** - * Creates a new TokenLattice instance. - * - * @param {string} sentence - The input sentence to be tokenized. - * @param {number} bosTokenId - The beginning-of-sequence token ID. - * @param {number} eosTokenId - The end-of-sequence token ID. - */ - constructor(sentence, bosTokenId, eosTokenId) { - this.sentence = sentence; - this.len = sentence.length; - this.bosTokenId = bosTokenId; - this.eosTokenId = eosTokenId; - this.nodes = []; - this.beginNodes = new Array(this.len + 1); - this.endNodes = new Array(this.len + 1); - for (let i = 0; i < this.len + 1; i++) { - this.beginNodes[i] = []; - this.endNodes[i] = []; - } - const bos = new TokenLatticeNode(this.bosTokenId, 0, 0, 0, 0.0); - const eos = new TokenLatticeNode(this.eosTokenId, 1, this.len, 0, 0.0); - this.nodes.push(bos.clone()); - this.nodes.push(eos.clone()); - this.beginNodes[this.len].push(eos); - this.endNodes[0].push(bos); - } - - /** - * Inserts a new token node into the token lattice. - * - * @param {number} pos - The starting position of the token. - * @param {number} length - The length of the token. - * @param {number} score - The score of the token. - * @param {number} tokenId - The token ID of the token. - */ - insert(pos, length, score, tokenId) { - const nodeId = this.nodes.length; - const node = new TokenLatticeNode(tokenId, nodeId, pos, length, score); - this.beginNodes[pos].push(node); - this.endNodes[pos + length].push(node); - this.nodes.push(node); - } - - /** - * Implements the Viterbi algorithm to compute the most likely sequence of tokens. - * - * @returns {TokenLatticeNode[]} - The array of nodes representing the most likely sequence of tokens. - */ - viterbi() { - const len = this.len; - let pos = 0; - while (pos <= len) { - if (this.beginNodes[pos].length == 0) { - return []; - } - for (let rnode of this.beginNodes[pos]) { - rnode.prev = null; - let bestScore = 0.0; - let bestNode = null; - for (let lnode of this.endNodes[pos]) { - const score = lnode.backtraceScore + rnode.score; - if (bestNode === null || score > bestScore) { - bestNode = lnode.clone(); - bestScore = score; - } - } - if (bestNode !== null) { - rnode.prev = bestNode; - rnode.backtraceScore = bestScore; - } - else { - return []; - } - } - pos++; - } - const results = []; - const root = this.beginNodes[len][0]; - const prev = root.prev; - if (prev === null) { - return []; - } - let node = prev.clone(); - while (node.prev !== null) { - results.push(node.clone()); - const n = node.clone(); - node = n.prev.clone(); - } - results.reverse(); - return results; - } - - /** - * @param {any} node - * @returns {string} - The array of nodes representing the most likely sequence of tokens. - */ - piece(node) { - return this.sentence.slice(node.pos, node.pos + node.length); - } - - /** - * @returns {Array} - The array of nodes representing the most likely sequence of tokens. - */ - tokens() { - const nodes = this.viterbi(); - return nodes.map(x => this.piece(x)); - } - - /** - * @returns {Array} - The array of nodes representing the most likely sequence of tokens. - */ - tokenIds() { - const nodes = this.viterbi(); - return nodes.map(x => x.tokenId); - } -} -class TokenLatticeNode { - /** - * Represents a node in a token lattice for a given sentence. - * @param {number} tokenId - The ID of the token associated with this node. - * @param {number} nodeId - The ID of this node. - * @param {number} pos - The starting position of the token in the sentence. - * @param {number} length - The length of the token. - * @param {number} score - The score associated with the token. - */ - constructor(tokenId, nodeId, pos, length, score) { - this.tokenId = tokenId; - this.nodeId = nodeId; - this.pos = pos; - this.length = length; - this.score = score; - this.prev = null; - this.backtraceScore = 0.0; - } - - /** - * Returns a clone of this node. - * @returns {TokenLatticeNode} - A clone of this node. - */ - clone() { - const n = new TokenLatticeNode(this.tokenId, this.nodeId, this.pos, this.length, this.score); - n.prev = this.prev; - n.backtraceScore = this.backtraceScore; - return n; - } -} - -class AutoTokenizer { - // Helper class to determine tokenizer type from tokenizer.json - static TOKENIZER_CLASS_MAPPING = { - 'T5Tokenizer': T5Tokenizer, - 'DistilBertTokenizer': DistilBertTokenizer, - 'BertTokenizer': BertTokenizer, - 'MobileBertTokenizer': MobileBertTokenizer, - 'SqueezeBertTokenizer': SqueezeBertTokenizer, - 'AlbertTokenizer': AlbertTokenizer, - 'GPT2Tokenizer': GPT2Tokenizer, - 'BartTokenizer': BartTokenizer, - 'RobertaTokenizer': RobertaTokenizer, - 'WhisperTokenizer': WhisperTokenizer, - 'CodeGenTokenizer': CodeGenTokenizer, - 'CLIPTokenizer': CLIPTokenizer, - 'MarianTokenizer': MarianTokenizer, - } - - static async from_pretrained(modelPath, progressCallback = null) { - - let [tokenizerJSON, tokenizerConfig] = await Promise.all([ - fetchJSON(modelPath, 'tokenizer.json', progressCallback), - fetchJSON(modelPath, 'tokenizer_config.json', progressCallback), - ]) - - let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerConfig.tokenizer_class]; - if (!cls) { - console.warn(`Unknown tokenizer class "${tokenizerConfig.tokenizer_class}", attempting to construct from base class.`); - cls = PreTrainedTokenizer; - } - return new cls(tokenizerJSON, tokenizerConfig); - } -} - -module.exports = { - AutoTokenizer, - BertTokenizer, - DistilBertTokenizer, - T5Tokenizer, - GPT2Tokenizer -}; - - -/***/ }), - -/***/ "./src/transformers.js": -/*!*****************************!*\ - !*** ./src/transformers.js ***! - \*****************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -const { - AutoTokenizer, - BertTokenizer, - DistilBertTokenizer, - T5Tokenizer, - GPT2Tokenizer -} = __webpack_require__(/*! ./tokenizers.js */ "./src/tokenizers.js"); -const { - AutoModel, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForSeq2SeqLM, - AutoModelForCausalLM, - AutoModelForMaskedLM, - AutoModelForQuestionAnswering, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForObjectDetection, -} = __webpack_require__(/*! ./models.js */ "./src/models.js"); - -const { - AutoProcessor -} = __webpack_require__(/*! ./processors.js */ "./src/processors.js"); -const { - pipeline -} = __webpack_require__(/*! ./pipelines.js */ "./src/pipelines.js"); -const { env } = __webpack_require__(/*! ./env.js */ "./src/env.js"); - -const { Tensor } = __webpack_require__(/*! ./tensor_utils.js */ "./src/tensor_utils.js"); - -const moduleExports = { - // Tokenizers - AutoTokenizer, - BertTokenizer, - DistilBertTokenizer, - T5Tokenizer, - GPT2Tokenizer, - - // Models - AutoModel, - AutoModelForSeq2SeqLM, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForCausalLM, - AutoModelForMaskedLM, - AutoModelForQuestionAnswering, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForObjectDetection, - - // Processors - AutoProcessor, - - // other - pipeline, - Tensor, - - // environment variables - env -}; - -// Allow global access to these variables -if (typeof self !== 'undefined') { - // Used by web workers - Object.assign(self, moduleExports); -} - -// Used by other modules -module.exports = moduleExports - - -/***/ }), - -/***/ "./src/utils.js": -/*!**********************!*\ - !*** ./src/utils.js ***! - \**********************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -const fs = __webpack_require__(/*! fs */ "?569f"); - -const { env } = __webpack_require__(/*! ./env.js */ "./src/env.js"); - -if (__webpack_require__.g.ReadableStream === undefined && typeof process !== 'undefined') { - try { - // @ts-ignore - __webpack_require__.g.ReadableStream = Object(function webpackMissingModule() { var e = new Error("Cannot find module 'node:stream/web'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); // ReadableStream is not a global with Node 16 - } catch (err) { - console.warn("ReadableStream not defined and unable to import from node:stream/web"); - } -} - -class FileResponse { - /** - * Creates a new `FileResponse` object. - * @param {string|URL} filePath - */ - constructor(filePath) { - this.filePath = filePath; - this.headers = {}; - this.headers.get = (x) => this.headers[x] - - this.exists = fs.existsSync(filePath); - if (this.exists) { - this.status = 200; - this.statusText = 'OK'; - - let stats = fs.statSync(filePath); - this.headers['content-length'] = stats.size; - - this.updateContentType(); - - let self = this; - this.body = new ReadableStream({ - start(controller) { - self.arrayBuffer().then(buffer => { - controller.enqueue(new Uint8Array(buffer)); - controller.close(); - }) - } - }); - } else { - this.status = 404; - this.statusText = 'Not Found'; - this.body = null; - } - } - - /** - * Updates the 'content-type' header property of the response based on the extension of - * the file specified by the filePath property of the current object. - * @function - * @returns {void} - */ - updateContentType() { - // Set content-type header based on file extension - const extension = this.filePath.toString().split('.').pop().toLowerCase(); - switch (extension) { - case 'txt': - this.headers['content-type'] = 'text/plain'; - break; - case 'html': - this.headers['content-type'] = 'text/html'; - break; - case 'css': - this.headers['content-type'] = 'text/css'; - break; - case 'js': - this.headers['content-type'] = 'text/javascript'; - break; - case 'json': - this.headers['content-type'] = 'application/json'; - break; - case 'png': - this.headers['content-type'] = 'image/png'; - break; - case 'jpg': - case 'jpeg': - this.headers['content-type'] = 'image/jpeg'; - break; - case 'gif': - this.headers['content-type'] = 'image/gif'; - break; - default: - this.headers['content-type'] = 'application/octet-stream'; - break; - } - } - - /** - * @function - * @returns {FileResponse} - */ - clone() { - let response = new FileResponse(this.filePath); - response.exists = this.exists; - response.status = this.status; - response.statusText = this.statusText; - response.headers = this.headers; - return response; - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with an ArrayBuffer containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with an ArrayBuffer containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async arrayBuffer() { - const data = await fs.promises.readFile(this.filePath); - return data.buffer; - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a Blob containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a Blob containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async blob() { - const data = await fs.promises.readFile(this.filePath); - return new Blob([data], { type: this.headers['content-type'] }); - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a string containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a string containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async text() { - const data = await fs.promises.readFile(this.filePath, 'utf8'); - return data; - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a parsed JavaScript object containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a parsed JavaScript object containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async json() { - return JSON.parse(await this.text()); - } -} - -/** - * Determines whether the given string is a valid HTTP or HTTPS URL. - * @function - * @param {string|URL} string - The string to test for validity as an HTTP or HTTPS URL. - * @returns {boolean} - True if the string is a valid HTTP or HTTPS URL, false otherwise. - */ -function isValidHttpUrl(string) { - // https://stackoverflow.com/a/43467144 - let url; - try { - url = new URL(string); - } catch (_) { - return false; - } - return url.protocol === "http:" || url.protocol === "https:"; -} - -/** - * Helper function to get a file, using either the Fetch API or FileSystem API. - * - * @async - * @function getFile - * @param {string|URL} url - The URL of the file to get. - * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API). - */ -async function getFile(url) { - // Helper function to get a file, using either the Fetch API or FileSystem API - - if (env.useFS && !isValidHttpUrl(url)) { - return new FileResponse(url) - - } else { - return fetch(url) - } -} - -/** - * Helper function to dispatch progress callbacks. - * - * @function dispatchCallback - * @param {function} progressCallback - The progress callback function to dispatch. - * @param {any} data - The data to pass to the progress callback function. - * @returns {void} - */ -function dispatchCallback(progressCallback, data) { - if (progressCallback !== null) progressCallback(data); -} - -/** - * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API. - * - * @async - * @function getModelFile - * @param {string} modelPath - The path of the model file. - * @param {string} fileName - The name of the model file. - * @param {function} [progressCallback=null] - A function to call when the download progress is updated. - * @returns {Promise} A Promise that resolves with the file content as a buffer. - * @throws Will throw an error if the file is not found. - */ -async function getModelFile(modelPath, fileName, progressCallback = null, fatal = true) { - - // Initiate session - dispatchCallback(progressCallback, { - status: 'initiate', - name: modelPath, - file: fileName - }) - - let cache; - if (env.useCache) { - cache = await caches.open('transformers-cache'); - } - - const request = pathJoin(modelPath, fileName); - - /** @type {Response | FileResponse} */ - let response; - - /** @type {Response | FileResponse} */ - let responseToCache; - - if (!env.useCache || (response = await cache.match(request)) === undefined) { - // Caching not available, or model is not cached, so we perform the request - response = await getFile(request); - - if (response.status === 404) { - if (fatal) { - throw Error(`File not found. Could not locate "${request}".`) - } else { - // File not found, but this file is optional. - // TODO in future, cache the response - return null; - } - } - - if (env.useCache) { - // only clone if cache available - responseToCache = response.clone(); - } - } - - // Start downloading - dispatchCallback(progressCallback, { - status: 'download', - name: modelPath, - file: fileName - }) - - const buffer = await readResponse(response, data => { - dispatchCallback(progressCallback, { - status: 'progress', - ...data, - name: modelPath, - file: fileName - }) - }) - - // Check again whether request is in cache. If not, we add the response to the cache - if (responseToCache !== undefined && await cache.match(request) === undefined) { - cache.put(request, /** @type {Response} */(/** @type {unknown} */ (responseToCache))); - } - - dispatchCallback(progressCallback, { - status: 'done', - name: modelPath, - file: fileName - }); - - return buffer; -} - -/** - * Fetches a JSON file from a given path and file name. - * - * @param {string} modelPath - The path to the directory containing the file. - * @param {string} fileName - The name of the file to fetch. - * @param {function} progressCallback - A callback function to receive progress updates. Optional. - * @returns {Promise} - The JSON data parsed into a JavaScript object. - */ -async function fetchJSON(modelPath, fileName, progressCallback = null, fatal = true) { - let buffer = await getModelFile(modelPath, fileName, progressCallback, fatal); - if (buffer === null) { - // Return empty object - return {} - } - - let decoder = new TextDecoder('utf-8'); - let jsonData = decoder.decode(buffer); - - return JSON.parse(jsonData); -} - -/** - * Read and track progress when reading a Response object - * - * @param {any} response - The Response object to read - * @param {function} progressCallback - The function to call with progress updates - * @returns {Promise} A Promise that resolves with the Uint8Array buffer - */ -async function readResponse(response, progressCallback) { - // Read and track progress when reading a Response object - - const contentLength = response.headers.get('Content-Length'); - if (contentLength === null) { - console.warn('Unable to determine content-length from response headers. Will expand buffer when needed.') - } - let total = parseInt(contentLength ?? '0'); - let buffer = new Uint8Array(total); - let loaded = 0; - - const reader = response.body.getReader(); - async function read() { - const { done, value } = await reader.read(); - if (done) return; - - let newLoaded = loaded + value.length; - if (newLoaded > total) { - total = newLoaded; - - // Adding the new data will overflow buffer. - // In this case, we extend the buffer - let newBuffer = new Uint8Array(total); - - // copy contents - newBuffer.set(buffer); - - buffer = newBuffer; - } - buffer.set(value, loaded) - loaded = newLoaded; - - const progress = (loaded / total) * 100; - - // Call your function here - progressCallback({ - progress: progress, - loaded: loaded, - total: total, - }) - - return read(); - } - - // Actually read - await read(); - - return buffer; -} - -/** - * Joins multiple parts of a path into a single path, while handling leading and trailing slashes. - * - * @param {...string} parts - Multiple parts of a path. - * @returns {string} A string representing the joined path. - */ -function pathJoin(...parts) { - // https://stackoverflow.com/a/55142565 - parts = parts.map((part, index) => { - if (index) { - part = part.replace(new RegExp('^/'), ''); - } - if (index !== parts.length - 1) { - part = part.replace(new RegExp('/$'), ''); - } - return part; - }) - return parts.join('/'); -} - -/** - * Reverses the keys and values of an object. - * - * @param {object} data - The object to reverse. - * @returns {object} The reversed object. - * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript - */ -function reverseDictionary(data) { - // https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript - return Object.fromEntries(Object.entries(data).map(([key, value]) => [value, key])); -} - -/** - * Returns the index of the maximum value in an array. - * @param {Array} arr - The input array. - * @see https://stackoverflow.com/a/11301464 - * @returns {number} - The index of the maximum value in the array. - */ -function indexOfMax(arr) { - // https://stackoverflow.com/a/11301464 - - if (arr.length === 0) { - return -1; - } - - var max = arr[0]; - var maxIndex = 0; - - for (var i = 1; i < arr.length; ++i) { - if (arr[i] > max) { - maxIndex = i; - max = arr[i]; - } - } - - return maxIndex; -} - -/** - * Compute the softmax of an array of numbers. - * - * @param {number[]} arr - The array of numbers to compute the softmax of. - * @returns {number[]} The softmax array. - */ -function softmax(arr) { - // Compute the maximum value in the array - const maxVal = max(arr); - - // Compute the exponentials of the array values - const exps = arr.map(x => Math.exp(x - maxVal)); - - // Compute the sum of the exponentials - const sumExps = exps.reduce((acc, val) => acc + val, 0); - - // Compute the softmax values - const softmaxArr = exps.map(x => x / sumExps); - - return softmaxArr; -} - -/** - * Calculates the logarithm of the softmax function for the input array. - * @param {number[]} arr - The input array to calculate the log_softmax function for. - * @returns {any} - The resulting log_softmax array. - */ -function log_softmax(arr) { - // Compute the softmax values - const softmaxArr = softmax(arr); - - // Apply log formula to each element - const logSoftmaxArr = softmaxArr.map(x => Math.log(x)); - - return logSoftmaxArr; -} - -/** - * Escapes regular expression special characters from a string by replacing them with their escaped counterparts. - * - * @param {string} string - The string to escape. - * @returns {string} - The escaped string. - */ -function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string -} - -/** - * Get the top k items from an iterable, sorted by descending order - * - * @param {Array} items - The items to be sorted - * @param {number} [top_k=0] - The number of top items to return (default: 0 = return all) - * @returns {Array} - The top k items, sorted by descending order - */ -function getTopItems(items, top_k = 0) { - // if top == 0, return all - - items = Array.from(items) - .map((x, i) => [i, x]) // Get indices ([index, score]) - .sort((a, b) => b[1] - a[1]) // Sort by log probabilities - - if (top_k > 0) { - items = items.slice(0, top_k); // Get top k items - } - - return items -} - -/** - * Calculates the dot product of two arrays. - * @param {number[]} arr1 - The first array. - * @param {number[]} arr2 - The second array. - * @returns {number} - The dot product of arr1 and arr2. - */ -function dot(arr1, arr2) { - return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0); -} - -/** - * Computes the cosine similarity between two arrays. - * - * @param {number[]} arr1 - The first array. - * @param {number[]} arr2 - The second array. - * @returns {number} The cosine similarity between the two arrays. - */ -function cos_sim(arr1, arr2) { - // Calculate dot product of the two arrays - const dotProduct = dot(arr1, arr2); - - // Calculate the magnitude of the first array - const magnitudeA = magnitude(arr1); - - // Calculate the magnitude of the second array - const magnitudeB = magnitude(arr2); - - // Calculate the cosine similarity - const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB); - - return cosineSimilarity; -} - -/** - * Calculates the magnitude of a given array. - * @param {number[]} arr - The array to calculate the magnitude of. - * @returns {number} The magnitude of the array. - */ -function magnitude(arr) { - return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0)); -} - -/** - * A base class for creating callable objects. - * - * @extends Function - */ -class Callable extends Function { - /** - * Creates a new instance of the Callable class. - */ - constructor() { - super(); - /** - * Creates a closure that delegates to a private method '_call' with the given arguments. - * - * @param {...any} args - Zero or more arguments to pass to the '_call' method. - * @returns {*} - The result of calling the '_call' method. - */ - let closure = function (...args) { - // @ts-ignore - return closure._call(...args) - } - return Object.setPrototypeOf(closure, new.target.prototype) - } - - /** - * This method should be implemented in subclasses to provide the - * functionality of the callable object. - * - * @throws {Error} Must implement _call method in subclass - * @param {...*} args - */ - _call(...args) { - throw Error('Must implement _call method in subclass') - } -} - -/** - * Returns the minimum item. - * @param {number[]} arr - array of numbers. - * @returns {number} - the minimum number. - * @throws {Error} If array is empty. - */ -function min(arr) { - if (arr.length === 0) throw Error('Array must not be empty'); - let min = arr[0]; - for (let i = 1; i < arr.length; ++i) { - if (arr[i] < min) { - min = arr[i]; - } - } - return min; -} - - -/** - * Returns the maximum item. - * @param {number[]} arr - array of numbers. - * @returns {number} - the maximum number. - * @throws {Error} If array is empty. - */ -function max(arr) { - if (arr.length === 0) throw Error('Array must not be empty'); - let max = arr[0]; - for (let i = 1; i < arr.length; ++i) { - if (arr[i] > max) { - max = arr[i]; - } - } - return max; -} - -/** - * Check if a value is a string. - * @param {*} text - The value to check. - * @returns {boolean} - True if the value is a string, false otherwise. - */ -function isString(text) { - return typeof text === 'string' || text instanceof String -} - -/** - * Check if a value is an integer. - * @param {*} x - The value to check. - * @returns {boolean} - True if the value is a string, false otherwise. - */ -function isIntegralNumber(x) { - return Number.isInteger(x) || typeof x === 'bigint' -} - -/** - * Check if a value is exists. - * @param {*} x - The value to check. - * @returns {boolean} - True if the value exists, false otherwise. - */ -function exists(x) { - return x !== undefined && x !== null; -} - -module.exports = { - Callable, - getModelFile, - dispatchCallback, - fetchJSON, - pathJoin, - reverseDictionary, - indexOfMax, - softmax, - log_softmax, - escapeRegExp, - getTopItems, - dot, - cos_sim, - magnitude, - getFile, - isIntegralNumber, - isString, - exists, - min, - max, -}; - - -/***/ }), - -/***/ "?569f": -/*!********************!*\ - !*** fs (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?3f59": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?36f4": -/*!***********************!*\ - !*** sharp (ignored) ***! - \***********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__("./src/transformers.js"); -/******/ -/******/ })() -; -//# sourceMappingURL=transformers.js.map \ No newline at end of file diff --git a/dist/transformers.js.map b/dist/transformers.js.map deleted file mode 100644 index c773f7539..000000000 --- a/dist/transformers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dist/transformers.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,KAAK,mBAAmB,SAAS;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qCAAqC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mCAAmC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,2BAA2B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,oBAAoB,OAAO,IAAI,MAAM,cAAc;AAC3G;AACA;;;;;;;;;;;;;;;;ACxFA;AACA;AACiD;AACjD;;;;;;;;;;;;;;;ACHA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,MAAM;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACtBA;AACA;AACqC;AACrC;AACA;AACA;AACO,gBAAgB,8CAAO;AAC9B;;;;;;;;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC0B;AACJ;AACc;AACX;AACI;AAC7B;;;;;;;;;;;;;;;;;ACtBA;AACA;AACgD;AACd;AAC3B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,2CAAM;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2CAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,KAAK;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,2CAAM;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,KAAK;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2CAAM;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,kBAAkB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,+BAA+B;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzLA;AACA;AACoF;AACpF;AACO,yBAAyB,qEAAoB;AACpD;;;;;;;;;;;;ACLA;AACA;AACU;AACV;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA,wCAAwC,EAAE,6BAA6B,IAAI;AAC3E;AACA;AACA,yCAAyC,EAAE,yCAAyC,IAAI;AACxF;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,KAAK;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,MAAM,gCAAgC,sBAAsB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,iBAAiB;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,iBAAiB;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,KAAK,+BAA+B,YAAY;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AAC5D;AACA;AACA;AACA,mCAAmC;AACnC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,OAAO;AACvB;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,wBAAwB,UAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA,gBAAgB,OAAO;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,gBAAgB,OAAO;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,eAAe;AACnD;AACA;AACA;AACA,UAAU;AACV;AACA,oCAAoC,eAAe;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA,6BAA6B,eAAe;AAC5C;AACA;AACA,4CAA4C,WAAW;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,eAAe;AACnD;AACA;AACA;AACA,UAAU;AACV;AACA,oCAAoC,eAAe;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,eAAe;AAC5C,uCAAuC,kBAAkB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjfA,QAAQ,SAAS,EAAE,mBAAO,CAAC,gDAAmB;AAC9C;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,kCAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,YAAY;AAC3B,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA,wBAAwB,4CAA4C;AACpE;AACA,4BAA4B,+BAA+B;AAC3D;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC9dA;AACA,WAAW,mBAAO,CAAC,iBAAI;AACvB,QAAQ,oBAAoB,EAAE,mBAAO,CAAC,kCAAY;AAClD,QAAQ,MAAM,EAAE,mBAAO,CAAC,8BAAU;AAClC;AACA;AACA,cAAc,mBAAO,CAAC,oBAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,yCAAyC,YAAY;AACrD,cAAc,aAAa,6BAA6B,yBAAyB;AACjF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV,uDAAuD,aAAa;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,cAAc;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,cAAc;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,cAAc;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,aAAa;AAC9B;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,cAAc;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7TA;AACA;AACA,aAAa,gIAAgI;AAC7I,aAAa,gCAAgC;AAC7C,aAAa,4BAA4B;AACzC;AACA;AACA;AACA,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,cAAc,eAAe;AAC7B,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,kCAAY;AACxB;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,wCAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,4CAAiB;AAC7B;AACA,QAAQ,2BAA2B,EAAE,mBAAO,CAAC,kDAAoB;AACjE;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,6CAAgB;AAC5B,QAAQ,uCAAuC;AAC/C;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,aAAa,2BAA2B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,oEAAoE,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,aAAa,+BAA+B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,aAAa,0BAA0B;AACvC;AACA;AACA;AACA;AACA,EAAE,IAAI;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,QAAQ;AACzB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,iBAAiB;AAClC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,aAAa;AAC1B,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,gBAAgB;AAC/B,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,IAAI;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6BAA6B;AAC7D,oDAAoD,EAAE;AACtD,oDAAoD,EAAE;AACtD;AACA;AACA;AACA,gCAAgC,6BAA6B;AAC7D,oDAAoD,EAAE;AACtD,oDAAoD,EAAE;AACtD;AACA;AACA,cAAc;AACd;AACA,gCAAgC,qBAAqB;AACrD,oDAAoD,EAAE;AACtD,oDAAoD,EAAE;AACtD;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,gCAAgC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,gCAAgC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,iBAAiB;AACjB,eAAe,OAAO;AACtB;AACA;AACA;AACA,iLAAiL,6BAA6B;AAC9M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA,kLAAkL,8BAA8B;AAChN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,iBAAiB;AACjB;AACA;AACA;AACA,mLAAmL,+BAA+B;AAClN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe,OAAO;AACtB;AACA;AACA;AACA,sLAAsL,kCAAkC;AACxN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0CAA0C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,oCAAoC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB,gBAAgB;AAChB,iBAAiB;AACjB;AACA;AACA;AACA,mLAAmL,kBAAkB;AACrM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB,gBAAgB;AAChB,iBAAiB;AACjB;AACA;AACA;AACA,qLAAqL,oBAAoB;AACzM;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA,gBAAgB,QAAQ;AACxB,iBAAiB;AACjB;AACA;AACA;AACA,sLAAsL,qBAAqB;AAC3M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,iCAAiC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB,gBAAgB;AAChB,iBAAiB;AACjB;AACA;AACA;AACA,iLAAiL,6BAA6B;AAC9M;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,KAAK;AACnB,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,KAAK;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iDAAiD,kBAAkB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,iBAAiB;AAClC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,gEAAgE;AACjF,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,0BAA0B;AAC3C,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACvnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,kCAAY;AACxB;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,4CAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,oCAAa;AACzB;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,4CAAiB;AAC7B;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,8BAAU;AACtB;AACA,QAAQ,yBAAyB,EAAE,mBAAO,CAAC,gDAAmB;AAC9D,QAAQ,cAAc,EAAE,mBAAO,CAAC,8CAAkB;AAClD;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,2BAA2B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,wBAAwB,iCAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oCAAoC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA,2CAA2C,qBAAqB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,2BAA2B;AACtF;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ,WAAW;AAClC,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA,gBAAgB,OAAO;AACvB;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD;AACvD,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ,mBAAmB;AAC1C,iBAAiB,cAAc;AAC/B;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB;AACA,gBAAgB;AAChB;AACA;AACA,iDAAiD;AACjD;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,iBAAiB,+BAA+B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,2BAA2B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ,UAAU;AACjC,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,iBAAiB,iBAAiB;AAClC;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,4BAA4B,8BAA8B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,yBAAyB;AACzB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8BAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ,4HAA4H;AACnJ;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA,oDAAoD;AACpD,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,wCAAwC,iCAAiC;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,aAAa,mBAAmB;AAChC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,KAAK,oBAAoB,6BAA6B;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,MAAM;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACn7CA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,kCAAY;AACxB;AACA;AACA,YAAY,mBAAO,CAAC,8BAAU;AAC9B,QAAQ,sCAAsC,EAAE,mBAAO,CAAC,gDAAmB;AAC3E;AACA,QAAQ,cAAc,EAAE,mBAAO,CAAC,8CAAkB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,oBAAoB;AACrC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,uEAAuE,0CAA0C;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA,wCAAwC;AACxC,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD,gCAAgC,OAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa,oBAAoB;AAClD,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,UAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,gCAAgC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B,eAAe,UAAU;AACzB,iBAAiB,gBAAgB,4CAA4C,IAAI;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,4BAA4B,+BAA+B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B,eAAe,YAAY;AAC3B,iBAAiB,QAAQ,4CAA4C,4CAA4C,EAAE;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,yDAAyD;AACzD;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA,4BAA4B,wBAAwB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,kBAAkB,qCAAqC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC,4BAA4B,QAAQ;AACpC,iDAAiD;AACjD;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,UAAU,wBAAwB,GAAG;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACt9BA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,kCAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,iGAAiG,uCAAuC;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA,oCAAoC;AACpC,oCAAoC;AACpC;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wBAAwB;AACxD;AACA;AACA;AACA,aAAa;AACb;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxPA,QAAQ,OAAO,EAAE,mBAAO,CAAC,kDAAoB;AAC7C;AACA,QAAQ,2DAA2D,EAAE,mBAAO,CAAC,4CAAiB;AAC9F;AACA;AACA;AACA,aAAa,yCAAyC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAsD;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB;AACjB;AACA;AACA,4BAA4B,0BAA0B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,2BAA2B;AAC3B;AACA,2BAA2B;AAC3B;AACA,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,aAAa,0EAA0E;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,mDAAmD;AACnD,mDAAmD;AACnD,mDAAmD;AACnD,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB;AACA,cAAc,qFAAqF;AACnG,aAAa,6BAA6B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,eAAe,cAAc,WAAW;AAC5F;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,kCAAY;AACxB;AACA,QAAQ,SAAS,EAAE,mBAAO,CAAC,gDAAmB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,YAAY;AAC5E;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,yBAAyB;AACxC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mDAAmD;AAC3E,wBAAwB,mDAAmD;AAC3E,wBAAwB,mDAAmD;AAC3E;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA,yBAAyB,WAAW,EAAE,KAAK;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,YAAY;AAC7B,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,YAAY;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,cAAc;AAC7B,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,YAAY;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,UAAU;AACzB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,eAAe,iBAAiB;AAChC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,6BAA6B,EAAE,WAAW,EAAE;AAC5C;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,qDAAqD,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE;AAClF;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,eAAe;AAChC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,YAAY;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iCAAiC;AACnD,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,eAAe;AAC9B,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,YAAY;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,gBAAgB,QAAQ;AACxB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB,aAAa;AAC9B,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,kDAAkD,KAAK;AACvD;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB,eAAe,iBAAiB;AAChC,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,mBAAmB,uCAAuC,iCAAiC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,IAAI;AACd;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ,eAAe;AACtC,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB;AACA,iBAAiB,QAAQ;AACzB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,gJAAgJ,qBAAqB;AACrK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,QAAQ;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ,yDAAyD,GAAG;AACnF,eAAe,QAAQ;AACvB,iBAAiB,UAAU,gBAAgB,2EAA2E,EAAE,GAAG;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,sBAAsB;AACtB;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB,UAAU;AAC3B,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,8BAA8B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,2DAA2D,SAAS,uEAAuE,8CAA8C;AACzL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,wBAAwB,uCAAuC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,2BAA2B;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gCAAgC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACljFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,4CAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,oCAAa;AACzB;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,4CAAiB;AAC7B;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,0CAAgB;AAC5B,QAAQ,MAAM,EAAE,mBAAO,CAAC,8BAAU;AAClC;AACA,QAAQ,SAAS,EAAE,mBAAO,CAAC,gDAAmB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrEA;AACA,WAAW,mBAAO,CAAC,iBAAI;AACvB;AACA,QAAQ,MAAM,EAAE,mBAAO,CAAC,8BAAU;AAClC;AACA,IAAI,qBAAM;AACV;AACA;AACA,QAAQ,qBAAM,kBAAkB,8IAAyC,EAAE;AAC3E,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,eAAe;AAChC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,kCAAkC,oCAAoC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,gCAAgC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,KAAK;AAChB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,QAAQ;AACzE,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,sCAAsC,UAAU,cAAc,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,UAAU;AACrB,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B,qBAAqB,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,aAAa,QAAQ;AACrB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,aAAa,QAAQ;AACrB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5oBA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;UENA;UACA;UACA;UACA","sources":["webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/backend-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/backend.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/env-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/env.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/index.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/inference-session.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/onnx-value.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/tensor-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/tensor.js","webpack://@xenova/transformers/./node_modules/onnxruntime-web/dist/ort-web.min.js","webpack://@xenova/transformers/./src/backends/onnx.js","webpack://@xenova/transformers/./src/env.js","webpack://@xenova/transformers/./src/fft.js","webpack://@xenova/transformers/./src/generation.js","webpack://@xenova/transformers/./src/image_utils.js","webpack://@xenova/transformers/./src/math_utils.js","webpack://@xenova/transformers/./src/models.js","webpack://@xenova/transformers/./src/pipelines.js","webpack://@xenova/transformers/./src/processors.js","webpack://@xenova/transformers/./src/samplers.js","webpack://@xenova/transformers/./src/tensor_utils.js","webpack://@xenova/transformers/./src/tokenizers.js","webpack://@xenova/transformers/./src/transformers.js","webpack://@xenova/transformers/./src/utils.js","webpack://@xenova/transformers/ignored|D:\\joshu\\Xenova\\Projects\\transformers.js\\src|fs","webpack://@xenova/transformers/ignored|D:\\joshu\\Xenova\\Projects\\transformers.js\\src|path","webpack://@xenova/transformers/ignored|D:\\joshu\\Xenova\\Projects\\transformers.js\\src|sharp","webpack://@xenova/transformers/webpack/bootstrap","webpack://@xenova/transformers/webpack/runtime/define property getters","webpack://@xenova/transformers/webpack/runtime/global","webpack://@xenova/transformers/webpack/runtime/hasOwnProperty shorthand","webpack://@xenova/transformers/webpack/runtime/make namespace object","webpack://@xenova/transformers/webpack/before-startup","webpack://@xenova/transformers/webpack/startup","webpack://@xenova/transformers/webpack/after-startup"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nconst backends = {};\nconst backendsSortedByPriority = [];\n/**\n * Register a backend.\n *\n * @param name - the name as a key to lookup as an execution provider.\n * @param backend - the backend object.\n * @param priority - an integer indicating the priority of the backend. Higher number means higher priority. if priority\n * < 0, it will be considered as a 'beta' version and will not be used as a fallback backend by default.\n *\n * @internal\n */\nexport const registerBackend = (name, backend, priority) => {\n if (backend && typeof backend.init === 'function' && typeof backend.createSessionHandler === 'function') {\n const currentBackend = backends[name];\n if (currentBackend === undefined) {\n backends[name] = { backend, priority };\n }\n else if (currentBackend.priority > priority) {\n // same name is already registered with a higher priority. skip registeration.\n return;\n }\n else if (currentBackend.priority === priority) {\n if (currentBackend.backend !== backend) {\n throw new Error(`cannot register backend \"${name}\" using priority ${priority}`);\n }\n }\n if (priority >= 0) {\n const i = backendsSortedByPriority.indexOf(name);\n if (i !== -1) {\n backendsSortedByPriority.splice(i, 1);\n }\n for (let i = 0; i < backendsSortedByPriority.length; i++) {\n if (backends[backendsSortedByPriority[i]].priority <= priority) {\n backendsSortedByPriority.splice(i, 0, name);\n return;\n }\n }\n backendsSortedByPriority.push(name);\n }\n return;\n }\n throw new TypeError('not a valid backend');\n};\n/**\n * Resolve backend by specified hints.\n *\n * @param backendHints - a list of execution provider names to lookup. If omitted use registered backends as list.\n * @returns a promise that resolves to the backend.\n *\n * @internal\n */\nexport const resolveBackend = async (backendHints) => {\n const backendNames = backendHints.length === 0 ? backendsSortedByPriority : backendHints;\n const errors = [];\n for (const backendName of backendNames) {\n const backendInfo = backends[backendName];\n if (backendInfo) {\n if (backendInfo.initialized) {\n return backendInfo.backend;\n }\n else if (backendInfo.aborted) {\n continue; // current backend is unavailable; try next\n }\n const isInitializing = !!backendInfo.initPromise;\n try {\n if (!isInitializing) {\n backendInfo.initPromise = backendInfo.backend.init();\n }\n await backendInfo.initPromise;\n backendInfo.initialized = true;\n return backendInfo.backend;\n }\n catch (e) {\n if (!isInitializing) {\n errors.push({ name: backendName, err: e });\n }\n backendInfo.aborted = true;\n }\n finally {\n delete backendInfo.initPromise;\n }\n }\n }\n throw new Error(`no available backend found. ERR: ${errors.map(e => `[${e.name}] ${e.err}`).join(', ')}`);\n};\n//# sourceMappingURL=backend-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nexport { registerBackend } from './backend-impl';\n//# sourceMappingURL=backend.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nexport class EnvImpl {\n constructor() {\n this.wasm = {};\n this.webgl = {};\n this.logLevelInternal = 'warning';\n }\n // TODO standadize the getter and setter convention in env for other fields.\n set logLevel(value) {\n if (value === undefined) {\n return;\n }\n if (typeof value !== 'string' || ['verbose', 'info', 'warning', 'error', 'fatal'].indexOf(value) === -1) {\n throw new Error(`Unsupported logging level: ${value}`);\n }\n this.logLevelInternal = value;\n }\n get logLevel() {\n return this.logLevelInternal;\n }\n}\n//# sourceMappingURL=env-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { EnvImpl } from './env-impl';\n/**\n * Represent a set of flags as a global singleton.\n */\nexport const env = new EnvImpl();\n//# sourceMappingURL=env.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n/**\n * # ONNX Runtime JavaScript API\n *\n * ONNX Runtime JavaScript API is a unified API for all JavaScript usages, including the following NPM packages:\n *\n * - [onnxruntime-node](https://www.npmjs.com/package/onnxruntime-node)\n * - [onnxruntime-web](https://www.npmjs.com/package/onnxruntime-web)\n * - [onnxruntime-react-native](https://www.npmjs.com/package/onnxruntime-react-native)\n *\n * See also:\n * - [Get Started](https://onnxruntime.ai/docs/get-started/with-javascript.html)\n * - [Inference examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js)\n *\n * @packageDocumentation\n */\nexport * from './backend';\nexport * from './env';\nexport * from './inference-session';\nexport * from './tensor';\nexport * from './onnx-value';\n//# sourceMappingURL=index.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { resolveBackend } from './backend-impl';\nimport { Tensor } from './tensor';\nexport class InferenceSession {\n constructor(handler) {\n this.handler = handler;\n }\n async run(feeds, arg1, arg2) {\n const fetches = {};\n let options = {};\n // check inputs\n if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n throw new TypeError('\\'feeds\\' must be an object that use input names as keys and OnnxValue as corresponding values.');\n }\n let isFetchesEmpty = true;\n // determine which override is being used\n if (typeof arg1 === 'object') {\n if (arg1 === null) {\n throw new TypeError('Unexpected argument[1]: cannot be null.');\n }\n if (arg1 instanceof Tensor) {\n throw new TypeError('\\'fetches\\' cannot be a Tensor');\n }\n if (Array.isArray(arg1)) {\n if (arg1.length === 0) {\n throw new TypeError('\\'fetches\\' cannot be an empty array.');\n }\n isFetchesEmpty = false;\n // output names\n for (const name of arg1) {\n if (typeof name !== 'string') {\n throw new TypeError('\\'fetches\\' must be a string array or an object.');\n }\n if (this.outputNames.indexOf(name) === -1) {\n throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n }\n fetches[name] = null;\n }\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n // decide whether arg1 is fetches or options\n // if any output name is present and its value is valid OnnxValue, we consider it fetches\n let isFetches = false;\n const arg1Keys = Object.getOwnPropertyNames(arg1);\n for (const name of this.outputNames) {\n if (arg1Keys.indexOf(name) !== -1) {\n const v = arg1[name];\n if (v === null || v instanceof Tensor) {\n isFetches = true;\n isFetchesEmpty = false;\n fetches[name] = v;\n }\n }\n }\n if (isFetches) {\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n options = arg1;\n }\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('Unexpected argument[1]: must be \\'fetches\\' or \\'options\\'.');\n }\n // check if all inputs are in feed\n for (const name of this.inputNames) {\n if (typeof feeds[name] === 'undefined') {\n throw new Error(`input '${name}' is missing in 'feeds'.`);\n }\n }\n // if no fetches is specified, we use the full output names list\n if (isFetchesEmpty) {\n for (const name of this.outputNames) {\n fetches[name] = null;\n }\n }\n // feeds, fetches and options are prepared\n const results = await this.handler.run(feeds, fetches, options);\n const returnValue = {};\n for (const key in results) {\n if (Object.hasOwnProperty.call(results, key)) {\n returnValue[key] = new Tensor(results[key].type, results[key].data, results[key].dims);\n }\n }\n return returnValue;\n }\n static async create(arg0, arg1, arg2, arg3) {\n // either load from a file or buffer\n let filePathOrUint8Array;\n let options = {};\n if (typeof arg0 === 'string') {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (arg0 instanceof Uint8Array) {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (arg0 instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && arg0 instanceof SharedArrayBuffer)) {\n const buffer = arg0;\n let byteOffset = 0;\n let byteLength = arg0.byteLength;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 === 'number') {\n byteOffset = arg1;\n if (!Number.isSafeInteger(byteOffset)) {\n throw new RangeError('\\'byteOffset\\' must be an integer.');\n }\n if (byteOffset < 0 || byteOffset >= buffer.byteLength) {\n throw new RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`);\n }\n byteLength = arg0.byteLength - byteOffset;\n if (typeof arg2 === 'number') {\n byteLength = arg2;\n if (!Number.isSafeInteger(byteLength)) {\n throw new RangeError('\\'byteLength\\' must be an integer.');\n }\n if (byteLength <= 0 || byteOffset + byteLength > buffer.byteLength) {\n throw new RangeError(`'byteLength' is out of range (0, ${buffer.byteLength - byteOffset}].`);\n }\n if (typeof arg3 === 'object' && arg3 !== null) {\n options = arg3;\n }\n else if (typeof arg3 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'byteLength\\' must be a number.');\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n filePathOrUint8Array = new Uint8Array(buffer, byteOffset, byteLength);\n }\n else {\n throw new TypeError('Unexpected argument[0]: must be \\'path\\' or \\'buffer\\'.');\n }\n // get backend hints\n const eps = options.executionProviders || [];\n const backendHints = eps.map(i => typeof i === 'string' ? i : i.name);\n const backend = await resolveBackend(backendHints);\n const handler = await backend.createSessionHandler(filePathOrUint8Array, options);\n return new InferenceSession(handler);\n }\n startProfiling() {\n this.handler.startProfiling();\n }\n endProfiling() {\n this.handler.endProfiling();\n }\n get inputNames() {\n return this.handler.inputNames;\n }\n get outputNames() {\n return this.handler.outputNames;\n }\n}\n//# sourceMappingURL=inference-session-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { InferenceSession as InferenceSessionImpl } from './inference-session-impl';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const InferenceSession = InferenceSessionImpl;\n//# sourceMappingURL=inference-session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nexport {};\n//# sourceMappingURL=onnx-value.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nconst isBigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined' && typeof BigInt64Array.from === 'function';\nconst isBigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined' && typeof BigUint64Array.from === 'function';\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nconst NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP = new Map([\n ['float32', Float32Array],\n ['uint8', Uint8Array],\n ['int8', Int8Array],\n ['uint16', Uint16Array],\n ['int16', Int16Array],\n ['int32', Int32Array],\n ['bool', Uint8Array],\n ['float64', Float64Array],\n ['uint32', Uint32Array],\n]);\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nconst NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP = new Map([\n [Float32Array, 'float32'],\n [Uint8Array, 'uint8'],\n [Int8Array, 'int8'],\n [Uint16Array, 'uint16'],\n [Int16Array, 'int16'],\n [Int32Array, 'int32'],\n [Float64Array, 'float64'],\n [Uint32Array, 'uint32'],\n]);\nif (isBigInt64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('int64', BigInt64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array, 'int64');\n}\nif (isBigUint64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('uint64', BigUint64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array, 'uint64');\n}\n/**\n * calculate size from dims.\n *\n * @param dims the dims array. May be an illegal input.\n */\nconst calculateSize = (dims) => {\n let size = 1;\n for (let i = 0; i < dims.length; i++) {\n const dim = dims[i];\n if (typeof dim !== 'number' || !Number.isSafeInteger(dim)) {\n throw new TypeError(`dims[${i}] must be an integer, got: ${dim}`);\n }\n if (dim < 0) {\n throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${dim}`);\n }\n size *= dim;\n }\n return size;\n};\nexport class Tensor {\n constructor(arg0, arg1, arg2) {\n let type;\n let data;\n let dims;\n // check whether arg0 is type or data\n if (typeof arg0 === 'string') {\n //\n // Override: constructor(type, data, ...)\n //\n type = arg0;\n dims = arg2;\n if (arg0 === 'string') {\n // string tensor\n if (!Array.isArray(arg1)) {\n throw new TypeError('A string tensor\\'s data must be a string array.');\n }\n // we don't check whether every element in the array is string; this is too slow. we assume it's correct and\n // error will be populated at inference\n data = arg1;\n }\n else {\n // numeric tensor\n const typedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(arg0);\n if (typedArrayConstructor === undefined) {\n throw new TypeError(`Unsupported tensor type: ${arg0}.`);\n }\n if (Array.isArray(arg1)) {\n // use 'as any' here because TypeScript's check on type of 'SupportedTypedArrayConstructors.from()' produces\n // incorrect results.\n // 'typedArrayConstructor' should be one of the typed array prototype objects.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = typedArrayConstructor.from(arg1);\n }\n else if (arg1 instanceof typedArrayConstructor) {\n data = arg1;\n }\n else {\n throw new TypeError(`A ${type} tensor's data must be type of ${typedArrayConstructor}`);\n }\n }\n }\n else {\n //\n // Override: constructor(data, ...)\n //\n dims = arg1;\n if (Array.isArray(arg0)) {\n // only boolean[] and string[] is supported\n if (arg0.length === 0) {\n throw new TypeError('Tensor type cannot be inferred from an empty array.');\n }\n const firstElementType = typeof arg0[0];\n if (firstElementType === 'string') {\n type = 'string';\n data = arg0;\n }\n else if (firstElementType === 'boolean') {\n type = 'bool';\n // 'arg0' is of type 'boolean[]'. Uint8Array.from(boolean[]) actually works, but typescript thinks this is\n // wrong type. We use 'as any' to make it happy.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = Uint8Array.from(arg0);\n }\n else {\n throw new TypeError(`Invalid element type of data array: ${firstElementType}.`);\n }\n }\n else {\n // get tensor type from TypedArray\n const mappedType = NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(arg0.constructor);\n if (mappedType === undefined) {\n throw new TypeError(`Unsupported type for tensor data: ${arg0.constructor}.`);\n }\n type = mappedType;\n data = arg0;\n }\n }\n // type and data is processed, now processing dims\n if (dims === undefined) {\n // assume 1-D tensor if dims omitted\n dims = [data.length];\n }\n else if (!Array.isArray(dims)) {\n throw new TypeError('A tensor\\'s dims must be a number array');\n }\n // perform check\n const size = calculateSize(dims);\n if (size !== data.length) {\n throw new Error(`Tensor's size(${size}) does not match data length(${data.length}).`);\n }\n this.dims = dims;\n this.type = type;\n this.data = data;\n this.size = size;\n }\n // #endregion\n /**\n * Create a new tensor object from image object\n *\n * @param buffer - Extracted image buffer data - assuming RGBA format\n * @param imageFormat - input image configuration - required configurations height, width, format\n * @param tensorFormat - output tensor configuration - Default is RGB format\n */\n static bufferToTensor(buffer, options) {\n if (buffer === undefined) {\n throw new Error('Image buffer must be defined');\n }\n if (options.height === undefined || options.width === undefined) {\n throw new Error('Image height and width must be defined');\n }\n const { height, width } = options;\n const norm = options.norm;\n let normMean;\n let normBias;\n if (norm === undefined || norm.mean === undefined) {\n normMean = 255;\n }\n else {\n normMean = norm.mean;\n }\n if (norm === undefined || norm.bias === undefined) {\n normBias = 0;\n }\n else {\n normBias = norm.bias;\n }\n const inputformat = options.bitmapFormat !== undefined ? options.bitmapFormat : 'RGBA';\n // default value is RGBA since imagedata and HTMLImageElement uses it\n const outputformat = options.tensorFormat !== undefined ?\n (options.tensorFormat !== undefined ? options.tensorFormat : 'RGB') :\n 'RGB';\n const offset = height * width;\n const float32Data = outputformat === 'RGBA' ? new Float32Array(offset * 4) : new Float32Array(offset * 3);\n // Default pointer assignments\n let step = 4, rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = offset, bTensorPointer = offset * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGB') {\n step = 3;\n rImagePointer = 0;\n gImagePointer = 1;\n bImagePointer = 2;\n aImagePointer = -1;\n }\n // Updating the pointer assignments based on the output tensor format\n if (outputformat === 'RGBA') {\n aTensorPointer = offset * 3;\n }\n else if (outputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = offset;\n gTensorPointer = offset * 2;\n }\n else if (outputformat === 'BGR') {\n bTensorPointer = 0;\n gTensorPointer = offset;\n rTensorPointer = offset * 2;\n }\n for (let i = 0; i < offset; i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step) {\n float32Data[rTensorPointer++] = (buffer[rImagePointer] + normBias) / normMean;\n float32Data[gTensorPointer++] = (buffer[gImagePointer] + normBias) / normMean;\n float32Data[bTensorPointer++] = (buffer[bImagePointer] + normBias) / normMean;\n if (aTensorPointer !== -1 && aImagePointer !== -1) {\n float32Data[aTensorPointer++] = (buffer[aImagePointer] + normBias) / normMean;\n }\n }\n // Float32Array -> ort.Tensor\n const outputTensor = outputformat === 'RGBA' ? new Tensor('float32', float32Data, [1, 4, height, width]) :\n new Tensor('float32', float32Data, [1, 3, height, width]);\n return outputTensor;\n }\n static async fromImage(image, options) {\n // checking the type of image object\n const isHTMLImageEle = typeof (HTMLImageElement) !== 'undefined' && image instanceof HTMLImageElement;\n const isImageDataEle = typeof (ImageData) !== 'undefined' && image instanceof ImageData;\n const isImageBitmap = typeof (ImageBitmap) !== 'undefined' && image instanceof ImageBitmap;\n const isURL = typeof (String) !== 'undefined' && (image instanceof String || typeof image === 'string');\n let data;\n let tensorConfig = {};\n // filling and checking image configuration options\n if (isHTMLImageEle) {\n // HTMLImageElement - image object - format is RGBA by default\n const canvas = document.createElement('canvas');\n const pixels2DContext = canvas.getContext('2d');\n if (pixels2DContext != null) {\n let height = image.naturalHeight;\n let width = image.naturalWidth;\n if (options !== undefined && options.resizedHeight !== undefined && options.resizedWidth !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n if (options !== undefined) {\n tensorConfig = options;\n if (options.tensorFormat !== undefined) {\n throw new Error('Image input config format must be RGBA for HTMLImageElement');\n }\n else {\n tensorConfig.tensorFormat = 'RGBA';\n }\n if (options.height !== undefined && options.height !== height) {\n throw new Error('Image input config height doesn\\'t match HTMLImageElement height');\n }\n else {\n tensorConfig.height = height;\n }\n if (options.width !== undefined && options.width !== width) {\n throw new Error('Image input config width doesn\\'t match HTMLImageElement width');\n }\n else {\n tensorConfig.width = width;\n }\n }\n else {\n tensorConfig.tensorFormat = 'RGBA';\n tensorConfig.height = height;\n tensorConfig.width = width;\n }\n canvas.width = width;\n canvas.height = height;\n pixels2DContext.drawImage(image, 0, 0, width, height);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else if (isImageDataEle) {\n // ImageData - image object - format is RGBA by default\n const format = 'RGBA';\n let height;\n let width;\n if (options !== undefined && options.resizedWidth !== undefined && options.resizedHeight !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n else {\n height = image.height;\n width = image.width;\n }\n if (options !== undefined) {\n tensorConfig = options;\n if (options.bitmapFormat !== undefined && options.bitmapFormat !== format) {\n throw new Error('Image input config format must be RGBA for ImageData');\n }\n else {\n tensorConfig.bitmapFormat = 'RGBA';\n }\n }\n else {\n tensorConfig.bitmapFormat = 'RGBA';\n }\n tensorConfig.height = height;\n tensorConfig.width = width;\n if (options !== undefined) {\n const tempCanvas = document.createElement('canvas');\n tempCanvas.width = width;\n tempCanvas.height = height;\n const pixels2DContext = tempCanvas.getContext('2d');\n if (pixels2DContext != null) {\n pixels2DContext.putImageData(image, 0, 0);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else {\n data = image.data;\n }\n }\n else if (isImageBitmap) {\n // ImageBitmap - image object - format must be provided by user\n if (options === undefined) {\n throw new Error('Please provide image config with format for Imagebitmap');\n }\n if (options.bitmapFormat !== undefined) {\n throw new Error('Image input config format must be defined for ImageBitmap');\n }\n const pixels2DContext = document.createElement('canvas').getContext('2d');\n if (pixels2DContext != null) {\n const height = image.height;\n const width = image.width;\n pixels2DContext.drawImage(image, 0, 0, width, height);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n if (options !== undefined) {\n // using square brackets to avoid TS error - type 'never'\n if (options.height !== undefined && options.height !== height) {\n throw new Error('Image input config height doesn\\'t match ImageBitmap height');\n }\n else {\n tensorConfig.height = height;\n }\n // using square brackets to avoid TS error - type 'never'\n if (options.width !== undefined && options.width !== width) {\n throw new Error('Image input config width doesn\\'t match ImageBitmap width');\n }\n else {\n tensorConfig.width = width;\n }\n }\n else {\n tensorConfig.height = height;\n tensorConfig.width = width;\n }\n return Tensor.bufferToTensor(data, tensorConfig);\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else if (isURL) {\n return new Promise((resolve, reject) => {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!image || !context) {\n return reject();\n }\n const newImage = new Image();\n newImage.crossOrigin = 'Anonymous';\n newImage.src = image;\n newImage.onload = () => {\n canvas.width = newImage.width;\n canvas.height = newImage.height;\n context.drawImage(newImage, 0, 0, canvas.width, canvas.height);\n const img = context.getImageData(0, 0, canvas.width, canvas.height);\n if (options !== undefined) {\n // using square brackets to avoid TS error - type 'never'\n if (options.height !== undefined && options.height !== canvas.height) {\n throw new Error('Image input config height doesn\\'t match ImageBitmap height');\n }\n else {\n tensorConfig.height = canvas.height;\n }\n // using square brackets to avoid TS error - type 'never'\n if (options.width !== undefined && options.width !== canvas.width) {\n throw new Error('Image input config width doesn\\'t match ImageBitmap width');\n }\n else {\n tensorConfig.width = canvas.width;\n }\n }\n else {\n tensorConfig.height = canvas.height;\n tensorConfig.width = canvas.width;\n }\n resolve(Tensor.bufferToTensor(img.data, tensorConfig));\n };\n });\n }\n else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n if (data !== undefined) {\n return Tensor.bufferToTensor(data, tensorConfig);\n }\n else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n }\n toImageData(options) {\n var _a, _b;\n const pixels2DContext = document.createElement('canvas').getContext('2d');\n let image;\n if (pixels2DContext != null) {\n // Default values for height and width & format\n const width = this.dims[3];\n const height = this.dims[2];\n const channels = this.dims[1];\n const inputformat = options !== undefined ? (options.format !== undefined ? options.format : 'RGB') : 'RGB';\n const normMean = options !== undefined ? (((_a = options.norm) === null || _a === void 0 ? void 0 : _a.mean) !== undefined ? options.norm.mean : 255) : 255;\n const normBias = options !== undefined ? (((_b = options.norm) === null || _b === void 0 ? void 0 : _b.bias) !== undefined ? options.norm.bias : 0) : 0;\n const offset = height * width;\n if (options !== undefined) {\n if (options.height !== undefined && options.height !== height) {\n throw new Error('Image output config height doesn\\'t match tensor height');\n }\n if (options.width !== undefined && options.width !== width) {\n throw new Error('Image output config width doesn\\'t match tensor width');\n }\n if (options.format !== undefined && (channels === 4 && options.format !== 'RGBA') ||\n (channels === 3 && (options.format !== 'RGB' && options.format !== 'BGR'))) {\n throw new Error('Tensor format doesn\\'t match input tensor dims');\n }\n }\n // Default pointer assignments\n const step = 4;\n let rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = offset, bTensorPointer = offset * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGBA') {\n rTensorPointer = 0;\n gTensorPointer = offset;\n bTensorPointer = offset * 2;\n aTensorPointer = offset * 3;\n }\n else if (inputformat === 'RGB') {\n rTensorPointer = 0;\n gTensorPointer = offset;\n bTensorPointer = offset * 2;\n }\n else if (inputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = offset;\n gTensorPointer = offset * 2;\n }\n image = pixels2DContext.createImageData(width, height);\n for (let i = 0; i < height * width; rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++) {\n image.data[rImagePointer] = (this.data[rTensorPointer++] - normBias) * normMean; // R value\n image.data[gImagePointer] = (this.data[gTensorPointer++] - normBias) * normMean; // G value\n image.data[bImagePointer] = (this.data[bTensorPointer++] - normBias) * normMean; // B value\n image.data[aImagePointer] =\n aTensorPointer === -1 ? 255 : (this.data[aTensorPointer++] - normBias) * normMean; // A value\n }\n }\n else {\n throw new Error('Can not access image data');\n }\n return image;\n }\n // #endregion\n // #region tensor utilities\n reshape(dims) {\n return new Tensor(this.type, this.data, dims);\n }\n}\n//# sourceMappingURL=tensor-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { Tensor as TensorImpl } from './tensor-impl';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Tensor = TensorImpl;\n//# sourceMappingURL=tensor.js.map","/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n!function(t,e){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=e(require(\"onnxruntime-common\"));else if(\"function\"==typeof define&&define.amd)define([],e);else{var n=\"object\"==typeof exports?e(require(\"onnxruntime-common\")):e(t.ort);for(var r in n)(\"object\"==typeof exports?exports:t)[r]=n[r]}}(self,(__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){function e(){return $.buffer!=C&&H($.buffer),F}function r(){return $.buffer!=C&&H($.buffer),N}function i(){return $.buffer!=C&&H($.buffer),L}function o(){return $.buffer!=C&&H($.buffer),R}function a(){return $.buffer!=C&&H($.buffer),j}var s,u,c;t=t||{},s||(s=void 0!==t?t:{}),s.ready=new Promise((function(t,e){u=t,c=e}));var l,p,f,d,h,g,b=Object.assign({},s),m=\"./this.program\",y=(t,e)=>{throw e},_=\"object\"==typeof window,v=\"function\"==typeof importScripts,w=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,x=s.ENVIRONMENT_IS_PTHREAD||!1,T=\"\";function S(t){return s.locateFile?s.locateFile(t,T):T+t}if(w){let e;T=v?n(908).dirname(T)+\"/\":\"//\",g=()=>{h||(d=n(1384),h=n(908))},l=function(t,e){return g(),t=h.normalize(t),d.readFileSync(t,e?void 0:\"utf8\")},f=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),p=(t,e,n)=>{g(),t=h.normalize(t),d.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(J())throw process.exitCode=t,e;e instanceof ut||P(\"exiting due to exception: \"+e),process.exit(t)},s.inspect=function(){return\"[Emscripten Module object]\"};try{e=n(9925)}catch(t){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),t}n.g.Worker=e.Worker}else(_||v)&&(v?T=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(T=document.currentScript.src),_scriptDir&&(T=_scriptDir),T=0!==T.indexOf(\"blob:\")?T.substr(0,T.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",w||(l=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},v&&(f=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),p=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));w&&\"undefined\"==typeof performance&&(n.g.performance=n(6953).performance);var O=console.log.bind(console),A=console.warn.bind(console);w&&(g(),O=t=>d.writeSync(1,t+\"\\n\"),A=t=>d.writeSync(2,t+\"\\n\"));var E,I=s.print||O,P=s.printErr||A;Object.assign(s,b),b=null,s.thisProgram&&(m=s.thisProgram),s.quit&&(y=s.quit),s.wasmBinary&&(E=s.wasmBinary);var D=s.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&it(\"no native wasm support detected\");var $,k,C,F,N,L,R,j,M=!1,U=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function V(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function B(t,e){return(t>>>=0)?V(r(),t,e):\"\"}function z(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-i}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function H(t){C=t,s.HEAP8=F=new Int8Array(t),s.HEAP16=new Int16Array(t),s.HEAP32=L=new Int32Array(t),s.HEAPU8=N=new Uint8Array(t),s.HEAPU16=new Uint16Array(t),s.HEAPU32=R=new Uint32Array(t),s.HEAPF32=new Float32Array(t),s.HEAPF64=j=new Float64Array(t)}x&&(C=s.buffer);var W=s.INITIAL_MEMORY||16777216;if(x)$=s.wasmMemory,C=s.buffer;else if(s.wasmMemory)$=s.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),w&&console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\"),Error(\"bad memory\");$&&(C=$.buffer),W=C.byteLength,H(C);var q,X=[],Y=[],K=[],Z=[];function J(){return D||!1}function Q(){var t=s.preRun.shift();X.unshift(t)}var tt,et=0,nt=null,rt=null;function it(t){throw x?postMessage({cmd:\"onAbort\",arg:t}):s.onAbort&&s.onAbort(t),P(t=\"Aborted(\"+t+\")\"),M=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),c(t),t}function ot(){return tt.startsWith(\"data:application/octet-stream;base64,\")}function at(){var t=tt;try{if(t==tt&&E)return new Uint8Array(E);if(f)return f(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){it(t)}}tt=\"ort-wasm-threaded.wasm\",ot()||(tt=S(tt));var st={};function ut(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function ct(t){(t=dt.Vb[t])||it(),dt.mc(t)}function lt(t){var e=dt.Cc();if(!e)return 6;dt.ac.push(e),dt.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:\"run\",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function pt(t){if(x)return qt(1,1,t);J()||(dt.oc(),s.onExit&&s.onExit(t),M=!0),y(t,new ut(t))}function ft(t,e){if(!e&&x)throw bt(t),\"unwind\";J()||x||(me(),ht(K),be(0),re[1].length&&ie(1,10),re[2].length&&ie(2,10),dt.oc()),pt(t)}var dt={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&dt.Ec()},Pc:function(){},Ec:function(){dt.receiveObjectTransfer=dt.Gc,dt.threadInitTLS=dt.pc,dt.setExitStatus=dt.nc,D=!1},nc:function(){},oc:function(){for(var t of Object.values(dt.Vb))dt.mc(t);for(t of dt.Yb)t.terminate();dt.Yb=[]},mc:function(t){var e=t.Ub;delete dt.Vb[e],dt.Yb.push(t),dt.ac.splice(dt.ac.indexOf(t),1),t.Ub=0,xe(e)},Gc:function(){},pc:function(){dt.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(dt.Bc=t.Ub),n.targetThread&&n.targetThread!=de()){var i=dt.Vb[n.Qc];i?i.postMessage(n,n.transferList):P('Internal error! Worker sent a message \"'+r+'\" to target pthread '+n.targetThread+\", but that thread no longer exists!\")}else\"processProxyingQueue\"===r?Vt(n.queue):\"spawnThread\"===r?lt(n):\"cleanupThread\"===r?ct(n.thread):\"killThread\"===r?(n=n.thread,r=dt.Vb[n],delete dt.Vb[n],r.terminate(),xe(n),dt.ac.splice(dt.ac.indexOf(r),1),r.Ub=0):\"cancelThread\"===r?dt.Vb[n.thread].postMessage({cmd:\"cancel\"}):\"loaded\"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):\"print\"===r?I(\"Thread \"+n.threadId+\": \"+n.text):\"printErr\"===r?P(\"Thread \"+n.threadId+\": \"+n.text):\"alert\"===r?alert(\"Thread \"+n.threadId+\": \"+n.text):\"setimmediate\"===n.target?t.postMessage(n):\"onAbort\"===r?s.onAbort&&s.onAbort(n.arg):r&&P(\"worker sent an unknown command \"+r);dt.Bc=void 0},t.onerror=t=>{throw P(\"worker sent an error! \"+t.filename+\":\"+t.lineno+\": \"+t.message),t},w&&(t.on(\"message\",(function(e){t.onmessage({data:e})})),t.on(\"error\",(function(e){t.onerror(e)})),t.on(\"detachedExit\",(function(){}))),t.postMessage({cmd:\"load\",urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:$,wasmModule:k})},yc:function(){var t=S(\"ort-wasm-threaded.worker.js\");dt.Yb.push(new Worker(t))},Cc:function(){return 0==dt.Yb.length&&(dt.yc(),dt.Fc(dt.Yb[0])),dt.Yb.pop()}};function ht(t){for(;0>2>>>0];t=i()[t+48>>2>>>0],Oe(e,e-t),Ee(e)};var mt=[];function yt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=q.get(t)),e}s.invokeEntryPoint=function(t,e){t=yt(t)(e),J()?dt.nc(t):Te(t)};var _t,vt,wt=[],xt=0,Tt=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){o()[this.Sb+4>>2>>>0]=t},this.bc=function(){return o()[this.Sb+4>>2>>>0]},this.wc=function(t){o()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return o()[this.Sb+8>>2>>>0]},this.rc=function(){i()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(i(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(i(),this.Sb>>2,1)},this.cc=function(t){o()[this.Sb+16>>2>>>0]=t},this.tc=function(){return o()[this.Sb+16>>2>>>0]},this.vc=function(){if(De(this.bc()))return o()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Ot(t){return ge(new St(t).Sb)}function At(t,e,n,r){return x?qt(3,1,t,e,n,r):Et(t,e,n,r)}function Et(t,e,n,r){if(\"undefined\"==typeof SharedArrayBuffer)return P(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var i=[];return x&&0===i.length?At(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:i},x?(t.Oc=\"spawnThread\",postMessage(t,i),0):lt(t))}function It(t,e,n){return x?qt(4,1,t,e,n):0}function Pt(t,e){if(x)return qt(5,1,t,e)}function Dt(t,e){if(x)return qt(6,1,t,e)}function $t(t,e,n){if(x)return qt(7,1,t,e,n)}function kt(t,e,n){return x?qt(8,1,t,e,n):0}function Ct(t,e){if(x)return qt(9,1,t,e)}function Ft(t,e,n){if(x)return qt(10,1,t,e,n)}function Nt(t,e,n,r){if(x)return qt(11,1,t,e,n,r)}function Lt(t,e,n,r){if(x)return qt(12,1,t,e,n,r)}function Rt(t,e,n,r){if(x)return qt(13,1,t,e,n,r)}function jt(t){if(x)return qt(14,1,t)}function Mt(t,e){if(x)return qt(15,1,t,e)}function Ut(t,e,n){if(x)return qt(16,1,t,e,n)}function Vt(t){Atomics.store(i(),t>>2,1),de()&&we(t),Atomics.compareExchange(i(),t>>2,1,0)}function Bt(t){return o()[t>>>2]+4294967296*i()[t+4>>>2]}function zt(t,e,n,r,i,o){return x?qt(17,1,t,e,n,r,i,o):-52}function Gt(t,e,n,r,i,o){if(x)return qt(18,1,t,e,n,r,i,o)}function Ht(t){var n=G(t)+1,r=he(n);return r&&z(t,e(),r,n),r}function Wt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:\"GMT\"}if(x)return qt(19,1,t,e,n);var a=(new Date).getFullYear(),s=new Date(a,0,1),u=new Date(a,6,1);a=s.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(a,c);i()[t>>2>>>0]=60*l,i()[e>>2>>>0]=Number(a!=c),t=r(s),e=r(u),t=Ht(t),e=Ht(e),c>2>>>0]=t,o()[n+4>>2>>>0]=e):(o()[n>>2>>>0]=e,o()[n+4>>2>>>0]=t)}function qt(t,e){var n=arguments.length-2,r=arguments;return gt((()=>{for(var i=Ie(8*n),o=i>>3,s=0;s>>0]=u}return ve(t,n,i,e)}))}s.executeNotifiedProxyingQueue=Vt,vt=w?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:x?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Xt,Yt=[],Kt={};function Zt(){if(!Xt){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:m||\"./this.program\"};for(t in Kt)void 0===Kt[t]?delete e[t]:e[t]=Kt[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);Xt=n}return Xt}function Jt(t,n){if(x)return qt(20,1,t,n);var r=0;return Zt().forEach((function(i,a){var s=n+r;for(a=o()[t+4*a>>2>>>0]=s,s=0;s>0>>>0]=i.charCodeAt(s);e()[a>>0>>>0]=0,r+=i.length+1})),0}function Qt(t,e){if(x)return qt(21,1,t,e);var n=Zt();o()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),o()[e>>2>>>0]=r,0}function te(t){return x?qt(22,1,t):52}function ee(t,e,n,r){return x?qt(23,1,t,e,n,r):52}function ne(t,e,n,r,i){return x?qt(24,1,t,e,n,r,i):70}var re=[null,[],[]];function ie(t,e){var n=re[t];0===e||10===e?((1===t?I:P)(V(n,0)),n.length=0):n.push(e)}function oe(t,e,n,i){if(x)return qt(25,1,t,e,n,i);for(var a=0,s=0;s>2>>>0],c=o()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);a+=c}return o()[i>>2>>>0]=a,0}var ae=0;function se(t){return 0==t%4&&(0!=t%100||0==t%400)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,o){function a(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=c(new Date(t.getFullYear(),0,4)),n=c(n),0>=u(e,t)?0>=u(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var p=i()[o+40>>2>>>0];for(var f in o={Lc:i()[o>>2>>>0],Kc:i()[o+4>>2>>>0],dc:i()[o+8>>2>>>0],jc:i()[o+12>>2>>>0],ec:i()[o+16>>2>>>0],Xb:i()[o+20>>2>>>0],Tb:i()[o+24>>2>>>0],Wb:i()[o+28>>2>>>0],Rc:i()[o+32>>2>>>0],Jc:i()[o+36>>2>>>0],Mc:p?B(p):\"\"},r=B(r),p={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})r=r.replace(new RegExp(f,\"g\"),p[f]);var d=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),h=\"January February March April May June July August September October November December\".split(\" \");for(f in p={\"%a\":function(t){return d[t.Tb].substring(0,3)},\"%A\":function(t){return d[t.Tb]},\"%b\":function(t){return h[t.ec].substring(0,3)},\"%B\":function(t){return h[t.ec]},\"%C\":function(t){return s((t.Xb+1900)/100|0,2)},\"%d\":function(t){return s(t.jc,2)},\"%e\":function(t){return a(t.jc,2,\" \")},\"%g\":function(t){return l(t).toString().substring(2)},\"%G\":function(t){return l(t)},\"%H\":function(t){return s(t.dc,2)},\"%I\":function(t){return 0==(t=t.dc)?t=12:12t.dc?\"AM\":\"PM\"},\"%S\":function(t){return s(t.Lc,2)},\"%t\":function(){return\"\\t\"},\"%u\":function(t){return t.Tb||7},\"%U\":function(t){return s(Math.floor((t.Wb+7-t.Tb)/7),2)},\"%V\":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&se(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&se(t.Xb%400-1))&&e++}return s(e,2)},\"%w\":function(t){return t.Tb},\"%W\":function(t){return s(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},\"%y\":function(t){return(t.Xb+1900).toString().substring(2)},\"%Y\":function(t){return t.Xb+1900},\"%z\":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.Mc},\"%%\":function(){return\"%\"}},r=r.replace(/%%/g,\"\\0\\0\"),p)r.includes(f)&&(r=r.replace(new RegExp(f,\"g\"),p[f](o)));return f=function(t){var e=Array(G(t)+1);return z(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,\"%\")),f.length>n?0:(function(t,n){e().set(t,n>>>0)}(f,t),f.length-1)}dt.fc();var pe=[null,pt,bt,At,It,Pt,Dt,$t,kt,Ct,Ft,Nt,Lt,Rt,jt,Mt,Ut,zt,Gt,Wt,Jt,Qt,te,ee,ne,oe],fe={b:function(t){return he(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),xt--),t.ic(!1),wt.push(t),t.sc(),t.vc()},ma:function(t){throw P(\"Unexpected exception thrown, this is not properly supported - aborting\"),M=!0,t},x:function(){Se(0);var t=wt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&yt(e)(t.Zb),Ot(t.Zb)}Tt=0},e:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;iVt(r)));else if(x)postMessage({targetThread:t,cmd:\"processProxyingQueue\",queue:r});else{if(!(t=dt.Vb[t]))return;t.postMessage({cmd:\"processProxyingQueue\",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Bt(t)),i()[e>>2>>>0]=t.getUTCSeconds(),i()[e+4>>2>>>0]=t.getUTCMinutes(),i()[e+8>>2>>>0]=t.getUTCHours(),i()[e+12>>2>>>0]=t.getUTCDate(),i()[e+16>>2>>>0]=t.getUTCMonth(),i()[e+20>>2>>>0]=t.getUTCFullYear()-1900,i()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,i()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Bt(t)),i()[e>>2>>>0]=t.getSeconds(),i()[e+4>>2>>>0]=t.getMinutes(),i()[e+8>>2>>>0]=t.getHours(),i()[e+12>>2>>>0]=t.getDate(),i()[e+16>>2>>>0]=t.getMonth(),i()[e+20>>2>>>0]=t.getFullYear()-1900,i()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;i()[e+28>>2>>>0]=r,i()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),i()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(i()[t+20>>2>>>0]+1900,i()[t+16>>2>>>0],i()[t+12>>2>>>0],i()[t+8>>2>>>0],i()[t+4>>2>>>0],i()[t>>2>>>0],0),n=i()[t+32>>2>>>0],r=e.getTimezoneOffset(),o=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),u=Math.min(s,a);return 0>n?i()[t+32>>2>>>0]=Number(a!=s&&u==r):0>2>>>0]=e.getDay(),n=(e.getTime()-o.getTime())/864e5|0,i()[t+28>>2>>>0]=n,i()[t>>2>>>0]=e.getSeconds(),i()[t+4>>2>>>0]=e.getMinutes(),i()[t+8>>2>>>0]=e.getHours(),i()[t+12>>2>>>0]=e.getDate(),i()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:zt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Wt(e,n,r))},y:function(){it(\"\")},U:function(){if(!w&&!v){var t=\"Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread\";_t||(_t={}),_t[t]||(_t[t]=1,w&&(t=\"warning: \"+t),P(t))}},ra:function(){return 4294901760},B:vt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return w?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Yt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?st[-t-1]:pe[t]).apply(null,Yt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var i=e*(1+.2/n);i=Math.min(i,t+100663296);var o=Math;i=Math.max(t,i),o=o.min.call(o,4294901760,i+(65536-i%65536)%65536);t:{try{$.grow(o-C.byteLength+65535>>>16),H($.buffer);var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Na:function(){throw\"unwind\"},Ga:Jt,Ha:Qt,J:ft,I:te,S:ee,ga:ne,R:oe,d:function(){return ae},na:function t(r,i){t.lc||(t.lc=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(w)try{var e=n(Object(function(){var t=new Error(\"Cannot find module 'crypto'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>it(\"randomDevice\")}());for(var o=0;o>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ae();try{return yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ae();try{return yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var i=Ae();try{return yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,i){var o=Ae();try{return yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,i,o){var a=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,i,o){var a=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,i,o,a){var s=Ae();try{return yt(t)(e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,i,o,a,s){var u=Ae();try{return yt(t)(e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Ae();try{return yt(t)(e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,i,o,a,s){var u=Ae();try{return Me(t,e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,i,o,a){var s=Ae();try{return ke(t,e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,i){var o=Ae();try{return Ue(t,e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var i=Ae();try{return Re(t,e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ae();try{return $e(t)}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ae();try{return je(t,e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ae();try{return Ce(t,e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ae();try{yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ae();try{yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ae();try{yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,i){var o=Ae();try{yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,i,o){var a=Ae();try{yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,i,o,a){var s=Ae();try{yt(t)(e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,i,o,a,s){var u=Ae();try{yt(t)(e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,i,o,a,s,u){var c=Ae();try{yt(t)(e,n,r,i,o,a,s,u)}catch(t){if(Ee(c),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,i,o,a,s,u,c,l){var p=Ae();try{yt(t)(e,n,r,i,o,a,s,u,c,l)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,i,o,a,s,u,c,l,p,f,d,h,g){var b=Ae();try{yt(t)(e,n,r,i,o,a,s,u,c,l,p,f,d,h,g)}catch(t){if(Ee(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,i,o,a,s){var u=Ae();try{Fe(t,e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Ae();try{Le(t,e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,i,o){var a=Ae();try{Ne(t,e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:$||s.wasmMemory,G:function(t){ae=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){s.asm=t.exports,dt.qc.push(s.asm.sb),q=s.asm.ub,Y.unshift(s.asm.Va),k=e,x||(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!E&&(_||v)){if(\"function\"==typeof fetch&&!tt.startsWith(\"file://\"))return fetch(tt,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at '\"+tt+\"'\";return t.arrayBuffer()})).catch((function(){return at()}));if(p)return new Promise((function(t,e){p(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return at()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){P(\"failed to asynchronously prepare wasm: \"+t),it(t)}))}var r={a:fe};if(x||(et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(t){return P(\"Module.instantiateWasm callback failed with error: \"+t),!1}(E||\"function\"!=typeof WebAssembly.instantiateStreaming||ot()||tt.startsWith(\"file://\")||w||\"function\"!=typeof fetch?n(e):fetch(tt,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return P(\"wasm streaming compile failed: \"+t),P(\"falling back to ArrayBuffer instantiation\"),n(e)}))}))).catch(c)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Va).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Wa).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Xa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Ya).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Za).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm._a).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.$a).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.ab).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.bb).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.cb).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.db).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.eb).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.fb).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.gb).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.hb).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.ib).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.jb).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.kb).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.lb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.mb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.nb).apply(null,arguments)};var de=s._pthread_self=function(){return(de=s._pthread_self=s.asm.ob).apply(null,arguments)},he=s._malloc=function(){return(he=s._malloc=s.asm.pb).apply(null,arguments)},ge=s._free=function(){return(ge=s._free=s.asm.qb).apply(null,arguments)},be=s._fflush=function(){return(be=s._fflush=s.asm.rb).apply(null,arguments)};s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.sb).apply(null,arguments)};var me=s.___funcs_on_exit=function(){return(me=s.___funcs_on_exit=s.asm.tb).apply(null,arguments)},ye=s.__emscripten_thread_init=function(){return(ye=s.__emscripten_thread_init=s.asm.vb).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.wb).apply(null,arguments)};var _e,ve=s._emscripten_run_in_main_runtime_thread_js=function(){return(ve=s._emscripten_run_in_main_runtime_thread_js=s.asm.xb).apply(null,arguments)},we=s.__emscripten_proxy_execute_task_queue=function(){return(we=s.__emscripten_proxy_execute_task_queue=s.asm.yb).apply(null,arguments)},xe=s.__emscripten_thread_free_data=function(){return(xe=s.__emscripten_thread_free_data=s.asm.zb).apply(null,arguments)},Te=s.__emscripten_thread_exit=function(){return(Te=s.__emscripten_thread_exit=s.asm.Ab).apply(null,arguments)},Se=s._setThrew=function(){return(Se=s._setThrew=s.asm.Bb).apply(null,arguments)},Oe=s._emscripten_stack_set_limits=function(){return(Oe=s._emscripten_stack_set_limits=s.asm.Cb).apply(null,arguments)},Ae=s.stackSave=function(){return(Ae=s.stackSave=s.asm.Db).apply(null,arguments)},Ee=s.stackRestore=function(){return(Ee=s.stackRestore=s.asm.Eb).apply(null,arguments)},Ie=s.stackAlloc=function(){return(Ie=s.stackAlloc=s.asm.Fb).apply(null,arguments)},Pe=s.___cxa_can_catch=function(){return(Pe=s.___cxa_can_catch=s.asm.Gb).apply(null,arguments)},De=s.___cxa_is_pointer_type=function(){return(De=s.___cxa_is_pointer_type=s.asm.Hb).apply(null,arguments)},$e=s.dynCall_j=function(){return($e=s.dynCall_j=s.asm.Ib).apply(null,arguments)},ke=s.dynCall_iiiiij=function(){return(ke=s.dynCall_iiiiij=s.asm.Jb).apply(null,arguments)},Ce=s.dynCall_jii=function(){return(Ce=s.dynCall_jii=s.asm.Kb).apply(null,arguments)},Fe=s.dynCall_viiiiij=function(){return(Fe=s.dynCall_viiiiij=s.asm.Lb).apply(null,arguments)},Ne=s.dynCall_vjji=function(){return(Ne=s.dynCall_vjji=s.asm.Mb).apply(null,arguments)},Le=s.dynCall_viiijjjii=function(){return(Le=s.dynCall_viiijjjii=s.asm.Nb).apply(null,arguments)},Re=s.dynCall_iij=function(){return(Re=s.dynCall_iij=s.asm.Ob).apply(null,arguments)},je=s.dynCall_ji=function(){return(je=s.dynCall_ji=s.asm.Pb).apply(null,arguments)},Me=s.dynCall_iiiiiij=function(){return(Me=s.dynCall_iiiiiij=s.asm.Qb).apply(null,arguments)},Ue=s.dynCall_iiij=function(){return(Ue=s.dynCall_iiij=s.asm.Rb).apply(null,arguments)};function Ve(){function t(){if(!_e&&(_e=!0,s.calledRun=!0,!M)&&(x||ht(Y),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!x)){if(s.postRun)for(\"function\"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var t=s.postRun.shift();Z.unshift(t)}ht(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){var e,r,i;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,i=e}));var o,a,s,u,c,l,p=Object.assign({},e),f=\"./this.program\",d=(t,e)=>{throw e},h=\"object\"==typeof window,g=\"function\"==typeof importScripts,b=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,m=\"\";b?(m=g?n(908).dirname(m)+\"/\":\"//\",l=()=>{c||(u=n(1384),c=n(908))},o=function(t,e){return l(),t=c.normalize(t),u.readFileSync(t,e?void 0:\"utf8\")},s=t=>((t=o(t,!0)).buffer||(t=new Uint8Array(t)),t),a=(t,e,n)=>{l(),t=c.normalize(t),u.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(w||0{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},g&&(s=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),a=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var y,_=e.print||console.log.bind(console),v=e.printErr||console.warn.bind(console);Object.assign(e,p),p=null,e.thisProgram&&(f=e.thisProgram),e.quit&&(d=e.quit),e.wasmBinary&&(y=e.wasmBinary);var w=e.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&W(\"no native wasm support detected\");var x,T,S,O,A,E,I=!1,P=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function D(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function $(t,e){return(t>>>=0)?D(O,t,e):\"\"}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-i}function C(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function F(){var t=x.buffer;T=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=A=new Int32Array(t),e.HEAPU8=O=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=E=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var N,L=[],R=[],j=[],M=[],U=0;function V(){var t=e.preRun.shift();L.unshift(t)}var B,z=0,G=null,H=null;function W(t){throw e.onAbort&&e.onAbort(t),v(t=\"Aborted(\"+t+\")\"),I=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),i(t),t}function q(){return B.startsWith(\"data:application/octet-stream;base64,\")}if(B=\"ort-wasm.wasm\",!q()){var X=B;B=e.locateFile?e.locateFile(X,m):m+X}function Y(){var t=B;try{if(t==B&&y)return new Uint8Array(y);if(s)return s(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){W(t)}}function K(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return E[this.zb+4>>2>>>0]},this.Sb=function(t){E[this.zb+8>>2>>>0]=t},this.Wb=function(){return E[this.zb+8>>2>>>0]},this.Tb=function(){A[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){A[this.zb>>2>>>0]+=1},this.Xb=function(){var t=A[this.zb>>2>>>0];return A[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){E[this.zb+16>>2>>>0]=t},this.Ob=function(){return E[this.zb+16>>2>>>0]},this.Qb=function(){if(Et(this.Eb()))return E[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return _t(new et(t).zb)}var rt=[];function it(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=N.get(t)),e}function ot(t){var e=C(t)+1,n=yt(e);return n&&k(t,S,n,e),n}var at={};function st(){if(!ut){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:f||\"./this.program\"};for(t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);ut=n}return ut}var ut,ct=[null,[],[]];function lt(t,e){var n=ct[t];0===e||10===e?((1===t?_:v)(D(n,0)),n.length=0):n.push(e)}var pt=0;function ft(t){return 0==t%4&&(0!=t%100||0==t%400)}var dt=[31,29,31,30,31,30,31,31,30,31,30,31],ht=[31,28,31,30,31,30,31,31,30,31,30,31];function gt(t,e,n,r){function i(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=a(e,t)?0>=a(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=A[r+40>>2>>>0];for(var l in r={$b:A[r>>2>>>0],Zb:A[r+4>>2>>>0],Gb:A[r+8>>2>>>0],Kb:A[r+12>>2>>>0],Hb:A[r+16>>2>>>0],Cb:A[r+20>>2>>>0],Ab:A[r+24>>2>>>0],Bb:A[r+28>>2>>>0],bc:A[r+32>>2>>>0],Yb:A[r+36>>2>>>0],ac:c?$(c):\"\"},n=$(n),c={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})n=n.replace(new RegExp(l,\"g\"),c[l]);var p=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),f=\"January February March April May June July August September October November December\".split(\" \");for(l in c={\"%a\":function(t){return p[t.Ab].substring(0,3)},\"%A\":function(t){return p[t.Ab]},\"%b\":function(t){return f[t.Hb].substring(0,3)},\"%B\":function(t){return f[t.Hb]},\"%C\":function(t){return o((t.Cb+1900)/100|0,2)},\"%d\":function(t){return o(t.Kb,2)},\"%e\":function(t){return i(t.Kb,2,\" \")},\"%g\":function(t){return u(t).toString().substring(2)},\"%G\":function(t){return u(t)},\"%H\":function(t){return o(t.Gb,2)},\"%I\":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?\"AM\":\"PM\"},\"%S\":function(t){return o(t.$b,2)},\"%t\":function(){return\"\\t\"},\"%u\":function(t){return t.Ab||7},\"%U\":function(t){return o(Math.floor((t.Bb+7-t.Ab)/7),2)},\"%V\":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&ft(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&ft(t.Cb%400-1))&&e++}return o(e,2)},\"%w\":function(t){return t.Ab},\"%W\":function(t){return o(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},\"%y\":function(t){return(t.Cb+1900).toString().substring(2)},\"%Y\":function(t){return t.Cb+1900},\"%z\":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.ac},\"%%\":function(){return\"%\"}},n=n.replace(/%%/g,\"\\0\\0\"),c)n.includes(l)&&(n=n.replace(new RegExp(l,\"g\"),c[l](r)));return l=function(t){var e=Array(C(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,\"%\")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return yt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),Q--),t.Jb(!1),J.push(t),t.Nb(),t.Qb()},ia:function(t){throw v(\"Unexpected exception thrown, this is not properly supported - aborting\"),I=!0,t},w:function(){xt(0);var t=J.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&it(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return pt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return pt=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;i>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getUTCSeconds(),A[e+4>>2>>>0]=t.getUTCMinutes(),A[e+8>>2>>>0]=t.getUTCHours(),A[e+12>>2>>>0]=t.getUTCDate(),A[e+16>>2>>>0]=t.getUTCMonth(),A[e+20>>2>>>0]=t.getUTCFullYear()-1900,A[e+24>>2>>>0]=t.getUTCDay(),A[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(E[t>>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getSeconds(),A[e+4>>2>>>0]=t.getMinutes(),A[e+8>>2>>>0]=t.getHours(),A[e+12>>2>>>0]=t.getDate(),A[e+16>>2>>>0]=t.getMonth(),A[e+20>>2>>>0]=t.getFullYear()-1900,A[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);A[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,A[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),A[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(A[t+20>>2>>>0]+1900,A[t+16>>2>>>0],A[t+12>>2>>>0],A[t+8>>2>>>0],A[t+4>>2>>>0],A[t>>2>>>0],0),n=A[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=i.getTimezoneOffset(),s=Math.min(a,o);return 0>n?A[t+32>>2>>>0]=Number(o!=a&&s==r):0>2>>>0]=e.getDay(),A[t+28>>2>>>0]=(e.getTime()-i.getTime())/864e5|0,A[t>>2>>>0]=e.getSeconds(),A[t+4>>2>>>0]=e.getMinutes(),A[t+8>>2>>>0]=e.getHours(),A[t+12>>2>>>0]=e.getDate(),A[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:\"GMT\"}var i=(new Date).getFullYear(),o=new Date(i,0,1),a=new Date(i,6,1);i=o.getTimezoneOffset();var s=a.getTimezoneOffset();A[t>>2>>>0]=60*Math.max(i,s),A[e>>2>>>0]=Number(i!=s),t=r(o),e=r(a),t=ot(t),e=ot(e),s>2>>>0]=t,E[n+4>>2>>>0]=e):(E[n>>2>>>0]=e,E[n+4>>2>>>0]=t)}(e,n,r))},B:function(){W(\"\")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){O.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=O.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var i=Math;r=Math.max(t,r),i=i.min.call(i,4294901760,r+(65536-r%65536)%65536);t:{try{x.grow(i-T.byteLength+65535>>>16),F();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},va:function(t,e){var n=0;return st().forEach((function(r,i){var o=e+n;for(i=E[t+4*i>>2>>>0]=o,o=0;o>0>>>0]=r.charCodeAt(o);S[i>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=st();E[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),E[e>>2>>>0]=r,0},ba:function(t){w||0>2>>>0],s=E[e+4>>2>>>0];e+=8;for(var u=0;u>>0]);i+=s}return E[r>>2>>>0]=i,0},c:function(){return pt},ja:function t(e,r){t.Mb||(t.Mb=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error(\"Cannot find module 'crypto'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>W(\"randomDevice\")}());for(var i=0;i>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},fa:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},J:function(t){var e=Tt();try{return it(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},e:function(t,e){var n=Tt();try{return it(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},N:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},O:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},j:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},o:function(t,e,n,r){var i=Tt();try{return it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},p:function(t,e,n,r,i){var o=Tt();try{return it(t)(e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},M:function(t,e,n,r,i,o){var a=Tt();try{return it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},r:function(t,e,n,r,i,o){var a=Tt();try{return it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},v:function(t,e,n,r,i,o,a){var s=Tt();try{return it(t)(e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},K:function(t,e,n,r,i,o,a,s){var u=Tt();try{return it(t)(e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},D:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Tt();try{return it(t)(e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},X:function(t,e,n,r,i,o,a,s){var u=Tt();try{return Lt(t,e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},V:function(t,e,n,r,i,o,a){var s=Tt();try{return Pt(t,e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},U:function(t,e,n,r,i){var o=Tt();try{return Rt(t,e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},Z:function(t,e,n,r){var i=Tt();try{return Ft(t,e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},W:function(t){var e=Tt();try{return It(t)}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},Y:function(t,e){var n=Tt();try{return Nt(t,e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},T:function(t,e,n){var r=Tt();try{return Dt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},f:function(t){var e=Tt();try{it(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},q:function(t,e){var n=Tt();try{it(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},h:function(t,e,n){var r=Tt();try{it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},da:function(t,e,n,r){var i=Tt();try{it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},l:function(t,e,n,r){var i=Tt();try{it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},t:function(t,e,n,r,i){var o=Tt();try{it(t)(e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},u:function(t,e,n,r,i,o){var a=Tt();try{it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},x:function(t,e,n,r,i,o,a){var s=Tt();try{it(t)(e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},z:function(t,e,n,r,i,o,a,s){var u=Tt();try{it(t)(e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},ga:function(t,e,n,r,i,o,a,s,u){var c=Tt();try{it(t)(e,n,r,i,o,a,s,u)}catch(t){if(St(c),t!==t+0)throw t;xt(1,0)}},A:function(t,e,n,r,i,o,a,s,u,c,l){var p=Tt();try{it(t)(e,n,r,i,o,a,s,u,c,l)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},C:function(t,e,n,r,i,o,a,s,u,c,l,p,f,d,h,g){var b=Tt();try{it(t)(e,n,r,i,o,a,s,u,c,l,p,f,d,h,g)}catch(t){if(St(b),t!==t+0)throw t;xt(1,0)}},aa:function(t,e,n,r,i,o,a,s){var u=Tt();try{$t(t,e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},_:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Tt();try{Ct(t,e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},$:function(t,e,n,r,i,o){var a=Tt();try{kt(t,e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},n:function(t){return t},F:function(t){pt=t},ha:gt,y:function(t,e,n,r){return gt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,x=e.asm.Ka,F(),N=e.asm.ib,R.unshift(e.asm.La),z--,e.monitorRunDependencies&&e.monitorRunDependencies(z),0==z&&(null!==G&&(clearInterval(G),G=null),H&&(t=H,H=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!y&&(h||g)){if(\"function\"==typeof fetch&&!B.startsWith(\"file://\"))return fetch(B,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at '\"+B+\"'\";return t.arrayBuffer()})).catch((function(){return Y()}));if(a)return new Promise((function(t,e){a(B,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Y()}))}().then((function(t){return WebAssembly.instantiate(t,o)})).then((function(t){return t})).then(t,(function(t){v(\"failed to asynchronously prepare wasm: \"+t),W(t)}))}var o={a:bt};if(z++,e.monitorRunDependencies&&e.monitorRunDependencies(z),e.instantiateWasm)try{return e.instantiateWasm(o,t)}catch(t){return v(\"Module.instantiateWasm callback failed with error: \"+t),!1}(y||\"function\"!=typeof WebAssembly.instantiateStreaming||q()||B.startsWith(\"file://\")||b||\"function\"!=typeof fetch?r(n):fetch(B,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,o).then(n,(function(t){return v(\"wasm streaming compile failed: \"+t),v(\"falling back to ArrayBuffer instantiation\"),r(n)}))}))).catch(i)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,yt=e._malloc=function(){return(yt=e._malloc=e.asm.eb).apply(null,arguments)},_t=e._free=function(){return(_t=e._free=e.asm.fb).apply(null,arguments)},vt=e._fflush=function(){return(vt=e._fflush=e.asm.gb).apply(null,arguments)},wt=e.___funcs_on_exit=function(){return(wt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},xt=e._setThrew=function(){return(xt=e._setThrew=e.asm.jb).apply(null,arguments)},Tt=e.stackSave=function(){return(Tt=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Ot=e.stackAlloc=function(){return(Ot=e.stackAlloc=e.asm.mb).apply(null,arguments)},At=e.___cxa_can_catch=function(){return(At=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Et=e.___cxa_is_pointer_type=function(){return(Et=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},It=e.dynCall_j=function(){return(It=e.dynCall_j=e.asm.pb).apply(null,arguments)},Pt=e.dynCall_iiiiij=function(){return(Pt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Dt=e.dynCall_jii=function(){return(Dt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},$t=e.dynCall_viiiiij=function(){return($t=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Ct=e.dynCall_viiijjjii=function(){return(Ct=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Ft=e.dynCall_iij=function(){return(Ft=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Nt=e.dynCall_ji=function(){return(Nt=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Lt=e.dynCall_iiiiiij=function(){return(Lt=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},Rt=e.dynCall_iiij=function(){return(Rt=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function jt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!I)){if(Z(R),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for(\"function\"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();M.unshift(t)}Z(M)}}if(!(0{\"use strict\";t.exports=function(t,e){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i{\"use strict\";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&\"=\"===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t,e,n){for(var i,o=null,a=[],s=0,u=0;e>2],i=(3&c)<<4,u=1;break;case 1:a[s++]=r[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[s++]=r[i|c>>6],a[s++]=r[63&c],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join(\"\")):String.fromCharCode.apply(String,a.slice(0,s))};var a=\"invalid encoding\";n.decode=function(t,e,n){for(var r,o=n,s=0,u=0;u1)break;if(void 0===(c=i[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:e[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:e[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:e[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-o},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},9211:t=>{\"use strict\";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r{\"use strict\";function e(t){return\"undefined\"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(t,r,i){e[0]=t,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function s(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?i:o,t.writeFloatBE=r?o:i,t.readFloatLE=r?a:s,t.readFloatBE=r?s:a}():function(){function e(t,e,n,r){var i=e<0?1:0;if(i&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((i<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((i<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((i<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,n,r)}}function a(t,e,n){var r=t(e,n),i=2*(r>>31)+1,o=r>>>23&255,a=8388607&r;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=a.bind(null,i),t.readFloatBE=a.bind(null,o)}(),\"undefined\"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(t,r,i){e[0]=t,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function s(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?i:o,t.writeDoubleBE=r?o:i,t.readDoubleLE=r?a:s,t.readDoubleBE=r?s:a}():function(){function e(t,e,n,r,i,o){var a=r<0?1:0;if(a&&(r=-r),0===r)t(0,i,o+e),t(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))t(0,i,o+e),t(2146959360,i,o+n);else if(r>17976931348623157e292)t(0,i,o+e),t((a<<31|2146435072)>>>0,i,o+n);else{var s;if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,i,o+e),t((a<<31|s/4294967296)>>>0,i,o+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(s=r*Math.pow(2,-u))>>>0,i,o+e),t((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+n)}}}function a(t,e,n,r,i){var o=t(r,i+e),a=t(r,i+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=a.bind(null,i,0,4),t.readDoubleBE=a.bind(null,o,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},7199:module=>{\"use strict\";function inquire(moduleName){try{var mod=eval(\"quire\".replace(/^/,\"re\"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:t=>{\"use strict\";t.exports=function(t,e,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){if(n<1||n>i)return t(n);a+n>r&&(o=t(r),a=0);var s=e.call(o,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4997:(t,e)=>{\"use strict\";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r191&&r<224?o[a++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join(\"\")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(t,e,n){for(var r,i,o=n,a=0;a>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=t.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-o}},3442:(t,e)=>{\"use strict\";e.__esModule=!0;var n=function(){function t(e){if(!e)throw new TypeError(\"Invalid argument; `value` has no value.\");this.value=t.EMPTY,e&&t.isGuid(e)&&(this.value=e)}return t.isGuid=function(e){var n=e.toString();return e&&(e instanceof t||t.validator.test(n))},t.create=function(){return new t([t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join(\"-\"))},t.createEmpty=function(){return new t(\"emptyguid\")},t.parse=function(e){return new t(e)},t.raw=function(){return[t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join(\"-\")},t.gen=function(t){for(var e=\"\",n=0;n{t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,\"__isLong__\",{value:!0}),n.isLong=r;var i={},o={};function a(t,e){var n,r,a;return e?(a=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(o[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=i[t])?r:(n=u(t,t<0?-1:0,!1),a&&(i[t]=n),n)}function s(t,e){if(isNaN(t))return e?m:b;if(e){if(t<0)return m;if(t>=d)return x}else{if(t<=-h)return T;if(t+1>=h)return w}return t<0?s(-t,e).neg():u(t%f|0,t/f|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t,e,n){if(0===t.length)throw Error(\"empty string\");if(\"NaN\"===t||\"Infinity\"===t||\"+Infinity\"===t||\"-Infinity\"===t)return b;if(\"number\"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error(\"interior hyphen\");if(0===r)return l(t.substring(1),e,n).neg();for(var i=s(c(n,8)),o=b,a=0;a>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((o=u).isZero())return l+a;for(;l.length<6;)l=\"0\"+l;a=\"\"+l+a}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(t){return r(t)||(t=p(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(r(t)||(t=p(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(y)},S.neg=S.negate,S.add=function(t){r(t)||(t=p(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,l=0,f=0,d=0,h=0;return d+=(h+=o+(65535&t.low))>>>16,f+=(d+=i+c)>>>16,l+=(f+=n+s)>>>16,l+=e+a,u((d&=65535)<<16|(h&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},S.subtract=function(t){return r(t)||(t=p(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return b;if(r(t)||(t=p(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return b;if(this.eq(T))return t.isOdd()?T:b;if(t.eq(T))return this.isOdd()?T:b;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,a=65535&this.low,c=t.high>>>16,l=65535&t.high,f=t.low>>>16,d=65535&t.low,h=0,m=0,y=0,_=0;return y+=(_+=a*d)>>>16,m+=(y+=o*d)>>>16,y&=65535,m+=(y+=a*f)>>>16,h+=(m+=i*d)>>>16,m&=65535,h+=(m+=o*f)>>>16,m&=65535,h+=(m+=a*l)>>>16,h+=n*d+i*f+o*l+a*c,u((y&=65535)<<16|(_&=65535),(h&=65535)<<16|(m&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(r(t)||(t=p(t)),t.isZero())throw Error(\"division by zero\");var n,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:b;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return _;o=m}else{if(this.eq(T))return t.eq(y)||t.eq(v)?T:t.eq(T)?y:(n=this.shr(1).div(t).shl(1)).eq(b)?t.isNegative()?y:v:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(T))return this.unsigned?m:b;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=b}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:c(2,a-48),f=s(n),d=f.mul(t);d.isNegative()||d.gt(i);)d=(f=s(n-=l,this.unsigned)).mul(t);f.isZero()&&(f=y),o=o.add(f),i=i.sub(d)}return o},S.div=S.divide,S.modulo=function(t){return r(t)||(t=p(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t){return r(t)||(t=p(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return r(t)||(t=p(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return r(t)||(t=p(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},1446:(t,e,n)=>{\"use strict\";var r,i,o,a=n(2100),s=a.Reader,u=a.Writer,c=a.util,l=a.roots.default||(a.roots.default={});l.onnx=((o={}).Version=(r={},(i=Object.create(r))[r[0]=\"_START_VERSION\"]=0,i[r[1]=\"IR_VERSION_2017_10_10\"]=1,i[r[2]=\"IR_VERSION_2017_10_30\"]=2,i[r[3]=\"IR_VERSION_2017_11_3\"]=3,i[r[4]=\"IR_VERSION_2019_1_22\"]=4,i[r[5]=\"IR_VERSION\"]=5,i),o.AttributeProto=function(){function t(t){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.name=t.string();break;case 21:r.refAttrName=t.string();break;case 13:r.docString=t.string();break;case 20:r.type=t.int32();break;case 2:r.f=t.float();break;case 3:r.i=t.int64();break;case 4:r.s=t.bytes();break;case 5:r.t=l.onnx.TensorProto.decode(t,t.uint32());break;case 6:r.g=l.onnx.GraphProto.decode(t,t.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.i.high>>>0).toNumber())),null!=t.s&&(\"string\"==typeof t.s?c.base64.decode(t.s,e.s=c.newBuffer(c.base64.length(t.s)),0):t.s.length&&(e.s=t.s)),null!=t.t){if(\"object\"!=typeof t.t)throw TypeError(\".onnx.AttributeProto.t: object expected\");e.t=l.onnx.TensorProto.fromObject(t.t)}if(null!=t.g){if(\"object\"!=typeof t.g)throw TypeError(\".onnx.AttributeProto.g: object expected\");e.g=l.onnx.GraphProto.fromObject(t.g)}if(t.floats){if(!Array.isArray(t.floats))throw TypeError(\".onnx.AttributeProto.floats: array expected\");e.floats=[];for(var n=0;n>>0,t.ints[n].high>>>0).toNumber())}if(t.strings){if(!Array.isArray(t.strings))throw TypeError(\".onnx.AttributeProto.strings: array expected\");for(e.strings=[],n=0;n>>0,t.i.high>>>0).toNumber():t.i),null!=t.s&&t.hasOwnProperty(\"s\")&&(n.s=e.bytes===String?c.base64.encode(t.s,0,t.s.length):e.bytes===Array?Array.prototype.slice.call(t.s):t.s),null!=t.t&&t.hasOwnProperty(\"t\")&&(n.t=l.onnx.TensorProto.toObject(t.t,e)),null!=t.g&&t.hasOwnProperty(\"g\")&&(n.g=l.onnx.GraphProto.toObject(t.g,e)),t.floats&&t.floats.length){n.floats=[];for(var i=0;i>>0,t.ints[i].high>>>0).toNumber():t.ints[i];if(t.strings&&t.strings.length)for(n.strings=[],i=0;i>>3){case 1:r.name=t.string();break;case 2:r.type=l.onnx.TypeProto.decode(t,t.uint32());break;case 3:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.name&&t.hasOwnProperty(\"name\")&&!c.isString(t.name))return\"name: string expected\";if(null!=t.type&&t.hasOwnProperty(\"type\")){var e=l.onnx.TypeProto.verify(t.type);if(e)return\"type.\"+e}return null!=t.docString&&t.hasOwnProperty(\"docString\")&&!c.isString(t.docString)?\"docString: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.ValueInfoProto)return t;var e=new l.onnx.ValueInfoProto;if(null!=t.name&&(e.name=String(t.name)),null!=t.type){if(\"object\"!=typeof t.type)throw TypeError(\".onnx.ValueInfoProto.type: object expected\");e.type=l.onnx.TypeProto.fromObject(t.type)}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name=\"\",n.type=null,n.docString=\"\"),null!=t.name&&t.hasOwnProperty(\"name\")&&(n.name=t.name),null!=t.type&&t.hasOwnProperty(\"type\")&&(n.type=l.onnx.TypeProto.toObject(t.type,e)),null!=t.docString&&t.hasOwnProperty(\"docString\")&&(n.docString=t.docString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o.NodeProto=function(){function t(t){if(this.input=[],this.output=[],this.attribute=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(t.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(t.string());break;case 3:r.name=t.string();break;case 4:r.opType=t.string();break;case 7:r.domain=t.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(l.onnx.AttributeProto.decode(t,t.uint32()));break;case 6:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.input&&t.hasOwnProperty(\"input\")){if(!Array.isArray(t.input))return\"input: array expected\";for(var e=0;e>>3){case 1:r.irVersion=t.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t,t.uint32()));break;case 2:r.producerName=t.string();break;case 3:r.producerVersion=t.string();break;case 4:r.domain=t.string();break;case 5:r.modelVersion=t.int64();break;case 6:r.docString=t.string();break;case 7:r.graph=l.onnx.GraphProto.decode(t,t.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.irVersion&&t.hasOwnProperty(\"irVersion\")&&!(c.isInteger(t.irVersion)||t.irVersion&&c.isInteger(t.irVersion.low)&&c.isInteger(t.irVersion.high)))return\"irVersion: integer|Long expected\";if(null!=t.opsetImport&&t.hasOwnProperty(\"opsetImport\")){if(!Array.isArray(t.opsetImport))return\"opsetImport: array expected\";for(var e=0;e>>0,t.irVersion.high>>>0).toNumber())),t.opsetImport){if(!Array.isArray(t.opsetImport))throw TypeError(\".onnx.ModelProto.opsetImport: array expected\");e.opsetImport=[];for(var n=0;n>>0,t.modelVersion.high>>>0).toNumber())),null!=t.docString&&(e.docString=String(t.docString)),null!=t.graph){if(\"object\"!=typeof t.graph)throw TypeError(\".onnx.ModelProto.graph: object expected\");e.graph=l.onnx.GraphProto.fromObject(t.graph)}if(t.metadataProps){if(!Array.isArray(t.metadataProps))throw TypeError(\".onnx.ModelProto.metadataProps: array expected\");for(e.metadataProps=[],n=0;n>>0,t.irVersion.high>>>0).toNumber():t.irVersion),null!=t.producerName&&t.hasOwnProperty(\"producerName\")&&(n.producerName=t.producerName),null!=t.producerVersion&&t.hasOwnProperty(\"producerVersion\")&&(n.producerVersion=t.producerVersion),null!=t.domain&&t.hasOwnProperty(\"domain\")&&(n.domain=t.domain),null!=t.modelVersion&&t.hasOwnProperty(\"modelVersion\")&&(\"number\"==typeof t.modelVersion?n.modelVersion=e.longs===String?String(t.modelVersion):t.modelVersion:n.modelVersion=e.longs===String?c.Long.prototype.toString.call(t.modelVersion):e.longs===Number?new c.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber():t.modelVersion),null!=t.docString&&t.hasOwnProperty(\"docString\")&&(n.docString=t.docString),null!=t.graph&&t.hasOwnProperty(\"graph\")&&(n.graph=l.onnx.GraphProto.toObject(t.graph,e)),t.opsetImport&&t.opsetImport.length){n.opsetImport=[];for(var i=0;i>>3){case 1:r.key=t.string();break;case 2:r.value=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return\"object\"!=typeof t||null===t?\"object expected\":null!=t.key&&t.hasOwnProperty(\"key\")&&!c.isString(t.key)?\"key: string expected\":null!=t.value&&t.hasOwnProperty(\"value\")&&!c.isString(t.value)?\"value: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.StringStringEntryProto)return t;var e=new l.onnx.StringStringEntryProto;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key=\"\",n.value=\"\"),null!=t.key&&t.hasOwnProperty(\"key\")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty(\"value\")&&(n.value=t.value),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o.TensorAnnotation=function(){function t(t){if(this.quantParameterTensorNames=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorName=t.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.tensorName&&t.hasOwnProperty(\"tensorName\")&&!c.isString(t.tensorName))return\"tensorName: string expected\";if(null!=t.quantParameterTensorNames&&t.hasOwnProperty(\"quantParameterTensorNames\")){if(!Array.isArray(t.quantParameterTensorNames))return\"quantParameterTensorNames: array expected\";for(var e=0;e>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(l.onnx.NodeProto.decode(t,t.uint32()));break;case 2:r.name=t.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(l.onnx.TensorProto.decode(t,t.uint32()));break;case 10:r.docString=t.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.node&&t.hasOwnProperty(\"node\")){if(!Array.isArray(t.node))return\"node: array expected\";for(var e=0;e>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.dims[n].high>>>0).toNumber())}if(null!=t.dataType&&(e.dataType=0|t.dataType),null!=t.segment){if(\"object\"!=typeof t.segment)throw TypeError(\".onnx.TensorProto.segment: object expected\");e.segment=l.onnx.TensorProto.Segment.fromObject(t.segment)}if(t.floatData){if(!Array.isArray(t.floatData))throw TypeError(\".onnx.TensorProto.floatData: array expected\");for(e.floatData=[],n=0;n>>0,t.int64Data[n].high>>>0).toNumber())}if(null!=t.name&&(e.name=String(t.name)),null!=t.docString&&(e.docString=String(t.docString)),null!=t.rawData&&(\"string\"==typeof t.rawData?c.base64.decode(t.rawData,e.rawData=c.newBuffer(c.base64.length(t.rawData)),0):t.rawData.length&&(e.rawData=t.rawData)),t.externalData){if(!Array.isArray(t.externalData))throw TypeError(\".onnx.TensorProto.externalData: array expected\");for(e.externalData=[],n=0;n>>0,t.uint64Data[n].high>>>0).toNumber(!0))}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),e.defaults&&(n.dataType=0,n.segment=null,n.name=\"\",e.bytes===String?n.rawData=\"\":(n.rawData=[],e.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString=\"\",n.dataLocation=e.enums===String?\"DEFAULT\":0),t.dims&&t.dims.length){n.dims=[];for(var r=0;r>>0,t.dims[r].high>>>0).toNumber():t.dims[r]}if(null!=t.dataType&&t.hasOwnProperty(\"dataType\")&&(n.dataType=t.dataType),null!=t.segment&&t.hasOwnProperty(\"segment\")&&(n.segment=l.onnx.TensorProto.Segment.toObject(t.segment,e)),t.floatData&&t.floatData.length)for(n.floatData=[],r=0;r>>0,t.int64Data[r].high>>>0).toNumber():t.int64Data[r];if(null!=t.name&&t.hasOwnProperty(\"name\")&&(n.name=t.name),null!=t.rawData&&t.hasOwnProperty(\"rawData\")&&(n.rawData=e.bytes===String?c.base64.encode(t.rawData,0,t.rawData.length):e.bytes===Array?Array.prototype.slice.call(t.rawData):t.rawData),t.doubleData&&t.doubleData.length)for(n.doubleData=[],r=0;r>>0,t.uint64Data[r].high>>>0).toNumber(!0):t.uint64Data[r];if(null!=t.docString&&t.hasOwnProperty(\"docString\")&&(n.docString=t.docString),t.externalData&&t.externalData.length)for(n.externalData=[],r=0;r>>3){case 1:r.begin=t.int64();break;case 2:r.end=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return\"object\"!=typeof t||null===t?\"object expected\":null!=t.begin&&t.hasOwnProperty(\"begin\")&&!(c.isInteger(t.begin)||t.begin&&c.isInteger(t.begin.low)&&c.isInteger(t.begin.high))?\"begin: integer|Long expected\":null!=t.end&&t.hasOwnProperty(\"end\")&&!(c.isInteger(t.end)||t.end&&c.isInteger(t.end.low)&&c.isInteger(t.end.high))?\"end: integer|Long expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorProto.Segment)return t;var e=new l.onnx.TensorProto.Segment;return null!=t.begin&&(c.Long?(e.begin=c.Long.fromValue(t.begin)).unsigned=!1:\"string\"==typeof t.begin?e.begin=parseInt(t.begin,10):\"number\"==typeof t.begin?e.begin=t.begin:\"object\"==typeof t.begin&&(e.begin=new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber())),null!=t.end&&(c.Long?(e.end=c.Long.fromValue(t.end)).unsigned=!1:\"string\"==typeof t.end?e.end=parseInt(t.end,10):\"number\"==typeof t.end?e.end=t.end:\"object\"==typeof t.end&&(e.end=new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.begin=e.longs===String?\"0\":0;c.Long?(r=new c.Long(0,0,!1),n.end=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.end=e.longs===String?\"0\":0}return null!=t.begin&&t.hasOwnProperty(\"begin\")&&(\"number\"==typeof t.begin?n.begin=e.longs===String?String(t.begin):t.begin:n.begin=e.longs===String?c.Long.prototype.toString.call(t.begin):e.longs===Number?new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber():t.begin),null!=t.end&&t.hasOwnProperty(\"end\")&&(\"number\"==typeof t.end?n.end=e.longs===String?String(t.end):t.end:n.end=e.longs===String?c.Long.prototype.toString.call(t.end):e.longs===Number?new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber():t.end),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t.DataLocation=function(){var t={},e=Object.create(t);return e[t[0]=\"DEFAULT\"]=0,e[t[1]=\"EXTERNAL\"]=1,e}(),t}(),o.TensorShapeProto=function(){function t(t){if(this.dim=[],t)for(var e=Object.keys(t),n=0;n>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t,t.uint32()))):t.skipType(7&i)}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.dim&&t.hasOwnProperty(\"dim\")){if(!Array.isArray(t.dim))return\"dim: array expected\";for(var e=0;e>>3){case 1:r.dimValue=t.int64();break;case 2:r.dimParam=t.string();break;case 3:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";var e={};if(null!=t.dimValue&&t.hasOwnProperty(\"dimValue\")&&(e.value=1,!(c.isInteger(t.dimValue)||t.dimValue&&c.isInteger(t.dimValue.low)&&c.isInteger(t.dimValue.high))))return\"dimValue: integer|Long expected\";if(null!=t.dimParam&&t.hasOwnProperty(\"dimParam\")){if(1===e.value)return\"value: multiple values\";if(e.value=1,!c.isString(t.dimParam))return\"dimParam: string expected\"}return null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&!c.isString(t.denotation)?\"denotation: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorShapeProto.Dimension)return t;var e=new l.onnx.TensorShapeProto.Dimension;return null!=t.dimValue&&(c.Long?(e.dimValue=c.Long.fromValue(t.dimValue)).unsigned=!1:\"string\"==typeof t.dimValue?e.dimValue=parseInt(t.dimValue,10):\"number\"==typeof t.dimValue?e.dimValue=t.dimValue:\"object\"==typeof t.dimValue&&(e.dimValue=new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber())),null!=t.dimParam&&(e.dimParam=String(t.dimParam)),null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=\"\"),null!=t.dimValue&&t.hasOwnProperty(\"dimValue\")&&(\"number\"==typeof t.dimValue?n.dimValue=e.longs===String?String(t.dimValue):t.dimValue:n.dimValue=e.longs===String?c.Long.prototype.toString.call(t.dimValue):e.longs===Number?new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber():t.dimValue,e.oneofs&&(n.value=\"dimValue\")),null!=t.dimParam&&t.hasOwnProperty(\"dimParam\")&&(n.dimParam=t.dimParam,e.oneofs&&(n.value=\"dimParam\")),null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),o.TypeProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorType=l.onnx.TypeProto.Tensor.decode(t,t.uint32());break;case 6:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.tensorType&&t.hasOwnProperty(\"tensorType\")){var e=l.onnx.TypeProto.Tensor.verify(t.tensorType);if(e)return\"tensorType.\"+e}return null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&!c.isString(t.denotation)?\"denotation: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto)return t;var e=new l.onnx.TypeProto;if(null!=t.tensorType){if(\"object\"!=typeof t.tensorType)throw TypeError(\".onnx.TypeProto.tensorType: object expected\");e.tensorType=l.onnx.TypeProto.Tensor.fromObject(t.tensorType)}return null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=\"\"),null!=t.tensorType&&t.hasOwnProperty(\"tensorType\")&&(n.tensorType=l.onnx.TypeProto.Tensor.toObject(t.tensorType,e),e.oneofs&&(n.value=\"tensorType\")),null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.Tensor=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.elemType=t.int32();break;case 2:r.shape=l.onnx.TensorShapeProto.decode(t,t.uint32());break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.elemType&&t.hasOwnProperty(\"elemType\")&&!c.isInteger(t.elemType))return\"elemType: integer expected\";if(null!=t.shape&&t.hasOwnProperty(\"shape\")){var e=l.onnx.TensorShapeProto.verify(t.shape);if(e)return\"shape.\"+e}return null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto.Tensor)return t;var e=new l.onnx.TypeProto.Tensor;if(null!=t.elemType&&(e.elemType=0|t.elemType),null!=t.shape){if(\"object\"!=typeof t.shape)throw TypeError(\".onnx.TypeProto.Tensor.shape: object expected\");e.shape=l.onnx.TensorShapeProto.fromObject(t.shape)}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.elemType=0,n.shape=null),null!=t.elemType&&t.hasOwnProperty(\"elemType\")&&(n.elemType=t.elemType),null!=t.shape&&t.hasOwnProperty(\"shape\")&&(n.shape=l.onnx.TensorShapeProto.toObject(t.shape,e)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),o.OperatorSetIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.domain=t.string();break;case 2:r.version=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return\"object\"!=typeof t||null===t?\"object expected\":null!=t.domain&&t.hasOwnProperty(\"domain\")&&!c.isString(t.domain)?\"domain: string expected\":null!=t.version&&t.hasOwnProperty(\"version\")&&!(c.isInteger(t.version)||t.version&&c.isInteger(t.version.low)&&c.isInteger(t.version.high))?\"version: integer|Long expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.OperatorSetIdProto)return t;var e=new l.onnx.OperatorSetIdProto;return null!=t.domain&&(e.domain=String(t.domain)),null!=t.version&&(c.Long?(e.version=c.Long.fromValue(t.version)).unsigned=!1:\"string\"==typeof t.version?e.version=parseInt(t.version,10):\"number\"==typeof t.version?e.version=t.version:\"object\"==typeof t.version&&(e.version=new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults)if(n.domain=\"\",c.Long){var r=new c.Long(0,0,!1);n.version=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.version=e.longs===String?\"0\":0;return null!=t.domain&&t.hasOwnProperty(\"domain\")&&(n.domain=t.domain),null!=t.version&&t.hasOwnProperty(\"version\")&&(\"number\"==typeof t.version?n.version=e.longs===String?String(t.version):t.version:n.version=e.longs===String?c.Long.prototype.toString.call(t.version):e.longs===Number?new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber():t.version),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o),t.exports=l},2100:(t,e,n)=>{\"use strict\";t.exports=n(9482)},9482:(t,e,n)=>{\"use strict\";var r=e;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build=\"minimal\",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=i,i()},1408:(t,e,n)=>{\"use strict\";t.exports=u;var r,i=n(9693),o=i.LongBits,a=i.utf8;function s(t,e){return RangeError(\"index out of range: \"+t.pos+\" + \"+(e||1)+\" > \"+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var c,l=\"undefined\"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error(\"illegal buffer\")}:function(t){if(Array.isArray(t))return new u(t);throw Error(\"illegal buffer\")},p=function(){return i.Buffer?function(t){return(u.create=function(t){return i.Buffer.isBuffer(t)?new r(t):l(t)})(t)}:l};function f(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error(\"invalid varint encoding\")}function d(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)},u.prototype.string=function(){var t=this.bytes();return a.read(t,0,t.length)},u.prototype.skip=function(t){if(\"number\"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+t+\" at offset \"+this.pos)}return this},u._configure=function(t){r=t,u.create=p(),r._configure();var e=i.Long?\"toLong\":\"toNumber\";i.merge(u.prototype,{int64:function(){return f.call(this)[e](!1)},uint64:function(){return f.call(this)[e](!0)},sint64:function(){return f.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},593:(t,e,n)=>{\"use strict\";t.exports=o;var r=n(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(t){r.call(this,t)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString(\"utf-8\",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},5054:t=>{\"use strict\";t.exports={}},5994:(t,e,n)=>{\"use strict\";e.Service=n(7948)},7948:(t,e,n)=>{\"use strict\";t.exports=i;var r=n(9693);function i(t,e,n){if(\"function\"!=typeof t)throw TypeError(\"rpcImpl must be a function\");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function t(e,n,i,o,a){if(!o)throw TypeError(\"request must be specified\");var s=this;if(!a)return r.asPromise(t,s,e,n,i,o);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?\"encodeDelimited\":\"encode\"](o).finish(),(function(t,n){if(t)return s.emit(\"error\",t,e),a(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?\"decodeDelimited\":\"decode\"](n)}catch(t){return s.emit(\"error\",t,e),a(t)}return s.emit(\"data\",n,e),a(null,n)}s.end(!0)}))}catch(t){return s.emit(\"error\",t,e),void setTimeout((function(){a(t)}),0)}else setTimeout((function(){a(Error(\"already ended\"))}),0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(\"end\").off()),this}},1945:(t,e,n)=>{\"use strict\";t.exports=i;var r=n(9693);function i(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash=\"\\0\\0\\0\\0\\0\\0\\0\\0\";i.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(t){if(\"number\"==typeof t)return i.fromNumber(t);if(r.isString(t)){if(!r.Long)return i.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new i(t.low>>>0,t.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;i.fromHash=function(t){return t===a?o:new i((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},9693:function(t,e,n){\"use strict\";var r=e;function i(t,e,n){for(var r=Object.keys(e),i=0;i0)},r.Buffer=function(){try{var t=r.inquire(\"buffer\").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return\"number\"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):\"undefined\"==typeof Uint8Array?t:new Uint8Array(t)},r.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire(\"long\"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=i,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o(\"ProtocolError\"),r.oneOfGetter=function(t){for(var e={},n=0;n-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n{\"use strict\";t.exports=p;var r,i=n(9693),o=i.LongBits,a=i.base64,s=i.utf8;function u(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function c(){}function l(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function p(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function d(t,e,n){e[n]=255&t}function h(t,e){this.len=t,this.next=void 0,this.val=e}function g(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function b(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}p.create=f(),p.alloc=function(t){return new i.Array(t)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(t,e,n){return this.tail=this.tail.next=new u(t,e,n),this.len+=e,this},h.prototype=Object.create(u.prototype),h.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},p.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new h((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},p.prototype.int32=function(t){return t<0?this._push(g,10,o.fromNumber(t)):this.uint32(t)},p.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},p.prototype.uint64=function(t){var e=o.from(t);return this._push(g,e.length(),e)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(g,e.length(),e)},p.prototype.bool=function(t){return this._push(d,1,t?1:0)},p.prototype.fixed32=function(t){return this._push(b,4,t>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(t){var e=o.from(t);return this._push(b,4,e.lo)._push(b,4,e.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(t){return this._push(i.float.writeFloatLE,4,t)},p.prototype.double=function(t){return this._push(i.float.writeDoubleLE,8,t)};var m=i.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r>>0;if(!e)return this._push(d,1,0);if(i.isString(t)){var n=p.alloc(e=a.length(t));a.decode(t,n,0),t=n}return this.uint32(e)._push(m,e,t)},p.prototype.string=function(t){var e=s.length(t);return e?this.uint32(e)._push(s.write,e,t):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},p.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},p._configure=function(t){r=t,p.create=f(),r._configure()}},3155:(t,e,n)=>{\"use strict\";t.exports=o;var r=n(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(){r.call(this)}function a(t,e,n){t.length<40?i.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&\"set\"===i.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=i.Buffer.byteLength(t);return this.uint32(e),e&&this._push(a,e,t),this},o._configure()},7714:(t,e,n)=>{\"use strict\";e.R=void 0;const r=n(6919),i=n(7448);e.R=new class{async init(){}async createSessionHandler(t,e){const n=new r.Session(e);return await n.loadModel(t),new i.OnnxjsSessionHandler(n)}}},4200:(t,e,n)=>{\"use strict\";e.c8=e.rX=void 0;const r=n(1670),i=n(5381),o=n(2157),a=n(2306);e.rX=()=>{if((\"number\"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),\"boolean\"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),\"boolean\"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),\"number\"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const t=\"undefined\"==typeof navigator?(0,i.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,o.initWasm)()}async createSessionHandler(t,e){const n=new a.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(t,e),Promise.resolve(n)}}},6018:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)\"default\"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(n(1670),e);const o=n(1670);{const t=n(7714).R;(0,o.registerBackend)(\"webgl\",t,-10)}{const t=n(4200).c8;(0,o.registerBackend)(\"cpu\",t,10),(0,o.registerBackend)(\"wasm\",t,10),(0,o.registerBackend)(\"xnnpack\",t,9)}},246:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createAttributeWithCacheKey=void 0;class n{constructor(t){Object.assign(this,t)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((t=>`${this[t]}`)).join(\";\")),this._cacheKey}}e.createAttributeWithCacheKey=t=>new n(t)},7778:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Attribute=void 0;const r=n(1446),i=n(9395),o=n(9162),a=n(2517);var s=i.onnxruntime.experimental.fbs;class u{constructor(t){if(this._attributes=new Map,null!=t){for(const e of t)e instanceof r.onnx.AttributeProto?this._attributes.set(e.name,[u.getValue(e),u.getType(e)]):e instanceof s.Attribute&&this._attributes.set(e.name(),[u.getValue(e),u.getType(e)]);if(this._attributes.sizeo.Tensor.fromProto(t)));if(t instanceof s.Attribute)return n.map((t=>o.Tensor.fromOrtTensor(t)))}if(e===r.onnx.AttributeProto.AttributeType.STRING&&t instanceof r.onnx.AttributeProto){const t=n;return(0,a.decodeUtf8String)(t)}return e===r.onnx.AttributeProto.AttributeType.STRINGS&&t instanceof r.onnx.AttributeProto?n.map(a.decodeUtf8String):n}static getValueNoCheck(t){return t instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(t):this.getValueNoCheckFromOrtFormat(t)}static getValueNoCheckFromOnnxFormat(t){switch(t.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return t.f;case r.onnx.AttributeProto.AttributeType.INT:return t.i;case r.onnx.AttributeProto.AttributeType.STRING:return t.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return t.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return t.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return t.floats;case r.onnx.AttributeProto.AttributeType.INTS:return t.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return t.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return t.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return t.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t.type]}`)}}static getValueNoCheckFromOrtFormat(t){switch(t.type()){case s.AttributeType.FLOAT:return t.f();case s.AttributeType.INT:return t.i();case s.AttributeType.STRING:return t.s();case s.AttributeType.TENSOR:return t.t();case s.AttributeType.GRAPH:return t.g();case s.AttributeType.FLOATS:return t.floatsArray();case s.AttributeType.INTS:{const e=[];for(let n=0;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.resolveBackend=e.backend=void 0;const r=n(5038),i=new Map;async function o(t){const n=e.backend;if(void 0!==n[t]&&function(t){const e=t;return\"initialize\"in e&&\"function\"==typeof e.initialize&&\"createSessionHandler\"in e&&\"function\"==typeof e.createSessionHandler&&\"dispose\"in e&&\"function\"==typeof e.dispose}(n[t])){const e=n[t];let r=e.initialize();if(\"object\"==typeof r&&\"then\"in r&&(r=await r),r)return i.set(t,e),e}}e.backend={webgl:new r.WebGLBackend},e.resolveBackend=async function t(e){if(!e)return t([\"webgl\"]);{const t=\"string\"==typeof e?[e]:e;for(const e of t){const t=i.get(e);if(t)return t;const n=await o(e);if(n)return n}}throw new Error(\"no available backend to use\")}},5038:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLBackend=void 0;const r=n(1670),i=n(6231),o=n(6416),a=n(7305);e.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(t){r.env.webgl.contextId=t}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(t){r.env.webgl.matmulMaxBatchSize=t}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(t){r.env.webgl.textureCacheMode=t}get pack(){return r.env.webgl.pack}set pack(t){r.env.webgl.pack=t}get async(){return r.env.webgl.async}set async(t){r.env.webgl.async=t}initialize(){try{return this.glContext=(0,a.createWebGLContext)(this.contextId),\"number\"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),\"string\"!=typeof this.textureCacheMode&&(this.textureCacheMode=\"full\"),\"boolean\"!=typeof this.pack&&(this.pack=!1),\"boolean\"!=typeof this.async&&(this.async=!1),i.Logger.setWithEnv(r.env),i.Logger.verbose(\"WebGLBackend\",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(t){return i.Logger.warning(\"WebGLBackend\",`Unable to initialize WebGLBackend. ${t}`),!1}}createSessionHandler(t){return new o.WebGLSessionHandler(this,t)}dispose(){this.glContext.dispose()}}},5107:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.CoordsGlslLib=void 0;const r=n(2517),i=n(8520),o=n(5060),a=n(7859),s=n(9390);class u extends i.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new i.GlslLibRoutine(\"\\n vec2 offsetToCoords(int offset, int width, int height) {\\n int t = offset / width;\\n int s = offset - t*width;\\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\\n return coords;\\n }\\n \")}}coordsToOffset(){return{coordsToOffset:new i.GlslLibRoutine(\"\\n int coordsToOffset(vec2 coords, int width, int height) {\\n float s = coords.s * float(width);\\n float t = coords.t * float(height);\\n int offset = int(t) * width + int(s);\\n return offset;\\n }\\n \")}}getOutputSamplingSnippet(){const t=this.context.outputTextureLayout;return t.isPacked?this.getPackedOutputSamplingSnippet(t):this.getUnpackedOutputSamplingSnippet(t)}getPackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},a=\"getOutputCoords\";switch(e.length){case 0:r[a]=this.getOutputScalarCoords();break;case 1:r[a]=this.getOutputPacked1DCoords(e,n);break;case 2:r[a]=this.getOutputPacked2DCoords(e,n);break;case 3:r[a]=this.getOutputPacked3DCoords(e,n);break;default:r[a]=this.getOutputPackedNDCoords(e,n)}const s=`\\n void setOutput(vec4 val) {\\n ${(0,o.getGlsl)(this.context.glContext.version).output} = val;\\n }\\n `;return r.floatTextureSetRGBA=new i.GlslLibRoutine(s),r}getUnpackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},a=\"getOutputCoords\";switch(e.length){case 0:r[a]=this.getOutputScalarCoords();break;case 1:r[a]=this.getOutputUnpacked1DCoords(e,n);break;case 2:r[a]=this.getOutputUnpacked2DCoords(e,n);break;case 3:r[a]=this.getOutputUnpacked3DCoords(e,n);break;case 4:r[a]=this.getOutputUnpacked4DCoords(e,n);break;case 5:r[a]=this.getOutputUnpacked5DCoords(e,n);break;case 6:r[a]=this.getOutputUnpacked6DCoords(e,n);break;default:throw new Error(`Unsupported output dimensionality: ${e.length}`)}const s=`\\n void setOutput(float val) {\\n ${(0,o.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\\n }\\n `;return r.floatTextureSetR=new i.GlslLibRoutine(s),r}getOutputScalarCoords(){return new i.GlslLibRoutine(\"\\n int getOutputCoords() {\\n return 0;\\n }\\n \")}getOutputPacked1DCoords(t,e){const n=e;let r=\"\";return 1===n[0]?(r=`\\n int getOutputCoords() {\\n return 2 * int(TexCoords.y * ${n[1]}.0);\\n }\\n `,new i.GlslLibRoutine(r)):1===n[1]?(r=`\\n int getOutputCoords() {\\n return 2 * int(TexCoords.x * ${n[0]}.0);\\n }\\n `,new i.GlslLibRoutine(r)):(r=`\\n int getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${n[0]}, ${n[1]}));\\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\\n }\\n `,new i.GlslLibRoutine(r))}getOutputPacked2DCoords(t,e){let n=\"\";if(r.ArrayUtil.arraysEqual(t,e))return n=`\\n ivec2 getOutputCoords() {\\n return 2 * ivec2(TexCoords.xy * vec2(${e[0]}, ${e[1]}));\\n }\\n `,new i.GlslLibRoutine(n);const o=e,a=Math.ceil(t[1]/2);return n=`\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${o[0]}, ${o[1]}));\\n\\n int index = resTexRC.y * ${o[0]} + resTexRC.x;\\n\\n // reverse r and c order for packed texture\\n int r = imod(index, ${a}) * 2;\\n int c = 2 * (index / ${a});\\n\\n return ivec2(r, c);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputPacked3DCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[2]/2),o=r*Math.ceil(t[1]/2),a=`\\n ivec3 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${n[0]}, ${n[1]}));\\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\\n\\n int b = index / ${o};\\n index -= b * ${o};\\n\\n // reverse r and c order for packed texture\\n int r = imod(index, ${r}) * 2;\\n int c = 2 * (index / ${r});\\n\\n return ivec3(b, r, c);\\n }\\n `;return new i.GlslLibRoutine(a)}getOutputPackedNDCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[t.length-1]/2),o=r*Math.ceil(t[t.length-2]/2);let a=o,s=\"\",u=\"b, r, c\";for(let e=2;e=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec3 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec3(r, c, d);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputUnpacked4DCoords(t,e){let n=\"\";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\",\"d2\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec4 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec4(r, c, d, d2);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputUnpacked5DCoords(t,e){let n=\"\";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\",\"d2\",\"d3\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec5 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec5(r, c, d, d2, d3);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputUnpacked6DCoords(t,e){let n=\"\";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\",\"d2\",\"d3\",\"d4\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec6 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec6(r, c, d, d2, d3, d4);\\n }\\n `,new i.GlslLibRoutine(n)}getCommonUtilFuncs(){const t={};let e=\"uvFromFlat\";t[e]=new i.GlslLibRoutine(\"\\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\\n int texC = index / texNumR;\\n int texR = index - texC * texNumR;\\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\\n // v.\\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\\n }\\n \"),e=\"packedUVfrom1D\",t[e]=new i.GlslLibRoutine(\"\\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\\n int texelIndex = index / 2;\\n int texR = texelIndex / texNumC;\\n int texC = texelIndex - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n }\\n \"),e=\"packedUVfrom2D\",t[e]=new i.GlslLibRoutine(\"\\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\\n int texR = texelIndex / texNumC;\\n int texC = texelIndex - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n }\\n \"),e=\"packedUVfrom3D\",t[e]=new i.GlslLibRoutine(\"\\n vec2 packedUVfrom3D(int texNumR, int texNumC,\\n int texelsInBatch, int texelsInLogicalRow, int b,\\n int row, int col) {\\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n }\\n \"),e=\"sampleTexture\";const n=(0,o.getGlsl)(this.context.glContext.version);return t[e]=new i.GlslLibRoutine(`\\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\\n return ${n.texture2D}(textureSampler, uv).r;\\n }`),t}getInputsSamplingSnippets(){const t={},e=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach(((n,r)=>{const i=this.context.inputTextureLayouts[r],o=(0,s.generateShaderFuncNameFromInputSamplerName)(n);i.isPacked?t[o]=this.getPackedSamplerFromInput(o,n,i):t[o]=this.getUnpackedSamplerFromInput(o,n,i);const a=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);i.unpackedShape.length<=e.unpackedShape.length&&(i.isPacked?t[a]=this.getPackedSamplerAtOutputCoords(a,i,e,n):t[a]=this.getUnpackedSamplerAtOutputCoords(a,i,e,n))})),t}getPackedSamplerAtOutputCoords(t,e,n,o){const a=e.unpackedShape,u=n.unpackedShape,c=o,l=(0,s.generateShaderFuncNameFromInputSamplerName)(c),p=a.length,f=u.length,d=r.BroadcastUtil.getBroadcastDims(a,u),h=(0,s.getCoordsDataType)(f),g=f-p;let b;const m=(0,s.getGlChannels)();b=0===p?\"\":f<2&&d.length>=1?\"coords = 0;\":d.map((t=>`coords.${m[t+g]} = 0;`)).join(\"\\n\");let y=\"\";y=f<2&&p>0?\"coords\":a.map(((t,e)=>`coords.${m[e+g]}`)).join(\", \");let _=\"return outputValue;\";const v=1===r.ShapeUtil.size(a),w=1===r.ShapeUtil.size(u);if(1!==p||v||w){if(v&&!w)_=1===f?\"\\n return vec4(outputValue.x, outputValue.x, 0., 0.);\\n \":\"\\n return vec4(outputValue.x);\\n \";else if(d.length){const t=p-2,e=p-1;d.indexOf(t)>-1&&d.indexOf(e)>-1?_=\"return vec4(outputValue.x);\":d.indexOf(t)>-1?_=\"return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);\":d.indexOf(e)>-1&&(_=\"return vec4(outputValue.xx, outputValue.zz);\")}}else _=\"\\n return vec4(outputValue.xy, outputValue.xy);\\n \";const x=`\\n vec4 ${t}() {\\n ${h} coords = getOutputCoords();\\n \\n int lastDim = coords.${m[f-1]};\\n coords.${m[f-1]} = coords.${m[f-2]};\\n coords.${m[f-2]} = lastDim;\\n \\n ${b}\\n vec4 outputValue = ${l}(${y});\\n ${_}\\n }\\n `;return new i.GlslLibRoutine(x,[\"coordinates.getOutputCoords\"])}getUnpackedSamplerAtOutputCoords(t,e,n,o){const a=[n.width,n.height],u=[e.width,e.height],c=e.unpackedShape.length,l=n.unpackedShape.length,p=e.unpackedShape,f=n.unpackedShape,d=(0,s.generateShaderFuncNameFromInputSamplerName)(o);if(c===l&&r.ArrayUtil.arraysEqual(u,a)){const e=`\\n float ${t}() {\\n return sampleTexture(${o}, TexCoords);\\n }\\n `;return new i.GlslLibRoutine(e,[\"coordinates.sampleTexture\"])}const h=(0,s.getCoordsDataType)(l),g=r.BroadcastUtil.getBroadcastDims(p,f),b=l-c;let m;const y=(0,s.getGlChannels)();m=0===c?\"\":l<2&&g.length>=1?\"coords = 0;\":g.map((t=>`coords.${y[t+b]} = 0;`)).join(\"\\n\");let _=\"\";_=l<2&&c>0?\"coords\":e.unpackedShape.map(((t,e)=>`coords.${y[e+b]}`)).join(\", \");const v=`\\n float ${t}() {\\n ${h} coords = getOutputCoords();\\n ${m}\\n return ${d}(${_});\\n }\\n `;return new i.GlslLibRoutine(v,[\"coordinates.getOutputCoords\"])}getPackedSamplerFromInput(t,e,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t,e);case 1:return this.getPackedSampler1D(t,e,n);case 2:return this.getPackedSampler2D(t,e,n);case 3:return this.getPackedSampler3D(t,e,n);default:return this.getPackedSamplerND(t,e,n)}}getUnpackedSamplerFromInput(t,e,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(t,e,n);case 1:return this.getUnpackedSampler1D(t,e,n);case 2:return this.getUnpackedSampler2D(t,e,n);case 3:return this.getUnpackedSampler3D(t,e,n);case 4:return this.getUnpackedSampler4D(t,e,n);case 5:return this.getUnpackedSampler5D(t,e,n);case 6:return this.getUnpackedSampler6D(t,e,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(t,e){const n=`\\n vec4 ${t}() {\\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e}, halfCR);\\n }\\n `;return new i.GlslLibRoutine(n)}getPackedSampler1D(t,e,n){const r=[n.width,n.height],a=[r[1],r[0]],s=(0,o.getGlsl)(this.context.glContext.version),u=`vec4 ${t}(int index) {\\n vec2 uv = packedUVfrom1D(\\n ${a[0]}, ${a[1]}, index);\\n return ${s.texture2D}(${e}, uv);\\n }`;return new i.GlslLibRoutine(u,[\"coordinates.packedUVfrom1D\"])}getPackedSampler2D(t,e,n){const a=n.unpackedShape,s=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=s[0],l=s[1];if(null!=s&&r.ArrayUtil.arraysEqual(a,s)){const n=`vec4 ${t}(int row, int col) {\\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${c}.0);\\n return ${u.texture2D}(${e}, uv);\\n }`;return new i.GlslLibRoutine(n)}const p=s,f=Math.ceil(a[1]/2),d=`vec4 ${t}(int row, int col) {\\n vec2 uv = packedUVfrom2D(${p[1]}, ${p[0]}, ${f}, row, col);\\n return ${u.texture2D}(${e}, uv);\\n }`;return new i.GlslLibRoutine(d,[\"coordinates.packedUVfrom2D\"])}getPackedSampler3D(t,e,n){const r=n.unpackedShape,a=[n.width,n.height],u=[a[0],a[1]],c=(0,o.getGlsl)(this.context.glContext.version);if(1===r[0]){const o=r.slice(1),a=[1,2],u=(0,s.squeezeInputShape)(r,o),c=[\"b\",\"row\",\"col\"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=u;const p=this.getPackedSamplerFromInput(t,e,l),f=`${p.routineBody}\\n vec4 ${t}(int b, int row, int col) {\\n return ${t}(${(0,s.getSqueezedParams)(c,a)});\\n } `;return new i.GlslLibRoutine(f,p.dependencies)}const l=u[0],p=u[1],f=Math.ceil(r[2]/2),d=`vec4 ${t}(int b, int row, int col) {\\n vec2 uv = packedUVfrom3D(\\n ${p}, ${l}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\\n return ${c.texture2D}(${e}, uv);}`;return new i.GlslLibRoutine(d,[\"coordinates.packedUVfrom3D\"])}getPackedSamplerND(t,e,n){const r=n.unpackedShape,a=r.length,s=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=[s[0],s[1]],l=c[1],p=c[0],f=Math.ceil(r[a-1]/2);let d=f*Math.ceil(r[a-2]/2),h=\"int b, int row, int col\",g=`b * ${d} + (row / 2) * ${f} + (col / 2)`;for(let t=2;t{const r=this.context.inputTextureLayouts[n],o=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let a=`_${e}`;t[a]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!1),[`shapeUtils.indicesToOffset${a}`,\"coordinates.offsetToCoords\",\"fragcolor.getColorAsFloat\"]),a+=\"_T\",t[a]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!0),[`shapeUtils.indicesToOffset${a}`,\"coordinates.offsetToCoords\",\"fragcolor.getColorAsFloat\"])})),t}getValueFromSingle(t,e,n,r,i){let a=`_${t}`;return i&&(a+=\"_T\"),`\\n float ${a}(int m[${e}]) {\\n int offset = indicesToOffset${a}(m);\\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\\n float value = getColorAsFloat(${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords));\\n return value;\\n }\\n `}getPackedValueFrom(t,e,n,r,i){let a=`_${t}_Pack`;return i&&(a+=\"_T\"),`\\n vec4 ${a}(int m[${e}]) {\\n int offset = indicesToOffset_${t}(m);\\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords);\\n }\\n `}}e.CoordsGlslLib=u},8520:(t,e)=>{\"use strict\";var n;Object.defineProperty(e,\"__esModule\",{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||(e.FunctionType={}))[n.ValueBased=0]=\"ValueBased\",n[n.Positional=1]=\"Positional\",e.GlslContext=class{constructor(t,e,n,r){this.glContext=t,this.programInfo=e,this.inputTextureLayouts=n,this.outputTextureLayout=r}},e.GlslLib=class{constructor(t){this.context=t}},e.GlslLibRoutine=class{constructor(t,e){this.routineBody=t,this.dependencies=e}},e.GlslLibRoutineNode=class{constructor(t,e,n){this.name=t,this.dependencies=n||[],e&&(this.routineBody=e)}addDependency(t){t&&this.dependencies.push(t)}},e.TopologicalSortGlslRoutines=class{static returnOrderedNodes(t){if(!t||0===t.length)return[];if(1===t.length)return t;const e=new Set,n=new Set,r=new Array;return this.createOrderedNodes(t,e,n,r),r}static createOrderedNodes(t,e,n,r){for(let i=0;i0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.EncodingGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine(\"highp vec4 encode(highp float f) {\\n return vec4(f, 0.0, 0.0, 0.0);\\n }\\n \")}}decodeFloat32(){return{decode:new r.GlslLibRoutine(\"highp float decode(highp vec4 rgba) {\\n return rgba.r;\\n }\\n \")}}encodeUint8(){const t=i.isLittleEndian()?\"rgba.rgba=rgba.abgr;\":\"\";return{encode:new r.GlslLibRoutine(`\\n highp vec4 encode(highp float f) {\\n highp float F = abs(f);\\n highp float Sign = step(0.0,-f);\\n highp float Exponent = floor(log2(F));\\n highp float Mantissa = (exp2(- Exponent) * F);\\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\\n highp vec4 rgba;\\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\\n ${t}\\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\\n return rgba;\\n }\\n `)}}decodeUint8(){const t=i.isLittleEndian()?\"rgba.rgba=rgba.abgr;\":\"\";return{decode:new r.GlslLibRoutine(`\\n highp float decode(highp vec4 rgba) {\\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\\n ${t}\\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\\n return Result;\\n }\\n `)}}static isLittleEndian(){const t=new ArrayBuffer(4),e=new Uint32Array(t),n=new Uint8Array(t);if(e[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error(\"unknown endianness\")}}e.EncodingGlslLib=i},9894:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.FragColorGlslLib=void 0;const r=n(8520),i=n(5060);class o extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const t=(0,i.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\\n void setFragColor(float value) {\\n ${t.output} = encode(value);\\n }\\n `,[\"encoding.encode\"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine(\"\\n float getColorAsFloat(vec4 color) {\\n return decode(color);\\n }\\n \",[\"encoding.decode\"])}}}e.FragColorGlslLib=o},2848:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.replaceInlines=void 0;const n=/@inline[\\s\\n\\r]+(\\w+)[\\s\\n\\r]+([0-9a-zA-Z_]+)\\s*\\(([^)]*)\\)\\s*{(([^}]|[\\n\\r])*)}/gm;e.replaceInlines=function(t){const e={};let r;for(;null!==(r=n.exec(t));){const t=r[3].split(\",\").map((t=>{const e=t.trim().split(\" \");return e&&2===e.length?{type:e[0],name:e[1]}:null})).filter((t=>null!==t));e[r[2]]={params:t,body:r[4]}}for(const n in e){const i=\"(\\\\w+)?\\\\s+([_0-9a-zA-Z]+)\\\\s+=\\\\s+__FUNC__\\\\((.*)\\\\)\\\\s*;\".replace(\"__FUNC__\",n),o=new RegExp(i,\"gm\");for(;null!==(r=o.exec(t));){const i=r[1],o=r[2],a=r[3].split(\",\"),s=i?`${i} ${o};`:\"\";let u=e[n].body,c=\"\";e[n].params.forEach(((t,e)=>{t&&(c+=`${t.type} ${t.name} = ${a[e]};\\n`)})),u=`${c}\\n ${u}`,u=u.replace(\"return\",`${o} = `);const l=`\\n ${s}\\n {\\n ${u}\\n }\\n `;t=t.replace(r[0],l)}}return t.replace(n,\"\")}},8879:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.GlslPreprocessor=void 0;const r=n(8520),i=n(2848),o=n(5483),a=n(5060);e.GlslPreprocessor=class{constructor(t,e,n,i){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(t,e,n,i),Object.keys(o.glslRegistry).forEach((t=>{const e=new o.glslRegistry[t](this.context);this.libs[t]=e}));const a=this.glslLibRoutineDependencyGraph;for(const t in this.libs){const e=this.libs[t].getFunctions();for(const n in e){const i=t+\".\"+n;let o;a[i]?(o=a[i],o.routineBody=e[n].routineBody):(o=new r.GlslLibRoutineNode(i,e[n].routineBody),a[i]=o);const s=e[n].dependencies;if(s)for(let t=0;t{const r=n.split(\".\")[1];-1!==t.indexOf(r)&&e.push(this.glslLibRoutineDependencyGraph[n])})),r.TopologicalSortGlslRoutines.returnOrderedNodes(e)}getUniforms(t,e){const n=[];if(t)for(const e of t)n.push(`uniform sampler2D ${e};`);if(e)for(const t of e)n.push(`uniform ${t.type} ${t.name}${t.arrayLength?`[${t.arrayLength}]`:\"\"};`);return n.join(\"\\n\")}}},5483:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.glslRegistry=void 0;const r=n(5107),i=n(7341),o=n(9894),a=n(2655),s=n(3891);e.glslRegistry={encoding:i.EncodingGlslLib,fragcolor:o.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:a.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeUtilsGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const t=this.context.outputTextureLayout.shape.length,e={};return this.context.programInfo.inputNames.forEach(((n,i)=>{const o=this.context.inputTextureLayouts[i].unpackedShape;if(o.length<=t){const i=o.length,a=t-i,s=`bcastIndices_${n}`;let u=\"\";for(let t=0;t{const o=this.context.inputTextureLayouts[i].shape;if(!(o.length<2||o.length>t)){const i=o.length,a=t-i,s=`bcastMatmulIndices_${n}`;let u=\"\";for(let t=0;t{const o=this.context.inputTextureLayouts[n].shape,a=this.context.inputTextureLayouts[n].strides,s=o.length;let u=`indicesToOffset_${e}`;t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a)),u=`indicesToOffset_${e}_T`,t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a.slice().reverse()))})),t}static indexToOffsetSingle(t,e,n){let r=\"\";for(let t=e-1;t>=0;--t)r+=`\\n offset += indices[${t}] * ${n[t]};\\n `;return`\\n int ${t}(int indices[${e}]) {\\n int offset = 0;\\n ${r}\\n return offset;\\n }\\n `}offsetToIndices(){const t={};return this.context.programInfo.inputNames.forEach(((e,n)=>{const o=this.context.inputTextureLayouts[n].shape,a=this.context.inputTextureLayouts[n].strides,s=o.length;let u=`offsetToIndices_${e}`;t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a)),u=`offsetToIndices_${e}_T`,t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a.slice().reverse()))})),t}static offsetToIndicesSingle(t,e,n){const r=[];for(let t=0;t{const i=this.context.inputTextureLayouts[n].shape,o=i.length,a=`incrementIndices_${e}`;let s=\"\";for(let t=0;t= 0; --i) {\\n if(i > axis) continue;\\n indices[i] += 1;\\n if(indices[i] < shape[i]) {\\n break;\\n }\\n indices[i] = 0;\\n }\\n }\\n `;t[a]=new r.GlslLibRoutine(u)})),t}}e.ShapeUtilsGlslLib=i},5060:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;const n={version:\"\",attribute:\"attribute\",varyingVertex:\"varying\",varyingFrag:\"varying\",texture2D:\"texture2D\",output:\"gl_FragColor\",outputDeclaration:\"\"},r={version:\"#version 300 es\",attribute:\"in\",varyingVertex:\"out\",varyingFrag:\"in\",texture2D:\"texture\",output:\"outputColor\",outputDeclaration:\"out vec4 outputColor;\"};function i(t){return 1===t?n:r}e.getGlsl=i,e.getVertexShaderSource=function(t){const e=i(t);return`${e.version}\\n precision highp float;\\n ${e.attribute} vec3 position;\\n ${e.attribute} vec2 textureCoord;\\n\\n ${e.varyingVertex} vec2 TexCoords;\\n\\n void main()\\n {\\n gl_Position = vec4(position, 1.0);\\n TexCoords = textureCoord;\\n }`},e.getFragShaderPreamble=function(t){const e=i(t);return`${e.version}\\n precision highp float;\\n precision highp int;\\n precision highp sampler2D;\\n ${e.varyingFrag} vec2 TexCoords;\\n ${e.outputDeclaration}\\n const vec2 halfCR = vec2(0.5, 0.5);\\n\\n // Custom vector types to handle higher dimenalities.\\n struct ivec5\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n };\\n\\n struct ivec6\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n int v;\\n };\\n\\n int imod(int x, int y) {\\n return x - y * (x / y);\\n }\\n\\n `},e.getDefaultFragShaderMain=function(t,e){return`\\n void main() {\\n int indices[${e}];\\n toVec(TexCoords, indices);\\n vec4 result = vec4(process(indices));\\n ${i(t).output} = result;\\n }\\n `}},3891:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.VecGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const t=this.context.outputTextureLayout.shape.length,e={add:\"+=\",sub:\"-=\",mul:\"*=\",div:\"/=\"},n={};for(const i in e){const o=`${i}Vec`;let a=\"\";for(let n=0;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLInferenceHandler=void 0;const r=n(6231),i=n(9162),o=n(2517),a=n(2403),s=n(7019),u=n(8710),c=n(5611),l=n(4057),p=n(2039);e.WebGLInferenceHandler=class{constructor(t){this.session=t,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(t,e){return(0,l.calculateTextureWidthAndHeight)(this.session.layoutStrategy,t,e)}executeProgram(t,e){if(e.length{const n=e.map((t=>`${t.unpackedShape.join(\",\")};${t.width}x${t.height}`)).join(\"_\");let r=t.name;return t.cacheHint&&(r+=\"[\"+t.cacheHint+\"]\"),r+=\":\"+n,r})(t,n);let i=this.session.programManager.getArtifact(r);const o=i?i.programInfo:\"function\"==typeof t.get?t.get():t,a=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o.output.dims,o.output.textureType),s=this.createTextureData(a,o.output.type);return i||(i=this.session.programManager.build(o,n,s),this.session.programManager.setArtifact(r,i)),this.runProgram(i,n,s),s}run(t,e){return this.executeProgram(t,e).tensor}runProgram(t,e,n){for(let n=0;nthis.readTexture(a)),(async t=>this.readTextureAsync(a)),void 0,o),texture:n});return this.setTextureData(a.tensor.dataId,a,t.isPacked),a}getTextureData(t,e=!1){return this.session.isInitializer(t)?this.session.getTextureData(t,e):e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){this.session.isInitializer(t)?this.session.setTextureData(t,e,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(t,e)}isTextureLayoutCached(t,e=!1){return!!this.getTextureData(t.dataId,e)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.unpackedTextureDataCache=new Map}readTexture(t){return t.isPacked?this.readTexture(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}async readTextureAsync(t){return t.isPacked?this.readTextureAsync(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}pack(t){return this.executeProgram((0,a.createPackProgramInfoLoader)(this,t.tensor),[t.tensor])}unpack(t){return this.executeProgram((0,c.createUnpackProgramInfoLoader)(this,t.tensor),[t.tensor])}}},1640:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.WEBGL_OP_RESOLVE_RULES=void 0;const a=n(2898),s=o(n(7839)),u=n(4196),c=n(2069),l=n(8138),p=n(9663),f=n(5193),d=n(7992),h=n(1253),g=n(4776),b=n(6572),m=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),x=n(718),T=n(2268),S=n(8117),O=n(2278),A=n(5524),E=n(5975),I=n(3933),P=n(6558),D=n(5723),$=n(3738),k=o(n(4909)),C=n(8428),F=n(9793);e.WEBGL_OP_RESOLVE_RULES=[[\"Abs\",\"\",\"6+\",k.abs],[\"Acos\",\"\",\"7+\",k.acos],[\"Add\",\"\",\"7+\",s.add],[\"And\",\"\",\"7+\",s.and],[\"Asin\",\"\",\"7+\",k.asin],[\"Atan\",\"\",\"7+\",k.atan],[\"AveragePool\",\"\",\"7+\",v.averagePool,v.parseAveragePoolAttributes],[\"BatchNormalization\",\"\",\"7+\",a.batchNormalization,a.parseBatchNormalizationAttributes],[\"Cast\",\"\",\"6+\",u.cast,u.parseCastAttributes],[\"Ceil\",\"\",\"6+\",k.ceil],[\"Clip\",\"\",\"6-10\",k.clip,k.parseClipAttributes],[\"Clip\",\"\",\"11+\",k.clipV11],[\"Concat\",\"\",\"4+\",c.concat,c.parseConcatAttributes],[\"Conv\",\"\",\"1+\",l.conv,l.parseConvAttributes],[\"ConvTranspose\",\"\",\"1+\",p.convTranspose,p.parseConvTransposeAttributes],[\"Cos\",\"\",\"7+\",k.cos],[\"Div\",\"\",\"7+\",s.div],[\"Dropout\",\"\",\"7+\",k.identity],[\"DepthToSpace\",\"\",\"1+\",f.depthToSpace,f.parseDepthToSpaceAttributes],[\"Equal\",\"\",\"7+\",s.equal],[\"Elu\",\"\",\"6+\",k.elu,k.parseEluAttributes],[\"Exp\",\"\",\"6+\",k.exp],[\"Flatten\",\"\",\"1+\",d.flatten,d.parseFlattenAttributes],[\"Floor\",\"\",\"6+\",k.floor],[\"FusedConv\",\"com.microsoft\",\"1+\",l.conv,l.parseConvAttributes],[\"Gather\",\"\",\"1+\",h.gather,h.parseGatherAttributes],[\"Gemm\",\"\",\"7-10\",g.gemm,g.parseGemmAttributesV7],[\"Gemm\",\"\",\"11+\",g.gemm,g.parseGemmAttributesV11],[\"GlobalAveragePool\",\"\",\"1+\",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],[\"GlobalMaxPool\",\"\",\"1+\",v.globalMaxPool],[\"Greater\",\"\",\"7+\",s.greater],[\"Identity\",\"\",\"1+\",k.identity],[\"ImageScaler\",\"\",\"1+\",b.imageScaler,b.parseImageScalerAttributes],[\"InstanceNormalization\",\"\",\"6+\",m.instanceNormalization,m.parseInstanceNormalizationAttributes],[\"LeakyRelu\",\"\",\"6+\",k.leakyRelu,k.parseLeakyReluAttributes],[\"Less\",\"\",\"7+\",s.less],[\"Log\",\"\",\"6+\",k.log],[\"MatMul\",\"\",\"1+\",y.matMul,y.parseMatMulAttributes],[\"MaxPool\",\"\",\"1+\",v.maxPool,v.parseMaxPoolAttributes],[\"Mul\",\"\",\"7+\",s.mul],[\"Neg\",\"\",\"6+\",k.neg],[\"Not\",\"\",\"1+\",k.not],[\"Or\",\"\",\"7+\",s.or],[\"Pad\",\"\",\"2-10\",_.padV2,_.parsePadAttributesV2],[\"Pad\",\"\",\"11+\",_.padV11,_.parsePadAttributesV11],[\"Pow\",\"\",\"7+\",s.pow],[\"PRelu\",\"\",\"7+\",s.pRelu],[\"ReduceLogSum\",\"\",\"1+\",w.reduceLogSum,w.parseReduceAttributes],[\"ReduceMax\",\"\",\"1+\",w.reduceMax,w.parseReduceAttributes],[\"ReduceMean\",\"\",\"1+\",w.reduceMean,w.parseReduceAttributes],[\"ReduceMin\",\"\",\"1+\",w.reduceMin,w.parseReduceAttributes],[\"ReduceProd\",\"\",\"1+\",w.reduceProd,w.parseReduceAttributes],[\"ReduceSum\",\"\",\"1-12\",w.reduceSum,w.parseReduceAttributes],[\"ReduceSumSquare\",\"\",\"1+\",w.reduceLogSumSquare,w.parseReduceAttributes],[\"Relu\",\"\",\"6+\",k.relu],[\"Reshape\",\"\",\"5+\",x.reshape],[\"Resize\",\"\",\"10\",T.resize,T.parseResizeAttributesV10],[\"Resize\",\"\",\"11+\",T.resize,T.parseResizeAttributesV11],[\"Shape\",\"\",\"1+\",S.shape],[\"Sigmoid\",\"\",\"6+\",k.sigmoid],[\"Sin\",\"\",\"7+\",k.sin],[\"Slice\",\"\",\"10+\",O.sliceV10],[\"Slice\",\"\",\"1-9\",O.slice,O.parseSliceAttributes],[\"Softmax\",\"\",\"1-12\",A.softmax,A.parseSoftmaxAttributes],[\"Softmax\",\"\",\"13+\",A.softmaxV13,A.parseSoftmaxAttributesV13],[\"Split\",\"\",\"2-12\",E.split,E.parseSplitAttributes],[\"Sqrt\",\"\",\"6+\",k.sqrt],[\"Squeeze\",\"\",\"1-12\",I.squeeze,I.parseSqueezeAttributes],[\"Squeeze\",\"\",\"13+\",I.squeezeV13],[\"Sub\",\"\",\"7+\",s.sub],[\"Sum\",\"\",\"6+\",P.sum],[\"Tan\",\"\",\"7+\",k.tan],[\"Tanh\",\"\",\"6+\",k.tanh],[\"Tile\",\"\",\"6+\",D.tile],[\"Transpose\",\"\",\"1+\",$.transpose,$.parseTransposeAttributes],[\"Upsample\",\"\",\"7-8\",F.upsample,F.parseUpsampleAttributesV7],[\"Upsample\",\"\",\"9\",F.upsample,F.parseUpsampleAttributesV9],[\"Unsqueeze\",\"\",\"1-12\",C.unsqueeze,C.parseUnsqueezeAttributes],[\"Unsqueeze\",\"\",\"13+\",C.unsqueezeV13],[\"Xor\",\"\",\"7+\",s.xor]]},2898:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;const r=n(246),i=n(5060),o=n(2039),a={name:\"BatchNormalization\",inputNames:[\"A\",\"Scale\",\"B\",\"Mean\",\"Variance\"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};e.batchNormalization=(t,e,n)=>(u(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>s(t,e,n)}),e)]),e.parseBatchNormalizationAttributes=t=>{const e=t.attributes.getFloat(\"epsilon\",1e-5),n=t.attributes.getFloat(\"momentum\",.9),i=t.attributes.getInt(\"spatial\",1);return(0,r.createAttributeWithCacheKey)({epsilon:e,momentum:n,spatial:i})};const s=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),s=e[0].dims.length,[u,c]=t.calculateTextureWidthAndHeight(e[1].dims,o.TextureType.unpacked),l=`\\n float process(int[${s}] indices) {\\n vec2 position = offsetToCoords(indices[1], ${u}, ${c});\\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\\n float b = getColorAsFloat(${r.texture2D}(B, position));\\n\\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\\n }`;return Object.assign(Object.assign({},a),{output:{dims:e[0].dims,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},u=t=>{if(!t||5!==t.length)throw new Error(\"BatchNormalization requires 5 inputs.\");const e=t[0],n=t[1],r=t[2],i=t[3],o=t[4];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==i.dims.length||1!==o.dims.length)throw new Error(\"invalid input shape.\");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1]||i.dims[0]!==e.dims[1]||o.dims[0]!==e.dims[1])throw new Error(\"invalid input shape.\");if(\"float32\"!==e.type&&\"float64\"!==e.type||\"float32\"!==n.type&&\"float64\"!==n.type||\"float32\"!==r.type&&\"float64\"!==r.type||\"float32\"!==i.type&&\"float64\"!==i.type||\"float32\"!==o.type&&\"float64\"!==o.type)throw new Error(\"invalid input tensor types.\")}},7839:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;const r=n(2517),i=n(8520),o=n(5060),a=n(2039);function s(){const t=\"add_\";return{body:`\\n float ${t}(float a, float b) {\\n return a + b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 + v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function u(){const t=\"div_\";return{body:`\\n float ${t}(float a, float b) {\\n return a / b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 / v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function c(){const t=\"mul_\";return{body:`\\n float ${t}(float a, float b) {\\n return a * b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 * v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function l(){const t=\"sub_\";return{body:`\\n float ${t}(float a, float b) {\\n return a - b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 - v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function p(){const t=\"equal_\";return{body:`\\n float ${t}(float a, float b) {\\n return float(a == b);\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4(equal(v1, v2));\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function f(){const t=\"greater_\";return{body:`\\n float ${t}(float a, float b) {\\n return float(a > b);\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4( v1.r > v2.r ,\\n v1.g > v2.g,\\n v1.b > v2.b,\\n v1.a > v2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function d(){const t=\"less_\";return{body:`\\n float ${t}(float a, float b) {\\n return float(a < b);\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4( v1.r < v2.r ,\\n v1.g < v2.g,\\n v1.b < v2.b,\\n v1.a < v2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function h(){const t=\"and_\";return{body:`\\n float ${t}(float a, float b) {\\n return float( bool(a) && bool(b) );\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n bvec4 b1 = bvec4(v1);\\n bvec4 b2 = bvec4(v2);\\n return vec4( b1.r && b2.r ,\\n b1.g && b2.g,\\n b1.b && b2.b,\\n b1.a && b2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function g(){const t=\"or_\";return{body:`\\n float ${t}(float a, float b) {\\n return float( bool(a) || bool(b) );\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n bvec4 b1 = bvec4(v1);\\n bvec4 b2 = bvec4(v2);\\n return vec4( b1.r || b2.r ,\\n b1.g || b2.g,\\n b1.b || b2.b,\\n b1.a || b2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function b(){const t=\"xor_\";return{body:`\\n float ${t}(float a, float b) {\\n return float( bool(a) ^^ bool(b) );\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n bvec4 b1 = bvec4(v1);\\n bvec4 b2 = bvec4(v2);\\n return vec4( b1.r ^^ b2.r ,\\n b1.g ^^ b2.g,\\n b1.b ^^ b2.b,\\n b1.a ^^ b2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function m(){return function(t){const e=`${t}_`;return{body:`\\n float ${e}(float a, float b) {\\n return ${t}(a, b);\\n }\\n vec4 ${e}(vec4 v1, vec4 v2) {\\n return ${t}(v1, v2);\\n }\\n `,name:e,type:i.FunctionType.ValueBased}}(\"pow\")}function y(){const t=\"prelu_\";return{body:`\\n float ${t}(float a, float b) {\\n return a < 0.0 ? a * b: a;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4(\\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\\n v1.a < 0.0 ? v1.a * v2.a: v1.a\\n );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}e.glslAdd=s,e.glslDiv=u,e.glslMul=c,e.glslSub=l,e.glslEqual=p,e.glslGreater=f,e.glslLess=d,e.glslAnd=h,e.glslOr=g,e.glslXor=b,e.glslPow=m,e.glslPRelu=y;const _=(t,e,n,r=e[0].type,i)=>{const o=t.session.pack?a.TextureType.packed:a.TextureType.unpacked;return{name:n.name,inputNames:[\"A\",\"B\"],inputTypes:[o,o],cacheHint:i,get:()=>v(t,e,n,r)}},v=(t,e,n,i=e[0].type)=>{const s=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,u=!r.ShapeUtil.areEqual(e[0].dims,e[1].dims);let c=e[0].dims;const l=t.session.pack;if(u){const a=r.BroadcastUtil.calcShape(e[0].dims,e[1].dims,!1);if(!a)throw new Error(\"Can't perform binary op on the given tensors\");c=a;const u=c.length,p=0!==e[0].dims.length?e[0].dims.length:1,f=0!==e[1].dims.length?e[1].dims.length:1,d=0!==e[0].dims.length?\"bcastIndices_A(indices, aindices);\":\"aindices[0] = 0;\",h=0!==e[1].dims.length?\"bcastIndices_B(indices, bindices);\":\"bindices[0] = 0;\",g=(0,o.getGlsl)(t.session.backend.glContext.version),b=l?`\\n ${n.body}\\n void main() {\\n vec4 a = getAAtOutCoords();\\n vec4 b = getBAtOutCoords();\\n vec4 result = ${n.name}(a, b);\\n ${g.output} = result;\\n }`:`\\n ${n.body}\\n float process(int indices[${u}]) {\\n int aindices[${p}];\\n int bindices[${f}];\\n ${d}\\n ${h}\\n return ${n.name}(_A(aindices), _B(bindices));\\n }`;return{name:n.name,inputNames:[\"A\",\"B\"],inputTypes:[s,s],output:{dims:c,type:i,textureType:s},shaderSource:b,hasMain:l}}const p=(0,o.getGlsl)(t.session.backend.glContext.version),f=`\\n ${n.body}\\n void main() {\\n vec4 v1 = ${p.texture2D}(A, TexCoords);\\n vec4 v2 = ${p.texture2D}(B, TexCoords);\\n vec4 result = ${n.name}(v1, v2);\\n ${p.output} = result;\\n }\\n `;return{name:n.name,inputNames:[\"A\",\"B\"],inputTypes:[s,s],output:{dims:e[0].dims,type:i,textureType:s},shaderSource:f,hasMain:!0}};e.add=(t,e)=>[t.run(_(t,e,s()),e)],e.and=(t,e)=>[t.run(_(t,e,h(),\"bool\"),e)],e.div=(t,e)=>[t.run(_(t,e,u()),e)],e.equal=(t,e)=>[t.run(_(t,e,p(),\"bool\"),e)],e.greater=(t,e)=>[t.run(_(t,e,f(),\"bool\"),e)],e.less=(t,e)=>[t.run(_(t,e,d(),\"bool\"),e)],e.mul=(t,e)=>[t.run(_(t,e,c()),e)],e.or=(t,e)=>[t.run(_(t,e,g(),\"bool\"),e)],e.pow=(t,e)=>[t.run(_(t,e,m()),e)],e.pRelu=(t,e)=>[t.run(_(t,e,y()),e)],e.sub=(t,e)=>[t.run(_(t,e,l()),e)],e.xor=(t,e)=>[t.run(_(t,e,b(),\"bool\"),e)]},4196:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseCastAttributes=e.cast=void 0;const r=n(2517);e.cast=(t,e,n)=>(i(e),[t.cast(e[0],n)]),e.parseCastAttributes=t=>r.ProtoUtil.tensorDataTypeFromProto(t.attributes.getInt(\"to\"));const i=t=>{if(!t||1!==t.length)throw new Error(\"Cast requires 1 input.\");if(\"string\"===t[0].type)throw new Error(\"Invalid input type.\")}},1163:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827);e.createPackedConcatProgramInfoLoader=(t,e,n)=>{const u=(c=e.length,l=n.cacheKey,{name:\"Concat (packed)\",inputNames:Array.from({length:c},((t,e)=>`X${e}`)),inputTypes:Array(c).fill(i.TextureType.packed),cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const c=n[0].dims.slice();if(u>=c.length||u<-1*c.length)throw new Error(\"axis specified for concat doesn't match input dimensionality\");u<0&&(u=c.length+u);const l=c.slice(0);for(let t=1;tt.dims)),b=(0,o.getGlChannels)(p),m=new Array(g.length-1);m[0]=g[0][u];for(let t=1;t= ${m[t-1]}) {\\n return getChannel(\\n getX${t}(${s(b,y,e)}),\\n vec2(${s(_,y,e)}));\\n }`}const x=m.length,T=m[m.length-1];w+=`\\n return getChannel(\\n getX${x}(${s(b,y,T)}),\\n vec2(${s(_,y,T)}));`;const S=(0,r.getGlsl)(t.session.backend.glContext.version),O=`\\n ${h}\\n float getValue(${b.map((t=>\"int \"+t))}) {\\n ${w}\\n }\\n\\n void main() {\\n ${d} coords = getOutputCoords();\\n int lastDim = coords.${b[p-1]};\\n coords.${b[p-1]} = coords.${b[p-2]};\\n coords.${b[p-2]} = lastDim;\\n\\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\\n\\n ${f[p-1]} = ${f[p-1]} + 1;\\n if (${f[p-1]} < ${l[p-1]}) {\\n result.g = getValue(${f});\\n }\\n\\n ${f[p-2]} = ${f[p-2]} + 1;\\n if (${f[p-2]} < ${l[p-2]}) {\\n result.a = getValue(${f});\\n }\\n\\n ${f[p-1]} = ${f[p-1]} - 1;\\n if (${f[p-2]} < ${l[p-2]} &&\\n ${f[p-1]} < ${l[p-1]}) {\\n result.b = getValue(${f});\\n }\\n ${S.output} = result;\\n }\\n `;return Object.assign(Object.assign({},e),{output:{dims:l,type:n[0].type,textureType:i.TextureType.packed},shaderSource:O,hasMain:!0})})(t,u,e,n.axis)})};const s=(t,e,n)=>{const r=t.indexOf(e);return t.map(((t,e)=>e===r?`${t} - ${n}`:t)).join()}},2069:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseConcatAttributes=e.concat=void 0;const r=n(246),i=n(2039),o=n(1163);e.concat=(t,e,n)=>(p(e),t.session.pack&&e[0].dims.length>1?[t.run((0,o.createPackedConcatProgramInfoLoader)(t,e,n),e)]:[t.run(a(t,e,n),e)]);const a=(t,e,n)=>{const r=(o=e.length,a=n.cacheKey,{name:\"Concat\",inputNames:Array.from({length:o},((t,e)=>`X${e}`)),inputTypes:Array(o).fill(i.TextureType.unpacked),cacheHint:a});var o,a;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice();if(r>=o.length||r<-1*o.length)throw new Error(\"axis specified for concat doesn't match input dimensionality\");r<0&&(r=o.length+r);const a=o.slice(0);for(let t=1;t`int getTextureWhereDataResides(int index) {\\n ${t.map(((t,e)=>`if(index<${t}) {return ${e};}\\n`)).join(\"\")}\\n }`,u=t=>s(t),c=(t,e)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${e}]) {`];for(let e=0;e{const e=[\"int getSizeInConcatAxisValueFromIndex(int index) {\"];for(let n=0;n(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\")});const p=t=>{if(!t||t.length<1)throw new Error(\"too few inputs\");const e=t[0].type,n=t[0].dims.length;if(\"string\"===e)throw new Error(\"string tensor is not supported yet\");for(const r of t){if(r.type!==e)throw new Error(\"input tensors should be one type\");if(r.dims.length!==n)throw new Error(\"input tensors should have the same shape\")}}},4770:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),i=n(5060),o=n(2039),a=n(8138),s=n(2823);e.createUnpackedGroupedConvProgramInfoLoader=(t,e,n)=>{const u=(c=e.length>2,l=n.cacheKey,{name:\"GroupedConv\",inputNames:c?[\"X\",\"W\",\"Bias\"]:[\"X\",\"W\"],inputTypes:c?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const c=e.length>2?\"value += getBias(output_channel);\":\"\",l=e[0].dims.slice(),p=e[1].dims.slice(),f=p[0]/u.group;r.Logger.verbose(\"GroupedConv\",`autpPad:${u.autoPad}, dilations:${u.dilations}, group:${u.group}, kernelShape:${u.kernelShape}, pads:${u.pads}, strides:${u.strides}`);const d=(0,a.calculateOutputShape)(l,p,u.dilations,u.pads,u.strides),h=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:g,applyActivation:b}=(0,s.getActivationSnippet)(u),m=`\\n const ivec2 strides = ivec2(${u.strides[0]}, ${u.strides[1]});\\n const ivec2 pads = ivec2(${u.pads[0]}, ${u.pads[1]});\\n ${g}\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords.x;\\n int output_channel = coords.y;\\n ivec2 xRCCorner = coords.zw * strides - pads;\\n int group_id = output_channel / ${f};\\n\\n float value = 0.0;\\n for (int wInChannel = 0; wInChannel < ${p[1]}; wInChannel++) {\\n int input_channel = group_id * ${p[1]} + wInChannel;\\n for (int wHeight = 0; wHeight < ${p[2]}; wHeight++) {\\n int xHeight = xRCCorner.x + wHeight * ${u.dilations[0]};\\n\\n if (xHeight < 0 || xHeight >= ${l[2]}) {\\n continue;\\n }\\n\\n for (int wWidth = 0; wWidth < ${p[3]}; wWidth++) {\\n int xWidth = xRCCorner.y + wWidth * ${u.dilations[1]};\\n if (xWidth < 0 || xWidth >= ${l[3]}) {\\n continue;\\n }\\n\\n float xVal = getX(batch, input_channel, xWidth, xHeight);\\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\\n value += xVal*wVal;\\n }\\n }\\n }\\n ${c}\\n ${b}\\n ${h.output} = vec4(value, .0, .0, .0);\\n }\\n`;return Object.assign(Object.assign({},n),{output:{dims:d,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,hasMain:!0})})(t,e,u,n)})}},1386:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;const r=n(8138),i=n(8555),o=n(708);e.conv2DPackedPointwise=(t,e,n)=>{const i=e[0].dims,a=e[1].dims,s=(0,r.calculateOutputShape)(i,a,n.dilations,n.pads,n.strides),u=t.reshapePacked(e[0],[i[1],i[2]*i[3]]),c=t.reshapePacked(e[1],[a[0],a[1]]),l=e.length>2?[c,u,e[2]]:[c,u],p=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,l,n),l);return t.reshapePacked(p,s)},e.conv2DPacked=(t,e,n)=>{const a=e[0].dims,s=e[1].dims,u=(0,r.calculateOutputShape)(a,s,n.dilations,n.pads,n.strides),c=t.run((0,i.createPackedIm2ColProgramInfoLoader)(t,e[0],e[1],u,n),[e[0]]),l=t.reshapePacked(e[1],[s[0],s[1]*s[2]*s[3]]),p=3===e.length?[l,c,e[2]]:[l,c],f=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,p,n),p);return t.reshapePacked(f,u)}},9663:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseConvTransposeAttributes=e.convTranspose=void 0;const r=n(246),i=n(5060),o=n(2039),a=n(2823),s=(t,e,n,r,i,o)=>(t-1)*e+n+(r-1)*i+1-o,u=(t,e,n,r,i)=>{const o=Math.floor(t/2);\"SAME_UPPER\"===e?(n[r]=o,n[i]=t-o):\"SAME_LOWER\"===e&&(n[r]=t-o,n[i]=o)};e.convTranspose=(t,e,n)=>(f(e,n),c(t,e,n));const c=(t,e,n)=>{const r=p(n,e);return[l(t,e,r)]},l=(t,e,n)=>t.run(((t,e,n)=>{const r=(s=e.length>2,u=n.cacheKey,{name:\"ConvTranspose\",inputNames:s?[\"X\",\"W\",\"B\"]:[\"X\",\"W\"],inputTypes:s?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:u});var s,u;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const s=e.length>2?\"getB(output_channel)\":\"0.0\",u=e[0].dims,c=e[1].dims,l=c[1],p=c[0]/r.group,f=[e[0].dims[0],e[1].dims[1]*r.group,...r.outputShape],d=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:h,applyActivation:g}=(0,a.getActivationSnippet)(r),b=`\\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\\n ${h}\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords.x;\\n int output_channel = coords.y;\\n\\n ivec2 loc = coords.zw + pads;\\n\\n int group_id = output_channel / ${l};\\n int wOutChannel = output_channel - group_id * ${l};\\n\\n float value = ${s};\\n for (int inChannelOffset = 0; inChannelOffset < ${p}; inChannelOffset++) {\\n int input_channel = group_id * ${p} + inChannelOffset;\\n for (int wWOff = 0; wWOff < ${c[2]}; wWOff++) {\\n for (int wHOff = 0; wHOff < ${c[3]}; wHOff++) {\\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\\n ivec2 wLoc = loc - wOff;\\n ivec2 wLocIn = wLoc / strides;\\n if (\\n wLocIn * strides == wLoc &&\\n wLocIn.x >= 0 && wLocIn.x < ${u[2]} &&\\n wLocIn.y >= 0 && wLocIn.y < ${u[3]}\\n ) {\\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\\n value += xVal * wVal;\\n }\\n }\\n }\\n }\\n ${g}\\n ${d.output} = vec4(value, .0, .0, .0);\\n }\\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:b,hasMain:!0})})(t,e,r,n)})})(t,e,n),e),p=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const l=t.length-2,p=0===c.length;for(let f=0;f{const e=t.attributes,n=(0,a.parseInternalActivationAttributes)(e),i=e.getString(\"auto_pad\",\"NOTSET\"),o=e.getInts(\"dilations\",[1,1]),s=e.getInt(\"group\",1),u=e.getInts(\"kernel_shape\",[]),c=e.getInts(\"output_padding\",[0,0]),l=e.getInts(\"output_shape\",[]),p=e.getInts(\"pads\",[0,0,0,0]),f=e.getInts(\"strides\",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:s,kernelShape:u,outputPadding:c,outputShape:l,pads:p,strides:f},n))};const f=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error(\"Conv requires 2 or 3 inputs\");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error(\"currently only support 2-dimensional conv\");if(t[0].dims[1]!==t[1].dims[0])throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");const n=t[1].dims[1]*e.group;if(3===t.length&&(1!==t[2].dims.length||t[2].dims[0]!==n))throw new Error(\"invalid bias\");const r=t[0].dims.length-2;if(e.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(e.strides.length!==r)throw new Error(`strides should be ${r}D`);if(e.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(e.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(0!==e.outputShape.length&&e.outputShape.length!==t[0].dims.length-2)throw new Error(\"invalid output shape\");if(\"float32\"!==t[0].type||\"float32\"!==t[1].type)throw new Error(\"ConvTranspose input(X,W) should be float tensor\");if(3===t.length&&\"float32\"!==t[2].type)throw new Error(\"ConvTranspose input(bias) should be float tensor\")}},8138:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseConvAttributes=e.conv=e.calculateOutputShape=void 0;const r=n(246),i=n(2517),o=n(4770),a=n(1386),s=n(9828),u=n(2823),c=n(3248),l=n(5623);e.calculateOutputShape=(t,e,n,r,i)=>{const o=t[0],a=t.slice(2),s=a.length,u=e[0],c=e.slice(2).map(((t,e)=>t+(t-1)*(n[e]-1))),l=a.map(((t,e)=>t+r[e]+r[e+s])).map(((t,e)=>Math.floor((t-c[e]+i[e])/i[e])));return[o,u].concat(...l)},e.conv=(t,e,n)=>(g(e,n),p(t,e,n));const p=(t,e,n)=>{const r=h(n,e),i=t.session.pack,s=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[t.run((0,o.createUnpackedGroupedConvProgramInfoLoader)(t,e,r),e)]:s&&i?[f(t,e,r)]:i&&4===e[0].dims.length&&1===e[0].dims[0]&&!s?[(0,a.conv2DPacked)(t,e,r)]:[d(t,e,r)]},f=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,a=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),s=t.reshapeUnpacked(n[0],[i[1],i[2]*i[3]]),u=t.reshapeUnpacked(n[1],[o[0],o[1]]),c=n.length>2?[u,s,n[2]]:[u,s],p=t.run((0,l.createMatmulProgramInfoLoader)(c,r),c);return t.reshapeUnpacked(p,a)},d=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,a=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),u=t.run((0,c.createIm2ColProgramInfoLoader)(t,n[0],n[1],a,r),[n[0]]),l=3===n.length?[u,n[1],n[2]]:[u,n[1]];return t.run((0,s.createDotProductProgramInfoLoader)(t,n,a,r),l)},h=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const e=t.attributes,n=(0,u.parseInternalActivationAttributes)(e),i=e.getString(\"auto_pad\",\"NOTSET\"),o=e.getInts(\"dilations\",[1,1]),a=e.getInt(\"group\",1),s=e.getInts(\"kernel_shape\",[]),c=e.getInts(\"pads\",[0,0,0,0]),l=e.getInts(\"strides\",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:a,kernelShape:s,pads:c,strides:l},n))};const g=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error(\"Conv requires 2 or 3 inputs\");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error(\"currently only support 2-dimensional conv\");if(t[0].dims[1]!==t[1].dims[1]*e.group)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");if(3===t.length&&(1!==t[2].dims.length||t[1].dims[0]!==t[2].dims[0]))throw new Error(\"invalid bias\");const n=t[0].dims.length-2;if(e.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(e.strides.length!==n)throw new Error(`strides should be ${n}D`);if(e.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(\"float32\"!==t[0].type||\"float32\"!==t[1].type)throw new Error(\"Conv input(X,W) should be float tensor\");if(3===t.length&&\"float32\"!==t[2].type)throw new Error(\"Conv input(bias) should be float tensor\")}},5193:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;const r=n(3738);e.depthToSpace=(t,e,n)=>{i(e);const o=n.blocksize,a=o*o,s=\"DCR\"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],u=\"DCR\"===n.mode?[e[0].dims[0],o,o,e[0].dims[1]/a,e[0].dims[2],e[0].dims[3]]:[e[0].dims[0],e[0].dims[1]/a,o,o,e[0].dims[2],e[0].dims[3]],c=t.reshapeUnpacked(e[0],u),l={perm:s,cacheKey:`${s}`},[p]=(0,r.transpose)(t,[c],l),f=[e[0].dims[0],e[0].dims[1]/a,e[0].dims[2]*o,e[0].dims[3]*o];return[t.reshapeUnpacked(p,f)]},e.parseDepthToSpaceAttributes=t=>{const e=t.attributes.getInt(\"blocksize\");if(e<1)throw new Error(`blocksize must be >= 1, but got : ${e} for DepthToSpace`);const n=t.attributes.getString(\"mode\",\"DCR\");if(\"DCR\"!==n&&\"CRD\"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:e}};const i=t=>{if(1!==t.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${t.length}`);if(\"string\"===t[0].type||4!==t[0].dims.length)throw new TypeError(\"DepthToSpace input should be a 4-D numeric tensor\")}},9828:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createDotProductProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(2823),s=n(3248);e.createDotProductProgramInfoLoader=(t,e,n,u)=>{const c=((t,e)=>({name:\"ConvDotProduct\",inputNames:t?[\"Im2Col\",\"K\",\"B\"]:[\"Im2Col\",\"K\"],inputTypes:t?[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.packedLastDimension],cacheKey:e.activationCacheKey}))(e.length>2,u);return Object.assign(Object.assign({},c),{get:()=>((t,e,n,u,c)=>{const l=n[0].dims,p=n[1].dims,f=[p[0],Math.ceil(l[1]*p[2]*p[3]/4)],d=(0,s.calculateIm2ColDims)(l,p,u),[h,g]=t.calculateTextureWidthAndHeight(f,o.TextureType.packedLastDimension),b=r.ShapeUtil.computeStrides(d),[m,y]=t.calculateTextureWidthAndHeight(d,o.TextureType.packedLastDimension),_=u.length,v=n.length<3?\"0.0\":\"_B(b)\",w=Math.ceil(l[1]*p[2]*p[3]/4),{activationFunction:x,applyActivation:T}=(0,a.getActivationSnippet)(c),S=(0,i.getGlsl)(t.session.backend.glContext.version),O=`\\n${x}\\nfloat process(int indices[${_}]) {\\n int b[1];\\n b[0] = indices[1];\\n int im2col[4];\\n im2col[0] = indices[0];\\n im2col[1] = indices[2];\\n im2col[2] = indices[3];\\n int im2colOffset = im2col[0] * ${b[0]} + im2col[1] * ${b[1]} + im2col[2] * ${b[2]};\\n int kernelOffset = indices[1] * ${f[1]};\\n float value = ${v};\\n for (int i = 0; i < ${w}; ++i) {\\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${m}, ${y});\\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${g});\\n value += dot(${S.texture2D}(Im2Col, im2colCoords), ${S.texture2D}(K, kernelCoords));\\n ++im2colOffset;\\n ++kernelOffset;\\n }\\n ${T}\\n return value;\\n}`;return Object.assign(Object.assign({},e),{output:{dims:u,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:O})})(t,c,e,n,u)})}},7992:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;const r=n(2517);e.flatten=(t,e,n)=>{i(e,n);const o=r.ShapeUtil.flattenShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.parseFlattenAttributes=t=>t.attributes.getInt(\"axis\",1);const i=(t,e)=>{if(!t||1!==t.length)throw new Error(\"Flatten requires 1 input.\");const n=t[0].dims.length;if(0===n)throw new Error(\"scalar tensor is not supported.\");if(e<-n||e>n)throw new Error(\"Invalid axis\");if(\"string\"===t[0].type)throw new Error(\"string tensor is not supported.\")}},2823:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;const r=n(2517),i=n(4909);e.getActivationSnippet=function(t){let e;switch(t.activation){case\"Relu\":e=(0,i.glslRelu)();break;case\"Sigmoid\":e=(0,i.glslSigmoid)();break;case\"Clip\":e=(0,i.glslClip)(t.clipMin,t.clipMax);break;default:return{activationFunction:\"\",applyActivation:\"\"}}const n=e.name;return{activationFunction:e.body,applyActivation:`value = ${n}_(value);`}},e.parseInternalActivationAttributes=t=>{const e=t.getString(\"activation\",\"\");if(\"Clip\"===e){const[n,i]=t.getFloats(\"activation_params\",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:e,clipMax:i,clipMin:n,activationCacheKey:`${e}:${n},${i}`}}return{activation:e,activationCacheKey:e}}},1253:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseGatherAttributes=e.gather=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039);e.gather=(t,e,n)=>(c(e,n.axis),[t.run(u(t,e,n),e)]),e.parseGatherAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\",0)});const s={name:\"Gather\",inputNames:[\"A\",\"B\"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},u=(t,e,n)=>{const r=Object.assign(Object.assign({},s),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const i=n[0].dims.slice(),s=n[1].dims.slice(),u=new Array(i.length+s.length-1);r=o.ShapeUtil.normalizeAxis(r,i.length);const c=[];for(let t=0;t{if(!t||2!==t.length)throw new Error(\"Gather requires 2 inputs.\");const n=t[0].dims.length;if(n<1)throw new Error(\"Invalid input shape.\");if(e<-n||e>n-1)throw new Error(\"Invalid axis.\");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invaid input type.\");if(\"int32\"!==t[1].type&&\"int16\"!==t[1].type)throw new Error(\"Invaid input type.\")}},4776:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;const r=n(246),i=n(2517),o=n(2039);e.gemm=(t,e,n)=>(c(e,n),[t.run(s(e,n),e)]);const a=(t,e)=>{const n=0!==t.attributes.getInt(\"transA\",0),i=0!==t.attributes.getInt(\"transB\",0),o=t.attributes.getFloat(\"alpha\",1),a=t.attributes.getFloat(\"beta\",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:i,alpha:o,beta:a,isOptionalC:e})};e.parseGemmAttributesV7=t=>a(t,!1),e.parseGemmAttributesV11=t=>a(t,!0);const s=(t,e)=>{const n={name:\"Gemm\",inputNames:3===t.length?[\"A\",\"B\",\"C\"]:[\"A\",\"B\"],inputTypes:3===t.length?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],key:e.cacheKey};return Object.assign(Object.assign({},n),{get:()=>u(n,t,e)})},u=(t,e,n)=>{const r=e[0].dims.slice(),a=e[1].dims.slice(),[s,u]=i.GemmUtil.getShapeOfGemmResult(r,n.transA,a,n.transB,3===e.length?e[2].dims:void 0),c=[s,u];if(!c)throw new Error(\"Can't use gemm on the given tensors\");let l=r[r.length-1],p=\"\";n.transA&&(l=r[0]),n.transA&&n.transB?p=\"value += _A_T(a) * _B_T(b);\":n.transA&&!n.transB?p=\"value += _A_T(a) * _B(b);\":!n.transA&&n.transB?p=\"value += _A(a) * _B_T(b);\":n.transA||n.transB||(p=\"value += _A(a) * _B(b);\");const f=c.length,d=`\\n float process(int indices[${f}]) {\\n int a[${f}];\\n int b[${f}];\\n ${3===e.length?`int c[${e[2].dims.length}];`:\"\"}\\n\\n copyVec(indices, a);\\n copyVec(indices, b);\\n ${3===e.length?\"bcastIndices_C(indices, c);\":\"\"}\\n\\n float value = 0.0;\\n for (int k=0; k<${l}; ++k) {\\n a[${f-1}] = k;\\n b[${f-2}] = k;\\n ${p}\\n }\\n\\n value = value * alpha;\\n ${3===e.length?\"value += beta * _C(c);\":\"\"}\\n return value;\\n }`;return Object.assign(Object.assign({},t),{output:{dims:c,type:e[0].type,textureType:o.TextureType.unpacked},variables:[{name:\"alpha\",type:\"float\",data:n.alpha},{name:\"beta\",type:\"float\",data:n.beta}],shaderSource:d})},c=(t,e)=>{if(!t)throw new Error(\"Input is missing\");if(e.isOptionalC&&(t.length<2||t.length>3))throw new Error(\"Invaid input shape.\");if(!e.isOptionalC&&3!==t.length)throw new Error(\"Gemm requires 3 inputs\");if(3===t.length&&1!==t[2].dims.length&&2!==t[2].dims.length)throw new Error(\"Invalid input shape of C\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type||\"float32\"!==t[1].type&&\"float64\"!==t[1].type||3===t.length&&\"float32\"!==t[2].type&&\"float64\"!==t[2].type)throw new Error(\"Invalid input type.\");if(t[0].type!==t[1].type||3===t.length&&t[0].type!==t[2].type)throw new Error(\"Input types are mismatched\")}},8555:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(2827);e.createPackedIm2ColProgramInfoLoader=(t,e,n,a,s)=>{const u=(c=s.cacheKey,{name:\"Im2Col (packed)\",inputNames:[\"A\"],inputTypes:[i.TextureType.packed],cacheHint:c});var c;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,a,s,u)=>{const c=n.dims,l=a.dims,p=s.length,f=[l[1]*l[2]*l[3],s[2]*s[3]],d=l[2]*l[3],h=(0,o.unpackFromChannel)(),g=(0,r.getGlsl)(t.session.backend.glContext.version);let b=\"\";for(let t=0;t<=1;t++)for(let e=0;e<=1;e++)b+=`\\n blockIndex = rc.x + ${e};\\n pos = rc.y + ${t};\\n\\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\\n offsetY = int(blockIndex / (${s[p-1]})) * ${u.strides[0]} -\\n ${u.pads[0]};\\n d0 = offsetY + ${u.dilations[0]} * (imod(pos, ${d}) / ${l[2]});\\n\\n if(d0 < ${c[2]} && d0 >= 0) {\\n offsetX = imod(blockIndex, ${s[p-1]}) * ${u.strides[1]} -\\n ${u.pads[1]};\\n d1 = offsetX + ${u.dilations[1]} * imod(imod(pos, ${d}), ${l[2]});\\n\\n if(d1 < ${c[3]} && d1 >= 0) {\\n\\n ch = int(float(pos)/ ${d}.);\\n innerDims = vec2(d0, d1);\\n result[${2*t+e}] = getChannel(\\n getA(0, ch, int(innerDims.x),\\n int(innerDims.y)), innerDims);\\n }\\n }\\n }\\n\\n `;const m=`\\n ${h}\\n\\n void main() {\\n ivec2 rc = getOutputCoords();\\n vec4 result = vec4(0.0);\\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\\n vec2 innerDims;\\n ${b}\\n ${g.output} = result;\\n }\\n `;return Object.assign(Object.assign({},e),{output:{dims:f,type:n.type,textureType:i.TextureType.packed},shaderSource:m,hasMain:!0})})(t,u,e,n,a,s)})}},3248:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.calculateIm2ColDims=e.createIm2ColProgramInfoLoader=void 0;const r=n(2039);e.createIm2ColProgramInfoLoader=(t,n,i,o,a)=>{const s=(u=a.cacheKey,{name:\"Im2Col\",inputNames:[\"X\"],inputTypes:[r.TextureType.unpacked],cacheHint:u});var u;return Object.assign(Object.assign({},s),{get:()=>((t,n,i,o,a,s)=>{const u=i.dims,c=o.dims,l=a.length,p=(0,e.calculateIm2ColDims)(u,c,a,4),f=`\\n const int XC = ${u[1]};\\n const int XH = ${u[2]};\\n const int XW = ${u[3]};\\n const int KH = ${s.kernelShape[0]};\\n const int KW = ${s.kernelShape[1]};\\n const int dilationH = ${s.dilations[0]};\\n const int dilationW = ${s.dilations[1]};\\n const int strideH = ${s.strides[0]};\\n const int strideW = ${s.strides[1]};\\n const int padH = ${s.pads[0]};\\n const int padW = ${s.pads[1]};\\n const int KHKW = KH*KW;\\n const int XCKHKW = XC * KHKW;\\n const int outputChannels = 4;\\n vec4 process(int indices[${l}]) {\\n int b = indices[0]; // batch size\\n int oh = indices[1] * strideH - padH; //output height\\n int ow = indices[2] * strideW - padW; //output width\\n int p = indices[3] * outputChannels; //patch\\n vec4 value = vec4(0.0);\\n for(int i=0; i < outputChannels; ++i) {\\n if(p < XCKHKW) {\\n int patchC = p / KHKW;\\n int patchH = (p - patchC*KHKW) / KW;\\n int patchW = (p - patchC*KHKW) - patchH * KW;\\n int xh2 = oh + patchH * dilationH;\\n int xw2 = ow + patchW * dilationW;\\n int x[${u.length}];\\n x[0] = b;\\n x[1] = patchC;\\n x[2] = xh2;\\n x[3] = xw2;\\n if(xh2 >= 0 &&\\n xh2 < XH &&\\n xw2 >= 0 &&\\n xw2 < XW) {\\n value[i] = _X(x);\\n }\\n }\\n ++p;\\n }\\n return value;\\n }\\n `;return Object.assign(Object.assign({},n),{output:{dims:p,type:i.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n,i,o,a)})},e.calculateIm2ColDims=(t,e,n,r=4)=>[n[0],n[2],n[3],Math.ceil(t[1]*e[2]*e[3]/r)]},6572:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseImageScalerAttributes=e.imageScaler=void 0;const r=n(246),i=n(2039);e.imageScaler=(t,e,n)=>(u(e),[t.run(a(t,e,n),e)]),e.parseImageScalerAttributes=t=>{const e=t.attributes.getFloat(\"scale\"),n=t.attributes.getFloats(\"bias\");return(0,r.createAttributeWithCacheKey)({scale:e,bias:n})};const o={name:\"ImageScaler\",inputNames:[\"X\"],inputTypes:[i.TextureType.unpacked]},a=(t,e,n)=>{const r=Object.assign(Object.assign({},o),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice(),a=o.length,u=`\\n ${s(r.bias.length)}\\n float process(int indices[${a}]) {\\n return _X(indices) * scale + getBias(bias, indices[1]);\\n }`;return Object.assign(Object.assign({},e),{output:{dims:o,type:n[0].type,textureType:i.TextureType.unpacked},variables:[{name:\"bias\",type:\"float\",arrayLength:r.bias.length,data:r.bias},{name:\"scale\",type:\"float\",data:r.scale}],shaderSource:u})})(0,r,e,n)})},s=t=>{const e=[`float getBias(float bias[${t}], int channel) {`];for(let n=0;n{if(!t||1!==t.length)throw new Error(\"ImageScaler requires 1 input.\");if(4!==t[0].dims.length)throw new Error(\"Invalid input shape.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type.\")}},3346:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;const r=n(5060),i=n(2039);e.instanceNormalization=(t,e,n)=>{c(e);const r=t.run(a(e[0]),e);return[t.run(u(t,e[0],n,r.dims),[e[0],r,e[1],e[2]])]},e.parseInstanceNormalizationAttributes=t=>t.attributes.getFloat(\"epsilon\",1e-5);const o={name:\"InstanceNormalization_MeanAndVariance\",inputNames:[\"X\"],inputTypes:[i.TextureType.unpacked]},a=t=>Object.assign(Object.assign({},o),{get:()=>((t,e)=>{const n=e.dims.slice(),r=n[1],o=n[2]*n[3],a=[n[0],r],s=`\\n vec4 process(int[2] indices) {\\n vec4 v = vec4(0.0);\\n int a[4];\\n a[0] = indices[0];\\n a[1] = indices[1];\\n float temp = 0.0;\\n for(int a2=0; a2<${n[2]}; a2++) {\\n a[2] = a2;\\n for(int a3=0; a3<${n[3]}; a3++) {\\n a[3] = a3;\\n float x = _X(a);\\n temp += x;\\n }\\n }\\n float mean = temp / float(${o});\\n temp = 0.0;\\n for(int a2=0; a2<${n[2]}; a2++) {\\n a[2] = a2;\\n for(int a3=0; a3<${n[3]}; a3++) {\\n a[3] = a3;\\n float x = _X(a);\\n temp += (x - mean) * (x - mean);\\n }\\n }\\n v.r = mean;\\n v.g = temp / float(${o});\\n\\n return v;\\n }`;return Object.assign(Object.assign({},t),{output:{dims:a,type:e.type,textureType:i.TextureType.packedLastDimension},shaderSource:s})})(o,t)}),s={name:\"InstanceNormalization_ComputeOutput\",inputNames:[\"X\",\"MeanAndVariance\",\"Scale\",\"B\"],inputTypes:[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked,i.TextureType.unpacked]},u=(t,e,n,o)=>{const a=Object.assign(Object.assign({},s),{cacheHint:`${n}`});return Object.assign(Object.assign({},a),{get:()=>((t,e,n,o,a)=>{const s=(0,r.getGlsl)(t.session.backend.glContext.version),[u,c]=t.calculateTextureWidthAndHeight(a,i.TextureType.packedLastDimension),[l,p]=[u/4,c],f=`\\n vec4 get_MeanAndVariance(int[2] mv) {\\n int offset = indicesToOffset_MeanAndVariance(mv);\\n vec2 coords = offsetToCoords(offset, ${l}, ${p});\\n return ${s.texture2D}(MeanAndVariance, coords);\\n }\\n\\n float process(int[4] indices) {\\n int mv[2];\\n mv[0] = indices[0];\\n mv[1] = indices[1];\\n vec4 mean_and_variance = get_MeanAndVariance(mv);\\n float mean = mean_and_variance.r;\\n float variance = mean_and_variance.g;\\n\\n int sb[1];\\n sb[0] = indices[1];\\n float scale = _Scale(sb);\\n float b = _B(sb);\\n\\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\\n }`;return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i.TextureType.unpacked},variables:[{name:\"epsilon\",type:\"float\",data:o}],shaderSource:f})})(t,a,e,n,o)})},c=t=>{if(!t||3!==t.length)throw new Error(\"InstanceNormalization requires 3 inputs.\");const e=t[0],n=t[1],r=t[2];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error(\"Invalid input shape.\");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1])throw new Error(\"Input shapes are mismatched.\");if(\"float32\"!==e.type&&\"float64\"!==e.type||\"float32\"!==n.type&&\"float64\"!==n.type||\"float32\"!==r.type&&\"float64\"!==r.type)throw new Error(\"Invalid input type.\");if(4!==t[0].dims.length)throw new Error(\"Only support 4-D input shape.\")}},708:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(9390),s=n(2823),u=n(5623);e.createPackedMatmulProgramInfoLoader=(t,e,n)=>{const c=(l=e.length>2,p=n.activationCacheKey,{name:\"MatMul (packed)\",inputNames:l?[\"A\",\"B\",\"Bias\"]:[\"A\",\"B\"],inputTypes:l?[o.TextureType.packed,o.TextureType.packed,o.TextureType.packed]:[o.TextureType.packed,o.TextureType.packed],cacheHint:p});var l,p;return Object.assign(Object.assign({},c),{get:()=>((t,e,n,c)=>{const l=n.length>2,p=l?\"value += getBiasForMatmul();\":\"\",f=n[0].dims,d=n[1].dims,h=r.BroadcastUtil.calcShape(f,d,!0),g=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error(\"Can't use matmul on the given tensors\");const b=f[f.length-1],m=Math.ceil(b/2),y=f.length,_=d.length,v=(0,i.getGlsl)(t.session.backend.glContext.version),w=(0,a.getCoordsDataType)(h.length),x=h.length,T=(0,a.getGlChannels)(),{activationFunction:S,applyActivation:O}=(0,s.getActivationSnippet)(c),A=l?`${(0,u.getBiasForMatmul)(w,T,n[2].dims,h,!0)}`:\"\",E=g?`${function(t,e,n,i){let o=[],a=[];const s=n[0].dims,u=n[1].dims,c=s.length,l=u.length,p=i.length,f=p-c,d=p-l;o=s.map(((t,n)=>`coords.${e[n+f]}`)),o[c-1]=\"i*2\",o.join(\", \"),a=u.map(((t,n)=>`coords.${e[n+d]}`)),a[l-2]=\"i*2\",a.join(\", \");const h=r.BroadcastUtil.getBroadcastDims(s,i),g=r.BroadcastUtil.getBroadcastDims(u,i),b=h.map((t=>`coords.${e[t+f]} = 0;`)).join(\"\\n\"),m=g.map((t=>`coords.${e[t+d]} = 0;`)).join(\"\\n\"),y=`int lastDim = coords.${e[p-1]};\\n coords.${e[p-1]} = coords.${e[p-2]};\\n coords.${e[p-2]} = lastDim;`;return`\\nvec4 getAAtOutCoordsMatmul(int i) {\\n ${t} coords = getOutputCoords();\\n ${y}\\n ${b}\\n vec4 outputValue = getA(${o});\\n return outputValue;\\n}\\n\\nvec4 getBAtOutCoordsMatmul(int i) {\\n ${t} coords = getOutputCoords();\\n ${y}\\n ${m}\\n vec4 outputValue = getB(${a});\\n return outputValue;\\n}`}(w,T,n,h)}`:\"\",I=g?\"getAAtOutCoordsMatmul(i)\":`getA(${function(t,e){let n=\"\";for(let r=0;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getBiasForMatmul=e.createMatmulProgramInfoLoader=e.parseMatMulAttributes=e.matMul=void 0;const r=n(2517),i=n(2039),o=n(9390),a=n(2823),s=n(708);function u(t,e){const n=(s=t.length>2,u=e.activationCacheKey,{name:\"MatMul\",inputNames:s?[\"A\",\"B\",\"Bias\"]:[\"A\",\"B\"],inputTypes:s?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});var s,u;return Object.assign(Object.assign({},n),{get:()=>function(t,e,n){const s=e[0].dims,u=e[1].dims,c=r.BroadcastUtil.calcShape(s,u,!0);if(!c)throw new Error(\"Can't use matmul on the given tensors\");const p=(0,o.getCoordsDataType)(c.length),f=(0,o.getGlChannels)(),{activationFunction:d,applyActivation:h}=(0,a.getActivationSnippet)(n),g=e.length>2,b=g?\"value += getBiasForMatmul();\":\"\",m=g?`${l(p,f,e[2].dims,c,!1)}`:\"\",y=c.length,_=s.length,v=u.length,w=`\\n ${d}\\n ${m}\\n float process(int indices[${y}]) {\\n int a[${_}];\\n int b[${v}];\\n bcastMatmulIndices_A(indices, a);\\n bcastMatmulIndices_B(indices, b);\\n\\n float value;\\n for (int k=0; k<${s[s.length-1]}; ++k) {\\n a[${_-1}] = k;\\n b[${v-2}] = k;\\n value += _A(a) * _B(b);\\n }\\n ${b}\\n ${h}\\n return value;\\n }`;return Object.assign(Object.assign({},t),{output:{dims:c,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:w})}(n,t,e)})}e.matMul=(t,e,n)=>(c(e),t.session.pack?[t.run((0,s.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(u(e,n),e)]),e.parseMatMulAttributes=t=>(0,a.parseInternalActivationAttributes)(t.attributes),e.createMatmulProgramInfoLoader=u;const c=t=>{if(!t||2!==t.length)throw new Error(\"MatMul requires 2 inputs.\");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error(\"shared dimension does not match.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type||\"float32\"!==t[1].type&&\"float64\"!==t[1].type)throw new Error(\"inputs should be float type\");if(t[0].type!==t[1].type)throw new Error(\"inputs types should match\")};function l(t,e,n,i,o){let a=\"\";const s=n.length,u=i.length,c=u-s;a=u<2&&s>0?\"coords\":n.map(((t,n)=>`coords.${e[n+c]}`)).join(\", \");const l=r.BroadcastUtil.getBroadcastDims(n,i).map((t=>`coords.${e[t+c]} = 0;`)).join(\"\\n\");let p=\"vec4(outputValue.xx, outputValue.yy)\";return 1===r.ShapeUtil.size(n)&&(p=\"vec4(outputValue.x)\"),o?`\\nvec4 getBiasForMatmul() {\\n ${t} coords = getOutputCoords();\\n ${l}\\n vec4 outputValue = getBias(${a});\\n return ${p};\\n}`:`\\nfloat getBiasForMatmul() {\\n ${t} coords = getOutputCoords();\\n ${l}\\n return getBias(coords.x);\\n}`}e.getBiasForMatmul=l},2403:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:\"pack\",inputNames:[\"A\"],inputTypes:[i.TextureType.unpackedReversed]};e.createPackProgramInfoLoader=(t,e)=>Object.assign(Object.assign({},s),{get:()=>((t,e)=>{const n=(0,r.getGlsl)(t.session.backend.glContext.version),u=e.dims,c=u.length,l=e.dims.length,p=(0,o.getCoordsDataType)(l),f=(0,a.getChannels)(\"rc\",l),d=(h=l,g=f,b=u[u.length-2],m=u[u.length-1],0===h||1===h?\"\":`\\n int r = ${g[h-2]};\\n int c = ${g[h-1]};\\n int rp1 = ${g[h-2]} + 1;\\n int cp1 = ${g[h-1]} + 1;\\n bool rEdge = rp1 >= ${m};\\n bool cEdge = cp1 >= ${b};\\n `);var h,g,b,m;let y;y=0===c?[1,1]:1===c?[u[0],1]:[u[l-1],u[l-2]];const _=function(t,e,n){if(0===t)return\"false\";if(1===t)return`rc > ${e[0]}`;let r=\"\";for(let i=t-2;i= ${e[i-t+2]}`,i= ${t[0]} ? 0. : getA(rc + 1),\\n 0, 0`;let r=\"\";if(n>2)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.unpackFromChannel=e.getChannels=e.getVecChannels=void 0;const r=n(9390);function i(t,e){return(0,r.getGlChannels)(e).map((e=>`${t}.${e}`))}e.getVecChannels=i,e.getChannels=function(t,e){return 1===e?[t]:i(t,e)},e.unpackFromChannel=function(){return\"\\n float getChannel(vec4 frag, int dim) {\\n int modCoord = imod(dim, 2);\\n return modCoord == 0 ? frag.r : frag.g;\\n }\\n\\n float getChannel(vec4 frag, vec2 innerDims) {\\n vec2 modCoord = mod(innerDims, 2.);\\n return modCoord.x == 0. ?\\n (modCoord.y == 0. ? frag.r : frag.g) :\\n (modCoord.y == 0. ? frag.b : frag.a);\\n }\\n \"}},2870:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;const r=n(246),i=n(2517),o=n(5060),a=n(2039),s={name:\"Pad\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]};e.padV2=(t,e,n)=>(l(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>c(t,e[0],n)}),e)]),e.parsePadAttributesV2=t=>{const e=t.attributes.getString(\"mode\",\"constant\"),n=t.attributes.getFloat(\"value\",0),i=t.attributes.getInts(\"pads\");return(0,r.createAttributeWithCacheKey)({mode:e,value:n,pads:i})},e.padV11=(t,n,r)=>{p(n);const i=u(t,n,r);return(0,e.padV2)(t,[n[0]],i)},e.parsePadAttributesV11=t=>t.attributes.getString(\"mode\",\"constant\");const u=(t,e,n)=>{if(!t.session.isInitializer(e[1].dataId)||e.length>=3&&!t.session.isInitializer(e[2].dataId))throw new Error(\"dynamic pad attributes are not allowed\");const i=Array.from(e[1].integerData),o=e.length>=3?e[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:i,value:o})},c=(t,e,n)=>{const r=i.ShapeUtil.padShape(e.dims.slice(),n.pads),o=r.length,s=`\\n ${f(t,e,n)}\\n float process(int[${o}] indices) {\\n return padA(indices);\\n }`;return{name:\"Pad\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked],output:{dims:r,type:e.type,textureType:a.TextureType.unpacked},shaderSource:s}},l=t=>{if(!t||1!==t.length)throw new Error(\"Pad requires 1 input\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type.\")},p=t=>{if(!t||2!==t.length&&3!==t.length)throw new Error(\"Pad requires 2 or 3 inputs\");if(\"int32\"!==t[1].type)throw new Error(\"Invalid input type.\");if(t.length>=3&&\"string\"===t[2].type)throw new Error(\"Invalid input type.\")},f=(t,e,n)=>{const r=(0,o.getGlsl)(t.session.backend.glContext.version),[s,u]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),c=i.ShapeUtil.computeStrides(e.dims);switch(n.mode){case\"constant\":return d(r,e.dims,c,s,u,n.pads,n.value);case\"reflect\":return h(r,e.dims,c,s,u,n.pads);case\"edge\":return g(r,e.dims,c,s,u,n.pads);default:throw new Error(\"Invalid mode\")}},d=(t,e,n,r,i,o,a)=>{const s=e.length;let u=\"\";for(let t=s-1;t>=0;--t)u+=`\\n k = m[${t}] - ${o[t]};\\n if (k < 0) return constant;\\n if (k >= ${e[t]}) return constant;\\n offset += k * ${n[t]};\\n `;return`\\n float padA(int m[${s}]) {\\n const float constant = float(${a});\\n int offset = 0;\\n int k = 0;\\n ${u}\\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\\n float value = getColorAsFloat(${t.texture2D}(A, coords));\\n return value;\\n }\\n `},h=(t,e,n,r,i,o)=>{const a=e.length;let s=\"\";for(let t=a-1;t>=0;--t)s+=`\\n k = m[${t}] - ${o[t]};\\n if (k < 0) { k = -k; }\\n {\\n const int _2n_1 = ${2*(e[t]-1)};\\n k = int( mod( float(k), float(_2n_1) ) ) ;\\n if(k >= ${e[t]}) { k = _2n_1 - k; }\\n }\\n offset += k * ${n[t]};\\n `;return`\\n float padA(int m[${a}]) {\\n int offset = 0;\\n int k = 0;\\n ${s}\\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\\n float value = getColorAsFloat(${t.texture2D}(A, coords));\\n return value;\\n }\\n `},g=(t,e,n,r,i,o)=>{const a=e.length;let s=\"\";for(let t=a-1;t>=0;--t)s+=`\\n k = m[${t}] - ${o[t]};\\n if (k < 0) k = 0;\\n if (k >= ${e[t]}) k = ${e[t]-1};\\n offset += k * ${n[t]};\\n `;return`\\n float padA(int m[${a}]) {\\n int offset = 0;\\n int k = 0;\\n ${s}\\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\\n float value = getColorAsFloat(${t.texture2D}(A, coords));\\n return value;\\n }\\n `}},2143:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;const r=n(246),i=n(2517),o=n(2039);e.averagePool=(t,e,n)=>{p(e);const r={name:\"AveragePool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!1,n)}),e)]},e.parseAveragePoolAttributes=t=>{const e=t.attributes.getString(\"auto_pad\",\"NOTSET\"),n=t.attributes.getInt(\"ceil_mode\",0),i=0!==t.attributes.getInt(\"count_include_pad\",0),o=t.attributes.getInts(\"kernel_shape\"),a=t.attributes.getInts(\"strides\",[]),s=t.attributes.getInts(\"pads\",[]);if(0!==n)throw new Error(\"using ceil() in shape computation is not yet supported for AveragePool\");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:i,kernelShape:o,strides:a,pads:s})};const a=(t,e,n,r)=>{const[a,s]=u(t,r,n),c=i.ShapeUtil.size(a.kernelShape);let l=\"\";a.countIncludePad?l+=`value /= float(${c});`:l+=`value /= float(${c} - pad);`;const p=`\\n ${f(t[0].dims,a,\"value += _X(x);\",l,\"0.0\")}\\n `;return Object.assign(Object.assign({},e),{output:{dims:s,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:p})};e.globalAveragePool=(t,e,n)=>{p(e);const r={name:\"GlobalAveragePool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!0,n)}),e)]},e.parseGlobalAveragePoolAttributes=t=>{const e=0!==t.attributes.getInt(\"count_include_pad\",0);return(0,r.createAttributeWithCacheKey)({autoPad:\"\",ceilMode:0,countIncludePad:e,kernelShape:[],strides:[],pads:[]})},e.maxPool=(t,e,n)=>{p(e);const r={name:\"MaxPool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>s(e,r,!1,n)}),e)]},e.parseMaxPoolAttributes=t=>{const e=t.attributes.getString(\"auto_pad\",\"NOTSET\"),n=t.attributes.getInt(\"ceil_mode\",0),i=t.attributes.getInts(\"kernel_shape\"),o=t.attributes.getInts(\"strides\",[]),a=t.attributes.getInts(\"pads\",[]),s=t.attributes.getInt(\"storage_order\",0),u=t.attributes.getInts(\"dilations\",[]);if(0!==s)throw new Error(\"column major storage order is not yet supported for MaxPool\");if(0!==n)throw new Error(\"using ceil() in shape computation is not yet supported for MaxPool\");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:!1,kernelShape:i,strides:o,pads:a,storageOrder:s,dilations:u})};const s=(t,e,n,r)=>{const[i,a]=u(t,r,n),s=`\\n ${f(t[0].dims,i,\"\\n value = max(_X(x), value);\\n \",\"\",\"-1e5\")}\\n `;return Object.assign(Object.assign({},e),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:s})},u=(t,e,n)=>{const r=t[0].dims.slice(),o=Object.hasOwnProperty.call(e,\"dilations\"),a=e.kernelShape.slice(),s=e.strides.slice(),u=o?e.dilations.slice():[],c=e.pads.slice();i.PoolConvUtil.adjustPoolAttributes(n,r,a,s,u,c);const l=i.PoolConvUtil.computePoolOutputShape(n,r,s,u,a,c,e.autoPad),p=Object.assign({},e);return o?Object.assign(p,{kernelShape:a,strides:s,pads:c,dilations:u,cacheKey:e.cacheKey}):Object.assign(p,{kernelShape:a,strides:s,pads:c,cacheKey:e.cacheKey}),[p,l]},c={autoPad:\"\",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:\"\"},l={name:\"GlobalMaxPool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked]};e.globalMaxPool=(t,e)=>(p(e),[t.run(Object.assign(Object.assign({},l),{get:()=>s(e,l,!0,c)}),e)]);const p=t=>{if(!t||1!==t.length)throw new Error(\"Pool ops requires 1 input.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type.\")},f=(t,e,n,r,o)=>{const a=t.length;if(e.kernelShape.length<=2){const i=e.kernelShape[e.kernelShape.length-1],s=e.strides[e.strides.length-1],u=e.pads[e.pads.length/2-1],c=e.pads[e.pads.length-1],l=t[a-1];let p=\"\",f=\"\",d=\"\";if(p=u+c!==0?`\\n for (int i = 0; i < ${i}; i++) {\\n x[${a} - 1] = indices[${a} - 1] * ${s} - ${u} + i;\\n if (x[${a} - 1] < 0 || x[${a} - 1] >= ${l}) {\\n pad++;\\n continue;\\n }\\n ${n}\\n }`:`\\n for (int i = 0; i < ${i}; i++) {\\n x[${a} - 1] = indices[${a} - 1] * ${s} - ${u} + i;\\n ${n}\\n }`,2===e.kernelShape.length){const n=e.kernelShape[e.kernelShape.length-2],r=e.strides[e.strides.length-2],o=e.pads[e.pads.length/2-2],s=e.pads[e.pads.length-2],u=t[a-2];f=o+s!==0?`\\n for (int j = 0; j < ${n}; j++) {\\n x[${a} - 2] = indices[${a} - 2] * ${r} - ${o} + j;\\n if (x[${a} - 2] < 0 || x[${a} - 2] >= ${u}) {\\n pad+= ${i};\\n continue;\\n }\\n `:`\\n for (int j = 0; j < ${n}; j++) {\\n x[${a} - 2] = indices[${a} - 2] * ${r} - ${o} + j;\\n `,d=\"\\n }\\n \"}return`\\n float process(int indices[${a}]) {\\n int x[${a}];\\n copyVec(indices, x);\\n\\n float value = ${o};\\n int pad = 0;\\n ${f}\\n ${p}\\n ${d}\\n ${r}\\n return value;\\n }\\n `}{const s=i.ShapeUtil.size(e.kernelShape),u=i.ShapeUtil.computeStrides(e.kernelShape),c=u.length,l=e.pads.length,p=h(c),f=d(t,\"inputDims\"),g=d(e.pads,\"pads\"),b=d(u,\"kernelStrides\"),m=d(e.strides,\"strides\");let y=\"\";return y=e.pads.reduce(((t,e)=>t+e))?`\\n if (x[j] >= inputDims[j] || x[j] < 0) {\\n pad++;\\n isPad = true;\\n break;\\n }\\n }\\n if (!isPad) {\\n ${n}\\n }`:`\\n }\\n ${n}\\n `,`\\n ${p}\\n float process(int indices[${a}]) {\\n int x[${a}];\\n copyVec(indices, x);\\n int offset[${c}];\\n int pads[${l}];\\n int inputDims[${a}];\\n int kernelStrides[${c}];\\n int strides[${c}];\\n ${g}\\n ${f}\\n ${m}\\n ${b}\\n\\n float value = ${o};\\n int pad = 0;\\n bool isPad = false;\\n for (int i = 0; i < ${s}; i++) {\\n offsetToIndices(i, kernelStrides, offset);\\n isPad = false;\\n for (int j = ${a} - ${c}; j < ${a}; j++) {\\n x[j] = indices[j] * strides[j - ${a} + ${c}]\\n + offset[j - ${a} + ${c}] - pads[j - 2];\\n ${y}\\n }\\n ${r}\\n\\n return value;\\n }\\n `}},d=(t,e)=>{let n=\"\";for(let r=0;r`\\n void offsetToIndices(int offset, int[${t}] strides, out int[${t}] indices) {\\n if (${t} == 0) {\\n return;\\n }\\n for (int i = 0; i < ${t} - 1; ++i) {\\n indices[i] = offset / strides[i];\\n offset -= indices[i] * strides[i];\\n }\\n indices[${t} - 1] = offset;\\n }`},4939:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.reduceLogSumSquare=e.reduceLogSum=e.reduceProd=e.reduceMin=e.reduceMax=e.reduceMean=e.reduceSum=e.parseReduceAttributes=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039),s=(t,e,n,r,i)=>{c(e);const o={name:r,inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},o),{cacheHint:n.cacheKey,get:()=>u(t,e,n,r,i,o)}),e)]};e.parseReduceAttributes=t=>{const e=t.attributes.getInts(\"axes\",[]),n=1===t.attributes.getInt(\"keepdims\",1);return(0,r.createAttributeWithCacheKey)({axes:e,keepDims:n})};const u=(t,e,n,r,i,s)=>{const u=[],c=e[0].dims.length||1,l=[],p=o.ShapeUtil.normalizeAxes(n.axes,e[0].dims.length),f=i(e,p);let d=f[1];for(let t=0;t=0||0===p.length?(n.keepDims&&u.push(1),d=`\\n for(int j${t} = 0; j${t} < ${e[0].dims[t]}; j${t}++) {\\n inputIdx[${t}] = j${t};\\n ${d}\\n }`):(l.push(`inputIdx[${t}] = outputIdx[${u.length}];`),u.push(e[0].dims[t]));const h=`\\n float process(int outputIdx[${u.length||1}]) {\\n float value; // final result\\n int inputIdx[${c}]; // addressing input data\\n ${l.join(\"\\n\")}\\n ${f[0]} // init ops for reduce max/min\\n ${d}\\n ${f[2]} // final computation for reduce mean\\n return value;\\n }`;return Object.assign(Object.assign({},s),{output:{dims:u,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:h})},c=t=>{if(!t||1!==t.length)throw new Error(\"Reduce op requires 1 input.\");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invalid input type.\")};e.reduceSum=(t,e,n)=>s(t,e,n,\"ReduceSum\",(()=>[\"value = 0.0;\",\"value += _A(inputIdx);\",\"\"])),e.reduceMean=(t,e,n)=>s(t,e,n,\"ReduceMean\",((t,e)=>{let n=1;for(let r=0;r=0||0===e.length)&&(n*=t[0].dims[r]);return[\"value = 0.0;\",\"value += _A(inputIdx);\",`value /= ${n}.;`]})),e.reduceMax=(t,e,n)=>s(t,e,n,\"ReduceMax\",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join(\"\\n\")}\\nvalue = _A(inputIdx);`,\"value = max(value, _A(inputIdx));\",\"\"]})),e.reduceMin=(t,e,n)=>s(t,e,n,\"ReduceMin\",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join(\"\\n\")}\\nvalue = _A(inputIdx);`,\"value = min(value, _A(inputIdx));\",\"\"]})),e.reduceProd=(t,e,n)=>s(t,e,n,\"ReduceProd\",(()=>[\"value = 1.0;\",\"value *= _A(inputIdx);\",\"\"])),e.reduceLogSum=(t,e,n)=>s(t,e,n,\"ReduceLogSum\",(()=>[\"value = 0.0;\",\"value += _A(inputIdx);\",\"value = log(value);\"])),e.reduceLogSumSquare=(t,e,n)=>s(t,e,n,\"ReduceLogSumSquare\",(()=>[\"float t; value = 0.0;\",\"t = _A(inputIdx); value += t * t;\",\"\"]))},7019:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.isReshapeCheap=e.processDims3D=e.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(2827);e.createPackedReshape3DProgramInfoLoader=(t,e,n)=>{const s=(t=>({name:\"Reshape (packed)\",inputTypes:[o.TextureType.packed],inputNames:[\"A\"],cacheHint:`${t}`}))(n);return Object.assign(Object.assign({},s),{get:()=>((t,e,n,s)=>{const u=e.dims,c=s;let l=\"\";for(let t=0;t<4;t++){let e=\"\";switch(t){case 0:e=\"outputCoords = rc;\";break;case 1:e=\"outputCoords = ivec3(rc.x, rc.y+1, rc.z);\";break;case 2:e=\"outputCoords = ivec3(rc.x, rc.y, rc.z+1);\";break;case 3:e=\"outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);\";break;default:throw new Error}l+=`\\n ${e}\\n ${t>0?\"if(outputCoords.y < rows && outputCoords.z < cols){\":\"\"}\\n int flattenedIndex = getFlattenedIndex(outputCoords);\\n\\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\\n\\n result[${t}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\\n\\n ${t>0?\"}\":\"\"}\\n `}const p=(0,i.getGlsl)(t.session.backend.glContext.version),f=`\\n ${function(t){const e=r.ShapeUtil.computeStrides(t),n=[\"b\",\"r\",\"c\"],i=\"index\";return`\\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\\n ${e.map(((t,r)=>`int ${n[r]} = ${i} / ${t}; ${r===e.length-1?`int ${n[r+1]} = ${i} - ${n[r]} * ${t}`:`index -= ${n[r]} * ${t}`};`)).join(\"\")}\\n return ivec3(b, r, c);\\n }\\n `}(u)}\\n ${function(t){const e=r.ShapeUtil.computeStrides(t);return`\\n int getFlattenedIndex(ivec3 coords) {\\n // reverse y, z order\\n return coords.x * ${e[0]} + coords.z * ${e[1]} + coords.y;\\n }\\n`}(c)}\\n ${(0,a.unpackFromChannel)()}\\n\\n void main() {\\n ivec3 rc = getOutputCoords();\\n\\n vec4 result = vec4(0.0);\\n\\n ivec3 outputCoords;\\n int rows = ${c[2]};\\n int cols = ${c[1]};\\n\\n ${l}\\n ${p.output} = result;\\n }\\n `;return Object.assign(Object.assign({},n),{output:{dims:c,type:e.type,textureType:o.TextureType.packed},shaderSource:f,hasMain:!0})})(t,e,s,n)})},e.processDims3D=function(t){if(0===t.length)return[1,1,1];let e=1;for(let n=0;n1?t[t.length-2]:1,t[t.length-1]]},e.isReshapeCheap=function(t,e){let n=!1;return n=0===t.length||0===e.length||(t.length<2||e.length<2?t[t.length-1]===e[e.length-1]:t[t.length-1]===e[e.length-1]&&t[t.length-2]===e[e.length-2]),n}},718:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.reshape=void 0;const r=n(2517);e.reshape=(t,e)=>{const n=r.ShapeUtil.calculateReshapedDims(e[0].dims,e[1].integerData);return t.session.pack?[t.reshapePacked(e[0],n)]:[t.reshapeUnpacked(e[0],n)]}},2268:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s=n(9793),u={name:\"Resize\",inputNames:[\"A\"],inputTypes:[i.TextureType.packed]};e.resize=(t,e,n)=>((0,s.validateInputs)(e,n),[t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>c(t,e,n)}),e)]),e.parseResizeAttributesV10=t=>(0,s.parseUpsampleAttributes)(t,10),e.parseResizeAttributesV11=t=>(0,s.parseUpsampleAttributes)(t,11);const c=(t,e,n)=>{const s=(0,r.getGlsl)(t.session.backend.glContext.version),[c,p]=l(e,n);if(c.every((t=>1===t))&&\"tf_crop_and_resize\"!==n.coordinateTransformMode)return Object.assign(Object.assign({},u),{output:{dims:p,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:`void main() {\\n vec4 v = ${s.texture2D}(X, TexCoords);\\n ${s.output} = v;\\n }`});const f=p.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const d=p[f-2],h=p[f-1],g=e[0].dims;if(f!==g.length)throw new Error(`output dimension should match input ${g.length}, but got ${f}`);const b=g[f-2],m=g[f-1],y=c[f-2],_=c[f-1];let v=\"\";if(\"linear\"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case\"asymmetric\":v=\"\\n vec4 getSourceFracIndex(ivec4 coords) {\\n return vec4(coords) / scaleWHWH;\\n }\\n \";break;case\"half_pixel\":v=\"\\n vec4 getSourceFracIndex(ivec4 coords) {\\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\\n }\\n \";break;case\"pytorch_half_pixel\":v=`\\n vec4 getSourceFracIndex(ivec4 coords) {\\n vec4 fcoords = vec4(coords);\\n return vec4(\\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\\n ${d}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\\n ${d}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\\n );\\n }\\n `;break;case\"align_corners\":v=`\\n vec4 getSourceFracIndex(ivec4 coords) {\\n vec4 resized = vec4(${h}.0 - 1.0, ${d}.0 - 1.0, ${h}.0 - 1.0,\\n ${d}.0 - 1.0);\\n vec4 original = vec4(${m}.0 - 1.0, ${b}.0 - 1.0, ${m}.0 - 1.0,\\n ${b}.0 - 1.0);\\n vec4 new_scale = original / resized;\\n return vec4(coords) * new_scale;\\n }\\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,o.getCoordsDataType)(f),x=`\\n const vec2 inputWH = vec2(${b}.0, ${m}.0);\\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\\n ${(0,a.unpackFromChannel)()}\\n ${v}\\n float getAValue(int x10, int r, int c, int d) {\\n return getChannel(getA(x10, r, c, d), vec2(c, d));\\n }\\n void main() {\\n ${w} rc = getOutputCoords();\\n\\n int batch = rc[0];\\n int depth = rc[1];\\n\\n // retrieve the 4 coordinates that is used in the 4 packed output values.\\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\\n\\n // calculate the source index in fraction\\n vec4 sourceFrac = getSourceFracIndex(coords);\\n\\n // get the lower and upper bound of the 4 values that will be packed into one texel.\\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\\n\\n bool hasNextRow = rc.w < ${d-1};\\n bool hasNextCol = rc.z < ${h-1};\\n\\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\\n vec4 topLeft = vec4(\\n getAValue(batch, depth, x00.x, x00.y),\\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\\n\\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\\n vec4 topRight = vec4(\\n getAValue(batch, depth, x00.x, x00.w),\\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\\n\\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\\n vec4 bottomLeft = vec4(\\n getAValue(batch, depth, x00.z, x00.y),\\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\\n\\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\\n vec4 bottomRight = vec4(\\n getAValue(batch, depth, x00.z, x00.w),\\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\\n\\n // calculate the interpolation fraction on u and v direction\\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\\n\\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\\n\\n ${s.output} = vec4(newValue);\\n }\\n `;return Object.assign(Object.assign({},u),{output:{dims:p,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:x})},l=(t,e)=>{const n=t[0].dims;let r,i=e.scales;if(0===i.length){const o=t[e.scalesInputIdx];if(o&&0!==o.size){if(t[e.sizesInputIdx])throw new Error(\"Only one of scales or sizes must be provided as input.\");i=p(o,e.mode,e.isResize)}else{const o=t[e.sizesInputIdx];if(!o||0===o.size)throw new Error(\"Either scales or sizes MUST be provided as input.\");r=Array.from(o.integerData),i=f(r,n,e.mode,e.isResize)}}else if(t[e.sizesInputIdx])throw new Error(\"Only one of scales or sizes must be provided as input.\");const o=r||n.map(((t,e)=>Math.floor(t*i[e])));return[i,o]},p=(t,e,n)=>{const r=Array.from(t.floatData);return(0,s.scalesValidation)(r,e,n),r},f=(t,e,n,r)=>{const i=e.length,o=new Array(i);for(let n=0,r=i;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.shape=void 0;const r=n(9162);e.shape=(t,e)=>(i(e),[new r.Tensor([e[0].dims.length],\"int32\",void 0,void 0,new Int32Array(e[0].dims))]);const i=t=>{if(!t||1!==t.length)throw new Error(\"Shape requires 1 input.\")}},2278:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sliceV10=e.parseSliceAttributes=e.slice=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039),s={name:\"Slice\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]};e.slice=(t,e,n)=>(c(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),e)]),e.parseSliceAttributes=t=>{const e=t.attributes.getInts(\"starts\"),n=t.attributes.getInts(\"ends\"),i=t.attributes.getInts(\"axes\",[]);return(0,r.createAttributeWithCacheKey)({starts:e,ends:n,axes:i})};const u=(t,e,n)=>{const r=0===n.axes.length?e.dims.slice(0).map(((t,e)=>e)):n.axes,i=o.ShapeUtil.normalizeAxes(r,e.dims.length),u=n.starts.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),c=n.ends.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),l=e.dims.slice(),p=[];for(let t=0;t0&&p.push(`outputIdx[${i[t]}] += ${u[t]};`);const f=`\\n float process(int outputIdx[${l.length}]) {\\n ${p.join(\"\\n \")}\\n return _A(outputIdx);\\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},c=t=>{if(!t||1!==t.length)throw new Error(\"Slice requires 1 input.\");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invalid input type.\")};e.sliceV10=(t,e)=>{p(e);const n=l(t,e);return[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),[e[0]])]};const l=(t,e)=>{if(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)||e.length>=4&&!t.session.isInitializer(e[3].dataId)||e.length>=5&&!t.session.isInitializer(e[4].dataId))throw new Error(\"dynamic slice attributes are not allowed\");if(e.length>=5&&e[4].integerData.some((t=>1!==t)))throw new Error(\"currently non-1 steps is not supported for Slice\");const n=Array.from(e[1].integerData),r=Array.from(e[2].integerData),i=e.length>=4?Array.from(e[3].integerData):[];return{starts:n,ends:r,axes:i,cacheKey:`${i};${n};${r}`}},p=t=>{if(!t||t.length<3||t.length>5)throw new Error(\"Invalid input number.\");if(\"int32\"!==t[1].type||1!==t[1].dims.length)throw new Error(\"Invalid input type.\");if(\"int32\"!==t[2].type||1!==t[2].dims.length)throw new Error(\"Invalid input type.\");if(t.length>=4&&(\"int32\"!==t[3].type||1!==t[3].dims.length))throw new Error(\"Invalid input type.\");if(t.length>=5&&(\"int32\"!==t[4].type||1!==t[4].dims.length))throw new Error(\"Invalid input type.\")}},5524:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;const r=n(246),i=n(2517),o=n(5060),a=n(2039),s=n(3738),u={name:\"SoftmaxComputeMax\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]},c={name:\"SoftmaxComputeScale\",inputNames:[\"A\",\"Max\"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},l={name:\"SoftMax\",inputNames:[\"A\",\"Max\",\"Norm\"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};e.softmax=(t,e,n)=>{g(e);const r=e[0].dims.slice(),o=i.ShapeUtil.normalizeAxis(n.axis,r.length),a=i.ShapeUtil.sizeToDimension(r,o),s=i.ShapeUtil.sizeFromDimension(r,o);return p(t,e,n,a,s)},e.parseSoftmaxAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\",1)}),e.parseSoftmaxAttributesV13=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\",-1)}),e.softmaxV13=(t,e,n)=>{g(e);const o=e[0].dims.slice(),a=i.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,c=a!==u-1,l=[];let f,d=[],h=[];c&&(d=Array.from({length:u}).map(((t,e)=>e)),d[a]=u-1,d[u-1]=a,d.map((t=>l.push(o[t]))),f=(0,r.createAttributeWithCacheKey)({perm:d}),h=(0,s.transpose)(t,e,f));const b=c?i.ShapeUtil.sizeToDimension(l,u-1):i.ShapeUtil.sizeToDimension(o,u-1),m=c?i.ShapeUtil.sizeFromDimension(l,u-1):i.ShapeUtil.sizeFromDimension(o,u-1),y=p(t,c?h:e,n,b,m);return c?(0,s.transpose)(t,y,f):y};const p=(t,e,n,r,i)=>{const o=f(t,e[0],r,i,[r]),a=t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>o}),e),s=d(t,e[0],r,i,o.output.dims,[r]),p=t.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>s}),[e[0],a]),g=h(t,e[0],r,i,o.output.dims,s.output.dims);return[t.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>g}),[e[0],a,p])]},f=(t,e,n,r,i)=>{const[s,c]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),l=i.length;if(n<1||r<1)throw new Error(\"Logical row count N and feature count D must be greater than or equal to 1\");if(1!==i.length)throw new Error(\"Dimensionality of the output should be 1\");if(i[0]!==n)throw new Error(\"Shape of the output should be equal to logical row count\");const p=(0,o.getGlsl)(t.session.backend.glContext.version),f=`\\n float process(int[${l}] indices) {\\n int logical_row_start_offset = indices[0] * ${r};\\n\\n float max = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s},\\n ${c} )));\\n for(int i=1; i<${r}; ++i)\\n {\\n float current = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\\n ${s}, ${c})));\\n if(current > max)\\n max = current;\\n }\\n\\n return max;\\n }`;return Object.assign(Object.assign({},u),{output:{dims:i,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},d=(t,e,n,r,i,s)=>{const[u,l]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),p=s.length;if(n<1||r<1)throw new Error(\"Logical row count N and feature count D must be greater than or equal to 1\");if(1!==s.length)throw new Error(\"Dimensionality of the output should be 1\");if(s[0]!==n)throw new Error(\"Shape of the output should be equal to logical row count\");if(1!==i.length)throw new Error(\"Dimensionality of the intermediate results should be 1\");if(i[0]!==n)throw new Error(\"Shape of the intermediate results should be equal to logical row count\");const f=`\\n float process(int[${p}] indices) {\\n int logical_row_start_offset = indices[0] * ${r};\\n\\n float norm_factor = 0.0;\\n float max = _Max(indices);\\n for(int i=0; i<${r}; ++i)\\n {\\n norm_factor += exp(getColorAsFloat(${(0,o.getGlsl)(t.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\\n ${u}, ${l}))) - max);\\n }\\n\\n return norm_factor;\\n }`;return Object.assign(Object.assign({},c),{output:{dims:s,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},h=(t,e,n,r,i,o)=>{const[s,u]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),c=e.dims.length;if(n<1||r<1)throw new Error(\"Logical row count N and feature count D must be greater than or equal to 1\");if(1!==i.length||1!==o.length)throw new Error(\"Dimensionality of the intermediate results should be 1\");if(i[0]!==n||o[0]!==n)throw new Error(\"Shape of the intermediate results should be equal to logical row count\");const p=`\\n float process(int[${c}] indices) {\\n\\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\\n int offset = coordsToOffset(TexCoords, ${s}, ${u});\\n\\n //determine the logical row for this index\\n int logical_row_index[1];\\n logical_row_index[0] = offset / ${r};\\n\\n float norm_factor = _Norm(logical_row_index);\\n\\n // avoid possible division by 0\\n // if norm_facor is 0, all elements are zero\\n // if so, return 0\\n if(norm_factor == 0.0)\\n return 0.0;\\n\\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\\n }`;return Object.assign(Object.assign({},l),{output:{dims:e.dims,type:e.type,textureType:a.TextureType.unpacked},shaderSource:p})},g=t=>{if(!t||1!==t.length)throw new Error(\"Softmax requires 1 input.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type\")}},5975:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseSplitAttributes=e.split=void 0;const r=n(246),i=n(2517),o=n(2039),a={name:\"Split\",inputNames:[\"A\"],inputTypes:[o.TextureType.unpacked]};e.split=(t,e,n)=>{c(e);const r=i.ShapeUtil.normalizeAxis(n.axis,e[0].dims.length),o=s(t,e,r,n),l=[];for(let i=0;iu(t,e[0],n,r,i)}),e));return l},e.parseSplitAttributes=t=>{const e=t.attributes.getInt(\"axis\",0),n=t.attributes.getInts(\"split\",[]),i=t.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:e,split:n,numOutputs:i})};const s=(t,e,n,r)=>{const[,o]=i.SplitUtil.splitShape(e[0].dims,n,r.split,r.numOutputs);return o.length},u=(t,e,n,r,s)=>{const[u,c]=i.SplitUtil.splitShape(e.dims,r,n.split,n.numOutputs),l=c[s],p=u[s],f=`\\n float process(int indices[${p.length}]) {\\n indices[${r}] += ${l};\\n return _A(indices);\\n }\\n `;return Object.assign(Object.assign({},a),{cacheHint:`${n.cacheKey}:${s}`,output:{dims:p,type:e.type,textureType:o.TextureType.unpacked},shaderSource:f})},c=t=>{if(!t||1!==t.length)throw new Error(\"Split requires one input.\");if(\"int8\"!==t[0].type&&\"uint8\"!==t[0].type&&\"int16\"!==t[0].type&&\"uint16\"!==t[0].type&&\"int32\"!==t[0].type&&\"uint32\"!==t[0].type&&\"float32\"!==t[0].type&&\"float64\"!==t[0].type&&\"bool\"!==t[0].type)throw new Error(\"Invalid input type.\")}},3933:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseSqueezeAttributes=e.squeezeV13=e.squeeze=void 0;const r=n(2517);e.squeeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.squeezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.squeezeV13=(t,n)=>(o(n),(0,e.squeeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseSqueezeAttributes=t=>t.attributes.getInts(\"axes\");const i=t=>{if(!t||1!==t.length)throw new Error(\"Squeeze requires 1 input.\");if(\"string\"===t[0].type)throw new Error(\"invalid input tensor types.\")},o=t=>{if(!t||2!==t.length)throw new Error(\"Squeeze requires 2 inputs.\");if(\"int32\"!==t[1].type)throw new Error(\"Invalid input type.\")}},6558:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sum=void 0;const r=n(5060),i=n(2039);e.sum=(t,e)=>{a(e);const n={name:\"Sum\",inputNames:e.map(((t,e)=>`X${e}`)),inputTypes:new Array(e.length).fill(i.TextureType.unpacked)};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const o=(0,r.getGlsl)(t.session.backend.glContext.version),a=e[0].dims.slice(),s=`\\n void main() {\\n vec4 result = ${e.map(((t,e)=>`${o.texture2D}(X${e},TexCoords)`)).join(\" + \")};\\n ${o.output} = result;\\n }\\n `;return Object.assign(Object.assign({},n),{output:{dims:a,type:e[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:s})},a=t=>{if(!t||0===t.length)throw new Error(\"Sum requires inputs.\");const e=t[0].dims.length;for(let n=1;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.tile=void 0;const r=n(782),i=n(2039);e.tile=(t,e)=>{a(e);const n={name:\"Tile\",inputNames:[\"A\"],inputTypes:[i.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const r=e[0].dims.slice(),o=new Array(r.length),a=[];for(let t=0;t{if(!t||2!==t.length)throw new Error(\"Tile requires 2 input.\");if(1!==t[1].dims.length)throw new Error(\"The second input shape must 1 dimension.\");if(t[1].dims[0]!==t[0].dims.length)throw new Error(\"Invalid input shape.\");if(-1===r.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invalid input type.\");if(\"int32\"!==t[1].type&&\"int16\"!==t[1].type)throw new Error(\"Invalid repeat type.\")}},3738:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseTransposeAttributes=e.transpose=void 0;const r=n(246),i=n(2517),o=n(2039),a={name:\"Transpose\",inputNames:[\"A\"],inputTypes:[o.TextureType.unpacked]};e.transpose=(t,e,n)=>(p(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>s(t,e[0],n.perm)}),e)]),e.parseTransposeAttributes=t=>(0,r.createAttributeWithCacheKey)({perm:t.attributes.getInts(\"perm\",[])});const s=(t,e,n)=>{const r=e.dims;n=u(r,n);const i=c(r,n),s=r.length,p=`\\n ${l(\"perm\",n,s)}\\n float process(int indices[${s}]) {\\n int a[${s}];\\n perm(a, indices);\\n return _A(a);\\n }`;return Object.assign(Object.assign({},a),{output:{dims:i,type:e.type,textureType:o.TextureType.unpacked},shaderSource:p})},u=(t,e)=>(e&&e.length!==t.length&&(e=[...t.keys()].reverse()),e),c=(t,e)=>(e=u(t,e),i.ShapeUtil.sortBasedOnPerm(t,e)),l=(t,e,n)=>{const r=[];r.push(`void ${t}(out int a[${n}], int src[${n}]) {`);for(let t=0;t{if(!t||1!==t.length)throw new Error(\"Transpose requires 1 input.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"input should be float tensor\")}},8710:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.encodeAsUint8=void 0;const r=n(5060),i=n(2039);e.encodeAsUint8=(t,e)=>{const n=e.shape,o=(0,r.getGlsl)(t.session.backend.glContext.version),a=`\\n const float FLOAT_MAX = 1.70141184e38;\\n const float FLOAT_MIN = 1.17549435e-38;\\n\\n bool isNaN(float val) {\\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\\n }\\n\\n highp vec4 encodeAsUint8(highp float v) {\\n if (isNaN(v)) {\\n return vec4(255, 255, 255, 255);\\n }\\n\\n highp float av = abs(v);\\n\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\\n } else if(v < -FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\\n }\\n\\n highp vec4 c = vec4(0,0,0,0);\\n\\n highp float e = floor(log2(av));\\n highp float m = exp2(fract(log2(av))) - 1.0;\\n\\n c[2] = floor(128.0 * m);\\n m -= c[2] / 128.0;\\n c[1] = floor(32768.0 * m);\\n m -= c[1] / 32768.0;\\n c[0] = floor(8388608.0 * m);\\n\\n highp float ebias = e + 127.0;\\n c[3] = floor(ebias / 2.0);\\n ebias -= c[3] * 2.0;\\n c[2] += floor(ebias) * 128.0;\\n\\n c[3] += 128.0 * step(0.0, -v);\\n\\n return c / 255.0;\\n }\\n\\n void main() {\\n float value = ${o.texture2D}(X,TexCoords).r;\\n ${o.output} = encodeAsUint8(value);\\n }`,s={name:\"Uint8Encode\",inputTypes:[i.TextureType.unpacked],inputNames:[\"X\"],output:{dims:n,type:e.tensor.type,textureType:i.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return t.executeProgram(s,[e.tensor])}},4909:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.tanh=e.tan=e.sqrt=e.sin=e.sigmoid=e.relu=e.not=e.neg=e.log=e.parseLeakyReluAttributes=e.leakyRelu=e.identity=e.floor=e.exp=e.parseEluAttributes=e.elu=e.cos=e.ceil=e.clipV11=e.parseClipAttributes=e.clip=e.atan=e.asin=e.acos=e.abs=e.glslTanh=e.glslTan=e.glslSqrt=e.glslSigmoid=e.glslRelu=e.glslSin=e.glslNot=e.glslNeg=e.glslLog=e.glslLeakyRelu=e.glslIdentity=e.glslClip=e.glslFloor=e.glslExp=e.glslElu=e.glslCos=e.glslCeil=e.glslAtan=e.glslAsin=e.glslAcos=e.glslAbs=void 0;const r=n(246),i=n(2517),o=n(8520),a=n(5060),s=n(2039);function u(){return P(\"abs\")}function c(){return P(\"acos\")}function l(){return P(\"asin\")}function p(){return P(\"atan\")}function f(){return P(\"ceil\")}function d(){return P(\"cos\")}function h(t){const e=\"elu\";return{body:`\\n const float alpha = float(${t});\\n\\n float ${e}_(float a) {\\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\\n }\\n vec4 ${e}_(vec4 v) {\\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\\n }\\n `,name:e,type:o.FunctionType.ValueBased}}function g(){return P(\"exp\")}function b(){return P(\"floor\")}function m(t,e){const n=\"clip\";return{body:`\\n const float min = float(${t});\\n const float max = float(${e});\\n\\n float ${n}_(float a) {\\n return clamp(a, min, max);\\n }\\n vec4 ${n}_(vec4 v) {\\n return clamp(v, min, max);\\n }\\n `,name:n,type:o.FunctionType.ValueBased}}function y(){const t=\"indentity\";return{body:`\\n float ${t}_(float a) {\\n return a;\\n }\\n vec4 ${t}_(vec4 v) {\\n return v;\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function _(t){const e=\"leakyRelu\";return{body:`\\n const float alpha = float(${t});\\n\\n float ${e}_(float a) {\\n return a < 0.0 ? a * alpha : a;\\n }\\n vec4 ${e}_(vec4 v) {\\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\\n }\\n `,name:e,type:o.FunctionType.ValueBased}}function v(){return P(\"log\")}function w(){const t=\"neg\";return{body:`\\n float ${t}_(float a) {\\n return -a;\\n }\\n vec4 ${t}_(vec4 v) {\\n return -v;\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function x(){const t=\"not\";return{body:`\\n float ${t}_(float a) {\\n return float( ! bool(a) );\\n }\\n bool ${t}_(bool a) {\\n return !a;\\n }\\n vec4 ${t}_(vec4 v) {\\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\\n }\\n bvec4 ${t}_(bvec4 v) {\\n return bvec4(!v.x, !v.y, !v.z, !v.w);\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function T(){return P(\"sin\")}function S(){const t=\"relu\";return{body:`\\n float ${t}_(float a) {\\n return max( a, 0.0 );\\n }\\n vec4 ${t}_(vec4 v) {\\n return max( v, 0.0 );\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function O(){const t=\"sigmoid\";return{body:`\\n float ${t}_(float a) {\\n return 1.0 / (1.0 + exp(-a));\\n }\\n vec4 ${t}_(vec4 v) {\\n return 1.0 / (1.0 + exp(-v));\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function A(){return P(\"sqrt\")}function E(){return P(\"tan\")}function I(){const t=\"tanh\";return{body:`\\n float ${t}_(float a) {\\n a = clamp(a, -10., 10.);\\n a = exp(2.*a);\\n return (a - 1.) / (a + 1.);\\n }\\n vec4 ${t}_(vec4 v) {\\n v = clamp(v, -10., 10.);\\n v = exp(2.*v);\\n return (v - 1.) / (v + 1.);\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function P(t){return{body:`\\n float ${t}_(float a) {\\n return ${t}(a);\\n }\\n vec4 ${t}_(vec4 v) {\\n return ${t}(v);\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}e.glslAbs=u,e.glslAcos=c,e.glslAsin=l,e.glslAtan=p,e.glslCeil=f,e.glslCos=d,e.glslElu=h,e.glslExp=g,e.glslFloor=b,e.glslClip=m,e.glslIdentity=y,e.glslLeakyRelu=_,e.glslLog=v,e.glslNeg=w,e.glslNot=x,e.glslSin=T,e.glslRelu=S,e.glslSigmoid=O,e.glslSqrt=A,e.glslTan=E,e.glslTanh=I;const D=(t,e,n,r)=>{const i=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,o={name:n.name,inputTypes:[i],inputNames:[\"A\"],cacheHint:r};return Object.assign(Object.assign({},o),{get:()=>((t,e,n,r)=>{const i=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,o=(0,a.getGlsl)(t.session.backend.glContext.version);return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:`\\n ${r.body}\\n void main() {\\n vec4 v = ${o.texture2D}(A, TexCoords);\\n v = ${r.name}_(v);\\n ${o.output} = v;\\n }\\n `,hasMain:!0})})(t,o,e,n)})};e.abs=(t,e)=>[t.run(D(t,e[0],u()),e)],e.acos=(t,e)=>[t.run(D(t,e[0],c()),e)],e.asin=(t,e)=>[t.run(D(t,e[0],l()),e)],e.atan=(t,e)=>[t.run(D(t,e[0],p()),e)],e.clip=(t,e,n)=>[t.run(D(t,e[0],m(n.min,n.max),n.cacheKey),e)],e.parseClipAttributes=t=>(0,r.createAttributeWithCacheKey)({min:t.attributes.getFloat(\"min\",i.MIN_CLIP),max:t.attributes.getFloat(\"max\",i.MAX_CLIP)}),e.clipV11=(t,n)=>{const r=$(t,n);return(0,e.clip)(t,[n[0]],r)};const $=(t,e)=>{if(e.length>=3&&(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)))throw new Error(\"dynamic clip attributes are not allowed\");const n=e.length>=3?e[1].numberData[0]:i.MIN_CLIP,o=e.length>=3?e[2].numberData[0]:i.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:o})};e.ceil=(t,e)=>[t.run(D(t,e[0],f()),e)],e.cos=(t,e)=>[t.run(D(t,e[0],d()),e)],e.elu=(t,e,n)=>[t.run(D(t,e[0],h(n.alpha),n.cacheKey),e)],e.parseEluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat(\"alpha\",1)}),e.exp=(t,e)=>[t.run(D(t,e[0],g()),e)],e.floor=(t,e)=>[t.run(D(t,e[0],b()),e)],e.identity=(t,e)=>[t.run(D(t,e[0],y()),e)],e.leakyRelu=(t,e,n)=>[t.run(D(t,e[0],_(n.alpha),n.cacheKey),e)],e.parseLeakyReluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat(\"alpha\",.01)}),e.log=(t,e)=>[t.run(D(t,e[0],v()),e)],e.neg=(t,e)=>[t.run(D(t,e[0],w()),e)],e.not=(t,e)=>[t.run(D(t,e[0],x()),e)],e.relu=(t,e)=>[t.run(D(t,e[0],S()),e)],e.sigmoid=(t,e)=>[t.run(D(t,e[0],O()),e)],e.sin=(t,e)=>[t.run(D(t,e[0],T()),e)],e.sqrt=(t,e)=>[t.run(D(t,e[0],A()),e)],e.tan=(t,e)=>[t.run(D(t,e[0],E()),e)],e.tanh=(t,e)=>[t.run(D(t,e[0],I()),e)]},5611:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createUnpackProgramInfoLoader=e.createUnpackProgramInfo=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:\"unpack\",inputNames:[\"A\"],inputTypes:[i.TextureType.packed]};e.createUnpackProgramInfo=(t,e)=>{const n=e.dims.length,u=(0,a.getChannels)(\"rc\",n),c=u.slice(-2),l=(0,o.getCoordsDataType)(n),p=(0,a.unpackFromChannel)(),f=0===e.dims.length?\"\":function(t,e){if(1===t)return\"rc\";let n=\"\";for(let r=0;rObject.assign(Object.assign({},s),{get:()=>(0,e.createUnpackProgramInfo)(t,n)})},8428:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseUnsqueezeAttributes=e.unsqueezeV13=e.unsqueeze=void 0;const r=n(2517);e.unsqueeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.unsqueezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.unsqueezeV13=(t,n)=>(o(n),(0,e.unsqueeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseUnsqueezeAttributes=t=>t.attributes.getInts(\"axes\");const i=t=>{if(!t||1!==t.length)throw new Error(\"Unsqueeze requires 1 input.\");if(\"string\"===t[0].type)throw new Error(\"invalid input tensor types.\")},o=t=>{if(!t||2!==t.length)throw new Error(\"Unsqueeze requires 2 inputs.\");if(\"int32\"!==t[1].type)throw new Error(\"Invalid input type.\")}},9793:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;const r=n(246),i=n(5060),o=n(2039),a={name:\"Upsample\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked]};e.upsample=(t,n,r)=>((0,e.validateInputs)(n,r),[t.run(Object.assign(Object.assign({},a),{cacheHint:r.cacheKey,get:()=>s(t,n,r)}),n)]),e.parseUpsampleAttributesV7=t=>(0,e.parseUpsampleAttributes)(t,7),e.parseUpsampleAttributesV9=t=>(0,e.parseUpsampleAttributes)(t,9),e.parseUpsampleAttributes=(t,n)=>{const i=n>=10,o=t.attributes.getString(\"mode\",\"nearest\");if(\"nearest\"!==o&&\"linear\"!==o&&(n<11||\"cubic\"!==o))throw new Error(`unrecognized mode: ${o}`);let a=[];n<9&&(a=t.attributes.getFloats(\"scales\"),(0,e.scalesValidation)(a,o,i));const s=t.attributes.getFloat(\"extrapolation_value\",0),u=n>10?t.attributes.getString(\"coordinate_transformation_mode\",\"half_pixel\"):\"asymmetric\";if(-1===[\"asymmetric\",\"pytorch_half_pixel\",\"tf_half_pixel_for_nn\",\"align_corners\",\"tf_crop_and_resize\",\"half_pixel\"].indexOf(u))throw new Error(`coordinate_transform_mode '${u}' is not supported`);const c=\"tf_crop_and_resize\"===u,l=c,p=\"nearest\"===o&&n>=11?t.attributes.getString(\"nearest_mode\",\"round_prefer_floor\"):\"\";if(-1===[\"round_prefer_floor\",\"round_prefer_ceil\",\"floor\",\"ceil\",\"\"].indexOf(p))throw new Error(`nearest_mode '${p}' is not supported`);const f=t.attributes.getFloat(\"cubic_coeff_a\",-.75),d=0!==t.attributes.getInt(\"exclude_outside\",0);if(d&&\"cubic\"!==o)throw new Error(\"exclude_outside can be set to 1 only when mode is CUBIC.\");const h=n<11||\"nearest\"===o&&\"asymmetric\"===u&&\"floor\"===p;let g=0,b=0,m=0;return n>10?t.inputs.length>2?(g=1,b=2,m=3):(b=1,m=2):9===n&&(b=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:i,mode:o,scales:a,extrapolationValue:s,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:p,cubicCoefficientA:f,excludeOutside:d,useNearest2xOptimization:h,roiInputIdx:g,scalesInputIdx:b,sizesInputIdx:m})};const s=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),[s,u]=t.calculateTextureWidthAndHeight(e[0].dims,o.TextureType.unpacked),c=e[0].dims.map(((t,e)=>Math.floor(t*n.scales[e]))),[l,p]=t.calculateTextureWidthAndHeight(c,o.TextureType.unpacked),f=c.length,d=new Array(f),h=new Array(f);let g=`\\n int output_pitches[${f}];\\n int input_pitches[${f}];\\n `;for(let t=f-1;t>=0;t--)d[t]=t===f-1?1:d[t+1]*c[t+1],h[t]=t===f-1?1:h[t+1]*e[0].dims[t+1],g+=`\\n output_pitches[${t}] = ${d[t]};\\n input_pitches[${t}] = ${h[t]};\\n `;const b=`\\n float getInputFloat(int index) {\\n vec2 coords = offsetToCoords(index, ${s}, ${u});\\n float value = getColorAsFloat(${r.texture2D}(X, coords));\\n return value;\\n }\\n `,m=\"nearest\"===n.mode?`\\n ${b}\\n float process(int indices[${f}]) {\\n int input_index = 0;\\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\\n\\n ${g}\\n\\n int d, m;\\n for (int dim = 0; dim < ${f}; ++dim) {\\n d = output_index / output_pitches[dim];\\n m = output_index - d * output_pitches[dim];\\n output_index = m;\\n\\n if (scales[dim] != 1 && d > 0) {\\n int d2 = d / scales[dim];\\n m = d - d2 * scales[dim];\\n d = d2;\\n }\\n input_index += input_pitches[dim] * d;\\n }\\n\\n return getInputFloat(input_index);\\n }`:4===f?`\\n ${b}\\n float process(int indices[4]) {\\n int input_index = 0;\\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\\n\\n ${g}\\n\\n int m;\\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\\n index_of_dim0 = output_index / output_pitches[0];\\n m = output_index - index_of_dim0 * output_pitches[0];\\n index_of_dim1 = m / output_pitches[1];\\n m = m - index_of_dim1 * output_pitches[1];\\n index_of_dim2 = m / output_pitches[2];\\n m = m - index_of_dim2 * output_pitches[2];\\n index_of_dim3 = m;\\n\\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\\n index_of_input_dim2 = index_of_dim2 / scales[2];\\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\\n index_of_input_dim3 = index_of_dim3 / scales[3];\\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\\n\\n input_index = index_of_dim0 * input_pitches[0] +\\n index_of_dim1 * input_pitches[1] +\\n index_of_input_dim2 * input_pitches[2] +\\n index_of_input_dim3;\\n\\n float x00 = getInputFloat(input_index);\\n float x10, x01, x11;\\n\\n bool end_of_dim2 = false;\\n if (index_of_input_dim2 == (${e[0].dims[2]} - 1)) {\\n // It's the end in dimension 2\\n x01 = x00;\\n end_of_dim2 = true;\\n } else {\\n x01 = getInputFloat(input_index + input_pitches[2]);\\n }\\n\\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\\n // It's the end in dimension 3\\n x10 = x00;\\n x11 = x01;\\n }\\n else {\\n x10 = getInputFloat(input_index + 1);\\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\\n }\\n\\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\\n }`:`\\n ${b}\\n float process(int indices[2]) {\\n int input_index = 0;\\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\\n\\n ${g}\\n\\n int m;\\n int index_of_dim0, index_of_dim1;\\n index_of_dim0 = output_index / output_pitches[0];\\n m = output_index - index_of_dim0 * output_pitches[0];\\n index_of_dim1 = m;\\n\\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\\n index_of_input_dim0 = index_of_dim0 / scales[0];\\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\\n index_of_input_dim1 = index_of_dim1 / scales[1];\\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\\n\\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\\n\\n float x00 = getInputFloat(input_index);\\n float x10, x01, x11;\\n\\n bool end_of_dim0 = false;\\n if (index_of_input_dim0 == (${e[0].dims[0]} - 1)) {\\n // It's the end in dimension 0\\n x01 = x00;\\n end_of_dim0 = true;\\n } else {\\n x01 = getInputFloat(input_index + input_pitches[0]);\\n }\\n\\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\\n // It's the end in dimension 1\\n x10 = x00;\\n x11 = x01;\\n }\\n else {\\n x10 = getInputFloat(input_index + 1);\\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\\n }\\n\\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\\n }`;return Object.assign(Object.assign({},a),{output:{dims:c,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,variables:[{name:\"scales\",type:\"int\",arrayLength:n.scales.length,data:n.scales.map((t=>Math.ceil(t)))}]})};e.validateInputs=(t,e)=>{if(!t||e.opset<9&&1!==t.length||e.opset>=9&&e.opset<11&&2!==t.length||e.opset>=11&&t.length<2)throw new Error(\"invalid inputs.\");if(e.scales.length>0&&t[0].dims.length!==e.scales.length)throw new Error(\"Invalid input shape.\");if(\"string\"===t[0].type)throw new Error(\"Invalid input tensor types.\")},e.scalesValidation=(t,e,n)=>{if(n){for(const e of t)if(e<=0)throw new Error(\"Scale value should be greater than 0.\")}else for(const e of t)if(e<1)throw new Error(\"Scale value should be greater than or equal to 1.\");if(!(\"linear\"!==e&&\"cubic\"!==e||2===t.length||4===t.length&&1===t[0]&&1===t[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?\"Resize\":\"Upsample\"} opeartor.`)}},1958:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ProgramManager=void 0;const r=n(1670),i=n(6231),o=n(8879),a=n(5060);e.ProgramManager=class{constructor(t,e,n){this.profiler=t,this.glContext=e,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(t){return this.repo.get(t)}setArtifact(t,e){this.repo.set(t,e)}run(t,e,n){var r;this.profiler.event(\"op\",`ProgramManager.run ${null!==(r=t.programInfo.name)&&void 0!==r?r:\"unknown kernel\"}`,(()=>{var r;const o=this.glContext.gl,a=t.program;o.useProgram(a);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(t.attribLocations),this.bindUniforms(t.uniformLocations,null!==(r=t.programInfo.variables)&&void 0!==r?r:[],e)}catch(e){throw i.Logger.error(\"ProgramManager\",t.programInfo.shaderSource),e}this.profiler.event(\"backend\",\"GlContext.draw()\",(()=>{this.glContext.draw()}))}),this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((t=>this.glContext.deleteProgram(t.program)))}build(t,e,n){return this.profiler.event(\"backend\",\"ProgramManager.build\",(()=>{const r=new o.GlslPreprocessor(this.glContext,t,e,n),i=r.preprocess(),a=this.compile(i);return{programInfo:t,program:a,uniformLocations:this.getUniformLocations(a,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(a)}}))}compile(t){if(!this.vertexShader){i.Logger.verbose(\"ProrgramManager\",\"Compiling and caching Vertex shader for the first time\");const t=(0,a.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(t,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&i.Logger.verbose(\"ProrgramManager\",`FragShader:\\n${t}\\n`);const e=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,e);return this.glContext.deleteShader(e),n}bindOutput(t){const e=t.width,n=t.height;i.Logger.verbose(\"ProrgramManager\",`Binding output texture to Framebuffer: w/h=${e}/${n}, shape=${t.shape}, type=${t.tensor.type}`),this.glContext.attachFramebuffer(t.texture,e,n)}bindAttributes(t){const e=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(e,n),this.attributesBound=!0}bindUniforms(t,e,n){var r;const i=this.glContext.gl;let o=0;for(const{name:a,type:s,location:u,arrayLength:c}of t){const t=null===(r=e.find((t=>t.name===a)))||void 0===r?void 0:r.data;if(\"sampler2D\"!==s&&!t)throw new Error(`variable '${a}' does not have data defined in program info`);switch(s){case\"sampler2D\":this.bindTexture(n[o],u,o),o++;break;case\"float\":c?i.uniform1fv(u,t):i.uniform1f(u,t);break;case\"int\":c?i.uniform1iv(u,t):i.uniform1i(u,t);break;default:throw new Error(`Uniform not implemented: ${s}`)}}}bindTexture(t,e,n){this.glContext.bindTextureToUniform(t.texture,n,e)}getAttribLocations(t){return{position:this.getAttribLocation(t,\"position\"),textureCoord:this.getAttribLocation(t,\"textureCoord\")}}getUniformLocations(t,e,n){const r=[];if(e)for(const n of e)r.push({name:n,type:\"sampler2D\",location:this.getUniformLocation(t,n)});if(n)for(const e of n)r.push(Object.assign(Object.assign({},e),{location:this.getUniformLocation(t,e.name)}));return r}getUniformLocation(t,e){const n=this.glContext.gl.getUniformLocation(t,e);if(null===n)throw new Error(`Uniform ${e} not found.`);return n}getAttribLocation(t,e){return this.glContext.gl.getAttribLocation(t,e)}}},6416:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLSessionHandler=void 0;const r=n(6231),i=n(1047),o=n(8316),a=n(1640),s=n(1958),u=n(7859),c=n(5702);e.WebGLSessionHandler=class{constructor(t,e){this.backend=t,this.context=e,this.layoutStrategy=new u.PreferLogicalStrategy(t.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:\"full\"===t.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new o.WebGLInferenceHandler(this)}onGraphInitialized(t){const e=t.getValues().filter((t=>-1===t.from&&t.tensor)).map((t=>t.tensor.dataId));this.initializers=new Set(e)}isInitializer(t){return!!this.initializers&&this.initializers.has(t)}addInitializer(t){this.initializers.add(t)}getTextureData(t,e){return e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){r.Logger.verbose(\"WebGLSessionHandler\",\"Storing Texture data in cache\"),n?this.packedTextureDataCache.set(t,e):this.unpackedTextureDataCache.set(t,e)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.unpackedTextureDataCache=new Map}resolve(t,e,n){const r=(0,i.resolveOperator)(t,e,a.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(t,n):t}}}},7769:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;const r=n(6231);e.RedFloat32DataEncoder=class{constructor(t,e=1){if(1===e)this.internalFormat=t.R32F,this.format=t.RED,this.textureType=t.FLOAT,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA32F,this.format=t.RGBA,this.textureType=t.FLOAT,this.channelSize=e}}encode(t,e){let n,i;return t.constructor!==Float32Array&&(r.Logger.warning(\"Encoder\",\"data was not of type Float32; creating new Float32Array\"),i=new Float32Array(t)),e*this.channelSize>t.length?(r.Logger.warning(\"Encoder\",\"Source data too small. Allocating larger array\"),i=t,n=this.allocate(e*this.channelSize),i.forEach(((t,e)=>n[e]=t))):(i=t,n=i),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.RGBAFloatDataEncoder=class{constructor(t,e=1,n){if(1!==e&&4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.channelSize=e,this.textureType=n||t.FLOAT}encode(t,e){let n=t;return 1===this.channelSize&&(r.Logger.verbose(\"Encoder\",\"Exploding into a larger array\"),n=this.allocate(e),t.forEach(((t,e)=>n[4*e]=t))),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.Uint8DataEncoder=class{constructor(t,e=1){if(this.channelSize=4,1===e)this.internalFormat=t.ALPHA,this.format=t.ALPHA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e}}encode(t,e){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}allocate(t){return new Uint8Array(t*this.channelSize)}decode(t,e){if(t instanceof Uint8Array)return t.subarray(0,e);throw new Error(`Invalid array type: ${t.constructor}`)}}},7859:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),i=n(2517);function o(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,o=null==e||i?null:a(e,t).sort();let s=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),r.push(e)),o[s]<=e&&s++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}}function a(t,e){const n=e.length;return t=null==t?e.map(((t,e)=>e)):[].concat(t),(0,i.assert)(t.every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),(0,i.assert)(t.every(s),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function s(t){return t%1==0}function u(t){if(0===t.length)return 1;let e=t[0];for(let n=1;n=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(i>n||o>n))return[i,o];r.Logger.verbose(\"TextureLayout\",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}const i=t.reduce(((t,e)=>t*e));let o=Math.floor(Math.sqrt(i));for(;o=n||i%o!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${t}`);return[o,i/o]}},e.PreferLogicalStrategy=class{constructor(t){this.maxTextureSize=t}computeTextureWH(t,e){const n=this.computeTexture(t,e);return e&&e.isPacked&&(n[0]/=2,n[1]/=2),e&&e.reverseWH?[n[1],n[0]]:n}computeTexture(t,e){const n=e&&e.isPacked;if(0===t.length)return n?[2,2]:[1,1];let i=this.maxTextureSize;if(e&&void 0!==e.breakAxis){const n=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(n>i||o>i))return[n,o];r.Logger.verbose(\"TextureLayout\",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}let a=t.slice(0);if(n&&(i*=2,a=a.map(((t,e)=>e>=a.length-2?a[e]%2==0?a[e]:a[e]+1:a[e])),1===a.length&&(a=[2,a[0]])),2!==a.length){const t=o(a);a=t.newShape}const s=u(a);return a.length<=1&&s<=i?[1,s]:2===a.length&&a[0]<=i&&a[1]<=i?a:3===a.length&&a[0]*a[1]<=i&&a[2]<=i?[a[0]*a[1],a[2]]:3===a.length&&a[0]<=i&&a[1]*a[2]<=i?[a[0],a[1]*a[2]]:4===a.length&&a[0]*a[1]*a[2]<=i&&a[3]<=i?[a[0]*a[1]*a[2],a[3]]:4===a.length&&a[0]<=i&&a[1]*a[2]*a[3]<=i?[a[0],a[1]*a[2]*a[3]]:n?c(s/4).map((t=>2*t)):c(s)}},e.squeezeShape=o,e.parseAxisParam=a,e.isInt=s,e.sizeFromShape=u,e.getRowsCols=function(t){if(0===t.length)throw Error(\"Cannot get rows and columns of an empty shape array.\");return[t.length>1?t[t.length-2]:1,t[t.length-1]]},e.sizeToSquarishShape=c,e.getBatchDim=function(t,e=2){return u(t.slice(0,t.length-e))}},4057:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;const r=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=(t,n,r)=>{const o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,a=r===i.TextureType.packed,s=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,c=r===i.TextureType.packedLastDimension?n.map(((t,e)=>e===n.length-1?4*t:t)):void 0;return(0,e.createTextureLayoutFromShape)(t,n,o,c,{isPacked:a,reverseWH:s,breakAxis:u})},e.calculateTextureWidthAndHeight=(t,n,r)=>{const i=(0,e.createTextureLayoutFromTextureType)(t,n,r);return[i.width,i.height]},e.createTextureLayoutFromShape=(t,e,n=1,i,o)=>{const a=!(!o||!o.isPacked),[s,u]=t.computeTextureWH(a&&i||e,o),c=e.length;let l=e.slice(0);if(0===c&&(l=[1]),1===n)i=e;else if(a){if(4!==n)throw new Error(\"a packed texture must be 4-channel\");i=e,c>0&&(l[c-1]=Math.ceil(l[c-1]/2)),c>1&&(l[c-2]=Math.ceil(l[c-2]/2))}else if(!i)throw new Error(\"Unpacked shape is needed when using channels > 1\");return{width:s,height:u,channels:n,isPacked:a,shape:l,strides:r.ShapeUtil.computeStrides(l),unpackedShape:i,reversedWH:o&&o.reverseWH}}},5702:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.TextureManager=void 0;const r=n(6231);e.TextureManager=class{constructor(t,e,n,r){this.glContext=t,this.layoutStrategy=e,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(t,e,n,i){const o=this.toEncoderType(t),a=this.glContext.getEncoder(o,e.channels||1,i);if(e.isPacked&&1===i)throw new Error(\"not implemented\");const s=e.width,u=e.height;let c,l;if(this.config.reuseTextures){c=`${s}x${u}_${a.format}_${a.internalFormat}_${a.textureType}`,l=this.inUseTextures.get(c),l||(l=[],this.inUseTextures.set(c,l));const e=this.idleTextures.get(c);if(e&&e.length>0){const r=e.pop();return l.push(r),1===i&&this.glContext.updateTexture(r,s,u,a,this.toTextureData(t,n)),r}}r.Logger.verbose(\"TextureManager\",`Creating new texture of size ${e.width}x${e.height}`);const p=this.glContext.allocateTexture(s,u,a,this.toTextureData(t,n));return this.config.reuseTextures&&(l.push(p),this.textureLookup.set(p,c)),p}readTexture(t,e,n){return n||(n=1),this.profiler.event(\"backend\",\"TextureManager.readTexture\",(()=>{const r=t.shape.reduce(((t,e)=>t*e))*n,i=this.glContext.readTexture(t.texture,t.width,t.height,r,this.toEncoderType(e),n);return this.toTensorData(e,i)}))}async readTextureAsync(t,e,n){const r=t.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const t=this.pendingRead.get(r);return new Promise((e=>null==t?void 0:t.push(e)))}return this.profiler.event(\"backend\",\"TextureManager.readTextureAsync\",(async()=>{this.pendingRead.set(r,[]);const i=t.shape.reduce(((t,e)=>t*e))*n;await this.glContext.createAndWaitForFence();const o=this.glContext.readTexture(t.texture,t.width,t.height,i,this.toEncoderType(e),n),a=this.toTensorData(e,o),s=this.pendingRead.get(r);return this.pendingRead.delete(r),null==s||s.forEach((t=>t(a))),a}))}readUint8TextureAsFloat(t){return this.profiler.event(\"backend\",\"TextureManager.readUint8TextureAsFloat\",(()=>{const e=t.shape.reduce(((t,e)=>t*e)),n=this.glContext.readTexture(t.texture,t.width,t.height,4*e,\"byte\",4);return new Float32Array(n.buffer,n.byteOffset,e)}))}releaseTexture(t,e){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture),n)){e&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const e=r.indexOf(t.texture);if(-1!==e){r.splice(e,1);let i=this.idleTextures.get(n);i||(i=[],this.idleTextures.set(n,i)),i.push(t.texture)}}}n&&!e||(r.Logger.verbose(\"TextureManager\",`Deleting texture of size ${t.width}x${t.height}`),this.glContext.deleteTexture(t.texture))}toTensorData(t,e){switch(t){case\"int16\":return e instanceof Int16Array?e:Int16Array.from(e);case\"int32\":return e instanceof Int32Array?e:Int32Array.from(e);case\"int8\":return e instanceof Int8Array?e:Int8Array.from(e);case\"uint16\":return e instanceof Uint16Array?e:Uint16Array.from(e);case\"uint32\":return e instanceof Uint32Array?e:Uint32Array.from(e);case\"uint8\":case\"bool\":return e instanceof Uint8Array?e:Uint8Array.from(e);case\"float32\":return e instanceof Float32Array?e:Float32Array.from(e);case\"float64\":return e instanceof Float64Array?e:Float64Array.from(e);default:throw new Error(`TensorData type ${t} is not supported`)}}toTextureData(t,e){if(e)return e instanceof Float32Array?e:new Float32Array(e)}toEncoderType(t){return\"float\"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(t,e)=>{\"use strict\";var n;Object.defineProperty(e,\"__esModule\",{value:!0}),e.TextureType=void 0,(n=e.TextureType||(e.TextureType={}))[n.unpacked=0]=\"unpacked\",n[n.unpackedReversed=1]=\"unpackedReversed\",n[n.packed=2]=\"packed\",n[n.downloadUint8AsFloat=3]=\"downloadUint8AsFloat\",n[n.packedLastDimension=4]=\"packedLastDimension\"},9390:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;const r=n(2517);e.getPackedShape=function(t){const e=t.length;return t.slice(0,e-1).concat(t[e-1]/4)},e.repeatedTry=async function(t,e=(t=>0),n){return new Promise(((r,i)=>{let o=0;const a=()=>{if(t())return void r();o++;const s=e(o);null!=n&&o>=n?i():setTimeout(a,s)};a()}))},e.generateShaderFuncNameFromInputSamplerName=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>\"empty string found for sampler name\")),\"get\"+t.charAt(0).toUpperCase()+t.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>\"empty string found for sampler name\")),\"get\"+t.charAt(0).toUpperCase()+t.slice(1)+\"AtOutCoords\"},e.squeezeInputShape=function(t,e){let n=JSON.parse(JSON.stringify(t));return n=e,n},e.getSqueezedParams=function(t,e){return e.map((e=>t[e])).join(\", \")},e.getCoordsDataType=function(t){if(t<=1)return\"int\";if(2===t)return\"ivec2\";if(3===t)return\"ivec3\";if(4===t)return\"ivec4\";if(5===t)return\"ivec5\";if(6===t)return\"ivec6\";throw Error(`GPU for rank ${t} is not yet supported`)},e.getGlChannels=function(t=6){return[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"].slice(0,t)}},7305:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;const r=n(6231),i=n(1713),o={};function a(t){const e=function(){if(\"undefined\"==typeof document){if(\"undefined\"==typeof OffscreenCanvas)throw new TypeError(\"failed to create canvas: OffscreenCanvas is not supported\");return new OffscreenCanvas(1,1)}const t=document.createElement(\"canvas\");return t.width=1,t.height=1,t}();let n;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t||\"webgl2\"===t)&&(n=e.getContext(\"webgl2\",o),n))try{return new i.WebGLContext(n,2)}catch(t){r.Logger.warning(\"GlContextFactory\",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!t||\"webgl\"===t)&&(n=e.getContext(\"webgl\",o)||e.getContext(\"experimental-webgl\",o),n))try{return new i.WebGLContext(n,1)}catch(t){r.Logger.warning(\"GlContextFactory\",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error(\"WebGL is not supported\")}e.createWebGLContext=function t(e){let n;e&&\"webgl2\"!==e||!(\"webgl2\"in o)?e&&\"webgl\"!==e||!(\"webgl\"in o)||(n=o.webgl):n=o.webgl2,n=n||a(e),e=e||1===n.version?\"webgl\":\"webgl2\";const r=n.gl;return o[e]=n,r.isContextLost()?(delete o[e],t(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},e.createNewWebGLContext=a},1713:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;const a=n(1670),s=o(n(7769)),u=n(9390);function c(t){let e=0;for(;ethis.isTimerResultAvailable(t))),this.getTimerResult(t)}async createAndWaitForFence(){const t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e;const n=t,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),e=null===r?()=>!0:()=>{const t=n.clientWaitSync(r,0,0);return t===n.ALREADY_SIGNALED||t===n.CONDITION_SATISFIED},{query:r,isFencePassed:e}}async pollFence(t){return new Promise((e=>{this.addItemToPoll((()=>t.isFencePassed()),(()=>e()))}))}pollItems(){const t=c(this.itemsToPoll.map((t=>t.isDoneFn)));for(let e=0;e<=t;++e){const{resolveFn:t}=this.itemsToPoll[e];t()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}async addItemToPoll(t,e){this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||await(0,u.repeatedTry)((()=>(this.pollItems(),0===this.itemsToPoll.length)))}}},1036:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ExecutionPlan=void 0;const r=n(6231);class i{constructor(t,e){this.op=t,this.node=e}}e.ExecutionPlan=class{constructor(t,e,n){this.graph=t,this.profiler=n,this.initialize(e)}initialize(t){this.profiler.event(\"session\",\"ExecutionPlan.initialize\",(()=>{const e=this.graph.getNodes();if(e.length!==t.length)throw new Error(\"The size of nodes and OPs do not match.\");this._ops=t.map(((t,n)=>new i(t,e[n]))),this.reset(),this._starter=[],this._ops.forEach(((t,e)=>{let n=!0;for(const e of t.node.inputs)if(!this._values[e]&&-1===this.graph.getInputIndices().indexOf(e)){n=!1;break}n&&this._starter.push(e)}))}))}reset(){this._values=this.graph.getValues().map((t=>t.tensor))}async execute(t,e){return this.profiler.event(\"session\",\"ExecutionPlan.execute\",(async()=>{this.reset();const n=t.createInferenceHandler(),i=this.graph.getInputIndices();if(e.length!==i.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${e.length} expected: ${i.length}`);e.forEach(((t,e)=>{const n=i[e];this._values[n]=t}));const o=this._starter.slice(0),a=this.graph.getValues(),s=this.graph.getNodes();let u=0;for(;uthis._values[t]));if(-1!==i.indexOf(void 0))throw new Error(`unresolved input detected: op: ${e.node}`);const c=i;r.Logger.verbose(\"ExecPlan\",`Runing op:${e.node.name} (${c.map(((t,n)=>`'${e.node.inputs[n]}': ${t.type}[${t.dims.join(\",\")}]`)).join(\", \")})`);const l=await this.profiler.event(\"node\",e.node.name,(async()=>e.op.impl(n,c,e.op.context)));if(l.length!==e.node.outputs.length)throw new Error(\"the size of output does not match model definition.\");l.forEach(((t,n)=>{const r=e.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${e.node.name}`);this._values[r]=t}));const p=new Set;l.forEach(((t,n)=>{const r=e.node.outputs[n];for(const t of a[r].to){const e=s[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&p.add(t)}})),o.push(...p)}const c=[];for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Graph=void 0;const r=n(1446),i=n(7778),o=n(9395),a=n(9162),s=n(2517);var u=o.onnxruntime.experimental.fbs;e.Graph={from:(t,e)=>new p(t,e)};class c{constructor(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(t.type.tensorType))}get from(){return this._from}get to(){return this._to}}class l{constructor(t,e){t instanceof r.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new i.Attribute(t.attribute)):t instanceof u.Node&&(this.name=null!=e?e:t.name(),this.opType=t.opType(),this.attributes=new i.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class p{constructor(t,e){if(!t)throw new TypeError(\"graph is empty\");this.buildGraph(t),this.transformGraph(e),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(t){if(t instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else{if(!(t instanceof u.Graph))throw new TypeError(\"Graph type is not supported.\");this.buildGraphFromOrtFormat(t)}}buildGraphFromOnnxFormat(t){const e=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!t.input)throw new Error(\"missing information in graph: input\");const r=[];for(const n of t.input){if(e.has(n.name))throw new Error(`duplicated input name: ${n.name}`);const t=this._allData.push(new c(n))-1;e.set(n.name,t),r.push(n.name)}if(!t.initializer)throw new Error(\"missing information in graph: initializer\");for(const n of t.initializer){let t=e.get(n.name);if(void 0===t){const r=new c;r.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(n.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(n.dataType)},t=this._allData.push(r)-1,e.set(n.name,t)}this._allData[t]._from=-1,this._allData[t].tensor=a.Tensor.fromProto(n)}for(let t=0;t{this._allData[e]._to.forEach((e=>{t.add(e)}))}));const e=Array.from(t),n=new Array(this._nodes.length).fill(\"white\");for(;e.length>0;){const t=e.pop();\"gray\"===n[t]?n[t]=\"black\":(e.push(t),n[t]=\"gray\",this._nodes[t].outputs.forEach((r=>{const i=this._allData[r];if(void 0!==i.tensor)throw new Error(\"node outputs should not be initialized\");if(i._from!==t)throw new Error(\"from property of the Value object doesn't match index of Node being processed\");i._to.forEach((t=>{if(\"gray\"===n[t])throw new Error(\"model graph is cyclic\");\"white\"===n[t]&&e.push(t)}))})))}}transformGraph(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let t=0;for(let e=0;e0&&(this._nodes[e].inputs.forEach((n=>{const r=this._allData[n]._to.indexOf(e+t);-1!==r&&(this._allData[n]._to[r]=e)})),this._nodes[e].outputs.forEach((n=>{this._allData[n]._from&&this._allData[n]._from===e+t&&(this._allData[n]._from=e)}))):(t++,this._nodes[e].outputs.forEach((t=>{this._allData[t]._from=-2})),this._nodes.splice(e,1),e--);t=0;for(let e=0;e0){let n=-1;void 0!==this._allData[e].from&&-1!==this._allData[e].from?(n=this._nodes[this._allData[e].from].outputs.indexOf(e+t),-1!==n&&(this._nodes[this._allData[e].from].outputs[n]=e)):(n=this._allInputIndices.indexOf(e+t),-1!==n&&(this._allInputIndices[n]=e)),this._allData[e].to.forEach((r=>{n=this._nodes[r].inputs.indexOf(e+t),-1!==n&&(this._nodes[r].inputs[n]=e)})),0===this._allData[e].to.length&&(n=this._allOutputIndices.indexOf(e+t),-1!==n&&(this._allOutputIndices[n]=e))}}else t++,this._allData.splice(e,1),e--}deleteNode(t){const e=this._nodes[t];if(e.outputs.length>1)for(let t=1;t0)throw new Error(\"Node deletion with more than one output connected to other nodes is not supported. \");e.executeNode=!1;const n=e.inputs[0],r=e.outputs[0],i=this._allData[r].to,o=this._allData[n].to.indexOf(t);if(-1===o)throw new Error(\"The Value object doesn't have the current Node in it's 'to' property \");this._allData[n].to.splice(o,1),this._allData[r]._to=[];const a=this._allOutputIndices.indexOf(r);if(-1!==a&&(this._allOutputIndices[a]=n),i&&i.length>0)for(const t of i){const e=this._nodes[t].inputs.indexOf(r);if(-1===e)throw new Error(\"The Node object doesn't have the output Value in it's 'inputs' property \");this._nodes[t].inputs[e]=n,this._allData[n].to.push(t)}}removeAllDropoutNodes(){let t=0;for(const e of this._nodes){if(\"Dropout\"===e.opType){if(1!==e.inputs.length)throw new Error(\"Dropout nodes should only contain one input. \");if(1!==e.outputs.length&&2!==e.outputs.length)throw new Error(\"Dropout nodes should contain either 1 or 2 output(s)\");if(2===e.outputs.length&&0!==this._allData[e.outputs[1]]._to.length)throw new Error(\"Dropout nodes's second output should not be referenced by other nodes\");this.deleteNode(t)}t++}}removeAllIdentityNodes(){let t=0;for(const e of this._nodes)\"Identity\"===e.opType&&this.deleteNode(t),t++}isActivation(t){switch(t.opType){case\"Relu\":case\"Sigmoid\":case\"Clip\":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if(\"Conv\"===t.opType){const e=this._allData[t.outputs[0]]._to;if(1===e.length&&this.isActivation(this._nodes[e[0]])){const n=this._nodes[e[0]];if(\"Clip\"===n.opType)if(1===n.inputs.length)try{t.attributes.set(\"activation_params\",\"floats\",[n.attributes.getFloat(\"min\"),n.attributes.getFloat(\"max\")])}catch(e){t.attributes.set(\"activation_params\",\"floats\",[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(n.inputs.length>=3&&void 0!==this._allData[n.inputs[1]].tensor&&void 0!==this._allData[n.inputs[2]].tensor))continue;t.attributes.set(\"activation_params\",\"floats\",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]])}t.attributes.set(\"activation\",\"string\",n.opType),this.deleteNode(e[0])}}}}},6231:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.now=e.Profiler=e.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(t,e,n){}},console:new class{log(t,e,n){console.log(`${this.color(t)} ${n?\"\u001b[35m\"+n+\"\u001b[0m \":\"\"}${e}`)}color(t){switch(t){case\"verbose\":return\"\u001b[34;40mv\u001b[0m\";case\"info\":return\"\u001b[32mi\u001b[0m\";case\"warning\":return\"\u001b[30;43mw\u001b[0m\";case\"error\":return\"\u001b[31;40me\u001b[0m\";case\"fatal\":return\"\u001b[101mf\u001b[0m\";default:throw new Error(`unsupported severity: ${t}`)}}}},i={provider:\"console\",minimalSeverity:\"warning\",logDateTime:!0,logSourceLocation:!1};let o={\"\":i};function a(t,e,n,r){if(void 0===e)return i=t,{verbose:a.verbose.bind(null,i),info:a.info.bind(null,i),warning:a.warning.bind(null,i),error:a.error.bind(null,i),fatal:a.fatal.bind(null,i)};if(void 0===n)s(t,e);else if(\"number\"==typeof n&&void 0===r)s(t,e);else if(\"string\"==typeof n&&void 0===r)s(t,n,0,e);else{if(\"string\"!=typeof n||\"number\"!=typeof r)throw new TypeError(\"input is valid\");s(t,n,0,e)}var i}function s(t,e,i,a){const s=o[a||\"\"]||o[\"\"];n[t]{a.then((async e=>{i&&await i.end(),t(e)}),(async t=>{i&&await i.end(),e(t)}))}));if(!o&&i){const t=i.end();if(t&&\"function\"==typeof t.then)return new Promise(((e,n)=>{t.then((()=>{e(a)}),(t=>{n(t)}))}))}return a}begin(t,n,r){if(!this._started)throw new Error(\"profiler is not started yet\");if(void 0===r){const r=(0,e.now)();return this.flush(r),new u(t,n,r,(t=>this.endSync(t)))}{const e=r.beginTimer();return new u(t,n,0,(async t=>this.end(t)),e,r)}}async end(t){const e=await t.checkTimer();this._timingEvents.length=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Model=void 0;const r=n(5686),i=n(1446),o=n(7070),a=n(9395),s=n(2517);var u=a.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(t,e,n){if(!n)try{return void this.loadFromOnnxFormat(t,e)}catch(t){if(void 0!==n)throw t}this.loadFromOrtFormat(t,e)}loadFromOnnxFormat(t,e){const n=i.onnx.ModelProto.decode(t);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error(\"only support ONNX model with IR_VERSION>=3\");this._opsets=n.opsetImport.map((t=>({domain:t.domain,version:s.LongUtil.longToNumber(t.version)}))),this._graph=o.Graph.from(n.graph,e)}loadFromOrtFormat(t,e){const n=new r.flatbuffers.ByteBuffer(t),i=u.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(i.irVersion())<3)throw new Error(\"only support ONNX model with IR_VERSION>=3\");this._opsets=[];for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=[\"float32\",\"float64\",\"int32\",\"int16\",\"int8\",\"uint16\",\"uint32\",\"uint8\"],e.INT_TYPES=[\"int32\",\"int16\",\"int8\",\"uint16\",\"uint32\",\"uint8\"],e.FLOAT_TYPES=[\"float32\",\"float64\"]},1047:(t,e)=>{\"use strict\";function n(t,e){if(e.endsWith(\"+\")){const n=Number.parseInt(e.substring(0,e.length-1),10);return!isNaN(n)&&n<=t}if(2===e.split(\"-\").length){const n=e.split(\"-\"),r=Number.parseInt(n[0],10),i=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(i)&&r<=t&&t<=i}return Number.parseInt(e,10)===t}Object.defineProperty(e,\"__esModule\",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t,e,r){for(const i of r){const r=i[0],o=i[1],a=i[2],s=i[3],u=i[4];if(t.opType===r)for(const t of e)if((t.domain===o||\"ai.onnx\"===t.domain&&\"\"===o)&&n(t.version,a))return{opImpl:s,opInit:u}}throw new TypeError(`cannot resolve operator '${t.opType}' with opsets: ${e.map((t=>`${t.domain||\"ai.onnx\"} v${t.version}`)).join(\", \")}`)}},9395:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.onnxruntime=void 0;const r=n(5686);var i,o;i=e.onnxruntime||(e.onnxruntime={}),function(t){let e;!function(t){t[t.UNDEFINED=0]=\"UNDEFINED\",t[t.FLOAT=1]=\"FLOAT\",t[t.INT=2]=\"INT\",t[t.STRING=3]=\"STRING\",t[t.TENSOR=4]=\"TENSOR\",t[t.GRAPH=5]=\"GRAPH\",t[t.FLOATS=6]=\"FLOATS\",t[t.INTS=7]=\"INTS\",t[t.STRINGS=8]=\"STRINGS\",t[t.TENSORS=9]=\"TENSORS\",t[t.GRAPHS=10]=\"GRAPHS\",t[t.SPARSE_TENSOR=11]=\"SPARSE_TENSOR\",t[t.SPARSE_TENSORS=12]=\"SPARSE_TENSORS\"}(e=t.AttributeType||(t.AttributeType={}))}((o=i.experimental||(i.experimental={})).fbs||(o.fbs={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNKNOWN=0]=\"UNKNOWN\",t[t.VALUE=1]=\"VALUE\",t[t.PARAM=2]=\"PARAM\"}(e=t.DimensionValueType||(t.DimensionValueType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNDEFINED=0]=\"UNDEFINED\",t[t.FLOAT=1]=\"FLOAT\",t[t.UINT8=2]=\"UINT8\",t[t.INT8=3]=\"INT8\",t[t.UINT16=4]=\"UINT16\",t[t.INT16=5]=\"INT16\",t[t.INT32=6]=\"INT32\",t[t.INT64=7]=\"INT64\",t[t.STRING=8]=\"STRING\",t[t.BOOL=9]=\"BOOL\",t[t.FLOAT16=10]=\"FLOAT16\",t[t.DOUBLE=11]=\"DOUBLE\",t[t.UINT32=12]=\"UINT32\",t[t.UINT64=13]=\"UINT64\",t[t.COMPLEX64=14]=\"COMPLEX64\",t[t.COMPLEX128=15]=\"COMPLEX128\",t[t.BFLOAT16=16]=\"BFLOAT16\"}(e=t.TensorDataType||(t.TensorDataType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.Primitive=0]=\"Primitive\",t[t.Fused=1]=\"Fused\"}(e=t.NodeType||(t.NodeType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]=\"NONE\",t[t.tensor_type=1]=\"tensor_type\",t[t.sequence_type=2]=\"sequence_type\",t[t.map_type=3]=\"map_type\"}(e=t.TypeInfoValue||(t.TypeInfoValue={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dim(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return n.startShape(t),n.addDim(t,e),n.endShape(t)}}e.Shape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}value(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,r){return n.startDimension(t),n.addValue(t,e),n.addDenotation(t,r),n.endDimension(t)}}e.Dimension=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):t.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(e,n){e.addFieldInt8(0,n,t.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,r,i){return n.startDimensionValue(t),n.addDimType(t,e),n.addDimValue(t,r),n.addDimParam(t,i),n.endDimensionValue(t)}}e.DimensionValue=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}shape(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,r){return n.startTensorTypeAndShape(t),n.addElemType(t,e),n.addShape(t,r),n.endTensorTypeAndShape(t)}}e.TensorTypeAndShape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}valueType(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,r){return n.startMapType(t),n.addKeyType(t,e),n.addValueType(t,r),n.endMapType(t)}}e.MapType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return n.startSequenceType(t),n.addElemType(t,e),n.endSequenceType(t)}}e.SequenceType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){(t.fbs||(t.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(t,e,n,r){return t.prep(4,12),t.writeInt32(r),t.writeInt32(n),t.writeInt32(e),t.offset()}}}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,r,i){return n.startNodeEdge(t),n.addNodeIndex(t,e),n.addInputEdges(t,r),n.addOutputEdges(t,i),n.endNodeEdge(t)}}e.NodeEdge=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(e,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(e,n){e.addFieldInt32(6,n,t.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,r,i,o,a,s,u,c,l,p,f,d,h){return n.startNode(t),n.addName(t,e),n.addDocString(t,r),n.addDomain(t,i),n.addSinceVersion(t,o),n.addIndex(t,a),n.addOpType(t,s),n.addType(t,u),n.addExecutionProviderType(t,c),n.addInputs(t,l),n.addOutputs(t,p),n.addAttributes(t,f),n.addInputArgCounts(t,d),n.addImplicitInputs(t,h),n.endNode(t)}}e.Node=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,r,i){return n.startValueInfo(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.endValueInfo(t)}}e.ValueInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(e,n){e.addFieldInt8(1,n,t.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,r,i){return n.startTypeInfo(t),n.addDenotation(t,e),n.addValueType(t,r),n.addValue(t,i),n.endTypeInfo(t)}}e.TypeInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,n,r){return e.startOperatorSetId(t),e.addDomain(t,n),e.addVersion(t,r),e.endOperatorSetId(t)}}t.OperatorSetId=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(e,n){e.addFieldInt32(3,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,r,i,o,a,s){return n.startTensor(t),n.addName(t,e),n.addDocString(t,r),n.addDims(t,i),n.addDataType(t,o),n.addRawData(t,a),n.addStringData(t,s),n.endTensor(t)}}e.Tensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}values(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,r,i){return n.startSparseTensor(t),n.addValues(t,e),n.addIndices(t,r),n.addDims(t,i),n.endSparseTensor(t)}}e.SparseTensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(e){let n=this.bb.__offset(this.bb_pos,16);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(e,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(e,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(e,n){e.addFieldInt32(2,n,t.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,r,i,o,a,s,u,c,l,p,f,d,h){return n.startAttribute(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.addF(t,o),n.addI(t,a),n.addS(t,s),n.addT(t,u),n.addG(t,c),n.addFloats(t,l),n.addInts(t,p),n.addStrings(t,f),n.addTensors(t,d),n.addGraphs(t,h),n.endAttribute(t)}}e.Attribute=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}initializers(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(e,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(e,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,r,i,o,a,s,u,c){return n.startGraph(t),n.addInitializers(t,e),n.addNodeArgs(t,r),n.addNodes(t,i),n.addMaxNodeIndex(t,o),n.addNodeEdges(t,a),n.addInputs(t,s),n.addOutputs(t,u),n.addSparseInitializers(t,c),n.endGraph(t)}}e.Graph=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,r,i,o,a,s,u,c,l){return n.startModel(t),n.addIrVersion(t,e),n.addOpsetImport(t,r),n.addProducerName(t,i),n.addProducerVersion(t,o),n.addDomain(t,a),n.addModelVersion(t,s),n.addDocString(t,u),n.addGraph(t,c),n.addGraphDocString(t,l),n.endModel(t)}}e.Model=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,n,r){return e.startKernelCreateInfos(t),e.addNodeIndices(t,n),e.addKernelDefHashes(t,r),e.endKernelCreateInfos(t)}}t.KernelCreateInfos=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,r){return n.startSubGraphSessionState(t),n.addGraphId(t,e),n.addSessionState(t,r),n.endSubGraphSessionState(t)}}e.SubGraphSessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}kernels(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,r){return n.startSessionState(t),n.addKernels(t,e),n.addSubGraphSessionStates(t,r),n.endSessionState(t)}}e.SessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"ORTM\")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,\"ORTM\")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,\"ORTM\",!0)}static createInferenceSession(t,e,r,i){return n.startInferenceSession(t),n.addOrtVersion(t,e),n.addModel(t,r),n.addSessionState(t,i),n.endInferenceSession(t)}}e.InferenceSession=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.OnnxjsSessionHandler=void 0;const r=n(1670),i=n(9162);e.OnnxjsSessionHandler=class{constructor(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t,e,n){const o=new Map;for(const e in t)if(Object.hasOwnProperty.call(t,e)){const n=t[e];o.set(e,new i.Tensor(n.dims,n.type,void 0,void 0,n.data))}const a=await this.session.run(o),s={};return a.forEach(((t,e)=>{s[e]=new r.Tensor(t.type,t.data,t.dims)})),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Session=void 0;const r=n(7067),i=n(1296),o=n(7091),a=n(1036),s=n(6231),u=n(2644);e.Session=class{constructor(t={}){this._initialized=!1,this.backendHint=t.backendHint,this.profiler=s.Profiler.create(t.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(t,e,n){await this.profiler.event(\"session\",\"Session.loadModel\",(async()=>{const a=await(0,o.resolveBackend)(this.backendHint);if(this.sessionHandler=a.createSessionHandler(this.context),this._model=new u.Model,\"string\"==typeof t){const e=t.endsWith(\".ort\");if(\"undefined\"==typeof fetch){const n=await(0,i.promisify)(r.readFile)(t);this.initialize(n,e)}else{const n=await fetch(t),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),e)}}else if(ArrayBuffer.isView(t))this.initialize(t);else{const r=new Uint8Array(t,e||0,n||t.byteLength);this.initialize(r)}}))}initialize(t,e){if(this._initialized)throw new Error(\"already initialized\");this.profiler.event(\"session\",\"Session.initialize\",(()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t,n,e),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new a.ExecutionPlan(this._model.graph,this._ops,this.profiler)})),this._initialized=!0}async run(t){if(!this._initialized)throw new Error(\"session not initialized yet\");return this.profiler.event(\"session\",\"Session.run\",(async()=>{const e=this.normalizeAndValidateInputs(t),n=await this._executionPlan.execute(this.sessionHandler,e);return this.createOutput(n)}))}normalizeAndValidateInputs(t){const e=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==e.length)throw new Error(`incorrect input array length: expected ${e.length} but got ${t.length}`)}else{if(t.size!==e.length)throw new Error(`incorrect input map size: expected ${e.length} but got ${t.size}`);const n=new Array(t.size);let r=0;for(let i=0;i\"string\"==typeof t))))throw new TypeError(\"cache should be a string array\");c&&(this.cache=new Array(s))}else{if(void 0!==o){const t=f(e);if(!(o instanceof t))throw new TypeError(`cache should be type ${t.name}`)}if(c){const t=new ArrayBuffer(s*function(t){switch(t){case\"bool\":case\"int8\":case\"uint8\":return 1;case\"int16\":case\"uint16\":return 2;case\"int32\":case\"uint32\":case\"float32\":return 4;case\"float64\":return 8;default:throw new Error(`cannot calculate sizeof() on type ${t}`)}}(e));this.cache=function(t,e){return new(f(e))(t)}(t,e)}}}static fromProto(t){if(!t)throw new Error(\"cannot construct Value from an empty tensor\");const e=u.ProtoUtil.tensorDataTypeFromProto(t.dataType),n=u.ProtoUtil.tensorDimsFromProto(t.dims),r=new l(n,e);if(\"string\"===e)t.stringData.forEach(((t,e)=>{r.data[e]=(0,u.decodeUtf8String)(t)}));else if(t.rawData&&\"number\"==typeof t.rawData.byteLength&&t.rawData.byteLength>0){const e=r.data,n=new DataView(t.rawData.buffer,t.rawData.byteOffset,t.rawData.byteLength),i=p(t.dataType),o=t.rawData.byteLength/i;if(t.rawData.byteLength%i!=0)throw new Error(\"invalid buffer length\");if(e.length!==o)throw new Error(\"buffer length mismatch\");for(let r=0;r0){const e=r.data,n=new DataView(t.rawDataArray().buffer,t.rawDataArray().byteOffset,t.rawDataLength()),i=p(t.dataType()),o=t.rawDataLength()/i;if(t.rawDataLength()%i!=0)throw new Error(\"invalid buffer length\");if(e.length!==o)throw new Error(\"buffer length mismatch\");for(let r=0;r1&&u>1)return;a[o-s]=Math.max(n,u)}return a}static index(t,e){const n=new Array(e.length);return c.fillIndex(t,e,n),n}static fillIndex(t,e,n){const r=t.length-e.length;for(let i=0;i=0;t--)r[t]=l%o[t],l=Math.floor(l/o[t]);d||(c.fillIndex(r,t.dims,i),p=t.get(i)),h||(c.fillIndex(r,e.dims,s),f=e.get(s)),u.set(r,n(p,f))}}return u}}static isValidBroadcast(t,e){const n=t.length,r=e.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(1!==t[n-i]&&t[n-i]!==e[r-i])return!1;return!0}static getBroadcastDims(t,e){const n=t.length,r=[];for(let i=0;i1&&1===a&&r.unshift(o)}return r}}e.BroadcastUtil=c,e.arrayCopyHelper=function(t,e,n,r,i){if(r<0||r>=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let o=0;oo.default.isLong(t)?t.toNumber():t))}static tensorValueTypeFromProto(t){return{tensorType:l.tensorDataTypeFromProto(t.elemType),shape:{dims:l.tensorDimsFromProto(t.shape.dim.map((t=>t.dimValue)))}}}static tensorDimsFromORTFormat(t){const e=[];for(let n=0;nt.length)throw new Error(`invalid dimension of ${e} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return f.getSizeFromDimensionRange(t,e,t.length)}static sizeToDimension(t,e){if(e<0||e>t.length)throw new Error(`invalid dimension of ${e} for sizeToDimension as Tensor has ${t.length} dimensions.`);return f.getSizeFromDimensionRange(t,0,e)}static getSizeFromDimensionRange(t,e,n){let r=1;for(let i=e;i=0;--r)n[r]=n[r+1]*t[r+1];return n}static transpose(t){return t.slice().reverse()}static indicesToOffset(t,e,n){void 0===n&&(n=t.length);let r=0;for(let i=0;i=e)throw new Error(\"unsupported axis for this operation.\");return t<0?t+e:t}static normalizeAxes(t,e){return t.map((t=>this.normalizeAxis(t,e)))}static incrementIndex(t,e,n){if(0===e.length||0===t.length)throw new Error(\"Index incrementing unsupported for scalar Tensor\");if(void 0===n)n=e.length;else if(n<=0||n>e.length)throw new Error(\"Incorrect axis to increment on\");for(let r=n-1;r>=0&&(t[r]++,!(t[r]=t.length)throw new Error(\"the dimension with value zero exceeds the dimension size of the input tensor\");r[a]=t[a]}else r[a]=e[a];o*=r[a]}}const a=f.size(t);if(-1!==i){if(a%o!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t}] Output shape: [${e}]`);r[i]=a/o}else if(o!==a)throw new Error(\"reshapedDims and originalDims don't have matching sizes\");return r}static sortBasedOnPerm(t,e){return e?e.map((e=>t[e])):t.slice().reverse()}static padShape(t,e){const n=t.length;return t.map(((t,r)=>t+e[r]+e[r+n]))}static areEqual(t,e){return t.length===e.length&&t.every(((t,n)=>t===e[n]))}static validateDimsAndCalcSize(t){if(t.length>6)throw new TypeError(\"Only rank 0 to 6 is supported for tensor shape.\");let e=1;for(const n of t){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);e*=n}return e}static flattenShape(t,e){e<0&&(e+=t.length);const n=t.reduce(((t,e)=>t*e),1),r=t.slice(e).reduce(((t,e)=>t*e),1);return[n/r,r]}static squeezeShape(t,e){const n=new Array;e=f.normalizeAxes(e,t.length);for(let r=0;r=0;if(i&&1!==t[r])throw new Error(\"squeeze an axis of size different than 1\");(0===e.length&&t[r]>1||e.length>0&&!i)&&n.push(t[r])}return n}static unsqueezeShape(t,e){const n=new Array(t.length+e.length);n.fill(0);for(let t=0;t=n.length)throw new Error(\"'axes' has an out of range axis\");if(0!==n[r])throw new Error(\"'axes' has a duplicate axis\");n[r]=1}let r=0;for(let e=0;e=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let o=0;o=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let a=0;a=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let a=0;a=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let o=0;oe.push(n)));const a=h.calcReduceShape(o,e,!0),u=f.size(a),l=new s.Tensor(a,t.type),p=f.computeStrides(a),d=f.computeStrides(o),g=new Array(o.length);for(let n=0;n=e.length)return o(t[i]);const u=e[r],c=u>=n.length?1:f.size(n.slice(u+1));for(let l=0;l0!==t))}}e.ReduceUtil=h;class g{static adjustPoolAttributes(t,e,n,r,i,o){if(!t&&n.length!==e.length-2)throw new Error(\"length of specified kernel shapes should be 2 less than length of input dimensions\");if(t)for(let t=0;t=n.length?n.push(e[t+2]):n[t]=e[t+2];for(let t=0;t=n[t]||o[t+n.length]>=n[t])throw new Error(\"pads should be smaller than kernel\")}}static adjustPadsBasedOnAutoPad(t,e,n,r,i,o){if(o){if(i.length!==2*(t.length-2))throw new Error(\"length of pads should be twice the length of data dimensions\");if(e.length!==t.length-2)throw new Error(\"length of strides should be the length of data dimensions\");if(r.length!==t.length-2)throw new Error(\"length of kernel shapes should be the length of data dimensions\");for(let a=0;a{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,i)=>{if(\"object\"==typeof t&&null!==t){if(r.has(t))throw new Error(\"Circular reference in options\");r.add(t)}Object.entries(t).forEach((([t,o])=>{const a=n?n+t:t;if(\"object\"==typeof o)(0,e.iterateExtraOptions)(o,a+\".\",r,i);else if(\"string\"==typeof o||\"number\"==typeof o)i(a,o.toString());else{if(\"boolean\"!=typeof o)throw new Error(\"Can't handle extra config type: \"+typeof o);i(a,o?\"1\":\"0\")}}))}},2157:function(t,e,n){\"use strict\";var r,i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;const s=n(1670),u=a(n(349)),c=n(6361),l=()=>!!s.env.wasm.proxy&&\"undefined\"!=typeof document;let p,f,d,h=!1,g=!1,b=!1;const m=[],y=[],_=[],v=[],w=[],x=[],T=()=>{if(h||!g||b||!p)throw new Error(\"worker not ready\")},S=t=>{switch(t.data.type){case\"init-wasm\":h=!1,t.data.err?(b=!0,f[1](t.data.err)):(g=!0,f[0]());break;case\"init-ort\":t.data.err?d[1](t.data.err):d[0]();break;case\"create_allocate\":t.data.err?m.shift()[1](t.data.err):m.shift()[0](t.data.out);break;case\"create_finalize\":t.data.err?y.shift()[1](t.data.err):y.shift()[0](t.data.out);break;case\"create\":t.data.err?_.shift()[1](t.data.err):_.shift()[0](t.data.out);break;case\"release\":t.data.err?v.shift()[1](t.data.err):v.shift()[0]();break;case\"run\":t.data.err?w.shift()[1](t.data.err):w.shift()[0](t.data.out);break;case\"end-profiling\":t.data.err?x.shift()[1](t.data.err):x.shift()[0]()}},O=\"undefined\"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;e.initWasm=async()=>{if(l()){if(g)return;if(h)throw new Error(\"multiple calls to 'initWasm()' detected.\");if(b)throw new Error(\"previous call to 'initWasm()' failed.\");return h=!0,void 0===s.env.wasm.wasmPaths&&O&&0!==O.indexOf(\"blob:\")&&(s.env.wasm.wasmPaths=O.substr(0,+O.lastIndexOf(\"/\")+1)),new Promise(((t,e)=>{null==p||p.terminate(),p=n(9710).Z(),p.onmessage=S,f=[t,e];const r={type:\"init-wasm\",in:s.env.wasm};p.postMessage(r)}))}return(0,c.initializeWebAssembly)(s.env.wasm)},e.initOrt=async(t,e)=>{if(l())return T(),new Promise(((n,r)=>{d=[n,r];const i={type:\"init-ort\",in:{numThreads:t,loggingLevel:e}};p.postMessage(i)}));u.initOrt(t,e)},e.createSessionAllocate=async t=>l()?(T(),new Promise(((e,n)=>{m.push([e,n]);const r={type:\"create_allocate\",in:{model:t}};p.postMessage(r,[t.buffer])}))):u.createSessionAllocate(t),e.createSessionFinalize=async(t,e)=>l()?(T(),new Promise(((n,r)=>{y.push([n,r]);const i={type:\"create_finalize\",in:{modeldata:t,options:e}};p.postMessage(i)}))):u.createSessionFinalize(t,e),e.createSession=async(t,e)=>l()?(T(),new Promise(((n,r)=>{_.push([n,r]);const i={type:\"create\",in:{model:t,options:e}};p.postMessage(i,[t.buffer])}))):u.createSession(t,e),e.releaseSession=async t=>{if(l())return T(),new Promise(((e,n)=>{v.push([e,n]);const r={type:\"release\",in:t};p.postMessage(r)}));u.releaseSession(t)},e.run=async(t,e,n,r,i)=>l()?(T(),new Promise(((o,a)=>{w.push([o,a]);const s={type:\"run\",in:{sessionId:t,inputIndices:e,inputs:n,outputIndices:r,options:i}};p.postMessage(s,u.extractTransferableBuffers(n))}))):u.run(t,e,n,r,i),e.endProfiling=async t=>{if(l())return T(),new Promise(((e,n)=>{x.push([e,n]);const r={type:\"end-profiling\",in:t};p.postMessage(r)}));u.endProfiling(t)}},586:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setRunOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setRunOptions=t=>{const e=(0,o.getInstance)();let n=0;const a=[],s=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))s.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(s.terminate=!1);let o=0;if(void 0!==(null==t?void 0:t.tag)&&(o=(0,i.allocWasmString)(t.tag,a)),n=e._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,o),0===n)throw new Error(\"Can't create run options\");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,a),s=(0,i.allocWasmString)(r,a);if(0!==e._OrtAddRunConfigEntry(n,o,s))throw new Error(`Can't set a run config entry: ${t} - ${r}`)})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),a.forEach(e._free),t}}},2306:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),i=n(1670),o=n(2850),a=n(2157);let s;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(t){const e=await fetch(t),n=await e.arrayBuffer();return(0,a.createSessionAllocate)(new Uint8Array(n))}async loadModel(t,e){if(s||(await(0,a.initOrt)(i.env.wasm.numThreads,(t=>{switch(t){case\"verbose\":return 0;case\"info\":return 1;case\"warning\":return 2;case\"error\":return 3;case\"fatal\":return 4;default:throw new Error(`unsupported logging level: ${t}`)}})(i.env.logLevel)),s=!0),\"string\"==typeof t)if(\"undefined\"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(n,e)}else{const n=await this.createSessionAllocate(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSessionFinalize)(n,e)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(t,e)}async dispose(){return(0,a.releaseSession)(this.sessionId)}async run(t,e,n){const r=[],o=[];Object.entries(t).forEach((t=>{const e=t[0],n=t[1],i=this.inputNames.indexOf(e);if(-1===i)throw new Error(`invalid input '${e}'`);r.push(n),o.push(i)}));const s=[];Object.entries(e).forEach((t=>{const e=t[0],n=this.outputNames.indexOf(e);if(-1===n)throw new Error(`invalid output '${e}'`);s.push(n)}));const u=await(0,a.run)(this.sessionId,o,r.map((t=>[t.type,t.dims,t.data])),s,n),c={};for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setSessionOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setSessionOptions=t=>{const e=(0,o.getInstance)();let n=0;const a=[],s=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly=\"1\")})(s);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(s.graphOptimizationLevel=\"all\");const u=(t=>{switch(t){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(s.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(s.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(s.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(s.executionMode=\"sequential\");const c=(t=>{switch(t){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(s.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,i.allocWasmString)(t.logId,a)),void 0===(null==t?void 0:t.logSeverityLevel))s.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(s.enableProfiling=!1),n=e._OrtCreateSessionOptions(u,!!s.enableCpuMemArena,!!s.enableMemPattern,c,!!s.enableProfiling,0,l,s.logSeverityLevel,s.logVerbosityLevel),0===n)throw new Error(\"Can't create session options\");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e=\"string\"==typeof r?r:r.name;switch(e){case\"xnnpack\":e=\"XNNPACK\";break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported EP: ${e}`)}const a=(0,i.allocWasmString)(e,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,a))throw new Error(`Can't append execution provider: ${e}`)}})(n,t.executionProviders,a),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,a),s=(0,i.allocWasmString)(r,a);if(0!==e._OrtAddSessionConfigEntry(n,o,s))throw new Error(`Can't set a session config entry: ${t} - ${r}`)})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),a.forEach(e._free),t}}},4983:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.allocWasmString=void 0;const r=n(6361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),i=n.lengthBytesUTF8(t)+1,o=n._malloc(i);return n.stringToUTF8(t,o,i),e.push(o),o}},349:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),i=n(4919),o=n(4983),a=n(6361);e.initOrt=(t,e)=>{const n=(0,a.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const s=new Map;e.createSessionAllocate=t=>{const e=(0,a.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,a.getInstance)();let r=0,o=0,u=[];try{if([o,u]=(0,i.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],o),0===r)throw new Error(\"Can't create a session\")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(o),u.forEach(n._free)}const c=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),p=[],f=[],d=[],h=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,a.getInstance)(),n=s.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],i=n[1],o=n[2];i.forEach(e._OrtFree),o.forEach(e._OrtFree),e._OrtReleaseSession(r),s.delete(t)};const u=t=>{switch(t){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${t}`)}},c=t=>{switch(t){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case\"float32\":return Float32Array;case\"uint8\":case\"bool\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,i,p)=>{const f=(0,a.getInstance)(),d=s.get(t);if(!d)throw new Error(\"invalid session id\");const h=d[0],g=d[1],b=d[2],m=e.length,y=i.length;let _=0,v=[];const w=[],x=[];try{[_,v]=(0,r.setRunOptions)(p);for(let t=0;tf.HEAP32[t++]=e));const n=f._OrtCreateTensor(u(e),a,s,l,r.length);if(0===n)throw new Error(\"Can't create a tensor\");w.push(n)}finally{f.stackRestore(c)}}const t=f.stackSave(),a=f.stackAlloc(4*m),s=f.stackAlloc(4*m),d=f.stackAlloc(4*y),T=f.stackAlloc(4*y);try{let n=a/4,r=s/4,o=d/4,u=T/4;for(let t=0;tt*e));if(i=c(a),\"string\"===i){const t=[];let e=o/4;for(let n=0;n{const e=(0,a.getInstance)(),n=s.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],i=e._OrtEndProfiling(r);if(0===i)throw new Error(\"Can't get an profile file name\");e._OrtFree(i)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},6361:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const s=o(n(6449)),u=a(n(932)),c=n(3474);let l,p=!1,f=!1,d=!1;const h=(t,e)=>e?t?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-threaded.wasm\":t?\"ort-wasm-simd.wasm\":\"ort-wasm.wasm\";e.initializeWebAssembly=async t=>{if(p)return Promise.resolve();if(f)throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");if(d)throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");f=!0;const e=t.initTimeout,r=t.numThreads,i=t.simd,o=r>1&&(()=>{try{return\"undefined\"!=typeof SharedArrayBuffer&&(\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),a=i&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),g=\"string\"==typeof t.wasmPaths?t.wasmPaths:void 0,b=h(!1,o),m=h(a,o),y=\"object\"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let _=!1;const v=[];if(e>0&&v.push(new Promise((t=>{setTimeout((()=>{_=!0,t()}),e)}))),v.push(new Promise(((t,e)=>{const r=o?c:u.default,i={locateFile:(t,e)=>o&&t.endsWith(\".worker.js\")&&\"undefined\"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:\"text/javascript\"})):t===b?null!=y?y:(null!=g?g:e)+m:e+t};if(o)if(\"undefined\"==typeof Blob)i.mainScriptUrlOrBlob=s.join(\"/\",\"ort-wasm-threaded.js\");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;i.mainScriptUrlOrBlob=new Blob([t],{type:\"text/javascript\"})}r(i).then((e=>{f=!1,p=!0,l=e,t()}),(t=>{f=!1,d=!0,e(t)}))}))),await Promise.race(v),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(p&&l)return l;throw new Error(\"WebAssembly is not initialized yet.\")},e.dispose=()=>{var t;!p||f||d||(f=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,f=!1,p=!1,d=!0)}},9710:(t,e,n)=>{\"use strict\";n.d(e,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*!\\n* ONNX Runtime Web v1.14.0\\n* Copyright (c) Microsoft Corporation. All rights reserved.\\n* Licensed under the MIT License.\\n*/\\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m=\"./this.program\",g=(t,e)=>{throw e},v=\"object\"==typeof window,w=\"function\"==typeof importScripts,_=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A=\"\";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+\"/\":\"//\",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:\"utf8\")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x(\"exiting due to exception: \"+e),process.exit(t)},u.inspect=function(){return\"[Emscripten Module object]\"};try{e=n(925)}catch(t){throw console.error(\\'The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?\\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf(\"blob:\")?A.substr(0,A.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",_||(l=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&\"undefined\"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+\"\\\\n\"),E=t=>h.writeSync(2,t+\"\\\\n\"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&at(\"no native wasm support detected\");var j,k,D,P,U,F,I,W,H=!1,L=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):\"\"}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),_&&console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\"),Error(\"bad memory\");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:\"onAbort\",arg:t}):u.onAbort&&u.onAbort(t),x(t=\"Aborted(\"+t+\")\"),H=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),s(t),t}function it(){return tt.startsWith(\"data:application/octet-stream;base64,\")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){at(t)}}tt=\"ort-wasm-threaded.wasm\",it()||(tt=S(tt));var ut={};function ct(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:\"run\",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),\"unwind\";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\\'Internal error! Worker sent a message \"\\'+r+\\'\" to target pthread \\'+n.targetThread+\", but that thread no longer exists!\")}else\"processProxyingQueue\"===r?zt(n.queue):\"spawnThread\"===r?lt(n):\"cleanupThread\"===r?st(n.thread):\"killThread\"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):\"cancelThread\"===r?ht.Vb[n.thread].postMessage({cmd:\"cancel\"}):\"loaded\"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):\"print\"===r?C(\"Thread \"+n.threadId+\": \"+n.text):\"printErr\"===r?x(\"Thread \"+n.threadId+\": \"+n.text):\"alert\"===r?alert(\"Thread \"+n.threadId+\": \"+n.text):\"setimmediate\"===n.target?t.postMessage(n):\"onAbort\"===r?u.onAbort&&u.onAbort(n.arg):r&&x(\"worker sent an unknown command \"+r);ht.Bc=void 0},t.onerror=t=>{throw x(\"worker sent an error! \"+t.filename+\":\"+t.lineno+\": \"+t.message),t},_&&(t.on(\"message\",(function(e){t.onmessage({data:e})})),t.on(\"error\",(function(e){t.onerror(e)})),t.on(\"detachedExit\",(function(){}))),t.postMessage({cmd:\"load\",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S(\"ort-wasm-threaded.worker.js\");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if(\"undefined\"==typeof SharedArrayBuffer)return x(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc=\"spawnThread\",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\\\(([A-Za-z ]+)\\\\)$/))?t[1]:\"GMT\"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:m||\"./this.program\"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):\"\"},r=Y(r),f={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})r=r.replace(new RegExp(p,\"g\"),f[p]);var h=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),d=\"January February March April May June July August September October November December\".split(\" \");for(p in f={\"%a\":function(t){return h[t.Tb].substring(0,3)},\"%A\":function(t){return h[t.Tb]},\"%b\":function(t){return d[t.ec].substring(0,3)},\"%B\":function(t){return d[t.ec]},\"%C\":function(t){return u((t.Xb+1900)/100|0,2)},\"%d\":function(t){return u(t.jc,2)},\"%e\":function(t){return o(t.jc,2,\" \")},\"%g\":function(t){return l(t).toString().substring(2)},\"%G\":function(t){return l(t)},\"%H\":function(t){return u(t.dc,2)},\"%I\":function(t){return 0==(t=t.dc)?t=12:12t.dc?\"AM\":\"PM\"},\"%S\":function(t){return u(t.Lc,2)},\"%t\":function(){return\"\\\\t\"},\"%u\":function(t){return t.Tb||7},\"%U\":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},\"%V\":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},\"%w\":function(t){return t.Tb},\"%W\":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},\"%y\":function(t){return(t.Xb+1900).toString().substring(2)},\"%Y\":function(t){return t.Xb+1900},\"%z\":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.Mc},\"%%\":function(){return\"%\"}},r=r.replace(/%%/g,\"\\\\0\\\\0\"),f)r.includes(p)&&(r=r.replace(new RegExp(p,\"g\"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\\\0\\\\0/g,\"%\")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x(\"Unexpected exception thrown, this is not properly supported - aborting\"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:\"processProxyingQueue\",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:\"processProxyingQueue\",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at(\"\")},U:function(){if(!_&&!w){var t=\"Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread\";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t=\"warning: \"+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw\"unwind\"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error(\"Cannot find module \\'crypto\\'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at(\"randomDevice\")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if(\"function\"==typeof fetch&&!tt.startsWith(\"file://\"))return fetch(tt,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at \\'\"+tt+\"\\'\";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x(\"failed to asynchronously prepare wasm: \"+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x(\"Module.instantiateWasm callback failed with error: \"+t),!1}(M||\"function\"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith(\"file://\")||_||\"function\"!=typeof fetch?n(e):fetch(tt,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x(\"wasm streaming compile failed: \"+t),x(\"falling back to ArrayBuffer instantiation\"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for(\"function\"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p=\"./this.program\",h=(t,e)=>{throw e},d=\"object\"==typeof window,y=\"function\"==typeof importScripts,b=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,m=\"\";b?(m=y?n(908).dirname(m)+\"/\":\"//\",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:\"utf8\")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&V(\"no native wasm support detected\");var O,A,S,T,E,M,C=!1,x=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):\"\"}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t=\"Aborted(\"+t+\")\"),C=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),a(t),t}function $(){return Y.startsWith(\"data:application/octet-stream;base64,\")}if(Y=\"ort-wasm.wasm\",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){V(t)}}function J(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:p||\"./this.program\"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):\"\"},n=j(n),s={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})n=n.replace(new RegExp(l,\"g\"),s[l]);var f=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),p=\"January February March April May June July August September October November December\".split(\" \");for(l in s={\"%a\":function(t){return f[t.Ab].substring(0,3)},\"%A\":function(t){return f[t.Ab]},\"%b\":function(t){return p[t.Hb].substring(0,3)},\"%B\":function(t){return p[t.Hb]},\"%C\":function(t){return i((t.Cb+1900)/100|0,2)},\"%d\":function(t){return i(t.Kb,2)},\"%e\":function(t){return a(t.Kb,2,\" \")},\"%g\":function(t){return c(t).toString().substring(2)},\"%G\":function(t){return c(t)},\"%H\":function(t){return i(t.Gb,2)},\"%I\":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?\"AM\":\"PM\"},\"%S\":function(t){return i(t.$b,2)},\"%t\":function(){return\"\\\\t\"},\"%u\":function(t){return t.Ab||7},\"%U\":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},\"%V\":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},\"%w\":function(t){return t.Ab},\"%W\":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},\"%y\":function(t){return(t.Cb+1900).toString().substring(2)},\"%Y\":function(t){return t.Cb+1900},\"%z\":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.ac},\"%%\":function(){return\"%\"}},n=n.replace(/%%/g,\"\\\\0\\\\0\"),s)n.includes(l)&&(n=n.replace(new RegExp(l,\"g\"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\\\0\\\\0/g,\"%\")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w(\"Unexpected exception thrown, this is not properly supported - aborting\"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\\\(([A-Za-z ]+)\\\\)$/))?t[1]:\"GMT\"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V(\"\")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error(\"Cannot find module \\'crypto\\'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V(\"randomDevice\")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if(\"function\"==typeof fetch&&!Y.startsWith(\"file://\"))return fetch(Y,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at \\'\"+Y+\"\\'\";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w(\"failed to asynchronously prepare wasm: \"+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w(\"Module.instantiateWasm callback failed with error: \"+t),!1}(g||\"function\"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith(\"file://\")||b||\"function\"!=typeof fetch?r(n):fetch(Y,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w(\"wasm streaming compile failed: \"+t),w(\"falling back to ArrayBuffer instantiation\"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for(\"function\"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if(\"object\"==typeof t&&null!==t){if(r.has(t))throw new Error(\"Circular reference in options\");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if(\"object\"==typeof i)(0,e.iterateExtraOptions)(i,o+\".\",r,a);else if(\"string\"==typeof i||\"number\"==typeof i)a(o,i.toString());else{if(\"boolean\"!=typeof i)throw new Error(\"Can\\'t handle extra config type: \"+typeof i);a(o,i?\"1\":\"0\")}}))}},586:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error(\"Can\\'t create run options\");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly=\"1\")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel=\"all\");const c=(t=>{switch(t){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode=\"sequential\");const s=(t=>{switch(t){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error(\"Can\\'t create session options\");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e=\"string\"==typeof r?r:r.name;switch(e){case\"xnnpack\":e=\"XNNPACK\";break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error(\"Can\\'t create a session\")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case\"float32\":return Float32Array;case\"uint8\":case\"bool\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error(\"invalid session id\");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error(\"Can\\'t create a tensor\");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),\"string\"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error(\"Can\\'t get an profile file name\");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!(\"get\"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-threaded.wasm\":t?\"ort-wasm-simd.wasm\":\"ort-wasm.wasm\";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error(\"multiple calls to \\'initializeWebAssembly()\\' detected.\");if(h)throw new Error(\"previous call to \\'initializeWebAssembly()\\' failed.\");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return\"undefined\"!=typeof SharedArrayBuffer&&(\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y=\"string\"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g=\"object\"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(\".worker.js\")&&\"undefined\"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:\"text/javascript\"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if(\"undefined\"==typeof Blob)a.mainScriptUrlOrBlob=u.join(\"/\",\"ort-wasm-threaded.js\");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:\"text/javascript\"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error(\"WebAssembly is not initialized yet.\")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{\"use strict\";t.exports=\\'\"use strict\";var e={},t=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node;if(t){var r=require(\"worker_threads\"),a=r.parentPort;a.on(\"message\",(e=>onmessage({data:e})));var o=require(\"fs\");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,\"utf8\"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(\" \");t?o.writeSync(2,e+\"\\\\\\\\n\"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if(\"load\"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,\"string\"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if(\"run\"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if(\"unwind\"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else\"cancel\"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):\"setimmediate\"===t.data.target||(\"processProxyingQueue\"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i(\"worker.js received unknown command \"+t.data.cmd),i(t.data)))}catch(t){throw i(\"worker.js onmessage() captured an uncaught exception: \"+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\\\n\\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),(()=>{\"use strict\";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case\"init-wasm\":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:\"init-wasm\"})),(t=>postMessage({type:\"init-wasm\",err:t})));break;case\"init-ort\":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:\"init-ort\"})}catch(t){postMessage({type:\"init-ort\",err:t})}break;case\"create_allocate\":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:\"create_allocate\",out:r})}catch(t){postMessage({type:\"create_allocate\",err:t})}break;case\"create_finalize\":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:\"create_finalize\",out:a})}catch(t){postMessage({type:\"create_finalize\",err:t})}break;case\"create\":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:\"create\",out:a})}catch(t){postMessage({type:\"create\",err:t})}break;case\"release\":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:\"release\"})}catch(t){postMessage({type:\"release\",err:t})}break;case\"run\":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:\"run\",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:\"run\",err:t})}break;case\"end-profiling\":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:\"end-profiling\"})}catch(t){postMessage({type:\"end-profiling\",err:t})}}}})()})();\\n',\"Worker\",void 0,void 0)}},477:t=>{\"use strict\";t.exports=function(t,e,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([t])}catch(e){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(t),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),u=new i[e](s,n);return a.revokeObjectURL(s),u}catch(r){return new i[e](\"data:application/javascript,\".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error(\"Inline worker is not supported\");return new i[e](r,n)}}},4154:t=>{\"use strict\";t.exports='\"use strict\";var e={},t=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node;if(t){var r=require(\"worker_threads\"),a=r.parentPort;a.on(\"message\",(e=>onmessage({data:e})));var o=require(\"fs\");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,\"utf8\"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(\" \");t?o.writeSync(2,e+\"\\\\n\"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if(\"load\"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,\"string\"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if(\"run\"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if(\"unwind\"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else\"cancel\"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):\"setimmediate\"===t.data.target||(\"processProxyingQueue\"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i(\"worker.js received unknown command \"+t.data.cmd),i(t.data)))}catch(t){throw i(\"worker.js onmessage() captured an uncaught exception: \"+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n'},1670:t=>{\"use strict\";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e,n)=>{\"use strict\";n.r(e),n.d(e,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(n+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;t:for(e=0;e=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},r.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+e))throw new Error(\"FlatBuffers: field \"+e+\" must be set\")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n=56320?i:(i<<10)+t.charCodeAt(n++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),n=0;for(var o=this.space,a=this.bb.bytes();n>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return i},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error(\"FlatBuffers: file identifier must be length \"+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})()));\n//# sourceMappingURL=ort-web.min.js.map","let ONNX;\r\n\r\n// TODO support more execution providers (e.g., webgpu)\r\nconst executionProviders = ['wasm'];\r\n\r\nif (typeof process !== 'undefined') {\r\n // Running in a node-like environment.\r\n // Try to import onnxruntime-node, using onnxruntime-web as a fallback\r\n try {\r\n ONNX = require('onnxruntime-node');\r\n } catch (err) {\r\n console.warn(\r\n \"Node.js environment detected, but `onnxruntime-node` was not found. \" +\r\n \"Using `onnxruntime-web` as a fallback. We recommend installing `onnxruntime-node` \" +\r\n \"as it generally improves performance (up to 5X).\"\r\n )\r\n\r\n // Fix \"ReferenceError: self is not defined\" bug when running directly with node\r\n // https://github.com/microsoft/onnxruntime/issues/13072\r\n // @ts-ignore\r\n global.self = global;\r\n\r\n ONNX = require('onnxruntime-web');\r\n\r\n // Disable spawning worker threads for testing.\r\n // This is done by setting numThreads to 1\r\n // https://github.com/microsoft/onnxruntime/issues/10311\r\n ONNX.env.wasm.numThreads = 1;\r\n }\r\n\r\n // Add `cpu` execution provider, with higher precedence that `wasm`.\r\n executionProviders.unshift('cpu');\r\n\r\n} else {\r\n // Running in a browser-environment, so we just import `onnxruntime-web`\r\n ONNX = require('onnxruntime-web');\r\n}\r\n\r\nmodule.exports = {\r\n ONNX,\r\n executionProviders,\r\n}\r\n","const fs = require('fs');\r\nconst path = require('path');\r\n\r\nconst { env: onnx_env } = require('./backends/onnx.js').ONNX;\r\n\r\n// check if various APIs are available (depends on environment)\r\nconst CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self;\r\nconst FS_AVAILABLE = !isEmpty(fs); // check if file system is available\r\nconst PATH_AVAILABLE = !isEmpty(path); // check if path is available\r\n\r\nconst RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE;\r\n\r\n// set local model path, based on available APIs\r\nconst DEFAULT_LOCAL_PATH = '/models/onnx/quantized/';\r\nconst localURL = RUNNING_LOCALLY\r\n ? path.join(path.dirname(__dirname), DEFAULT_LOCAL_PATH)\r\n : DEFAULT_LOCAL_PATH;\r\n\r\n// First, set path to wasm files. This is needed when running in a web worker.\r\n// https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths\r\n// We use remote wasm files by default to make it easier for newer users.\r\n// In practice, users should probably self-host the necessary .wasm files.\r\nonnx_env.wasm.wasmPaths = RUNNING_LOCALLY\r\n ? path.join(path.dirname(__dirname), '/dist/')\r\n : 'https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/';\r\n\r\n\r\n// Global variable used to control exection, with suitable defaults\r\nconst env = {\r\n // access onnxruntime-web's environment variables\r\n onnx: onnx_env,\r\n\r\n // whether to support loading models from the HuggingFace hub\r\n remoteModels: true,\r\n\r\n // URL to load models from\r\n remoteURL: 'https://huggingface.co/Xenova/transformers.js/resolve/main/quantized/',\r\n\r\n // Local URL to load models from.\r\n localURL: localURL,\r\n\r\n // Whether to use Cache API to cache models. By default, it is true if available.\r\n useCache: CACHE_AVAILABLE,\r\n\r\n // Whether to use the file system to load files. By default, it is true available.\r\n useFS: FS_AVAILABLE,\r\n}\r\n\r\n\r\n/**\r\n * @param {object} obj\r\n */\r\nfunction isEmpty(obj) {\r\n return Object.keys(obj).length === 0;\r\n}\r\n\r\nmodule.exports = {\r\n env\r\n}\r\n","\r\n/**\r\n * FFT class provides functionality for performing Fast Fourier Transform on arrays\r\n * Code adapted from https://www.npmjs.com/package/fft.js\r\n */\r\nclass FFT {\r\n /**\r\n * @param {number} size - The size of the input array. Must be a power of two and bigger than 1.\r\n * @throws {Error} FFT size must be a power of two and bigger than 1.\r\n */\r\n constructor(size) {\r\n this.size = size | 0; // convert to a 32-bit signed integer\r\n if (this.size <= 1 || (this.size & (this.size - 1)) !== 0)\r\n throw new Error('FFT size must be a power of two and bigger than 1');\r\n\r\n this._csize = size << 1;\r\n\r\n this.table = new Float64Array(this.size * 2);\r\n for (let i = 0; i < this.table.length; i += 2) {\r\n const angle = Math.PI * i / this.size;\r\n this.table[i] = Math.cos(angle);\r\n this.table[i + 1] = -Math.sin(angle);\r\n }\r\n\r\n // Find size's power of two\r\n let power = 0;\r\n for (let t = 1; this.size > t; t <<= 1)\r\n ++power;\r\n\r\n // Calculate initial step's width:\r\n // * If we are full radix-4 - it is 2x smaller to give inital len=8\r\n // * Otherwise it is the same as `power` to give len=4\r\n this._width = power % 2 === 0 ? power - 1 : power;\r\n\r\n // Pre-compute bit-reversal patterns\r\n this._bitrev = new Int32Array(1 << this._width);\r\n for (let j = 0; j < this._bitrev.length; ++j) {\r\n this._bitrev[j] = 0;\r\n for (let shift = 0; shift < this._width; shift += 2) {\r\n const revShift = this._width - shift - 2;\r\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Create a complex number array with size `2 * size`\r\n *\r\n * @returns {Float64Array} - A complex number array with size `2 * size`\r\n */\r\n createComplexArray() {\r\n return new Float64Array(this._csize);\r\n }\r\n\r\n /**\r\n * Converts a complex number representation stored in a Float64Array to an array of real numbers.\r\n * \r\n * @param {Float64Array} complex - The complex number representation to be converted.\r\n * @param {number[]} [storage] - An optional array to store the result in.\r\n * @returns {number[]} An array of real numbers representing the input complex number representation.\r\n */\r\n fromComplexArray(complex, storage) {\r\n const res = storage || new Array(complex.length >>> 1);\r\n for (let i = 0; i < complex.length; i += 2)\r\n res[i >>> 1] = complex[i];\r\n return res;\r\n }\r\n\r\n /**\r\n * Convert a real-valued input array to a complex-valued output array.\r\n * @param {Float64Array} input - The real-valued input array.\r\n * @param {Float64Array} [storage] - Optional buffer to store the output array.\r\n * @returns {Float64Array} The complex-valued output array.\r\n */\r\n toComplexArray(input, storage) {\r\n const res = storage || this.createComplexArray();\r\n for (let i = 0; i < res.length; i += 2) {\r\n res[i] = input[i >>> 1];\r\n res[i + 1] = 0;\r\n }\r\n return res;\r\n }\r\n\r\n /**\r\n * Completes the spectrum by adding its mirrored negative frequency components.\r\n * @param {Float64Array} spectrum - The input spectrum.\r\n * @returns {void}\r\n */\r\n completeSpectrum(spectrum) {\r\n const size = this._csize;\r\n const half = size >>> 1;\r\n for (let i = 2; i < half; i += 2) {\r\n spectrum[size - i] = spectrum[i];\r\n spectrum[size - i + 1] = -spectrum[i + 1];\r\n }\r\n }\r\n\r\n /**\r\n * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer.\r\n * \r\n * @param {Float64Array} out - The output buffer to store the result.\r\n * @param {Float64Array} data - The input data to transform.\r\n * \r\n * @throws {Error} Input and output buffers must be different.\r\n * \r\n * @returns {void}\r\n */\r\n transform(out, data) {\r\n if (out === data)\r\n throw new Error('Input and output buffers must be different');\r\n\r\n this._transform4(out, data, 1 /* DONE */);\r\n }\r\n\r\n /**\r\n * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer.\r\n * The input buffer must contain real values only, while the output buffer will contain complex values. The input and\r\n * output buffers must be different.\r\n *\r\n * @param {Float64Array} out - The output buffer.\r\n * @param {Float64Array} data - The input buffer containing real values.\r\n *\r\n * @throws {Error} If the input and output buffers are the same.\r\n */\r\n realTransform(out, data) {\r\n if (out === data)\r\n throw new Error('Input and output buffers must be different');\r\n\r\n this._realTransform4(out, data, 1 /* DONE */);\r\n }\r\n\r\n /**\r\n * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`.\r\n * The `out` array must be a different buffer than the `data` array. The `out` array will contain the\r\n * result of the transformation. The `data` array will not be modified.\r\n * \r\n * @param {Float64Array} out - The output buffer for the transformed data.\r\n * @param {Float64Array} data - The input data to transform.\r\n * @throws {Error} If `out` and `data` refer to the same buffer.\r\n * @returns {void}\r\n */\r\n inverseTransform(out, data) {\r\n if (out === data)\r\n throw new Error('Input and output buffers must be different');\r\n\r\n this._transform4(out, data, -1 /* DONE */);\r\n for (let i = 0; i < out.length; ++i)\r\n out[i] /= this.size;\r\n }\r\n\r\n /**\r\n * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data.\r\n *\r\n * @param {Float64Array} out - The output buffer for the transformed data.\r\n * @param {Float64Array} data - The input buffer of data to be transformed.\r\n * @param {number} inv - A scaling factor to apply to the transform.\r\n * @returns {void}\r\n */\r\n _transform4(out, data, inv) {\r\n // radix-4 implementation\r\n\r\n const size = this._csize;\r\n\r\n // Initial step (permute and transform)\r\n const width = this._width;\r\n let step = 1 << width;\r\n let len = (size / step) << 1;\r\n\r\n let outOff;\r\n let t;\r\n let bitrev = this._bitrev;\r\n if (len === 4) {\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleTransform2(data, out, outOff, off, step);\r\n }\r\n } else {\r\n // len === 8\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleTransform4(data, out, outOff, off, step, inv);\r\n }\r\n }\r\n\r\n // Loop through steps in decreasing order\r\n for (step >>= 2; step >= 2; step >>= 2) {\r\n len = (size / step) << 1;\r\n let quarterLen = len >>> 2;\r\n\r\n // Loop through offsets in the data\r\n for (outOff = 0; outOff < size; outOff += len) {\r\n // Full case\r\n let limit = outOff + quarterLen;\r\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\r\n const A = i;\r\n const B = A + quarterLen;\r\n const C = B + quarterLen;\r\n const D = C + quarterLen;\r\n\r\n // Original values\r\n const Ar = out[A];\r\n const Ai = out[A + 1];\r\n const Br = out[B];\r\n const Bi = out[B + 1];\r\n const Cr = out[C];\r\n const Ci = out[C + 1];\r\n const Dr = out[D];\r\n const Di = out[D + 1];\r\n\r\n const tableBr = this.table[k];\r\n const tableBi = inv * this.table[k + 1];\r\n const MBr = Br * tableBr - Bi * tableBi;\r\n const MBi = Br * tableBi + Bi * tableBr;\r\n\r\n const tableCr = this.table[2 * k];\r\n const tableCi = inv * this.table[2 * k + 1];\r\n const MCr = Cr * tableCr - Ci * tableCi;\r\n const MCi = Cr * tableCi + Ci * tableCr;\r\n\r\n const tableDr = this.table[3 * k];\r\n const tableDi = inv * this.table[3 * k + 1];\r\n const MDr = Dr * tableDr - Di * tableDi;\r\n const MDi = Dr * tableDi + Di * tableDr;\r\n\r\n // Pre-Final values\r\n const T0r = Ar + MCr;\r\n const T0i = Ai + MCi;\r\n const T1r = Ar - MCr;\r\n const T1i = Ai - MCi;\r\n const T2r = MBr + MDr;\r\n const T2i = MBi + MDi;\r\n const T3r = inv * (MBr - MDr);\r\n const T3i = inv * (MBi - MDi);\r\n\r\n // Final values\r\n out[A] = T0r + T2r;\r\n out[A + 1] = T0i + T2i;\r\n out[B] = T1r + T3i;\r\n out[B + 1] = T1i - T3r;\r\n out[C] = T0r - T2r;\r\n out[C + 1] = T0i - T2i;\r\n out[D] = T1r - T3i;\r\n out[D + 1] = T1i + T3r;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data.\r\n *\r\n * @param {Float64Array} data - The input buffer of data to be transformed.\r\n * @param {Float64Array} out - The output buffer for the transformed data.\r\n * @param {number} outOff - The offset at which to write the output data.\r\n * @param {number} off - The offset at which to begin reading the input data.\r\n * @param {number} step - The step size for indexing the input data.\r\n * @returns {void}\r\n */\r\n _singleTransform2(data, out, outOff, off, step) {\r\n // radix-2 implementation\r\n // NOTE: Only called for len=4\r\n\r\n const evenR = data[off];\r\n const evenI = data[off + 1];\r\n const oddR = data[off + step];\r\n const oddI = data[off + step + 1];\r\n\r\n out[outOff] = evenR + oddR;\r\n out[outOff + 1] = evenI + oddI;\r\n out[outOff + 2] = evenR - oddR;\r\n out[outOff + 3] = evenI - oddI;\r\n }\r\n\r\n /**\r\n * Performs radix-4 transformation on input data of length 8\r\n *\r\n * @param {Float64Array} data - Input data array of length 8\r\n * @param {Float64Array} out - Output data array of length 8\r\n * @param {number} outOff - Index of output array to start writing from\r\n * @param {number} off - Index of input array to start reading from\r\n * @param {number} step - Step size between elements in input array\r\n * @param {number} inv - Scaling factor for inverse transform\r\n * \r\n * @returns {void}\r\n */\r\n _singleTransform4(data, out, outOff, off, step, inv) {\r\n // radix-4\r\n // NOTE: Only called for len=8\r\n const step2 = step * 2;\r\n const step3 = step * 3;\r\n\r\n // Original values\r\n const Ar = data[off];\r\n const Ai = data[off + 1];\r\n const Br = data[off + step];\r\n const Bi = data[off + step + 1];\r\n const Cr = data[off + step2];\r\n const Ci = data[off + step2 + 1];\r\n const Dr = data[off + step3];\r\n const Di = data[off + step3 + 1];\r\n\r\n // Pre-Final values\r\n const T0r = Ar + Cr;\r\n const T0i = Ai + Ci;\r\n const T1r = Ar - Cr;\r\n const T1i = Ai - Ci;\r\n const T2r = Br + Dr;\r\n const T2i = Bi + Di;\r\n const T3r = inv * (Br - Dr);\r\n const T3i = inv * (Bi - Di);\r\n\r\n // Final values\r\n out[outOff] = T0r + T2r;\r\n out[outOff + 1] = T0i + T2i;\r\n out[outOff + 2] = T1r + T3i;\r\n out[outOff + 3] = T1i - T3r;\r\n out[outOff + 4] = T0r - T2r;\r\n out[outOff + 5] = T0i - T2i;\r\n out[outOff + 6] = T1r - T3i;\r\n out[outOff + 7] = T1i + T3r;\r\n }\r\n\r\n /**\r\n * Real input radix-4 implementation\r\n * @param {Float64Array} out - Output array for the transformed data\r\n * @param {Float64Array} data - Input array of real data to be transformed\r\n * @param {number} inv - The scale factor used to normalize the inverse transform\r\n */\r\n _realTransform4(out, data, inv) {\r\n // Real input radix-4 implementation\r\n const size = this._csize;\r\n\r\n // Initial step (permute and transform)\r\n const width = this._width;\r\n let step = 1 << width;\r\n let len = (size / step) << 1;\r\n\r\n var outOff;\r\n var t;\r\n var bitrev = this._bitrev;\r\n if (len === 4) {\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1);\r\n }\r\n } else {\r\n // len === 8\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv);\r\n }\r\n }\r\n\r\n // Loop through steps in decreasing order\r\n for (step >>= 2; step >= 2; step >>= 2) {\r\n len = (size / step) << 1;\r\n const halfLen = len >>> 1;\r\n const quarterLen = halfLen >>> 1;\r\n const hquarterLen = quarterLen >>> 1;\r\n\r\n // Loop through offsets in the data\r\n for (outOff = 0; outOff < size; outOff += len) {\r\n for (let i = 0, k = 0; i <= hquarterLen; i += 2, k += step) {\r\n const A = outOff + i;\r\n const B = A + quarterLen;\r\n const C = B + quarterLen;\r\n const D = C + quarterLen;\r\n\r\n // Original values\r\n const Ar = out[A];\r\n const Ai = out[A + 1];\r\n const Br = out[B];\r\n const Bi = out[B + 1];\r\n const Cr = out[C];\r\n const Ci = out[C + 1];\r\n const Dr = out[D];\r\n const Di = out[D + 1];\r\n\r\n const tableBr = this.table[k];\r\n const tableBi = inv * this.table[k + 1];\r\n const MBr = Br * tableBr - Bi * tableBi;\r\n const MBi = Br * tableBi + Bi * tableBr;\r\n\r\n const tableCr = this.table[2 * k];\r\n const tableCi = inv * this.table[2 * k + 1];\r\n const MCr = Cr * tableCr - Ci * tableCi;\r\n const MCi = Cr * tableCi + Ci * tableCr;\r\n\r\n const tableDr = this.table[3 * k];\r\n const tableDi = inv * this.table[3 * k + 1];\r\n const MDr = Dr * tableDr - Di * tableDi;\r\n const MDi = Dr * tableDi + Di * tableDr;\r\n\r\n // Pre-Final values\r\n const T0r = Ar + MCr;\r\n const T0i = Ai + MCi;\r\n const T1r = Ar - MCr;\r\n const T1i = Ai - MCi;\r\n const T2r = MBr + MDr;\r\n const T2i = MBi + MDi;\r\n const T3r = inv * (MBr - MDr);\r\n const T3i = inv * (MBi - MDi);\r\n\r\n // Final values\r\n out[A] = T0r + T2r;\r\n out[A + 1] = T0i + T2i;\r\n out[B] = T1r + T3i;\r\n out[B + 1] = T1i - T3r;\r\n\r\n // Output final middle point\r\n if (i === 0) {\r\n out[C] = T0r - T2r;\r\n out[C + 1] = T0i - T2i;\r\n continue;\r\n }\r\n\r\n // Do not overwrite ourselves\r\n if (i === hquarterLen)\r\n continue;\r\n\r\n const SA = outOff + quarterLen - i;\r\n const SB = outOff + halfLen - i;\r\n\r\n out[SA] = T1r + -inv * T3i;\r\n out[SA + 1] = -T1i - inv * T3r;\r\n out[SB] = T0r + -inv * T2r;\r\n out[SB + 1] = -T0i + inv * T2i;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Performs a single real input radix-2 transformation on the provided data\r\n * \r\n * @param {Float64Array} data - The input data array\r\n * @param {Float64Array} out - The output data array\r\n * @param {number} outOff - The output offset\r\n * @param {number} off - The input offset\r\n * @param {number} step - The step\r\n * \r\n * @returns {void}\r\n */\r\n _singleRealTransform2(data, out, outOff, off, step) {\r\n // radix-2 implementation\r\n // NOTE: Only called for len=4\r\n\r\n const evenR = data[off];\r\n const oddR = data[off + step];\r\n\r\n out[outOff] = evenR + oddR;\r\n out[outOff + 1] = 0;\r\n out[outOff + 2] = evenR - oddR;\r\n out[outOff + 3] = 0;\r\n }\r\n\r\n /**\r\n * Computes a single real-valued transform using radix-4 algorithm.\r\n * This method is only called for len=8.\r\n *\r\n * @param {Float64Array} data - The input data array.\r\n * @param {Float64Array} out - The output data array.\r\n * @param {number} outOff - The offset into the output array.\r\n * @param {number} off - The offset into the input array.\r\n * @param {number} step - The step size for the input array.\r\n * @param {number} inv - The value of inverse.\r\n */\r\n _singleRealTransform4(data, out, outOff, off, step, inv) {\r\n // radix-4\r\n // NOTE: Only called for len=8\r\n const step2 = step * 2;\r\n const step3 = step * 3;\r\n\r\n // Original values\r\n const Ar = data[off];\r\n const Br = data[off + step];\r\n const Cr = data[off + step2];\r\n const Dr = data[off + step3];\r\n\r\n // Pre-Final values\r\n const T0r = Ar + Cr;\r\n const T1r = Ar - Cr;\r\n const T2r = Br + Dr;\r\n const T3r = inv * (Br - Dr);\r\n\r\n // Final values\r\n out[outOff] = T0r + T2r;\r\n out[outOff + 1] = 0;\r\n out[outOff + 2] = T1r;\r\n out[outOff + 3] = -T3r;\r\n out[outOff + 4] = T0r - T2r;\r\n out[outOff + 5] = 0;\r\n out[outOff + 6] = T1r;\r\n out[outOff + 7] = T3r;\r\n }\r\n}\r\n\r\nmodule.exports = FFT\r\n","const { Tensor } = require(\"./tensor_utils.js\");\r\nconst {\r\n Callable,\r\n exists,\r\n log_softmax\r\n} = require(\"./utils.js\");\r\n\r\n/**\r\n * A class representing a list of logits processors. A logits processor is a function that modifies the logits\r\n * output of a language model. This class provides methods for adding new processors and applying all processors to a\r\n * batch of logits.\r\n *\r\n * @extends Callable\r\n */\r\nclass LogitsProcessorList extends Callable {\r\n /**\r\n * Constructs a new instance of `LogitsProcessorList`.\r\n */\r\n constructor() {\r\n super();\r\n this.processors = [];\r\n }\r\n\r\n /**\r\n * Adds a new logits processor to the list.\r\n *\r\n * @param {function} item - The logits processor function to add.\r\n */\r\n push(item) {\r\n this.processors.push(item);\r\n }\r\n\r\n /**\r\n * Adds multiple logits processors to the list.\r\n *\r\n * @param {function[]} items - The logits processor functions to add.\r\n */\r\n extend(items) {\r\n this.processors.push(...items);\r\n }\r\n\r\n /**\r\n * Applies all logits processors in the list to a batch of logits, modifying them in-place.\r\n *\r\n * @param {number[]} input_ids - The input IDs for the language model.\r\n * @param {number[][]} batchedLogits - A 2D array of logits, where each row corresponds to a single\r\n * input sequence in the batch.\r\n */\r\n _call(input_ids, batchedLogits) {\r\n // NOTE: This is different from the Python code, since vanilla JS does not support vectorized operations. \r\n // As a result, we apply each processor to each item in the batch.\r\n for (let logits of batchedLogits) {\r\n // Modifies logits inplace\r\n this.processors.forEach(\r\n func => func(input_ids, logits)\r\n )\r\n }\r\n }\r\n\r\n [Symbol.iterator]() {\r\n return this.processors.values();\r\n }\r\n}\r\n\r\n/**\r\n * Base class for processing logits.\r\n * @extends Callable\r\n */\r\nclass LogitsProcessor extends Callable {\r\n /**\r\n * Apply the processor to the input logits.\r\n *\r\n * @abstract\r\n * @param {Array} input_ids The input ids.\r\n * @param {Tensor} logits The logits to process.\r\n * @throws {Error} Throws an error if `_call` is not implemented in the subclass.\r\n */\r\n _call(input_ids, logits) {\r\n throw Error(\"`_call` should be implemented in a subclass\")\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that forces a specific token to be generated by the decoder.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass ForceTokensLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Constructs a new instance of `ForceTokensLogitsProcessor`.\r\n * \r\n * @param {Array} forced_decoder_ids The ids of tokens that should be forced.\r\n */\r\n constructor(forced_decoder_ids) {\r\n super();\r\n this.force_token_map = Object.fromEntries(forced_decoder_ids ?? []);\r\n }\r\n\r\n /**\r\n * Apply the processor to the input logits.\r\n *\r\n * @param {Array} input_ids The input ids.\r\n * @param {any} logits The logits to process.\r\n * @returns {Array} The processed logits.\r\n */\r\n _call(input_ids, logits) {\r\n let map = this.force_token_map[input_ids.length];\r\n if (exists(map)) { // There exists a mapping\r\n logits.data.fill(-Infinity)\r\n logits.data[map] = 0;\r\n }\r\n return logits;\r\n }\r\n}\r\n\r\n/**\r\n * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence.\r\n * @extends LogitsProcessor\r\n */\r\nclass ForcedBOSTokenLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a ForcedBOSTokenLogitsProcessor.\r\n * @param {number} bos_token_id - The ID of the beginning-of-sequence token to be forced.\r\n */\r\n constructor(bos_token_id) {\r\n super();\r\n this.bos_token_id = bos_token_id;\r\n }\r\n\r\n /**\r\n * Apply the BOS token forcing to the logits.\r\n * @param {Array} input_ids - The input IDs.\r\n * @param {Object} logits - The logits.\r\n * @returns {Object} The logits with BOS token forcing.\r\n */\r\n _call(input_ids, logits) {\r\n if (input_ids.length === 1) {\r\n logits.data.fill(-Infinity)\r\n logits.data[this.bos_token_id] = 0;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that forces end-of-sequence token probability to 1.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass ForcedEOSTokenLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a ForcedEOSTokenLogitsProcessor.\r\n * @param {number} max_length - Max length of the sequence.\r\n * @param {number} forced_eos_token_id - The ID of the end-of-sequence token to be forced.\r\n */\r\n constructor(max_length, forced_eos_token_id) {\r\n super();\r\n this.max_length = max_length;\r\n this.forced_eos_token_id = forced_eos_token_id;\r\n }\r\n\r\n /**\r\n * Apply the processor to input_ids and logits.\r\n * \r\n * @param {number[]} input_ids - The input ids.\r\n * @param {any} logits - The logits tensor.\r\n */\r\n _call(input_ids, logits) {\r\n // console.log('call ForcedEOSTokenLogitsProcessor')\r\n // TODO\r\n }\r\n}\r\n\r\n/**\r\n * A LogitsProcessor that handles adding timestamps to generated text.\r\n * @extends LogitsProcessor\r\n */\r\nclass WhisperTimeStampLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Constructs a new WhisperTimeStampLogitsProcessor.\r\n * @param {object} generate_config - The config object passed to the `generate()` method of a transformer model.\r\n * @param {number} generate_config.eos_token_id - The ID of the end-of-sequence token.\r\n * @param {number} generate_config.no_timestamps_token_id - The ID of the token used to indicate that a token should not have a timestamp.\r\n * @param {number[][]} [generate_config.forced_decoder_ids] - An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp.\r\n * @param {number} [generate_config.max_initial_timestamp_index] - The maximum index at which an initial timestamp can appear.\r\n */\r\n constructor(generate_config) {\r\n super();\r\n this.eos_token_id = generate_config.eos_token_id;\r\n this.no_timestamps_token_id = generate_config.no_timestamps_token_id;\r\n this.timestamp_begin = this.no_timestamps_token_id + 1;\r\n\r\n this.begin_index = (generate_config.forced_decoder_ids || []).length + 2;\r\n if (generate_config.forced_decoder_ids.slice(-1)[0][1] === this.no_timestamps_token_id) {\r\n this.begin_index -= 1;\r\n }\r\n this.max_initial_timestamp_index = generate_config.max_initial_timestamp_index;\r\n\r\n }\r\n\r\n /**\r\n * Modify the logits to handle timestamp tokens.\r\n * @param {Array} input_ids - The input sequence of tokens.\r\n * @param {Tensor} logits - The logits output by the model.\r\n * @returns {Tensor} - The modified logits.\r\n */\r\n _call(input_ids, logits) {\r\n // suppress <|notimestamps|> which is handled by without_timestamps\r\n logits.data[this.no_timestamps_token_id] = -Infinity;\r\n\r\n if (input_ids.length === this.begin_index - 1) {\r\n logits.data.fill(-Infinity);\r\n logits.data[this.timestamp_begin] = 0;\r\n return logits;\r\n }\r\n\r\n // timestamps have to appear in pairs, except directly before eos_token; mask logits accordingly\r\n const seq = input_ids.slice(this.begin_index);\r\n const last_was_timestamp = seq.length >= 1 && seq[seq.length - 1] >= this.timestamp_begin;\r\n const penultimate_was_timestamp = seq.length < 2 || seq[seq.length - 2] >= this.timestamp_begin;\r\n\r\n if (last_was_timestamp) {\r\n if (penultimate_was_timestamp) { // has to be non-timestamp\r\n logits.data.subarray(this.timestamp_begin).fill(-Infinity);\r\n } else { // cannot be normal text tokens\r\n logits.data.subarray(0, this.eos_token_id).fill(-Infinity);\r\n }\r\n }\r\n\r\n // apply the `max_initial_timestamp` option\r\n if (input_ids.length === this.begin_index && this.max_initial_timestamp_index !== null) {\r\n const last_allowed = this.timestamp_begin + this.max_initial_timestamp_index;\r\n logits.data.subarray(last_allowed + 1).fill(-Infinity);\r\n }\r\n\r\n // if sum of probability over timestamps is above any other token, sample timestamp\r\n const logprobs = log_softmax(logits.data);\r\n const timestamp_logprob = Math.log(logprobs.subarray(this.timestamp_begin).map(Math.exp).reduce((a, b) => a + b));\r\n const max_text_token_logprob = Math.max(...logprobs.subarray(0, this.timestamp_begin));\r\n if (timestamp_logprob > max_text_token_logprob) {\r\n logits.data.subarray(0, this.timestamp_begin).fill(-Infinity);\r\n }\r\n\r\n return logits;\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that disallows ngrams of a certain size to be repeated.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass NoRepeatNGramLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a NoRepeatNGramLogitsProcessor.\r\n * @param {number} no_repeat_ngram_size - The no-repeat-ngram size. All ngrams of this size can only occur once.\r\n */\r\n constructor(no_repeat_ngram_size) {\r\n super();\r\n this.no_repeat_ngram_size = no_repeat_ngram_size;\r\n }\r\n\r\n /**\r\n * Generate n-grams from a sequence of token ids.\r\n * @param {number[]} prevInputIds - List of previous input ids\r\n * @returns {Map} - Map of generated n-grams\r\n */\r\n getNgrams(prevInputIds) {\r\n const curLen = prevInputIds.length;\r\n\r\n /**@type {number[][]} */\r\n const ngrams = [];\r\n for (let j = 0; j < curLen + 1 - this.no_repeat_ngram_size; ++j) {\r\n const ngram = [];\r\n for (let k = 0; k < this.no_repeat_ngram_size; ++k) {\r\n ngram.push(prevInputIds[j + k]);\r\n }\r\n ngrams.push(ngram);\r\n }\r\n\r\n /** @type {Map} */\r\n const generatedNgram = new Map();\r\n for (const ngram of ngrams) {\r\n const prevNgram = ngram.slice(0, ngram.length - 1);\r\n const prevNgramKey = JSON.stringify(prevNgram);\r\n const prevNgramValue = generatedNgram.get(prevNgramKey) ?? [];\r\n prevNgramValue.push(ngram[ngram.length - 1]);\r\n generatedNgram.set(prevNgramKey, prevNgramValue);\r\n }\r\n return generatedNgram;\r\n }\r\n\r\n /**\r\n * Generate n-grams from a sequence of token ids.\r\n * @param {Map} bannedNgrams - Map of banned n-grams\r\n * @param {number[]} prevInputIds - List of previous input ids\r\n * @returns {number[]} - Map of generated n-grams\r\n */\r\n getGeneratedNgrams(bannedNgrams, prevInputIds) {\r\n const ngramIdx = prevInputIds.slice(prevInputIds.length + 1 - this.no_repeat_ngram_size, prevInputIds.length);\r\n const banned = bannedNgrams.get(JSON.stringify(ngramIdx)) ?? [];\r\n return banned;\r\n }\r\n\r\n /**\r\n * Calculate banned n-gram tokens\r\n * @param {number[]} prevInputIds - List of previous input ids\r\n * @returns {number[]} - Map of generated n-grams\r\n */\r\n calcBannedNgramTokens(prevInputIds) {\r\n const bannedTokens = [];\r\n if (prevInputIds.length + 1 < this.no_repeat_ngram_size) {\r\n // return no banned tokens if we haven't generated no_repeat_ngram_size tokens yet\r\n return bannedTokens;\r\n\r\n } else {\r\n const generatedNgrams = this.getNgrams(prevInputIds);\r\n const bannedTokens = this.getGeneratedNgrams(generatedNgrams, prevInputIds);\r\n return bannedTokens;\r\n }\r\n }\r\n\r\n /**\r\n * Apply the no-repeat-ngram processor to the logits.\r\n * @param {Array} input_ids - The input IDs.\r\n * @param {Object} logits - The logits.\r\n * @returns {Object} The logits with no-repeat-ngram processing.\r\n */\r\n _call(input_ids, logits) {\r\n const bannedTokens = this.calcBannedNgramTokens(input_ids);\r\n\r\n for (const token of bannedTokens) {\r\n logits.data[token] = -Infinity;\r\n }\r\n return logits;\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that penalises repeated output tokens.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass RepetitionPenaltyLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a RepetitionPenaltyLogitsProcessor.\r\n * @param {number} penalty - The penalty to apply for repeated tokens.\r\n */\r\n constructor(penalty) {\r\n super();\r\n this.penalty = penalty;\r\n }\r\n\r\n /**\r\n * Apply the repetition penalty to the logits.\r\n * @param {Array} input_ids - The input IDs.\r\n * @param {Object} logits - The logits.\r\n * @returns {Object} The logits with repetition penalty processing.\r\n */\r\n _call(input_ids, logits) {\r\n // Modify the logits corresponding to each element in `input_ids`.\r\n // As a consequence, the logits corresponding to tokens that appear\r\n // many times in the output will be penalised more.\r\n for (const input_id of input_ids) {\r\n if (logits.data[input_id] < 0) {\r\n logits.data[input_id] *= this.penalty;\r\n } else {\r\n logits.data[input_id] /= this.penalty;\r\n }\r\n }\r\n return logits\r\n }\r\n}\r\n\r\n\r\nclass GenerationConfig {\r\n constructor(kwargs = {}) {\r\n // Parameters that control the length of the output\r\n // TODO: extend the configuration with correct types\r\n /**\r\n * Create a GenerationConfig object\r\n * @constructor\r\n * @param {Object} [kwargs={}] - The configuration parameters\r\n * @param {number} [kwargs.max_length=20] - The maximum length of the generated text\r\n * @param {number} [kwargs.max_new_tokens=null] - The maximum number of new tokens to generate\r\n * @param {number} [kwargs.min_length=0] - The minimum length of the generated text\r\n * @param {number} [kwargs.min_new_tokens=null] - The minimum number of new tokens to generate\r\n * @param {boolean} [kwargs.early_stopping=false] - Whether to stop generation early if a stop token is encountered\r\n * @param {number} [kwargs.max_time=null] - The maximum amount of time to spend generating text\r\n * @param {boolean} [kwargs.do_sample=false] - Whether to use sampling when generating text\r\n * @param {number} [kwargs.num_beams=1] - The number of beams to use when generating text\r\n * @param {number} [kwargs.num_beam_groups=1] - The number of beam groups to use when generating text\r\n * @param {number} [kwargs.penalty_alpha=null] - The value of the alpha penalty to use when generating text\r\n * @param {boolean} [kwargs.use_cache=true] - Whether to use cache when generating text\r\n * @param {number} [kwargs.temperature=1.0] - The temperature to use when generating text\r\n * @param {number} [kwargs.top_k=50] - The value of k to use when generating text\r\n * @param {number} [kwargs.top_p=1.0] - The value of p to use when generating text\r\n * @param {number} [kwargs.typical_p=1.0] - The typical value of p to use when generating text\r\n * @param {number} [kwargs.epsilon_cutoff=0.0] - The value of epsilon cutoff to use when generating text\r\n * @param {number} [kwargs.eta_cutoff=0.0] - The value of eta cutoff to use when generating text\r\n * @param {number} [kwargs.diversity_penalty=0.0] - The value of diversity penalty to use when generating text\r\n * @param {number} [kwargs.repetition_penalty=1.0] - The value of repetition penalty to use when generating text\r\n * @param {number} [kwargs.encoder_repetition_penalty=1.0] - The value of encoder repetition penalty to use when generating text\r\n * @param {number} [kwargs.length_penalty=1.0] - The value of length\r\n * @param {number} [kwargs.no_repeat_ngram_size=0] - The size of the n-grams to avoid repeating in the generated output.\r\n * @param {?number[]} [kwargs.bad_words_ids=null] - An array of IDs representing tokens that should not be generated.\r\n * @param {?number[]} [kwargs.force_words_ids=null] - An array of IDs representing tokens that must be generated.\r\n * @param {boolean} [kwargs.renormalize_logits=false] - Whether or not to renormalize the logits before generating new tokens.\r\n * @param {?Object[]} [kwargs.constraints=null] - An array of constraint objects to apply during generation.\r\n */\r\n this.max_length = kwargs.max_length ?? 20;\r\n this.max_new_tokens = kwargs.max_new_tokens ?? null;\r\n this.min_length = kwargs.min_length ?? 0;\r\n this.min_new_tokens = kwargs.min_new_tokens ?? null;\r\n this.early_stopping = kwargs.early_stopping ?? false;\r\n this.max_time = kwargs.max_time ?? null;\r\n\r\n // Parameters that control the generation strategy used\r\n this.do_sample = kwargs.do_sample ?? false;\r\n this.num_beams = kwargs.num_beams ?? 1;\r\n this.num_beam_groups = kwargs.num_beam_groups ?? 1;\r\n this.penalty_alpha = kwargs.penalty_alpha ?? null;\r\n this.use_cache = kwargs.use_cache ?? true;\r\n\r\n // Parameters for manipulation of the model output logits\r\n this.temperature = kwargs.temperature ?? 1.0;\r\n this.top_k = kwargs.top_k ?? 50;\r\n this.top_p = kwargs.top_p ?? 1.0;\r\n this.typical_p = kwargs.typical_p ?? 1.0;\r\n this.epsilon_cutoff = kwargs.epsilon_cutoff ?? 0.0;\r\n this.eta_cutoff = kwargs.eta_cutoff ?? 0.0;\r\n this.diversity_penalty = kwargs.diversity_penalty ?? 0.0;\r\n this.repetition_penalty = kwargs.repetition_penalty ?? 1.0;\r\n this.encoder_repetition_penalty = kwargs.encoder_repetition_penalty ?? 1.0;\r\n this.length_penalty = kwargs.length_penalty ?? 1.0;\r\n this.no_repeat_ngram_size = kwargs.no_repeat_ngram_size ?? 0;\r\n this.bad_words_ids = kwargs.bad_words_ids ?? null;\r\n this.force_words_ids = kwargs.force_words_ids ?? null;\r\n this.renormalize_logits = kwargs.renormalize_logits ?? false;\r\n this.constraints = kwargs.constraints ?? null;\r\n this.forced_bos_token_id = kwargs.forced_bos_token_id ?? null;\r\n this.forced_eos_token_id = kwargs.forced_eos_token_id ?? null;\r\n this.remove_invalid_values = kwargs.remove_invalid_values ?? false;\r\n this.exponential_decay_length_penalty = kwargs.exponential_decay_length_penalty ?? null;\r\n this.suppress_tokens = kwargs.suppress_tokens ?? null;\r\n this.begin_suppress_tokens = kwargs.begin_suppress_tokens ?? null;\r\n this.forced_decoder_ids = kwargs.forced_decoder_ids ?? null;\r\n\r\n // Parameters that define the output variables of `generate`\r\n this.num_return_sequences = kwargs.num_return_sequences ?? 1;\r\n this.output_attentions = kwargs.output_attentions ?? false;\r\n this.output_hidden_states = kwargs.output_hidden_states ?? false;\r\n this.output_scores = kwargs.output_scores ?? false;\r\n this.return_dict_in_generate = kwargs.return_dict_in_generate ?? false;\r\n\r\n // Special tokens that can be used at generation time\r\n this.pad_token_id = kwargs.pad_token_id ?? null;\r\n this.bos_token_id = kwargs.bos_token_id ?? null;\r\n this.eos_token_id = kwargs.eos_token_id ?? null;\r\n\r\n // Generation parameters exclusive to encoder-decoder models\r\n this.encoder_no_repeat_ngram_size = kwargs.encoder_no_repeat_ngram_size ?? 0;\r\n this.decoder_start_token_id = kwargs.decoder_start_token_id ?? null;\r\n\r\n // Wild card\r\n this.generation_kwargs = kwargs.generation_kwargs ?? {};\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n LogitsProcessor,\r\n LogitsProcessorList,\r\n GenerationConfig,\r\n ForcedBOSTokenLogitsProcessor,\r\n ForcedEOSTokenLogitsProcessor,\r\n WhisperTimeStampLogitsProcessor,\r\n ForceTokensLogitsProcessor,\r\n NoRepeatNGramLogitsProcessor,\r\n RepetitionPenaltyLogitsProcessor\r\n};\r\n","\r\nconst fs = require('fs');\r\nconst { getFile, isString } = require('./utils.js');\r\nconst { env } = require('./env.js');\r\n\r\n// Will be empty (or not used) if running in browser or web-worker\r\nconst sharp = require('sharp');\r\n\r\nlet CanvasClass;\r\nlet ImageDataClass;\r\nlet loadImageFunction;\r\nif (typeof self !== 'undefined') {\r\n // Running in browser or web-worker\r\n CanvasClass = OffscreenCanvas;\r\n loadImageFunction = self.createImageBitmap;\r\n ImageDataClass = ImageData;\r\n\r\n} else if (sharp) {\r\n // Running in Node.js, electron, or other non-browser environment\r\n\r\n loadImageFunction = async (/**@type {sharp.Sharp}*/img) => {\r\n let { data, info } = await img.raw().toBuffer({ resolveWithObject: true });\r\n return new CustomImage(new Uint8ClampedArray(data), info.width, info.height, info.channels);\r\n }\r\n\r\n} else {\r\n throw new Error('Unable to load image processing library.');\r\n}\r\n\r\n\r\nclass CustomImage {\r\n\r\n /**\r\n * Create a new CustomImage object.\r\n * @param {Uint8ClampedArray} data - The pixel data.\r\n * @param {number} width - The width of the image.\r\n * @param {number} height - The height of the image.\r\n * @param {1|2|3|4} channels - The number of channels.\r\n */\r\n constructor(data, width, height, channels) {\r\n this._update(data, width, height, channels);\r\n }\r\n\r\n /**\r\n * Helper method for reading an image from a variety of input types.\r\n * @param {CustomImage|string|URL} input \r\n * @returns The image object.\r\n */\r\n static async read(input) {\r\n if (input instanceof CustomImage) {\r\n return input;\r\n } else if (isString(input) || input instanceof URL) {\r\n return await this.fromURL(input);\r\n } else {\r\n throw new Error(`Unsupported input type: ${typeof input}`);\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Read an image from a URL or file path.\r\n * @param {string|URL} url - The URL or file path to read the image from.\r\n * @returns {Promise} - The image object.\r\n */\r\n static async fromURL(url) {\r\n let response = await getFile(url);\r\n let blob = await response.blob();\r\n return this.fromBlob(blob);\r\n }\r\n\r\n /**\r\n * Helper method to create a new Image from a blob.\r\n * @param {Blob} blob - The blob to read the image from.\r\n * @returns {Promise} - The image object.\r\n */\r\n static async fromBlob(blob) {\r\n if (CanvasClass) {\r\n // Running in environment with canvas\r\n let img = await loadImageFunction(blob);\r\n\r\n const ctx = new CanvasClass(img.width, img.height).getContext('2d');\r\n\r\n // Draw image to context\r\n ctx.drawImage(img, 0, 0);\r\n\r\n return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4);\r\n\r\n } else {\r\n // Use sharp.js to read (and possible resize) the image.\r\n let img = sharp(await blob.arrayBuffer());\r\n\r\n return await loadImageFunction(img);\r\n }\r\n }\r\n\r\n /**\r\n * Convert the image to grayscale format.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n grayscale() {\r\n if (this.channels === 1) {\r\n return this;\r\n }\r\n\r\n let newData = new Uint8ClampedArray(this.width * this.height * 3);\r\n switch (this.channels) {\r\n case 3: // rgb to grayscale\r\n case 4: // rgba to grayscale\r\n for (let i = 0, offset = 0; i < this.data.length; i += this.channels) {\r\n const red = this.data[i];\r\n const green = this.data[i + 1];\r\n const blue = this.data[i + 2];\r\n\r\n newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue);\r\n }\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n return this._update(newData, this.width, this.height, 1);\r\n }\r\n\r\n /**\r\n * Convert the image to RGB format.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n rgb() {\r\n if (this.channels === 3) {\r\n return this;\r\n }\r\n\r\n let newData = new Uint8ClampedArray(this.width * this.height * 3);\r\n\r\n switch (this.channels) {\r\n case 1: // grayscale to rgb\r\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n }\r\n break;\r\n case 4: // rgba to rgb\r\n for (let i = 0, offset = 0; i < this.data.length; i += 4) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i + 1];\r\n newData[offset++] = this.data[i + 2];\r\n }\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n return this._update(newData, this.width, this.height, 3);\r\n\r\n }\r\n\r\n /**\r\n * Convert the image to RGBA format.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n rgba() {\r\n if (this.channels === 4) {\r\n return this;\r\n }\r\n\r\n let newData = new Uint8ClampedArray(this.width * this.height * 4);\r\n\r\n switch (this.channels) {\r\n case 1: // grayscale to rgba\r\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = 255;\r\n }\r\n break;\r\n case 3: // rgb to rgba\r\n for (let i = 0, offset = 0; i < this.data.length; i += 3) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i + 1];\r\n newData[offset++] = this.data[i + 2];\r\n newData[offset++] = 255;\r\n }\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n\r\n return this._update(newData, this.width, this.height, 4);\r\n }\r\n\r\n /**\r\n * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing.\r\n * @param {number} width - The width of the new image.\r\n * @param {number} height - The height of the new image.\r\n * @returns {Promise} - `this` to support chaining.\r\n */\r\n async resize(width, height) {\r\n if (CanvasClass) {\r\n // Store number of channels before resizing\r\n let numChannels = this.channels;\r\n\r\n // Create canvas object for this image\r\n let canvas = this.toCanvas();\r\n\r\n // Actually perform resizing using the canvas API\r\n const ctx = new CanvasClass(width, height).getContext('2d');\r\n\r\n // Draw image to context, resizing in the process\r\n ctx.drawImage(canvas, 0, 0, width, height);\r\n\r\n // Create image from the resized data\r\n let resizedImage = new CustomImage(ctx.getImageData(0, 0, width, height).data, width, height, 4);\r\n\r\n // Convert back so that image has the same number of channels as before\r\n return resizedImage.convert(numChannels);\r\n\r\n } else {\r\n // Create sharp image from raw data, and resize\r\n let img = sharp(this.data, {\r\n raw: {\r\n width: this.width,\r\n height: this.height,\r\n channels: this.channels\r\n }\r\n }).resize({\r\n // https://github.com/lovell/sharp/blob/main/docs/api-resize.md\r\n width, height,\r\n fit: 'fill',\r\n kernel: 'cubic'\r\n });\r\n return await loadImageFunction(img);\r\n }\r\n\r\n }\r\n\r\n toCanvas() {\r\n // Clone, and convert data to RGBA before drawing to canvas.\r\n // This is because the canvas API only supports RGBA\r\n let cloned = this.clone().rgba();\r\n\r\n // Create canvas object for the cloned image\r\n let clonedCanvas = new CanvasClass(cloned.width, cloned.height);\r\n\r\n // Draw image to context\r\n let data = new ImageDataClass(cloned.data, cloned.width, cloned.height);\r\n clonedCanvas.getContext('2d').putImageData(data, 0, 0);\r\n\r\n return clonedCanvas;\r\n }\r\n\r\n /**\r\n * Helper method to update the image data.\r\n * @param {Uint8ClampedArray} data - The new image data.\r\n * @param {number} width - The new width of the image.\r\n * @param {number} height - The new height of the image.\r\n * @param {1|2|3|4} channels - The new number of channels of the image.\r\n */\r\n _update(data, width, height, channels = null) {\r\n this.data = data;\r\n this.width = width;\r\n this.height = height;\r\n if (channels !== null) {\r\n this.channels = channels;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Clone the image\r\n * @returns {CustomImage} - The cloned image\r\n */\r\n clone() {\r\n return new CustomImage(this.data.slice(), this.width, this.height, this.channels);\r\n }\r\n\r\n /**\r\n * Helper method for converting image to have a certain number of channels\r\n * @param {number} numChannels - The number of channels. Must be 1, 3, or 4.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n convert(numChannels) {\r\n if (this.channels === numChannels) return this; // Already correct number of channels\r\n\r\n switch (numChannels) {\r\n case 1:\r\n this.grayscale();\r\n break;\r\n case 3:\r\n this.rgb();\r\n break;\r\n case 4:\r\n this.rgba();\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Save the image to the given path. This method is only available in environments with access to the FileSystem.\r\n * @param {string|Buffer|URL} path - The path to save the image to.\r\n * @param {string} [mime='image/png'] - The mime type of the image.\r\n */\r\n save(path, mime = 'image/png') {\r\n if (!env.useFS) {\r\n throw new Error('Unable to save the image because filesystem is disabled in this environment.')\r\n }\r\n\r\n let canvas = this.toCanvas();\r\n const buffer = canvas.toBuffer(mime);\r\n fs.writeFileSync(path, buffer);\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n CustomImage,\r\n};\r\n","\r\n/**\r\n * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray\r\n * @typedef {BigInt64Array | BigUint64Array} BigTypedArray\r\n * @typedef {TypedArray | BigTypedArray} AnyTypedArray\r\n */\r\n\r\n/**\r\n * @param {TypedArray} input\r\n */\r\nfunction interpolate(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) {\r\n // TODO use mode and align_corners\r\n\r\n // Output image dimensions\r\n const x_scale = out_width / in_width;\r\n const y_scale = out_height / in_height;\r\n\r\n // Output image\r\n // @ts-ignore\r\n const out_img = new input.constructor(out_height * out_width * in_channels);\r\n\r\n // Pre-calculate strides\r\n const inStride = in_height * in_width;\r\n const outStride = out_height * out_width;\r\n\r\n for (let i = 0; i < out_height; ++i) {\r\n for (let j = 0; j < out_width; ++j) {\r\n // Calculate output offset\r\n const outOffset = i * out_width + j;\r\n\r\n // Calculate input pixel coordinates\r\n const x = (j + 0.5) / x_scale - 0.5;\r\n const y = (i + 0.5) / y_scale - 0.5;\r\n\r\n // Calculate the four nearest input pixels\r\n // We also check if the input pixel coordinates are within the image bounds\r\n let x1 = Math.floor(x);\r\n let y1 = Math.floor(y);\r\n const x2 = Math.min(x1 + 1, in_width - 1);\r\n const y2 = Math.min(y1 + 1, in_height - 1);\r\n\r\n x1 = Math.max(x1, 0);\r\n y1 = Math.max(y1, 0);\r\n\r\n\r\n // Calculate the fractional distances between the input pixel and the four nearest pixels\r\n const s = x - x1;\r\n const t = y - y1;\r\n\r\n // Perform bilinear interpolation\r\n const w1 = (1 - s) * (1 - t);\r\n const w2 = s * (1 - t);\r\n const w3 = (1 - s) * t;\r\n const w4 = s * t;\r\n\r\n // Calculate the four nearest input pixel indices\r\n const yStride = y1 * in_width;\r\n const xStride = y2 * in_width;\r\n const idx1 = yStride + x1;\r\n const idx2 = yStride + x2;\r\n const idx3 = xStride + x1;\r\n const idx4 = xStride + x2;\r\n\r\n for (let k = 0; k < in_channels; ++k) {\r\n // Calculate channel offset\r\n const cOffset = k * inStride;\r\n\r\n out_img[k * outStride + outOffset] =\r\n w1 * input[cOffset + idx1] +\r\n w2 * input[cOffset + idx2] +\r\n w3 * input[cOffset + idx3] +\r\n w4 * input[cOffset + idx4];\r\n }\r\n }\r\n }\r\n\r\n return out_img;\r\n}\r\n\r\n\r\n/**\r\n * Helper method to transpose a AnyTypedArray directly\r\n * @param {T} array \r\n * @template {AnyTypedArray} T \r\n * @param {number[]} dims \r\n * @param {number[]} axes \r\n * @returns {[T, number[]]} The transposed array and the new shape.\r\n */\r\nfunction transpose_data(array, dims, axes) {\r\n // Calculate the new shape of the transposed array\r\n // and the stride of the original array\r\n const shape = new Array(axes.length);\r\n const stride = new Array(axes.length);\r\n\r\n for (let i = axes.length - 1, s = 1; i >= 0; --i) {\r\n stride[i] = s;\r\n shape[i] = dims[axes[i]];\r\n s *= shape[i];\r\n }\r\n\r\n // Precompute inverse mapping of stride\r\n const invStride = axes.map((_, i) => stride[axes.indexOf(i)]);\r\n\r\n // Create the transposed array with the new shape\r\n // @ts-ignore\r\n const transposedData = new array.constructor(array.length);\r\n\r\n // Transpose the original array to the new array\r\n for (let i = 0; i < array.length; ++i) {\r\n let newIndex = 0;\r\n for (let j = dims.length - 1, k = i; j >= 0; --j) {\r\n newIndex += (k % dims[j]) * invStride[j];\r\n k = Math.floor(k / dims[j]);\r\n }\r\n transposedData[newIndex] = array[i];\r\n }\r\n\r\n return [transposedData, shape];\r\n}\r\n\r\nmodule.exports = {\r\n interpolate,\r\n transpose: transpose_data,\r\n}\r\n","const {\r\n Callable,\r\n getModelFile,\r\n fetchJSON,\r\n dispatchCallback,\r\n isIntegralNumber,\r\n} = require(\"./utils.js\");\r\n\r\nconst {\r\n Sampler,\r\n} = require(\"./samplers.js\");\r\n\r\n\r\nconst {\r\n LogitsProcessorList,\r\n GenerationConfig,\r\n ForceTokensLogitsProcessor,\r\n ForcedBOSTokenLogitsProcessor,\r\n ForcedEOSTokenLogitsProcessor,\r\n WhisperTimeStampLogitsProcessor,\r\n NoRepeatNGramLogitsProcessor,\r\n RepetitionPenaltyLogitsProcessor\r\n} = require(\"./generation.js\");\r\n\r\nconst { executionProviders, ONNX } = require('./backends/onnx.js');\r\nconst {\r\n Tensor,\r\n cat\r\n} = require('./tensor_utils');\r\nconst { InferenceSession, Tensor: ONNXTensor } = ONNX;\r\n\r\n//////////////////////////////////////////////////\r\n// Helper functions\r\n/**\r\n * Constructs an InferenceSession using a model file located at the specified path.\r\n * @param {string} modelPath - The path to the directory containing the model file.\r\n * @param {string} fileName - The name of the model file.\r\n * @param {function} [progressCallback=null] - An optional function to track progress during the creation of the session.\r\n * @returns {Promise} - A Promise that resolves to an InferenceSession object.\r\n */\r\nasync function constructSession(modelPath, fileName, progressCallback = null) {\r\n let buffer = await getModelFile(modelPath, fileName, progressCallback);\r\n\r\n // TODO add option for user to force specify their desired execution provider\r\n try {\r\n return await InferenceSession.create(buffer, {\r\n executionProviders,\r\n });\r\n } catch (err) {\r\n console.warn(err);\r\n console.warn(\r\n 'Something went wrong during model construction (most likely a missing operation). ' +\r\n 'Using `wasm` as a fallback. '\r\n )\r\n return await InferenceSession.create(buffer, {\r\n executionProviders: ['wasm']\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Executes an InferenceSession using the specified inputs.\r\n * @param {InferenceSession} session - The InferenceSession object to run.\r\n * @param {Object} inputs - An object that maps input names to input tensors.\r\n * @returns {Promise} - A Promise that resolves to an object that maps output names to output tensors.\r\n */\r\nasync function sessionRun(session, inputs) {\r\n try {\r\n let output = await session.run(inputs);\r\n output = replaceTensors(output);\r\n return output;\r\n } catch (e) {\r\n console.error(`An error occurred during model execution: \"${e}\".`);\r\n console.error('Inputs given to model:', inputs);\r\n throw e;\r\n }\r\n}\r\n\r\n/**\r\n * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions.\r\n * @param {Object} obj - The object to replace tensor objects in.\r\n * @returns {Object} - The object with tensor objects replaced by custom Tensor objects.\r\n */\r\nfunction replaceTensors(obj) {\r\n // Convert ONNX Tensors with our custom Tensor class\r\n // to support additional functions\r\n for (let prop in obj) {\r\n if (obj[prop] instanceof ONNXTensor) {\r\n obj[prop] = new Tensor(obj[prop]);\r\n }\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Prepares an attention mask for a sequence of tokens based on configuration options.\r\n * @param {Object} self - The calling object instance.\r\n * @param {Tensor} tokens - The input tokens.\r\n * @returns {Tensor} - The attention mask tensor.\r\n */\r\nfunction _prepare_attention_mask(self, tokens) {\r\n\r\n // Prepare attention mask\r\n let pad_token_id = self.config.pad_token_id ?? null;\r\n let eos_token_id = self.config.eos_token_id ?? null;\r\n if (isIntegralNumber(eos_token_id)) {\r\n eos_token_id = [eos_token_id];\r\n }\r\n\r\n let is_pad_token_in_inputs = tokens.indexOf(pad_token_id) !== -1;\r\n let is_pad_token_not_equal_to_eos_token_id = (eos_token_id === null) || !eos_token_id.includes(pad_token_id)\r\n\r\n if (is_pad_token_in_inputs && is_pad_token_not_equal_to_eos_token_id) {\r\n let data = BigInt64Array.from(\r\n // Note: != so that int matches bigint\r\n tokens.data.map(x => x != pad_token_id)\r\n )\r\n return new Tensor('int64', data, tokens.dims)\r\n } else {\r\n return new Tensor(\r\n 'int64',\r\n new BigInt64Array(tokens.data.length).fill(1n),\r\n tokens.dims\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * Creates a boolean tensor with a single value.\r\n * @param {boolean} value - The value of the tensor.\r\n * @returns {Tensor} - The boolean tensor.\r\n */\r\nfunction boolTensor(value) {\r\n // Create boolean tensor\r\n return new Tensor('bool', [value], [1]);\r\n}\r\n\r\n// JS doesn't support mixins, so we define some reused functions here, and allow \"this\" to be passed in\r\n/**\r\n * Loads a sequence-to-sequence model from the specified path.\r\n * @param {string} modelPath - The path to the model directory.\r\n * @param {function} progressCallback - The optional progress callback function.\r\n * @returns {Promise<[any, any, any, any]>} - A promise that resolves with information about the loaded model.\r\n */\r\nasync function seq2seqLoadModel(modelPath, progressCallback) {\r\n let info = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'encoder_model.onnx', progressCallback),\r\n constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback),\r\n fetchJSON(modelPath, 'generation_config.json', progressCallback, false),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n return info;\r\n}\r\n\r\n/**\r\n * Perform forward pass on the seq2seq model.\r\n * @async\r\n * @function\r\n * @param {Object} self - The seq2seq model object.\r\n * @param {Object} model_inputs - The input object for the model containing encoder and decoder inputs.\r\n * @param {Object} options - The options\r\n * @param {string} [options.encoder_input_name='input_ids'] - The name of the input tensor for the encoder.\r\n * @param {boolean} [options.add_decoder_pkv=true] - Flag to add the decoder past key values.\r\n * @returns {Promise} - Promise that resolves with the output of the seq2seq model.\r\n */\r\nasync function seq2seq_forward(self, model_inputs, {\r\n encoder_input_name = 'input_ids',\r\n add_decoder_pkv = true\r\n} = {}) {\r\n let encoderOutputs = model_inputs.encoder_outputs;\r\n let pastKeyValues = model_inputs.past_key_values;\r\n\r\n if (encoderOutputs === null) {\r\n const encoderFeeds = {\r\n [encoder_input_name]: model_inputs[encoder_input_name],\r\n }\r\n\r\n if (self.session.inputNames.includes('attention_mask')) {\r\n encoderFeeds.attention_mask = model_inputs.attention_mask\r\n }\r\n const encoderResults = await sessionRun(self.session, encoderFeeds);\r\n encoderOutputs = encoderResults.last_hidden_state;\r\n }\r\n let decoderFeeds = {\r\n input_ids: model_inputs.decoder_input_ids,\r\n encoder_hidden_states: encoderOutputs,\r\n use_cache_branch: boolTensor(pastKeyValues !== null)\r\n };\r\n\r\n if (self.decoder_merged_session.inputNames.includes('encoder_attention_mask')) {\r\n decoderFeeds.encoder_attention_mask = model_inputs.attention_mask\r\n }\r\n self.addPastKeyValues(decoderFeeds, pastKeyValues, add_decoder_pkv);\r\n\r\n const decoderResults = await sessionRun(self.decoder_merged_session, decoderFeeds);\r\n let logits = decoderResults.logits;\r\n pastKeyValues = self.getPastKeyValues(decoderResults, pastKeyValues);\r\n return new Seq2SeqLMOutput(logits, pastKeyValues, encoderOutputs);\r\n}\r\n\r\n/**\r\n * Start the beam search process for the seq2seq model.\r\n * @function\r\n * @param {Object} self - The seq2seq model object.\r\n * @param {Object[]} inputTokenIds - Array of input token ids for each input sequence.\r\n * @param {number} numOutputTokens - The maximum number of output tokens for the model.\r\n * @param {boolean} [requires_attention_mask=true] - Flag to indicate if the model requires an attention mask.\r\n * @returns {Object[]} - Array of beam search objects.\r\n */\r\nfunction seq2seqStartBeams(self, inputTokenIds, numOutputTokens, requires_attention_mask = true) {\r\n let beams = [];\r\n let beamId = 0;\r\n for (let tokens of inputTokenIds) {\r\n // TODO: Improve\r\n // Currently, just add back batch dimension.\r\n // In future, allow for true parallel execution\r\n tokens.dims = [1, ...tokens.dims]\r\n\r\n // Create beam\r\n let start = {\r\n inputs: tokens,\r\n encoder_outputs: null,\r\n past_key_values: null,\r\n\r\n // decoder_input_ids == output_token_ids\r\n output_token_ids: [self.config.decoder_start_token_id],\r\n done: false,\r\n score: 0,\r\n id: beamId++ // assign unique id to beams\r\n }\r\n\r\n if (requires_attention_mask) {\r\n start.attention_mask = _prepare_attention_mask(self, tokens);\r\n }\r\n\r\n beams.push(start);\r\n }\r\n\r\n return beams;\r\n}\r\n\r\n/**\r\n * Run beam search on the seq2seq model for a single beam.\r\n * @async\r\n * @function\r\n * @param {Object} self - The seq2seq model object.\r\n * @param {Object} beam - The beam search object for which to run the model.\r\n * @param {Object} options - options\r\n * @param {string} [options.input_name='input_ids'] - The name of the input tensor for the encoder.\r\n * @returns {Promise} - Promise that resolves with the output of the seq2seq model for the given beam.\r\n */\r\nasync function seq2seqRunBeam(self, beam, {\r\n input_name = 'input_ids',\r\n} = {}\r\n) {\r\n // 1. Prepare\r\n let model_inputs = {\r\n [input_name]: beam.inputs,\r\n decoder_input_ids: self.toI64Tensor(beam.output_token_ids.slice(-1)),\r\n encoder_outputs: beam.encoder_outputs,\r\n past_key_values: beam.past_key_values,\r\n }\r\n if (beam.attention_mask) {\r\n model_inputs.attention_mask = beam.attention_mask\r\n }\r\n\r\n // 2. Run\r\n let output = await self.forward(model_inputs);\r\n\r\n // 3. Update\r\n beam.past_key_values = output.past_key_values;\r\n beam.encoder_outputs = output.encoder_outputs;\r\n\r\n return output;\r\n}\r\n\r\n/**\r\n * Forward pass of the text generation model.\r\n * @async\r\n * @function\r\n * @param {Object} self - The text generation model object.\r\n * @param {Object} model_inputs - The input data to be used for the forward pass.\r\n * @returns {Promise} - Promise that resolves with an object containing the logits and past key values.\r\n */\r\nasync function textgen_forward(self, model_inputs) {\r\n let past_key_values = model_inputs.past_key_values;\r\n let decoderFeeds = {\r\n input_ids: model_inputs.input_ids,\r\n attention_mask: model_inputs.attention_mask,\r\n use_cache_branch: boolTensor(past_key_values !== null)\r\n }\r\n self.addPastKeyValues(decoderFeeds, past_key_values)\r\n\r\n let decoderResults = await sessionRun(self.session, decoderFeeds);\r\n let logits = decoderResults.logits;\r\n\r\n past_key_values = self.getPastKeyValues(decoderResults, past_key_values);\r\n return { logits, past_key_values };\r\n}\r\n\r\n/**\r\n * Starts the generation of text by initializing the beams for the given input token IDs.\r\n * @param {Object} self - The text generation model object.\r\n * @param {any} inputTokenIds - An array of input token IDs to generate text from.\r\n * @param {number} numOutputTokens - The maximum number of tokens to generate for each beam.\r\n * @param {Tensor} [inputs_attention_mask] - The attention mask tensor for the input token IDs.\r\n * @returns {Object[]} An array of beams initialized with the given inputs and parameters.\r\n */\r\nfunction textgenStartBeams(self, inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n let beams = [];\r\n\r\n let beamId = 0;\r\n for (let tokens of inputTokenIds) {\r\n // TODO: Improve\r\n // Currently, just add back batch dimension.\r\n // In future, allow for true parallel execution\r\n tokens.dims = [1, ...tokens.dims]\r\n\r\n let attn_mask;\r\n if (inputs_attention_mask) {\r\n attn_mask = inputs_attention_mask.get(beamId)\r\n attn_mask.dims = [1, ...attn_mask.dims]\r\n\r\n } else {\r\n attn_mask = _prepare_attention_mask(self, tokens)\r\n }\r\n\r\n let start = {\r\n input: tokens,\r\n model_input_ids: tokens,\r\n attention_mask: attn_mask,\r\n past_key_values: null,\r\n\r\n output_token_ids: [],\r\n num_output_tokens: numOutputTokens,\r\n\r\n done: false,\r\n score: 0,\r\n id: beamId++ // assign unique id to beams\r\n }\r\n\r\n beams.push(start);\r\n }\r\n return beams;\r\n}\r\n\r\n/**\r\n * Runs a single step of the text generation process for a given beam.\r\n *\r\n * @async\r\n * @function textgenRunBeam\r\n * @param {Object} self - The textgen object.\r\n * @param {Object} beam - The beam to run.\r\n * @param {Tensor} beam.input - The input tensor.\r\n * @param {Tensor} beam.model_input_ids - The input ids to the model.\r\n * @param {Tensor} beam.attention_mask - The attention mask.\r\n * @param {Object} beam.past_key_values - The past key values.\r\n * @param {number[]} beam.output_token_ids - The output token ids.\r\n * @returns {Promise} The output of the generation step.\r\n */\r\nasync function textgenRunBeam(self, beam) {\r\n let attnMaskData = new BigInt64Array(beam.input.data.length + beam.output_token_ids.length).fill(1n)\r\n\r\n // 1. Prepare\r\n let model_inputs = {\r\n input_ids: beam.model_input_ids,\r\n attention_mask: new Tensor(\r\n 'int64',\r\n attnMaskData,\r\n [1, attnMaskData.length]\r\n ),\r\n past_key_values: beam.past_key_values,\r\n }\r\n\r\n // 2. Run\r\n let output = await self.forward(model_inputs);\r\n\r\n // 3. Update\r\n beam.past_key_values = output.past_key_values;\r\n\r\n return output;\r\n}\r\n\r\n/**\r\n * Update a beam with a new token ID.\r\n * @param {object} beam - The beam to update.\r\n * @param {number} newTokenId - The new token ID to add to the beam's output.\r\n */\r\nfunction textgenUpdatebeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n beam.model_input_ids = new Tensor('int64', [BigInt(newTokenId)], [1, 1]);\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// Base class\r\n/**\r\n * A base class for pre-trained models that provides the model configuration and an ONNX session.\r\n * @extends Callable\r\n */\r\nclass PreTrainedModel extends Callable {\r\n /**\r\n * Creates a new instance of the `PreTrainedModel` class.\r\n * @param {object} config - The model configuration.\r\n * @param {any} session - session for the model.\r\n */\r\n constructor(config, session) {\r\n super();\r\n\r\n this.config = config;\r\n this.session = session;\r\n }\r\n\r\n /**\r\n * Disposes of all the ONNX sessions that were created during inference.\r\n * @returns {Promise} - An array of promises, one for each ONNX session that is being disposed.\r\n */\r\n async dispose() {\r\n // Dispose of all ONNX sessions sessions\r\n // TODO use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\r\n\r\n let promises = [];\r\n for (let key of Object.keys(this)) {\r\n let item = this[key];\r\n if (item instanceof InferenceSession) {\r\n promises.push(item.handler.dispose())\r\n }\r\n }\r\n return await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from the given modelPath.\r\n * @static\r\n * @async\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} progressCallback - A function to be called with progress updates.\r\n * @returns {Promise} A new instance of the PreTrainedModel class.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let config = await fetchJSON(modelPath, 'config.json', progressCallback);\r\n let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx';\r\n\r\n // Load model\r\n let session = await constructSession(modelPath, modelName, progressCallback);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n return new this(config, session);\r\n }\r\n\r\n /**\r\n * Converts an array or Tensor of integers to an int64 Tensor.\r\n * @param {Array|Tensor} items - The input integers to be converted.\r\n * @returns {Tensor} The int64 Tensor with the converted values.\r\n * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length.\r\n */\r\n toI64Tensor(items) {\r\n if (items instanceof Tensor) {\r\n return items;\r\n }\r\n // items is an array\r\n if (items.length === 0) {\r\n throw Error(\"items must be non-empty\");\r\n }\r\n\r\n if (Array.isArray(items[0])) {\r\n // batched\r\n if (items.some(x => x.length !== items[0].length)) {\r\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.\")\r\n }\r\n\r\n return new Tensor('int64',\r\n BigInt64Array.from(items.flat().map(x => BigInt(x))),\r\n [items.length, items[0].length]\r\n );\r\n } else {\r\n //flat\r\n return new Tensor('int64',\r\n BigInt64Array.from(items.map(x => BigInt(x))),\r\n [1, items.length]\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Runs the model with the provided inputs\r\n * @param {Object} model_inputs - Object containing input tensors\r\n * @returns {Promise} - Object containing output tensors\r\n */\r\n async _call(model_inputs) {\r\n return await sessionRun(this.session, model_inputs);\r\n }\r\n\r\n /**\r\n * Forward method should be implemented in subclasses.\r\n * @abstract\r\n * @param {object} model_inputs - The input data to the model in the format specified in the ONNX model.\r\n * @returns {Promise} - The output data from the model in the format specified in the ONNX model.\r\n * @throws {Error} - This method must be implemented in subclasses.\r\n */\r\n async forward(model_inputs) {\r\n throw Error(\"forward should be implemented in subclasses.\")\r\n }\r\n\r\n /**\r\n * @param {GenerationConfig} generation_config \r\n * @param {number} input_ids_seq_length \r\n * @returns {LogitsProcessorList}\r\n */\r\n _get_logits_processor(\r\n generation_config,\r\n input_ids_seq_length,\r\n // encoder_input_ids, TODO\r\n // prefix_allowed_tokens_fn, TODO\r\n logits_processor = null\r\n ) {\r\n const processors = new LogitsProcessorList();\r\n\r\n // if (generation_config.diversity_penalty !== null && generation_config.diversity_penalty > 0.0) {\r\n // processors.push(new HammingDiversityLogitsProcessor(\r\n // generation_config.diversity_penalty,\r\n // generation_config.num_beams,\r\n // generation_config.num_beam_groups\r\n // ));\r\n // }\r\n\r\n // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== 1.0) {\r\n // processors.push(new EncoderRepetitionPenaltyLogitsProcessor(\r\n // generation_config.encoder_repetition_penalty,\r\n // encoder_input_ids\r\n // ));\r\n // }\r\n\r\n if (generation_config.repetition_penalty !== null && generation_config.repetition_penalty !== 1.0) {\r\n processors.push(new RepetitionPenaltyLogitsProcessor(generation_config.repetition_penalty));\r\n }\r\n\r\n if (generation_config.no_repeat_ngram_size !== null && generation_config.no_repeat_ngram_size > 0) {\r\n processors.push(new NoRepeatNGramLogitsProcessor(generation_config.no_repeat_ngram_size));\r\n }\r\n\r\n // if (generation_config.encoder_no_repeat_ngram_size !== null && generation_config.encoder_no_repeat_ngram_size > 0) {\r\n // if (this.config.is_encoder_decoder) {\r\n // processors.push(new EncoderNoRepeatNGramLogitsProcessor(\r\n // generation_config.encoder_no_repeat_ngram_size,\r\n // encoder_input_ids\r\n // ));\r\n // } else {\r\n // throw new Error(\"It's impossible to use `encoder_no_repeat_ngram_size` with decoder-only architecture\");\r\n // }\r\n // }\r\n\r\n // if (generation_config.bad_words_ids !== null) {\r\n // processors.push(new NoBadWordsLogitsProcessor(generation_config.bad_words_ids, generation_config.eos_token_id));\r\n // }\r\n\r\n // if (generation_config.min_length !== null && generation_config.eos_token_id !== null && generation_config.min_length > 0) {\r\n // processors.push(new MinLengthLogitsProcessor(generation_config.min_length, generation_config.eos_token_id));\r\n // }\r\n\r\n // if (generation_config.min_new_tokens !== null && generation_config.eos_token_id !== null && generation_config.min_new_tokens > 0) {\r\n // processors.push(new MinNewTokensLengthLogitsProcessor(\r\n // input_ids_seq_length,\r\n // generation_config.min_new_tokens,\r\n // generation_config.eos_token_id\r\n // ));\r\n // }\r\n\r\n // if (prefix_allowed_tokens_fn !== null) {\r\n // processors.push(new PrefixConstrainedLogitsProcessor(\r\n // prefix_allowed_tokens_fn,\r\n // generation_config.num_beams / generation_config.num_beam_groups\r\n // ));\r\n // }\r\n\r\n\r\n if (generation_config.forced_bos_token_id !== null) {\r\n processors.push(new ForcedBOSTokenLogitsProcessor(generation_config.forced_bos_token_id));\r\n }\r\n\r\n if (generation_config.forced_eos_token_id !== null) {\r\n processors.push(new ForcedEOSTokenLogitsProcessor(\r\n generation_config.max_length,\r\n generation_config.forced_eos_token_id\r\n ));\r\n }\r\n\r\n // if (generation_config.remove_invalid_values === true) {\r\n // processors.push(new InfNanRemoveLogitsProcessor());\r\n // }\r\n\r\n // if (generation_config.exponential_decay_length_penalty !== null) {\r\n // processors.push(new ExponentialDecayLengthPenalty(\r\n // generation_config.exponential_decay_length_penalty,\r\n // generation_config.eos_token_id,\r\n // input_ids_seq_length\r\n // ));\r\n // }\r\n\r\n // if (generation_config.suppress_tokens !== null) {\r\n // processors.push(new SuppressTokensLogitsProcessor(generation_config.suppress_tokens));\r\n // }\r\n\r\n // if (generation_config.begin_suppress_tokens !== null) {\r\n // let begin_index = input_ids_seq_length;\r\n // begin_index = (input_ids_seq_length > 1 || generation_config.forced_bos_token_id === null) ? begin_index : begin_index + 1;\r\n // if (generation_config.forced_decoder_ids !== null) {\r\n // begin_index += generation_config.forced_decoder_ids[generation_config.forced_decoder_ids.length - 1][0];\r\n // }\r\n // processors.push(new SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, begin_index));\r\n // }\r\n\r\n if (generation_config.forced_decoder_ids !== null) {\r\n processors.push(new ForceTokensLogitsProcessor(generation_config.forced_decoder_ids));\r\n }\r\n\r\n if (logits_processor !== null) {\r\n processors.extend(logits_processor)\r\n }\r\n\r\n // `LogitNormalization` should always be the last logit processor, when present\r\n // if (generation_config.renormalize_logits === true) {\r\n // processors.push(new LogitNormalization());\r\n // }\r\n\r\n return processors;\r\n }\r\n\r\n /**\r\n * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation.\r\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.\r\n *\r\n * @param {GenerationConfig} generation_config - A `GenerationConfig` object containing generation parameters.\r\n * @returns {GenerationConfig} The final generation config object to be used by the model for text generation.\r\n */\r\n _get_generation_config(generation_config) {\r\n // Create empty generation config (contains defaults)\r\n let gen_config = new GenerationConfig();\r\n\r\n // Apply model's generation config, if it exists\r\n if ('generation_config' in this) {\r\n Object.assign(gen_config, this.generation_config);\r\n }\r\n\r\n // Finally, use any generation config specified by the user\r\n // when calling `generate`\r\n if (generation_config !== null) {\r\n Object.assign(gen_config, generation_config);\r\n }\r\n return gen_config;\r\n }\r\n\r\n /**\r\n * Generates text based on the given inputs and generation configuration using the model.\r\n * @param {Array} inputs - An array of input token IDs.\r\n * @param {Object|null} generation_config - The generation configuration to use. If null, default configuration will be used.\r\n * @param {Object|null} logits_processor - An optional logits processor to use. If null, a new LogitsProcessorList instance will be created.\r\n * @param {Object} options - options\r\n * @param {Object} [options.inputs_attention_mask=null] - An optional attention mask for the inputs.\r\n * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs.\r\n * @throws {Error} Throws an error if the inputs array is empty.\r\n */\r\n async generate(\r\n inputs,\r\n generation_config = null,\r\n logits_processor = null,\r\n {\r\n inputs_attention_mask = null\r\n } = {},\r\n ) {\r\n\r\n if (inputs.length === 0) {\r\n throw Error(\"Must supply a non-empty array of input token ids.\")\r\n }\r\n\r\n // Update generation config with defaults\r\n generation_config = this._get_generation_config(generation_config);\r\n\r\n logits_processor = logits_processor ?? new LogitsProcessorList()\r\n\r\n // TODO Update generation config\r\n // this.generation_config\r\n\r\n // Update logits processor\r\n logits_processor = this._get_logits_processor(\r\n generation_config,\r\n inputs.length,\r\n logits_processor\r\n )\r\n\r\n // TODO implement early_stopping\r\n // https://huggingface.co/blog/how-to-generate\r\n\r\n let numOutputTokens = 1;\r\n const maxOutputTokens = numOutputTokens + (generation_config.max_new_tokens ?? Infinity);\r\n\r\n let sampler = Sampler.getSampler(generation_config);\r\n\r\n let beams = this.getStartBeams(inputs, numOutputTokens, inputs_attention_mask);\r\n\r\n while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) {\r\n let newest_beams = [];\r\n for (let beam of beams) {\r\n if (beam.done) {\r\n // TODO add length penalty (for ending early)\r\n // Add this beam back into the pool\r\n newest_beams.push(beam);\r\n continue\r\n }\r\n\r\n let output = await this.runBeam(beam);\r\n\r\n // Logits are of the form [batch_size, out_seq_length, vocab_size]\r\n // In most cases, this will be [batch_size, 1, vocab_size]\r\n // So, we select the last token's logits:\r\n // (equivalent to `logits = outputs.logits[:, -1, :]`)\r\n let extractedLogits = [];\r\n for (const batch of output.logits) {\r\n // Extract logits corresponding to the last token\r\n let lastLogits = batch.get(batch.dims[0] - 1);\r\n\r\n // Add back batch dimension (needed for `cat`)\r\n lastLogits.dims = [1, ...lastLogits.dims];\r\n extractedLogits.push(lastLogits)\r\n }\r\n let logits = cat(extractedLogits);\r\n logits_processor(beam.output_token_ids, logits)\r\n\r\n let sampledTokens = sampler(logits);\r\n for (let [newTokenId, logProb] of sampledTokens) {\r\n // use previous beam as a starting point\r\n let newBeam = { ...beam };\r\n\r\n // update new beam\r\n this.updateBeam(newBeam, newTokenId);\r\n\r\n newBeam.score += logProb;\r\n\r\n if (newTokenId === this.config.eos_token_id) {\r\n newBeam.done = true;\r\n }\r\n newest_beams.push(newBeam);\r\n }\r\n }\r\n ++numOutputTokens;\r\n\r\n // Next, we get the best beams, per ID\r\n newest_beams = this.groupBeams(newest_beams).map(\r\n group => group\r\n .sort((a, b) => b.score - a.score) // sort based on score\r\n .slice(0, generation_config.num_beams) // remove outside beam width\r\n );\r\n\r\n // Flatten beams\r\n beams = newest_beams.flat();\r\n\r\n // Run callback\r\n if (generation_config.callback_function) {\r\n generation_config.callback_function(beams);\r\n }\r\n }\r\n\r\n return this.groupBeams(beams).map(\r\n batch => {\r\n if (generation_config.num_return_sequences > 1) {\r\n return batch.slice(0, generation_config.num_return_sequences).map(x => x.output_token_ids);\r\n } else {\r\n return [batch[0].output_token_ids];\r\n }\r\n }\r\n )\r\n }\r\n\r\n /**\r\n * Groups an array of beam objects by their ids.\r\n *\r\n * @param {Array} beams - The array of beam objects to group.\r\n * @returns {Array} - An array of arrays, where each inner array contains beam objects with the same id.\r\n */\r\n groupBeams(beams) {\r\n // Group beams by their ids\r\n const groups = {};\r\n for (const obj of beams) {\r\n if (groups[obj.id] === undefined) {\r\n groups[obj.id] = [obj];\r\n } else {\r\n groups[obj.id].push(obj);\r\n }\r\n }\r\n\r\n return Object.values(groups);\r\n }\r\n\r\n /**\r\n * Returns an object containing past key values from the given decoder results object.\r\n *\r\n * @param {Object} decoderResults - The decoder results object.\r\n * @param {Object} pastKeyValues - The previous past key values.\r\n * @returns {Object} - An object containing past key values.\r\n */\r\n getPastKeyValues(decoderResults, pastKeyValues) {\r\n\r\n const pkvs = {};\r\n\r\n for (const name in decoderResults) {\r\n if (name.startsWith('present')) {\r\n let newName = name.replace('present', 'past_key_values');\r\n\r\n if (pastKeyValues !== null && name.includes('encoder')) {\r\n // Optimization introduced by optimum to reuse past key values. So, we just replace the constant\r\n // outputs with the previous past key values.\r\n // https://github.com/huggingface/optimum/blob/0bf2c05fb7e1182b52d21b703cfc95fd9e4ea3dc/optimum/onnxruntime/base.py#L677-L704\r\n pkvs[newName] = pastKeyValues[newName];\r\n } else {\r\n pkvs[newName] = decoderResults[name];\r\n }\r\n }\r\n }\r\n return pkvs;\r\n }\r\n\r\n /**\r\n * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.\r\n *\r\n * @param {Object} decoderFeeds - The decoder feeds object to add past key values to.\r\n * @param {Object} pastKeyValues - An object containing past key values.\r\n * @param {boolean} [hasDecoder=false] - Whether the model has a decoder.\r\n */\r\n addPastKeyValues(decoderFeeds, pastKeyValues, hasDecoder = false) {\r\n if (pastKeyValues === null) {\r\n // TODO support batches (i.e., batch_size > 1)\r\n if (hasDecoder) {\r\n let encoder_dims = [1, this.num_encoder_heads, 0, this.encoder_dim_kv];\r\n for (let i = 0; i < this.num_encoder_layers; ++i) {\r\n decoderFeeds[`past_key_values.${i}.encoder.key`] = new Tensor('float32', [], encoder_dims)\r\n decoderFeeds[`past_key_values.${i}.encoder.value`] = new Tensor('float32', [], encoder_dims)\r\n }\r\n\r\n let decoder_dims = [1, this.num_decoder_heads, 0, this.decoder_dim_kv];\r\n for (let i = 0; i < this.num_decoder_layers; ++i) {\r\n decoderFeeds[`past_key_values.${i}.decoder.key`] = new Tensor('float32', [], decoder_dims)\r\n decoderFeeds[`past_key_values.${i}.decoder.value`] = new Tensor('float32', [], decoder_dims)\r\n }\r\n\r\n } else {\r\n let dims = [1, this.num_heads, 0, this.dim_kv]\r\n for (let i = 0; i < this.num_layers; ++i) {\r\n decoderFeeds[`past_key_values.${i}.key`] = new Tensor('float32', [], dims)\r\n decoderFeeds[`past_key_values.${i}.value`] = new Tensor('float32', [], dims)\r\n }\r\n }\r\n\r\n } else {\r\n Object.assign(decoderFeeds, pastKeyValues)\r\n }\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n// Base model output class\r\nclass ModelOutput { }\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// Bert models\r\nclass BertPreTrainedModel extends PreTrainedModel { }\r\nclass BertModel extends BertPreTrainedModel { }\r\n\r\n/**\r\n * BertForMaskedLM is a class representing a BERT model for masked language modeling.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForMaskedLM extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for masked language modeling.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * BertForSequenceClassification is a class representing a BERT model for sequence classification.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForSequenceClassification extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for sequence classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * BertForTokenClassification is a class representing a BERT model for token classification.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForTokenClassification extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for token classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new TokenClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * BertForQuestionAnswering is a class representing a BERT model for question answering.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForQuestionAnswering extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for question answering.\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// DistilBert models\r\nclass DistilBertPreTrainedModel extends PreTrainedModel { }\r\nclass DistilBertModel extends DistilBertPreTrainedModel { }\r\n\r\n/**\r\n * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForSequenceClassification extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for sequence classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForTokenClassification extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for token classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new TokenClassifierOutput(logits)\r\n }\r\n}\r\n\r\n\r\n/**\r\n * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForQuestionAnswering extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for question answering.\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n\r\n/**\r\n * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForMaskedLM extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// MobileBert models\r\nclass MobileBertPreTrainedModel extends PreTrainedModel { }\r\nclass MobileBertModel extends MobileBertPreTrainedModel { }\r\n\r\n/**\r\n * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task.\r\n * @extends MobileBertPreTrainedModel\r\n */\r\nclass MobileBertForMaskedLM extends MobileBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * @extends MobileBertPreTrainedModel\r\n */\r\nclass MobileBertForSequenceClassification extends MobileBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * @extends MobileBertPreTrainedModel\r\n */\r\nclass MobileBertForQuestionAnswering extends MobileBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// SqueezeBert models\r\nclass SqueezeBertPreTrainedModel extends PreTrainedModel { }\r\nclass SqueezeBertModel extends SqueezeBertPreTrainedModel { }\r\nclass SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\nclass SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\nclass SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// Albert models\r\nclass AlbertPreTrainedModel extends PreTrainedModel { }\r\nclass AlbertModel extends AlbertPreTrainedModel { }\r\nclass AlbertForSequenceClassification extends AlbertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\nclass AlbertForQuestionAnswering extends AlbertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\nclass AlbertForMaskedLM extends AlbertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// T5 models\r\nclass T5PreTrainedModel extends PreTrainedModel { };\r\n\r\nclass T5Model extends T5PreTrainedModel {\r\n /**\r\n * Generates text based on the provided arguments.\r\n * @throws {Error} - Throws an error as the current model class (T5Model) is not compatible with `.generate()`.\r\n * @returns {Promise}\r\n * @param {any[]} args\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * T5Model is a class representing a T5 model for conditional generation.\r\n * @extends T5PreTrainedModel\r\n */\r\nclass T5ForConditionalGeneration extends T5PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `T5ForConditionalGeneration` class.\r\n * @param {object} config - The model configuration.\r\n * @param {any} session - session for the model.\r\n * @param {any} decoder_merged_session - session for the decoder.\r\n * @param {GenerationConfig} generation_config - The generation configuration.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.num_decoder_layers;\r\n this.num_decoder_heads = this.config.num_heads;\r\n this.decoder_dim_kv = this.config.d_kv;\r\n\r\n this.num_encoder_layers = this.config.num_layers;\r\n this.num_encoder_heads = this.config.num_heads;\r\n this.encoder_dim_kv = this.config.d_kv;\r\n }\r\n\r\n /**\r\n * Loads the pre-trained model from a given path.\r\n * @async\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} progressCallback - A function to call with progress updates (optional).\r\n * @returns {Promise} The loaded model instance.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Generates the start beams for a given set of inputs and output length.\r\n * @param {number[][]} inputs - The input token IDs.\r\n * @param {number} numOutputTokens - The desired output length.\r\n * @returns {Array} The start beams.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with a new token ID.\r\n * @param {any} beam - The current beam.\r\n * @param {number} newTokenId - The new token ID to add to the output sequence.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model for a given set of inputs.\r\n * @async\r\n * @param {Object} model_inputs - The model inputs.\r\n * @returns {Promise} The model output.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// MT5 models\r\nclass MT5PreTrainedModel extends PreTrainedModel { };\r\n\r\nclass MT5Model extends MT5PreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args\r\n * @returns {Promise}\r\n * @throws {Error}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (MT5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'MT5ForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * A class representing a conditional sequence-to-sequence model based on the MT5 architecture.\r\n *\r\n * @extends MT5PreTrainedModel\r\n */\r\nclass MT5ForConditionalGeneration extends MT5PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `MT5ForConditionalGeneration` class.\r\n * @param {any} config - The model configuration.\r\n * @param {any} session - The ONNX session containing the encoder weights.\r\n * @param {any} decoder_merged_session - The ONNX session containing the merged decoder weights.\r\n * @param {GenerationConfig} generation_config - The generation configuration.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.num_decoder_layers;\r\n this.num_decoder_heads = this.config.num_heads;\r\n this.decoder_dim_kv = this.config.d_kv;\r\n\r\n this.num_encoder_layers = this.config.num_layers;\r\n this.num_encoder_heads = this.config.num_heads;\r\n this.encoder_dim_kv = this.config.d_kv;\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from the given path.\r\n *\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function that is called with the download progress percentage (0-100).\r\n * @returns {Promise} - A Promise that resolves to a new `MT5ForConditionalGeneration` instance.\r\n * @static\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Generates the start beams for the given input tokens and output sequence length.\r\n *\r\n * @param {any[]} inputs - The input sequence.\r\n * @param {number} numOutputTokens - The desired length of the output sequence.\r\n * @param {...*} args - Additional arguments to pass to the `seq2seqStartBeams` function.\r\n * @returns {any[]} - An array of `Beam` objects representing the start beams.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new predicted token.\r\n * @param {any} beam - The beam to update.\r\n * @param {number} newTokenId - The index of the predicted token.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model on the given inputs.\r\n * @param {any} model_inputs - The model inputs.\r\n * @returns {Promise} - A Promise that resolves to the model outputs.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// Bart models\r\nclass BartPretrainedModel extends PreTrainedModel { };\r\n\r\n/**\r\n * BART encoder and decoder model.\r\n * \r\n * @hideconstructor\r\n * @extends BartPretrainedModel\r\n */\r\nclass BartModel extends BartPretrainedModel {\r\n /**\r\n * Throws an error because the current model class (BartModel) is not compatible with `.generate()`.\r\n * \r\n * @async\r\n * @throws {Error} The current model class (BartModel) is not compatible with `.generate()`.\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (BartModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'BartForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * BART model with a language model head for conditional generation.\r\n * @extends BartPretrainedModel\r\n */\r\nclass BartForConditionalGeneration extends BartPretrainedModel {\r\n /**\r\n * Creates a new instance of the `BartForConditionalGeneration` class.\r\n * @param {object} config - The configuration object for the Bart model.\r\n * @param {object} session - The ONNX session used to execute the model.\r\n * @param {object} decoder_merged_session - The ONNX session used to execute the decoder.\r\n * @param {object} generation_config - The generation configuration object.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.decoder_layers;\r\n this.num_decoder_heads = this.config.decoder_attention_heads;\r\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\r\n\r\n this.num_encoder_layers = this.config.encoder_layers;\r\n this.num_encoder_heads = this.config.encoder_attention_heads;\r\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\r\n }\r\n\r\n /**\r\n * Loads a BartForConditionalGeneration instance from a pretrained model stored on disk.\r\n * @param {string} modelPath - The path to the directory containing the pretrained model.\r\n * @param {function} [progressCallback=null] - An optional callback function to track the download progress.\r\n * @returns {Promise} - The pretrained BartForConditionalGeneration instance.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Returns the initial beam for generating output text.\r\n * @param {object} inputs - The input object containing the encoded input text.\r\n * @param {number} numOutputTokens - The maximum number of output tokens to generate.\r\n * @param {...any} args - Additional arguments to pass to the sequence-to-sequence generation function.\r\n * @returns {any} - The initial beam for generating output text.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the beam by appending the newly generated token ID to the list of output token IDs.\r\n * @param {any} beam - The current beam being generated.\r\n * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model for a given set of inputs.\r\n * @async\r\n * @param {Object} model_inputs - The model inputs.\r\n * @returns {Promise} The model output.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n\r\nclass BartForSequenceClassification extends BartPretrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for sequence classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// Roberta models\r\nclass RobertaPreTrainedModel extends PreTrainedModel { }\r\nclass RobertaModel extends RobertaPreTrainedModel { }\r\n\r\n/**\r\n * RobertaForMaskedLM class for performing masked language modeling on Roberta models.\r\n * @extends RobertaPreTrainedModel\r\n */\r\nclass RobertaForMaskedLM extends RobertaPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * RobertaForSequenceClassification class for performing sequence classification on Roberta models.\r\n * @extends RobertaPreTrainedModel\r\n */\r\nclass RobertaForSequenceClassification extends RobertaPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * RobertaForQuestionAnswering class for performing question answering on Roberta models.\r\n * @extends RobertaPreTrainedModel\r\n */\r\nclass RobertaForQuestionAnswering extends RobertaPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// T5 models\r\nclass WhisperPreTrainedModel extends PreTrainedModel { };\r\n\r\n/**\r\n * WhisperModel class for training Whisper models without a language model head.\r\n * @extends WhisperPreTrainedModel\r\n */\r\nclass WhisperModel extends WhisperPreTrainedModel {\r\n /**\r\n * Throws an error when attempting to generate output since this model doesn't have a language model head.\r\n * @throws Error\r\n * @returns {Promise}\r\n * @param {any[]} args\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (WhisperModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'WhisperForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.\r\n * @extends WhisperPreTrainedModel\r\n */\r\nclass WhisperForConditionalGeneration extends WhisperPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `WhisperForConditionalGeneration` class.\r\n * @param {Object} config - Configuration object for the model.\r\n * @param {Object} session - ONNX Session object for the model.\r\n * @param {Object} decoder_merged_session - ONNX Session object for the decoder.\r\n * @param {Object} generation_config - Configuration object for the generation process.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.decoder_layers;\r\n this.num_decoder_heads = this.config.decoder_attention_heads;\r\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\r\n\r\n this.num_encoder_layers = this.config.encoder_layers;\r\n this.num_encoder_heads = this.config.encoder_attention_heads;\r\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\r\n\r\n\r\n }\r\n\r\n /**\r\n * Generates outputs based on input and generation configuration.\r\n * @param {Object} inputs - Input data for the model.\r\n * @param {Object} generation_config - Configuration object for the generation process.\r\n * @param {Object} logits_processor - Optional logits processor object.\r\n * @returns {Promise} Promise object represents the generated outputs.\r\n */\r\n async generate(\r\n inputs,\r\n generation_config = null,\r\n logits_processor = null,\r\n ) {\r\n // Create generation config object\r\n generation_config = this._get_generation_config(generation_config);\r\n\r\n\r\n // Whisper has additional options for returning timestamps\r\n generation_config.return_timestamps ??= false;\r\n\r\n // TODO add language and task\r\n\r\n if (generation_config.return_timestamps) {\r\n logits_processor = [new WhisperTimeStampLogitsProcessor(generation_config)]\r\n }\r\n\r\n return super.generate(inputs, generation_config, logits_processor)\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from a saved model directory.\r\n * @param {string} modelPath - Path to the saved model directory.\r\n * @param {function} progressCallback - Optional function for tracking loading progress.\r\n * @returns {Promise} Promise object represents the loaded model.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Gets the start beams for generating outputs.\r\n * @param {Array} inputTokenIds - Array of input token IDs.\r\n * @param {number} numOutputTokens - Number of output tokens to generate.\r\n * @returns {Array} Array of start beams.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, ...args) {\r\n // arguments ignored in this case\r\n return seq2seqStartBeams(this, inputTokenIds, numOutputTokens, false);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam, {\r\n input_name: 'input_features',\r\n });\r\n }\r\n\r\n /**\r\n * Updates the beam by appending the newly generated token ID to the list of output token IDs.\r\n * @param {any} beam - The current beam being generated.\r\n * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model for a given set of inputs.\r\n * @async\r\n * @param {Object} model_inputs - The model inputs.\r\n * @returns {Promise} The model output.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs, {\r\n encoder_input_name: 'input_features',\r\n });\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n/**\r\n * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks\r\n * @extends PreTrainedModel\r\n */\r\nclass VisionEncoderDecoderModel extends PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `VisionEncoderDecoderModel` class.\r\n * @param {object} config - The configuration object specifying the hyperparameters and other model settings.\r\n * @param {object} session - The ONNX session containing the encoder model.\r\n * @param {any} decoder_merged_session - The ONNX session containing the merged decoder model.\r\n */\r\n constructor(config, session, decoder_merged_session) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n\r\n this.num_layers = this.config.decoder.n_layer;\r\n this.num_heads = this.config.decoder.n_head;\r\n this.dim_kv = this.config.decoder.n_embd / this.num_heads;\r\n }\r\n\r\n /**\r\n * Loads a VisionEncoderDecoderModel from the given path.\r\n *\r\n * @param {string} modelPath - The path to the folder containing the saved model files.\r\n * @param {function} [progressCallback=null] - Optional callback function to track the progress of model loading.\r\n * @returns {Promise} A Promise that resolves with the loaded VisionEncoderDecoderModel instance.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session, decoder_merged_session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'encoder_model.onnx', progressCallback),\r\n constructSession(modelPath, 'decoder_merged_session.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n return new this(config, session, decoder_merged_session);\r\n }\r\n\r\n /**\r\n * Generate beam search outputs for the given input pixels and number of output tokens.\r\n *\r\n * @param {array} inputs - The input pixels as a Tensor.\r\n * @param {number} numOutputTokens - The number of output tokens to generate.\r\n * @param {...*} args - Optional additional arguments to pass to seq2seqStartBeams.\r\n * @returns {any} An array of Beam objects representing the top-K output sequences.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return seq2seqRunBeam(this, beam, {\r\n input_name: 'pixel_values',\r\n });\r\n }\r\n\r\n /**\r\n * Update the given beam with the additional predicted token ID.\r\n *\r\n * @param {any} beam - The current beam.\r\n * @param {number} newTokenId - The new predicted token ID to add to the beam's output sequence.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Compute the forward pass of the model on the given input tensors.\r\n *\r\n * @param {object} model_inputs - The input tensors as an object with keys 'pixel_values' and 'decoder_input_ids'.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs, {\r\n encoder_input_name: 'pixel_values',\r\n add_decoder_pkv: false\r\n })\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// CLIP models\r\nclass CLIPPreTrainedModel extends PreTrainedModel { }\r\nclass CLIPModel extends CLIPPreTrainedModel {\r\n\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// GPT2 models\r\nclass GPT2PreTrainedModel extends PreTrainedModel { }\r\n/**\r\n * GPT2Model is not compatible with `.generate()`, as it doesn't have a language model head.\r\n * @extends GPT2PreTrainedModel\r\n */\r\nclass GPT2Model extends GPT2PreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args \r\n * @throws {Error}\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (GPT2Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'GPT2LMHeadModel'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks.\r\n * @extends GPT2PreTrainedModel\r\n */\r\nclass GPT2LMHeadModel extends GPT2PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `GPT2LMHeadModel` class.\r\n * @param {object} config - The configuration of the model.\r\n * @param {any} session - The ONNX session containing the model weights.\r\n */\r\n constructor(config, session) {\r\n super(config, session);\r\n\r\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\r\n this.config.pad_token_id = this.config.eos_token_id\r\n\r\n this.num_heads = this.config.n_head\r\n this.num_layers = this.config.n_layer\r\n this.dim_kv = this.config.n_embd / this.num_heads;\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {Tensor} inputTokenIds - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @param {Tensor} inputs_attention_mask - Optional input attention mask.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask)\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await textgenRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new generated token id.\r\n * @param {any} beam - The Beam object representing the beam.\r\n * @param {number} newTokenId - The new generated token id to be added to the beam.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n return textgenUpdatebeam(beam, newTokenId);\r\n }\r\n\r\n /**\r\n * Forward pass for the model.\r\n * @param {object} model_inputs - The inputs for the model.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await textgen_forward(this, model_inputs)\r\n }\r\n\r\n}\r\n// class GPT2ForSequenceClassification extends GPT2PreTrainedModel {\r\n// TODO\r\n// }\r\n//////////////////////////////////////////////////\r\nclass GPTNeoPreTrainedModel extends PreTrainedModel { }\r\nclass GPTNeoModel extends GPTNeoPreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args \r\n * @throws {Error}\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (GPTNeoModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'GPTNeoForCausalLM'}\"\r\n )\r\n }\r\n}\r\n\r\nclass GPTNeoForCausalLM extends GPTNeoPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `GPTNeoForCausalLM` class.\r\n * @param {object} config - The configuration of the model.\r\n * @param {any} session - The ONNX session containing the model weights.\r\n */\r\n constructor(config, session) {\r\n super(config, session);\r\n\r\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\r\n this.config.pad_token_id = this.config.eos_token_id\r\n\r\n this.num_heads = this.config.num_heads;\r\n this.num_layers = this.config.num_layers;\r\n this.dim_kv = this.config.hidden_size / this.num_heads;\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {Tensor} inputTokenIds - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @param {Tensor} inputs_attention_mask - Optional input attention mask.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask)\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await textgenRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new generated token id.\r\n * @param {any} beam - The Beam object representing the beam.\r\n * @param {number} newTokenId - The new generated token id to be added to the beam.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n return textgenUpdatebeam(beam, newTokenId);\r\n }\r\n\r\n /**\r\n * Forward pass for the model.\r\n * @param {object} model_inputs - The inputs for the model.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await textgen_forward(this, model_inputs)\r\n }\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n// CodeGen models\r\nclass CodeGenPreTrainedModel extends PreTrainedModel { }\r\n/**\r\n * CodeGenModel is a class representing a code generation model without a language model head.\r\n * \r\n * @extends CodeGenPreTrainedModel\r\n */\r\nclass CodeGenModel extends CodeGenPreTrainedModel {\r\n /**\r\n * Throws an error indicating that the current model class is not compatible with `.generate()`,\r\n * as it doesn't have a language model head.\r\n * \r\n * @throws {Error} The current model class is not compatible with `.generate()`\r\n * \r\n * @param {...any} args - Arguments passed to the generate function\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (CodeGenModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'CodeGenForCausalLM'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class.\r\n * @extends CodeGenPreTrainedModel\r\n */\r\nclass CodeGenForCausalLM extends CodeGenPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `CodeGenForCausalLM` class.\r\n * @param {object} config The model configuration object.\r\n * @param {object} session The ONNX session object.\r\n */\r\n constructor(config, session) {\r\n super(config, session);\r\n\r\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\r\n this.config.pad_token_id = this.config.eos_token_id\r\n\r\n this.num_heads = this.config.n_head\r\n this.num_layers = this.config.n_layer\r\n this.dim_kv = this.config.n_embd / this.num_heads;\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {Tensor} inputTokenIds - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @param {Tensor} inputs_attention_mask - Optional input attention mask.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask)\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await textgenRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new generated token id.\r\n * @param {any} beam - The Beam object representing the beam.\r\n * @param {number} newTokenId - The new generated token id to be added to the beam.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n return textgenUpdatebeam(beam, newTokenId);\r\n }\r\n\r\n /**\r\n * Forward pass for the model.\r\n * @param {object} model_inputs - The inputs for the model.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await textgen_forward(this, model_inputs)\r\n }\r\n\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\nclass ViTPreTrainedModel extends PreTrainedModel { }\r\nclass ViTForImageClassification extends ViTPreTrainedModel {\r\n /**\r\n * @param {any} model_inputs\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\nclass DetrPreTrainedModel extends PreTrainedModel { }\r\nclass DetrForObjectDetection extends DetrPreTrainedModel {\r\n /**\r\n * @param {any} model_inputs\r\n */\r\n async _call(model_inputs) {\r\n let output = (await super._call(model_inputs));\r\n return new DetrObjectDetectionOutput(output.logits, output.pred_boxes)\r\n }\r\n}\r\n\r\nclass DetrForSegmentation extends DetrPreTrainedModel {\r\n /**\r\n * Runs the model with the provided inputs\r\n * @param {Object} model_inputs - Model inputs\r\n * @returns {Promise} - Object containing segmentation outputs\r\n */\r\n async _call(model_inputs) {\r\n let output = (await super._call(model_inputs));\r\n return new DetrSegmentationOutput(output.logits, output.pred_boxes, output.pred_masks);\r\n }\r\n}\r\n\r\nclass DetrObjectDetectionOutput extends ModelOutput {\r\n /**\r\n * @param {any} logits\r\n * @param {any} pred_boxes\r\n */\r\n constructor(logits, pred_boxes) {\r\n super();\r\n this.logits = logits;\r\n this.pred_boxes = pred_boxes;\r\n }\r\n}\r\n\r\nclass DetrSegmentationOutput extends ModelOutput {\r\n\r\n /**\r\n * @param {Tensor} logits - The output logits of the model.\r\n * @param {Tensor} pred_boxes - Predicted boxes.\r\n * @param {Tensor} pred_masks - Predicted masks.\r\n */\r\n constructor(logits, pred_boxes, pred_masks) {\r\n super();\r\n this.logits = logits;\r\n this.pred_boxes = pred_boxes;\r\n this.pred_masks = pred_masks;\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// MarianMT models\r\nclass MarianPreTrainedModel extends PreTrainedModel { };\r\n\r\nclass MarianModel extends MarianPreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args \r\n * @throws {Error}\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\nclass MarianMTModel extends MarianPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `MarianMTModel` class.\r\n * @param {object} config The model configuration object.\r\n * @param {object} session The ONNX session object.\r\n * @param {any} decoder_merged_session \r\n * @param {any} generation_config \r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.decoder_layers;\r\n this.num_decoder_heads = this.config.decoder_attention_heads;\r\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\r\n\r\n this.num_encoder_layers = this.config.encoder_layers;\r\n this.num_encoder_heads = this.config.encoder_attention_heads;\r\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\r\n }\r\n\r\n /**\r\n * @param {string} modelPath\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {any[]} inputs - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n * @param {any[]} args\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * @param {any} beam\r\n * @param {any} newTokenId\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * @param {any} model_inputs\r\n * @returns {Promise}\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// AutoModels, used to simplify construction of PreTrainedModels\r\n// (uses config to instantiate correct class)\r\n/**\r\n * Helper class to determine model type from config\r\n */\r\nclass AutoModel {\r\n // Helper class to determine model type from config\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertModel,\r\n 'albert': AlbertModel,\r\n 'distilbert': DistilBertModel,\r\n 't5': T5Model,\r\n 'mt5': MT5Model,\r\n 'gpt2': GPT2Model,\r\n 'gpt_neo': GPTNeoModel,\r\n 'codegen': CodeGenModel,\r\n 'bart': BartModel,\r\n 'roberta': RobertaModel,\r\n 'whisper': WhisperModel,\r\n 'clip': CLIPModel,\r\n 'mobilebert': MobileBertModel,\r\n 'squeezebert': SqueezeBertModel,\r\n 'marian': MarianModel,\r\n }\r\n\r\n /**\r\n * Instantiates a pre-trained model based on the given model path and config.\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} progressCallback - Optional. A callback function that can be used to track loading progress.\r\n * @returns {Promise} - A promise that resolves to an instance of a pre-trained model.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let config = await fetchJSON(modelPath, 'config.json', progressCallback);\r\n let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx';\r\n\r\n let session = await constructSession(modelPath, modelName, progressCallback);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n console.warn(`Unknown model class \"${config.model_type}\", attempting to construct from base class.`);\r\n cls = PreTrainedModel;\r\n }\r\n return new cls(config, session)\r\n }\r\n}\r\n\r\n/**\r\n * Helper class for loading sequence classification models from pretrained checkpoints\r\n */\r\nclass AutoModelForSequenceClassification {\r\n\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForSequenceClassification,\r\n 'albert': AlbertForSequenceClassification,\r\n 'distilbert': DistilBertForSequenceClassification,\r\n 'roberta': RobertaForSequenceClassification,\r\n 'bart': BartForSequenceClassification,\r\n 'mobilebert': MobileBertForSequenceClassification,\r\n 'squeezebert': SqueezeBertForSequenceClassification,\r\n }\r\n\r\n /**\r\n * Load a sequence classification model from a pretrained checkpoint\r\n * @param {string} modelPath - The path to the model checkpoint directory\r\n * @param {function} [progressCallback=null] - An optional callback function to receive progress updates\r\n * @returns {Promise} A promise that resolves to a pre-trained sequence classification model\r\n * @throws {Error} if an unsupported model type is encountered\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback)\r\n ]);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Helper class for loading token classification models from pretrained checkpoints\r\n */\r\nclass AutoModelForTokenClassification {\r\n\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForTokenClassification,\r\n 'distilbert': DistilBertForTokenClassification,\r\n }\r\n\r\n /**\r\n * Load a token classification model from a pretrained checkpoint\r\n * @param {string} modelPath - The path to the model checkpoint directory\r\n * @param {function} [progressCallback=null] - An optional callback function to receive progress updates\r\n * @returns {Promise} A promise that resolves to a pre-trained token classification model\r\n * @throws {Error} if an unsupported model type is encountered\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback)\r\n ]);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Class representing an automatic sequence-to-sequence language model.\r\n */\r\nclass AutoModelForSeq2SeqLM {\r\n static MODEL_CLASS_MAPPING = {\r\n 't5': T5ForConditionalGeneration,\r\n 'mt5': MT5ForConditionalGeneration,\r\n 'bart': BartForConditionalGeneration,\r\n 'whisper': WhisperForConditionalGeneration,\r\n 'marian': MarianMTModel,\r\n }\r\n\r\n /**\r\n * Loads a pretrained sequence-to-sequence language model from a file path.\r\n * @param {string} modelPath - The path to the model files.\r\n * @param {function} [progressCallback=null] - A callback function to track loading progress.\r\n * @returns {Promise} A Promise that resolves to an instance of the appropriate model class.\r\n * @throws {Error} If the model type is unsupported.\r\n * @static\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n let config = info[0];\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(...info)\r\n }\r\n}\r\n\r\n/**\r\n * A class for loading pre-trained models for causal language modeling tasks.\r\n */\r\nclass AutoModelForCausalLM {\r\n static MODEL_CLASS_MAPPING = {\r\n 'gpt2': GPT2LMHeadModel,\r\n 'gpt_neo': GPTNeoForCausalLM,\r\n 'codegen': CodeGenForCausalLM,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from the given path and returns an instance of the appropriate class.\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} [progressCallback=null] - An optional callback function to track the progress of the loading process.\r\n * @returns {Promise} An instance of the appropriate class for the loaded model.\r\n * @throws {Error} If the loaded model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback)\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n\r\n }\r\n}\r\n\r\n/**\r\n * A class to automatically select the appropriate model for Masked Language Modeling (MLM) tasks.\r\n */\r\nclass AutoModelForMaskedLM {\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForMaskedLM,\r\n 'albert': AlbertForMaskedLM,\r\n 'distilbert': DistilBertForMaskedLM,\r\n 'roberta': RobertaForMaskedLM,\r\n 'mobilebert': MobileBertForMaskedLM,\r\n 'squeezebert': SqueezeBertForMaskedLM,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from a given directory and returns an instance of the appropriate model class.\r\n *\r\n * @async\r\n * @param {string} modelPath - The path to the pre-trained model directory.\r\n * @param {function} [progressCallback=null] - An optional callback function to track the loading progress.\r\n * @returns {Promise} An instance of the appropriate model class for MLM tasks.\r\n * @throws {Error} If an unsupported model type is encountered.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let config = await fetchJSON(modelPath, 'config.json', progressCallback);\r\n let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx';\r\n\r\n let session = await constructSession(modelPath, modelName, progressCallback);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n/**\r\n * Automatic model class for question answering tasks.\r\n */\r\nclass AutoModelForQuestionAnswering {\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForQuestionAnswering,\r\n 'albert': AlbertForQuestionAnswering,\r\n 'distilbert': DistilBertForQuestionAnswering,\r\n 'roberta': RobertaForQuestionAnswering,\r\n 'mobilebert': MobileBertForQuestionAnswering,\r\n 'squeezebert': SqueezeBertForQuestionAnswering,\r\n }\r\n\r\n /**\r\n * Loads and returns a question answering model from a pretrained model path.\r\n * @param {string} modelPath - The path to the pretrained model.\r\n * @param {function} [progressCallback=null] - Optional callback function to track loading progress.\r\n * @returns {Promise} - The loaded question answering model.\r\n * @throws Will throw an error if an unsupported model type is encountered.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback)\r\n ]);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n/**\r\n * Class representing an autoencoder-decoder model for vision-to-sequence tasks.\r\n */\r\nclass AutoModelForVision2Seq {\r\n static MODEL_CLASS_MAPPING = {\r\n 'vision-encoder-decoder': VisionEncoderDecoderModel\r\n }\r\n\r\n /**\r\n * Loads a pretrained model from a given path.\r\n * @param {string} modelPath - The path to the pretrained model.\r\n * @param {function} progressCallback - Optional callback function to track progress of the model loading.\r\n * @returns {Promise} - A Promise that resolves to a new instance of VisionEncoderDecoderModel.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session, decoder_merged_session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'encoder_model.onnx', progressCallback),\r\n constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback)\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session, decoder_merged_session);\r\n\r\n }\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n/**\r\n * AutoModelForImageClassification is a class for loading pre-trained image classification models from ONNX format.\r\n */\r\nclass AutoModelForImageClassification {\r\n static MODEL_CLASS_MAPPING = {\r\n 'vit': ViTForImageClassification,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained image classification model from a given directory path.\r\n * @param {string} modelPath - The path to the directory containing the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function to monitor the loading progress.\r\n * @returns {Promise} A Promise that resolves with the model.\r\n * @throws {Error} If the specified model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n/**\r\n * AutoModelForImageSegmentation is a class for loading pre-trained image classification models from ONNX format.\r\n */\r\nclass AutoModelForImageSegmentation {\r\n static MODEL_CLASS_MAPPING = {\r\n 'detr': DetrForSegmentation,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained image classification model from a given directory path.\r\n * @param {string} modelPath - The path to the directory containing the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function to monitor the loading progress.\r\n * @returns {Promise} A Promise that resolves with the model.\r\n * @throws {Error} If the specified model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\nclass AutoModelForObjectDetection {\r\n static MODEL_CLASS_MAPPING = {\r\n 'detr': DetrForObjectDetection,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained image classification model from a given directory path.\r\n * @param {string} modelPath - The path to the directory containing the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function to monitor the loading progress.\r\n * @returns {Promise} A Promise that resolves with the model.\r\n * @throws {Error} If the specified model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\nclass Seq2SeqLMOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits - The output logits of the model.\r\n * @param {Array} past_key_values - An array of key/value pairs that represent the previous state of the model.\r\n * @param {Tensor} encoder_outputs - The output of the encoder in a sequence-to-sequence model.\r\n */\r\n constructor(logits, past_key_values, encoder_outputs) {\r\n super();\r\n this.logits = logits;\r\n this.past_key_values = past_key_values;\r\n this.encoder_outputs = encoder_outputs;\r\n }\r\n}\r\n\r\nclass SequenceClassifierOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits \r\n */\r\n constructor(logits) {\r\n super();\r\n this.logits = logits;\r\n }\r\n}\r\n\r\nclass TokenClassifierOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits \r\n */\r\n constructor(logits) {\r\n super();\r\n this.logits = logits;\r\n }\r\n}\r\n\r\n\r\nclass MaskedLMOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits \r\n */\r\n constructor(logits) {\r\n super();\r\n this.logits = logits;\r\n }\r\n}\r\n\r\nclass QuestionAnsweringModelOutput extends ModelOutput {\r\n /**\r\n * @param {Float32Array} start_logits - The logits for start positions of the answer.\r\n * @param {Float32Array} end_logits - The logits for end positions of the answer.\r\n */\r\n constructor(start_logits, end_logits) {\r\n super();\r\n this.start_logits = start_logits;\r\n this.end_logits = end_logits;\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n AutoModel,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForCausalLM,\r\n AutoModelForMaskedLM,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForObjectDetection,\r\n AutoModelForImageSegmentation,\r\n};\r\n","const {\r\n Callable,\r\n softmax,\r\n indexOfMax,\r\n getTopItems,\r\n cos_sim,\r\n pathJoin,\r\n isString,\r\n getFile,\r\n dot\r\n} = require(\"./utils.js\");\r\n\r\nconst {\r\n AutoTokenizer\r\n} = require(\"./tokenizers.js\");\r\nconst {\r\n AutoModel,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForMaskedLM,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForCausalLM,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForImageSegmentation,\r\n AutoModelForObjectDetection\r\n} = require(\"./models.js\");\r\nconst {\r\n AutoProcessor,\r\n Processor\r\n} = require(\"./processors.js\");\r\n\r\n\r\nconst {\r\n env\r\n} = require('./env.js');\r\n\r\nconst { Tensor, transpose_data } = require(\"./tensor_utils.js\");\r\nconst { CustomImage } = require(\"./image_utils.js\");\r\n\r\n/**\r\n * Prepare images for further tasks.\r\n * @param {any[]} images - images to prepare.\r\n * @returns {Promise} - returns processed images.\r\n * @async\r\n */\r\nasync function prepareImages(images) {\r\n if (!Array.isArray(images)) {\r\n images = [images];\r\n }\r\n\r\n // Possibly convert any non-images to images\r\n images = await Promise.all(images.map(x => CustomImage.read(x)));\r\n return images;\r\n}\r\n\r\n/**\r\n * Pipeline class for executing a natural language processing task.\r\n * @extends Callable\r\n */\r\nclass Pipeline extends Callable {\r\n /**\r\n * Creates a new instance of Pipeline.\r\n * @param {string} task - The natural language processing task to be performed.\r\n * @param {object} tokenizer - The tokenizer object to be used for tokenizing input texts.\r\n * @param {object} model - The model object to be used for processing input texts.\r\n */\r\n constructor(task, tokenizer, model) {\r\n super();\r\n this.task = task;\r\n this.tokenizer = tokenizer;\r\n this.model = model;\r\n }\r\n\r\n /**\r\n * Disposes the model.\r\n * @returns {Promise} - A promise that resolves when the model has been disposed.\r\n */\r\n async dispose() {\r\n return await this.model.dispose();\r\n }\r\n\r\n /**\r\n * Executes the natural language processing task.\r\n * @param {any} texts - The input texts to be processed.\r\n * @returns {Promise} - A promise that resolves to an array containing the inputs and outputs of the task.\r\n */\r\n async _call(texts) {\r\n // Run tokenization\r\n let inputs = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true\r\n });\r\n\r\n // Run model\r\n let outputs = await this.model(inputs)\r\n\r\n return [inputs, outputs];\r\n }\r\n}\r\n\r\n/**\r\n * TextClassificationPipeline class for executing a text classification task.\r\n * @extends Pipeline\r\n */\r\nclass TextClassificationPipeline extends Pipeline {\r\n /**\r\n * Executes the text classification task.\r\n * @param {any} texts - The input texts to be classified.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @param {number} [options.topk=1] - The number of top predictions to be returned.\r\n * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores.\r\n */\r\n async _call(texts, {\r\n topk = 1\r\n } = {}) {\r\n\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n let id2label = this.model.config.id2label;\r\n let toReturn = [];\r\n for (let batch of outputs.logits) {\r\n let scores = getTopItems(softmax(batch.data), topk);\r\n\r\n let vals = scores.map(function (x) {\r\n return {\r\n label: id2label[x[0]],\r\n score: x[1],\r\n }\r\n });\r\n if (topk === 1) {\r\n toReturn.push(...vals);\r\n } else {\r\n toReturn.push(vals);\r\n }\r\n }\r\n\r\n return Array.isArray(texts) || topk === 1 ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n\r\n/**\r\n * TokenClassificationPipeline class for executing a token classification task.\r\n * @extends Pipeline\r\n */\r\nclass TokenClassificationPipeline extends Pipeline {\r\n /**\r\n * Executes the token classification task.\r\n * @param {any} texts - The input texts to be classified.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores.\r\n */\r\n async _call(texts, {\r\n ignore_labels = ['O'], // TODO init param?\r\n } = {}) {\r\n\r\n let isBatched = Array.isArray(texts);\r\n\r\n if (!isBatched) {\r\n texts = [texts];\r\n }\r\n\r\n let tokenizer = this.tokenizer;\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n let logits = outputs.logits;\r\n let id2label = this.model.config.id2label;\r\n\r\n let toReturn = [];\r\n for (let i = 0; i < logits.dims[0]; ++i) {\r\n let ids = inputs.input_ids.get(i);\r\n let batch = logits.get(i);\r\n\r\n // List of tokens that aren't ignored\r\n let tokens = [];\r\n for (let j = 0; j < batch.dims[0]; ++j) {\r\n let tokenData = batch.get(j);\r\n let topScoreIndex = indexOfMax(tokenData.data);\r\n\r\n let entity = id2label[topScoreIndex];\r\n if (ignore_labels.includes(entity)) {\r\n // We predicted a token that should be ignored. So, we skip it.\r\n continue;\r\n }\r\n\r\n // TODO add option to keep special tokens?\r\n let word = tokenizer.decode([ids.get(j)], { skip_special_tokens: true });\r\n if (word === '') {\r\n // Was a special token. So, we skip it.\r\n continue;\r\n }\r\n\r\n let scores = softmax(tokenData.data);\r\n\r\n tokens.push({\r\n entity: entity,\r\n score: scores[topScoreIndex],\r\n index: j,\r\n word: word,\r\n\r\n // TODO: null for now, but will add\r\n start: null,\r\n end: null,\r\n });\r\n }\r\n toReturn.push(tokens);\r\n }\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n/**\r\n * QuestionAnsweringPipeline class for executing a question answering task.\r\n * @extends Pipeline\r\n */\r\nclass QuestionAnsweringPipeline extends Pipeline {\r\n /**\r\n * Executes the question answering task.\r\n * @param {string|string[]} question - The question(s) to be answered.\r\n * @param {string|string[]} context - The context(s) where the answer(s) can be found.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @param {number} [options.topk=1] - The number of top answer predictions to be returned.\r\n * @todo fix error below\r\n * @returns {Promise} - A promise that resolves to an array or object containing the predicted answers and scores.\r\n */\r\n async _call(question, context, {\r\n topk = 1\r\n } = {}) {\r\n\r\n let inputs = this.tokenizer(question, {\r\n text_pair: context\r\n })\r\n\r\n let output = await this.model(inputs);\r\n\r\n let toReturn = [];\r\n for (let j = 0; j < output.start_logits.dims[0]; ++j) {\r\n let ids = inputs.input_ids.get(j);\r\n let sepIndex = ids.indexOf(this.tokenizer.sep_token_id);\r\n\r\n let s1 = Array.from(softmax(output.start_logits.get(j).data))\r\n .map((x, i) => [x, i])\r\n .filter(x => x[1] > sepIndex);\r\n let e1 = Array.from(softmax(output.end_logits.get(j).data))\r\n .map((x, i) => [x, i])\r\n .filter(x => x[1] > sepIndex);\r\n\r\n let options = product(s1, e1)\r\n .filter(x => x[0][1] <= x[1][1])\r\n .map(x => [x[0][1], x[1][1], x[0][0] * x[1][0]])\r\n .sort((a, b) => b[2] - a[2]);\r\n\r\n for (let k = 0; k < Math.min(options.length, topk); ++k) {\r\n let [start, end, score] = options[k];\r\n\r\n let answer_tokens = [...ids].slice(start, end + 1)\r\n\r\n let answer = this.tokenizer.decode(answer_tokens, {\r\n skip_special_tokens: true,\r\n });\r\n\r\n // TODO add start and end?\r\n // NOTE: HF returns character index\r\n toReturn.push({\r\n answer, score\r\n });\r\n }\r\n }\r\n\r\n // Mimic HF's return type based on topk\r\n return (topk === 1) ? toReturn[0] : toReturn;\r\n\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a fill-mask pipeline for natural language processing.\r\n * @extends Pipeline\r\n */\r\nclass FillMaskPipeline extends Pipeline {\r\n /**\r\n * @param {any} texts\r\n */\r\n async _call(texts, {\r\n topk = 5\r\n } = {}) {\r\n // Fill the masked token in the text(s) given as inputs.\r\n\r\n // Run tokenization\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n // Determine indices of mask tokens\r\n // let mask_token_indices = inputs.input_ids.data.map(x => )\r\n\r\n // let logits = reshape(outputs.logits.data, outputs.logits.dims);\r\n\r\n let tokenizer = this.tokenizer;\r\n\r\n let toReturn = [];\r\n\r\n for (let i = 0; i < inputs.input_ids.dims[0]; ++i) {\r\n let ids = inputs.input_ids.get(i);\r\n let mask_token_index = ids.indexOf(this.tokenizer.mask_token_id)\r\n\r\n if (mask_token_index === -1) {\r\n throw Error(`Mask token (${tokenizer.mask_token}) not found in text.`)\r\n }\r\n let logits = outputs.logits.get(i);\r\n let itemLogits = logits.get(mask_token_index);\r\n\r\n let scores = getTopItems(softmax(itemLogits.data), topk);\r\n\r\n toReturn.push(scores.map(x => {\r\n let sequence = [...ids];\r\n sequence[mask_token_index] = x[0];\r\n\r\n return {\r\n score: x[1],\r\n token: x[0],\r\n token_str: tokenizer.model.vocab[x[0]],\r\n sequence: tokenizer.decode(sequence, { skip_special_tokens: true }),\r\n }\r\n }));\r\n }\r\n return Array.isArray(texts) ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n/**\r\n * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks.\r\n * @extends Pipeline\r\n */\r\nclass Text2TextGenerationPipeline extends Pipeline {\r\n _key = null;\r\n\r\n /**\r\n * Fill the masked token in the text(s) given as inputs.\r\n * @async\r\n * @param {string|string[]} texts - The text or array of texts to be processed.\r\n * @param {Object} [options={}] - Options for the fill-mask pipeline.\r\n * @param {number} [options.topk=5] - The number of top-k predictions to return.\r\n * @returns {Promise} An array of objects containing the score, predicted token, predicted token string,\r\n * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text).\r\n * If only one input text is given, the output will be an array of objects.\r\n * @throws {Error} When the mask token is not found in the input text.\r\n */\r\n async _call(texts, generate_kwargs = {}) {\r\n if (!Array.isArray(texts)) {\r\n texts = [texts];\r\n }\r\n\r\n // Add global prefix, if present\r\n if (this.model.config.prefix) {\r\n texts = texts.map(x => this.model.config.prefix + x)\r\n }\r\n\r\n // Handle task specific params:\r\n let task_specific_params = this.model.config.task_specific_params\r\n if (task_specific_params && task_specific_params[this.task]) {\r\n // Add prefixes, if present\r\n if (task_specific_params[this.task].prefix) {\r\n texts = texts.map(x => task_specific_params[this.task].prefix + x)\r\n }\r\n\r\n // TODO update generation config\r\n }\r\n\r\n let input_ids = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true\r\n }).input_ids\r\n\r\n let outputTokenIds = (await this.model.generate(input_ids, generate_kwargs)).flat();\r\n\r\n /**\r\n * @type {any[]}\r\n */\r\n let toReturn = this.tokenizer.batch_decode(outputTokenIds, {\r\n skip_special_tokens: true,\r\n });\r\n if (this._key !== null) {\r\n toReturn = toReturn.map(text => {\r\n return (this._key === null) ? text : { [this._key]: text }\r\n })\r\n }\r\n return toReturn\r\n }\r\n}\r\n\r\n\r\n/**\r\n * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline.\r\n * @extends Text2TextGenerationPipeline\r\n */\r\nclass SummarizationPipeline extends Text2TextGenerationPipeline {\r\n _key = 'summary_text';\r\n}\r\n\r\n/**\r\n * TranslationPipeline class to translate text from one language to another using the provided model and tokenizer.\r\n * @extends Text2TextGenerationPipeline\r\n */\r\nclass TranslationPipeline extends Text2TextGenerationPipeline {\r\n _key = 'translation_text';\r\n}\r\n\r\n/**\r\n * A pipeline for generating text based on an input prompt.\r\n * @extends Pipeline\r\n */\r\nclass TextGenerationPipeline extends Pipeline {\r\n /**\r\n * Generates text based on an input prompt.\r\n * @async\r\n * @param {any} texts - The input prompt or prompts to generate text from.\r\n * @param {object} [generate_kwargs={}] - Additional arguments for text generation.\r\n * @returns {Promise} - The generated text or texts.\r\n */\r\n async _call(texts, generate_kwargs = {}) {\r\n let stringInput = typeof texts === 'string' || texts instanceof String;\r\n if (stringInput) {\r\n texts = [texts];\r\n }\r\n\r\n this.tokenizer.padding_side = 'left';\r\n let inputs = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true,\r\n });\r\n\r\n let input_ids = inputs.input_ids;\r\n let attention_mask = inputs.attention_mask;\r\n\r\n /**\r\n * @type {any[]}\r\n */\r\n let outputTokenIds = await this.model.generate(input_ids, generate_kwargs, null, {\r\n inputs_attention_mask: attention_mask\r\n });\r\n\r\n let toReturn = outputTokenIds.map((outTokens, i) => {\r\n let startText = texts[i].trim();\r\n let decoded = this.tokenizer.batch_decode(outTokens, {\r\n skip_special_tokens: true,\r\n }).map(x => {\r\n return {\r\n generated_text: startText + x\r\n }\r\n });\r\n\r\n return decoded\r\n });\r\n\r\n return (stringInput && toReturn.length === 1) ? toReturn[0] : toReturn;\r\n }\r\n}\r\n\r\n/**\r\n * Class representing an Zero Shot Classification Pipeline that should only be used with zero shot classification tasks.\r\n * @extends Pipeline\r\n */\r\nclass ZeroShotClassificationPipeline extends Pipeline {\r\n\r\n /**\r\n * @param {string} task\r\n * @param {any} tokenizer\r\n * @param {any} model\r\n */\r\n constructor(task, tokenizer, model) {\r\n super(task, tokenizer, model);\r\n\r\n // Use model config to get label2id mapping\r\n this.label2id = Object.fromEntries(\r\n Object.entries(this.model.config.label2id).map(\r\n ([k, v]) => [k.toLowerCase(), v]\r\n )\r\n );\r\n\r\n this.entailment_id = this.label2id['entailment'];\r\n if (this.entailment_id === undefined) {\r\n console.warn(\"Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.\");\r\n this.entailment_id = 2;\r\n }\r\n\r\n this.contradiction_id = this.label2id['contradiction'];\r\n if (this.contradiction_id === undefined) {\r\n console.warn(\"Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.\");\r\n this.contradiction_id = 0;\r\n }\r\n }\r\n /**\r\n * @param {any[]} texts\r\n * @param {string[]} candidate_labels\r\n * @todo fix error below\r\n * @return {Promise<*>}\r\n */\r\n async _call(texts, candidate_labels, {\r\n hypothesis_template = \"This example is {}.\",\r\n multi_label = false,\r\n } = {}) {\r\n\r\n let isBatched = Array.isArray(texts);\r\n\r\n if (!isBatched) {\r\n texts = [texts];\r\n }\r\n if (!Array.isArray(candidate_labels)) {\r\n candidate_labels = [candidate_labels];\r\n }\r\n\r\n // Insert labels into hypothesis template\r\n let hypotheses = candidate_labels.map(\r\n x => hypothesis_template.replace('{}', x)\r\n );\r\n\r\n // How to perform the softmax over the logits:\r\n // - true: softmax over the entailment vs. contradiction dim for each label independently\r\n // - false: softmax the \"entailment\" logits over all candidate labels\r\n let softmaxEach = multi_label || candidate_labels.length === 1;\r\n\r\n let toReturn = [];\r\n for (let premise of texts) {\r\n let entails_logits = [];\r\n\r\n for (let hypothesis of hypotheses) {\r\n let inputs = this.tokenizer(premise, {\r\n text_pair: hypothesis,\r\n })\r\n let outputs = await this.model(inputs)\r\n\r\n if (softmaxEach) {\r\n entails_logits.push([\r\n outputs.logits.data[this.contradiction_id],\r\n outputs.logits.data[this.entailment_id]\r\n ])\r\n } else {\r\n entails_logits.push(outputs.logits.data[this.entailment_id])\r\n }\r\n }\r\n\r\n let scores;\r\n if (softmaxEach) {\r\n scores = entails_logits.map(x => softmax(x)[1]);\r\n } else {\r\n scores = softmax(entails_logits);\r\n }\r\n\r\n // Sort by scores (desc) and return scores with indices\r\n let scores_sorted = scores\r\n .map((x, i) => [x, i])\r\n .sort((a, b) => {\r\n return b[0] - a[0];\r\n });\r\n\r\n toReturn.push({\r\n sequence: premise,\r\n labels: scores_sorted.map(x => candidate_labels[x[1]]),\r\n scores: scores_sorted.map(x => x[0]),\r\n });\r\n }\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Class representing an Embeddings Pipeline that should only be used with sentence-transformers.\r\n * If you want to get the raw outputs from the model, use `AutoModel.from_pretrained(...)`.\r\n * @extends Pipeline\r\n */\r\nclass EmbeddingsPipeline extends Pipeline {\r\n // Should only be used with sentence-transformers\r\n // If you want to get the raw outputs from the model,\r\n // use `AutoModel.from_pretrained(...)`\r\n /**\r\n * Private method to perform mean pooling of the last hidden state followed by a normalization step.\r\n * @param {Tensor} last_hidden_state - Tensor of shape [batchSize, seqLength, embedDim]\r\n * @param {Tensor} attention_mask - Tensor of shape [batchSize, seqLength]\r\n * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim].\r\n * @private\r\n */\r\n _mean_pooling(last_hidden_state, attention_mask) {\r\n // last_hidden_state: [batchSize, seqLength, embedDim]\r\n // attention_mask: [batchSize, seqLength]\r\n\r\n let shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]];\r\n let returnedData = new last_hidden_state.data.constructor(shape[0] * shape[1])\r\n let [batchSize, seqLength, embedDim] = last_hidden_state.dims;\r\n\r\n let outIndex = 0;\r\n for (let i = 0; i < batchSize; ++i) {\r\n let offset = i * embedDim * seqLength;\r\n\r\n for (let k = 0; k < embedDim; ++k) {\r\n let sum = 0;\r\n let count = 0;\r\n\r\n let attnMaskOffset = i * seqLength;\r\n let offset2 = offset + k;\r\n // Pool over all words in sequence\r\n for (let j = 0; j < seqLength; ++j) {\r\n // index into attention mask\r\n let attn = Number(attention_mask.data[attnMaskOffset + j]);\r\n\r\n count += attn;\r\n sum += last_hidden_state.data[offset2 + j * embedDim] * attn;\r\n }\r\n\r\n let avg = sum / count;\r\n returnedData[outIndex++] = avg;\r\n }\r\n }\r\n\r\n return new Tensor(\r\n last_hidden_state.type,\r\n returnedData,\r\n shape\r\n )\r\n }\r\n\r\n /**\r\n * Private method to normalize the input tensor along dim=1. \r\n * NOTE: only works for tensors of shape [batchSize, embedDim]. Operates in-place.\r\n * @param {any} tensor - Tensor of shape [batchSize, embedDim]\r\n * @returns {any} Returns the same Tensor object after performing normalization.\r\n * @private\r\n */\r\n _normalize(tensor) {\r\n for (let batch of tensor) {\r\n let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b))\r\n\r\n for (let i = 0; i < batch.data.length; ++i) {\r\n batch.data[i] /= norm;\r\n }\r\n }\r\n return tensor;\r\n }\r\n\r\n /**\r\n * Method to perform mean pooling and normalization of the input texts.\r\n * @param {string[]} texts - An array of texts to embed.\r\n * @returns {Promise} Returns a new Tensor of shape [batchSize, embedDim].\r\n */\r\n async _call(texts) {\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n // Perform mean pooling, followed by a normalization step\r\n return this._normalize(this._mean_pooling(outputs.last_hidden_state, inputs.attention_mask));\r\n }\r\n\r\n /**\r\n * @param {number[]} arr1\r\n * @param {number[]} arr2\r\n */\r\n cos_sim(arr1, arr2, is_normalised = false) {\r\n // Compute cosine similarity. If `is_normalised`, then\r\n // use the dot product instead of the cosine similarity\r\n return is_normalised ? dot(arr1, arr2) : cos_sim(arr1, arr2);\r\n }\r\n}\r\n\r\n/**\r\n * A class representing an automatic speech recognition pipeline.\r\n * @extends Pipeline\r\n */\r\nclass AutomaticSpeechRecognitionPipeline extends Pipeline {\r\n\r\n /**\r\n * Creates an instance of AutomaticSpeechRecognitionPipeline.\r\n * @param {string} task - The type of the task for this pipeline. Currently only \"asr\" is supported.\r\n * @param {object} tokenizer - The tokenizer to be used for pre-processing inputs.\r\n * @param {object} model - The model to be used for the task.\r\n * @param {object} processor - The processor to be used for pre-processing audio inputs.\r\n */\r\n constructor(task, tokenizer, model, processor) {\r\n super(task, tokenizer, model);\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * Preprocesses the input audio for the AutomaticSpeechRecognitionPipeline.\r\n * @param {any} audio - The audio to be preprocessed.\r\n * @param {number} sampling_rate - The sampling rate of the audio.\r\n * @returns {Promise} - A promise that resolves to the preprocessed audio data.\r\n * @private\r\n */\r\n async _preprocess(audio, sampling_rate) {\r\n if (isString(audio)) {\r\n // Attempting to load from path\r\n\r\n if (typeof AudioContext === 'undefined') {\r\n // Running in node or an environment without AudioContext\r\n throw Error(\r\n \"Unable to load audio from path/URL since `AudioContext` is not available in your environment. \" +\r\n \"As a result, audio data must be passed directly to the processor. \" +\r\n \"If you are running in node.js, you can use an external library (e.g., https://github.com/audiojs/web-audio-api) to do this.\"\r\n )\r\n }\r\n const response = await (await getFile(audio)).arrayBuffer();\r\n const audioCTX = new AudioContext({ sampleRate: sampling_rate });\r\n const decoded = await audioCTX.decodeAudioData(response);\r\n\r\n // We now replicate HuggingFace's `ffmpeg_read` method:\r\n // \r\n // When downmixing a stereo audio file to mono using the -ac 1 option in FFmpeg,\r\n // the audio signal is summed across both channels to create a single mono channel.\r\n // However, if the audio is at full scale (i.e. the highest possible volume level),\r\n // the summing of the two channels can cause the audio signal to clip or distort.\r\n\r\n // To prevent this clipping, FFmpeg applies a scaling factor of 1/sqrt(2) (~ 0.707)\r\n // to the audio signal before summing the two channels. This scaling factor ensures\r\n // that the combined audio signal will not exceed the maximum possible level, even\r\n // if both channels are at full scale.\r\n\r\n // After applying this scaling factor, the audio signal from both channels is summed\r\n // to create a single mono channel. It's worth noting that this scaling factor is\r\n // only applied when downmixing stereo audio to mono using the -ac 1 option in FFmpeg.\r\n // If you're using a different downmixing method, or if you're not downmixing the\r\n // audio at all, this scaling factor may not be needed.\r\n const SCALING_FACTOR = Math.sqrt(2);\r\n\r\n let left = decoded.getChannelData(0);\r\n let right = decoded.getChannelData(1);\r\n\r\n audio = new Float32Array(left.length);\r\n for (let i = 0; i < decoded.length; i++) {\r\n audio[i] = SCALING_FACTOR * (left[i] + right[i]) / 2;\r\n }\r\n }\r\n\r\n return audio;\r\n }\r\n\r\n /**\r\n * Asynchronously processes audio and generates text transcription using the model.\r\n * @param {Array} audio - The audio to be transcribed. Can be a single Float32Array or an array of Float32Arrays.\r\n * @param {Object} [kwargs={}] - Optional arguments.\r\n * @param {boolean} [kwargs.return_timestamps] - Whether to return timestamps or not. Default is false.\r\n * @param {number} [kwargs.chunk_length_s] - The length of audio chunks to process in seconds. Default is 0 (no chunking).\r\n * @param {number} [kwargs.stride_length_s] - The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to chunk_length_s / 6.\r\n * @param {function} [kwargs.chunk_callback] - Callback function to be called with each chunk processed.\r\n * @param {boolean} [kwargs.force_full_sequences] - Whether to force outputting full sequences or not. Default is false.\r\n * @returns {Promise} A Promise that resolves to an object containing the transcription text and optionally timestamps if return_timestamps is true.\r\n */\r\n async _call(audio, kwargs = {}) {\r\n let return_timestamps = kwargs.return_timestamps ?? false;\r\n let chunk_length_s = kwargs.chunk_length_s ?? 0;\r\n let stride_length_s = kwargs.stride_length_s ?? null;\r\n let chunk_callback = kwargs.chunk_callback ?? null;\r\n let force_full_sequences = kwargs.force_full_sequences ?? false;\r\n\r\n // TODO\r\n // task = 'transcribe',\r\n // language = 'en',\r\n\r\n let single = !Array.isArray(audio)\r\n if (single) {\r\n audio = [audio]\r\n }\r\n\r\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\r\n const time_precision = this.processor.feature_extractor.config.chunk_length / this.model.config.max_source_positions;\r\n\r\n let toReturn = [];\r\n for (let aud of audio) {\r\n aud = await this._preprocess(aud, sampling_rate)\r\n\r\n /** @type {any[]} */\r\n let chunks = [];\r\n if (chunk_length_s > 0) {\r\n if (stride_length_s === null) {\r\n stride_length_s = chunk_length_s / 6;\r\n } else if (chunk_length_s <= stride_length_s) {\r\n throw Error(\"`chunk_length_s` must be larger than `stride_length_s`.\")\r\n }\r\n\r\n // TODO support different stride_length_s (for left and right)\r\n\r\n const window = sampling_rate * chunk_length_s;\r\n const stride = sampling_rate * stride_length_s;\r\n const jump = window - 2 * stride;\r\n let offset = 0;\r\n\r\n // Create subarrays of audio with overlaps\r\n\r\n while (offset < aud.length) {\r\n let subarr = aud.subarray(offset, offset + window);\r\n let feature = await this.processor(subarr);\r\n\r\n let isFirst = offset === 0;\r\n let isLast = offset + jump >= aud.length;\r\n chunks.push({\r\n stride: [\r\n subarr.length,\r\n isFirst ? 0 : stride,\r\n isLast ? 0 : stride\r\n ],\r\n input_features: feature.input_features,\r\n is_last: isLast\r\n })\r\n offset += jump;\r\n }\r\n\r\n } else {\r\n chunks = [{\r\n stride: [aud.length, 0, 0],\r\n input_features: (await this.processor(aud)).input_features,\r\n is_last: true\r\n }]\r\n }\r\n\r\n // Generate for each set of input features\r\n for (let chunk of chunks) {\r\n // NOTE: doing sequentially for now\r\n let data = await this.model.generate(chunk.input_features, kwargs);\r\n\r\n // Get top beam\r\n chunk.tokens = data[0].flat()\r\n\r\n // convert stride to seconds\r\n chunk.stride = chunk.stride.map(x => x / sampling_rate);\r\n\r\n if (chunk_callback !== null) {\r\n chunk_callback(chunk)\r\n }\r\n }\r\n\r\n // Merge text chunks\r\n let [full_text, optional] = this.tokenizer._decode_asr(chunks, {\r\n time_precision: time_precision,\r\n return_timestamps: return_timestamps,\r\n force_full_sequences: force_full_sequences\r\n });\r\n\r\n toReturn.push({ text: full_text, ...optional })\r\n }\r\n return single ? toReturn[0] : toReturn;\r\n }\r\n}\r\n\r\n/**\r\n * A pipeline for performing image-to-text tasks.\r\n * @extends Pipeline\r\n */\r\nclass ImageToTextPipeline extends Pipeline {\r\n /**\r\n * Create an instance of ImageToTextPipeline.\r\n * @param {string} task - The task name.\r\n * @param {object} tokenizer - The tokenizer to use.\r\n * @param {object} model - The generator model to use.\r\n * @param {object} processor - The image processor to use.\r\n */\r\n constructor(task, tokenizer, model, processor) {\r\n super(task, tokenizer, model);\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * @param {any[]} images\r\n */\r\n async _call(images, generate_kwargs = {}) {\r\n let isBatched = Array.isArray(images);\r\n\r\n images = await prepareImages(images);\r\n\r\n let pixel_values = (await this.processor(images)).pixel_values;\r\n\r\n let toReturn = [];\r\n for (let batch of pixel_values) {\r\n batch.dims = [1, ...batch.dims]\r\n let output = (await this.model.generate(batch, generate_kwargs)).flat();\r\n let decoded = this.tokenizer.batch_decode(output, {\r\n skip_special_tokens: true,\r\n }).map(x => {\r\n return { generated_text: x.trim() }\r\n })\r\n toReturn.push(decoded);\r\n }\r\n\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n/**\r\n * A class representing an image classification pipeline.\r\n * @extends Pipeline\r\n */\r\nclass ImageClassificationPipeline extends Pipeline {\r\n /**\r\n * Create a new ImageClassificationPipeline.\r\n * @param {string} task - The task of the pipeline.\r\n * @param {Object} model - The model to use for classification.\r\n * @param {Function} processor - The function to preprocess images.\r\n */\r\n constructor(task, model, processor) {\r\n super(task, null, model); // TODO tokenizer\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * Classify the given images.\r\n * @async\r\n * @param {any} images - The images to classify.\r\n * @param {Object} options - The options to use for classification.\r\n * @param {number} [options.topk=1] - The number of top results to return.\r\n * @returns {Promise} - The top classification results for the images.\r\n */\r\n async _call(images, {\r\n topk = 1\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n images = await prepareImages(images);\r\n\r\n let inputs = await this.processor(images);\r\n let output = await this.model(inputs);\r\n\r\n let id2label = this.model.config.id2label;\r\n let toReturn = [];\r\n for (let batch of output.logits) {\r\n let scores = getTopItems(softmax(batch.data), topk);\r\n\r\n let vals = scores.map(function (x) {\r\n return {\r\n label: id2label[x[0]],\r\n score: x[1],\r\n }\r\n });\r\n if (topk === 1) {\r\n toReturn.push(...vals);\r\n } else {\r\n toReturn.push(vals);\r\n }\r\n }\r\n\r\n return isBatched || topk === 1 ? toReturn : toReturn[0];\r\n }\r\n\r\n}\r\n\r\n/**\r\n * ImageSegmentationPipeline class for executing an image-segmentation task.\r\n * @extends Pipeline\r\n */\r\nclass ImageSegmentationPipeline extends Pipeline {\r\n /**\r\n * Create a new ImageSegmentationPipeline.\r\n * @param {string} task - The task of the pipeline.\r\n * @param {Object} model - The model to use for classification.\r\n * @param {Processor} processor - The function to preprocess images.\r\n */\r\n constructor(task, model, processor) {\r\n super(task, null, model); // TODO tokenizer\r\n this.processor = processor;\r\n\r\n this.subtasks_mapping = {\r\n // Mapping of subtasks to their corresponding post-processing function names.\r\n panoptic: 'post_process_panoptic_segmentation',\r\n instance: 'post_process_instance_segmentation',\r\n semantic: 'post_process_semantic_segmentation'\r\n }\r\n }\r\n\r\n /**\r\n * Segment the input images.\r\n * @param {Array} images - The input images.\r\n * @param {Object} options - The options to use for segmentation.\r\n * @param {number} [options.threshold=0.5] - Probability threshold to filter out predicted masks.\r\n * @param {number} [options.mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values.\r\n * @param {number} [options.overlap_mask_area_threshold=0.8] - Mask overlap threshold to eliminate small, disconnected segments.\r\n * @param {null|string} [options.subtask=null] - Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`], depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order).\r\n * @param {Array} [options.label_ids_to_fuse=null] - List of label ids to fuse. If not set, do not fuse any labels.\r\n * @param {Array} [options.target_sizes=null] - List of target sizes for the input images. If not set, use the original image sizes.\r\n * @returns {Promise} - The annotated segments.\r\n */\r\n async _call(images, {\r\n threshold = 0.5,\r\n mask_threshold = 0.5,\r\n overlap_mask_area_threshold = 0.8,\r\n label_ids_to_fuse = null,\r\n target_sizes = null,\r\n subtask = null, // TODO use\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n\r\n if (isBatched && images.length !== 1) {\r\n throw Error(\"Image segmentation pipeline currently only supports a batch size of 1.\");\r\n }\r\n\r\n images = await prepareImages(images);\r\n let imageSizes = images.map(x => [x.height, x.width]);\r\n\r\n let inputs = await this.processor(images);\r\n let output = await this.model(inputs);\r\n\r\n let fn = null;\r\n if (subtask !== null) {\r\n fn = this.subtasks_mapping[subtask];\r\n } else {\r\n for (let [task, func] of Object.entries(this.subtasks_mapping)) {\r\n if (func in this.processor.feature_extractor) {\r\n fn = this.processor.feature_extractor[func].bind(this.processor.feature_extractor);\r\n subtask = task;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // add annotations\r\n let annotation = [];\r\n\r\n if (subtask === 'panoptic' || subtask === 'instance') {\r\n\r\n let processed = fn(\r\n output,\r\n threshold,\r\n mask_threshold,\r\n overlap_mask_area_threshold,\r\n label_ids_to_fuse,\r\n target_sizes ?? imageSizes, // TODO FIX?\r\n )[0];\r\n\r\n let segmentation = processed.segmentation;\r\n let id2label = this.model.config.id2label;\r\n\r\n for (let segment of processed.segments_info) {\r\n let maskData = new Uint8ClampedArray(segmentation.data.length);\r\n for (let i = 0; i < segmentation.data.length; ++i) {\r\n if (segmentation.data[i] === segment.id) {\r\n maskData[i] = 255;\r\n }\r\n }\r\n\r\n let mask = new CustomImage(maskData, segmentation.dims[1], segmentation.dims[0], 1)\r\n\r\n annotation.push({\r\n score: segment.score,\r\n label: id2label[segment.label_id],\r\n mask: mask\r\n })\r\n }\r\n\r\n } else if (subtask === 'semantic') {\r\n throw Error(`semantic segmentation not yet supported.`);\r\n\r\n } else {\r\n throw Error(`Subtask ${subtask} not supported.`);\r\n }\r\n\r\n return annotation;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Class representing a zero-shot image classification pipeline.\r\n * @extends Pipeline\r\n */\r\nclass ZeroShotImageClassificationPipeline extends Pipeline {\r\n\r\n /**\r\n * Create a zero-shot image classification pipeline.\r\n * @param {string} task - The task of the pipeline.\r\n * @param {Object} tokenizer - The tokenizer to use.\r\n * @param {Object} model - The model to use.\r\n * @param {Function} processor - The image processing function.\r\n */\r\n constructor(task, tokenizer, model, processor) {\r\n super(task, tokenizer, model);\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * Classify the input images with candidate labels using a zero-shot approach.\r\n * @param {Array} images - The input images.\r\n * @param {Array} candidate_labels - The candidate labels.\r\n * @param {Object} options - The options for the classification.\r\n * @param {string} [options.hypothesis_template] - The hypothesis template to use for zero-shot classification. Default: \"This is a photo of {}\".\r\n * @todo fix error below\r\n * @returns {Promise} An array of classifications for each input image or a single classification object if only one input image is provided.\r\n */\r\n async _call(images, candidate_labels, {\r\n hypothesis_template = \"This is a photo of {}\"\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n images = await prepareImages(images);\r\n\r\n // Insert label into hypothesis template \r\n let texts = candidate_labels.map(\r\n x => hypothesis_template.replace('{}', x)\r\n );\r\n\r\n // Run tokenization\r\n let text_inputs = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true\r\n });\r\n\r\n // Compare each image with each candidate label\r\n let image_inputs = await this.processor(images);\r\n let output = await this.model({ ...text_inputs, ...image_inputs });\r\n\r\n let toReturn = [];\r\n for (let batch of output.logits_per_image) {\r\n // Compute softmax per image\r\n let probs = softmax(batch.data);\r\n\r\n toReturn.push([...probs].map((x, i) => {\r\n return {\r\n score: x,\r\n label: candidate_labels[i]\r\n }\r\n }));\r\n }\r\n\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n\r\nclass ObjectDetectionPipeline extends Pipeline {\r\n /**\r\n * @param {string} task\r\n * @param {any} model\r\n * @param {any} processor\r\n */\r\n constructor(task, model, processor) {\r\n super(task, null, model); // TODO tokenizer\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * @param {any[]} images\r\n */\r\n async _call(images, {\r\n threshold = 0.5,\r\n percentage = false, // get in percentage (true) or in pixels (false)\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n\r\n if (isBatched && images.length !== 1) {\r\n throw Error(\"Object detection pipeline currently only supports a batch size of 1.\");\r\n }\r\n images = await prepareImages(images);\r\n\r\n let imageSizes = percentage ? null : images.map(x => [x.height, x.width]);\r\n\r\n let inputs = await this.processor(images);\r\n let output = await this.model(inputs);\r\n\r\n let processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes);\r\n\r\n // Add labels\r\n let id2label = this.model.config.id2label;\r\n processed.forEach(x => x.labels = x.classes.map(y => id2label[y]));\r\n\r\n return isBatched ? processed : processed[0];\r\n }\r\n}\r\n\r\nconst SUPPORTED_TASKS = {\r\n \"text-classification\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TextClassificationPipeline,\r\n \"model\": AutoModelForSequenceClassification,\r\n \"default\": {\r\n \"model\": \"distilbert-base-uncased-finetuned-sst-2-english\",\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"token-classification\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TokenClassificationPipeline,\r\n \"model\": AutoModelForTokenClassification,\r\n \"default\": {\r\n \"model\": \"Davlan/bert-base-multilingual-cased-ner-hrl\",\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"question-answering\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": QuestionAnsweringPipeline,\r\n \"model\": AutoModelForQuestionAnswering,\r\n \"default\": {\r\n \"model\": \"distilbert-base-cased-distilled-squad\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n\r\n \"fill-mask\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": FillMaskPipeline,\r\n \"model\": AutoModelForMaskedLM,\r\n \"default\": {\r\n \"model\": \"bert-base-uncased\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"summarization\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": SummarizationPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"default\": {\r\n \"model\": \"sshleifer/distilbart-cnn-6-6\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"translation\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TranslationPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"default\": {\r\n \"model\": \"t5-small\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"text2text-generation\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": Text2TextGenerationPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"default\": {\r\n \"model\": \"google/flan-t5-small\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"text-generation\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TextGenerationPipeline,\r\n \"model\": AutoModelForCausalLM,\r\n \"default\": {\r\n \"model\": \"gpt2\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"zero-shot-classification\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": ZeroShotClassificationPipeline,\r\n \"model\": AutoModelForSequenceClassification,\r\n \"default\": {\r\n \"model\": \"typeform/distilbert-base-uncased-mnli\",\r\n },\r\n \"type\": \"text\",\r\n },\r\n\r\n \"automatic-speech-recognition\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": AutomaticSpeechRecognitionPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"openai/whisper-tiny.en\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"image-to-text\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": ImageToTextPipeline,\r\n \"model\": AutoModelForVision2Seq,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"nlpconnect/vit-gpt2-image-captioning\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"image-classification\": {\r\n // no tokenizer\r\n \"pipeline\": ImageClassificationPipeline,\r\n \"model\": AutoModelForImageClassification,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"google/vit-base-patch16-224\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"image-segmentation\": {\r\n // no tokenizer\r\n \"pipeline\": ImageSegmentationPipeline,\r\n \"model\": AutoModelForImageSegmentation,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"facebook/detr-resnet-50-panoptic\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"zero-shot-image-classification\": {\r\n // no tokenizer\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": ZeroShotImageClassificationPipeline,\r\n \"model\": AutoModel,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"openai/clip-vit-base-patch32\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"object-detection\": {\r\n // no tokenizer\r\n \"pipeline\": ObjectDetectionPipeline,\r\n \"model\": AutoModelForObjectDetection,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"facebook/detr-resnet-50\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n // This task is not supported in HuggingFace transformers, but serves as a useful interface\r\n // for dealing with sentence-transformers (https://huggingface.co/sentence-transformers)\r\n \"embeddings\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": EmbeddingsPipeline,\r\n \"model\": AutoModel,\r\n \"default\": {\r\n \"model\": \"sentence-transformers/all-MiniLM-L6-v2\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n}\r\n\r\nconst TASK_NAME_MAPPING = {\r\n // Fix mismatch between pipeline's task name and exports (folder name)\r\n 'text-classification': 'sequence-classification',\r\n 'embeddings': 'default',\r\n 'fill-mask': 'masked-lm',\r\n\r\n 'text2text-generation': 'seq2seq-lm-with-past',\r\n 'summarization': 'seq2seq-lm-with-past',\r\n 'text-generation': 'causal-lm-with-past',\r\n\r\n 'automatic-speech-recognition': 'speech2seq-lm-with-past',\r\n 'image-to-text': 'vision2seq-lm-with-past',\r\n\r\n 'zero-shot-image-classification': 'default',\r\n 'zero-shot-classification': 'sequence-classification'\r\n}\r\n\r\nconst TASK_PREFIX_MAPPING = {\r\n // if task starts with one of these, set the corresponding folder name\r\n 'translation': 'seq2seq-lm-with-past',\r\n}\r\n\r\n\r\nconst TASK_ALIASES = {\r\n \"sentiment-analysis\": \"text-classification\",\r\n \"ner\": \"token-classification\",\r\n \"vqa\": \"visual-question-answering\",\r\n}\r\n\r\n/**\r\n * Constructs a pipeline for a specified task with optional model and progress callback.\r\n *\r\n * @async\r\n * @function\r\n * @param {string} task - The task to perform, e.g. \"text-generation\".\r\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.\r\n * @param {object} [options] - Optional parameters for the pipeline.\r\n * @param {function} [options.progress_callback=null] - A function to call with progress updates.\r\n * @returns {Promise} A Pipeline object for the specified task.\r\n * @todo fix error below\r\n * @throws {Error} If an unsupported pipeline is requested.\r\n */\r\nasync function pipeline(\r\n task,\r\n model = null,\r\n {\r\n progress_callback = null\r\n } = {}\r\n) {\r\n // Helper method to construct pipeline\r\n\r\n // Apply aliases\r\n task = TASK_ALIASES[task] ?? task;\r\n\r\n // Get pipeline info\r\n let pipelineInfo = SUPPORTED_TASKS[task.split('_', 1)[0]];\r\n if (!pipelineInfo) {\r\n throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`)\r\n }\r\n\r\n\r\n // Use model if specified, otherwise, use default\r\n if (!model) {\r\n model = pipelineInfo.default.model\r\n console.log(`No model specified. Using default model: \"${model}\".`);\r\n }\r\n\r\n // determine suffix\r\n let suffix = TASK_NAME_MAPPING[task];\r\n if (!suffix) {\r\n // try get from suffix\r\n for (const [prefix, mapping] of Object.entries(TASK_PREFIX_MAPPING)) {\r\n if (task.startsWith(prefix)) {\r\n suffix = mapping;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!suffix) {\r\n // Still not set... so, we default to the name given\r\n suffix = task;\r\n }\r\n\r\n // Construct model path\r\n model = pathJoin(\r\n (env.remoteModels) ? env.remoteURL : env.localURL, // host prefix\r\n model, // model name\r\n suffix, // task suffix\r\n )\r\n\r\n let tokenizerClass = pipelineInfo.tokenizer;\r\n let modelClass = pipelineInfo.model;\r\n let pipelineClass = pipelineInfo.pipeline;\r\n let processorClass = pipelineInfo.processor;\r\n\r\n let promises = [];\r\n\r\n if (tokenizerClass) {\r\n promises.push(\r\n AutoTokenizer.from_pretrained(model, progress_callback),\r\n )\r\n }\r\n if (modelClass) {\r\n promises.push(\r\n modelClass.from_pretrained(model, progress_callback)\r\n )\r\n }\r\n\r\n if (processorClass) {\r\n promises.push(\r\n processorClass.from_pretrained(model, progress_callback)\r\n )\r\n }\r\n\r\n // Load tokenizer and model\r\n let items = await Promise.all(promises)\r\n // TODO: fix error below\r\n return new pipelineClass(task, ...items);\r\n\r\n}\r\n\r\n/**\r\n * Compute the Cartesian product of given arrays\r\n * @param {...Array} a - Arrays to compute the product\r\n * @returns {Array} - Returns the computed Cartesian product as an array\r\n */\r\nfunction product(...a) {\r\n // Cartesian product of items\r\n // Adapted from https://stackoverflow.com/a/43053803\r\n return a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e])));\r\n}\r\n\r\nmodule.exports = {\r\n pipeline\r\n};\r\n","\r\nconst {\r\n Callable,\r\n fetchJSON,\r\n indexOfMax,\r\n softmax,\r\n} = require(\"./utils.js\");\r\n\r\n\r\nconst FFT = require('./fft.js');\r\nconst { Tensor, transpose, cat, interpolate } = require(\"./tensor_utils.js\");\r\n\r\nconst { CustomImage } = require('./image_utils.js');\r\n/**\r\n * Helper class to determine model type from config\r\n */\r\nclass AutoProcessor {\r\n /**\r\n * Returns a new instance of a Processor with a feature extractor\r\n * based on the configuration file located at `modelPath`.\r\n *\r\n * @param {string} modelPath - The path to the model directory.\r\n * @param {function} progressCallback - A callback function to track the loading progress (optional).\r\n * @returns {Promise} A Promise that resolves with a new instance of a Processor.\r\n * @throws {Error} If the feature extractor type specified in the configuration file is unknown.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let preprocessorConfig = await fetchJSON(modelPath, 'preprocessor_config.json', progressCallback)\r\n\r\n let processor_class;\r\n let feature_extractor;\r\n\r\n switch (preprocessorConfig.feature_extractor_type) {\r\n case 'WhisperFeatureExtractor':\r\n feature_extractor = new WhisperFeatureExtractor(preprocessorConfig)\r\n break;\r\n case 'ViTFeatureExtractor':\r\n feature_extractor = new ViTFeatureExtractor(preprocessorConfig)\r\n break;\r\n case 'DetrFeatureExtractor':\r\n feature_extractor = new DetrFeatureExtractor(preprocessorConfig)\r\n break;\r\n default:\r\n if (preprocessorConfig.size !== undefined) {\r\n // Assume ImageFeatureExtractor\r\n console.warn('Feature extractor type not specified, assuming ImageFeatureExtractor due to size parameter in config.')\r\n feature_extractor = new ImageFeatureExtractor(preprocessorConfig)\r\n\r\n } else {\r\n throw new Error(`Unknown Feature Extractor type: ${preprocessorConfig.feature_extractor_type}`);\r\n\r\n }\r\n }\r\n\r\n switch (preprocessorConfig.processor_class) {\r\n case 'WhisperProcessor':\r\n processor_class = WhisperProcessor;\r\n break;\r\n default:\r\n // No associated processor class, use default\r\n processor_class = Processor;\r\n }\r\n\r\n return new processor_class(feature_extractor);\r\n }\r\n}\r\n\r\n/**\r\n * Base class for feature extractors.\r\n *\r\n * @extends Callable\r\n */\r\nclass FeatureExtractor extends Callable {\r\n /**\r\n * Constructs a new FeatureExtractor instance.\r\n *\r\n * @param {object} config - The configuration for the feature extractor.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config\r\n }\r\n}\r\n\r\n/**\r\n * Feature extractor for Vision Transformer (ViT) models.\r\n *\r\n * @extends FeatureExtractor\r\n */\r\nclass ImageFeatureExtractor extends FeatureExtractor {\r\n\r\n /**\r\n * Constructs a new ViTFeatureExtractor instance.\r\n *\r\n * @param {object} config - The configuration for the feature extractor.\r\n * @param {number[]} config.image_mean - The mean values for image normalization.\r\n * @param {number[]} config.image_std - The standard deviation values for image normalization.\r\n * @param {boolean} config.do_rescale - Whether to rescale the image pixel values to the [0,1] range.\r\n * @param {boolean} config.do_normalize - Whether to normalize the image pixel values.\r\n * @param {boolean} config.do_resize - Whether to resize the image.\r\n * @param {number} config.size - The size to resize the image to.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.image_mean = this.config.image_mean;\r\n if (!Array.isArray(this.image_mean)) {\r\n this.image_mean = new Array(3).fill(this.image_mean);\r\n }\r\n\r\n this.image_std = this.config.image_std;\r\n if (!Array.isArray(this.image_std)) {\r\n this.image_std = new Array(3).fill(this.image_std);\r\n }\r\n\r\n this.do_rescale = this.config.do_rescale ?? true;\r\n this.do_normalize = this.config.do_normalize;\r\n\r\n this.do_resize = this.config.do_resize;\r\n this.size = this.config.size;\r\n\r\n this.max_size = this.config.max_size;\r\n\r\n // TODO use these\r\n this.do_center_crop = this.config.do_center_crop;\r\n this.crop_size = this.config.crop_size;\r\n }\r\n\r\n /**\r\n * Preprocesses the given image.\r\n *\r\n * @param {CustomImage} image - The image to preprocess.\r\n * @returns {Promise} The preprocessed image as a Tensor.\r\n */\r\n async preprocess(image) {\r\n\r\n const srcWidth = image.width; // original width\r\n const srcHeight = image.height; // original height\r\n\r\n // First, resize all images\r\n if (this.do_resize) {\r\n // If `max_size` is set, maintain aspect ratio and resize to `size`\r\n // while keeping the largest dimension <= `max_size`\r\n if (this.max_size !== undefined) {\r\n // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/\r\n // Try resize so that shortest edge is `this.size` (target)\r\n const ratio = Math.max(this.size / srcWidth, this.size / srcHeight);\r\n const newWidth = srcWidth * ratio;\r\n const newHeight = srcHeight * ratio;\r\n\r\n // The new width and height might be greater than `this.max_size`, so\r\n // we downscale again to ensure the largest dimension is `this.max_size` \r\n const downscaleFactor = Math.min(this.max_size / newWidth, this.max_size / newHeight, 1);\r\n\r\n // Perform resize\r\n image = await image.resize(Math.floor(newWidth * downscaleFactor), Math.floor(newHeight * downscaleFactor));\r\n\r\n } else {\r\n image = await image.resize(this.size, this.size);\r\n }\r\n }\r\n\r\n // Convert image to RGB\r\n image = image.rgb();\r\n\r\n const pixelData = Float32Array.from(image.data);\r\n\r\n if (this.do_rescale) {\r\n for (let i = 0; i < pixelData.length; ++i) {\r\n pixelData[i] = pixelData[i] / 255;\r\n }\r\n }\r\n\r\n if (this.do_normalize) {\r\n for (let i = 0; i < pixelData.length; i += 3) {\r\n for (let j = 0; j < 3; ++j) {\r\n pixelData[i + j] = (pixelData[i + j] - this.image_mean[j]) / this.image_std[j];\r\n }\r\n }\r\n }\r\n\r\n let imgDims = [image.height, image.width, 3];\r\n let img = new Tensor('float32', pixelData, imgDims);\r\n let transposed = transpose(img, [2, 0, 1]); // hwc -> chw\r\n\r\n return transposed;\r\n }\r\n\r\n /**\r\n * Calls the feature extraction process on an array of image\r\n * URLs, preprocesses each image, and concatenates the resulting\r\n * features into a single Tensor.\r\n * @param {any} images - The URL(s) of the image(s) to extract features from.\r\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\r\n */\r\n async _call(images) {\r\n if (!Array.isArray(images)) {\r\n images = [images];\r\n }\r\n images = await Promise.all(images.map(x => this.preprocess(x)));\r\n\r\n images.forEach(x => x.dims = [1, ...x.dims]); // add batch dimension\r\n\r\n images = cat(images);\r\n // TODO concatenate on dim=0\r\n return {\r\n pixel_values: images\r\n }\r\n }\r\n\r\n}\r\n\r\nclass ViTFeatureExtractor extends ImageFeatureExtractor { }\r\n\r\n/**\r\n * Detr Feature Extractor.\r\n *\r\n * @extends ImageFeatureExtractor\r\n */\r\nclass DetrFeatureExtractor extends ImageFeatureExtractor {\r\n /**\r\n * Calls the feature extraction process on an array of image\r\n * URLs, preprocesses each image, and concatenates the resulting\r\n * features into a single Tensor.\r\n * @param {any} urls - The URL(s) of the image(s) to extract features from.\r\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\r\n */\r\n async _call(urls) {\r\n let result = await super._call(urls);\r\n\r\n // TODO support differently-sized images, for now assume all images are the same size.\r\n // TODO support different mask sizes (not just 64x64)\r\n // Currently, just fill pixel mask with 1s\r\n let maskSize = [result.pixel_values.dims[0], 64, 64];\r\n result.pixel_mask = new Tensor(\r\n 'int64',\r\n // TODO: fix error below\r\n new BigInt64Array(maskSize.reduce((a, b) => a * b)).fill(1n),\r\n maskSize\r\n );\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * @param {number[]} arr - The URL(s) of the image(s) to extract features from.\r\n * @returns {number[]} An object containing the concatenated pixel values of the preprocessed images.\r\n */\r\n center_to_corners_format([centerX, centerY, width, height]) {\r\n return [\r\n centerX - width / 2,\r\n centerY - height / 2,\r\n centerX + width / 2,\r\n centerY + height / 2\r\n ];\r\n }\r\n\r\n /**\r\n * @param {{ logits: any; pred_boxes: any; }} outputs\r\n * @return {any}\r\n */\r\n post_process_object_detection(outputs, threshold = 0.5, target_sizes = null) {\r\n const out_logits = outputs.logits;\r\n const out_bbox = outputs.pred_boxes;\r\n const [batch_size, num_boxes, num_classes] = out_logits.dims;\r\n\r\n if (target_sizes !== null && target_sizes.length !== batch_size) {\r\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\r\n }\r\n let toReturn = [];\r\n for (let i = 0; i < batch_size; ++i) {\r\n let target_size = target_sizes !== null ? target_sizes[i] : null;\r\n let info = {\r\n boxes: [],\r\n classes: [],\r\n scores: []\r\n }\r\n let logits = out_logits.get(i);\r\n let bbox = out_bbox.get(i);\r\n\r\n for (let j = 0; j < num_boxes; ++j) {\r\n let logit = logits.get(j);\r\n\r\n // Get most probable class\r\n let maxIndex = indexOfMax(logit.data);\r\n\r\n if (maxIndex === num_classes - 1) {\r\n // This is the background class, skip it\r\n continue;\r\n }\r\n\r\n // Compute softmax over classes\r\n let probs = softmax(logit.data);\r\n\r\n let score = probs[maxIndex];\r\n if (score > threshold) {\r\n // Some class has a high enough probability\r\n /** @type {number[]} */\r\n let box = bbox.get(j);\r\n\r\n // convert to [x0, y0, x1, y1] format\r\n box = this.center_to_corners_format(box)\r\n if (target_size !== null) {\r\n box = box.map((x, i) => x * target_size[(i + 1) % 2])\r\n }\r\n\r\n info.boxes.push(box);\r\n info.classes.push(maxIndex);\r\n info.scores.push(score);\r\n }\r\n }\r\n toReturn.push(info);\r\n }\r\n return toReturn;\r\n }\r\n\r\n /**\r\n * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`.\r\n * @param {Tensor} class_logits - The class logits.\r\n * @param {Tensor} mask_logits - The mask logits.\r\n * @param {number} object_mask_threshold - A number between 0 and 1 used to binarize the masks.\r\n * @param {number} num_labels - The number of labels.\r\n * @returns {[Tensor[], number[], number[]]} - The binarized masks, the scores, and the labels.\r\n */\r\n remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) {\r\n\r\n let mask_probs_item = [];\r\n let pred_scores_item = [];\r\n let pred_labels_item = [];\r\n\r\n for (let j = 0; j < class_logits.dims[0]; ++j) {\r\n let cls = class_logits.get(j);\r\n let mask = mask_logits.get(j);\r\n\r\n let pred_label = indexOfMax(cls.data);\r\n if (pred_label === num_labels) {\r\n // Is the background, so we ignore it\r\n continue;\r\n }\r\n\r\n let scores = softmax(cls.data);\r\n let pred_score = scores[pred_label];\r\n if (pred_score > object_mask_threshold) {\r\n mask_probs_item.push(mask);\r\n pred_scores_item.push(pred_score);\r\n pred_labels_item.push(pred_label);\r\n }\r\n }\r\n\r\n return [mask_probs_item, pred_scores_item, pred_labels_item];\r\n\r\n }\r\n\r\n /**\r\n * Checks whether the segment is valid or not.\r\n * @param {Int32Array} mask_labels - Labels for each pixel in the mask.\r\n * @param {Tensor[]} mask_probs - Probabilities for each pixel in the masks.\r\n * @param {number} k - The class id of the segment.\r\n * @param {number} mask_threshold - The mask threshold.\r\n * @param {number} overlap_mask_area_threshold - The overlap mask area threshold.\r\n * @returns {[boolean, number[]]} - Whether the segment is valid or not, and the indices of the valid labels.\r\n */\r\n check_segment_validity(\r\n mask_labels,\r\n mask_probs,\r\n k,\r\n mask_threshold = 0.5,\r\n overlap_mask_area_threshold = 0.8\r\n ) {\r\n // mask_k is a 1D array of indices, indicating where the mask is equal to k\r\n let mask_k = [];\r\n let mask_k_area = 0;\r\n let original_area = 0;\r\n\r\n // Compute the area of all the stuff in query k\r\n for (let i = 0; i < mask_labels.length; ++i) {\r\n if (mask_labels[i] === k) {\r\n mask_k.push(i);\r\n ++mask_k_area;\r\n }\r\n\r\n if (mask_probs[k].data[i] >= mask_threshold) {\r\n ++original_area;\r\n }\r\n }\r\n let mask_exists = mask_k_area > 0 && original_area > 0;\r\n\r\n // Eliminate disconnected tiny segments\r\n if (mask_exists) {\r\n // Perform additional check\r\n let area_ratio = mask_k_area / original_area;\r\n mask_exists = area_ratio > overlap_mask_area_threshold;\r\n }\r\n\r\n return [mask_exists, mask_k]\r\n }\r\n\r\n /**\r\n * Computes the segments.\r\n * @param {Tensor[]} mask_probs - The mask probabilities.\r\n * @param {number[]} pred_scores - The predicted scores.\r\n * @param {number[]} pred_labels - The predicted labels.\r\n * @param {number} mask_threshold - The mask threshold.\r\n * @param {number} overlap_mask_area_threshold - The overlap mask area threshold.\r\n * @param {Set} label_ids_to_fuse - The label ids to fuse.\r\n * @param {number[]} target_size - The target size of the image.\r\n * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} - The computed segments.\r\n */\r\n compute_segments(\r\n mask_probs,\r\n pred_scores,\r\n pred_labels,\r\n mask_threshold,\r\n overlap_mask_area_threshold,\r\n label_ids_to_fuse = null,\r\n target_size = null,\r\n ) {\r\n let [height, width] = target_size ?? mask_probs[0].dims;\r\n\r\n let segmentation = new Tensor(\r\n 'int32',\r\n new Int32Array(height * width),\r\n [height, width]\r\n );\r\n let segments = [];\r\n\r\n // 1. If target_size is not null, we need to resize the masks to the target size\r\n if (target_size !== null) {\r\n // resize the masks to the target size\r\n for (let i = 0; i < mask_probs.length; ++i) {\r\n mask_probs[i] = interpolate(mask_probs[i], target_size, 'bilinear', false);\r\n }\r\n }\r\n\r\n // 2. Weigh each mask by its prediction score\r\n // NOTE: `mask_probs` is updated in-place\r\n // \r\n // Temporary storage for the best label/scores for each pixel ([height, width]):\r\n let mask_labels = new Int32Array(mask_probs[0].data.length);\r\n let bestScores = new Float32Array(mask_probs[0].data.length);\r\n\r\n for (let i = 0; i < mask_probs.length; ++i) {\r\n let score = pred_scores[i];\r\n\r\n for (let j = 0; j < mask_probs[i].data.length; ++j) {\r\n mask_probs[i].data[j] *= score\r\n if (mask_probs[i].data[j] > bestScores[j]) {\r\n mask_labels[j] = i;\r\n bestScores[j] = mask_probs[i].data[j];\r\n }\r\n }\r\n }\r\n\r\n let current_segment_id = 0;\r\n\r\n // let stuff_memory_list = {}\r\n for (let k = 0; k < pred_labels.length; ++k) {\r\n let pred_class = pred_labels[k];\r\n\r\n // TODO add `should_fuse`\r\n // let should_fuse = pred_class in label_ids_to_fuse\r\n\r\n // Check if mask exists and large enough to be a segment\r\n let [mask_exists, mask_k] = this.check_segment_validity(\r\n mask_labels,\r\n mask_probs,\r\n k,\r\n mask_threshold,\r\n overlap_mask_area_threshold\r\n )\r\n\r\n if (!mask_exists) {\r\n // Nothing to see here\r\n continue;\r\n }\r\n\r\n // TODO\r\n // if (pred_class in stuff_memory_list) {\r\n // current_segment_id = stuff_memory_list[pred_class]\r\n // } else {\r\n // current_segment_id += 1;\r\n // }\r\n ++current_segment_id;\r\n\r\n\r\n // Add current object segment to final segmentation map\r\n for (let index of mask_k) {\r\n segmentation.data[index] = current_segment_id;\r\n }\r\n\r\n segments.push({\r\n id: current_segment_id,\r\n label_id: pred_class,\r\n // was_fused: should_fuse, TODO\r\n score: pred_scores[k],\r\n })\r\n\r\n // TODO\r\n // if(should_fuse){\r\n // stuff_memory_list[pred_class] = current_segment_id\r\n // }\r\n }\r\n\r\n return [segmentation, segments];\r\n }\r\n\r\n /**\r\n * Post-process the model output to generate the final panoptic segmentation.\r\n * @param {*} outputs - The model output to post process\r\n * @param {number} [threshold=0.5] - The probability score threshold to keep predicted instance masks.\r\n * @param {number} [mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values.\r\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.\r\n * @param {Set} [label_ids_to_fuse=null] - The labels in this state will have all their instances be fused together.\r\n * @param {number[][]} [target_sizes=null] - The target sizes to resize the masks to.\r\n * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>}\r\n */\r\n post_process_panoptic_segmentation(\r\n outputs,\r\n threshold = 0.5,\r\n mask_threshold = 0.5,\r\n overlap_mask_area_threshold = 0.8,\r\n label_ids_to_fuse = null,\r\n target_sizes = null,\r\n ) {\r\n if (label_ids_to_fuse === null) {\r\n console.warn(\"`label_ids_to_fuse` unset. No instance will be fused.\")\r\n label_ids_to_fuse = new Set();\r\n }\r\n\r\n const class_queries_logits = outputs.logits; // [batch_size, num_queries, num_classes+1]\r\n const masks_queries_logits = outputs.pred_masks; // [batch_size, num_queries, height, width]\r\n\r\n const mask_probs = masks_queries_logits.sigmoid() // [batch_size, num_queries, height, width]\r\n\r\n let [batch_size, num_queries, num_labels] = class_queries_logits.dims;\r\n num_labels -= 1; // Remove last class (background)\r\n\r\n if (target_sizes !== null && target_sizes.length !== batch_size) {\r\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\r\n }\r\n\r\n let toReturn = [];\r\n for (let i = 0; i < batch_size; ++i) {\r\n let target_size = target_sizes !== null ? target_sizes[i] : null;\r\n\r\n let class_logits = class_queries_logits.get(i);\r\n let mask_logits = mask_probs.get(i);\r\n\r\n let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels);\r\n\r\n if (pred_labels_item.length === 0) {\r\n // No mask found\r\n let [height, width] = target_size ?? mask_logits.dims.slice(-2);\r\n\r\n let segmentation = new Tensor(\r\n 'int32',\r\n new Int32Array(height * width).fill(-1),\r\n [height, width]\r\n )\r\n toReturn.push({\r\n segmentation: segmentation,\r\n segments_info: []\r\n });\r\n continue;\r\n }\r\n\r\n\r\n // Get segmentation map and segment information of batch item\r\n let [segmentation, segments] = this.compute_segments(\r\n mask_probs_item,\r\n pred_scores_item,\r\n pred_labels_item,\r\n mask_threshold,\r\n overlap_mask_area_threshold,\r\n label_ids_to_fuse,\r\n target_size,\r\n )\r\n\r\n toReturn.push({\r\n segmentation: segmentation,\r\n segments_info: segments\r\n })\r\n }\r\n\r\n return toReturn;\r\n }\r\n\r\n post_process_instance_segmentation() {\r\n // TODO\r\n throw Error(\"Not implemented yet\");\r\n }\r\n}\r\n\r\n\r\nclass WhisperFeatureExtractor extends FeatureExtractor {\r\n\r\n /**\r\n * Calculates the index offset for a given index and window size.\r\n * @param {number} i - The index.\r\n * @param {number} w - The window size.\r\n * @returns {number} The index offset.\r\n */\r\n calcOffset(i, w) {\r\n return Math.abs((i + w) % (2 * w) - w);\r\n }\r\n\r\n /**\r\n * Pads an array with a reflected version of itself on both ends.\r\n * @param {Float32Array} array - The array to pad.\r\n * @param {number} left - The amount of padding to add to the left.\r\n * @param {number} right - The amount of padding to add to the right.\r\n * @returns {Float32Array} The padded array.\r\n */\r\n padReflect(array, left, right) {\r\n const padded = new Float32Array(array.length + left + right);\r\n const w = array.length - 1;\r\n\r\n for (let i = 0; i < array.length; ++i) {\r\n padded[left + i] = array[i];\r\n }\r\n\r\n for (let i = 1; i <= left; ++i) {\r\n padded[left - i] = array[this.calcOffset(i, w)];\r\n }\r\n\r\n for (let i = 1; i <= right; ++i) {\r\n padded[w + left + i] = array[this.calcOffset(w - i, w)];\r\n }\r\n\r\n return padded;\r\n }\r\n\r\n /**\r\n * Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal.\r\n * \r\n * @param {number[][]} frames - A 2D array representing the signal frames.\r\n * @param {number[]} window - A 1D array representing the window to be applied to the frames.\r\n * @returns {Object} An object with the following properties:\r\n * - data: A 1D array representing the complex STFT of the signal.\r\n * - dims: An array representing the dimensions of the STFT data, i.e. [num_frames, num_fft_bins].\r\n */\r\n stft(frames, window) {\r\n // Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal.\r\n // \r\n // NOTE: Since the window width is not a power of 2, we must \r\n // perform Fast Fourier Transform with chirp-z transform:\r\n // https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156\r\n\r\n // Helper variables\r\n const fft_size = this.config.n_fft;\r\n const a = 2 * (fft_size - 1);\r\n const b = 2 * (2 * fft_size - 1);\r\n const nextP2 = 2 ** (Math.ceil(Math.log2(b)))\r\n const num_fft_bins = fft_size + 2;\r\n\r\n // Preallocate array to store output\r\n // double since we store complex numbers\r\n const data = new Float32Array(num_fft_bins * frames.length);\r\n\r\n // Define buffers\r\n // Compute chirp for transform\r\n const chirp = new Float32Array(b);\r\n const ichirp = new Float32Array(nextP2);\r\n const buffer1 = new Float32Array(nextP2);\r\n const buffer2 = new Float32Array(nextP2);\r\n const outBuffer = new Float32Array(nextP2);\r\n const outBuffer2 = new Float32Array(nextP2);\r\n const outBuffer3 = new Float32Array(nextP2);\r\n\r\n // Compute complex exponentiation\r\n const theta = -2 * Math.PI / fft_size;\r\n const baseR = Math.cos(theta);\r\n const baseI = Math.sin(theta);\r\n\r\n // Precompute helper for chirp-z transform\r\n for (let i = 0; i < b >> 1; ++i) {\r\n // Compute complex power:\r\n const e = (i + 1 - fft_size) ** 2 / 2.0;\r\n\r\n // Compute the modulus and argument of the result\r\n const result_mod = Math.sqrt(baseR ** 2 + baseI ** 2) ** e;\r\n const result_arg = e * Math.atan2(baseI, baseR);\r\n\r\n // Convert the result back to rectangular form\r\n // and assign to chirp and ichirp\r\n let i2 = 2 * i;\r\n chirp[i2] = result_mod * Math.cos(result_arg);\r\n chirp[i2 + 1] = result_mod * Math.sin(result_arg);\r\n\r\n // conjugate\r\n ichirp[i2] = chirp[i2];\r\n ichirp[i2 + 1] = - chirp[i2 + 1];\r\n }\r\n const slicedChirp = chirp.subarray(a, b);\r\n\r\n // create object to perform Fast Fourier Transforms\r\n // with `nextP2` complex numbers\r\n const f = new FFT(nextP2 >> 1);\r\n // TODO: decide between Float32Array and Float64Array\r\n f.transform(outBuffer, ichirp);\r\n\r\n for (let i = 0; i < frames.length; ++i) {\r\n const frame = frames[i];\r\n\r\n for (let j = 0; j < slicedChirp.length; j += 2) {\r\n const j2 = j + 1\r\n const j3 = j >> 1;\r\n\r\n const a_real = frame[j3] * window[j3];\r\n buffer1[j] = a_real * slicedChirp[j];\r\n buffer1[j2] = a_real * slicedChirp[j2];\r\n }\r\n // TODO: decide between Float32Array and Float64Array\r\n f.transform(outBuffer2, buffer1);\r\n\r\n for (let j = 0; j < outBuffer.length; j += 2) {\r\n const j2 = j + 1;\r\n\r\n buffer2[j] = outBuffer2[j] * outBuffer[j] - outBuffer2[j2] * outBuffer[j2]\r\n buffer2[j2] = outBuffer2[j] * outBuffer[j2] + outBuffer2[j2] * outBuffer[j]\r\n }\r\n // TODO: decide between Float32Array and Float64Array\r\n f.inverseTransform(outBuffer3, buffer2)\r\n\r\n const offset = i * num_fft_bins;\r\n for (let j = 0; j < num_fft_bins; j += 2) {\r\n const a_real = outBuffer3[j + a];\r\n const a_imag = outBuffer3[j + a + 1];\r\n const b_real = slicedChirp[j];\r\n const b_imag = slicedChirp[j + 1];\r\n\r\n // TODO write as transpose\r\n const o1 = offset + j;\r\n data[o1] = a_real * b_real - a_imag * b_imag\r\n data[o1 + 1] = a_real * b_imag + a_imag * b_real\r\n }\r\n }\r\n\r\n return {\r\n data: data,\r\n dims: [frames.length, num_fft_bins] // [3001, 402]\r\n };\r\n }\r\n\r\n /**\r\n * Creates an array of frames from a given waveform.\r\n *\r\n * @param {Float32Array} waveform - The waveform to create frames from.\r\n * @param {boolean} [center=true] - Whether to center the frames on their corresponding positions in the waveform. Defaults to true.\r\n * @returns {Array} An array of frames.\r\n */\r\n fram_wave(waveform, center = true) {\r\n const frames = [];\r\n const half_window = Math.floor((this.config.n_fft - 1) / 2) + 1;\r\n const waveformLength = waveform.length;\r\n\r\n for (let i = 0; i < waveformLength + 1; i += this.config.hop_length) {\r\n\r\n let frame;\r\n if (center) {\r\n\r\n let frameStart = i > half_window ? i - half_window : 0;\r\n let frameEnd =\r\n i < waveformLength - half_window\r\n ? i + half_window\r\n : waveformLength;\r\n\r\n frame = waveform.subarray(frameStart, frameEnd)\r\n\r\n if (frameStart === 0) {\r\n frame = this.padReflect(\r\n frame,\r\n -i + half_window,\r\n 0\r\n )\r\n\r\n } else if (frameEnd === waveformLength) {\r\n frame = this.padReflect(\r\n frame,\r\n 0,\r\n i - waveformLength + half_window\r\n )\r\n }\r\n\r\n } else {\r\n frame = new Float32Array(this.config.n_fft);\r\n const frameArray = waveform.subarray(i, i + this.config.n_fft);\r\n\r\n if (frameArray.length < this.config.n_fft) {\r\n frame.set(frameArray);\r\n frame.fill(0, frameArray.length, this.config.n_fft)\r\n } else {\r\n frame = frameArray;\r\n }\r\n\r\n }\r\n frames.push(frame);\r\n }\r\n\r\n return frames;\r\n }\r\n\r\n /**\r\n * Generates a Hanning window of length M.\r\n *\r\n * @param {number} M - The length of the Hanning window to generate.\r\n * @returns {*} - The generated Hanning window.\r\n */\r\n hanning(M) {\r\n if (M < 1) {\r\n return [];\r\n }\r\n if (M === 1) {\r\n return [1];\r\n }\r\n const denom = M - 1;\r\n const cos_vals = new Float32Array(denom);\r\n for (let i = 0; i < denom; ++i) {\r\n const n = 2 * i - M + 1;\r\n cos_vals[i] = 0.5 + 0.5 * Math.cos(Math.PI * n / denom);\r\n }\r\n return cos_vals;\r\n }\r\n\r\n /**\r\n * Computes the log-Mel spectrogram of the provided audio waveform.\r\n * @param {Float32Array} waveform - The audio waveform to process.\r\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\r\n */\r\n _extract_fbank_features(waveform) {\r\n // Compute the log-Mel spectrogram of the provided audio\r\n\r\n const buffer = new Float32Array(this.config.n_samples);\r\n buffer.set(waveform)\r\n\r\n const window = this.hanning(this.config.n_fft + 1)\r\n const frames = this.fram_wave(buffer)\r\n\r\n const stft = this.stft(frames, window)\r\n\r\n const stftData = stft.data;\r\n const d1 = stft.dims[0] - 1; // Ignore last row\r\n const d2 = stft.dims[1] >> 1; // Only need to store real numbers now\r\n\r\n // compute magnitudes\r\n // NOTE: Unlinke the original implementation, we do not\r\n // transpose since we perform matrix multiplication later\r\n const magnitudes = new Float32Array(d1 * d2);\r\n for (let i = 0; i < d1; ++i) {\r\n for (let j = 0; j < d2; ++j) {\r\n // let outOffset = (j * d1 + i); // transpose\r\n let outOffset = i * d2 + j;\r\n let inOffset = outOffset << 1; // * 2 since complex\r\n let magnitude = stftData[inOffset] ** 2 + stftData[inOffset + 1] ** 2\r\n magnitudes[outOffset] = magnitude;\r\n }\r\n }\r\n\r\n const mel_filters = this.config.mel_filters\r\n const num_mel_filters = mel_filters.length;\r\n\r\n const mel_spec = new Float32Array(num_mel_filters * d1);\r\n let mIndex = 0;\r\n\r\n // Perform matrix muliplication:\r\n // mel_spec = filters @ magnitudes\r\n // - filters.shape=(80, 201)\r\n // - magnitudes.shape=(201, 3000)\r\n // - mel_spec.shape=(80, 3000)\r\n for (let i = 0; i < num_mel_filters; ++i) {\r\n const mel_filter = mel_filters[i];\r\n\r\n for (let j = 0; j < d1; ++j) {\r\n let sum = 0;\r\n\r\n // perform dot product\r\n for (let k = 0; k < d2; ++k) {\r\n sum += mel_filter[k] * magnitudes[j * d2 + k];\r\n }\r\n\r\n mel_spec[mIndex++] = sum;\r\n }\r\n }\r\n\r\n const a_min = 1e-10;\r\n const log_spec = new Float32Array(mel_spec.length);\r\n\r\n let maxLogSpec = 0;\r\n for (let i = 0; i < mel_spec.length; i++) {\r\n const clipped = Math.max(a_min, mel_spec[i]);\r\n const log10 = Math.log10(clipped);\r\n log_spec[i] = log10;\r\n maxLogSpec = Math.max(log10, maxLogSpec)\r\n }\r\n\r\n for (let i = 0; i < log_spec.length; i++) {\r\n log_spec[i] = Math.max(log_spec[i], maxLogSpec - 8);\r\n log_spec[i] = (log_spec[i] + 4) / 4;\r\n }\r\n\r\n return {\r\n data: log_spec,\r\n dims: [num_mel_filters, d1]\r\n };\r\n }\r\n\r\n /**\r\n * Asynchronously extracts features from a given audio using the provided configuration.\r\n * @param {Float32Array} audio - The audio data as a Float32Array.\r\n * @returns {Promise<{ input_features: Tensor }>} - A Promise resolving to an object containing the extracted input features as a Tensor.\r\n * @async\r\n */\r\n async _call(audio) {\r\n // audio is a float32array\r\n\r\n if (audio.length > this.config.n_samples) {\r\n console.warn(\r\n \"Attempting to extract features for audio longer than 30 seconds. \" +\r\n \"If using a pipeline to extract transcript from a long audio clip, \" +\r\n \"remember to specify `chunk_length_s` and/or `stride_length_s`.\"\r\n );\r\n }\r\n let waveform = audio.slice(0, this.config.n_samples)\r\n\r\n let features = this._extract_fbank_features(waveform);\r\n\r\n return {\r\n input_features: new Tensor('float32',\r\n features.data,\r\n [1, ...features.dims]\r\n )\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Represents a Processor that extracts features from an input.\r\n * @extends Callable\r\n */\r\nclass Processor extends Callable {\r\n /**\r\n * Creates a new Processor with the given feature extractor.\r\n * @param {function} feature_extractor - The function used to extract features from the input.\r\n */\r\n constructor(feature_extractor) {\r\n super();\r\n this.feature_extractor = feature_extractor;\r\n // TODO use tokenizer here?\r\n }\r\n\r\n /**\r\n * Calls the feature_extractor function with the given input.\r\n * @param {any} input - The input to extract features from.\r\n * @returns {Promise} A Promise that resolves with the extracted features.\r\n * @async\r\n */\r\n async _call(input) {\r\n return await this.feature_extractor(input);\r\n }\r\n}\r\n\r\n/**\r\n * Represents a WhisperProcessor that extracts features from an audio input.\r\n * @extends Processor\r\n */\r\nclass WhisperProcessor extends Processor {\r\n /**\r\n * Calls the feature_extractor function with the given audio input.\r\n * @param {any} audio - The audio input to extract features from.\r\n * @returns {Promise} A Promise that resolves with the extracted features.\r\n * @async\r\n */\r\n async _call(audio) {\r\n return await this.feature_extractor(audio)\r\n }\r\n}\r\n\r\n\r\nmodule.exports = {\r\n AutoProcessor,\r\n Processor,\r\n}\r\n","const {\r\n Callable,\r\n indexOfMax,\r\n softmax,\r\n log_softmax,\r\n getTopItems\r\n} = require(\"./utils.js\");\r\n\r\n/**\r\n * Sampler is a base class for all sampling methods used for text generation.\r\n */\r\nclass Sampler extends Callable {\r\n /**\r\n * Creates a new Sampler object with the specified temperature.\r\n * @param {number} temperature - The temperature to use when sampling. Higher values result in more random samples.\r\n */\r\n constructor(temperature) {\r\n super();\r\n this.temperature = temperature;\r\n }\r\n\r\n /**\r\n * Executes the sampler, using the specified logits.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @returns {void}\r\n */\r\n _call(logits, index = -1) {\r\n // Sample from logits, of dims [batch, sequence_length, vocab_size].\r\n // If index is specified, sample from [batch, index, vocab_size].\r\n return this.sample(logits, index);\r\n }\r\n\r\n /**\r\n * Abstract method for sampling the logits.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @throws {Error}\r\n */\r\n sample(logits, index) {\r\n throw Error(\"sample should be implemented in subclasses.\")\r\n }\r\n\r\n /**\r\n * Returns the specified logits as an array, with temperature applied.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @returns {Array}\r\n */\r\n getLogits(logits, index) {\r\n let vocabSize = logits.dims[2];\r\n\r\n let logs = logits.data;\r\n\r\n if (index === -1) {\r\n logs = logs.slice(-vocabSize);\r\n } else {\r\n let startIndex = index * vocabSize;\r\n logs = logs.slice(startIndex, startIndex + vocabSize);\r\n }\r\n\r\n // add temperature\r\n if (this.temperature > 0) {\r\n logs = logs.map(x => x / this.temperature)\r\n }\r\n return logs;\r\n }\r\n\r\n /**\r\n * Selects an item randomly based on the specified probabilities.\r\n * @param {Array} probabilities - An array of probabilities to use for selection.\r\n * @returns {number} The index of the selected item.\r\n */\r\n randomSelect(probabilities) {\r\n // Return index of chosen item\r\n let sumProbabilities = probabilities.reduce((acc, curr) => acc + curr, 0);\r\n\r\n let r = Math.random() * sumProbabilities;\r\n for (let i = 0; i < probabilities.length; ++i) {\r\n r -= probabilities[i];\r\n if (r <= 0) {\r\n return i;\r\n }\r\n }\r\n return 0; // return first (most probable) as a fallback\r\n }\r\n\r\n /**\r\n * Returns a Sampler object based on the specified options.\r\n * @param {object} generation_config - An object containing options for the sampler.\r\n * @returns {Sampler} A Sampler object.\r\n */\r\n static getSampler(generation_config) {\r\n if (generation_config.num_beams > 1) {\r\n return new BeamSearchSampler(\r\n generation_config.temperature,\r\n generation_config.num_beams,\r\n generation_config.do_sample,\r\n generation_config.top_k,\r\n );\r\n\r\n } else if (generation_config.do_sample) {\r\n return new TopKSampler(\r\n generation_config.temperature,\r\n generation_config.top_k,\r\n );\r\n\r\n } else {\r\n if (generation_config.num_return_sequences > 1) {\r\n throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${generation_config.num_return_sequences}.`)\r\n }\r\n return new GreedySampler(generation_config.temperature);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a Greedy Sampler.\r\n * @extends Sampler\r\n */\r\nclass GreedySampler extends Sampler {\r\n /**\r\n * Sample the maximum probability of a given logits tensor.\r\n * @param {any} logits\r\n * @param {number} [index=-1]\r\n * @returns {Array} - An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search).\r\n */\r\n sample(logits, index = -1) {\r\n // NOTE: no need to do log_softmax here since we only take the maximum\r\n let logs = this.getLogits(logits, index);\r\n let argmax = indexOfMax(logs);\r\n\r\n // Note: score is meaningless in this context, since we are performing\r\n // greedy search (p = 1 => log(p) = 0)\r\n return [\r\n [argmax, 0]\r\n ];\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a TopKSampler.\r\n * @extends Sampler\r\n */\r\nclass TopKSampler extends Sampler {\r\n /**\r\n * Create a TopKSampler.\r\n * @param {number} temperature\r\n * @param {number} k\r\n */\r\n constructor(temperature, k) {\r\n super(temperature);\r\n this.k = k;\r\n }\r\n\r\n /**\r\n * Sample from the logits using the top-k sampling strategy.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @returns {Array}\r\n */\r\n sample(logits, index = -1) {\r\n let [batchSize, seqLength, vocabSize] = logits.dims;\r\n let k = vocabSize;\r\n if (this.k > 0) {\r\n k = Math.min(this.k, k);\r\n }\r\n\r\n let logs = this.getLogits(logits, index);\r\n\r\n // Get top k tokens\r\n let topLogits = getTopItems(logs, k);\r\n\r\n // Compute softmax over logits\r\n let probabilities = softmax(topLogits.map(x => x[1]));\r\n\r\n let sampledIndex = this.randomSelect(probabilities);\r\n\r\n let tokenId = topLogits[sampledIndex][0];\r\n let score = Math.log(probabilities[sampledIndex]);\r\n return [\r\n [tokenId, score]\r\n ];\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a beam search sampler for generating sequences.\r\n * @extends Sampler\r\n */\r\nclass BeamSearchSampler extends Sampler {\r\n /**\r\n * Create a BeamSearchSampler.\r\n * @param {number} temperature\r\n * @param {number} num_beams\r\n * @param {boolean} do_sample\r\n * @param {number} top_k\r\n */\r\n constructor(temperature, num_beams, do_sample, top_k) {\r\n super(temperature);\r\n this.num_beams = num_beams; // maximum number of beams\r\n this.do_sample = do_sample; // if true, perform multinomial sampling\r\n\r\n this.top_k = top_k; // if do_sample, sample from top k items\r\n }\r\n\r\n /**\r\n * Samples from the logits to generate a sequence using beam search.\r\n * @param {any} logits - The logits to sample from.\r\n * @param {number} [index=-1] - The index to sample from, if applicable.\r\n * @returns {Array} - An array of arrays containing tokens and scores.\r\n */\r\n sample(logits, index = -1) {\r\n\r\n let logs = this.getLogits(logits, index);\r\n\r\n if (this.do_sample || this.top_k > 0) {\r\n const [batchSize, seqLength, vocabSize] = logits.dims;\r\n\r\n let k = vocabSize;\r\n if (this.top_k > 0) {\r\n k = Math.min(this.top_k, k);\r\n }\r\n const topLogits = getTopItems(logs, k);\r\n\r\n // Compute softmax over top k logits\r\n const probabilities = softmax(topLogits.map(x => x[1]));\r\n\r\n return Array.from({ length: this.num_beams }, () => {\r\n const sampledIndex = this.randomSelect(probabilities);\r\n const tokenId = topLogits[sampledIndex][0];\r\n return [tokenId, Math.log(probabilities[sampledIndex])];\r\n });\r\n\r\n } else {\r\n // first perform log softmax to get scores over whole distribution\r\n const logProbabilities = log_softmax(logs);\r\n const topLogits = getTopItems(logProbabilities, this.num_beams);\r\n return topLogits;\r\n }\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n Sampler,\r\n GreedySampler,\r\n TopKSampler,\r\n BeamSearchSampler\r\n}\r\n","const { ONNX } = require('./backends/onnx.js');\r\n\r\nconst { interpolate: interpolate_data, transpose: transpose_data } = require('./math_utils.js');\r\n\r\n\r\n/**\r\n * @typedef {import('./math_utils.js').AnyTypedArray} AnyTypedArray\r\n */\r\n\r\nconst ONNXTensor = ONNX.Tensor;\r\n\r\n// TODO: fix error below\r\nclass Tensor extends ONNXTensor {\r\n /**\r\n * Create a new Tensor or copy an existing Tensor.\r\n * @param {[string, Array|AnyTypedArray, number[]]|[ONNXTensor]} args \r\n */\r\n constructor(...args) {\r\n if (args[0] instanceof ONNX.Tensor) {\r\n // Create shallow copy\r\n super(args[0].type, args[0].data, args[0].dims);\r\n\r\n } else {\r\n // Create new\r\n super(...args)\r\n }\r\n }\r\n\r\n /**\r\n * Returns an iterator object for iterating over the tensor data in row-major order.\r\n * If the tensor has more than one dimension, the iterator will yield subarrays.\r\n * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order.\r\n */\r\n *[Symbol.iterator]() {\r\n const [iterLength, ...iterDims] = this.dims;\r\n\r\n if (iterDims.length > 0) {\r\n const iterSize = iterDims.reduce((a, b) => a * b);\r\n for (let i = 0; i < iterLength; ++i) {\r\n yield this._subarray(i, iterSize, iterDims);\r\n }\r\n } else {\r\n yield* this.data\r\n }\r\n\r\n }\r\n\r\n /**\r\n * \r\n * @param {number} index \r\n * @returns {Tensor}\r\n * @todo Set type based on dims\r\n */\r\n get(index) {\r\n const iterDims = this.dims.slice(1);\r\n if (iterDims.length > 0) {\r\n const iterSize = iterDims.reduce((a, b) => a * b);\r\n return this._subarray(index, iterSize, iterDims);\r\n } else {\r\n return this.data[index];\r\n }\r\n }\r\n\r\n /**\r\n * @param {any} item \r\n * @returns {number}\r\n */\r\n indexOf(item) {\r\n for (let index = 0; index < this.data.length; ++index) {\r\n // Note: == instead of === so we can match Ints with BigInts\r\n if (this.data[index] == item) {\r\n return index;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n /**\r\n * @param {number} index \r\n * @param {number} iterSize \r\n * @param {any} iterDims \r\n * @returns {Tensor}\r\n */\r\n _subarray(index, iterSize, iterDims) {\r\n let data = this.data.subarray(index * iterSize, (index + 1) * iterSize);\r\n return new Tensor(this.type, data, iterDims);\r\n }\r\n\r\n tolist() {\r\n // Convert tensor data to a n-dimensional JS list\r\n return reshape(this.data, this.dims)\r\n }\r\n\r\n /**\r\n * Return a new Tensor the sigmoid function applied to each element.\r\n * @returns {Tensor} - The tensor with the sigmoid function applied.\r\n */\r\n sigmoid() {\r\n return this.clone().sigmoid_();\r\n }\r\n\r\n /**\r\n * Applies the sigmoid function to the tensor in place.\r\n * @returns {Tensor} - Returns `this`.\r\n */\r\n sigmoid_() {\r\n for (let i = 0; i < this.data.length; ++i) {\r\n this.data[i] = 1 / (1 + Math.exp(-this.data[i]));\r\n }\r\n return this;\r\n }\r\n\r\n clone() {\r\n return new Tensor(this.type, this.data.slice(), this.dims.slice());\r\n }\r\n\r\n // TODO add .slice()\r\n\r\n /**\r\n * Return a transposed version of this Tensor, according to the provided dimensions.\r\n * @param {...number} dims - Dimensions to transpose.\r\n * @returns {Tensor} - The transposed tensor.\r\n */\r\n transpose(...dims) {\r\n return transpose(this, dims);\r\n }\r\n}\r\n\r\n/**\r\n * This creates a nested array of a given type and depth (see examples).\r\n * \r\n * @example\r\n * NestArray; // string[]\r\n * @example\r\n * NestArray; // number[][]\r\n * @example\r\n * NestArray; // string[][][] etc.\r\n * @template T\r\n * @template {number} Depth\r\n * @template {never[]} [Acc=[]]\r\n * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray\r\n */\r\n\r\n/**\r\n * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions.\r\n *\r\n * @example\r\n * reshape([10 ], [1 ]); // Type: number[] Value: [10]\r\n * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]]\r\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\r\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]]\r\n * @param {T[]} data - The input array to reshape.\r\n * @param {DIM} dimensions - The target shape/dimensions.\r\n * @template T\r\n * @template {[number]|[number, number]|[number, number, number]|[number, number, number, number]} DIM\r\n * @returns {NestArray} The reshaped array.\r\n */\r\nfunction reshape(data, dimensions) {\r\n\r\n const totalElements = data.length;\r\n const dimensionSize = dimensions.reduce((a, b) => a * b);\r\n\r\n if (totalElements !== dimensionSize) {\r\n throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`);\r\n }\r\n\r\n /** @type {any} */\r\n let reshapedArray = data;\r\n\r\n for (let i = dimensions.length - 1; i >= 0; i--) {\r\n reshapedArray = reshapedArray.reduce((acc, val) => {\r\n let lastArray = acc[acc.length - 1];\r\n\r\n if (lastArray.length < dimensions[i]) {\r\n lastArray.push(val);\r\n } else {\r\n acc.push([val]);\r\n }\r\n\r\n return acc;\r\n }, [[]]);\r\n }\r\n\r\n return reshapedArray[0];\r\n}\r\n\r\n/**\r\n * Transposes a tensor according to the provided axes.\r\n * @param {any} tensor - The input tensor to transpose.\r\n * @param {Array} axes - The axes to transpose the tensor along.\r\n * @returns {Tensor} The transposed tensor.\r\n */\r\nfunction transpose(tensor, axes) {\r\n const [transposedData, shape] = transpose_data(tensor.data, tensor.dims, axes);\r\n return new Tensor(tensor.type, transposedData, shape);\r\n}\r\n\r\n\r\n/**\r\n * Concatenates an array of tensors along the 0th dimension.\r\n *\r\n * @param {any} tensors - The array of tensors to concatenate.\r\n * @returns {Tensor} - The concatenated tensor.\r\n */\r\nfunction cat(tensors) {\r\n if (tensors.length === 0) {\r\n return tensors[0];\r\n }\r\n // NOTE: tensors must be batched\r\n // NOTE: currently only supports dim=0\r\n // TODO: add support for dim != 0\r\n\r\n\r\n let tensorType = tensors[0].type;\r\n let tensorShape = [...tensors[0].dims];\r\n tensorShape[0] = tensors.length;\r\n\r\n // Calculate total size to allocate\r\n let total = 0;\r\n for (let t of tensors) {\r\n total += t.data.length;\r\n }\r\n\r\n // Create output tensor of same type as first\r\n let data = new tensors[0].data.constructor(total);\r\n\r\n let offset = 0;\r\n for (let t of tensors) {\r\n data.set(t.data, offset);\r\n offset += t.data.length;\r\n }\r\n\r\n return new Tensor(tensorType, data, tensorShape)\r\n}\r\n\r\n/**\r\n * Interpolates an Tensor to the given size.\r\n * @param {Tensor} input - The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])\r\n * @param {number[]} size - The output size of the image\r\n * @param {string} mode - The interpolation mode\r\n * @param {boolean} align_corners - Whether to align corners.\r\n * @returns {Tensor} - The interpolated tensor.\r\n */\r\nfunction interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) {\r\n\r\n // Input image dimensions\r\n const in_channels = input.dims.at(-3) ?? 1;\r\n const in_height = input.dims.at(-2);\r\n const in_width = input.dims.at(-1);\r\n\r\n let output = interpolate_data(\r\n input.data,\r\n [in_channels, in_height, in_width],\r\n [out_height, out_width],\r\n mode,\r\n align_corners\r\n );\r\n return new Tensor(input.type, output, [in_channels, out_height, out_width]);\r\n}\r\n\r\nmodule.exports = {\r\n Tensor,\r\n transpose,\r\n cat,\r\n interpolate,\r\n transpose_data,\r\n}\r\n","const {\r\n Callable,\r\n fetchJSON,\r\n reverseDictionary,\r\n escapeRegExp,\r\n isIntegralNumber,\r\n min,\r\n} = require('./utils.js');\r\n\r\nconst { Tensor } = require('./tensor_utils.js')\r\n\r\n/**\r\n * Abstract base class for tokenizer models.\r\n *\r\n * @extends Callable\r\n */\r\nclass TokenizerModel extends Callable {\r\n /**\r\n * Creates a new instance of TokenizerModel.\r\n * @param {object} config - The configuration object for the TokenizerModel.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n /**\r\n * Instantiates a new TokenizerModel instance based on the configuration object provided.\r\n * @param {object} config - The configuration object for the TokenizerModel.\r\n * @param {...*} args - Optional arguments to pass to the specific TokenizerModel constructor.\r\n * @returns {TokenizerModel} A new instance of a TokenizerModel.\r\n * @throws Will throw an error if the TokenizerModel type in the config is not recognized.\r\n */\r\n static fromConfig(config, ...args) {\r\n switch (config.type) {\r\n case 'WordPiece':\r\n return new WordPieceTokenizer(config);\r\n case 'Unigram':\r\n // TODO: fix error below\r\n return new Unigram(config, ...args);\r\n\r\n case 'BPE':\r\n // TODO: fix error below\r\n return new BPE(config, ...args);\r\n default:\r\n throw new Error(`Unknown TokenizerModel type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Internal function to call the TokenizerModel instance.\r\n * @param {string[]} tokens - The tokens to encode.\r\n * @returns {number[]} The encoded token IDs.\r\n */\r\n _call(tokens) {\r\n return this.encode(tokens);\r\n }\r\n\r\n /**\r\n * Encodes a list of tokens into a list of token IDs.\r\n * @param {string[]} tokens - The tokens to encode.\r\n * @returns {number[]} The encoded token IDs.\r\n * @throws Will throw an error if not implemented in a subclass.\r\n */\r\n encode(tokens) {\r\n throw Error(\"encode should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Converts a list of tokens into a list of token IDs.\r\n * @param {string[]} tokens - The tokens to convert.\r\n * @returns {number[]} The converted token IDs.\r\n */\r\n convert_tokens_to_ids(tokens) {\r\n return tokens.map(t => this.tokens_to_ids[t] ?? this.unk_token_id);\r\n }\r\n\r\n /**\r\n * Converts a list of token IDs into a list of tokens.\r\n * @param {number[]} ids - The token IDs to convert.\r\n * @returns {string[]} The converted tokens.\r\n */\r\n convert_ids_to_tokens(ids) {\r\n return ids.map(i => this.vocab[i] ?? this.unk_token);\r\n }\r\n}\r\n\r\n/**\r\n * A subclass of TokenizerModel that uses WordPiece encoding to encode tokens.\r\n * @extends TokenizerModel\r\n */\r\nclass WordPieceTokenizer extends TokenizerModel {\r\n /**\r\n * @param {Object} config - The configuration object.\r\n * @param {Object.} config.vocab - A mapping of tokens to ids.\r\n * @param {string} config.unk_token - The unknown token string.\r\n * @param {string} config.continuing_subword_prefix - The prefix to use for continuing subwords.\r\n */\r\n constructor(config) {\r\n super(config);\r\n /**\r\n * A mapping of tokens to ids.\r\n * @type {Object.}\r\n */\r\n this.tokens_to_ids = config.vocab;\r\n\r\n /**\r\n * The id of the unknown token.\r\n * @type {number}\r\n */\r\n this.unk_token_id = this.tokens_to_ids[config.unk_token];\r\n\r\n /**\r\n * The unknown token string.\r\n * @type {string}\r\n */\r\n this.unk_token = config.unk_token;\r\n\r\n let e = Object.entries(this.tokens_to_ids);\r\n\r\n /**\r\n * An array of tokens.\r\n * @type {string[]}\r\n */\r\n this.vocab = Array(e.length);\r\n\r\n for (const [key, value] of e) {\r\n this.vocab[value] = key;\r\n }\r\n }\r\n\r\n /**\r\n * Encodes an array of tokens using WordPiece encoding.\r\n * @param {Array} tokens - The tokens to encode.\r\n * @returns {Array} An array of encoded tokens.\r\n */\r\n encode(tokens) {\r\n let outputTokens = [];\r\n for (let token of tokens) {\r\n let chars = [...token];\r\n // TODO add\r\n // if len(chars) > self.max_input_chars_per_word:\r\n // output_tokens.append(self.unk_token)\r\n // continue\r\n\r\n let isUnknown = false;\r\n let start = 0;\r\n let subTokens = [];\r\n\r\n while (start < chars.length) {\r\n let end = chars.length;\r\n let currentSubstring = null;\r\n while (start < end) {\r\n let substr = chars.slice(start, end).join('');\r\n\r\n if (start > 0) {\r\n substr = this.config.continuing_subword_prefix + substr;\r\n }\r\n if (this.vocab.includes(substr)) {\r\n currentSubstring = substr;\r\n break;\r\n }\r\n\r\n --end;\r\n }\r\n if (currentSubstring == null) {\r\n isUnknown = true;\r\n break;\r\n }\r\n subTokens.push(currentSubstring);\r\n start = end;\r\n }\r\n if (isUnknown) {\r\n outputTokens.push(this.unk_token);\r\n } else {\r\n outputTokens.push(...subTokens);\r\n }\r\n }\r\n\r\n return outputTokens;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Class representing a Unigram tokenizer model.\r\n * @extends TokenizerModel\r\n */\r\nclass Unigram extends TokenizerModel {\r\n /**\r\n * Create a new Unigram tokenizer model.\r\n * @param {object} config - The configuration object for the Unigram model.\r\n * @param {object} moreConfig - Additional configuration object for the Unigram model.\r\n */\r\n constructor(config, moreConfig) {\r\n super(config);\r\n\r\n this.vocab = config.vocab.map(x => x[0]);\r\n this.scores = config.vocab.map(x => x[1]);\r\n\r\n this.unk_token_id = config.unk_id;\r\n this.unk_token = this.vocab[config.unk_id];\r\n\r\n this.tokens_to_ids = Object.fromEntries(this.vocab.map((x, i) => [x, i]));\r\n this.bosToken = ' '; // beginning of a sentence token\r\n\r\n this.bosTokenId = this.tokens_to_ids[this.bosToken];\r\n this.eosToken = moreConfig.eos_token;\r\n\r\n this.eosTokenId = this.tokens_to_ids[this.eosToken];\r\n this.unkToken = this.vocab[this.unk_token_id];\r\n\r\n this.minScore = min(this.scores);\r\n\r\n this.unkScore = this.minScore - 10.0;\r\n this.scores[this.unk_token_id] = this.unkScore;\r\n\r\n this.trie = new CharTrie();\r\n this.trie.extend(this.vocab)\r\n }\r\n\r\n /**\r\n * Populates lattice nodes.\r\n * @param {TokenLattice} lattice - The token lattice to populate with nodes.\r\n */\r\n populateNodes(lattice) {\r\n const sentence = lattice.sentence;\r\n const len = sentence.length;\r\n let beginPos = 0;\r\n while (beginPos < len) {\r\n const mblen = 1;\r\n let hasSingleNode = false;\r\n const tokens = [];\r\n // TODO: fix error below\r\n for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) {\r\n tokens.push(token);\r\n const tokenId = this.tokens_to_ids[token];\r\n const tokenScore = this.scores[tokenId];\r\n const n = token.length;\r\n lattice.insert(beginPos, n, tokenScore, tokenId);\r\n if (!hasSingleNode && n == mblen) {\r\n hasSingleNode = true;\r\n }\r\n }\r\n if (!hasSingleNode) {\r\n lattice.insert(beginPos, mblen, this.unkScore, this.unk_token_id);\r\n }\r\n beginPos += mblen;\r\n }\r\n }\r\n\r\n /**\r\n * Encodes an array of tokens into an array of subtokens using the unigram model.\r\n *\r\n * @param {string} normalized - The normalized string.\r\n * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model.\r\n */\r\n tokenize(normalized) {\r\n const lattice = new TokenLattice(normalized, this.bosTokenId, this.eosTokenId);\r\n this.populateNodes(lattice);\r\n return lattice.tokens();\r\n }\r\n\r\n /**\r\n * Encodes an array of tokens using WordPiece encoding.\r\n * @param {Array} tokens - The tokens to encode.\r\n * @returns {Array} An array of encoded tokens.\r\n */\r\n encode(tokens) {\r\n let toReturn = [];\r\n for (let token of tokens) {\r\n const tokenized = this.tokenize(token);\r\n toReturn.push(...tokenized);\r\n }\r\n return toReturn;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Returns list of utf-8 byte and a mapping to unicode strings.\r\n * Specifically avoids mapping to whitespace/control characters the BPE code barfs on.\r\n * @returns {Object} Object with utf-8 byte keys and unicode string values.\r\n */\r\nconst BYTES_TO_UNICODE = (() => {\r\n // Returns list of utf-8 byte and a mapping to unicode strings.\r\n // We specifically avoids mapping to whitespace/control characters\r\n // the bpe code barfs on.\r\n\r\n const bs = [\r\n ...Array.from({ length: \"~\".charCodeAt(0) - \"!\".charCodeAt(0) + 1 }, (_, i) => i + \"!\".charCodeAt(0)),\r\n ...Array.from({ length: \"¬\".charCodeAt(0) - \"¡\".charCodeAt(0) + 1 }, (_, i) => i + \"¡\".charCodeAt(0)),\r\n ...Array.from({ length: \"ÿ\".charCodeAt(0) - \"®\".charCodeAt(0) + 1 }, (_, i) => i + \"®\".charCodeAt(0)),\r\n ];\r\n let cs = bs.slice();\r\n let n = 0;\r\n for (let b = 0; b < 256; b++) {\r\n if (!bs.includes(b)) {\r\n bs.push(b);\r\n cs.push(256 + n);\r\n n += 1;\r\n }\r\n }\r\n let ccs = cs.map(n => String.fromCharCode(n));\r\n return Object.fromEntries(bs.map((b, i) => [b, ccs[i]]));\r\n})();\r\n\r\nconst UNICODE_TO_BYTES = reverseDictionary(BYTES_TO_UNICODE);\r\n\r\n/**\r\n * BPE class for encoding text into Byte-Pair-Encoding (BPE) tokens.\r\n * @extends TokenizerModel\r\n */\r\nclass BPE extends TokenizerModel {\r\n /**\r\n * Create a BPE instance.\r\n * @param {Object} config - The configuration object for BPE.\r\n * @param {Object} config.vocab - A dictionary containing the vocabulary with tokens as keys and their corresponding indices as values.\r\n * @param {string} config.unk_token - The unknown token used for out of vocabulary words.\r\n * @param {Array} config.merges - An array of BPE merges as strings.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.tokens_to_ids = config.vocab;\r\n\r\n this.unk_token_id = this.tokens_to_ids[config.unk_token];\r\n this.unk_token = config.unk_token;\r\n\r\n let e = Object.entries(this.tokens_to_ids);\r\n this.vocab = Array(e.length);\r\n\r\n for (const [key, value] of e) {\r\n this.vocab[value] = key;\r\n }\r\n\r\n this.bpe_ranks = Object.fromEntries(config.merges.map((x, i) => [x, i]));\r\n this.merges = config.merges.map(x => x.split(/\\s+/))\r\n\r\n this.end_of_word_suffix = config.end_of_word_suffix;\r\n\r\n this.byte_encoder = BYTES_TO_UNICODE;\r\n this.text_encoder = new TextEncoder();\r\n\r\n this.cache = {}\r\n }\r\n\r\n /**\r\n * Get all the possible pairs of characters in a word.\r\n * @param {string[]} word - The word to get pairs from.\r\n * @returns {Array} - An array of pairs.\r\n */\r\n get_pairs(word) {\r\n let pairs = new Set();\r\n let prev_char = word[0];\r\n for (let i = 1; i < word.length; i++) {\r\n let char = word[i];\r\n pairs.add(`${prev_char} ${char}`);\r\n prev_char = char;\r\n }\r\n // TODO: fix error below\r\n return [...pairs];\r\n }\r\n\r\n /**\r\n * Apply Byte-Pair-Encoding (BPE) to a given token.\r\n * @param {string} token - The token to encode.\r\n * @returns {string} - The BPE encoded token.\r\n */\r\n bpe(token) {\r\n if (token in this.cache) {\r\n return this.cache[token];\r\n }\r\n let word = Array.from(token);\r\n if (this.end_of_word_suffix) {\r\n word[word.length - 1] += this.end_of_word_suffix;\r\n }\r\n let pairs = this.get_pairs(word);\r\n\r\n if (!pairs.length) {\r\n if (this.end_of_word_suffix) {\r\n token += this.end_of_word_suffix;\r\n }\r\n return token;\r\n }\r\n\r\n while (true) {\r\n let bigram = pairs.reduce((a, b) => {\r\n let c = this.bpe_ranks[a] ?? Infinity\r\n let d = this.bpe_ranks[b] ?? Infinity\r\n return c <= d ? a : b;\r\n });\r\n if (!(bigram in this.bpe_ranks)) {\r\n break;\r\n }\r\n let [first, second] = bigram.split(/\\s+/g)\r\n let new_word = [];\r\n let i = 0;\r\n let j = -1;\r\n\r\n while (i < word.length) {\r\n try {\r\n j = word.indexOf(first, i);\r\n if (j === -1) throw \"Error\";\r\n } catch (e) {\r\n new_word.push(...word.slice(i));\r\n break;\r\n }\r\n new_word.push(...word.slice(i, j));\r\n i = j;\r\n\r\n if (word[i] === first && i < word.length - 1 && word[i + 1] === second) {\r\n new_word.push(first + second);\r\n i += 2;\r\n } else {\r\n new_word.push(word[i]);\r\n i += 1;\r\n }\r\n }\r\n word = new_word\r\n if (word.length === 1) {\r\n break;\r\n } else {\r\n pairs = this.get_pairs(word);\r\n }\r\n }\r\n let final_word = word.join(\" \");\r\n this.cache[token] = final_word;\r\n return final_word;\r\n }\r\n\r\n /**\r\n * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens.\r\n * @param {Array} tokens - The input sequence of tokens to encode.\r\n * @returns {Array} - The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens.\r\n */\r\n encode(tokens) {\r\n let outputTokens = [];\r\n\r\n for (let token of tokens) {\r\n token = Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join('');\r\n let bpe_token_list = this.bpe(token).split(' ');\r\n outputTokens.push(...bpe_token_list);\r\n }\r\n\r\n return outputTokens;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * A base class for text normalization.\r\n * @abstract\r\n */\r\nclass Normalizer extends Callable {\r\n /**\r\n * @param {object} config - The configuration object for the normalizer.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Factory method for creating normalizers from config objects.\r\n * @static\r\n * @param {object} config - The configuration object for the normalizer.\r\n * @returns {Normalizer} - A Normalizer object.\r\n * @throws {Error} - If an unknown Normalizer type is specified in the config.\r\n */\r\n static fromConfig(config) {\r\n if (config === null) return null;\r\n switch (config.type) {\r\n case 'BertNormalizer':\r\n return new BertNormalizer(config);\r\n case 'Precompiled':\r\n return new Precompiled(config);\r\n case 'Sequence':\r\n return new NormalizerSequence(config);\r\n case 'Replace':\r\n return new Replace(config);\r\n case 'NFC':\r\n return new NFC(config);\r\n case 'NFKD':\r\n return new NFKD(config);\r\n case 'StripAccents':\r\n return new StripAccents(config);\r\n case 'Lowercase':\r\n return new Lowercase(config);\r\n default:\r\n throw new Error(`Unknown Normalizer type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Normalize the input text.\r\n * @abstract\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n * @throws {Error} - If this method is not implemented in a subclass.\r\n */\r\n normalize(text) {\r\n throw Error(\"normalize should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Alias for {@link Normalizer#normalize}.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n */\r\n _call(text) {\r\n return this.normalize(text);\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Replace normalizer that replaces occurrences of a pattern with a given string or regular expression.\r\n * @extends Normalizer\r\n */\r\nclass Replace extends Normalizer {\r\n /**\r\n * Normalize the input text by replacing the pattern with the content.\r\n * @param {string} text - The input text to be normalized.\r\n * @returns {string} The normalized text after replacing the pattern with the content.\r\n */\r\n normalize(text) {\r\n if (this.config.pattern.Regex) {\r\n text = text.replace(new RegExp(this.config.pattern.Regex, 'g'), this.config.content)\r\n\r\n } else if (this.config.pattern.String) {\r\n text = text.replace(this.config.pattern.String, this.config.content)\r\n\r\n } else {\r\n console.warn('Unknown pattern type:', this.config.pattern)\r\n }\r\n\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A normalizer that applies Unicode normalization form C (NFC) to the input text.\r\n * @extends Normalizer\r\n */\r\nclass NFC extends Normalizer {\r\n /**\r\n * Normalize the input text by applying Unicode normalization form C (NFC).\r\n * @param {string} text - The input text to be normalized.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n text = text.normalize('NFC')\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * NFKD Normalizer.\r\n * @extends Normalizer\r\n */\r\nclass NFKD extends Normalizer {\r\n /**\r\n * Normalize text using NFKD normalization.\r\n * @param {string} text - The text to be normalized.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n text = text.normalize('NFKD')\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * StripAccents normalizer removes all accents from the text.\r\n * @extends Normalizer\r\n */\r\nclass StripAccents extends Normalizer {\r\n /**\r\n * Remove all accents from the text.\r\n * @param {string} text - The input text.\r\n * @returns {string} The normalized text without accents.\r\n */\r\n normalize(text) {\r\n text = text.replace(/[\\u0300-\\u036f]/g, '');\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A Normalizer that lowercases the input string.\r\n * @extends Normalizer\r\n */\r\nclass Lowercase extends Normalizer {\r\n /**\r\n * Lowercases the input string.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n text = text.toLowerCase();\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A Normalizer that applies a sequence of Normalizers.\r\n * @extends Normalizer\r\n */\r\nclass NormalizerSequence extends Normalizer {\r\n /**\r\n * Create a new instance of NormalizerSequence.\r\n * @param {object} config - The configuration object.\r\n * @param {object[]} config.normalizers - An array of Normalizer configuration objects.\r\n */\r\n constructor(config) {\r\n super(config);\r\n this.normalizers = config.normalizers.map(x => Normalizer.fromConfig(x));\r\n }\r\n /**\r\n * Apply a sequence of Normalizers to the input text.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n // TODO use reduce?\r\n for (let normalizer of this.normalizers) {\r\n text = normalizer.normalize(text);\r\n }\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A class representing a normalizer used in BERT tokenization.\r\n * @extends Normalizer\r\n */\r\nclass BertNormalizer extends Normalizer {\r\n /**\r\n * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text.\r\n *\r\n * @param {string} text - The input text to tokenize.\r\n * @returns {string} - The tokenized text with whitespace added around CJK characters.\r\n */\r\n _tokenize_chinese_chars(text) {\r\n /* Adds whitespace around any CJK character. */\r\n let output = [];\r\n for (let i = 0; i < text.length; ++i) {\r\n let char = text[i];\r\n let cp = char.charCodeAt(0);\r\n if (this._is_chinese_char(cp)) {\r\n output.push(\" \");\r\n output.push(char);\r\n output.push(\" \");\r\n } else {\r\n output.push(char);\r\n }\r\n }\r\n return output.join(\"\");\r\n }\r\n\r\n /**\r\n * Checks whether the given Unicode codepoint represents a CJK (Chinese, Japanese, or Korean) character.\r\n *\r\n * A \"chinese character\" is defined as anything in the CJK Unicode block:\r\n * https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)\r\n *\r\n * Note that the CJK Unicode block is NOT all Japanese and Korean characters, despite its name.\r\n * The modern Korean Hangul alphabet is a different block, as is Japanese Hiragana and Katakana.\r\n * Those alphabets are used to write space-separated words, so they are not treated specially\r\n * and are handled like all other languages.\r\n *\r\n * @param {number} cp - The Unicode codepoint to check.\r\n * @returns {boolean} - True if the codepoint represents a CJK character, false otherwise.\r\n */\r\n _is_chinese_char(cp) {\r\n return (\r\n (cp >= 0x4E00 && cp <= 0x9FFF)\r\n || (cp >= 0x3400 && cp <= 0x4DBF)\r\n || (cp >= 0x20000 && cp <= 0x2A6DF)\r\n || (cp >= 0x2A700 && cp <= 0x2B73F)\r\n || (cp >= 0x2B740 && cp <= 0x2B81F)\r\n || (cp >= 0x2B820 && cp <= 0x2CEAF)\r\n || (cp >= 0xF900 && cp <= 0xFAFF)\r\n || (cp >= 0x2F800 && cp <= 0x2FA1F)\r\n )\r\n }\r\n /**\r\n * Strips accents from the given text.\r\n * @param {string} text - The text to strip accents from.\r\n * @returns {string} - The text with accents removed.\r\n */\r\n stripAccents(text) {\r\n return text.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\r\n }\r\n\r\n /**\r\n * Normalizes the given text based on the configuration.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n */\r\n normalize(text) {\r\n // TODO use rest of config\r\n // config.clean_text,\r\n // config.handle_chinese_chars,\r\n // config.strip_accents,\r\n // config.lowercase,\r\n\r\n if (this.config.handle_chinese_chars) {\r\n text = this._tokenize_chinese_chars(text);\r\n }\r\n\r\n if (this.config.lowercase) {\r\n text = text.toLowerCase();\r\n\r\n if (this.config.strip_accents !== false) {\r\n text = this.stripAccents(text);\r\n }\r\n } else if (this.config.strip_accents) {\r\n text = this.stripAccents(text);\r\n }\r\n\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A callable class representing a pre-tokenizer used in tokenization. Subclasses\r\n * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic.\r\n * @extends Callable\r\n */\r\nclass PreTokenizer extends Callable {\r\n /**\r\n * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration.\r\n *\r\n * @static\r\n * @param {Object} config - A configuration object for the pre-tokenizer.\r\n * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`.\r\n * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer.\r\n */\r\n static fromConfig(config) {\r\n switch (config.type) {\r\n case 'BertPreTokenizer':\r\n return new BertPreTokenizer(config);\r\n case 'Sequence':\r\n return new PreTokenizerSequence(config);\r\n case 'WhitespaceSplit':\r\n return new WhitespaceSplit(config);\r\n case 'Metaspace':\r\n return new MetaspacePreTokenizer(config);\r\n\r\n case 'ByteLevel':\r\n return new ByteLevelPreTokenizer(config);\r\n case 'Split':\r\n return new SplitPreTokenizer(config);\r\n\r\n default:\r\n throw new Error(`Unknown PreTokenizer type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Method that should be implemented by subclasses to define the specific pre-tokenization logic.\r\n *\r\n * @abstract\r\n * @param {string} text - The text to pre-tokenize.\r\n * @returns {string[]} The pre-tokenized text.\r\n * @throws {Error} If the method is not implemented in the subclass.\r\n */\r\n pre_tokenize_text(text) {\r\n throw Error(\"pre_tokenize_text should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Tokenizes the given text into pre-tokens.\r\n * @param {string|string[]} text - The text or array of texts to pre-tokenize.\r\n * @returns {string[]} An array of pre-tokens.\r\n */\r\n pre_tokenize(text) {\r\n let result = [];\r\n if (Array.isArray(text)) {\r\n result = text.map(x => this.pre_tokenize_text(x))\r\n } else {\r\n result = this.pre_tokenize_text(text);\r\n }\r\n return result.flat();\r\n }\r\n\r\n /**\r\n * Alias for {@link PreTokenizer#pre_tokenize}.\r\n * @param {string|string[]} text - The text or array of texts to pre-tokenize.\r\n * @returns {string[]} An array of pre-tokens.\r\n */\r\n _call(text) {\r\n return this.pre_tokenize(text);\r\n }\r\n}\r\n\r\n/**\r\n * @extends PreTokenizer\r\n */\r\nclass BertPreTokenizer extends PreTokenizer {\r\n /**\r\n * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme\r\n * similar to that used in the original implementation of BERT.\r\n * \r\n * @param {object} config - The configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n // TODO use config\r\n this.pattern = /\\b\\p{L}+\\b|[^\\s\\p{L}]+/gu\r\n }\r\n /**\r\n * Tokenizes a single text using the BERT pre-tokenization scheme.\r\n * \r\n * @param {string} text - The text to tokenize.\r\n * @returns {Array.} - An array of tokens.\r\n */\r\n pre_tokenize_text(text) {\r\n // Split on whitespace and punctuation\r\n return text.trim().match(this.pattern) || [];\r\n }\r\n}\r\n\r\n/**\r\n * A pre-tokenizer that splits text into Byte-Pair-Encoding (BPE) subwords.\r\n * @extends PreTokenizer\r\n */\r\nclass ByteLevelPreTokenizer extends PreTokenizer {\r\n /**\r\n * Creates a new instance of the `ByteLevelPreTokenizer` class.\r\n * @param {Object} config - The configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n // TODO use config\r\n this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+/gu;\r\n }\r\n\r\n /**\r\n * Tokenizes a single piece of text using byte-level tokenization.\r\n * @param {string} text - The text to tokenize.\r\n * @returns {string[]} - An array of tokens.\r\n */\r\n pre_tokenize_text(text) {\r\n // Split on whitespace and punctuation\r\n return text.match(this.pattern) || [];\r\n }\r\n}\r\n\r\n/**\r\n * Splits text using a given pattern.\r\n * @extends PreTokenizer\r\n */\r\nclass SplitPreTokenizer extends PreTokenizer {\r\n /**\r\n * @param {Object} config - The configuration options for the pre-tokenizer.\r\n * @param {Object} config.pattern - The pattern used to split the text. Can be a string or a regex object.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Tokenizes text by splitting it using the given pattern.\r\n * @param {string} text - The text to tokenize.\r\n * @returns {string[]} An array of tokens.\r\n */\r\n pre_tokenize_text(text) {\r\n if (this.config.pattern.Regex) {\r\n return text.match(new RegExp(this.config.pattern.Regex, 'gu')) || [];\r\n\r\n } else if (this.config.pattern.String) {\r\n return text.match(this.config.pattern.String) || [];\r\n\r\n } else {\r\n console.warn('Unknown pattern type:', this.config.pattern)\r\n }\r\n\r\n return [];\r\n }\r\n\r\n}\r\n\r\n/**\r\n * @extends Callable\r\n */\r\nclass PostProcessor extends Callable {\r\n\r\n /**\r\n * Factory method to create a PostProcessor object from a configuration object.\r\n *\r\n * @param {Object} config - Configuration object representing a PostProcessor.\r\n * @returns {PostProcessor} A PostProcessor object created from the given configuration.\r\n * @throws {Error} If an unknown PostProcessor type is encountered.\r\n */\r\n static fromConfig(config) {\r\n switch (config.type) {\r\n case 'TemplateProcessing':\r\n return new TemplateProcessing(config);\r\n\r\n case 'ByteLevel':\r\n return new ByteLevelPostProcessor(config);\r\n\r\n case 'RobertaProcessing':\r\n return new RobertaProcessing(config);\r\n\r\n default:\r\n throw new Error(`Unknown PostProcessor type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Method to be implemented in subclass to apply post-processing on the given tokens.\r\n *\r\n * @param {Array} tokens - The input tokens to be post-processed.\r\n * @param {...*} args - Additional arguments required by the post-processing logic.\r\n * @returns {Array} The post-processed tokens.\r\n * @throws {Error} If the method is not implemented in subclass.\r\n */\r\n post_process(tokens, ...args) {\r\n throw Error(\"post_process should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Alias for {@link PostProcessor#post_process}.\r\n * @param {Array} tokens - The text or array of texts to post-process.\r\n * @param {...*} args - Additional arguments required by the post-processing logic.\r\n * @returns {Array} An array of post-processed tokens.\r\n */\r\n _call(tokens, ...args) {\r\n return this.post_process(tokens, ...args);\r\n }\r\n}\r\n\r\n/**\r\n * A post-processor that adds special tokens to the beginning and end of the input.\r\n * @extends PostProcessor\r\n */\r\nclass RobertaProcessing extends PostProcessor {\r\n /**\r\n * @param {Object} config - The configuration for the post-processor.\r\n * @param {string[]} config.cls - The special tokens to add to the beginning of the input.\r\n * @param {string[]} config.sep - The special tokens to add to the end of the input.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n\r\n // TODO use all of config:\r\n // add_prefix_space, cls, sep, trim_offsets\r\n\r\n }\r\n\r\n /**\r\n * Adds the special tokens to the beginning and end of the input.\r\n * @param {string[]} tokens - The input tokens.\r\n * @param {string[]|null} tokens_pair - An optional second set of input tokens.\r\n * @returns {string[]} The input tokens with the special tokens added to the beginning and end.\r\n */\r\n post_process(tokens, tokens_pair = null) {\r\n tokens = [this.config.cls[0], ...tokens, this.config.sep[0]]\r\n\r\n // NOTE: It is intended to add 2 EOS tokens after the first set of tokens\r\n // https://github.com/huggingface/tokenizers/issues/983\r\n if (tokens_pair !== null) {\r\n tokens = [...tokens, this.config.sep[0], ...tokens_pair, this.config.sep[0]]\r\n }\r\n return tokens;\r\n }\r\n}\r\n\r\n/**\r\n * Post processor that replaces special tokens in a template with actual tokens.\r\n * @extends PostProcessor\r\n */\r\nclass TemplateProcessing extends PostProcessor {\r\n /**\r\n * Creates a new instance of `TemplateProcessing`.\r\n * @param {Object} config - The configuration options for the post processor.\r\n * @param {Array} config.single - The template for a single sequence of tokens.\r\n * @param {Array} config.pair - The template for a pair of sequences of tokens.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Replaces special tokens in the template with actual tokens.\r\n * @param {Array} tokens - The list of tokens for the first sequence.\r\n * @param {Array} [tokens_pair=null] - The list of tokens for the second sequence (optional).\r\n * @returns {Array} - The list of tokens with the special tokens replaced with actual tokens.\r\n */\r\n post_process(tokens, tokens_pair = null) {\r\n let type = tokens_pair === null ? this.config.single : this.config.pair\r\n\r\n let toReturn = [];\r\n for (let item of type) {\r\n if ('SpecialToken' in item) {\r\n toReturn.push(item.SpecialToken.id);\r\n\r\n } else if ('Sequence' in item) {\r\n if (item.Sequence.id === 'A') {\r\n toReturn.push(...tokens);\r\n\r\n } else if (item.Sequence.id === 'B') {\r\n toReturn.push(...tokens_pair);\r\n }\r\n }\r\n }\r\n return toReturn;\r\n }\r\n}\r\n\r\n/**\r\n * A PostProcessor that returns the given tokens as is.\r\n * @extends PostProcessor\r\n */\r\nclass ByteLevelPostProcessor extends PostProcessor {\r\n /**\r\n * Create a new instance of ByteLevelPostProcessor.\r\n * @param {object} config - Configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Post process the given tokens.\r\n * @param {string[]} tokens - The tokens to be post processed.\r\n * @returns {string[]} The post processed tokens.\r\n */\r\n post_process(tokens) {\r\n return tokens;\r\n }\r\n}\r\n\r\n/**\r\n * The base class for token decoders.\r\n * @extends Callable\r\n */\r\nclass Decoder extends Callable {\r\n\r\n /**\r\n * Creates an instance of `Decoder`.\r\n *\r\n * @param {Object} config - The configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Creates a decoder instance based on the provided configuration.\r\n *\r\n * @param {Object} config - The configuration object.\r\n * @returns {Decoder} A decoder instance.\r\n * @throws {Error} If an unknown decoder type is provided.\r\n */\r\n static fromConfig(config) {\r\n switch (config.type) {\r\n case 'WordPiece':\r\n return new WordPieceDecoder(config);\r\n case 'Metaspace':\r\n return new MetaspaceDecoder(config);\r\n case 'ByteLevel':\r\n return new ByteLevelDecoder(config);\r\n default:\r\n throw new Error(`Unknown Decoder type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Converts a list of tokens to a string.\r\n *\r\n * @param {string[]} tokens - The list of tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n convert_tokens_to_string(tokens) {\r\n return tokens.join('').trim();\r\n }\r\n\r\n /**\r\n * Calls the `decode` method.\r\n *\r\n * @param {string[]} tokens - The list of tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n _call(tokens) {\r\n return this.decode(tokens);\r\n }\r\n\r\n /**\r\n * Decodes a list of tokens.\r\n * @param {string[]} tokens - The list of tokens.\r\n * @returns {string} The decoded string.\r\n * @throws {Error} If the `decode` method is not implemented in the subclass.\r\n */\r\n decode(tokens) {\r\n throw Error(\"decode should be implemented in subclass.\")\r\n }\r\n\r\n\r\n}\r\n\r\n/**\r\n * A decoder that decodes a list of WordPiece tokens into a single string.\r\n * @extends Decoder\r\n */\r\nclass WordPieceDecoder extends Decoder {\r\n\r\n /**\r\n * Creates a new instance of WordPieceDecoder.\r\n * @param {Object} config - The configuration object.\r\n * @param {string} config.prefix - The prefix used for WordPiece encoding.\r\n * @param {boolean} config.cleanup - Whether to cleanup the decoded string.\r\n */\r\n constructor(config) {\r\n super(config);\r\n this.convertRegex = new RegExp(` ${config.prefix}`, 'g');\r\n this.cleanup = config.cleanup;\r\n }\r\n\r\n /**\r\n * Converts a list of WordPiece tokens to a single string.\r\n * @param {Array} tokens - The list of WordPiece tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n convert_tokens_to_string(tokens) {\r\n return tokens.join(' ').replace(this.convertRegex, '').trim();\r\n }\r\n\r\n /**\r\n * Decodes a list of WordPiece tokens into a single string.\r\n * @param {Array} tokens - The list of WordPiece tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n decode(tokens) {\r\n return this.convert_tokens_to_string(tokens);\r\n }\r\n}\r\n\r\n/**\r\n * Byte-level decoder for tokenization output. Inherits from the `Decoder` class.\r\n * @extends Decoder\r\n */\r\nclass ByteLevelDecoder extends Decoder {\r\n\r\n /**\r\n * Create a `ByteLevelDecoder` object.\r\n * @param {object} config - Configuration object.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.byte_decoder = UNICODE_TO_BYTES;\r\n this.text_decoder = new TextDecoder(\"utf-8\", {\r\n fatal: false,\r\n ignoreBOM: true,\r\n });\r\n\r\n this.end_of_word_suffix = null;\r\n }\r\n\r\n /**\r\n * Convert an array of tokens to string by decoding each byte.\r\n * @param {string[]} tokens - Array of tokens to be decoded.\r\n * @returns {string} - The decoded string.\r\n */\r\n convert_tokens_to_string(tokens) {\r\n let text = tokens.join('');\r\n\r\n if (this.config.trim_offsets) {\r\n text = text.trim();\r\n } else if (this.config.add_prefix_space) {\r\n text = ' ' + text;\r\n }\r\n\r\n // @ts-ignore\r\n let byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c]));\r\n let decoded_text = this.text_decoder.decode(byteArray);\r\n\r\n if (this.end_of_word_suffix) {\r\n decoded_text = decoded_text.replaceAll(this.end_of_word_suffix, ' ').trim();\r\n }\r\n return decoded_text;\r\n }\r\n\r\n /**\r\n * Decode an array of tokens to string.\r\n * @param {string[]} tokens - Array of tokens to be decoded.\r\n * @returns {string} - The decoded string.\r\n */\r\n decode(tokens) {\r\n // TODO move to base class (like HF)\r\n // tokens === filtered_tokens\r\n\r\n // To avoid mixing byte-level and unicode for byte-level BPT\r\n // we need to build string separately for added tokens and byte-level tokens\r\n // cf. https://github.com/huggingface/transformers/issues/1133\r\n let sub_texts = [];\r\n let current_sub_text = [];\r\n for (let token of tokens) {\r\n // tokens sent here are already filtered, so we don't need to do this\r\n // if (skip_special_tokens && this.all_special_ids.includes(token)) {\r\n // continue;\r\n // }\r\n\r\n if (this.added_tokens.includes(token)) {\r\n if (current_sub_text.length > 0) {\r\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\r\n current_sub_text = [];\r\n }\r\n sub_texts.push(token);\r\n } else {\r\n current_sub_text.push(token);\r\n }\r\n }\r\n if (current_sub_text.length > 0) {\r\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\r\n }\r\n\r\n // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options\r\n let text = sub_texts.join('');\r\n\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested,\r\n * and returns a list of tokens.\r\n * @extends PreTokenizer\r\n */\r\nclass MetaspacePreTokenizer extends PreTokenizer {\r\n /**\r\n * @param {Object} config - The configuration object for the MetaspacePreTokenizer.\r\n * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the first token.\r\n * @param {string} config.replacement - The character to replace spaces with.\r\n * @param {string} [config.str_rep=config.replacement] - An optional string representation of the replacement character.\r\n */\r\n constructor(config) {\r\n super();\r\n\r\n this.addPrefixSpace = config.add_prefix_space;\r\n this.replacement = config.replacement;\r\n this.strRep = config.str_rep || this.replacement;\r\n }\r\n\r\n /**\r\n * This method takes a list of normalized tokens, replaces spaces with the replacement character,\r\n * adds a prefix space if requested, and returns a new list of tokens.\r\n * @param {string[]|string} normalizedTokens - The list of normalized tokens to pre-tokenize.\r\n * @returns {string[]} A new list of pre-tokenized tokens.\r\n */\r\n pre_tokenize(normalizedTokens) {\r\n if (typeof normalizedTokens === 'string' || normalizedTokens instanceof String) {\r\n // Metaspace acts on a list of tokens. If passing in a string, first split on whitespace\r\n normalizedTokens = normalizedTokens.split(/\\s+/);\r\n }\r\n\r\n const result = [];\r\n for (let token of normalizedTokens) {\r\n let normalized = token.replace(' ', this.strRep);\r\n if (this.addPrefixSpace && !normalized.startsWith(this.replacement)) {\r\n normalized = this.strRep + normalized;\r\n }\r\n result.push(normalized);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * MetaspaceDecoder class extends the Decoder class and decodes Metaspace tokenization.\r\n * @extends Decoder\r\n */\r\nclass MetaspaceDecoder extends Decoder {\r\n /**\r\n * Constructs a new MetaspaceDecoder object.\r\n * @param {Object} config - The configuration object for the MetaspaceDecoder.\r\n * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the decoded string.\r\n * @param {string} config.replacement - The string to replace spaces with.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.addPrefixSpace = config.add_prefix_space;\r\n this.replacement = config.replacement;\r\n }\r\n\r\n /**\r\n * Decodes the given tokens back into a string.\r\n * @param {Array} tokens - The tokens to decode.\r\n * @returns {string} - The decoded string.\r\n */\r\n decode(tokens) {\r\n let result = [];\r\n let i = 0;\r\n for (let token of tokens) {\r\n let normalized = token.replace(this.replacement, ' ');\r\n if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) {\r\n normalized = normalized.substring(1);\r\n }\r\n result.push(normalized);\r\n ++i;\r\n }\r\n\r\n return this.convert_tokens_to_string(result);\r\n }\r\n}\r\n\r\n/**\r\n * A normalizer that applies a precompiled charsmap.\r\n * This is useful for applying complex normalizations in C++ and exposing them to JavaScript.\r\n * @extends Normalizer\r\n * @param {Object} config - The configuration object for the Precompiled normalizer.\r\n * @param {Object} config.precompiled_charsmap - The precompiled charsmap object.\r\n */\r\nclass Precompiled extends Normalizer {\r\n /**\r\n * Create a new instance of Precompiled normalizer.\r\n * @param {object} config - The configuration object.\r\n * @param {any} config.precompiled_charsmap - Precompiled chars mapping.\r\n */\r\n constructor(config) {\r\n super(config);\r\n this.charsmap = config.precompiled_charsmap;\r\n }\r\n\r\n /**\r\n * Normalizes the given text by applying the precompiled charsmap.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n */\r\n normalize(text) {\r\n // TODO use this.charsmap\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A pre-tokenizer that applies a sequence of pre-tokenizers to the input text.\r\n * @extends PreTokenizer\r\n */\r\nclass PreTokenizerSequence extends PreTokenizer {\r\n /**\r\n * Creates an instance of PreTokenizerSequence.\r\n * @param {object} config - The configuration object for the pre-tokenizer sequence.\r\n * @param {object[]} config.pretokenizers - An array of pre-tokenizer configurations.\r\n */\r\n constructor(config) {\r\n super();\r\n this.tokenizers = config.pretokenizers.map(x => PreTokenizer.fromConfig(x));\r\n }\r\n\r\n /**\r\n * Applies each pre-tokenizer in the sequence to the input text in turn.\r\n * @param {string|string[]} text - The text(s) to pre-tokenize.\r\n * @returns {string[]} The pre-tokenized text.\r\n */\r\n pre_tokenize_text(text) {\r\n if (typeof text === 'string') {\r\n text = [text];\r\n }\r\n // Use reduce to apply each tokenizer to the text\r\n return this.tokenizers.reduce((preTokenizedText, tokenizer) => {\r\n return tokenizer.pre_tokenize(preTokenizedText);\r\n }, text);\r\n }\r\n}\r\n\r\n/**\r\n * Splits a string of text by whitespace characters into individual tokens.\r\n * @extends PreTokenizer\r\n */\r\nclass WhitespaceSplit extends PreTokenizer {\r\n /**\r\n * Creates an instance of WhitespaceSplit.\r\n * @param {object} config - The configuration object for the pre-tokenizer sequence.\r\n */\r\n constructor(config) {\r\n super();\r\n }\r\n /**\r\n * Pre-tokenizes the input text by splitting it on whitespace characters.\r\n * @param {string} text - The text to be pre-tokenized.\r\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\r\n */\r\n pre_tokenize_text(text) {\r\n return text.split(/\\s+/);\r\n }\r\n}\r\n\r\nclass PreTrainedTokenizer extends Callable {\r\n /**\r\n * Create a new PreTrainedTokenizer instance.\r\n * @param {Object} tokenizerJSON - The JSON of the tokenizer.\r\n * @param {Object} tokenizerConfig - The config of the tokenizer.\r\n */\r\n constructor(tokenizerJSON, tokenizerConfig) {\r\n super();\r\n\r\n this.tokenizerJSON = tokenizerJSON;\r\n this.tokenizerConfig = tokenizerConfig;\r\n\r\n this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer);\r\n this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer);\r\n this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig);\r\n this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor);\r\n\r\n // TODO - maybe, allow this to be null; in which case, we use model as decoder too?\r\n this.decoder = Decoder.fromConfig(tokenizerJSON.decoder);\r\n\r\n // Slight hack, but it prevents code duplication:\r\n // Add added_tokens to this.decoder\r\n this.decoder.added_tokens = [];\r\n\r\n // Another slight hack to add `end_of_word_suffix` (if present) to the decoder\r\n // This is needed for cases where BPE model and ByteLevel decoder are used\r\n // For more information, see https://github.com/xenova/transformers.js/issues/74\r\n // TODO - save this to the decoder when exporting?\r\n this.decoder.end_of_word_suffix = this.model.end_of_word_suffix;\r\n\r\n // Add added_tokens to model\r\n this.special_tokens = [];\r\n this.all_special_ids = [];\r\n for (let addedToken of tokenizerJSON.added_tokens) {\r\n let id = addedToken.id;\r\n let content = addedToken.content;\r\n this.decoder.added_tokens.push(content);\r\n\r\n this.model.tokens_to_ids[content] = id;\r\n this.model.vocab[id] = content;\r\n\r\n if (addedToken.special) {\r\n this.special_tokens.push(content);\r\n this.all_special_ids.push(id);\r\n }\r\n }\r\n this.special_tokens_regex = new RegExp(\r\n '(' + this.special_tokens.map(escapeRegExp).join('|') + ')'\r\n );\r\n\r\n\r\n // Set mask token if present (otherwise will be undefined, which is fine)\r\n this.mask_token = this.getToken('mask_token');\r\n this.mask_token_id = this.model.tokens_to_ids[this.mask_token];\r\n\r\n this.pad_token = this.getToken('pad_token', 'eos_token');\r\n this.pad_token_id = this.model.tokens_to_ids[this.pad_token];\r\n\r\n this.sep_token = this.getToken('sep_token');\r\n this.sep_token_id = this.model.tokens_to_ids[this.sep_token];\r\n\r\n this.model_max_length = this.tokenizerConfig.model_max_length;\r\n\r\n this.remove_space = this.tokenizerConfig.remove_space;\r\n\r\n // TODO allow user to change this\r\n this.padding_side = 'right';\r\n }\r\n\r\n /**\r\n * Returns the value of the first matching key in the tokenizer config object.\r\n * @param {...string} keys - One or more keys to search for in the tokenizer config object.\r\n * @returns {string|null} - The value associated with the first matching key, or null if no match is found.\r\n * @throws {Error} - If an object is found for a matching key and its __type property is not \"AddedToken\".\r\n */\r\n getToken(...keys) {\r\n for (let key of keys) {\r\n let item = this.tokenizerConfig[key];\r\n\r\n if (!item) continue;\r\n\r\n if (typeof item === 'object') {\r\n if (item.__type === 'AddedToken') {\r\n return item.content;\r\n } else {\r\n throw Error(`Unknown token: ${item}`);\r\n }\r\n } else {\r\n return item;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates a new Tokenizer instance with the tokenizer configuration and files\r\n * downloaded from a pretrained model located at the given model path.\r\n *\r\n * @param {string} modelPath - The path to the pretrained model.\r\n * @param {function} [progressCallback=null] - Optional callback function that will be called with the current\r\n * progress percentage (0 to 100) each time a file is downloaded.\r\n * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the modelPath.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n // TODO get files in parallel\r\n\r\n let [tokenizerJSON, tokenizerConfig] = await Promise.all([\r\n fetchJSON(modelPath, 'tokenizer.json', progressCallback),\r\n fetchJSON(modelPath, 'tokenizer_config.json', progressCallback),\r\n ])\r\n\r\n return new this(tokenizerJSON, tokenizerConfig);\r\n }\r\n\r\n /**\r\n * This function can be overridden by a subclass to apply additional preprocessing\r\n * to a model's input data.\r\n * @param {Object} inputs - An object containing input data as properties.\r\n * @returns {Object} The modified inputs object.\r\n */\r\n prepare_model_inputs(inputs) {\r\n return inputs;\r\n }\r\n\r\n /**\r\n * Encode/tokenize the given text(s).\r\n * @param {string|string[]} text - The text to tokenize.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @param {string|string[]} [options.text_pair=null] - Optional second sequence to be encoded. If set, must be the same type as text.\r\n * @param {boolean} [options.padding=false] - Whether to pad the input sequences.\r\n * @param {boolean} [options.truncation=null] - Whether to truncate the input sequences.\r\n * @param {number} [options.max_length=null] - Maximum length of the returned list and optionally padding length.\r\n * @param {boolean} [options.return_tensor=true] - Whether to return the results as Tensors or arrays.\r\n * @returns {{ input_ids: number[]|number[][]|Tensor; attention_mask: any[]|Tensor; }} Object to be passed to the model.\r\n */\r\n _call(\r\n // Required positional arguments\r\n text,\r\n\r\n // Optional keyword arguments\r\n {\r\n text_pair = null,\r\n // add_special_tokens = true, // TODO\r\n padding = false,\r\n truncation = null,\r\n max_length = null,\r\n return_tensor = true, // Different to HF\r\n } = {},\r\n ) {\r\n /** @type {number[]|number[][]|Tensor} */\r\n let tokens;\r\n\r\n if (Array.isArray(text)) {\r\n if (text.length === 0) {\r\n throw Error('text array must be non-empty')\r\n }\r\n\r\n if (text_pair !== null) {\r\n if (!Array.isArray(text_pair)) {\r\n throw Error('text_pair must also be an array')\r\n\r\n } else if (text.length !== text_pair.length) {\r\n throw Error('text and text_pair must have the same length')\r\n }\r\n\r\n tokens = text.map(\r\n (text, i) => this.encode(text, text_pair[i])\r\n )\r\n\r\n } else {\r\n tokens = text.map(x => this.encode(x));\r\n }\r\n\r\n } else {\r\n if (text === null) {\r\n throw Error('text may not be null')\r\n }\r\n\r\n if (Array.isArray(text_pair)) {\r\n throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).')\r\n }\r\n tokens = [this.encode(text, text_pair)];\r\n }\r\n // At this point, tokens is batched: [batch_size, tokens]\r\n // However, array may be jagged. So, we pad to max_length\r\n\r\n let maxLengthOfBatch = Math.max(...tokens.map(x => x.length));\r\n\r\n // If null, we calculate max length from sequences\r\n if (max_length === null) {\r\n max_length = maxLengthOfBatch;\r\n }\r\n\r\n // Ensure it is less than model max length\r\n max_length = Math.min(max_length, this.model_max_length)\r\n\r\n /** @type {any[]|Tensor} */\r\n let attention_mask = [];\r\n if (padding || truncation) {\r\n // Perform padding and/or truncation\r\n for (let i = 0; i < tokens.length; ++i) {\r\n if (tokens[i].length === max_length) {\r\n attention_mask.push(new Array(tokens[i].length).fill(1))\r\n continue;\r\n\r\n } else if (tokens[i].length > max_length) {\r\n // possibly truncate\r\n if (truncation) {\r\n tokens[i] = tokens[i].slice(0, max_length);\r\n }\r\n attention_mask.push(new Array(tokens[i].length).fill(1))\r\n\r\n } else { // t.length < max_length\r\n if (padding) {\r\n let diff = max_length - tokens[i].length;\r\n\r\n if (this.padding_side === 'right') {\r\n attention_mask.push(\r\n (new Array(tokens[i].length).fill(1)).concat(new Array(diff).fill(0))\r\n )\r\n tokens[i].push(...new Array(diff).fill(this.pad_token_id))\r\n } else { // left\r\n attention_mask.push(\r\n (new Array(diff).fill(0)).concat(new Array(tokens[i].length).fill(1))\r\n )\r\n tokens[i].unshift(...new Array(diff).fill(this.pad_token_id))\r\n }\r\n\r\n } else {\r\n attention_mask.push(new Array(tokens[i].length).fill(1))\r\n }\r\n }\r\n }\r\n } else {\r\n attention_mask = tokens.map(x => new Array(x.length).fill(1))\r\n }\r\n\r\n if (return_tensor) {\r\n if (!(padding && truncation)) {\r\n // Not, guaranteed that all items have same length, so\r\n // we perform additional check\r\n\r\n if (tokens.some(x => x.length !== tokens[0].length)) {\r\n throw Error(\r\n \"Unable to create tensor, you should probably activate truncation and/or padding \" +\r\n \"with 'padding=true' and 'truncation=true' to have batched tensors with the same length.\"\r\n )\r\n }\r\n }\r\n\r\n // Now we actually convert to tensor\r\n let dims = [tokens.length, tokens[0].length];\r\n\r\n tokens = new Tensor('int64',\r\n BigInt64Array.from(tokens.flat().map(BigInt)),\r\n dims\r\n );\r\n\r\n attention_mask = new Tensor(\r\n 'int64',\r\n BigInt64Array.from(attention_mask.flat().map(BigInt)),\r\n dims\r\n )\r\n }\r\n\r\n\r\n // Finally, add attention mask, and possibly model-specific parameters\r\n let modelInputs = {\r\n input_ids: tokens,\r\n attention_mask: attention_mask\r\n }\r\n\r\n // Optional post-processing\r\n modelInputs = this.prepare_model_inputs(modelInputs);\r\n\r\n return modelInputs\r\n }\r\n\r\n /**\r\n * Encodes a single text using the preprocessor pipeline of the tokenizer.\r\n *\r\n * @param {string|null} text - The text to encode.\r\n * @returns {Array} The encoded tokens.\r\n */\r\n _encode_text(text) {\r\n if (text === null) return null;\r\n\r\n // Actual function which does encoding, for a single text\r\n // First, we take care of special tokens. Needed to avoid issues arising from\r\n // normalization and/or pretokenization (which may not preserve special tokens)\r\n const sections = text.split(this.special_tokens_regex).filter(x => x);\r\n\r\n let tokens = sections.map(x => {\r\n if (this.special_tokens.includes(x)) {\r\n // Ignore special tokens\r\n return x\r\n } else {\r\n if (this.remove_space === true) {\r\n // remove_space\r\n x = x.trim().split(/\\s+/).join(' ')\r\n }\r\n // Actually perform encoding\r\n if (this.normalizer !== null) {\r\n x = this.normalizer(x);\r\n }\r\n let sectionTokens = this.pre_tokenizer(x);\r\n return this.model(sectionTokens);\r\n }\r\n }).flat();\r\n\r\n return tokens;\r\n }\r\n\r\n /**\r\n * Encodes a single text or a pair of texts using the model's tokenizer.\r\n *\r\n * @param {string} text - The text to encode.\r\n * @param {string|null} text_pair - The optional second text to encode.\r\n * @returns {number[]} An array of token IDs representing the encoded text(s).\r\n */\r\n encode(text, text_pair = null) {\r\n // Function called by users to encode possibly multiple texts\r\n let tokens = this._encode_text(text);\r\n let tokens2 = this._encode_text(text_pair);\r\n\r\n let combinedTokens = this.post_processor(tokens, tokens2);\r\n let ids = this.model.convert_tokens_to_ids(combinedTokens);\r\n\r\n return ids\r\n }\r\n\r\n /**\r\n * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms\r\n * @param {string} text - The text to clean up.\r\n * @returns {string} - The cleaned up text.\r\n */\r\n clean_up_tokenization(text) {\r\n // Clean up a list of simple English tokenization artifacts\r\n // like spaces before punctuations and abbreviated forms\r\n return text.replace(/ \\./g, '.')\r\n .replace(/ \\?/g, '?')\r\n .replace(/ \\!/g, '!')\r\n .replace(/ ,/g, ',')\r\n .replace(/ \\' /g, \"'\")\r\n .replace(/ n\\'t/g, \"n't\")\r\n .replace(/ \\'m/g, \"'m\")\r\n .replace(/ \\'s/g, \"'s\")\r\n .replace(/ \\'ve/g, \"'ve\")\r\n .replace(/ \\'re/g, \"'re\");\r\n }\r\n\r\n /**\r\n * Decode a batch of tokenized sequences.\r\n * @param {number[][]} batch - List of tokenized input sequences.\r\n * @param {Object} decode_args - (Optional) Object with decoding arguments.\r\n * @returns {string[]} List of decoded sequences.\r\n */\r\n batch_decode(batch, decode_args = {}) {\r\n return batch.map(x => this.decode(x, decode_args));\r\n }\r\n\r\n /**\r\n * Decodes a sequence of token IDs back to a string.\r\n *\r\n * @param {number[]} token_ids - List of token IDs to decode.\r\n * @param {Object} [decode_args={}]\r\n * @param {boolean} [decode_args.skip_special_tokens=false] - If true, special tokens are removed from the output string.\r\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - If true, spaces before punctuations and abbreviated forms are removed.\r\n *\r\n * @returns {string} The decoded string.\r\n * @throws {Error} If `token_ids` is not a non-empty array of integers.\r\n */\r\n decode(\r\n token_ids,\r\n decode_args = {},\r\n ) {\r\n if (!Array.isArray(token_ids) || token_ids.length === 0 || !isIntegralNumber(token_ids[0])) {\r\n throw Error(\"token_ids must be a non-empty array of integers.\");\r\n }\r\n\r\n return this.decode_single(\r\n token_ids, decode_args\r\n )\r\n }\r\n\r\n /**\r\n * Decode a single list of token ids to a string.\r\n * @param {number[]} token_ids - List of token ids to decode\r\n * @param {object} decode_args - Optional arguments for decoding\r\n * @param {boolean} [decode_args.skip_special_tokens=false] - Whether to skip special tokens during decoding\r\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - Whether to clean up tokenization spaces during decoding\r\n * @returns {string} - The decoded string\r\n */\r\n decode_single(\r\n token_ids,\r\n {\r\n skip_special_tokens = false,\r\n clean_up_tokenization_spaces = true,\r\n }\r\n ) {\r\n let tokens = this.model.convert_ids_to_tokens(token_ids);\r\n if (skip_special_tokens) {\r\n tokens = tokens.filter(x => !this.special_tokens.includes(x));\r\n }\r\n\r\n let decoded = this.decoder(tokens); // tokens === filtered_tokens\r\n\r\n if ('cleanup' in this.decoder && this.decoder.cleanup !== clean_up_tokenization_spaces) {\r\n console.warn(`clean_up_tokenization_spaces disagrees with decoder's cleanup setting. Overriding to use decoder's cleanup setting (${this.decoder.cleanup})`)\r\n // @ts-ignore\r\n clean_up_tokenization_spaces = this.decoder.cleanup;\r\n }\r\n\r\n if (clean_up_tokenization_spaces) {\r\n decoded = this.clean_up_tokenization(decoded);\r\n }\r\n\r\n return decoded;\r\n }\r\n\r\n}\r\n\r\n/**\r\n* Prepare model inputs for a BERT model.\r\n* @param {Object} inputs - An object containing the input ids and attention mask.\r\n* @returns {Object} The prepared inputs object.\r\n*/\r\nfunction bert_prepare_model_inputs(inputs) {\r\n // Helper method for preparing token_type_ids for bert models\r\n inputs.token_type_ids = new Tensor(\r\n 'int64',\r\n new BigInt64Array(inputs.input_ids.data.length),\r\n inputs.input_ids.dims\r\n )\r\n return inputs;\r\n}\r\n\r\n/**\r\n * BertTokenizer is a class used to tokenize text for BERT models.\r\n * @extends PreTrainedTokenizer\r\n */\r\nclass BertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\n/**\r\n * Albert tokenizer\r\n * @extends PreTrainedTokenizer\r\n */\r\nclass AlbertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\nclass MobileBertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\nclass SqueezeBertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\nclass DistilBertTokenizer extends PreTrainedTokenizer { }\r\nclass T5Tokenizer extends PreTrainedTokenizer { }\r\nclass GPT2Tokenizer extends PreTrainedTokenizer { }\r\nclass BartTokenizer extends PreTrainedTokenizer { }\r\nclass RobertaTokenizer extends PreTrainedTokenizer { }\r\n\r\n\r\n/**\r\n * WhisperTokenizer tokenizer\r\n * @extends PreTrainedTokenizer\r\n */\r\nclass WhisperTokenizer extends PreTrainedTokenizer {\r\n static LANGUAGES = {\r\n \"en\": \"english\",\r\n \"zh\": \"chinese\",\r\n \"de\": \"german\",\r\n \"es\": \"spanish\",\r\n \"ru\": \"russian\",\r\n \"ko\": \"korean\",\r\n \"fr\": \"french\",\r\n \"ja\": \"japanese\",\r\n \"pt\": \"portuguese\",\r\n \"tr\": \"turkish\",\r\n \"pl\": \"polish\",\r\n \"ca\": \"catalan\",\r\n \"nl\": \"dutch\",\r\n \"ar\": \"arabic\",\r\n \"sv\": \"swedish\",\r\n \"it\": \"italian\",\r\n \"id\": \"indonesian\",\r\n \"hi\": \"hindi\",\r\n \"fi\": \"finnish\",\r\n \"vi\": \"vietnamese\",\r\n \"he\": \"hebrew\",\r\n \"uk\": \"ukrainian\",\r\n \"el\": \"greek\",\r\n \"ms\": \"malay\",\r\n \"cs\": \"czech\",\r\n \"ro\": \"romanian\",\r\n \"da\": \"danish\",\r\n \"hu\": \"hungarian\",\r\n \"ta\": \"tamil\",\r\n \"no\": \"norwegian\",\r\n \"th\": \"thai\",\r\n \"ur\": \"urdu\",\r\n \"hr\": \"croatian\",\r\n \"bg\": \"bulgarian\",\r\n \"lt\": \"lithuanian\",\r\n \"la\": \"latin\",\r\n \"mi\": \"maori\",\r\n \"ml\": \"malayalam\",\r\n \"cy\": \"welsh\",\r\n \"sk\": \"slovak\",\r\n \"te\": \"telugu\",\r\n \"fa\": \"persian\",\r\n \"lv\": \"latvian\",\r\n \"bn\": \"bengali\",\r\n \"sr\": \"serbian\",\r\n \"az\": \"azerbaijani\",\r\n \"sl\": \"slovenian\",\r\n \"kn\": \"kannada\",\r\n \"et\": \"estonian\",\r\n \"mk\": \"macedonian\",\r\n \"br\": \"breton\",\r\n \"eu\": \"basque\",\r\n \"is\": \"icelandic\",\r\n \"hy\": \"armenian\",\r\n \"ne\": \"nepali\",\r\n \"mn\": \"mongolian\",\r\n \"bs\": \"bosnian\",\r\n \"kk\": \"kazakh\",\r\n \"sq\": \"albanian\",\r\n \"sw\": \"swahili\",\r\n \"gl\": \"galician\",\r\n \"mr\": \"marathi\",\r\n \"pa\": \"punjabi\",\r\n \"si\": \"sinhala\",\r\n \"km\": \"khmer\",\r\n \"sn\": \"shona\",\r\n \"yo\": \"yoruba\",\r\n \"so\": \"somali\",\r\n \"af\": \"afrikaans\",\r\n \"oc\": \"occitan\",\r\n \"ka\": \"georgian\",\r\n \"be\": \"belarusian\",\r\n \"tg\": \"tajik\",\r\n \"sd\": \"sindhi\",\r\n \"gu\": \"gujarati\",\r\n \"am\": \"amharic\",\r\n \"yi\": \"yiddish\",\r\n \"lo\": \"lao\",\r\n \"uz\": \"uzbek\",\r\n \"fo\": \"faroese\",\r\n \"ht\": \"haitian creole\",\r\n \"ps\": \"pashto\",\r\n \"tk\": \"turkmen\",\r\n \"nn\": \"nynorsk\",\r\n \"mt\": \"maltese\",\r\n \"sa\": \"sanskrit\",\r\n \"lb\": \"luxembourgish\",\r\n \"my\": \"myanmar\",\r\n \"bo\": \"tibetan\",\r\n \"tl\": \"tagalog\",\r\n \"mg\": \"malagasy\",\r\n \"as\": \"assamese\",\r\n \"tt\": \"tatar\",\r\n \"haw\": \"hawaiian\",\r\n \"ln\": \"lingala\",\r\n \"ha\": \"hausa\",\r\n \"ba\": \"bashkir\",\r\n \"jw\": \"javanese\",\r\n \"su\": \"sundanese\",\r\n }\r\n\r\n /**\r\n * Decodes automatic speech recognition (ASR) sequences.\r\n * @param {Array.<{tokens: Array., stride: [number, number, number]}>} sequences The sequences to decode.\r\n * @param {Object} options - The options to use for decoding.\r\n * @returns {[string, {chunks?:Array.<{language: string|null, timestamp: [number|null, number|null], text: string}>}]} The decoded sequences.\r\n */\r\n _decode_asr(sequences, {\r\n return_timestamps = false,\r\n return_language = false,\r\n time_precision = null,\r\n force_full_sequences = true\r\n } = {}) {\r\n // Set force_full_sequences=false if you want streaming\r\n // TODO add support for `return_language`\r\n\r\n // Internal method meant to only be used by asr pipeline.\r\n // Handles all the little quirks specific to whisper to handle\r\n // the various options not allowed in other seq2seq models\r\n\r\n // =========== Overview ============\r\n // - iterate over all outputs\r\n // - all tokens within output\r\n // - Each token can be\r\n // - language token\r\n // - special token\r\n // - timestamp token\r\n // - text token\r\n // - We accumulate the text tokens.\r\n // - We split on end timestamps\r\n // - Lots of complexity comes from stride and timestamps\r\n\r\n if (time_precision === null) {\r\n throw Error(\"Must specify time_precision\")\r\n }\r\n let last_language = null;\r\n\r\n function new_chunk() {\r\n return { \"language\": last_language, \"timestamp\": [null, null], \"text\": \"\" };\r\n }\r\n\r\n // Welcome to the state machine!\r\n const chunks = [];\r\n let chunk = new_chunk();\r\n let time_offset = 0.0;\r\n const timestamp_begin = this.model.convert_tokens_to_ids([\"<|notimestamps|>\"])[0] + 1;\r\n\r\n let previous_tokens = [];\r\n let skip = false;\r\n let right_stride_start = null;\r\n\r\n\r\n const all_special_ids = new Set(this.all_special_ids);\r\n\r\n for (let output of sequences) {\r\n // NOTE: python version has batches, so it uses [0]\r\n const token_ids = output.tokens;\r\n\r\n // These keep track of timestamps within strides, which need\r\n // to be skipped and resolve all tokens in a single chunk.\r\n let last_timestamp = null;\r\n let first_timestamp = timestamp_begin;\r\n\r\n if (\"stride\" in output) {\r\n const [chunk_len, stride_left, stride_right] = output.stride;\r\n\r\n // Offset the timings to account for the other `model_outputs`.\r\n time_offset -= stride_left;\r\n right_stride_start = chunk_len - stride_right;\r\n\r\n // Keeping track of timestamps within strides\r\n // We're going to NOT split on those, and delay until we're\r\n // out of BOTH stride. Otherwise lots of issues occur and\r\n // corner cases\r\n if (stride_left) {\r\n first_timestamp = stride_left / time_precision + timestamp_begin;\r\n }\r\n\r\n if (stride_right) {\r\n for (let i = token_ids.length - 1; i >= 0; --i) {\r\n const token = token_ids[i];\r\n if (token >= timestamp_begin) {\r\n // There can be several token in the right stride\r\n // But the last one is ALWAYS going to be skipped\r\n if (last_timestamp !== null && (token - timestamp_begin) * time_precision < right_stride_start) {\r\n break;\r\n }\r\n last_timestamp = token;\r\n }\r\n }\r\n }\r\n }\r\n\r\n let current_tokens = [];\r\n\r\n // - all tokens within output\r\n for (const token of token_ids) {\r\n // 4 possible states for each token\r\n // - 1/ Language code\r\n // - 2/ all other special tokens (which we ignore)\r\n // - 3/ Timestamp\r\n // - 4/ Regular text\r\n\r\n if (all_special_ids.has(token)) {\r\n const text = this.decode([token]);\r\n if (text[0] === \"[\" && text[text.length - 1] === \"]\") {\r\n const language = WhisperTokenizer.LANGUAGES[text.slice(1, -1)];\r\n\r\n if (language !== undefined) {\r\n // 1/ Indeed some language\r\n // TODO Handle when language is different from the previous\r\n // one, and we cannot use timestamped tokens to create chunks\r\n if (last_language !== null && language !== last_language && !return_timestamps) {\r\n previous_tokens.push(current_tokens);\r\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens);\r\n const resolved_text = this.decode(resolved_tokens);\r\n chunk.text = resolved_text;\r\n chunks.push(chunk);\r\n\r\n // Flush all our temporary context\r\n previous_tokens = [];\r\n current_tokens = [];\r\n chunk = new_chunk();\r\n }\r\n\r\n last_language = chunk.language = language;\r\n } else {\r\n // 2/ This is a regular special token, ignoring it\r\n }\r\n }\r\n } else if (token >= timestamp_begin) {\r\n // 3/ Timestamp token\r\n const time = (token - timestamp_begin) * time_precision + time_offset;\r\n const rounded_time = Math.round(time * 100) / 100;\r\n\r\n if (last_timestamp !== null && token >= last_timestamp) {\r\n // Whisper outputted a timestamp token, but it falls within\r\n // our stride, so we're going to skip it for the time being\r\n // and resolve this later\r\n // Skip is necessary because timestamp tokens always come\r\n // by pair, so we need to skip the next one too (which would mark the start of another chunk).\r\n skip = true;\r\n } else if (skip || (previous_tokens.length > 0 && token < first_timestamp)) {\r\n skip = false;\r\n } else if (chunk.timestamp[0] === null) {\r\n chunk.timestamp[0] = rounded_time;\r\n } else {\r\n // This is the end of the timestamp chunk\r\n if (rounded_time === chunk.timestamp[0]) {\r\n // This is a bug in timestamp token output\r\n // where we're taking the duplicate token\r\n // as a stop where it should be a start.\r\n // This is an issue in the underlying model output\r\n // Let's just skip it so it becomes\r\n } else {\r\n chunk.timestamp[1] = time;\r\n\r\n // Handling merges\r\n previous_tokens.push(current_tokens)\r\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens)\r\n const resolved_text = this.decode(resolved_tokens)\r\n chunk.text = resolved_text\r\n chunks.push(chunk)\r\n\r\n // Flush all our temporary context\r\n previous_tokens = []\r\n current_tokens = []\r\n chunk = new_chunk()\r\n }\r\n }\r\n\r\n } else {\r\n // 4/ Regular token\r\n // We just append to the list of all tokens so we can handle\r\n // merges later and decode into text.\r\n current_tokens.push(token)\r\n\r\n }\r\n }\r\n\r\n if ('stride' in output) {\r\n const [chunk_len, stride_left, stride_right] = output.stride;\r\n time_offset += chunk_len - stride_right\r\n }\r\n\r\n // Leftover tokens\r\n if (current_tokens.length > 0) {\r\n previous_tokens.push(current_tokens)\r\n } else if (previous_tokens.every(p => p.length === 0)) {\r\n // Flushing previous tokens (END)\"\r\n chunk = new_chunk()\r\n previous_tokens = []\r\n current_tokens = []\r\n }\r\n\r\n }\r\n\r\n if (previous_tokens.length > 0) {\r\n if (force_full_sequences && return_timestamps) {\r\n // Last token should always be timestamps, so there shouldn't be\r\n // leftover\r\n throw new Error(\"There was an error while processing timestamps, we haven't found a timestamp as last token.\");\r\n }\r\n\r\n // Happens when we don't use timestamps\r\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens);\r\n\r\n // Flushing previous tokens (FINAL)\r\n const resolved_text = this.decode(resolved_tokens);\r\n chunk.text = resolved_text;\r\n chunks.push(chunk);\r\n }\r\n\r\n let optional = {};\r\n\r\n // Preparing and cleaning up the pipeline output\r\n const full_text = chunks.map(chunk => chunk.text).join('');\r\n if (return_timestamps || return_language) {\r\n for (let i = 0; i < chunks.length; i++) {\r\n const chunk = chunks[i];\r\n if (!return_timestamps) {\r\n delete chunk[\"timestamp\"];\r\n }\r\n\r\n if (!return_language) {\r\n delete chunk[\"language\"];\r\n }\r\n }\r\n optional = { \"chunks\": chunks };\r\n }\r\n return [full_text, optional];\r\n\r\n }\r\n\r\n /**\r\n * Finds the longest common sequence among the provided sequences.\r\n * @param {number[][]} sequences - An array of sequences of token ids to compare.\r\n * @returns {number[]} - The longest common sequence found.\r\n * @throws {Error} - If there is a bug within the function.\r\n */\r\n findLongestCommonSequence(sequences) {\r\n // It would be much harder to do O(n) because of fault tolerance.\r\n // We actually have a really good property which is that the total sequence\r\n // MUST be those subsequences in order.\r\n let leftSequence = sequences[0];\r\n let leftLength = leftSequence.length;\r\n let totalSequence = [];\r\n for (let i = 1; i < sequences.length; i++) {\r\n const rightSequence = sequences[i];\r\n let max = 0.0;\r\n let maxIndices = [leftLength, leftLength, 0, 0];\r\n // Here we're sliding matches\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n // = [c] == [d]\r\n\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n // = [c, d] == [c, d]\r\n\r\n\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n\r\n // = [b, c, d] == [c, d, f]\r\n\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n\r\n // [a, b, c] == [c, d, f]\r\n\r\n // [a, b, c, d]\r\n // [d, f]\r\n\r\n // [a, b] == [d, f]\r\n\r\n // [a, b, c, d]\r\n // [f]\r\n\r\n // [a] == [f]\r\n\r\n const rightLength = rightSequence.length;\r\n for (let j = 1; j < leftLength + rightLength; j++) {\r\n const eps = j / 10000.0;\r\n const leftStart = Math.max(0, leftLength - j);\r\n const leftStop = Math.min(leftLength, leftLength + rightLength - j);\r\n const left = leftSequence.slice(leftStart, leftStop);\r\n const rightStart = Math.max(0, j - leftLength);\r\n const rightStop = Math.min(rightLength, j);\r\n const right = rightSequence.slice(rightStart, rightStop);\r\n if (left.length !== right.length) {\r\n throw new Error(\"There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.\");\r\n }\r\n const matches = left.filter((elem, idx) => elem === right[idx]).length;\r\n const matching = matches / j + eps;\r\n if (matches > 1 && matching > max) {\r\n max = matching;\r\n maxIndices = [leftStart, leftStop, rightStart, rightStop];\r\n }\r\n }\r\n const [leftStart, leftStop, rightStart, rightStop] = maxIndices;\r\n const leftMid = Math.floor((leftStop + leftStart) / 2);\r\n const rightMid = Math.floor((rightStop + rightStart) / 2);\r\n totalSequence.push(...leftSequence.slice(0, leftMid));\r\n leftSequence = rightSequence.slice(rightMid);\r\n leftLength = leftSequence.length;\r\n }\r\n totalSequence.push(...leftSequence);\r\n return totalSequence;\r\n }\r\n}\r\nclass CodeGenTokenizer extends PreTrainedTokenizer { }\r\nclass CLIPTokenizer extends PreTrainedTokenizer { }\r\nclass MarianTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * Create a new MarianTokenizer instance.\r\n * @param {Object} tokenizerJSON - The JSON of the tokenizer.\r\n * @param {Object} tokenizerConfig - The config of the tokenizer.\r\n */\r\n constructor(tokenizerJSON, tokenizerConfig) {\r\n super(tokenizerJSON, tokenizerConfig);\r\n\r\n this.languageRegex = /^(>>\\w+<<)\\s*/g;\r\n\r\n this.supported_language_codes = this.model.vocab.filter(\r\n x => this.languageRegex.test(x)\r\n );\r\n }\r\n\r\n /**\r\n * Encodes a single text. Overriding this method is necessary since the language codes\r\n * must be removed before encoding with sentencepiece model.\r\n * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213\r\n *\r\n * @param {string|null} text - The text to encode.\r\n * @returns {Array} The encoded tokens.\r\n */\r\n _encode_text(text) {\r\n if (text === null) return null;\r\n\r\n // Check if text starts with language code:\r\n let [matchInfo, ...remainder] = text.trim().split(this.languageRegex);\r\n\r\n if (remainder.length === 0) {\r\n // No language code, encode normally\r\n return super._encode_text(matchInfo);\r\n\r\n } else if (remainder.length === 2) {\r\n // Text starts with language code, so we do not encode it with sentencepiece.\r\n let [language, text] = remainder;\r\n\r\n if (!this.supported_language_codes.includes(language)) {\r\n console.warn(`Unsupported language code \"${language}\" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`)\r\n }\r\n return [language, ...super._encode_text(text)]\r\n }\r\n }\r\n\r\n}\r\n\r\n/**\r\n * A trie structure to efficiently store and search for strings.\r\n */\r\nclass CharTrie {\r\n constructor() {\r\n this.root = CharTrieNode.default();\r\n }\r\n\r\n /**\r\n * Adds one or more `texts` to the trie.\r\n * @param {string[]} texts - The strings to add to the trie.\r\n */\r\n extend(texts) {\r\n for (let text of texts) {\r\n this.push(text);\r\n }\r\n }\r\n\r\n /**\r\n * Adds one or more `texts` to the trie.\r\n * @param {*} text - The strings to add to the trie.\r\n */\r\n push(text) {\r\n let node = this.root;\r\n for (let ch of text) {\r\n let child = node.children.get(ch);\r\n if (child === undefined) {\r\n child = CharTrieNode.default();\r\n node.children.set(ch, child);\r\n }\r\n node = child;\r\n }\r\n node.isLeaf = true;\r\n }\r\n\r\n /**\r\n * Searches the trie for all strings with a common prefix of `text`.\r\n * @param {string} text - The common prefix to search for.\r\n * @yields {string} - Each string in the trie that has `text` as a prefix.\r\n */\r\n *commonPrefixSearch(text) {\r\n let node = this.root;\r\n let prefix = \"\";\r\n for (let i = 0; i < text.length && node !== undefined; i++) {\r\n const ch = text[i];\r\n prefix += ch;\r\n node = node.children.get(ch);\r\n if (node !== undefined && node.isLeaf) {\r\n yield prefix;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Represents a node in a character trie.\r\n * @param {boolean} isLeaf - Whether the node is a leaf node or not.\r\n * @param {Map} children - A map containing the node's children, where the key is a character and the value is a `CharTrieNode`.\r\n */\r\nclass CharTrieNode {\r\n constructor(isLeaf, children) {\r\n this.isLeaf = isLeaf;\r\n this.children = children;\r\n }\r\n\r\n /**\r\n * Returns a new `CharTrieNode` instance with default values.\r\n * @returns {CharTrieNode} A new `CharTrieNode` instance with `isLeaf` set to `false` and an empty `children` map.\r\n */\r\n static default() {\r\n return new CharTrieNode(false, new Map());\r\n }\r\n}\r\n\r\nclass TokenLattice {\r\n /**\r\n * Creates a new TokenLattice instance.\r\n *\r\n * @param {string} sentence - The input sentence to be tokenized.\r\n * @param {number} bosTokenId - The beginning-of-sequence token ID.\r\n * @param {number} eosTokenId - The end-of-sequence token ID.\r\n */\r\n constructor(sentence, bosTokenId, eosTokenId) {\r\n this.sentence = sentence;\r\n this.len = sentence.length;\r\n this.bosTokenId = bosTokenId;\r\n this.eosTokenId = eosTokenId;\r\n this.nodes = [];\r\n this.beginNodes = new Array(this.len + 1);\r\n this.endNodes = new Array(this.len + 1);\r\n for (let i = 0; i < this.len + 1; i++) {\r\n this.beginNodes[i] = [];\r\n this.endNodes[i] = [];\r\n }\r\n const bos = new TokenLatticeNode(this.bosTokenId, 0, 0, 0, 0.0);\r\n const eos = new TokenLatticeNode(this.eosTokenId, 1, this.len, 0, 0.0);\r\n this.nodes.push(bos.clone());\r\n this.nodes.push(eos.clone());\r\n this.beginNodes[this.len].push(eos);\r\n this.endNodes[0].push(bos);\r\n }\r\n\r\n /**\r\n * Inserts a new token node into the token lattice.\r\n *\r\n * @param {number} pos - The starting position of the token.\r\n * @param {number} length - The length of the token.\r\n * @param {number} score - The score of the token.\r\n * @param {number} tokenId - The token ID of the token.\r\n */\r\n insert(pos, length, score, tokenId) {\r\n const nodeId = this.nodes.length;\r\n const node = new TokenLatticeNode(tokenId, nodeId, pos, length, score);\r\n this.beginNodes[pos].push(node);\r\n this.endNodes[pos + length].push(node);\r\n this.nodes.push(node);\r\n }\r\n\r\n /**\r\n * Implements the Viterbi algorithm to compute the most likely sequence of tokens.\r\n *\r\n * @returns {TokenLatticeNode[]} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n viterbi() {\r\n const len = this.len;\r\n let pos = 0;\r\n while (pos <= len) {\r\n if (this.beginNodes[pos].length == 0) {\r\n return [];\r\n }\r\n for (let rnode of this.beginNodes[pos]) {\r\n rnode.prev = null;\r\n let bestScore = 0.0;\r\n let bestNode = null;\r\n for (let lnode of this.endNodes[pos]) {\r\n const score = lnode.backtraceScore + rnode.score;\r\n if (bestNode === null || score > bestScore) {\r\n bestNode = lnode.clone();\r\n bestScore = score;\r\n }\r\n }\r\n if (bestNode !== null) {\r\n rnode.prev = bestNode;\r\n rnode.backtraceScore = bestScore;\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n pos++;\r\n }\r\n const results = [];\r\n const root = this.beginNodes[len][0];\r\n const prev = root.prev;\r\n if (prev === null) {\r\n return [];\r\n }\r\n let node = prev.clone();\r\n while (node.prev !== null) {\r\n results.push(node.clone());\r\n const n = node.clone();\r\n node = n.prev.clone();\r\n }\r\n results.reverse();\r\n return results;\r\n }\r\n\r\n /**\r\n * @param {any} node\r\n * @returns {string} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n piece(node) {\r\n return this.sentence.slice(node.pos, node.pos + node.length);\r\n }\r\n\r\n /**\r\n * @returns {Array} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n tokens() {\r\n const nodes = this.viterbi();\r\n return nodes.map(x => this.piece(x));\r\n }\r\n\r\n /**\r\n * @returns {Array} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n tokenIds() {\r\n const nodes = this.viterbi();\r\n return nodes.map(x => x.tokenId);\r\n }\r\n}\r\nclass TokenLatticeNode {\r\n /**\r\n * Represents a node in a token lattice for a given sentence.\r\n * @param {number} tokenId - The ID of the token associated with this node.\r\n * @param {number} nodeId - The ID of this node.\r\n * @param {number} pos - The starting position of the token in the sentence.\r\n * @param {number} length - The length of the token.\r\n * @param {number} score - The score associated with the token.\r\n */\r\n constructor(tokenId, nodeId, pos, length, score) {\r\n this.tokenId = tokenId;\r\n this.nodeId = nodeId;\r\n this.pos = pos;\r\n this.length = length;\r\n this.score = score;\r\n this.prev = null;\r\n this.backtraceScore = 0.0;\r\n }\r\n\r\n /**\r\n * Returns a clone of this node.\r\n * @returns {TokenLatticeNode} - A clone of this node.\r\n */\r\n clone() {\r\n const n = new TokenLatticeNode(this.tokenId, this.nodeId, this.pos, this.length, this.score);\r\n n.prev = this.prev;\r\n n.backtraceScore = this.backtraceScore;\r\n return n;\r\n }\r\n}\r\n\r\nclass AutoTokenizer {\r\n // Helper class to determine tokenizer type from tokenizer.json\r\n static TOKENIZER_CLASS_MAPPING = {\r\n 'T5Tokenizer': T5Tokenizer,\r\n 'DistilBertTokenizer': DistilBertTokenizer,\r\n 'BertTokenizer': BertTokenizer,\r\n 'MobileBertTokenizer': MobileBertTokenizer,\r\n 'SqueezeBertTokenizer': SqueezeBertTokenizer,\r\n 'AlbertTokenizer': AlbertTokenizer,\r\n 'GPT2Tokenizer': GPT2Tokenizer,\r\n 'BartTokenizer': BartTokenizer,\r\n 'RobertaTokenizer': RobertaTokenizer,\r\n 'WhisperTokenizer': WhisperTokenizer,\r\n 'CodeGenTokenizer': CodeGenTokenizer,\r\n 'CLIPTokenizer': CLIPTokenizer,\r\n 'MarianTokenizer': MarianTokenizer,\r\n }\r\n\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [tokenizerJSON, tokenizerConfig] = await Promise.all([\r\n fetchJSON(modelPath, 'tokenizer.json', progressCallback),\r\n fetchJSON(modelPath, 'tokenizer_config.json', progressCallback),\r\n ])\r\n\r\n let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerConfig.tokenizer_class];\r\n if (!cls) {\r\n console.warn(`Unknown tokenizer class \"${tokenizerConfig.tokenizer_class}\", attempting to construct from base class.`);\r\n cls = PreTrainedTokenizer;\r\n }\r\n return new cls(tokenizerJSON, tokenizerConfig);\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n AutoTokenizer,\r\n BertTokenizer,\r\n DistilBertTokenizer,\r\n T5Tokenizer,\r\n GPT2Tokenizer\r\n};\r\n","\r\nconst {\r\n AutoTokenizer,\r\n BertTokenizer,\r\n DistilBertTokenizer,\r\n T5Tokenizer,\r\n GPT2Tokenizer\r\n} = require(\"./tokenizers.js\");\r\nconst {\r\n AutoModel,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForCausalLM,\r\n AutoModelForMaskedLM,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForObjectDetection,\r\n} = require(\"./models.js\");\r\n\r\nconst {\r\n AutoProcessor\r\n} = require(\"./processors.js\");\r\nconst {\r\n pipeline\r\n} = require(\"./pipelines.js\");\r\nconst { env } = require('./env.js');\r\n\r\nconst { Tensor } = require('./tensor_utils.js');\r\n\r\nconst moduleExports = {\r\n // Tokenizers\r\n AutoTokenizer,\r\n BertTokenizer,\r\n DistilBertTokenizer,\r\n T5Tokenizer,\r\n GPT2Tokenizer,\r\n\r\n // Models\r\n AutoModel,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForCausalLM,\r\n AutoModelForMaskedLM,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForObjectDetection,\r\n\r\n // Processors\r\n AutoProcessor,\r\n\r\n // other\r\n pipeline,\r\n Tensor,\r\n\r\n // environment variables\r\n env\r\n};\r\n\r\n// Allow global access to these variables\r\nif (typeof self !== 'undefined') {\r\n // Used by web workers\r\n Object.assign(self, moduleExports);\r\n}\r\n\r\n// Used by other modules\r\nmodule.exports = moduleExports\r\n","\r\nconst fs = require('fs');\r\n\r\nconst { env } = require('./env.js');\r\n\r\nif (global.ReadableStream === undefined && typeof process !== 'undefined') {\r\n try {\r\n // @ts-ignore\r\n global.ReadableStream = require('node:stream/web').ReadableStream; // ReadableStream is not a global with Node 16\r\n } catch (err) {\r\n console.warn(\"ReadableStream not defined and unable to import from node:stream/web\");\r\n }\r\n}\r\n\r\nclass FileResponse {\r\n /**\r\n * Creates a new `FileResponse` object.\r\n * @param {string|URL} filePath\r\n */\r\n constructor(filePath) {\r\n this.filePath = filePath;\r\n this.headers = {};\r\n this.headers.get = (x) => this.headers[x]\r\n\r\n this.exists = fs.existsSync(filePath);\r\n if (this.exists) {\r\n this.status = 200;\r\n this.statusText = 'OK';\r\n\r\n let stats = fs.statSync(filePath);\r\n this.headers['content-length'] = stats.size;\r\n\r\n this.updateContentType();\r\n\r\n let self = this;\r\n this.body = new ReadableStream({\r\n start(controller) {\r\n self.arrayBuffer().then(buffer => {\r\n controller.enqueue(new Uint8Array(buffer));\r\n controller.close();\r\n })\r\n }\r\n });\r\n } else {\r\n this.status = 404;\r\n this.statusText = 'Not Found';\r\n this.body = null;\r\n }\r\n }\r\n\r\n /**\r\n * Updates the 'content-type' header property of the response based on the extension of\r\n * the file specified by the filePath property of the current object.\r\n * @function\r\n * @returns {void}\r\n */\r\n updateContentType() {\r\n // Set content-type header based on file extension\r\n const extension = this.filePath.toString().split('.').pop().toLowerCase();\r\n switch (extension) {\r\n case 'txt':\r\n this.headers['content-type'] = 'text/plain';\r\n break;\r\n case 'html':\r\n this.headers['content-type'] = 'text/html';\r\n break;\r\n case 'css':\r\n this.headers['content-type'] = 'text/css';\r\n break;\r\n case 'js':\r\n this.headers['content-type'] = 'text/javascript';\r\n break;\r\n case 'json':\r\n this.headers['content-type'] = 'application/json';\r\n break;\r\n case 'png':\r\n this.headers['content-type'] = 'image/png';\r\n break;\r\n case 'jpg':\r\n case 'jpeg':\r\n this.headers['content-type'] = 'image/jpeg';\r\n break;\r\n case 'gif':\r\n this.headers['content-type'] = 'image/gif';\r\n break;\r\n default:\r\n this.headers['content-type'] = 'application/octet-stream';\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * @function\r\n * @returns {FileResponse}\r\n */\r\n clone() {\r\n let response = new FileResponse(this.filePath);\r\n response.exists = this.exists;\r\n response.status = this.status;\r\n response.statusText = this.statusText;\r\n response.headers = this.headers;\r\n return response;\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with an ArrayBuffer containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with an ArrayBuffer containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async arrayBuffer() {\r\n const data = await fs.promises.readFile(this.filePath);\r\n return data.buffer;\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with a Blob containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with a Blob containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async blob() {\r\n const data = await fs.promises.readFile(this.filePath);\r\n return new Blob([data], { type: this.headers['content-type'] });\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with a string containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with a string containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async text() {\r\n const data = await fs.promises.readFile(this.filePath, 'utf8');\r\n return data;\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with a parsed JavaScript object containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with a parsed JavaScript object containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async json() {\r\n return JSON.parse(await this.text());\r\n }\r\n}\r\n\r\n/**\r\n * Determines whether the given string is a valid HTTP or HTTPS URL.\r\n * @function\r\n * @param {string|URL} string - The string to test for validity as an HTTP or HTTPS URL.\r\n * @returns {boolean} - True if the string is a valid HTTP or HTTPS URL, false otherwise.\r\n */\r\nfunction isValidHttpUrl(string) {\r\n // https://stackoverflow.com/a/43467144\r\n let url;\r\n try {\r\n url = new URL(string);\r\n } catch (_) {\r\n return false;\r\n }\r\n return url.protocol === \"http:\" || url.protocol === \"https:\";\r\n}\r\n\r\n/**\r\n * Helper function to get a file, using either the Fetch API or FileSystem API.\r\n *\r\n * @async\r\n * @function getFile\r\n * @param {string|URL} url - The URL of the file to get.\r\n * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API).\r\n */\r\nasync function getFile(url) {\r\n // Helper function to get a file, using either the Fetch API or FileSystem API\r\n\r\n if (env.useFS && !isValidHttpUrl(url)) {\r\n return new FileResponse(url)\r\n\r\n } else {\r\n return fetch(url)\r\n }\r\n}\r\n\r\n/**\r\n * Helper function to dispatch progress callbacks.\r\n *\r\n * @function dispatchCallback\r\n * @param {function} progressCallback - The progress callback function to dispatch.\r\n * @param {any} data - The data to pass to the progress callback function.\r\n * @returns {void}\r\n */\r\nfunction dispatchCallback(progressCallback, data) {\r\n if (progressCallback !== null) progressCallback(data);\r\n}\r\n\r\n/**\r\n * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API.\r\n *\r\n * @async\r\n * @function getModelFile\r\n * @param {string} modelPath - The path of the model file.\r\n * @param {string} fileName - The name of the model file.\r\n * @param {function} [progressCallback=null] - A function to call when the download progress is updated.\r\n * @returns {Promise} A Promise that resolves with the file content as a buffer.\r\n * @throws Will throw an error if the file is not found.\r\n */\r\nasync function getModelFile(modelPath, fileName, progressCallback = null, fatal = true) {\r\n\r\n // Initiate session\r\n dispatchCallback(progressCallback, {\r\n status: 'initiate',\r\n name: modelPath,\r\n file: fileName\r\n })\r\n\r\n let cache;\r\n if (env.useCache) {\r\n cache = await caches.open('transformers-cache');\r\n }\r\n\r\n const request = pathJoin(modelPath, fileName);\r\n\r\n /** @type {Response | FileResponse} */\r\n let response;\r\n\r\n /** @type {Response | FileResponse} */\r\n let responseToCache;\r\n\r\n if (!env.useCache || (response = await cache.match(request)) === undefined) {\r\n // Caching not available, or model is not cached, so we perform the request\r\n response = await getFile(request);\r\n\r\n if (response.status === 404) {\r\n if (fatal) {\r\n throw Error(`File not found. Could not locate \"${request}\".`)\r\n } else {\r\n // File not found, but this file is optional.\r\n // TODO in future, cache the response\r\n return null;\r\n }\r\n }\r\n\r\n if (env.useCache) {\r\n // only clone if cache available\r\n responseToCache = response.clone();\r\n }\r\n }\r\n\r\n // Start downloading\r\n dispatchCallback(progressCallback, {\r\n status: 'download',\r\n name: modelPath,\r\n file: fileName\r\n })\r\n\r\n const buffer = await readResponse(response, data => {\r\n dispatchCallback(progressCallback, {\r\n status: 'progress',\r\n ...data,\r\n name: modelPath,\r\n file: fileName\r\n })\r\n })\r\n\r\n // Check again whether request is in cache. If not, we add the response to the cache\r\n if (responseToCache !== undefined && await cache.match(request) === undefined) {\r\n cache.put(request, /** @type {Response} */(/** @type {unknown} */ (responseToCache)));\r\n }\r\n\r\n dispatchCallback(progressCallback, {\r\n status: 'done',\r\n name: modelPath,\r\n file: fileName\r\n });\r\n\r\n return buffer;\r\n}\r\n\r\n/**\r\n * Fetches a JSON file from a given path and file name.\r\n *\r\n * @param {string} modelPath - The path to the directory containing the file.\r\n * @param {string} fileName - The name of the file to fetch.\r\n * @param {function} progressCallback - A callback function to receive progress updates. Optional.\r\n * @returns {Promise} - The JSON data parsed into a JavaScript object.\r\n */\r\nasync function fetchJSON(modelPath, fileName, progressCallback = null, fatal = true) {\r\n let buffer = await getModelFile(modelPath, fileName, progressCallback, fatal);\r\n if (buffer === null) {\r\n // Return empty object\r\n return {}\r\n }\r\n\r\n let decoder = new TextDecoder('utf-8');\r\n let jsonData = decoder.decode(buffer);\r\n\r\n return JSON.parse(jsonData);\r\n}\r\n\r\n/**\r\n * Read and track progress when reading a Response object\r\n *\r\n * @param {any} response - The Response object to read\r\n * @param {function} progressCallback - The function to call with progress updates\r\n * @returns {Promise} A Promise that resolves with the Uint8Array buffer\r\n */\r\nasync function readResponse(response, progressCallback) {\r\n // Read and track progress when reading a Response object\r\n\r\n const contentLength = response.headers.get('Content-Length');\r\n if (contentLength === null) {\r\n console.warn('Unable to determine content-length from response headers. Will expand buffer when needed.')\r\n }\r\n let total = parseInt(contentLength ?? '0');\r\n let buffer = new Uint8Array(total);\r\n let loaded = 0;\r\n\r\n const reader = response.body.getReader();\r\n async function read() {\r\n const { done, value } = await reader.read();\r\n if (done) return;\r\n\r\n let newLoaded = loaded + value.length;\r\n if (newLoaded > total) {\r\n total = newLoaded;\r\n\r\n // Adding the new data will overflow buffer.\r\n // In this case, we extend the buffer\r\n let newBuffer = new Uint8Array(total);\r\n\r\n // copy contents\r\n newBuffer.set(buffer);\r\n\r\n buffer = newBuffer;\r\n }\r\n buffer.set(value, loaded)\r\n loaded = newLoaded;\r\n\r\n const progress = (loaded / total) * 100;\r\n\r\n // Call your function here\r\n progressCallback({\r\n progress: progress,\r\n loaded: loaded,\r\n total: total,\r\n })\r\n\r\n return read();\r\n }\r\n\r\n // Actually read\r\n await read();\r\n\r\n return buffer;\r\n}\r\n\r\n/**\r\n * Joins multiple parts of a path into a single path, while handling leading and trailing slashes.\r\n *\r\n * @param {...string} parts - Multiple parts of a path.\r\n * @returns {string} A string representing the joined path.\r\n */\r\nfunction pathJoin(...parts) {\r\n // https://stackoverflow.com/a/55142565\r\n parts = parts.map((part, index) => {\r\n if (index) {\r\n part = part.replace(new RegExp('^/'), '');\r\n }\r\n if (index !== parts.length - 1) {\r\n part = part.replace(new RegExp('/$'), '');\r\n }\r\n return part;\r\n })\r\n return parts.join('/');\r\n}\r\n\r\n/**\r\n * Reverses the keys and values of an object.\r\n *\r\n * @param {object} data - The object to reverse.\r\n * @returns {object} The reversed object.\r\n * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript\r\n */\r\nfunction reverseDictionary(data) {\r\n // https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript\r\n return Object.fromEntries(Object.entries(data).map(([key, value]) => [value, key]));\r\n}\r\n\r\n/**\r\n * Returns the index of the maximum value in an array.\r\n * @param {Array} arr - The input array.\r\n * @see https://stackoverflow.com/a/11301464\r\n * @returns {number} - The index of the maximum value in the array.\r\n */\r\nfunction indexOfMax(arr) {\r\n // https://stackoverflow.com/a/11301464\r\n\r\n if (arr.length === 0) {\r\n return -1;\r\n }\r\n\r\n var max = arr[0];\r\n var maxIndex = 0;\r\n\r\n for (var i = 1; i < arr.length; ++i) {\r\n if (arr[i] > max) {\r\n maxIndex = i;\r\n max = arr[i];\r\n }\r\n }\r\n\r\n return maxIndex;\r\n}\r\n\r\n/**\r\n * Compute the softmax of an array of numbers.\r\n *\r\n * @param {number[]} arr - The array of numbers to compute the softmax of.\r\n * @returns {number[]} The softmax array.\r\n */\r\nfunction softmax(arr) {\r\n // Compute the maximum value in the array\r\n const maxVal = max(arr);\r\n\r\n // Compute the exponentials of the array values\r\n const exps = arr.map(x => Math.exp(x - maxVal));\r\n\r\n // Compute the sum of the exponentials\r\n const sumExps = exps.reduce((acc, val) => acc + val, 0);\r\n\r\n // Compute the softmax values\r\n const softmaxArr = exps.map(x => x / sumExps);\r\n\r\n return softmaxArr;\r\n}\r\n\r\n/**\r\n * Calculates the logarithm of the softmax function for the input array.\r\n * @param {number[]} arr - The input array to calculate the log_softmax function for.\r\n * @returns {any} - The resulting log_softmax array.\r\n */\r\nfunction log_softmax(arr) {\r\n // Compute the softmax values\r\n const softmaxArr = softmax(arr);\r\n\r\n // Apply log formula to each element\r\n const logSoftmaxArr = softmaxArr.map(x => Math.log(x));\r\n\r\n return logSoftmaxArr;\r\n}\r\n\r\n/**\r\n * Escapes regular expression special characters from a string by replacing them with their escaped counterparts.\r\n *\r\n * @param {string} string - The string to escape.\r\n * @returns {string} - The escaped string.\r\n */\r\nfunction escapeRegExp(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\r\n}\r\n\r\n/**\r\n * Get the top k items from an iterable, sorted by descending order\r\n *\r\n * @param {Array} items - The items to be sorted\r\n * @param {number} [top_k=0] - The number of top items to return (default: 0 = return all)\r\n * @returns {Array} - The top k items, sorted by descending order\r\n */\r\nfunction getTopItems(items, top_k = 0) {\r\n // if top == 0, return all\r\n\r\n items = Array.from(items)\r\n .map((x, i) => [i, x]) // Get indices ([index, score])\r\n .sort((a, b) => b[1] - a[1]) // Sort by log probabilities\r\n\r\n if (top_k > 0) {\r\n items = items.slice(0, top_k); // Get top k items\r\n }\r\n\r\n return items\r\n}\r\n\r\n/**\r\n * Calculates the dot product of two arrays.\r\n * @param {number[]} arr1 - The first array.\r\n * @param {number[]} arr2 - The second array.\r\n * @returns {number} - The dot product of arr1 and arr2.\r\n */\r\nfunction dot(arr1, arr2) {\r\n return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);\r\n}\r\n\r\n/**\r\n * Computes the cosine similarity between two arrays.\r\n *\r\n * @param {number[]} arr1 - The first array.\r\n * @param {number[]} arr2 - The second array.\r\n * @returns {number} The cosine similarity between the two arrays.\r\n */\r\nfunction cos_sim(arr1, arr2) {\r\n // Calculate dot product of the two arrays\r\n const dotProduct = dot(arr1, arr2);\r\n\r\n // Calculate the magnitude of the first array\r\n const magnitudeA = magnitude(arr1);\r\n\r\n // Calculate the magnitude of the second array\r\n const magnitudeB = magnitude(arr2);\r\n\r\n // Calculate the cosine similarity\r\n const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB);\r\n\r\n return cosineSimilarity;\r\n}\r\n\r\n/**\r\n * Calculates the magnitude of a given array.\r\n * @param {number[]} arr - The array to calculate the magnitude of.\r\n * @returns {number} The magnitude of the array.\r\n */\r\nfunction magnitude(arr) {\r\n return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0));\r\n}\r\n\r\n/**\r\n * A base class for creating callable objects.\r\n *\r\n * @extends Function\r\n */\r\nclass Callable extends Function {\r\n /**\r\n * Creates a new instance of the Callable class.\r\n */\r\n constructor() {\r\n super();\r\n /**\r\n * Creates a closure that delegates to a private method '_call' with the given arguments.\r\n *\r\n * @param {...any} args - Zero or more arguments to pass to the '_call' method.\r\n * @returns {*} - The result of calling the '_call' method.\r\n */\r\n let closure = function (...args) {\r\n // @ts-ignore\r\n return closure._call(...args)\r\n }\r\n return Object.setPrototypeOf(closure, new.target.prototype)\r\n }\r\n\r\n /**\r\n * This method should be implemented in subclasses to provide the\r\n * functionality of the callable object.\r\n *\r\n * @throws {Error} Must implement _call method in subclass\r\n * @param {...*} args\r\n */\r\n _call(...args) {\r\n throw Error('Must implement _call method in subclass')\r\n }\r\n}\r\n\r\n/**\r\n * Returns the minimum item.\r\n * @param {number[]} arr - array of numbers.\r\n * @returns {number} - the minimum number.\r\n * @throws {Error} If array is empty.\r\n */\r\nfunction min(arr) {\r\n if (arr.length === 0) throw Error('Array must not be empty');\r\n let min = arr[0];\r\n for (let i = 1; i < arr.length; ++i) {\r\n if (arr[i] < min) {\r\n min = arr[i];\r\n }\r\n }\r\n return min;\r\n}\r\n\r\n\r\n/**\r\n * Returns the maximum item.\r\n * @param {number[]} arr - array of numbers.\r\n * @returns {number} - the maximum number.\r\n * @throws {Error} If array is empty.\r\n */\r\nfunction max(arr) {\r\n if (arr.length === 0) throw Error('Array must not be empty');\r\n let max = arr[0];\r\n for (let i = 1; i < arr.length; ++i) {\r\n if (arr[i] > max) {\r\n max = arr[i];\r\n }\r\n }\r\n return max;\r\n}\r\n\r\n/**\r\n * Check if a value is a string.\r\n * @param {*} text - The value to check.\r\n * @returns {boolean} - True if the value is a string, false otherwise.\r\n */\r\nfunction isString(text) {\r\n return typeof text === 'string' || text instanceof String\r\n}\r\n\r\n/**\r\n * Check if a value is an integer.\r\n * @param {*} x - The value to check.\r\n * @returns {boolean} - True if the value is a string, false otherwise.\r\n */\r\nfunction isIntegralNumber(x) {\r\n return Number.isInteger(x) || typeof x === 'bigint'\r\n}\r\n\r\n/**\r\n * Check if a value is exists.\r\n * @param {*} x - The value to check.\r\n * @returns {boolean} - True if the value exists, false otherwise.\r\n */\r\nfunction exists(x) {\r\n return x !== undefined && x !== null;\r\n}\r\n\r\nmodule.exports = {\r\n Callable,\r\n getModelFile,\r\n dispatchCallback,\r\n fetchJSON,\r\n pathJoin,\r\n reverseDictionary,\r\n indexOfMax,\r\n softmax,\r\n log_softmax,\r\n escapeRegExp,\r\n getTopItems,\r\n dot,\r\n cos_sim,\r\n magnitude,\r\n getFile,\r\n isIntegralNumber,\r\n isString,\r\n exists,\r\n min,\r\n max,\r\n};\r\n","/* (ignored) */","/* (ignored) */","/* (ignored) */","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/transformers.js\");\n",""],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/transformers.min.js b/dist/transformers.min.js deleted file mode 100644 index 509b8c2da..000000000 --- a/dist/transformers.min.js +++ /dev/null @@ -1,86 +0,0 @@ -(()=>{var __webpack_modules__={"./node_modules/onnxruntime-common/dist/lib/backend-impl.js": -/*!******************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/backend-impl.js ***! - \******************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{registerBackend:()=>o,resolveBackend:()=>s});const r={},i=[],o=(t,e,n)=>{if(!e||"function"!=typeof e.init||"function"!=typeof e.createSessionHandler)throw new TypeError("not a valid backend");{const o=r[t];if(void 0===o)r[t]={backend:e,priority:n};else{if(o.priority>n)return;if(o.priority===n&&o.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){const e=i.indexOf(t);-1!==e&&i.splice(e,1);for(let e=0;e{const e=0===t.length?i:t,n=[];for(const t of e){const e=r[t];if(e){if(e.initialized)return e.backend;if(e.aborted)continue;const r=!!e.initPromise;try{return r||(e.initPromise=e.backend.init()),await e.initPromise,e.initialized=!0,e.backend}catch(i){r||n.push({name:t,err:i}),e.aborted=!0}finally{delete e.initPromise}}}throw new Error(`no available backend found. ERR: ${n.map((t=>`[${t.name}] ${t.err}`)).join(", ")}`)}},"./node_modules/onnxruntime-common/dist/lib/backend.js": -/*!*************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/backend.js ***! - \*************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{registerBackend:()=>r.registerBackend});var r=n(/*! ./backend-impl */"./node_modules/onnxruntime-common/dist/lib/backend-impl.js")},"./node_modules/onnxruntime-common/dist/lib/env-impl.js": -/*!**************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/env-impl.js ***! - \**************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{EnvImpl:()=>r});class r{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(t){if(void 0!==t){if("string"!=typeof t||-1===["verbose","info","warning","error","fatal"].indexOf(t))throw new Error(`Unsupported logging level: ${t}`);this.logLevelInternal=t}}get logLevel(){return this.logLevelInternal}}},"./node_modules/onnxruntime-common/dist/lib/env.js": -/*!*********************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/env.js ***! - \*********************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{env:()=>r});const r=new(n(/*! ./env-impl */"./node_modules/onnxruntime-common/dist/lib/env-impl.js").EnvImpl)},"./node_modules/onnxruntime-common/dist/lib/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/index.js ***! - \***********************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{InferenceSession:()=>o.InferenceSession,Tensor:()=>s.Tensor,env:()=>i.env,registerBackend:()=>r.registerBackend});var r=n(/*! ./backend */"./node_modules/onnxruntime-common/dist/lib/backend.js"),i=n(/*! ./env */"./node_modules/onnxruntime-common/dist/lib/env.js"),o=n(/*! ./inference-session */"./node_modules/onnxruntime-common/dist/lib/inference-session.js"),s=n(/*! ./tensor */"./node_modules/onnxruntime-common/dist/lib/tensor.js");n(/*! ./onnx-value */"./node_modules/onnxruntime-common/dist/lib/onnx-value.js")},"./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js": -/*!****************************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js ***! - \****************************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{InferenceSession:()=>o});var r=n(/*! ./backend-impl */"./node_modules/onnxruntime-common/dist/lib/backend-impl.js"),i=n(/*! ./tensor */"./node_modules/onnxruntime-common/dist/lib/tensor.js");class o{constructor(t){this.handler=t}async run(t,e,n){const r={};let o={};if("object"!=typeof t||null===t||t instanceof i.Tensor||Array.isArray(t))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let s=!0;if("object"==typeof e){if(null===e)throw new TypeError("Unexpected argument[1]: cannot be null.");if(e instanceof i.Tensor)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(e)){if(0===e.length)throw new TypeError("'fetches' cannot be an empty array.");s=!1;for(const t of e){if("string"!=typeof t)throw new TypeError("'fetches' must be a string array or an object.");if(-1===this.outputNames.indexOf(t))throw new RangeError(`'fetches' contains invalid output name: ${t}.`);r[t]=null}if("object"==typeof n&&null!==n)o=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{let t=!1;const a=Object.getOwnPropertyNames(e);for(const n of this.outputNames)if(-1!==a.indexOf(n)){const o=e[n];(null===o||o instanceof i.Tensor)&&(t=!0,s=!1,r[n]=o)}if(t){if("object"==typeof n&&null!==n)o=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else o=e}}else if(void 0!==e)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const e of this.inputNames)if(void 0===t[e])throw new Error(`input '${e}' is missing in 'feeds'.`);if(s)for(const t of this.outputNames)r[t]=null;const a=await this.handler.run(t,r,o),u={};for(const t in a)Object.hasOwnProperty.call(a,t)&&(u[t]=new i.Tensor(a[t].type,a[t].data,a[t].dims));return u}static async create(t,e,n,i){let s,a={};if("string"==typeof t){if(s=t,"object"==typeof e&&null!==e)a=e;else if(void 0!==e)throw new TypeError("'options' must be an object.")}else if(t instanceof Uint8Array){if(s=t,"object"==typeof e&&null!==e)a=e;else if(void 0!==e)throw new TypeError("'options' must be an object.")}else{if(!(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer))throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");{const r=t;let o=0,u=t.byteLength;if("object"==typeof e&&null!==e)a=e;else if("number"==typeof e){if(o=e,!Number.isSafeInteger(o))throw new RangeError("'byteOffset' must be an integer.");if(o<0||o>=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(u=t.byteLength-o,"number"==typeof n){if(u=n,!Number.isSafeInteger(u))throw new RangeError("'byteLength' must be an integer.");if(u<=0||o+u>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-o}].`);if("object"==typeof i&&null!==i)a=i;else if(void 0!==i)throw new TypeError("'options' must be an object.")}else if(void 0!==n)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==e)throw new TypeError("'options' must be an object.");s=new Uint8Array(r,o,u)}}const u=(a.executionProviders||[]).map((t=>"string"==typeof t?t:t.name)),l=await(0,r.resolveBackend)(u),c=await l.createSessionHandler(s,a);return new o(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}},"./node_modules/onnxruntime-common/dist/lib/inference-session.js": -/*!***********************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/inference-session.js ***! - \***********************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{InferenceSession:()=>r});const r=n(/*! ./inference-session-impl */"./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js").InferenceSession},"./node_modules/onnxruntime-common/dist/lib/onnx-value.js": -/*!****************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/onnx-value.js ***! - \****************************************************************/(t,e,n)=>{"use strict";n.r(e)},"./node_modules/onnxruntime-common/dist/lib/tensor-impl.js": -/*!*****************************************************************!*\ - !*** ./node_modules/onnxruntime-common/dist/lib/tensor-impl.js ***! - \*****************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{Tensor:()=>a});const r="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,i="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,o=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),s=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);r&&(o.set("int64",BigInt64Array),s.set(BigInt64Array,"int64")),i&&(o.set("uint64",BigUint64Array),s.set(BigUint64Array,"uint64"));class a{constructor(t,e,n){let r,i,a;if("string"==typeof t)if(r=t,a=n,"string"===t){if(!Array.isArray(e))throw new TypeError("A string tensor's data must be a string array.");i=e}else{const n=o.get(t);if(void 0===n)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(e))i=n.from(e);else{if(!(e instanceof n))throw new TypeError(`A ${r} tensor's data must be type of ${n}`);i=e}}else if(a=e,Array.isArray(t)){if(0===t.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const e=typeof t[0];if("string"===e)r="string",i=t;else{if("boolean"!==e)throw new TypeError(`Invalid element type of data array: ${e}.`);r="bool",i=Uint8Array.from(t)}}else{const e=s.get(t.constructor);if(void 0===e)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);r=e,i=t}if(void 0===a)a=[i.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");const u=(t=>{let e=1;for(let n=0;n{const i=document.createElement("canvas"),o=i.getContext("2d");if(!t||!o)return r();const s=new Image;s.crossOrigin="Anonymous",s.src=t,s.onload=()=>{i.width=s.width,i.height=s.height,o.drawImage(s,0,0,i.width,i.height);const t=o.getImageData(0,0,i.width,i.height);if(void 0!==e){if(void 0!==e.height&&e.height!==i.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(u.height=i.height,void 0!==e.width&&e.width!==i.width)throw new Error("Image input config width doesn't match ImageBitmap width");u.width=i.width}else u.height=i.height,u.width=i.width;n(a.bufferToTensor(t.data,u))}}));throw new Error("Input data provided is not supported - aborted tensor creation")}{const n="RGBA";let r,i;if(void 0!==e&&void 0!==e.resizedWidth&&void 0!==e.resizedHeight?(r=e.resizedHeight,i=e.resizedWidth):(r=t.height,i=t.width),void 0!==e){if(u=e,void 0!==e.bitmapFormat&&e.bitmapFormat!==n)throw new Error("Image input config format must be RGBA for ImageData");u.bitmapFormat="RGBA"}else u.bitmapFormat="RGBA";if(u.height=r,u.width=i,void 0!==e){const e=document.createElement("canvas");e.width=i,e.height=r;const n=e.getContext("2d");if(null==n)throw new Error("Can not access image data");n.putImageData(t,0,0),s=n.getImageData(0,0,i,r).data}else s=t.data}}if(void 0!==s)return a.bufferToTensor(s,u);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(t){var e,n;const r=document.createElement("canvas").getContext("2d");let i;if(null==r)throw new Error("Can not access image data");{const o=this.dims[3],s=this.dims[2],a=this.dims[1],u=void 0!==t&&void 0!==t.format?t.format:"RGB",l=void 0!==t&&void 0!==(null===(e=t.norm)||void 0===e?void 0:e.mean)?t.norm.mean:255,c=void 0!==t&&void 0!==(null===(n=t.norm)||void 0===n?void 0:n.bias)?t.norm.bias:0,d=s*o;if(void 0!==t){if(void 0!==t.height&&t.height!==s)throw new Error("Image output config height doesn't match tensor height");if(void 0!==t.width&&t.width!==o)throw new Error("Image output config width doesn't match tensor width");if(void 0!==t.format&&4===a&&"RGBA"!==t.format||3===a&&"RGB"!==t.format&&"BGR"!==t.format)throw new Error("Tensor format doesn't match input tensor dims")}const h=4;let p=0,f=1,g=2,m=3,b=0,y=d,_=2*d,w=-1;"RGBA"===u?(b=0,y=d,_=2*d,w=3*d):"RGB"===u?(b=0,y=d,_=2*d):"RBG"===u&&(b=0,_=d,y=2*d),i=r.createImageData(o,s);for(let t=0;t{"use strict";n.r(e),n.d(e,{Tensor:()=>r});const r=n(/*! ./tensor-impl */"./node_modules/onnxruntime-common/dist/lib/tensor-impl.js").Tensor},"./node_modules/onnxruntime-web/dist/ort-web.min.js": -/*!**********************************************************!*\ - !*** ./node_modules/onnxruntime-web/dist/ort-web.min.js ***! - \**********************************************************/(module,__unused_webpack_exports,__webpack_require__)=>{var e;self,e=__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(t,e,n)=>{var r,i=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return $.buffer!=F&&H($.buffer),M}function i(){return $.buffer!=F&&H($.buffer),j}function o(){return $.buffer!=F&&H($.buffer),N}function s(){return $.buffer!=F&&H($.buffer),L}function a(){return $.buffer!=F&&H($.buffer),R}var u,l,c;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){l=t,c=e}));var d,h,p,f,g,m,b=Object.assign({},u),y="./this.program",_=(t,e)=>{throw e},w="object"==typeof window,v="function"==typeof importScripts,x="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,T=u.ENVIRONMENT_IS_PTHREAD||!1,S="";function O(t){return u.locateFile?u.locateFile(t,S):S+t}if(x){let e;S=v?n(908).dirname(S)+"/":"//",m=()=>{g||(f=n(1384),g=n(908))},d=function(t,e){return m(),t=g.normalize(t),f.readFileSync(t,e?void 0:"utf8")},p=t=>((t=d(t,!0)).buffer||(t=new Uint8Array(t)),t),h=(t,e,n)=>{m(),t=g.normalize(t),f.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof lt||P("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(t){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),t}n.g.Worker=e.Worker}else(w||v)&&(v?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),r&&(S=r),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",x||(d=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},v&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),h=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));x&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var A=console.log.bind(console),E=console.warn.bind(console);x&&(m(),A=t=>f.writeSync(1,t+"\n"),E=t=>f.writeSync(2,t+"\n"));var I,k=u.print||A,P=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(y=u.thisProgram),u.quit&&(_=u.quit),u.wasmBinary&&(I=u.wasmBinary);var D=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&ot("no native wasm support detected");var $,C,F,M,j,N,L,R,z=!1,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|s:(7&i)<<18|o<<12|s<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function V(t,e){return(t>>>=0)?B(i(),t,e):""}function G(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(n>=r)break;e[n++>>>0]=s}else{if(2047>=s){if(n+1>=r)break;e[n++>>>0]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;e[n++>>>0]=224|s>>12}else{if(n+3>=r)break;e[n++>>>0]=240|s>>18,e[n++>>>0]=128|s>>12&63}e[n++>>>0]=128|s>>6&63}e[n++>>>0]=128|63&s}}return e[n>>>0]=0,n-i}function q(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function H(t){F=t,u.HEAP8=M=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=N=new Int32Array(t),u.HEAPU8=j=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=L=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=R=new Float64Array(t)}T&&(F=u.buffer);var W=u.INITIAL_MEMORY||16777216;if(T)$=u.wasmMemory,F=u.buffer;else if(u.wasmMemory)$=u.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),x&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");$&&(F=$.buffer),W=F.byteLength,H(F);var X,Y=[],K=[],Z=[],J=[];function Q(){return D||!1}function tt(){var t=u.preRun.shift();Y.unshift(t)}var et,nt=0,rt=null,it=null;function ot(t){throw T?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),P(t="Aborted("+t+")"),z=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),c(t),t}function st(){return et.startsWith("data:application/octet-stream;base64,")}function at(){var t=et;try{if(t==et&&I)return new Uint8Array(I);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){ot(t)}}et="ort-wasm-threaded.wasm",st()||(et=O(et));var ut={};function lt(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function ct(t){(t=ft.Vb[t])||ot(),ft.mc(t)}function dt(t){var e=ft.Cc();if(!e)return 6;ft.ac.push(e),ft.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ht(t){if(T)return Wt(1,1,t);Q()||(ft.oc(),u.onExit&&u.onExit(t),z=!0),_(t,new lt(t))}function pt(t,e){if(!e&&T)throw mt(t),"unwind";Q()||T||(be(),gt(Z),me(0),re[1].length&&ie(1,10),re[2].length&&ie(2,10),ft.oc()),ht(t)}var ft={Yb:[],ac:[],qc:[],Vb:{},fc:function(){T&&ft.Ec()},Pc:function(){},Ec:function(){ft.receiveObjectTransfer=ft.Gc,ft.threadInitTLS=ft.pc,ft.setExitStatus=ft.nc,D=!1},nc:function(){},oc:function(){for(var t of Object.values(ft.Vb))ft.mc(t);for(t of ft.Yb)t.terminate();ft.Yb=[]},mc:function(t){var e=t.Ub;delete ft.Vb[e],ft.Yb.push(t),ft.ac.splice(ft.ac.indexOf(t),1),t.Ub=0,xe(e)},Gc:function(){},pc:function(){ft.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ft.Bc=t.Ub),n.targetThread&&n.targetThread!=pe()){var i=ft.Vb[n.Qc];i?i.postMessage(n,n.transferList):P('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Ut(n.queue):"spawnThread"===r?dt(n):"cleanupThread"===r?ct(n.thread):"killThread"===r?(n=n.thread,r=ft.Vb[n],delete ft.Vb[n],r.terminate(),xe(n),ft.ac.splice(ft.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ft.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?k("Thread "+n.threadId+": "+n.text):"printErr"===r?P("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&P("worker sent an unknown command "+r);ft.Bc=void 0},t.onerror=t=>{throw P("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},x&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:$,wasmModule:C})},yc:function(){var t=O("ort-wasm-threaded.worker.js");ft.Yb.push(new Worker(t))},Cc:function(){return 0==ft.Yb.length&&(ft.yc(),ft.Fc(ft.Yb[0])),ft.Yb.pop()}};function gt(t){for(;0>2>>>0];t=o()[t+48>>2>>>0],Oe(e,e-t),Ee(e)};var bt=[];function yt(t){var e=bt[t];return e||(t>=bt.length&&(bt.length=t+1),bt[t]=e=X.get(t)),e}u.invokeEntryPoint=function(t,e){t=yt(t)(e),Q()?ft.nc(t):Te(t)};var _t,wt,vt=[],xt=0,Tt=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){s()[this.Sb+4>>2>>>0]=t},this.bc=function(){return s()[this.Sb+4>>2>>>0]},this.wc=function(t){s()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return s()[this.Sb+8>>2>>>0]},this.rc=function(){o()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(o(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(o(),this.Sb>>2,1)},this.cc=function(t){s()[this.Sb+16>>2>>>0]=t},this.tc=function(){return s()[this.Sb+16>>2>>>0]},this.vc=function(){if(Pe(this.bc()))return s()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Ot(t){return ge(new St(t).Sb)}function At(t,e,n,r){return T?Wt(3,1,t,e,n,r):Et(t,e,n,r)}function Et(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return P("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var i=[];return T&&0===i.length?At(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:i},T?(t.Oc="spawnThread",postMessage(t,i),0):dt(t))}function It(t,e,n){return T?Wt(4,1,t,e,n):0}function kt(t,e){if(T)return Wt(5,1,t,e)}function Pt(t,e){if(T)return Wt(6,1,t,e)}function Dt(t,e,n){if(T)return Wt(7,1,t,e,n)}function $t(t,e,n){return T?Wt(8,1,t,e,n):0}function Ct(t,e){if(T)return Wt(9,1,t,e)}function Ft(t,e,n){if(T)return Wt(10,1,t,e,n)}function Mt(t,e,n,r){if(T)return Wt(11,1,t,e,n,r)}function jt(t,e,n,r){if(T)return Wt(12,1,t,e,n,r)}function Nt(t,e,n,r){if(T)return Wt(13,1,t,e,n,r)}function Lt(t){if(T)return Wt(14,1,t)}function Rt(t,e){if(T)return Wt(15,1,t,e)}function zt(t,e,n){if(T)return Wt(16,1,t,e,n)}function Ut(t){Atomics.store(o(),t>>2,1),pe()&&ve(t),Atomics.compareExchange(o(),t>>2,1,0)}function Bt(t){return s()[t>>>2]+4294967296*o()[t+4>>>2]}function Vt(t,e,n,r,i,o){return T?Wt(17,1,t,e,n,r,i,o):-52}function Gt(t,e,n,r,i,o){if(T)return Wt(18,1,t,e,n,r,i,o)}function qt(t){var n=q(t)+1,r=fe(n);return r&&G(t,e(),r,n),r}function Ht(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}if(T)return Wt(19,1,t,e,n);var i=(new Date).getFullYear(),a=new Date(i,0,1),u=new Date(i,6,1);i=a.getTimezoneOffset();var l=u.getTimezoneOffset(),c=Math.max(i,l);o()[t>>2>>>0]=60*c,o()[e>>2>>>0]=Number(i!=l),t=r(a),e=r(u),t=qt(t),e=qt(e),l>2>>>0]=t,s()[n+4>>2>>>0]=e):(s()[n>>2>>>0]=e,s()[n+4>>2>>>0]=t)}function Wt(t,e){var n=arguments.length-2,r=arguments;return function(t){var e=Ae();return t=t(),Ee(e),t}((()=>{for(var i=Ie(8*n),o=i>>3,s=0;s>>0]=u}return we(t,n,i,e)}))}u.executeNotifiedProxyingQueue=Ut,wt=x?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:T?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var Xt,Yt=[],Kt={};function Zt(){if(!Xt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(t in Kt)void 0===Kt[t]?delete e[t]:e[t]=Kt[t];var n=[];for(t in e)n.push(t+"="+e[t]);Xt=n}return Xt}function Jt(t,n){if(T)return Wt(20,1,t,n);var r=0;return Zt().forEach((function(i,o){var a=n+r;for(o=s()[t+4*o>>2>>>0]=a,a=0;a>0>>>0]=i.charCodeAt(a);e()[o>>0>>>0]=0,r+=i.length+1})),0}function Qt(t,e){if(T)return Wt(21,1,t,e);var n=Zt();s()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),s()[e>>2>>>0]=r,0}function te(t){return T?Wt(22,1,t):52}function ee(t,e,n,r){return T?Wt(23,1,t,e,n,r):52}function ne(t,e,n,r,i){return T?Wt(24,1,t,e,n,r,i):70}var re=[null,[],[]];function ie(t,e){var n=re[t];0===e||10===e?((1===t?k:P)(B(n,0)),n.length=0):n.push(e)}function oe(t,e,n,r){if(T)return Wt(25,1,t,e,n,r);for(var o=0,a=0;a>2>>>0],l=s()[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);o+=l}return s()[r>>2>>>0]=o,0}var se=0;function ae(t){return 0==t%4&&(0!=t%100||0==t%400)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],le=[31,28,31,30,31,30,31,31,30,31,30,31];function ce(t,n,r,i){function s(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=l(new Date(t.getFullYear(),0,4)),n=l(n),0>=u(e,t)?0>=u(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var d=o()[i+40>>2>>>0];for(var h in i={Lc:o()[i>>2>>>0],Kc:o()[i+4>>2>>>0],dc:o()[i+8>>2>>>0],jc:o()[i+12>>2>>>0],ec:o()[i+16>>2>>>0],Xb:o()[i+20>>2>>>0],Tb:o()[i+24>>2>>>0],Wb:o()[i+28>>2>>>0],Rc:o()[i+32>>2>>>0],Jc:o()[i+36>>2>>>0],Mc:d?V(d):""},r=V(r),d={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(h,"g"),d[h]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),f="January February March April May June July August September October November December".split(" ");for(h in d={"%a":function(t){return p[t.Tb].substring(0,3)},"%A":function(t){return p[t.Tb]},"%b":function(t){return f[t.ec].substring(0,3)},"%B":function(t){return f[t.ec]},"%C":function(t){return a((t.Xb+1900)/100|0,2)},"%d":function(t){return a(t.jc,2)},"%e":function(t){return s(t.jc,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return a(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return a(t.Lc,2)},"%t":function(){return"\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return a(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ae(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ae(t.Xb%400-1))&&e++}return a(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return a(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),d)r.includes(h)&&(r=r.replace(new RegExp(h,"g"),d[h](i)));return h=function(t){var e=Array(q(t)+1);return G(t,e,0,e.length),e}(r=r.replace(/\0\0/g,"%")),h.length>n?0:(function(t,n){e().set(t,n>>>0)}(h,t),h.length-1)}ft.fc();var de=[null,ht,mt,At,It,kt,Pt,Dt,$t,Ct,Ft,Mt,jt,Nt,Lt,Rt,zt,Vt,Gt,Ht,Jt,Qt,te,ee,ne,oe],he={b:function(t){return fe(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),xt--),t.ic(!1),vt.push(t),t.sc(),t.vc()},ma:function(t){throw P("Unexpected exception thrown, this is not properly supported - aborting"),z=!0,t},x:function(){Se(0);var t=vt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&yt(e)(t.Zb),Ot(t.Zb)}Tt=0},e:function(){var t=Tt;if(!t)return se=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return se=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;iUt(r)));else if(T)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ft.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Bt(t)),o()[e>>2>>>0]=t.getUTCSeconds(),o()[e+4>>2>>>0]=t.getUTCMinutes(),o()[e+8>>2>>>0]=t.getUTCHours(),o()[e+12>>2>>>0]=t.getUTCDate(),o()[e+16>>2>>>0]=t.getUTCMonth(),o()[e+20>>2>>>0]=t.getUTCFullYear()-1900,o()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,o()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Bt(t)),o()[e>>2>>>0]=t.getSeconds(),o()[e+4>>2>>>0]=t.getMinutes(),o()[e+8>>2>>>0]=t.getHours(),o()[e+12>>2>>>0]=t.getDate(),o()[e+16>>2>>>0]=t.getMonth(),o()[e+20>>2>>>0]=t.getFullYear()-1900,o()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;o()[e+28>>2>>>0]=r,o()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),o()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(o()[t+20>>2>>>0]+1900,o()[t+16>>2>>>0],o()[t+12>>2>>>0],o()[t+8>>2>>>0],o()[t+4>>2>>>0],o()[t>>2>>>0],0),n=o()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),s=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=i.getTimezoneOffset(),u=Math.min(a,s);return 0>n?o()[t+32>>2>>>0]=Number(s!=a&&u==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,o()[t+28>>2>>>0]=n,o()[t>>2>>>0]=e.getSeconds(),o()[t+4>>2>>>0]=e.getMinutes(),o()[t+8>>2>>>0]=e.getHours(),o()[t+12>>2>>>0]=e.getDate(),o()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Vt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Ht(e,n,r))},y:function(){ot("")},U:function(){if(!x&&!v){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";_t||(_t={}),_t[t]||(_t[t]=1,x&&(t="warning: "+t),P(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){i().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return x?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Yt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:de[t]).apply(null,Yt)},qa:function(t){var e=i().length;if((t>>>=0)<=e||4294901760=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var o=Math;r=Math.max(t,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);t:{try{$.grow(o-F.byteLength+65535>>>16),H($.buffer);var s=1;break t}catch(t){}s=void 0}if(s)return!0}return!1},Na:function(){throw"unwind"},Ga:Jt,Ha:Qt,J:pt,I:te,S:ee,ga:ne,R:oe,d:function(){return se},na:function t(r,i){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(x)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>ot("randomDevice")}());for(var o=0;o>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ae();try{return yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ae();try{return yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var i=Ae();try{return yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,i){var o=Ae();try{return yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,i,o){var s=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,i,o){var s=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,i,o,s){var a=Ae();try{return yt(t)(e,n,r,i,o,s)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,i,o,s,a){var u=Ae();try{return yt(t)(e,n,r,i,o,s,a)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,i,o,s,a,u,l,c,d){var h=Ae();try{return yt(t)(e,n,r,i,o,s,a,u,l,c,d)}catch(t){if(Ee(h),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,i,o,s,a){var u=Ae();try{return Re(t,e,n,r,i,o,s,a)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,i,o,s){var a=Ae();try{return $e(t,e,n,r,i,o,s)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,i){var o=Ae();try{return ze(t,e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var i=Ae();try{return Ne(t,e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ae();try{return De(t)}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ae();try{return Le(t,e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ae();try{return Ce(t,e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ae();try{yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ae();try{yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ae();try{yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,i){var o=Ae();try{yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,i,o){var s=Ae();try{yt(t)(e,n,r,i,o)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,i,o,s){var a=Ae();try{yt(t)(e,n,r,i,o,s)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,i,o,s,a){var u=Ae();try{yt(t)(e,n,r,i,o,s,a)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,i,o,s,a,u){var l=Ae();try{yt(t)(e,n,r,i,o,s,a,u)}catch(t){if(Ee(l),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,i,o,s,a,u,l,c){var d=Ae();try{yt(t)(e,n,r,i,o,s,a,u,l,c)}catch(t){if(Ee(d),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,i,o,s,a,u,l,c,d,h,p,f,g){var m=Ae();try{yt(t)(e,n,r,i,o,s,a,u,l,c,d,h,p,f,g)}catch(t){if(Ee(m),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,i,o,s,a){var u=Ae();try{Fe(t,e,n,r,i,o,s,a)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,i,o,s,a,u,l,c,d){var h=Ae();try{je(t,e,n,r,i,o,s,a,u,l,c,d)}catch(t){if(Ee(h),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,i,o){var s=Ae();try{Me(t,e,n,r,i,o)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:$||u.wasmMemory,G:function(t){se=t},la:ce,z:function(t,e,n,r){return ce(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ft.qc.push(u.asm.sb),X=u.asm.ub,K.unshift(u.asm.Va),C=e,T||(nt--,u.monitorRunDependencies&&u.monitorRunDependencies(nt),0==nt&&(null!==rt&&(clearInterval(rt),rt=null),it&&(t=it,it=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!I&&(w||v)){if("function"==typeof fetch&&!et.startsWith("file://"))return fetch(et,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+et+"'";return t.arrayBuffer()})).catch((function(){return at()}));if(h)return new Promise((function(t,e){h(et,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return at()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){P("failed to asynchronously prepare wasm: "+t),ot(t)}))}var r={a:he};if(T||(nt++,u.monitorRunDependencies&&u.monitorRunDependencies(nt)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return P("Module.instantiateWasm callback failed with error: "+t),!1}(I||"function"!=typeof WebAssembly.instantiateStreaming||st()||et.startsWith("file://")||x||"function"!=typeof fetch?n(e):fetch(et,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return P("wasm streaming compile failed: "+t),P("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(c)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var pe=u._pthread_self=function(){return(pe=u._pthread_self=u.asm.ob).apply(null,arguments)},fe=u._malloc=function(){return(fe=u._malloc=u.asm.pb).apply(null,arguments)},ge=u._free=function(){return(ge=u._free=u.asm.qb).apply(null,arguments)},me=u._fflush=function(){return(me=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var be=u.___funcs_on_exit=function(){return(be=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ye=u.__emscripten_thread_init=function(){return(ye=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var _e,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},ve=u.__emscripten_proxy_execute_task_queue=function(){return(ve=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},xe=u.__emscripten_thread_free_data=function(){return(xe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Te=u.__emscripten_thread_exit=function(){return(Te=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Oe=u._emscripten_stack_set_limits=function(){return(Oe=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ae=u.stackSave=function(){return(Ae=u.stackSave=u.asm.Db).apply(null,arguments)},Ee=u.stackRestore=function(){return(Ee=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ie=u.stackAlloc=function(){return(Ie=u.stackAlloc=u.asm.Fb).apply(null,arguments)},ke=u.___cxa_can_catch=function(){return(ke=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Pe=u.___cxa_is_pointer_type=function(){return(Pe=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},De=u.dynCall_j=function(){return(De=u.dynCall_j=u.asm.Ib).apply(null,arguments)},$e=u.dynCall_iiiiij=function(){return($e=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},Ce=u.dynCall_jii=function(){return(Ce=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Fe=u.dynCall_viiiiij=function(){return(Fe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Me=u.dynCall_vjji=function(){return(Me=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},je=u.dynCall_viiijjjii=function(){return(je=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ne=u.dynCall_iij=function(){return(Ne=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},Le=u.dynCall_ji=function(){return(Le=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},Re=u.dynCall_iiiiiij=function(){return(Re=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},ze=u.dynCall_iiij=function(){return(ze=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function Ue(){function t(){if(!_e&&(_e=!0,u.calledRun=!0,!z)&&(T||gt(K),l(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!T)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();J.unshift(t)}gt(J)}}if(!(0{var r,i=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,i,o;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){i=t,o=e}));var s,a,u,l,c,d,h=Object.assign({},e),p="./this.program",f=(t,e)=>{throw e},g="object"==typeof window,m="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=m?n(908).dirname(y)+"/":"//",d=()=>{c||(l=n(1384),c=n(908))},s=function(t,e){return d(),t=c.normalize(t),l.readFileSync(t,e?void 0:"utf8")},u=t=>((t=s(t,!0)).buffer||(t=new Uint8Array(t)),t),a=(t,e,n)=>{d(),t=c.normalize(t),l.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(x||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},m&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),a=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var _,w=e.print||console.log.bind(console),v=e.printErr||console.warn.bind(console);Object.assign(e,h),h=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(f=e.quit),e.wasmBinary&&(_=e.wasmBinary);var x=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&W("no native wasm support detected");var T,S,O,A,E,I,k=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|s:(7&i)<<18|o<<12|s<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function $(t,e){return(t>>>=0)?D(A,t,e):""}function C(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(n>=r)break;e[n++>>>0]=s}else{if(2047>=s){if(n+1>=r)break;e[n++>>>0]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;e[n++>>>0]=224|s>>12}else{if(n+3>=r)break;e[n++>>>0]=240|s>>18,e[n++>>>0]=128|s>>12&63}e[n++>>>0]=128|s>>6&63}e[n++>>>0]=128|63&s}}return e[n>>>0]=0,n-i}function F(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function M(){var t=T.buffer;S=t,e.HEAP8=O=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=A=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=I=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var j,N=[],L=[],R=[],z=[],U=0;function B(){var t=e.preRun.shift();N.unshift(t)}var V,G=0,q=null,H=null;function W(t){throw e.onAbort&&e.onAbort(t),v(t="Aborted("+t+")"),k=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),o(t),t}function X(){return V.startsWith("data:application/octet-stream;base64,")}if(V="ort-wasm.wasm",!X()){var Y=V;V=e.locateFile?e.locateFile(Y,y):y+Y}function K(){var t=V;try{if(t==V&&_)return new Uint8Array(_);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function Z(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function J(t){for(;0>2>>>0]=t},this.Eb=function(){return I[this.zb+4>>2>>>0]},this.Sb=function(t){I[this.zb+8>>2>>>0]=t},this.Wb=function(){return I[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){O[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=O[this.zb+12>>0>>>0]},this.Jb=function(t){O[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=O[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){I[this.zb+16>>2>>>0]=t},this.Ob=function(){return I[this.zb+16>>2>>>0]},this.Qb=function(){if(It(this.Eb()))return I[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function rt(t){return wt(new nt(t).zb)}var it=[];function ot(t){var e=it[t];return e||(t>=it.length&&(it.length=t+1),it[t]=e=j.get(t)),e}function st(t){var e=F(t)+1,n=_t(e);return n&&C(t,O,n,e),n}var at={};function ut(){if(!lt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var n=[];for(t in e)n.push(t+"="+e[t]);lt=n}return lt}var lt,ct=[null,[],[]];function dt(t,e){var n=ct[t];0===e||10===e?((1===t?w:v)(D(n,0)),n.length=0):n.push(e)}var ht=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ft=[31,29,31,30,31,30,31,31,30,31,30,31],gt=[31,28,31,30,31,30,31,31,30,31,30,31];function mt(t,e,n,r){function i(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=a(new Date(t.getFullYear(),0,4)),n=a(n),0>=s(e,t)?0>=s(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var l=E[r+40>>2>>>0];for(var c in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:l?$(l):""},n=$(n),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),l[c]);var d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(c in l={"%a":function(t){return d[t.Ab].substring(0,3)},"%A":function(t){return d[t.Ab]},"%b":function(t){return h[t.Hb].substring(0,3)},"%B":function(t){return h[t.Hb]},"%C":function(t){return o((t.Cb+1900)/100|0,2)},"%d":function(t){return o(t.Kb,2)},"%e":function(t){return i(t.Kb,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return o(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return o(t.$b,2)},"%t":function(){return"\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return o(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return o(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return o(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),l)n.includes(c)&&(n=n.replace(new RegExp(c,"g"),l[c](r)));return c=function(t){var e=Array(F(t)+1);return C(t,e,0,e.length),e}(n=n.replace(/\0\0/g,"%")),c.length>e?0:(O.set(c,t>>>0),c.length-1)}var bt={a:function(t){return _t(t+24)+24},m:function(t){return(t=new nt(t)).Pb()||(t.Ib(!0),tt--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw v("Unexpected exception thrown, this is not properly supported - aborting"),k=!0,t},w:function(){Tt(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&ot(e)(t.Db),rt(t.Db)}et=0},d:function(){var t=et;if(!t)return ht=0;var e=new nt(t);e.Fb(t);var n=e.Eb();if(!n)return ht=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;i>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(I[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),a=Math.min(s,o);return 0>n?E[t+32>>2>>>0]=Number(o!=s&&a==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-i.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var i=(new Date).getFullYear(),o=new Date(i,0,1),s=new Date(i,6,1);i=o.getTimezoneOffset();var a=s.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(i,a),E[e>>2>>>0]=Number(i!=a),t=r(o),e=r(s),t=st(t),e=st(e),a>2>>>0]=t,I[n+4>>2>>>0]=e):(I[n>>2>>>0]=e,I[n+4>>2>>>0]=t)}(e,n,r))},B:function(){W("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){A.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=A.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var i=Math;r=Math.max(t,r),i=i.min.call(i,4294901760,r+(65536-r%65536)%65536);t:{try{T.grow(i-S.byteLength+65535>>>16),M();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,i){var o=e+n;for(i=I[t+4*i>>2>>>0]=o,o=0;o>0>>>0]=r.charCodeAt(o);O[i>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();I[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),I[e>>2>>>0]=r,0},ba:function(t){x||0>2>>>0],a=I[e+4>>2>>>0];e+=8;for(var u=0;u>>0]);i+=a}return I[r>>2>>>0]=i,0},c:function(){return ht},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>W("randomDevice")}());for(var i=0;i>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=St();try{return ot(t)(e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},fa:function(t,e,n){var r=St();try{return ot(t)(e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},J:function(t){var e=St();try{return ot(t)()}catch(t){if(Ot(e),t!==t+0)throw t;Tt(1,0)}},e:function(t,e){var n=St();try{return ot(t)(e)}catch(t){if(Ot(n),t!==t+0)throw t;Tt(1,0)}},N:function(t,e,n){var r=St();try{return ot(t)(e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},O:function(t,e,n){var r=St();try{return ot(t)(e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},j:function(t,e,n){var r=St();try{return ot(t)(e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},o:function(t,e,n,r){var i=St();try{return ot(t)(e,n,r)}catch(t){if(Ot(i),t!==t+0)throw t;Tt(1,0)}},p:function(t,e,n,r,i){var o=St();try{return ot(t)(e,n,r,i)}catch(t){if(Ot(o),t!==t+0)throw t;Tt(1,0)}},M:function(t,e,n,r,i,o){var s=St();try{return ot(t)(e,n,r,i,o)}catch(t){if(Ot(s),t!==t+0)throw t;Tt(1,0)}},r:function(t,e,n,r,i,o){var s=St();try{return ot(t)(e,n,r,i,o)}catch(t){if(Ot(s),t!==t+0)throw t;Tt(1,0)}},v:function(t,e,n,r,i,o,s){var a=St();try{return ot(t)(e,n,r,i,o,s)}catch(t){if(Ot(a),t!==t+0)throw t;Tt(1,0)}},K:function(t,e,n,r,i,o,s,a){var u=St();try{return ot(t)(e,n,r,i,o,s,a)}catch(t){if(Ot(u),t!==t+0)throw t;Tt(1,0)}},D:function(t,e,n,r,i,o,s,a,u,l,c,d){var h=St();try{return ot(t)(e,n,r,i,o,s,a,u,l,c,d)}catch(t){if(Ot(h),t!==t+0)throw t;Tt(1,0)}},X:function(t,e,n,r,i,o,s,a){var u=St();try{return Nt(t,e,n,r,i,o,s,a)}catch(t){if(Ot(u),t!==t+0)throw t;Tt(1,0)}},V:function(t,e,n,r,i,o,s){var a=St();try{return Pt(t,e,n,r,i,o,s)}catch(t){if(Ot(a),t!==t+0)throw t;Tt(1,0)}},U:function(t,e,n,r,i){var o=St();try{return Lt(t,e,n,r,i)}catch(t){if(Ot(o),t!==t+0)throw t;Tt(1,0)}},Z:function(t,e,n,r){var i=St();try{return Mt(t,e,n,r)}catch(t){if(Ot(i),t!==t+0)throw t;Tt(1,0)}},W:function(t){var e=St();try{return kt(t)}catch(t){if(Ot(e),t!==t+0)throw t;Tt(1,0)}},Y:function(t,e){var n=St();try{return jt(t,e)}catch(t){if(Ot(n),t!==t+0)throw t;Tt(1,0)}},T:function(t,e,n){var r=St();try{return Dt(t,e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},f:function(t){var e=St();try{ot(t)()}catch(t){if(Ot(e),t!==t+0)throw t;Tt(1,0)}},q:function(t,e){var n=St();try{ot(t)(e)}catch(t){if(Ot(n),t!==t+0)throw t;Tt(1,0)}},h:function(t,e,n){var r=St();try{ot(t)(e,n)}catch(t){if(Ot(r),t!==t+0)throw t;Tt(1,0)}},da:function(t,e,n,r){var i=St();try{ot(t)(e,n,r)}catch(t){if(Ot(i),t!==t+0)throw t;Tt(1,0)}},l:function(t,e,n,r){var i=St();try{ot(t)(e,n,r)}catch(t){if(Ot(i),t!==t+0)throw t;Tt(1,0)}},t:function(t,e,n,r,i){var o=St();try{ot(t)(e,n,r,i)}catch(t){if(Ot(o),t!==t+0)throw t;Tt(1,0)}},u:function(t,e,n,r,i,o){var s=St();try{ot(t)(e,n,r,i,o)}catch(t){if(Ot(s),t!==t+0)throw t;Tt(1,0)}},x:function(t,e,n,r,i,o,s){var a=St();try{ot(t)(e,n,r,i,o,s)}catch(t){if(Ot(a),t!==t+0)throw t;Tt(1,0)}},z:function(t,e,n,r,i,o,s,a){var u=St();try{ot(t)(e,n,r,i,o,s,a)}catch(t){if(Ot(u),t!==t+0)throw t;Tt(1,0)}},ga:function(t,e,n,r,i,o,s,a,u){var l=St();try{ot(t)(e,n,r,i,o,s,a,u)}catch(t){if(Ot(l),t!==t+0)throw t;Tt(1,0)}},A:function(t,e,n,r,i,o,s,a,u,l,c){var d=St();try{ot(t)(e,n,r,i,o,s,a,u,l,c)}catch(t){if(Ot(d),t!==t+0)throw t;Tt(1,0)}},C:function(t,e,n,r,i,o,s,a,u,l,c,d,h,p,f,g){var m=St();try{ot(t)(e,n,r,i,o,s,a,u,l,c,d,h,p,f,g)}catch(t){if(Ot(m),t!==t+0)throw t;Tt(1,0)}},aa:function(t,e,n,r,i,o,s,a){var u=St();try{$t(t,e,n,r,i,o,s,a)}catch(t){if(Ot(u),t!==t+0)throw t;Tt(1,0)}},_:function(t,e,n,r,i,o,s,a,u,l,c,d){var h=St();try{Ft(t,e,n,r,i,o,s,a,u,l,c,d)}catch(t){if(Ot(h),t!==t+0)throw t;Tt(1,0)}},$:function(t,e,n,r,i,o){var s=St();try{Ct(t,e,n,r,i,o)}catch(t){if(Ot(s),t!==t+0)throw t;Tt(1,0)}},n:function(t){return t},F:function(t){ht=t},ha:mt,y:function(t,e,n,r){return mt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,T=e.asm.Ka,M(),j=e.asm.ib,L.unshift(e.asm.La),G--,e.monitorRunDependencies&&e.monitorRunDependencies(G),0==G&&(null!==q&&(clearInterval(q),q=null),H&&(t=H,H=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!_&&(g||m)){if("function"==typeof fetch&&!V.startsWith("file://"))return fetch(V,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+V+"'";return t.arrayBuffer()})).catch((function(){return K()}));if(a)return new Promise((function(t,e){a(V,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return K()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){v("failed to asynchronously prepare wasm: "+t),W(t)}))}var i={a:bt};if(G++,e.monitorRunDependencies&&e.monitorRunDependencies(G),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return v("Module.instantiateWasm callback failed with error: "+t),!1}(_||"function"!=typeof WebAssembly.instantiateStreaming||X()||V.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(V,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return v("wasm streaming compile failed: "+t),v("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(o)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var yt,_t=e._malloc=function(){return(_t=e._malloc=e.asm.eb).apply(null,arguments)},wt=e._free=function(){return(wt=e._free=e.asm.fb).apply(null,arguments)},vt=e._fflush=function(){return(vt=e._fflush=e.asm.gb).apply(null,arguments)},xt=e.___funcs_on_exit=function(){return(xt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Tt=e._setThrew=function(){return(Tt=e._setThrew=e.asm.jb).apply(null,arguments)},St=e.stackSave=function(){return(St=e.stackSave=e.asm.kb).apply(null,arguments)},Ot=e.stackRestore=function(){return(Ot=e.stackRestore=e.asm.lb).apply(null,arguments)},At=e.stackAlloc=function(){return(At=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},It=e.___cxa_is_pointer_type=function(){return(It=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},kt=e.dynCall_j=function(){return(kt=e.dynCall_j=e.asm.pb).apply(null,arguments)},Pt=e.dynCall_iiiiij=function(){return(Pt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Dt=e.dynCall_jii=function(){return(Dt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},$t=e.dynCall_viiiiij=function(){return($t=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},Ct=e.dynCall_vjji=function(){return(Ct=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Ft=e.dynCall_viiijjjii=function(){return(Ft=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Mt=e.dynCall_iij=function(){return(Mt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},jt=e.dynCall_ji=function(){return(jt=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Nt=e.dynCall_iiiiiij=function(){return(Nt=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},Lt=e.dynCall_iiij=function(){return(Lt=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Rt(){function t(){if(!yt&&(yt=!0,e.calledRun=!0,!k)){if(J(L),i(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();z.unshift(t)}J(z)}}if(!(0{"use strict";t.exports=function(t,e){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i{"use strict";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t,e,n){for(var i,o=null,s=[],a=0,u=0;e>2],i=(3&l)<<4,u=1;break;case 1:s[a++]=r[i|l>>4],i=(15&l)<<2,u=2;break;case 2:s[a++]=r[i|l>>6],s[a++]=r[63&l],u=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=r[i],s[a++]=61,1===u&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";n.decode=function(t,e,n){for(var r,o=n,a=0,u=0;u1)break;if(void 0===(l=i[l]))throw Error(s);switch(a){case 0:r=l,a=1;break;case 1:e[n++]=r<<2|(48&l)>>4,r=l,a=2;break;case 2:e[n++]=(15&r)<<4|(60&l)>>2,r=l,a=3;break;case 3:e[n++]=(3&r)<<6|l,a=0}}if(1===a)throw Error(s);return n-o},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},9211:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r{"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(t,r,i){e[0]=t,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function s(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function a(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?i:o,t.writeFloatBE=r?o:i,t.readFloatLE=r?s:a,t.readFloatBE=r?a:s}():function(){function e(t,e,n,r){var i=e<0?1:0;if(i&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((i<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((i<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((i<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,n,r)}}function s(t,e,n){var r=t(e,n),i=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=s.bind(null,i),t.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(t,r,i){e[0]=t,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function s(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function a(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?i:o,t.writeDoubleBE=r?o:i,t.readDoubleLE=r?s:a,t.readDoubleBE=r?a:s}():function(){function e(t,e,n,r,i,o){var s=r<0?1:0;if(s&&(r=-r),0===r)t(0,i,o+e),t(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))t(0,i,o+e),t(2146959360,i,o+n);else if(r>17976931348623157e292)t(0,i,o+e),t((s<<31|2146435072)>>>0,i,o+n);else{var a;if(r<22250738585072014e-324)t((a=r/5e-324)>>>0,i,o+e),t((s<<31|a/4294967296)>>>0,i,o+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(a=r*Math.pow(2,-u))>>>0,i,o+e),t((s<<31|u+1023<<20|1048576*a&1048575)>>>0,i,o+n)}}}function s(t,e,n,r,i){var o=t(r,i+e),s=t(r,i+n),a=2*(s>>31)+1,u=s>>>20&2047,l=4294967296*(1048575&s)+o;return 2047===u?l?NaN:a*(1/0):0===u?5e-324*a*l:a*Math.pow(2,u-1075)*(l+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=s.bind(null,i,0,4),t.readDoubleBE=s.bind(null,o,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:t=>{"use strict";t.exports=function(t,e,n){var r=n||8192,i=r>>>1,o=null,s=r;return function(n){if(n<1||n>i)return t(n);s+n>r&&(o=t(r),s=0);var a=e.call(o,s,s+=n);return 7&s&&(s=1+(7|s)),a}}},4997:(t,e)=>{"use strict";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r191&&r<224?o[s++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(t,e,n){for(var r,i,o=n,s=0;s>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=t.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&i),++s,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-o}},3442:(t,e)=>{"use strict";e.__esModule=!0;var n=function(){function t(e){if(!e)throw new TypeError("Invalid argument; `value` has no value.");this.value=t.EMPTY,e&&t.isGuid(e)&&(this.value=e)}return t.isGuid=function(e){var n=e.toString();return e&&(e instanceof t||t.validator.test(n))},t.create=function(){return new t([t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-"))},t.createEmpty=function(){return new t("emptyguid")},t.parse=function(e){return new t(e)},t.raw=function(){return[t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-")},t.gen=function(t){for(var e="",n=0;n{t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var i={},o={};function s(t,e){var n,r,s;return e?(s=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(n=u(t,(0|t)<0?-1:0,!0),s&&(o[t]=n),n):(s=-128<=(t|=0)&&t<128)&&(r=i[t])?r:(n=u(t,t<0?-1:0,!1),s&&(i[t]=n),n)}function a(t,e){if(isNaN(t))return e?b:m;if(e){if(t<0)return b;if(t>=p)return x}else{if(t<=-f)return T;if(t+1>=f)return v}return t<0?a(-t,e).neg():u(t%h|0,t/h|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=s,n.fromNumber=a,n.fromBits=u;var l=Math.pow;function c(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return m;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return c(t.substring(1),e,n).neg();for(var i=a(l(n,8)),o=m,s=0;s>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((o=u).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(t){return r(t)||(t=d(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(r(t)||(t=d(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(y)},S.neg=S.negate,S.add=function(t){r(t)||(t=d(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,l=t.low>>>16,c=0,h=0,p=0,f=0;return p+=(f+=o+(65535&t.low))>>>16,h+=(p+=i+l)>>>16,c+=(h+=n+a)>>>16,c+=e+s,u((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},S.subtract=function(t){return r(t)||(t=d(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return m;if(r(t)||(t=d(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return m;if(this.eq(T))return t.isOdd()?T:m;if(t.eq(T))return this.isOdd()?T:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return a(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,l=t.high>>>16,c=65535&t.high,h=t.low>>>16,p=65535&t.low,f=0,b=0,y=0,_=0;return y+=(_+=s*p)>>>16,b+=(y+=o*p)>>>16,y&=65535,b+=(y+=s*h)>>>16,f+=(b+=i*p)>>>16,b&=65535,f+=(b+=o*h)>>>16,b&=65535,f+=(b+=s*c)>>>16,f+=n*p+i*h+o*c+s*l,u((y&=65535)<<16|(_&=65535),(f&=65535)<<16|(b&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(r(t)||(t=d(t)),t.isZero())throw Error("division by zero");var n,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:m;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return b;if(t.gt(this.shru(1)))return _;o=b}else{if(this.eq(T))return t.eq(y)||t.eq(w)?T:t.eq(T)?y:(n=this.shr(1).div(t).shl(1)).eq(m)?t.isNegative()?y:w:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(T))return this.unsigned?b:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=m}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),c=s<=48?1:l(2,s-48),h=a(n),p=h.mul(t);p.isNegative()||p.gt(i);)p=(h=a(n-=c,this.unsigned)).mul(t);h.isZero()&&(h=y),o=o.add(h),i=i.sub(p)}return o},S.div=S.divide,S.modulo=function(t){return r(t)||(t=d(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t){return r(t)||(t=d(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return r(t)||(t=d(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return r(t)||(t=d(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},1446:(t,e,n)=>{"use strict";var r,i,o,s=n(2100),a=s.Reader,u=s.Writer,l=s.util,c=s.roots.default||(s.roots.default={});c.onnx=((o={}).Version=(r={},(i=Object.create(r))[r[0]="_START_VERSION"]=0,i[r[1]="IR_VERSION_2017_10_10"]=1,i[r[2]="IR_VERSION_2017_10_30"]=2,i[r[3]="IR_VERSION_2017_11_3"]=3,i[r[4]="IR_VERSION_2019_1_22"]=4,i[r[5]="IR_VERSION"]=5,i),o.AttributeProto=function(){function t(t){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.name=t.string();break;case 21:r.refAttrName=t.string();break;case 13:r.docString=t.string();break;case 20:r.type=t.int32();break;case 2:r.f=t.float();break;case 3:r.i=t.int64();break;case 4:r.s=t.bytes();break;case 5:r.t=c.onnx.TensorProto.decode(t,t.uint32());break;case 6:r.g=c.onnx.GraphProto.decode(t,t.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.i.high>>>0).toNumber())),null!=t.s&&("string"==typeof t.s?l.base64.decode(t.s,e.s=l.newBuffer(l.base64.length(t.s)),0):t.s.length&&(e.s=t.s)),null!=t.t){if("object"!=typeof t.t)throw TypeError(".onnx.AttributeProto.t: object expected");e.t=c.onnx.TensorProto.fromObject(t.t)}if(null!=t.g){if("object"!=typeof t.g)throw TypeError(".onnx.AttributeProto.g: object expected");e.g=c.onnx.GraphProto.fromObject(t.g)}if(t.floats){if(!Array.isArray(t.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");e.floats=[];for(var n=0;n>>0,t.ints[n].high>>>0).toNumber())}if(t.strings){if(!Array.isArray(t.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(e.strings=[],n=0;n>>0,t.i.high>>>0).toNumber():t.i),null!=t.s&&t.hasOwnProperty("s")&&(n.s=e.bytes===String?l.base64.encode(t.s,0,t.s.length):e.bytes===Array?Array.prototype.slice.call(t.s):t.s),null!=t.t&&t.hasOwnProperty("t")&&(n.t=c.onnx.TensorProto.toObject(t.t,e)),null!=t.g&&t.hasOwnProperty("g")&&(n.g=c.onnx.GraphProto.toObject(t.g,e)),t.floats&&t.floats.length){n.floats=[];for(var i=0;i>>0,t.ints[i].high>>>0).toNumber():t.ints[i];if(t.strings&&t.strings.length)for(n.strings=[],i=0;i>>3){case 1:r.name=t.string();break;case 2:r.type=c.onnx.TypeProto.decode(t,t.uint32());break;case 3:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!l.isString(t.name))return"name: string expected";if(null!=t.type&&t.hasOwnProperty("type")){var e=c.onnx.TypeProto.verify(t.type);if(e)return"type."+e}return null!=t.docString&&t.hasOwnProperty("docString")&&!l.isString(t.docString)?"docString: string expected":null},t.fromObject=function(t){if(t instanceof c.onnx.ValueInfoProto)return t;var e=new c.onnx.ValueInfoProto;if(null!=t.name&&(e.name=String(t.name)),null!=t.type){if("object"!=typeof t.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");e.type=c.onnx.TypeProto.fromObject(t.type)}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name="",n.type=null,n.docString=""),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.type&&t.hasOwnProperty("type")&&(n.type=c.onnx.TypeProto.toObject(t.type,e)),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),o.NodeProto=function(){function t(t){if(this.input=[],this.output=[],this.attribute=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(t.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(t.string());break;case 3:r.name=t.string();break;case 4:r.opType=t.string();break;case 7:r.domain=t.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(c.onnx.AttributeProto.decode(t,t.uint32()));break;case 6:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.input&&t.hasOwnProperty("input")){if(!Array.isArray(t.input))return"input: array expected";for(var e=0;e>>3){case 1:r.irVersion=t.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(c.onnx.OperatorSetIdProto.decode(t,t.uint32()));break;case 2:r.producerName=t.string();break;case 3:r.producerVersion=t.string();break;case 4:r.domain=t.string();break;case 5:r.modelVersion=t.int64();break;case 6:r.docString=t.string();break;case 7:r.graph=c.onnx.GraphProto.decode(t,t.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(c.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.irVersion&&t.hasOwnProperty("irVersion")&&!(l.isInteger(t.irVersion)||t.irVersion&&l.isInteger(t.irVersion.low)&&l.isInteger(t.irVersion.high)))return"irVersion: integer|Long expected";if(null!=t.opsetImport&&t.hasOwnProperty("opsetImport")){if(!Array.isArray(t.opsetImport))return"opsetImport: array expected";for(var e=0;e>>0,t.irVersion.high>>>0).toNumber())),t.opsetImport){if(!Array.isArray(t.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");e.opsetImport=[];for(var n=0;n>>0,t.modelVersion.high>>>0).toNumber())),null!=t.docString&&(e.docString=String(t.docString)),null!=t.graph){if("object"!=typeof t.graph)throw TypeError(".onnx.ModelProto.graph: object expected");e.graph=c.onnx.GraphProto.fromObject(t.graph)}if(t.metadataProps){if(!Array.isArray(t.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(e.metadataProps=[],n=0;n>>0,t.irVersion.high>>>0).toNumber():t.irVersion),null!=t.producerName&&t.hasOwnProperty("producerName")&&(n.producerName=t.producerName),null!=t.producerVersion&&t.hasOwnProperty("producerVersion")&&(n.producerVersion=t.producerVersion),null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.modelVersion&&t.hasOwnProperty("modelVersion")&&("number"==typeof t.modelVersion?n.modelVersion=e.longs===String?String(t.modelVersion):t.modelVersion:n.modelVersion=e.longs===String?l.Long.prototype.toString.call(t.modelVersion):e.longs===Number?new l.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber():t.modelVersion),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),null!=t.graph&&t.hasOwnProperty("graph")&&(n.graph=c.onnx.GraphProto.toObject(t.graph,e)),t.opsetImport&&t.opsetImport.length){n.opsetImport=[];for(var i=0;i>>3){case 1:r.key=t.string();break;case 2:r.value=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.key&&t.hasOwnProperty("key")&&!l.isString(t.key)?"key: string expected":null!=t.value&&t.hasOwnProperty("value")&&!l.isString(t.value)?"value: string expected":null},t.fromObject=function(t){if(t instanceof c.onnx.StringStringEntryProto)return t;var e=new c.onnx.StringStringEntryProto;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key="",n.value=""),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(n.value=t.value),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),o.TensorAnnotation=function(){function t(t){if(this.quantParameterTensorNames=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorName=t.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(c.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorName&&t.hasOwnProperty("tensorName")&&!l.isString(t.tensorName))return"tensorName: string expected";if(null!=t.quantParameterTensorNames&&t.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(t.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var e=0;e>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(c.onnx.NodeProto.decode(t,t.uint32()));break;case 2:r.name=t.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(c.onnx.TensorProto.decode(t,t.uint32()));break;case 10:r.docString=t.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(c.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(c.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(c.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(c.onnx.TensorAnnotation.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.node&&t.hasOwnProperty("node")){if(!Array.isArray(t.node))return"node: array expected";for(var e=0;e>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.dims[n].high>>>0).toNumber())}if(null!=t.dataType&&(e.dataType=0|t.dataType),null!=t.segment){if("object"!=typeof t.segment)throw TypeError(".onnx.TensorProto.segment: object expected");e.segment=c.onnx.TensorProto.Segment.fromObject(t.segment)}if(t.floatData){if(!Array.isArray(t.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(e.floatData=[],n=0;n>>0,t.int64Data[n].high>>>0).toNumber())}if(null!=t.name&&(e.name=String(t.name)),null!=t.docString&&(e.docString=String(t.docString)),null!=t.rawData&&("string"==typeof t.rawData?l.base64.decode(t.rawData,e.rawData=l.newBuffer(l.base64.length(t.rawData)),0):t.rawData.length&&(e.rawData=t.rawData)),t.externalData){if(!Array.isArray(t.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(e.externalData=[],n=0;n>>0,t.uint64Data[n].high>>>0).toNumber(!0))}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),e.defaults&&(n.dataType=0,n.segment=null,n.name="",e.bytes===String?n.rawData="":(n.rawData=[],e.bytes!==Array&&(n.rawData=l.newBuffer(n.rawData))),n.docString="",n.dataLocation=e.enums===String?"DEFAULT":0),t.dims&&t.dims.length){n.dims=[];for(var r=0;r>>0,t.dims[r].high>>>0).toNumber():t.dims[r]}if(null!=t.dataType&&t.hasOwnProperty("dataType")&&(n.dataType=t.dataType),null!=t.segment&&t.hasOwnProperty("segment")&&(n.segment=c.onnx.TensorProto.Segment.toObject(t.segment,e)),t.floatData&&t.floatData.length)for(n.floatData=[],r=0;r>>0,t.int64Data[r].high>>>0).toNumber():t.int64Data[r];if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.rawData&&t.hasOwnProperty("rawData")&&(n.rawData=e.bytes===String?l.base64.encode(t.rawData,0,t.rawData.length):e.bytes===Array?Array.prototype.slice.call(t.rawData):t.rawData),t.doubleData&&t.doubleData.length)for(n.doubleData=[],r=0;r>>0,t.uint64Data[r].high>>>0).toNumber(!0):t.uint64Data[r];if(null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),t.externalData&&t.externalData.length)for(n.externalData=[],r=0;r>>3){case 1:r.begin=t.int64();break;case 2:r.end=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.begin&&t.hasOwnProperty("begin")&&!(l.isInteger(t.begin)||t.begin&&l.isInteger(t.begin.low)&&l.isInteger(t.begin.high))?"begin: integer|Long expected":null!=t.end&&t.hasOwnProperty("end")&&!(l.isInteger(t.end)||t.end&&l.isInteger(t.end.low)&&l.isInteger(t.end.high))?"end: integer|Long expected":null},t.fromObject=function(t){if(t instanceof c.onnx.TensorProto.Segment)return t;var e=new c.onnx.TensorProto.Segment;return null!=t.begin&&(l.Long?(e.begin=l.Long.fromValue(t.begin)).unsigned=!1:"string"==typeof t.begin?e.begin=parseInt(t.begin,10):"number"==typeof t.begin?e.begin=t.begin:"object"==typeof t.begin&&(e.begin=new l.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber())),null!=t.end&&(l.Long?(e.end=l.Long.fromValue(t.end)).unsigned=!1:"string"==typeof t.end?e.end=parseInt(t.end,10):"number"==typeof t.end?e.end=t.end:"object"==typeof t.end&&(e.end=new l.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults){if(l.Long){var r=new l.Long(0,0,!1);n.begin=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.begin=e.longs===String?"0":0;l.Long?(r=new l.Long(0,0,!1),n.end=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.end=e.longs===String?"0":0}return null!=t.begin&&t.hasOwnProperty("begin")&&("number"==typeof t.begin?n.begin=e.longs===String?String(t.begin):t.begin:n.begin=e.longs===String?l.Long.prototype.toString.call(t.begin):e.longs===Number?new l.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber():t.begin),null!=t.end&&t.hasOwnProperty("end")&&("number"==typeof t.end?n.end=e.longs===String?String(t.end):t.end:n.end=e.longs===String?l.Long.prototype.toString.call(t.end):e.longs===Number?new l.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber():t.end),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),t.DataLocation=function(){var t={},e=Object.create(t);return e[t[0]="DEFAULT"]=0,e[t[1]="EXTERNAL"]=1,e}(),t}(),o.TensorShapeProto=function(){function t(t){if(this.dim=[],t)for(var e=Object.keys(t),n=0;n>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(c.onnx.TensorShapeProto.Dimension.decode(t,t.uint32()))):t.skipType(7&i)}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.dim&&t.hasOwnProperty("dim")){if(!Array.isArray(t.dim))return"dim: array expected";for(var e=0;e>>3){case 1:r.dimValue=t.int64();break;case 2:r.dimParam=t.string();break;case 3:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e={};if(null!=t.dimValue&&t.hasOwnProperty("dimValue")&&(e.value=1,!(l.isInteger(t.dimValue)||t.dimValue&&l.isInteger(t.dimValue.low)&&l.isInteger(t.dimValue.high))))return"dimValue: integer|Long expected";if(null!=t.dimParam&&t.hasOwnProperty("dimParam")){if(1===e.value)return"value: multiple values";if(e.value=1,!l.isString(t.dimParam))return"dimParam: string expected"}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!l.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof c.onnx.TensorShapeProto.Dimension)return t;var e=new c.onnx.TensorShapeProto.Dimension;return null!=t.dimValue&&(l.Long?(e.dimValue=l.Long.fromValue(t.dimValue)).unsigned=!1:"string"==typeof t.dimValue?e.dimValue=parseInt(t.dimValue,10):"number"==typeof t.dimValue?e.dimValue=t.dimValue:"object"==typeof t.dimValue&&(e.dimValue=new l.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber())),null!=t.dimParam&&(e.dimParam=String(t.dimParam)),null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.dimValue&&t.hasOwnProperty("dimValue")&&("number"==typeof t.dimValue?n.dimValue=e.longs===String?String(t.dimValue):t.dimValue:n.dimValue=e.longs===String?l.Long.prototype.toString.call(t.dimValue):e.longs===Number?new l.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber():t.dimValue,e.oneofs&&(n.value="dimValue")),null!=t.dimParam&&t.hasOwnProperty("dimParam")&&(n.dimParam=t.dimParam,e.oneofs&&(n.value="dimParam")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),t}(),o.TypeProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorType=c.onnx.TypeProto.Tensor.decode(t,t.uint32());break;case 6:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorType&&t.hasOwnProperty("tensorType")){var e=c.onnx.TypeProto.Tensor.verify(t.tensorType);if(e)return"tensorType."+e}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!l.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof c.onnx.TypeProto)return t;var e=new c.onnx.TypeProto;if(null!=t.tensorType){if("object"!=typeof t.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");e.tensorType=c.onnx.TypeProto.Tensor.fromObject(t.tensorType)}return null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.tensorType&&t.hasOwnProperty("tensorType")&&(n.tensorType=c.onnx.TypeProto.Tensor.toObject(t.tensorType,e),e.oneofs&&(n.value="tensorType")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t.Tensor=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.elemType=t.int32();break;case 2:r.shape=c.onnx.TensorShapeProto.decode(t,t.uint32());break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.elemType&&t.hasOwnProperty("elemType")&&!l.isInteger(t.elemType))return"elemType: integer expected";if(null!=t.shape&&t.hasOwnProperty("shape")){var e=c.onnx.TensorShapeProto.verify(t.shape);if(e)return"shape."+e}return null},t.fromObject=function(t){if(t instanceof c.onnx.TypeProto.Tensor)return t;var e=new c.onnx.TypeProto.Tensor;if(null!=t.elemType&&(e.elemType=0|t.elemType),null!=t.shape){if("object"!=typeof t.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");e.shape=c.onnx.TensorShapeProto.fromObject(t.shape)}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.elemType=0,n.shape=null),null!=t.elemType&&t.hasOwnProperty("elemType")&&(n.elemType=t.elemType),null!=t.shape&&t.hasOwnProperty("shape")&&(n.shape=c.onnx.TensorShapeProto.toObject(t.shape,e)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),t}(),o.OperatorSetIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.domain=t.string();break;case 2:r.version=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.domain&&t.hasOwnProperty("domain")&&!l.isString(t.domain)?"domain: string expected":null!=t.version&&t.hasOwnProperty("version")&&!(l.isInteger(t.version)||t.version&&l.isInteger(t.version.low)&&l.isInteger(t.version.high))?"version: integer|Long expected":null},t.fromObject=function(t){if(t instanceof c.onnx.OperatorSetIdProto)return t;var e=new c.onnx.OperatorSetIdProto;return null!=t.domain&&(e.domain=String(t.domain)),null!=t.version&&(l.Long?(e.version=l.Long.fromValue(t.version)).unsigned=!1:"string"==typeof t.version?e.version=parseInt(t.version,10):"number"==typeof t.version?e.version=t.version:"object"==typeof t.version&&(e.version=new l.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults)if(n.domain="",l.Long){var r=new l.Long(0,0,!1);n.version=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.version=e.longs===String?"0":0;return null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.version&&t.hasOwnProperty("version")&&("number"==typeof t.version?n.version=e.longs===String?String(t.version):t.version:n.version=e.longs===String?l.Long.prototype.toString.call(t.version):e.longs===Number?new l.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber():t.version),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),o),t.exports=c},2100:(t,e,n)=>{"use strict";t.exports=n(9482)},9482:(t,e,n)=>{"use strict";var r=e;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=i,i()},1408:(t,e,n)=>{"use strict";t.exports=u;var r,i=n(9693),o=i.LongBits,s=i.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var l,c="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},d=function(){return i.Buffer?function(t){return(u.create=function(t){return i.Buffer.isBuffer(t)?new r(t):c(t)})(t)}:c};function h(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function p(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}u.create=d(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return l}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)},u.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){r=t,u.create=d(),r._configure();var e=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return h.call(this)[e](!1)},uint64:function(){return h.call(this)[e](!0)},sint64:function(){return h.call(this).zzDecode()[e](!1)},fixed64:function(){return f.call(this)[e](!0)},sfixed64:function(){return f.call(this)[e](!1)}})}},593:(t,e,n)=>{"use strict";t.exports=o;var r=n(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(t){r.call(this,t)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},5054:t=>{"use strict";t.exports={}},5994:(t,e,n)=>{"use strict";e.Service=n(7948)},7948:(t,e,n)=>{"use strict";t.exports=i;var r=n(9693);function i(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function t(e,n,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return r.asPromise(t,a,e,n,i,o);if(a.rpcImpl)try{return a.rpcImpl(e,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(t,n){if(t)return a.emit("error",t,e),s(t);if(null!==n){if(!(n instanceof i))try{n=i[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return a.emit("error",t,e),s(t)}return a.emit("data",n,e),s(null,n)}a.end(!0)}))}catch(t){return a.emit("error",t,e),void setTimeout((function(){s(t)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(t,e,n)=>{"use strict";t.exports=i;var r=n(9693);function i(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(t){if("number"==typeof t)return i.fromNumber(t);if(r.isString(t)){if(!r.Long)return i.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new i(t.low>>>0,t.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;i.fromHash=function(t){return t===s?o:new i((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},9693:function(t,e,n){"use strict";var r=e;function i(t,e,n){for(var r=Object.keys(e),i=0;i0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=i,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(t){for(var e={},n=0;n-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n{"use strict";t.exports=d;var r,i=n(9693),o=i.LongBits,s=i.base64,a=i.utf8;function u(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function l(){}function c(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function d(){this.len=0,this.head=new u(l,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function p(t,e,n){e[n]=255&t}function f(t,e){this.len=t,this.next=void 0,this.val=e}function g(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function m(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}d.create=h(),d.alloc=function(t){return new i.Array(t)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(t,e,n){return this.tail=this.tail.next=new u(t,e,n),this.len+=e,this},f.prototype=Object.create(u.prototype),f.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},d.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new f((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},d.prototype.int32=function(t){return t<0?this._push(g,10,o.fromNumber(t)):this.uint32(t)},d.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},d.prototype.uint64=function(t){var e=o.from(t);return this._push(g,e.length(),e)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(g,e.length(),e)},d.prototype.bool=function(t){return this._push(p,1,t?1:0)},d.prototype.fixed32=function(t){return this._push(m,4,t>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(t){var e=o.from(t);return this._push(m,4,e.lo)._push(m,4,e.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(t){return this._push(i.float.writeFloatLE,4,t)},d.prototype.double=function(t){return this._push(i.float.writeDoubleLE,8,t)};var b=i.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r>>0;if(!e)return this._push(p,1,0);if(i.isString(t)){var n=d.alloc(e=s.length(t));s.decode(t,n,0),t=n}return this.uint32(e)._push(b,e,t)},d.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(l,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(l,0,0),this.len=0),this},d.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},d.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},d._configure=function(t){r=t,d.create=h(),r._configure()}},3155:(t,e,n)=>{"use strict";t.exports=o;var r=n(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(){r.call(this)}function s(t,e,n){t.length<40?i.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=i.Buffer.byteLength(t);return this.uint32(e),e&&this._push(s,e,t),this},o._configure()},7714:(t,e,n)=>{"use strict";e.R=void 0;const r=n(6919),i=n(7448);e.R=new class{async init(){}async createSessionHandler(t,e){const n=new r.Session(e);return await n.loadModel(t),new i.OnnxjsSessionHandler(n)}}},4200:(t,e,n)=>{"use strict";e.c8=e.rX=void 0;const r=n(1670),i=n(5381),o=n(2157),s=n(2306);e.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const t="undefined"==typeof navigator?(0,i.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,o.initWasm)()}async createSessionHandler(t,e){const n=new s.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(t,e),Promise.resolve(n)}}},6018:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(1670),e);const o=n(1670);{const t=n(7714).R;(0,o.registerBackend)("webgl",t,-10)}{const t=n(4200).c8;(0,o.registerBackend)("cpu",t,10),(0,o.registerBackend)("wasm",t,10),(0,o.registerBackend)("xnnpack",t,9)}},246:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAttributeWithCacheKey=void 0;class n{constructor(t){Object.assign(this,t)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((t=>`${this[t]}`)).join(";")),this._cacheKey}}e.createAttributeWithCacheKey=t=>new n(t)},7778:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;const r=n(1446),i=n(9395),o=n(9162),s=n(2517);var a=i.onnxruntime.experimental.fbs;class u{constructor(t){if(this._attributes=new Map,null!=t){for(const e of t)e instanceof r.onnx.AttributeProto?this._attributes.set(e.name,[u.getValue(e),u.getType(e)]):e instanceof a.Attribute&&this._attributes.set(e.name(),[u.getValue(e),u.getType(e)]);if(this._attributes.sizeo.Tensor.fromProto(t)));if(t instanceof a.Attribute)return n.map((t=>o.Tensor.fromOrtTensor(t)))}if(e===r.onnx.AttributeProto.AttributeType.STRING&&t instanceof r.onnx.AttributeProto){const t=n;return(0,s.decodeUtf8String)(t)}return e===r.onnx.AttributeProto.AttributeType.STRINGS&&t instanceof r.onnx.AttributeProto?n.map(s.decodeUtf8String):n}static getValueNoCheck(t){return t instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(t):this.getValueNoCheckFromOrtFormat(t)}static getValueNoCheckFromOnnxFormat(t){switch(t.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return t.f;case r.onnx.AttributeProto.AttributeType.INT:return t.i;case r.onnx.AttributeProto.AttributeType.STRING:return t.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return t.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return t.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return t.floats;case r.onnx.AttributeProto.AttributeType.INTS:return t.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return t.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return t.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return t.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t.type]}`)}}static getValueNoCheckFromOrtFormat(t){switch(t.type()){case a.AttributeType.FLOAT:return t.f();case a.AttributeType.INT:return t.i();case a.AttributeType.STRING:return t.s();case a.AttributeType.TENSOR:return t.t();case a.AttributeType.GRAPH:return t.g();case a.AttributeType.FLOATS:return t.floatsArray();case a.AttributeType.INTS:{const e=[];for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveBackend=e.backend=void 0;const r=n(5038),i=new Map;async function o(t){const n=e.backend;if(void 0!==n[t]&&function(t){const e=t;return"initialize"in e&&"function"==typeof e.initialize&&"createSessionHandler"in e&&"function"==typeof e.createSessionHandler&&"dispose"in e&&"function"==typeof e.dispose}(n[t])){const e=n[t];let r=e.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return i.set(t,e),e}}e.backend={webgl:new r.WebGLBackend},e.resolveBackend=async function t(e){if(!e)return t(["webgl"]);{const t="string"==typeof e?[e]:e;for(const e of t){const t=i.get(e);if(t)return t;const n=await o(e);if(n)return n}}throw new Error("no available backend to use")}},5038:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLBackend=void 0;const r=n(1670),i=n(6231),o=n(6416),s=n(7305);e.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(t){r.env.webgl.contextId=t}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(t){r.env.webgl.matmulMaxBatchSize=t}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(t){r.env.webgl.textureCacheMode=t}get pack(){return r.env.webgl.pack}set pack(t){r.env.webgl.pack=t}get async(){return r.env.webgl.async}set async(t){r.env.webgl.async=t}initialize(){try{return this.glContext=(0,s.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),i.Logger.setWithEnv(r.env),i.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(t){return i.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${t}`),!1}}createSessionHandler(t){return new o.WebGLSessionHandler(this,t)}dispose(){this.glContext.dispose()}}},5107:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CoordsGlslLib=void 0;const r=n(2517),i=n(8520),o=n(5060),s=n(7859),a=n(9390);class u extends i.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new i.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new i.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const t=this.context.outputTextureLayout;return t.isPacked?this.getPackedOutputSamplingSnippet(t):this.getUnpackedOutputSamplingSnippet(t)}getPackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},s="getOutputCoords";switch(e.length){case 0:r[s]=this.getOutputScalarCoords();break;case 1:r[s]=this.getOutputPacked1DCoords(e,n);break;case 2:r[s]=this.getOutputPacked2DCoords(e,n);break;case 3:r[s]=this.getOutputPacked3DCoords(e,n);break;default:r[s]=this.getOutputPackedNDCoords(e,n)}const a=`\n void setOutput(vec4 val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new i.GlslLibRoutine(a),r}getUnpackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},s="getOutputCoords";switch(e.length){case 0:r[s]=this.getOutputScalarCoords();break;case 1:r[s]=this.getOutputUnpacked1DCoords(e,n);break;case 2:r[s]=this.getOutputUnpacked2DCoords(e,n);break;case 3:r[s]=this.getOutputUnpacked3DCoords(e,n);break;case 4:r[s]=this.getOutputUnpacked4DCoords(e,n);break;case 5:r[s]=this.getOutputUnpacked5DCoords(e,n);break;case 6:r[s]=this.getOutputUnpacked6DCoords(e,n);break;default:throw new Error(`Unsupported output dimensionality: ${e.length}`)}const a=`\n void setOutput(float val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new i.GlslLibRoutine(a),r}getOutputScalarCoords(){return new i.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(t,e){const n=e;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new i.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new i.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new i.GlslLibRoutine(r))}getOutputPacked2DCoords(t,e){let n="";if(r.ArrayUtil.arraysEqual(t,e))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${e[0]}, ${e[1]}));\n }\n `,new i.GlslLibRoutine(n);const o=e,s=Math.ceil(t[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${o[0]}, ${o[1]}));\n\n int index = resTexRC.y * ${o[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${s}) * 2;\n int c = 2 * (index / ${s});\n\n return ivec2(r, c);\n }\n `,new i.GlslLibRoutine(n)}getOutputPacked3DCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[2]/2),o=r*Math.ceil(t[1]/2),s=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${o};\n index -= b * ${o};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new i.GlslLibRoutine(s)}getOutputPackedNDCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[t.length-1]/2),o=r*Math.ceil(t[t.length-2]/2);let s=o,a="",u="b, r, c";for(let e=2;e=0;--e)o[e]=o[e+1]*t[e+1];const s=["r","c","d"],a=o.map(((t,e)=>`int ${s[e]} = index / ${t}; ${e===o.length-1?`int ${s[e+1]} = index - ${s[e]} * ${t}`:`index -= ${s[e]} * ${t}`};`)).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${a}\n return ivec3(r, c, d);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked4DCoords(t,e){let n="";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const s=["r","c","d","d2"],a=o.map(((t,e)=>`int ${s[e]} = index / ${t}; ${e===o.length-1?`int ${s[e+1]} = index - ${s[e]} * ${t}`:`index -= ${s[e]} * ${t}`};`)).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${a}\n return ivec4(r, c, d, d2);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked5DCoords(t,e){let n="";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const s=["r","c","d","d2","d3"],a=o.map(((t,e)=>`int ${s[e]} = index / ${t}; ${e===o.length-1?`int ${s[e+1]} = index - ${s[e]} * ${t}`:`index -= ${s[e]} * ${t}`};`)).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${a}\n return ivec5(r, c, d, d2, d3);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked6DCoords(t,e){let n="";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const s=["r","c","d","d2","d3","d4"],a=o.map(((t,e)=>`int ${s[e]} = index / ${t}; ${e===o.length-1?`int ${s[e+1]} = index - ${s[e]} * ${t}`:`index -= ${s[e]} * ${t}`};`)).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\n ${a}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new i.GlslLibRoutine(n)}getCommonUtilFuncs(){const t={};let e="uvFromFlat";t[e]=new i.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),e="packedUVfrom1D",t[e]=new i.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="packedUVfrom2D",t[e]=new i.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="packedUVfrom3D",t[e]=new i.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="sampleTexture";const n=(0,o.getGlsl)(this.context.glContext.version);return t[e]=new i.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),t}getInputsSamplingSnippets(){const t={},e=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach(((n,r)=>{const i=this.context.inputTextureLayouts[r],o=(0,a.generateShaderFuncNameFromInputSamplerName)(n);i.isPacked?t[o]=this.getPackedSamplerFromInput(o,n,i):t[o]=this.getUnpackedSamplerFromInput(o,n,i);const s=(0,a.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);i.unpackedShape.length<=e.unpackedShape.length&&(i.isPacked?t[s]=this.getPackedSamplerAtOutputCoords(s,i,e,n):t[s]=this.getUnpackedSamplerAtOutputCoords(s,i,e,n))})),t}getPackedSamplerAtOutputCoords(t,e,n,o){const s=e.unpackedShape,u=n.unpackedShape,l=o,c=(0,a.generateShaderFuncNameFromInputSamplerName)(l),d=s.length,h=u.length,p=r.BroadcastUtil.getBroadcastDims(s,u),f=(0,a.getCoordsDataType)(h),g=h-d;let m;const b=(0,a.getGlChannels)();m=0===d?"":h<2&&p.length>=1?"coords = 0;":p.map((t=>`coords.${b[t+g]} = 0;`)).join("\n");let y="";y=h<2&&d>0?"coords":s.map(((t,e)=>`coords.${b[e+g]}`)).join(", ");let _="return outputValue;";const w=1===r.ShapeUtil.size(s),v=1===r.ShapeUtil.size(u);if(1!==d||w||v){if(w&&!v)_=1===h?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(p.length){const t=d-2,e=d-1;p.indexOf(t)>-1&&p.indexOf(e)>-1?_="return vec4(outputValue.x);":p.indexOf(t)>-1?_="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":p.indexOf(e)>-1&&(_="return vec4(outputValue.xx, outputValue.zz);")}}else _="\n return vec4(outputValue.xy, outputValue.xy);\n ";const x=`\n vec4 ${t}() {\n ${f} coords = getOutputCoords();\n \n int lastDim = coords.${b[h-1]};\n coords.${b[h-1]} = coords.${b[h-2]};\n coords.${b[h-2]} = lastDim;\n \n ${m}\n vec4 outputValue = ${c}(${y});\n ${_}\n }\n `;return new i.GlslLibRoutine(x,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(t,e,n,o){const s=[n.width,n.height],u=[e.width,e.height],l=e.unpackedShape.length,c=n.unpackedShape.length,d=e.unpackedShape,h=n.unpackedShape,p=(0,a.generateShaderFuncNameFromInputSamplerName)(o);if(l===c&&r.ArrayUtil.arraysEqual(u,s)){const e=`\n float ${t}() {\n return sampleTexture(${o}, TexCoords);\n }\n `;return new i.GlslLibRoutine(e,["coordinates.sampleTexture"])}const f=(0,a.getCoordsDataType)(c),g=r.BroadcastUtil.getBroadcastDims(d,h),m=c-l;let b;const y=(0,a.getGlChannels)();b=0===l?"":c<2&&g.length>=1?"coords = 0;":g.map((t=>`coords.${y[t+m]} = 0;`)).join("\n");let _="";_=c<2&&l>0?"coords":e.unpackedShape.map(((t,e)=>`coords.${y[e+m]}`)).join(", ");const w=`\n float ${t}() {\n ${f} coords = getOutputCoords();\n ${b}\n return ${p}(${_});\n }\n `;return new i.GlslLibRoutine(w,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(t,e,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t,e);case 1:return this.getPackedSampler1D(t,e,n);case 2:return this.getPackedSampler2D(t,e,n);case 3:return this.getPackedSampler3D(t,e,n);default:return this.getPackedSamplerND(t,e,n)}}getUnpackedSamplerFromInput(t,e,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(t,e,n);case 1:return this.getUnpackedSampler1D(t,e,n);case 2:return this.getUnpackedSampler2D(t,e,n);case 3:return this.getUnpackedSampler3D(t,e,n);case 4:return this.getUnpackedSampler4D(t,e,n);case 5:return this.getUnpackedSampler5D(t,e,n);case 6:return this.getUnpackedSampler6D(t,e,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(t,e){const n=`\n vec4 ${t}() {\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e}, halfCR);\n }\n `;return new i.GlslLibRoutine(n)}getPackedSampler1D(t,e,n){const r=[n.width,n.height],s=[r[1],r[0]],a=(0,o.getGlsl)(this.context.glContext.version),u=`vec4 ${t}(int index) {\n vec2 uv = packedUVfrom1D(\n ${s[0]}, ${s[1]}, index);\n return ${a.texture2D}(${e}, uv);\n }`;return new i.GlslLibRoutine(u,["coordinates.packedUVfrom1D"])}getPackedSampler2D(t,e,n){const s=n.unpackedShape,a=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),l=a[0],c=a[1];if(null!=a&&r.ArrayUtil.arraysEqual(s,a)){const n=`vec4 ${t}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${c}.0, ${l}.0);\n return ${u.texture2D}(${e}, uv);\n }`;return new i.GlslLibRoutine(n)}const d=a,h=Math.ceil(s[1]/2),p=`vec4 ${t}(int row, int col) {\n vec2 uv = packedUVfrom2D(${d[1]}, ${d[0]}, ${h}, row, col);\n return ${u.texture2D}(${e}, uv);\n }`;return new i.GlslLibRoutine(p,["coordinates.packedUVfrom2D"])}getPackedSampler3D(t,e,n){const r=n.unpackedShape,s=[n.width,n.height],u=[s[0],s[1]],l=(0,o.getGlsl)(this.context.glContext.version);if(1===r[0]){const o=r.slice(1),s=[1,2],u=(0,a.squeezeInputShape)(r,o),l=["b","row","col"],c=JSON.parse(JSON.stringify(n));c.unpackedShape=u;const d=this.getPackedSamplerFromInput(t,e,c),h=`${d.routineBody}\n vec4 ${t}(int b, int row, int col) {\n return ${t}(${(0,a.getSqueezedParams)(l,s)});\n } `;return new i.GlslLibRoutine(h,d.dependencies)}const c=u[0],d=u[1],h=Math.ceil(r[2]/2),p=`vec4 ${t}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${d}, ${c}, ${h*Math.ceil(r[1]/2)}, ${h}, b, row, col);\n return ${l.texture2D}(${e}, uv);}`;return new i.GlslLibRoutine(p,["coordinates.packedUVfrom3D"])}getPackedSamplerND(t,e,n){const r=n.unpackedShape,s=r.length,a=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),l=[a[0],a[1]],c=l[1],d=l[0],h=Math.ceil(r[s-1]/2);let p=h*Math.ceil(r[s-2]/2),f="int b, int row, int col",g=`b * ${p} + (row / 2) * ${h} + (col / 2)`;for(let t=2;t{const r=this.context.inputTextureLayouts[n],o=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let s=`_${e}`;t[s]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!1),[`shapeUtils.indicesToOffset${s}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),s+="_T",t[s]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!0),[`shapeUtils.indicesToOffset${s}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])})),t}getValueFromSingle(t,e,n,r,i){let s=`_${t}`;return i&&(s+="_T"),`\n float ${s}(int m[${e}]) {\n int offset = indicesToOffset${s}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords));\n return value;\n }\n `}getPackedValueFrom(t,e,n,r,i){let s=`_${t}_Pack`;return i&&(s+="_T"),`\n vec4 ${s}(int m[${e}]) {\n int offset = indicesToOffset_${t}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords);\n }\n `}}e.CoordsGlslLib=u},8520:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||(e.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",e.GlslContext=class{constructor(t,e,n,r){this.glContext=t,this.programInfo=e,this.inputTextureLayouts=n,this.outputTextureLayout=r}},e.GlslLib=class{constructor(t){this.context=t}},e.GlslLibRoutine=class{constructor(t,e){this.routineBody=t,this.dependencies=e}},e.GlslLibRoutineNode=class{constructor(t,e,n){this.name=t,this.dependencies=n||[],e&&(this.routineBody=e)}addDependency(t){t&&this.dependencies.push(t)}},e.TopologicalSortGlslRoutines=class{static returnOrderedNodes(t){if(!t||0===t.length)return[];if(1===t.length)return t;const e=new Set,n=new Set,r=new Array;return this.createOrderedNodes(t,e,n,r),r}static createOrderedNodes(t,e,n,r){for(let i=0;i0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodingGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const t=i.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${t}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const t=i.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${t}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const t=new ArrayBuffer(4),e=new Uint32Array(t),n=new Uint8Array(t);if(e[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}e.EncodingGlslLib=i},9894:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FragColorGlslLib=void 0;const r=n(8520),i=n(5060);class o extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const t=(0,i.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${t.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}e.FragColorGlslLib=o},2848:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;e.replaceInlines=function(t){const e={};let r;for(;null!==(r=n.exec(t));){const t=r[3].split(",").map((t=>{const e=t.trim().split(" ");return e&&2===e.length?{type:e[0],name:e[1]}:null})).filter((t=>null!==t));e[r[2]]={params:t,body:r[4]}}for(const n in e){const i="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),o=new RegExp(i,"gm");for(;null!==(r=o.exec(t));){const i=r[1],o=r[2],s=r[3].split(","),a=i?`${i} ${o};`:"";let u=e[n].body,l="";e[n].params.forEach(((t,e)=>{t&&(l+=`${t.type} ${t.name} = ${s[e]};\n`)})),u=`${l}\n ${u}`,u=u.replace("return",`${o} = `);const c=`\n ${a}\n {\n ${u}\n }\n `;t=t.replace(r[0],c)}}return t.replace(n,"")}},8879:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlslPreprocessor=void 0;const r=n(8520),i=n(2848),o=n(5483),s=n(5060);e.GlslPreprocessor=class{constructor(t,e,n,i){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(t,e,n,i),Object.keys(o.glslRegistry).forEach((t=>{const e=new o.glslRegistry[t](this.context);this.libs[t]=e}));const s=this.glslLibRoutineDependencyGraph;for(const t in this.libs){const e=this.libs[t].getFunctions();for(const n in e){const i=t+"."+n;let o;s[i]?(o=s[i],o.routineBody=e[n].routineBody):(o=new r.GlslLibRoutineNode(i,e[n].routineBody),s[i]=o);const a=e[n].dependencies;if(a)for(let t=0;t{const r=n.split(".")[1];-1!==t.indexOf(r)&&e.push(this.glslLibRoutineDependencyGraph[n])})),r.TopologicalSortGlslRoutines.returnOrderedNodes(e)}getUniforms(t,e){const n=[];if(t)for(const e of t)n.push(`uniform sampler2D ${e};`);if(e)for(const t of e)n.push(`uniform ${t.type} ${t.name}${t.arrayLength?`[${t.arrayLength}]`:""};`);return n.join("\n")}}},5483:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.glslRegistry=void 0;const r=n(5107),i=n(7341),o=n(9894),s=n(2655),a=n(3891);e.glslRegistry={encoding:i.EncodingGlslLib,fragcolor:o.FragColorGlslLib,vec:a.VecGlslLib,shapeUtils:s.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeUtilsGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const t=this.context.outputTextureLayout.shape.length,e={};return this.context.programInfo.inputNames.forEach(((n,i)=>{const o=this.context.inputTextureLayouts[i].unpackedShape;if(o.length<=t){const i=o.length,s=t-i,a=`bcastIndices_${n}`;let u="";for(let t=0;t{const o=this.context.inputTextureLayouts[i].shape;if(!(o.length<2||o.length>t)){const i=o.length,s=t-i,a=`bcastMatmulIndices_${n}`;let u="";for(let t=0;t{const o=this.context.inputTextureLayouts[n].shape,s=this.context.inputTextureLayouts[n].strides,a=o.length;let u=`indicesToOffset_${e}`;t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,a,s)),u=`indicesToOffset_${e}_T`,t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,a,s.slice().reverse()))})),t}static indexToOffsetSingle(t,e,n){let r="";for(let t=e-1;t>=0;--t)r+=`\n offset += indices[${t}] * ${n[t]};\n `;return`\n int ${t}(int indices[${e}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const t={};return this.context.programInfo.inputNames.forEach(((e,n)=>{const o=this.context.inputTextureLayouts[n].shape,s=this.context.inputTextureLayouts[n].strides,a=o.length;let u=`offsetToIndices_${e}`;t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,a,s)),u=`offsetToIndices_${e}_T`,t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,a,s.slice().reverse()))})),t}static offsetToIndicesSingle(t,e,n){const r=[];for(let t=0;t{const i=this.context.inputTextureLayouts[n].shape,o=i.length,s=`incrementIndices_${e}`;let a="";for(let t=0;t= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;t[s]=new r.GlslLibRoutine(u)})),t}}e.ShapeUtilsGlslLib=i},5060:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function i(t){return 1===t?n:r}e.getGlsl=i,e.getVertexShaderSource=function(t){const e=i(t);return`${e.version}\n precision highp float;\n ${e.attribute} vec3 position;\n ${e.attribute} vec2 textureCoord;\n\n ${e.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},e.getFragShaderPreamble=function(t){const e=i(t);return`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFrag} vec2 TexCoords;\n ${e.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},e.getDefaultFragShaderMain=function(t,e){return`\n void main() {\n int indices[${e}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${i(t).output} = result;\n }\n `}},3891:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VecGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const t=this.context.outputTextureLayout.shape.length,e={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const i in e){const o=`${i}Vec`;let s="";for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLInferenceHandler=void 0;const r=n(6231),i=n(9162),o=n(2517),s=n(2403),a=n(7019),u=n(8710),l=n(5611),c=n(4057),d=n(2039);e.WebGLInferenceHandler=class{constructor(t){this.session=t,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(t,e){return(0,c.calculateTextureWidthAndHeight)(this.session.layoutStrategy,t,e)}executeProgram(t,e){if(e.length{const n=e.map((t=>`${t.unpackedShape.join(",")};${t.width}x${t.height}`)).join("_");let r=t.name;return t.cacheHint&&(r+="["+t.cacheHint+"]"),r+=":"+n,r})(t,n);let i=this.session.programManager.getArtifact(r);const o=i?i.programInfo:"function"==typeof t.get?t.get():t,s=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o.output.dims,o.output.textureType),a=this.createTextureData(s,o.output.type);return i||(i=this.session.programManager.build(o,n,a),this.session.programManager.setArtifact(r,i)),this.runProgram(i,n,a),a}run(t,e){return this.executeProgram(t,e).tensor}runProgram(t,e,n){for(let n=0;nthis.readTexture(s)),(async t=>this.readTextureAsync(s)),void 0,o),texture:n});return this.setTextureData(s.tensor.dataId,s,t.isPacked),s}getTextureData(t,e=!1){return this.session.isInitializer(t)?this.session.getTextureData(t,e):e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){this.session.isInitializer(t)?this.session.setTextureData(t,e,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(t,e)}isTextureLayoutCached(t,e=!1){return!!this.getTextureData(t.dataId,e)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.unpackedTextureDataCache=new Map}readTexture(t){return t.isPacked?this.readTexture(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}async readTextureAsync(t){return t.isPacked?this.readTextureAsync(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}pack(t){return this.executeProgram((0,s.createPackProgramInfoLoader)(this,t.tensor),[t.tensor])}unpack(t){return this.executeProgram((0,l.createUnpackProgramInfoLoader)(this,t.tensor),[t.tensor])}}},1640:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.WEBGL_OP_RESOLVE_RULES=void 0;const s=n(2898),a=o(n(7839)),u=n(4196),l=n(2069),c=n(8138),d=n(9663),h=n(5193),p=n(7992),f=n(1253),g=n(4776),m=n(6572),b=n(3346),y=n(5623),_=n(2870),w=n(2143),v=n(4939),x=n(718),T=n(2268),S=n(8117),O=n(2278),A=n(5524),E=n(5975),I=n(3933),k=n(6558),P=n(5723),D=n(3738),$=o(n(4909)),C=n(8428),F=n(9793);e.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",$.abs],["Acos","","7+",$.acos],["Add","","7+",a.add],["And","","7+",a.and],["Asin","","7+",$.asin],["Atan","","7+",$.atan],["AveragePool","","7+",w.averagePool,w.parseAveragePoolAttributes],["BatchNormalization","","7+",s.batchNormalization,s.parseBatchNormalizationAttributes],["Cast","","6+",u.cast,u.parseCastAttributes],["Ceil","","6+",$.ceil],["Clip","","6-10",$.clip,$.parseClipAttributes],["Clip","","11+",$.clipV11],["Concat","","4+",l.concat,l.parseConcatAttributes],["Conv","","1+",c.conv,c.parseConvAttributes],["ConvTranspose","","1+",d.convTranspose,d.parseConvTransposeAttributes],["Cos","","7+",$.cos],["Div","","7+",a.div],["Dropout","","7+",$.identity],["DepthToSpace","","1+",h.depthToSpace,h.parseDepthToSpaceAttributes],["Equal","","7+",a.equal],["Elu","","6+",$.elu,$.parseEluAttributes],["Exp","","6+",$.exp],["Flatten","","1+",p.flatten,p.parseFlattenAttributes],["Floor","","6+",$.floor],["FusedConv","com.microsoft","1+",c.conv,c.parseConvAttributes],["Gather","","1+",f.gather,f.parseGatherAttributes],["Gemm","","7-10",g.gemm,g.parseGemmAttributesV7],["Gemm","","11+",g.gemm,g.parseGemmAttributesV11],["GlobalAveragePool","","1+",w.globalAveragePool,w.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",w.globalMaxPool],["Greater","","7+",a.greater],["Identity","","1+",$.identity],["ImageScaler","","1+",m.imageScaler,m.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",$.leakyRelu,$.parseLeakyReluAttributes],["Less","","7+",a.less],["Log","","6+",$.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",w.maxPool,w.parseMaxPoolAttributes],["Mul","","7+",a.mul],["Neg","","6+",$.neg],["Not","","1+",$.not],["Or","","7+",a.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",a.pow],["PRelu","","7+",a.pRelu],["ReduceLogSum","","1+",v.reduceLogSum,v.parseReduceAttributes],["ReduceMax","","1+",v.reduceMax,v.parseReduceAttributes],["ReduceMean","","1+",v.reduceMean,v.parseReduceAttributes],["ReduceMin","","1+",v.reduceMin,v.parseReduceAttributes],["ReduceProd","","1+",v.reduceProd,v.parseReduceAttributes],["ReduceSum","","1-12",v.reduceSum,v.parseReduceAttributes],["ReduceSumSquare","","1+",v.reduceLogSumSquare,v.parseReduceAttributes],["Relu","","6+",$.relu],["Reshape","","5+",x.reshape],["Resize","","10",T.resize,T.parseResizeAttributesV10],["Resize","","11+",T.resize,T.parseResizeAttributesV11],["Shape","","1+",S.shape],["Sigmoid","","6+",$.sigmoid],["Sin","","7+",$.sin],["Slice","","10+",O.sliceV10],["Slice","","1-9",O.slice,O.parseSliceAttributes],["Softmax","","1-12",A.softmax,A.parseSoftmaxAttributes],["Softmax","","13+",A.softmaxV13,A.parseSoftmaxAttributesV13],["Split","","2-12",E.split,E.parseSplitAttributes],["Sqrt","","6+",$.sqrt],["Squeeze","","1-12",I.squeeze,I.parseSqueezeAttributes],["Squeeze","","13+",I.squeezeV13],["Sub","","7+",a.sub],["Sum","","6+",k.sum],["Tan","","7+",$.tan],["Tanh","","6+",$.tanh],["Tile","","6+",P.tile],["Transpose","","1+",D.transpose,D.parseTransposeAttributes],["Upsample","","7-8",F.upsample,F.parseUpsampleAttributesV7],["Upsample","","9",F.upsample,F.parseUpsampleAttributesV9],["Unsqueeze","","1-12",C.unsqueeze,C.parseUnsqueezeAttributes],["Unsqueeze","","13+",C.unsqueezeV13],["Xor","","7+",a.xor]]},2898:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;const r=n(246),i=n(5060),o=n(2039),s={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};e.batchNormalization=(t,e,n)=>(u(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>a(t,e,n)}),e)]),e.parseBatchNormalizationAttributes=t=>{const e=t.attributes.getFloat("epsilon",1e-5),n=t.attributes.getFloat("momentum",.9),i=t.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:e,momentum:n,spatial:i})};const a=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),a=e[0].dims.length,[u,l]=t.calculateTextureWidthAndHeight(e[1].dims,o.TextureType.unpacked),c=`\n float process(int[${a}] indices) {\n vec2 position = offsetToCoords(indices[1], ${u}, ${l});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},s),{output:{dims:e[0].dims,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:c})},u=t=>{if(!t||5!==t.length)throw new Error("BatchNormalization requires 5 inputs.");const e=t[0],n=t[1],r=t[2],i=t[3],o=t[4];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==i.dims.length||1!==o.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1]||i.dims[0]!==e.dims[1]||o.dims[0]!==e.dims[1])throw new Error("invalid input shape.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==i.type&&"float64"!==i.type||"float32"!==o.type&&"float64"!==o.type)throw new Error("invalid input tensor types.")}},7839:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;const r=n(2517),i=n(8520),o=n(5060),s=n(2039);function a(){const t="add_";return{body:`\n float ${t}(float a, float b) {\n return a + b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function u(){const t="div_";return{body:`\n float ${t}(float a, float b) {\n return a / b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function l(){const t="mul_";return{body:`\n float ${t}(float a, float b) {\n return a * b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function c(){const t="sub_";return{body:`\n float ${t}(float a, float b) {\n return a - b;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:t,type:i.FunctionType.ValueBased}}function d(){const t="equal_";return{body:`\n float ${t}(float a, float b) {\n return float(a == b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:t,type:i.FunctionType.ValueBased}}function h(){const t="greater_";return{body:`\n float ${t}(float a, float b) {\n return float(a > b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function p(){const t="less_";return{body:`\n float ${t}(float a, float b) {\n return float(a < b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function f(){const t="and_";return{body:`\n float ${t}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function g(){const t="or_";return{body:`\n float ${t}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function m(){const t="xor_";return{body:`\n float ${t}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:t,type:i.FunctionType.ValueBased}}function b(){return function(t){const e=`${t}_`;return{body:`\n float ${e}(float a, float b) {\n return ${t}(a, b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return ${t}(v1, v2);\n }\n `,name:e,type:i.FunctionType.ValueBased}}("pow")}function y(){const t="prelu_";return{body:`\n float ${t}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:t,type:i.FunctionType.ValueBased}}e.glslAdd=a,e.glslDiv=u,e.glslMul=l,e.glslSub=c,e.glslEqual=d,e.glslGreater=h,e.glslLess=p,e.glslAnd=f,e.glslOr=g,e.glslXor=m,e.glslPow=b,e.glslPRelu=y;const _=(t,e,n,r=e[0].type,i)=>{const o=t.session.pack?s.TextureType.packed:s.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[o,o],cacheHint:i,get:()=>w(t,e,n,r)}},w=(t,e,n,i=e[0].type)=>{const a=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,u=!r.ShapeUtil.areEqual(e[0].dims,e[1].dims);let l=e[0].dims;const c=t.session.pack;if(u){const s=r.BroadcastUtil.calcShape(e[0].dims,e[1].dims,!1);if(!s)throw new Error("Can't perform binary op on the given tensors");l=s;const u=l.length,d=0!==e[0].dims.length?e[0].dims.length:1,h=0!==e[1].dims.length?e[1].dims.length:1,p=0!==e[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",f=0!==e[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",g=(0,o.getGlsl)(t.session.backend.glContext.version),m=c?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${g.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${u}]) {\n int aindices[${d}];\n int bindices[${h}];\n ${p}\n ${f}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],output:{dims:l,type:i,textureType:a},shaderSource:m,hasMain:c}}const d=(0,o.getGlsl)(t.session.backend.glContext.version),h=`\n ${n.body}\n void main() {\n vec4 v1 = ${d.texture2D}(A, TexCoords);\n vec4 v2 = ${d.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${d.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],output:{dims:e[0].dims,type:i,textureType:a},shaderSource:h,hasMain:!0}};e.add=(t,e)=>[t.run(_(t,e,a()),e)],e.and=(t,e)=>[t.run(_(t,e,f(),"bool"),e)],e.div=(t,e)=>[t.run(_(t,e,u()),e)],e.equal=(t,e)=>[t.run(_(t,e,d(),"bool"),e)],e.greater=(t,e)=>[t.run(_(t,e,h(),"bool"),e)],e.less=(t,e)=>[t.run(_(t,e,p(),"bool"),e)],e.mul=(t,e)=>[t.run(_(t,e,l()),e)],e.or=(t,e)=>[t.run(_(t,e,g(),"bool"),e)],e.pow=(t,e)=>[t.run(_(t,e,b()),e)],e.pRelu=(t,e)=>[t.run(_(t,e,y()),e)],e.sub=(t,e)=>[t.run(_(t,e,c()),e)],e.xor=(t,e)=>[t.run(_(t,e,m(),"bool"),e)]},4196:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseCastAttributes=e.cast=void 0;const r=n(2517);e.cast=(t,e,n)=>(i(e),[t.cast(e[0],n)]),e.parseCastAttributes=t=>r.ProtoUtil.tensorDataTypeFromProto(t.attributes.getInt("to"));const i=t=>{if(!t||1!==t.length)throw new Error("Cast requires 1 input.");if("string"===t[0].type)throw new Error("Invalid input type.")}},1163:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),s=n(2827);e.createPackedConcatProgramInfoLoader=(t,e,n)=>{const u=(l=e.length,c=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:l},((t,e)=>`X${e}`)),inputTypes:Array(l).fill(i.TextureType.packed),cacheHint:c});var l,c;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const l=n[0].dims.slice();if(u>=l.length||u<-1*l.length)throw new Error("axis specified for concat doesn't match input dimensionality");u<0&&(u=l.length+u);const c=l.slice(0);for(let t=1;tt.dims)),m=(0,o.getGlChannels)(d),b=new Array(g.length-1);b[0]=g[0][u];for(let t=1;t= ${b[t-1]}) {\n return getChannel(\n getX${t}(${a(m,y,e)}),\n vec2(${a(_,y,e)}));\n }`}const x=b.length,T=b[b.length-1];v+=`\n return getChannel(\n getX${x}(${a(m,y,T)}),\n vec2(${a(_,y,T)}));`;const S=(0,r.getGlsl)(t.session.backend.glContext.version),O=`\n ${f}\n float getValue(${m.map((t=>"int "+t))}) {\n ${v}\n }\n\n void main() {\n ${p} coords = getOutputCoords();\n int lastDim = coords.${m[d-1]};\n coords.${m[d-1]} = coords.${m[d-2]};\n coords.${m[d-2]} = lastDim;\n\n vec4 result = vec4(getValue(${h}), 0., 0., 0.);\n\n ${h[d-1]} = ${h[d-1]} + 1;\n if (${h[d-1]} < ${c[d-1]}) {\n result.g = getValue(${h});\n }\n\n ${h[d-2]} = ${h[d-2]} + 1;\n if (${h[d-2]} < ${c[d-2]}) {\n result.a = getValue(${h});\n }\n\n ${h[d-1]} = ${h[d-1]} - 1;\n if (${h[d-2]} < ${c[d-2]} &&\n ${h[d-1]} < ${c[d-1]}) {\n result.b = getValue(${h});\n }\n ${S.output} = result;\n }\n `;return Object.assign(Object.assign({},e),{output:{dims:c,type:n[0].type,textureType:i.TextureType.packed},shaderSource:O,hasMain:!0})})(t,u,e,n.axis)})};const a=(t,e,n)=>{const r=t.indexOf(e);return t.map(((t,e)=>e===r?`${t} - ${n}`:t)).join()}},2069:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseConcatAttributes=e.concat=void 0;const r=n(246),i=n(2039),o=n(1163);e.concat=(t,e,n)=>(d(e),t.session.pack&&e[0].dims.length>1?[t.run((0,o.createPackedConcatProgramInfoLoader)(t,e,n),e)]:[t.run(s(t,e,n),e)]);const s=(t,e,n)=>{const r=(o=e.length,s=n.cacheKey,{name:"Concat",inputNames:Array.from({length:o},((t,e)=>`X${e}`)),inputTypes:Array(o).fill(i.TextureType.unpacked),cacheHint:s});var o,s;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice();if(r>=o.length||r<-1*o.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=o.length+r);const s=o.slice(0);for(let t=1;t`int getTextureWhereDataResides(int index) {\n ${t.map(((t,e)=>`if(index<${t}) {return ${e};}\n`)).join("")}\n }`,u=t=>a(t),l=(t,e)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${e}]) {`];for(let e=0;e{const e=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis")});const d=t=>{if(!t||t.length<1)throw new Error("too few inputs");const e=t[0].type,n=t[0].dims.length;if("string"===e)throw new Error("string tensor is not supported yet");for(const r of t){if(r.type!==e)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},4770:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),i=n(5060),o=n(2039),s=n(8138),a=n(2823);e.createUnpackedGroupedConvProgramInfoLoader=(t,e,n)=>{const u=(l=e.length>2,c=n.cacheKey,{name:"GroupedConv",inputNames:l?["X","W","Bias"]:["X","W"],inputTypes:l?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:c});var l,c;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const l=e.length>2?"value += getBias(output_channel);":"",c=e[0].dims.slice(),d=e[1].dims.slice(),h=d[0]/u.group;r.Logger.verbose("GroupedConv",`autpPad:${u.autoPad}, dilations:${u.dilations}, group:${u.group}, kernelShape:${u.kernelShape}, pads:${u.pads}, strides:${u.strides}`);const p=(0,s.calculateOutputShape)(c,d,u.dilations,u.pads,u.strides),f=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:g,applyActivation:m}=(0,a.getActivationSnippet)(u),b=`\n const ivec2 strides = ivec2(${u.strides[0]}, ${u.strides[1]});\n const ivec2 pads = ivec2(${u.pads[0]}, ${u.pads[1]});\n ${g}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${h};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${d[1]}; wInChannel++) {\n int input_channel = group_id * ${d[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${d[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${u.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${c[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${d[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${u.dilations[1]};\n if (xWidth < 0 || xWidth >= ${c[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${l}\n ${m}\n ${f.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:p,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:b,hasMain:!0})})(t,e,u,n)})}},1386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;const r=n(8138),i=n(8555),o=n(708);e.conv2DPackedPointwise=(t,e,n)=>{const i=e[0].dims,s=e[1].dims,a=(0,r.calculateOutputShape)(i,s,n.dilations,n.pads,n.strides),u=t.reshapePacked(e[0],[i[1],i[2]*i[3]]),l=t.reshapePacked(e[1],[s[0],s[1]]),c=e.length>2?[l,u,e[2]]:[l,u],d=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,c,n),c);return t.reshapePacked(d,a)},e.conv2DPacked=(t,e,n)=>{const s=e[0].dims,a=e[1].dims,u=(0,r.calculateOutputShape)(s,a,n.dilations,n.pads,n.strides),l=t.run((0,i.createPackedIm2ColProgramInfoLoader)(t,e[0],e[1],u,n),[e[0]]),c=t.reshapePacked(e[1],[a[0],a[1]*a[2]*a[3]]),d=3===e.length?[c,l,e[2]]:[c,l],h=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,d,n),d);return t.reshapePacked(h,u)}},9663:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseConvTransposeAttributes=e.convTranspose=void 0;const r=n(246),i=n(5060),o=n(2039),s=n(2823),a=(t,e,n,r,i,o)=>(t-1)*e+n+(r-1)*i+1-o,u=(t,e,n,r,i)=>{const o=Math.floor(t/2);"SAME_UPPER"===e?(n[r]=o,n[i]=t-o):"SAME_LOWER"===e&&(n[r]=t-o,n[i]=o)};e.convTranspose=(t,e,n)=>(h(e,n),l(t,e,n));const l=(t,e,n)=>{const r=d(n,e);return[c(t,e,r)]},c=(t,e,n)=>t.run(((t,e,n)=>{const r=(a=e.length>2,u=n.cacheKey,{name:"ConvTranspose",inputNames:a?["X","W","B"]:["X","W"],inputTypes:a?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:u});var a,u;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const a=e.length>2?"getB(output_channel)":"0.0",u=e[0].dims,l=e[1].dims,c=l[1],d=l[0]/r.group,h=[e[0].dims[0],e[1].dims[1]*r.group,...r.outputShape],p=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:f,applyActivation:g}=(0,s.getActivationSnippet)(r),m=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${f}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${c};\n int wOutChannel = output_channel - group_id * ${c};\n\n float value = ${a};\n for (int inChannelOffset = 0; inChannelOffset < ${d}; inChannelOffset++) {\n int input_channel = group_id * ${d} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${l[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${l[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${u[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${u[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${g}\n ${p.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:h,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,hasMain:!0})})(t,e,r,n)})})(t,e,n),e),d=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const c=t.length-2,d=0===l.length;for(let h=0;h{const e=t.attributes,n=(0,s.parseInternalActivationAttributes)(e),i=e.getString("auto_pad","NOTSET"),o=e.getInts("dilations",[1,1]),a=e.getInt("group",1),u=e.getInts("kernel_shape",[]),l=e.getInts("output_padding",[0,0]),c=e.getInts("output_shape",[]),d=e.getInts("pads",[0,0,0,0]),h=e.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:a,kernelShape:u,outputPadding:l,outputShape:c,pads:d,strides:h},n))};const h=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(t[0].dims[1]!==t[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=t[1].dims[1]*e.group;if(3===t.length&&(1!==t[2].dims.length||t[2].dims[0]!==n))throw new Error("invalid bias");const r=t[0].dims.length-2;if(e.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(e.strides.length!==r)throw new Error(`strides should be ${r}D`);if(e.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(e.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==e.outputShape.length&&e.outputShape.length!==t[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==t[0].type||"float32"!==t[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===t.length&&"float32"!==t[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseConvAttributes=e.conv=e.calculateOutputShape=void 0;const r=n(246),i=n(2517),o=n(4770),s=n(1386),a=n(9828),u=n(2823),l=n(3248),c=n(5623);e.calculateOutputShape=(t,e,n,r,i)=>{const o=t[0],s=t.slice(2),a=s.length,u=e[0],l=e.slice(2).map(((t,e)=>t+(t-1)*(n[e]-1))),c=s.map(((t,e)=>t+r[e]+r[e+a])).map(((t,e)=>Math.floor((t-l[e]+i[e])/i[e])));return[o,u].concat(...c)},e.conv=(t,e,n)=>(g(e,n),d(t,e,n));const d=(t,e,n)=>{const r=f(n,e),i=t.session.pack,a=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[t.run((0,o.createUnpackedGroupedConvProgramInfoLoader)(t,e,r),e)]:a&&i?[h(t,e,r)]:i&&4===e[0].dims.length&&1===e[0].dims[0]&&!a?[(0,s.conv2DPacked)(t,e,r)]:[p(t,e,r)]},h=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,s=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),a=t.reshapeUnpacked(n[0],[i[1],i[2]*i[3]]),u=t.reshapeUnpacked(n[1],[o[0],o[1]]),l=n.length>2?[u,a,n[2]]:[u,a],d=t.run((0,c.createMatmulProgramInfoLoader)(l,r),l);return t.reshapeUnpacked(d,s)},p=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,s=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),u=t.run((0,l.createIm2ColProgramInfoLoader)(t,n[0],n[1],s,r),[n[0]]),c=3===n.length?[u,n[1],n[2]]:[u,n[1]];return t.run((0,a.createDotProductProgramInfoLoader)(t,n,s,r),c)},f=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const e=t.attributes,n=(0,u.parseInternalActivationAttributes)(e),i=e.getString("auto_pad","NOTSET"),o=e.getInts("dilations",[1,1]),s=e.getInt("group",1),a=e.getInts("kernel_shape",[]),l=e.getInts("pads",[0,0,0,0]),c=e.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:s,kernelShape:a,pads:l,strides:c},n))};const g=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(t[0].dims[1]!==t[1].dims[1]*e.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===t.length&&(1!==t[2].dims.length||t[1].dims[0]!==t[2].dims[0]))throw new Error("invalid bias");const n=t[0].dims.length-2;if(e.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(e.strides.length!==n)throw new Error(`strides should be ${n}D`);if(e.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==t[0].type||"float32"!==t[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===t.length&&"float32"!==t[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;const r=n(3738);e.depthToSpace=(t,e,n)=>{i(e);const o=n.blocksize,s=o*o,a="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],u="DCR"===n.mode?[e[0].dims[0],o,o,e[0].dims[1]/s,e[0].dims[2],e[0].dims[3]]:[e[0].dims[0],e[0].dims[1]/s,o,o,e[0].dims[2],e[0].dims[3]],l=t.reshapeUnpacked(e[0],u),c={perm:a,cacheKey:`${a}`},[d]=(0,r.transpose)(t,[l],c),h=[e[0].dims[0],e[0].dims[1]/s,e[0].dims[2]*o,e[0].dims[3]*o];return[t.reshapeUnpacked(d,h)]},e.parseDepthToSpaceAttributes=t=>{const e=t.attributes.getInt("blocksize");if(e<1)throw new Error(`blocksize must be >= 1, but got : ${e} for DepthToSpace`);const n=t.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:e}};const i=t=>{if(1!==t.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${t.length}`);if("string"===t[0].type||4!==t[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDotProductProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),s=n(2823),a=n(3248);e.createDotProductProgramInfoLoader=(t,e,n,u)=>{const l=((t,e)=>({name:"ConvDotProduct",inputNames:t?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:t?[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.packedLastDimension],cacheKey:e.activationCacheKey}))(e.length>2,u);return Object.assign(Object.assign({},l),{get:()=>((t,e,n,u,l)=>{const c=n[0].dims,d=n[1].dims,h=[d[0],Math.ceil(c[1]*d[2]*d[3]/4)],p=(0,a.calculateIm2ColDims)(c,d,u),[f,g]=t.calculateTextureWidthAndHeight(h,o.TextureType.packedLastDimension),m=r.ShapeUtil.computeStrides(p),[b,y]=t.calculateTextureWidthAndHeight(p,o.TextureType.packedLastDimension),_=u.length,w=n.length<3?"0.0":"_B(b)",v=Math.ceil(c[1]*d[2]*d[3]/4),{activationFunction:x,applyActivation:T}=(0,s.getActivationSnippet)(l),S=(0,i.getGlsl)(t.session.backend.glContext.version),O=`\n${x}\nfloat process(int indices[${_}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${m[0]} + im2col[1] * ${m[1]} + im2col[2] * ${m[2]};\n int kernelOffset = indices[1] * ${h[1]};\n float value = ${w};\n for (int i = 0; i < ${v}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${b}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${f}, ${g});\n value += dot(${S.texture2D}(Im2Col, im2colCoords), ${S.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${T}\n return value;\n}`;return Object.assign(Object.assign({},e),{output:{dims:u,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:O})})(t,l,e,n,u)})}},7992:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;const r=n(2517);e.flatten=(t,e,n)=>{i(e,n);const o=r.ShapeUtil.flattenShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.parseFlattenAttributes=t=>t.attributes.getInt("axis",1);const i=(t,e)=>{if(!t||1!==t.length)throw new Error("Flatten requires 1 input.");const n=t[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(e<-n||e>n)throw new Error("Invalid axis");if("string"===t[0].type)throw new Error("string tensor is not supported.")}},2823:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;const r=n(2517),i=n(4909);e.getActivationSnippet=function(t){let e;switch(t.activation){case"Relu":e=(0,i.glslRelu)();break;case"Sigmoid":e=(0,i.glslSigmoid)();break;case"Clip":e=(0,i.glslClip)(t.clipMin,t.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=e.name;return{activationFunction:e.body,applyActivation:`value = ${n}_(value);`}},e.parseInternalActivationAttributes=t=>{const e=t.getString("activation","");if("Clip"===e){const[n,i]=t.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:e,clipMax:i,clipMin:n,activationCacheKey:`${e}:${n},${i}`}}return{activation:e,activationCacheKey:e}}},1253:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseGatherAttributes=e.gather=void 0;const r=n(246),i=n(782),o=n(2517),s=n(2039);e.gather=(t,e,n)=>(l(e,n.axis),[t.run(u(t,e,n),e)]),e.parseGatherAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",0)});const a={name:"Gather",inputNames:["A","B"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},u=(t,e,n)=>{const r=Object.assign(Object.assign({},a),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const i=n[0].dims.slice(),a=n[1].dims.slice(),u=new Array(i.length+a.length-1);r=o.ShapeUtil.normalizeAxis(r,i.length);const l=[];for(let t=0;t{if(!t||2!==t.length)throw new Error("Gather requires 2 inputs.");const n=t[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(e<-n||e>n-1)throw new Error("Invalid axis.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invaid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invaid input type.")}},4776:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;const r=n(246),i=n(2517),o=n(2039);e.gemm=(t,e,n)=>(l(e,n),[t.run(a(e,n),e)]);const s=(t,e)=>{const n=0!==t.attributes.getInt("transA",0),i=0!==t.attributes.getInt("transB",0),o=t.attributes.getFloat("alpha",1),s=t.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:i,alpha:o,beta:s,isOptionalC:e})};e.parseGemmAttributesV7=t=>s(t,!1),e.parseGemmAttributesV11=t=>s(t,!0);const a=(t,e)=>{const n={name:"Gemm",inputNames:3===t.length?["A","B","C"]:["A","B"],inputTypes:3===t.length?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],key:e.cacheKey};return Object.assign(Object.assign({},n),{get:()=>u(n,t,e)})},u=(t,e,n)=>{const r=e[0].dims.slice(),s=e[1].dims.slice(),[a,u]=i.GemmUtil.getShapeOfGemmResult(r,n.transA,s,n.transB,3===e.length?e[2].dims:void 0),l=[a,u];if(!l)throw new Error("Can't use gemm on the given tensors");let c=r[r.length-1],d="";n.transA&&(c=r[0]),n.transA&&n.transB?d="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?d="value += _A_T(a) * _B(b);":!n.transA&&n.transB?d="value += _A(a) * _B_T(b);":n.transA||n.transB||(d="value += _A(a) * _B(b);");const h=l.length,p=`\n float process(int indices[${h}]) {\n int a[${h}];\n int b[${h}];\n ${3===e.length?`int c[${e[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===e.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${c}; ++k) {\n a[${h-1}] = k;\n b[${h-2}] = k;\n ${d}\n }\n\n value = value * alpha;\n ${3===e.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:l,type:e[0].type,textureType:o.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:p})},l=(t,e)=>{if(!t)throw new Error("Input is missing");if(e.isOptionalC&&(t.length<2||t.length>3))throw new Error("Invaid input shape.");if(!e.isOptionalC&&3!==t.length)throw new Error("Gemm requires 3 inputs");if(3===t.length&&1!==t[2].dims.length&&2!==t[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type||3===t.length&&"float32"!==t[2].type&&"float64"!==t[2].type)throw new Error("Invalid input type.");if(t[0].type!==t[1].type||3===t.length&&t[0].type!==t[2].type)throw new Error("Input types are mismatched")}},8555:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(2827);e.createPackedIm2ColProgramInfoLoader=(t,e,n,s,a)=>{const u=(l=a.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[i.TextureType.packed],cacheHint:l});var l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,s,a,u)=>{const l=n.dims,c=s.dims,d=a.length,h=[c[1]*c[2]*c[3],a[2]*a[3]],p=c[2]*c[3],f=(0,o.unpackFromChannel)(),g=(0,r.getGlsl)(t.session.backend.glContext.version);let m="";for(let t=0;t<=1;t++)for(let e=0;e<=1;e++)m+=`\n blockIndex = rc.x + ${e};\n pos = rc.y + ${t};\n\n if(blockIndex < ${h[1]} && pos < ${h[0]}) {\n offsetY = int(blockIndex / (${a[d-1]})) * ${u.strides[0]} -\n ${u.pads[0]};\n d0 = offsetY + ${u.dilations[0]} * (imod(pos, ${p}) / ${c[2]});\n\n if(d0 < ${l[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${a[d-1]}) * ${u.strides[1]} -\n ${u.pads[1]};\n d1 = offsetX + ${u.dilations[1]} * imod(imod(pos, ${p}), ${c[2]});\n\n if(d1 < ${l[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${p}.);\n innerDims = vec2(d0, d1);\n result[${2*t+e}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const b=`\n ${f}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${m}\n ${g.output} = result;\n }\n `;return Object.assign(Object.assign({},e),{output:{dims:h,type:n.type,textureType:i.TextureType.packed},shaderSource:b,hasMain:!0})})(t,u,e,n,s,a)})}},3248:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.calculateIm2ColDims=e.createIm2ColProgramInfoLoader=void 0;const r=n(2039);e.createIm2ColProgramInfoLoader=(t,n,i,o,s)=>{const a=(u=s.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:u});var u;return Object.assign(Object.assign({},a),{get:()=>((t,n,i,o,s,a)=>{const u=i.dims,l=o.dims,c=s.length,d=(0,e.calculateIm2ColDims)(u,l,s,4),h=`\n const int XC = ${u[1]};\n const int XH = ${u[2]};\n const int XW = ${u[3]};\n const int KH = ${a.kernelShape[0]};\n const int KW = ${a.kernelShape[1]};\n const int dilationH = ${a.dilations[0]};\n const int dilationW = ${a.dilations[1]};\n const int strideH = ${a.strides[0]};\n const int strideW = ${a.strides[1]};\n const int padH = ${a.pads[0]};\n const int padW = ${a.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${c}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${u.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:d,type:i.type,textureType:r.TextureType.packedLastDimension},shaderSource:h})})(0,a,n,i,o,s)})},e.calculateIm2ColDims=(t,e,n,r=4)=>[n[0],n[2],n[3],Math.ceil(t[1]*e[2]*e[3]/r)]},6572:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseImageScalerAttributes=e.imageScaler=void 0;const r=n(246),i=n(2039);e.imageScaler=(t,e,n)=>(u(e),[t.run(s(t,e,n),e)]),e.parseImageScalerAttributes=t=>{const e=t.attributes.getFloat("scale"),n=t.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:e,bias:n})};const o={name:"ImageScaler",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},s=(t,e,n)=>{const r=Object.assign(Object.assign({},o),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice(),s=o.length,u=`\n ${a(r.bias.length)}\n float process(int indices[${s}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},e),{output:{dims:o,type:n[0].type,textureType:i.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:u})})(0,r,e,n)})},a=t=>{const e=[`float getBias(float bias[${t}], int channel) {`];for(let n=0;n{if(!t||1!==t.length)throw new Error("ImageScaler requires 1 input.");if(4!==t[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")}},3346:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;const r=n(5060),i=n(2039);e.instanceNormalization=(t,e,n)=>{l(e);const r=t.run(s(e[0]),e);return[t.run(u(t,e[0],n,r.dims),[e[0],r,e[1],e[2]])]},e.parseInstanceNormalizationAttributes=t=>t.attributes.getFloat("epsilon",1e-5);const o={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},s=t=>Object.assign(Object.assign({},o),{get:()=>((t,e)=>{const n=e.dims.slice(),r=n[1],o=n[2]*n[3],s=[n[0],r],a=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${o});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${o});\n\n return v;\n }`;return Object.assign(Object.assign({},t),{output:{dims:s,type:e.type,textureType:i.TextureType.packedLastDimension},shaderSource:a})})(o,t)}),a={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked,i.TextureType.unpacked]},u=(t,e,n,o)=>{const s=Object.assign(Object.assign({},a),{cacheHint:`${n}`});return Object.assign(Object.assign({},s),{get:()=>((t,e,n,o,s)=>{const a=(0,r.getGlsl)(t.session.backend.glContext.version),[u,l]=t.calculateTextureWidthAndHeight(s,i.TextureType.packedLastDimension),[c,d]=[u/4,l],h=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${c}, ${d});\n return ${a.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:o}],shaderSource:h})})(t,s,e,n,o)})},l=t=>{if(!t||3!==t.length)throw new Error("InstanceNormalization requires 3 inputs.");const e=t[0],n=t[1],r=t[2];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==t[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),s=n(9390),a=n(2823),u=n(5623);e.createPackedMatmulProgramInfoLoader=(t,e,n)=>{const l=(c=e.length>2,d=n.activationCacheKey,{name:"MatMul (packed)",inputNames:c?["A","B","Bias"]:["A","B"],inputTypes:c?[o.TextureType.packed,o.TextureType.packed,o.TextureType.packed]:[o.TextureType.packed,o.TextureType.packed],cacheHint:d});var c,d;return Object.assign(Object.assign({},l),{get:()=>((t,e,n,l)=>{const c=n.length>2,d=c?"value += getBiasForMatmul();":"",h=n[0].dims,p=n[1].dims,f=r.BroadcastUtil.calcShape(h,p,!0),g=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!f)throw new Error("Can't use matmul on the given tensors");const m=h[h.length-1],b=Math.ceil(m/2),y=h.length,_=p.length,w=(0,i.getGlsl)(t.session.backend.glContext.version),v=(0,s.getCoordsDataType)(f.length),x=f.length,T=(0,s.getGlChannels)(),{activationFunction:S,applyActivation:O}=(0,a.getActivationSnippet)(l),A=c?`${(0,u.getBiasForMatmul)(v,T,n[2].dims,f,!0)}`:"",E=g?`${function(t,e,n,i){let o=[],s=[];const a=n[0].dims,u=n[1].dims,l=a.length,c=u.length,d=i.length,h=d-l,p=d-c;o=a.map(((t,n)=>`coords.${e[n+h]}`)),o[l-1]="i*2",o.join(", "),s=u.map(((t,n)=>`coords.${e[n+p]}`)),s[c-2]="i*2",s.join(", ");const f=r.BroadcastUtil.getBroadcastDims(a,i),g=r.BroadcastUtil.getBroadcastDims(u,i),m=f.map((t=>`coords.${e[t+h]} = 0;`)).join("\n"),b=g.map((t=>`coords.${e[t+p]} = 0;`)).join("\n"),y=`int lastDim = coords.${e[d-1]};\n coords.${e[d-1]} = coords.${e[d-2]};\n coords.${e[d-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${t} coords = getOutputCoords();\n ${y}\n ${m}\n vec4 outputValue = getA(${o});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${t} coords = getOutputCoords();\n ${y}\n ${b}\n vec4 outputValue = getB(${s});\n return outputValue;\n}`}(v,T,n,f)}`:"",I=g?"getAAtOutCoordsMatmul(i)":`getA(${function(t,e){let n="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBiasForMatmul=e.createMatmulProgramInfoLoader=e.parseMatMulAttributes=e.matMul=void 0;const r=n(2517),i=n(2039),o=n(9390),s=n(2823),a=n(708);function u(t,e){const n=(a=t.length>2,u=e.activationCacheKey,{name:"MatMul",inputNames:a?["A","B","Bias"]:["A","B"],inputTypes:a?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});var a,u;return Object.assign(Object.assign({},n),{get:()=>function(t,e,n){const a=e[0].dims,u=e[1].dims,l=r.BroadcastUtil.calcShape(a,u,!0);if(!l)throw new Error("Can't use matmul on the given tensors");const d=(0,o.getCoordsDataType)(l.length),h=(0,o.getGlChannels)(),{activationFunction:p,applyActivation:f}=(0,s.getActivationSnippet)(n),g=e.length>2,m=g?"value += getBiasForMatmul();":"",b=g?`${c(d,h,e[2].dims,l,!1)}`:"",y=l.length,_=a.length,w=u.length,v=`\n ${p}\n ${b}\n float process(int indices[${y}]) {\n int a[${_}];\n int b[${w}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${a[a.length-1]}; ++k) {\n a[${_-1}] = k;\n b[${w-2}] = k;\n value += _A(a) * _B(b);\n }\n ${m}\n ${f}\n return value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:l,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:v})}(n,t,e)})}e.matMul=(t,e,n)=>(l(e),t.session.pack?[t.run((0,a.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(u(e,n),e)]),e.parseMatMulAttributes=t=>(0,s.parseInternalActivationAttributes)(t.attributes),e.createMatmulProgramInfoLoader=u;const l=t=>{if(!t||2!==t.length)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type)throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function c(t,e,n,i,o){let s="";const a=n.length,u=i.length,l=u-a;s=u<2&&a>0?"coords":n.map(((t,n)=>`coords.${e[n+l]}`)).join(", ");const c=r.BroadcastUtil.getBroadcastDims(n,i).map((t=>`coords.${e[t+l]} = 0;`)).join("\n");let d="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(d="vec4(outputValue.x)"),o?`\nvec4 getBiasForMatmul() {\n ${t} coords = getOutputCoords();\n ${c}\n vec4 outputValue = getBias(${s});\n return ${d};\n}`:`\nfloat getBiasForMatmul() {\n ${t} coords = getOutputCoords();\n ${c}\n return getBias(coords.x);\n}`}e.getBiasForMatmul=c},2403:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPackProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),s=n(2827),a={name:"pack",inputNames:["A"],inputTypes:[i.TextureType.unpackedReversed]};e.createPackProgramInfoLoader=(t,e)=>Object.assign(Object.assign({},a),{get:()=>((t,e)=>{const n=(0,r.getGlsl)(t.session.backend.glContext.version),u=e.dims,l=u.length,c=e.dims.length,d=(0,o.getCoordsDataType)(c),h=(0,s.getChannels)("rc",c),p=(f=c,g=h,m=u[u.length-2],b=u[u.length-1],0===f||1===f?"":`\n int r = ${g[f-2]};\n int c = ${g[f-1]};\n int rp1 = ${g[f-2]} + 1;\n int cp1 = ${g[f-1]} + 1;\n bool rEdge = rp1 >= ${b};\n bool cEdge = cp1 >= ${m};\n `);var f,g,m,b;let y;y=0===l?[1,1]:1===l?[u[0],1]:[u[c-1],u[c-2]];const _=function(t,e,n){if(0===t)return"false";if(1===t)return`rc > ${e[0]}`;let r="";for(let i=t-2;i= ${e[i-t+2]}`,i= ${t[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unpackFromChannel=e.getChannels=e.getVecChannels=void 0;const r=n(9390);function i(t,e){return(0,r.getGlChannels)(e).map((e=>`${t}.${e}`))}e.getVecChannels=i,e.getChannels=function(t,e){return 1===e?[t]:i(t,e)},e.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "}},2870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;const r=n(246),i=n(2517),o=n(5060),s=n(2039),a={name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};e.padV2=(t,e,n)=>(c(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>l(t,e[0],n)}),e)]),e.parsePadAttributesV2=t=>{const e=t.attributes.getString("mode","constant"),n=t.attributes.getFloat("value",0),i=t.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:e,value:n,pads:i})},e.padV11=(t,n,r)=>{d(n);const i=u(t,n,r);return(0,e.padV2)(t,[n[0]],i)},e.parsePadAttributesV11=t=>t.attributes.getString("mode","constant");const u=(t,e,n)=>{if(!t.session.isInitializer(e[1].dataId)||e.length>=3&&!t.session.isInitializer(e[2].dataId))throw new Error("dynamic pad attributes are not allowed");const i=Array.from(e[1].integerData),o=e.length>=3?e[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:i,value:o})},l=(t,e,n)=>{const r=i.ShapeUtil.padShape(e.dims.slice(),n.pads),o=r.length,a=`\n ${h(t,e,n)}\n float process(int[${o}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked],output:{dims:r,type:e.type,textureType:s.TextureType.unpacked},shaderSource:a}},c=t=>{if(!t||1!==t.length)throw new Error("Pad requires 1 input");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},d=t=>{if(!t||2!==t.length&&3!==t.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==t[1].type)throw new Error("Invalid input type.");if(t.length>=3&&"string"===t[2].type)throw new Error("Invalid input type.")},h=(t,e,n)=>{const r=(0,o.getGlsl)(t.session.backend.glContext.version),[a,u]=t.calculateTextureWidthAndHeight(e.dims,s.TextureType.unpacked),l=i.ShapeUtil.computeStrides(e.dims);switch(n.mode){case"constant":return p(r,e.dims,l,a,u,n.pads,n.value);case"reflect":return f(r,e.dims,l,a,u,n.pads);case"edge":return g(r,e.dims,l,a,u,n.pads);default:throw new Error("Invalid mode")}},p=(t,e,n,r,i,o,s)=>{const a=e.length;let u="";for(let t=a-1;t>=0;--t)u+=`\n k = m[${t}] - ${o[t]};\n if (k < 0) return constant;\n if (k >= ${e[t]}) return constant;\n offset += k * ${n[t]};\n `;return`\n float padA(int m[${a}]) {\n const float constant = float(${s});\n int offset = 0;\n int k = 0;\n ${u}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${t.texture2D}(A, coords));\n return value;\n }\n `},f=(t,e,n,r,i,o)=>{const s=e.length;let a="";for(let t=s-1;t>=0;--t)a+=`\n k = m[${t}] - ${o[t]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(e[t]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${e[t]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[t]};\n `;return`\n float padA(int m[${s}]) {\n int offset = 0;\n int k = 0;\n ${a}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${t.texture2D}(A, coords));\n return value;\n }\n `},g=(t,e,n,r,i,o)=>{const s=e.length;let a="";for(let t=s-1;t>=0;--t)a+=`\n k = m[${t}] - ${o[t]};\n if (k < 0) k = 0;\n if (k >= ${e[t]}) k = ${e[t]-1};\n offset += k * ${n[t]};\n `;return`\n float padA(int m[${s}]) {\n int offset = 0;\n int k = 0;\n ${a}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${t.texture2D}(A, coords));\n return value;\n }\n `}},2143:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;const r=n(246),i=n(2517),o=n(2039);e.averagePool=(t,e,n)=>{d(e);const r={name:"AveragePool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>s(e,r,!1,n)}),e)]},e.parseAveragePoolAttributes=t=>{const e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),i=0!==t.attributes.getInt("count_include_pad",0),o=t.attributes.getInts("kernel_shape"),s=t.attributes.getInts("strides",[]),a=t.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:i,kernelShape:o,strides:s,pads:a})};const s=(t,e,n,r)=>{const[s,a]=u(t,r,n),l=i.ShapeUtil.size(s.kernelShape);let c="";s.countIncludePad?c+=`value /= float(${l});`:c+=`value /= float(${l} - pad);`;const d=`\n ${h(t[0].dims,s,"value += _X(x);",c,"0.0")}\n `;return Object.assign(Object.assign({},e),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:d})};e.globalAveragePool=(t,e,n)=>{d(e);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[t.run(Object.assign(Object.assign({},r),{get:()=>s(e,r,!0,n)}),e)]},e.parseGlobalAveragePoolAttributes=t=>{const e=0!==t.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:e,kernelShape:[],strides:[],pads:[]})},e.maxPool=(t,e,n)=>{d(e);const r={name:"MaxPool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!1,n)}),e)]},e.parseMaxPoolAttributes=t=>{const e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),i=t.attributes.getInts("kernel_shape"),o=t.attributes.getInts("strides",[]),s=t.attributes.getInts("pads",[]),a=t.attributes.getInt("storage_order",0),u=t.attributes.getInts("dilations",[]);if(0!==a)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:!1,kernelShape:i,strides:o,pads:s,storageOrder:a,dilations:u})};const a=(t,e,n,r)=>{const[i,s]=u(t,r,n),a=`\n ${h(t[0].dims,i,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},e),{output:{dims:s,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:a})},u=(t,e,n)=>{const r=t[0].dims.slice(),o=Object.hasOwnProperty.call(e,"dilations"),s=e.kernelShape.slice(),a=e.strides.slice(),u=o?e.dilations.slice():[],l=e.pads.slice();i.PoolConvUtil.adjustPoolAttributes(n,r,s,a,u,l);const c=i.PoolConvUtil.computePoolOutputShape(n,r,a,u,s,l,e.autoPad),d=Object.assign({},e);return o?Object.assign(d,{kernelShape:s,strides:a,pads:l,dilations:u,cacheKey:e.cacheKey}):Object.assign(d,{kernelShape:s,strides:a,pads:l,cacheKey:e.cacheKey}),[d,c]},l={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},c={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[o.TextureType.unpacked]};e.globalMaxPool=(t,e)=>(d(e),[t.run(Object.assign(Object.assign({},c),{get:()=>a(e,c,!0,l)}),e)]);const d=t=>{if(!t||1!==t.length)throw new Error("Pool ops requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},h=(t,e,n,r,o)=>{const s=t.length;if(e.kernelShape.length<=2){const i=e.kernelShape[e.kernelShape.length-1],a=e.strides[e.strides.length-1],u=e.pads[e.pads.length/2-1],l=e.pads[e.pads.length-1],c=t[s-1];let d="",h="",p="";if(d=u+l!==0?`\n for (int i = 0; i < ${i}; i++) {\n x[${s} - 1] = indices[${s} - 1] * ${a} - ${u} + i;\n if (x[${s} - 1] < 0 || x[${s} - 1] >= ${c}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${i}; i++) {\n x[${s} - 1] = indices[${s} - 1] * ${a} - ${u} + i;\n ${n}\n }`,2===e.kernelShape.length){const n=e.kernelShape[e.kernelShape.length-2],r=e.strides[e.strides.length-2],o=e.pads[e.pads.length/2-2],a=e.pads[e.pads.length-2],u=t[s-2];h=o+a!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${s} - 2] = indices[${s} - 2] * ${r} - ${o} + j;\n if (x[${s} - 2] < 0 || x[${s} - 2] >= ${u}) {\n pad+= ${i};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${s} - 2] = indices[${s} - 2] * ${r} - ${o} + j;\n `,p="\n }\n "}return`\n float process(int indices[${s}]) {\n int x[${s}];\n copyVec(indices, x);\n\n float value = ${o};\n int pad = 0;\n ${h}\n ${d}\n ${p}\n ${r}\n return value;\n }\n `}{const a=i.ShapeUtil.size(e.kernelShape),u=i.ShapeUtil.computeStrides(e.kernelShape),l=u.length,c=e.pads.length,d=f(l),h=p(t,"inputDims"),g=p(e.pads,"pads"),m=p(u,"kernelStrides"),b=p(e.strides,"strides");let y="";return y=e.pads.reduce(((t,e)=>t+e))?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${d}\n float process(int indices[${s}]) {\n int x[${s}];\n copyVec(indices, x);\n int offset[${l}];\n int pads[${c}];\n int inputDims[${s}];\n int kernelStrides[${l}];\n int strides[${l}];\n ${g}\n ${h}\n ${b}\n ${m}\n\n float value = ${o};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${a}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${s} - ${l}; j < ${s}; j++) {\n x[j] = indices[j] * strides[j - ${s} + ${l}]\n + offset[j - ${s} + ${l}] - pads[j - 2];\n ${y}\n }\n ${r}\n\n return value;\n }\n `}},p=(t,e)=>{let n="";for(let r=0;r`\n void offsetToIndices(int offset, int[${t}] strides, out int[${t}] indices) {\n if (${t} == 0) {\n return;\n }\n for (int i = 0; i < ${t} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${t} - 1] = offset;\n }`},4939:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reduceLogSumSquare=e.reduceLogSum=e.reduceProd=e.reduceMin=e.reduceMax=e.reduceMean=e.reduceSum=e.parseReduceAttributes=void 0;const r=n(246),i=n(782),o=n(2517),s=n(2039),a=(t,e,n,r,i)=>{l(e);const o={name:r,inputNames:["A"],inputTypes:[s.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},o),{cacheHint:n.cacheKey,get:()=>u(t,e,n,r,i,o)}),e)]};e.parseReduceAttributes=t=>{const e=t.attributes.getInts("axes",[]),n=1===t.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:e,keepDims:n})};const u=(t,e,n,r,i,a)=>{const u=[],l=e[0].dims.length||1,c=[],d=o.ShapeUtil.normalizeAxes(n.axes,e[0].dims.length),h=i(e,d);let p=h[1];for(let t=0;t=0||0===d.length?(n.keepDims&&u.push(1),p=`\n for(int j${t} = 0; j${t} < ${e[0].dims[t]}; j${t}++) {\n inputIdx[${t}] = j${t};\n ${p}\n }`):(c.push(`inputIdx[${t}] = outputIdx[${u.length}];`),u.push(e[0].dims[t]));const f=`\n float process(int outputIdx[${u.length||1}]) {\n float value; // final result\n int inputIdx[${l}]; // addressing input data\n ${c.join("\n")}\n ${h[0]} // init ops for reduce max/min\n ${p}\n ${h[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},a),{output:{dims:u,type:e[0].type,textureType:s.TextureType.unpacked},shaderSource:f})},l=t=>{if(!t||1!==t.length)throw new Error("Reduce op requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.reduceSum=(t,e,n)=>a(t,e,n,"ReduceSum",(()=>["value = 0.0;","value += _A(inputIdx);",""])),e.reduceMean=(t,e,n)=>a(t,e,n,"ReduceMean",((t,e)=>{let n=1;for(let r=0;r=0||0===e.length)&&(n*=t[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]})),e.reduceMax=(t,e,n)=>a(t,e,n,"ReduceMax",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]})),e.reduceMin=(t,e,n)=>a(t,e,n,"ReduceMin",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]})),e.reduceProd=(t,e,n)=>a(t,e,n,"ReduceProd",(()=>["value = 1.0;","value *= _A(inputIdx);",""])),e.reduceLogSum=(t,e,n)=>a(t,e,n,"ReduceLogSum",(()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"])),e.reduceLogSumSquare=(t,e,n)=>a(t,e,n,"ReduceLogSumSquare",(()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""]))},7019:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isReshapeCheap=e.processDims3D=e.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),s=n(2827);e.createPackedReshape3DProgramInfoLoader=(t,e,n)=>{const a=(t=>({name:"Reshape (packed)",inputTypes:[o.TextureType.packed],inputNames:["A"],cacheHint:`${t}`}))(n);return Object.assign(Object.assign({},a),{get:()=>((t,e,n,a)=>{const u=e.dims,l=a;let c="";for(let t=0;t<4;t++){let e="";switch(t){case 0:e="outputCoords = rc;";break;case 1:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:e="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}c+=`\n ${e}\n ${t>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${t}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${t>0?"}":""}\n `}const d=(0,i.getGlsl)(t.session.backend.glContext.version),h=`\n ${function(t){const e=r.ShapeUtil.computeStrides(t),n=["b","r","c"],i="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${e.map(((t,r)=>`int ${n[r]} = ${i} / ${t}; ${r===e.length-1?`int ${n[r+1]} = ${i} - ${n[r]} * ${t}`:`index -= ${n[r]} * ${t}`};`)).join("")}\n return ivec3(b, r, c);\n }\n `}(u)}\n ${function(t){const e=r.ShapeUtil.computeStrides(t);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${e[0]} + coords.z * ${e[1]} + coords.y;\n }\n`}(l)}\n ${(0,s.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${l[2]};\n int cols = ${l[1]};\n\n ${c}\n ${d.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:l,type:e.type,textureType:o.TextureType.packed},shaderSource:h,hasMain:!0})})(t,e,a,n)})},e.processDims3D=function(t){if(0===t.length)return[1,1,1];let e=1;for(let n=0;n1?t[t.length-2]:1,t[t.length-1]]},e.isReshapeCheap=function(t,e){let n=!1;return n=0===t.length||0===e.length||(t.length<2||e.length<2?t[t.length-1]===e[e.length-1]:t[t.length-1]===e[e.length-1]&&t[t.length-2]===e[e.length-2]),n}},718:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reshape=void 0;const r=n(2517);e.reshape=(t,e)=>{const n=r.ShapeUtil.calculateReshapedDims(e[0].dims,e[1].integerData);return t.session.pack?[t.reshapePacked(e[0],n)]:[t.reshapeUnpacked(e[0],n)]}},2268:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;const r=n(5060),i=n(2039),o=n(9390),s=n(2827),a=n(9793),u={name:"Resize",inputNames:["A"],inputTypes:[i.TextureType.packed]};e.resize=(t,e,n)=>((0,a.validateInputs)(e,n),[t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>l(t,e,n)}),e)]),e.parseResizeAttributesV10=t=>(0,a.parseUpsampleAttributes)(t,10),e.parseResizeAttributesV11=t=>(0,a.parseUpsampleAttributes)(t,11);const l=(t,e,n)=>{const a=(0,r.getGlsl)(t.session.backend.glContext.version),[l,d]=c(e,n);if(l.every((t=>1===t))&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},u),{output:{dims:d,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${a.texture2D}(X, TexCoords);\n ${a.output} = v;\n }`});const h=d.length;if(h<2)throw new Error(`output dimension should be at least 2, but got ${h}`);const p=d[h-2],f=d[h-1],g=e[0].dims;if(h!==g.length)throw new Error(`output dimension should match input ${g.length}, but got ${h}`);const m=g[h-2],b=g[h-1],y=l[h-2],_=l[h-1];let w="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":w="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":w="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":w=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${f}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${f}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":w=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${f}.0 - 1.0, ${p}.0 - 1.0, ${f}.0 - 1.0,\n ${p}.0 - 1.0);\n vec4 original = vec4(${b}.0 - 1.0, ${m}.0 - 1.0, ${b}.0 - 1.0,\n ${m}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const v=(0,o.getCoordsDataType)(h),x=`\n const vec2 inputWH = vec2(${m}.0, ${b}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\n ${(0,s.unpackFromChannel)()}\n ${w}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${v} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${p-1};\n bool hasNextCol = rc.z < ${f-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${a.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},u),{output:{dims:d,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:x})},c=(t,e)=>{const n=t[0].dims;let r,i=e.scales;if(0===i.length){const o=t[e.scalesInputIdx];if(o&&0!==o.size){if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");i=d(o,e.mode,e.isResize)}else{const o=t[e.sizesInputIdx];if(!o||0===o.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(o.integerData),i=h(r,n,e.mode,e.isResize)}}else if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const o=r||n.map(((t,e)=>Math.floor(t*i[e])));return[i,o]},d=(t,e,n)=>{const r=Array.from(t.floatData);return(0,a.scalesValidation)(r,e,n),r},h=(t,e,n,r)=>{const i=e.length,o=new Array(i);for(let n=0,r=i;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shape=void 0;const r=n(9162);e.shape=(t,e)=>(i(e),[new r.Tensor([e[0].dims.length],"int32",void 0,void 0,new Int32Array(e[0].dims))]);const i=t=>{if(!t||1!==t.length)throw new Error("Shape requires 1 input.")}},2278:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sliceV10=e.parseSliceAttributes=e.slice=void 0;const r=n(246),i=n(782),o=n(2517),s=n(2039),a={name:"Slice",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};e.slice=(t,e,n)=>(l(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),e)]),e.parseSliceAttributes=t=>{const e=t.attributes.getInts("starts"),n=t.attributes.getInts("ends"),i=t.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:e,ends:n,axes:i})};const u=(t,e,n)=>{const r=0===n.axes.length?e.dims.slice(0).map(((t,e)=>e)):n.axes,i=o.ShapeUtil.normalizeAxes(r,e.dims.length),u=n.starts.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),l=n.ends.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),c=e.dims.slice(),d=[];for(let t=0;t0&&d.push(`outputIdx[${i[t]}] += ${u[t]};`);const h=`\n float process(int outputIdx[${c.length}]) {\n ${d.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},a),{output:{dims:c,type:e.type,textureType:s.TextureType.unpacked},shaderSource:h})},l=t=>{if(!t||1!==t.length)throw new Error("Slice requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.sliceV10=(t,e)=>{d(e);const n=c(t,e);return[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),[e[0]])]};const c=(t,e)=>{if(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)||e.length>=4&&!t.session.isInitializer(e[3].dataId)||e.length>=5&&!t.session.isInitializer(e[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(e.length>=5&&e[4].integerData.some((t=>1!==t)))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(e[1].integerData),r=Array.from(e[2].integerData),i=e.length>=4?Array.from(e[3].integerData):[];return{starts:n,ends:r,axes:i,cacheKey:`${i};${n};${r}`}},d=t=>{if(!t||t.length<3||t.length>5)throw new Error("Invalid input number.");if("int32"!==t[1].type||1!==t[1].dims.length)throw new Error("Invalid input type.");if("int32"!==t[2].type||1!==t[2].dims.length)throw new Error("Invalid input type.");if(t.length>=4&&("int32"!==t[3].type||1!==t[3].dims.length))throw new Error("Invalid input type.");if(t.length>=5&&("int32"!==t[4].type||1!==t[4].dims.length))throw new Error("Invalid input type.")}},5524:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;const r=n(246),i=n(2517),o=n(5060),s=n(2039),a=n(3738),u={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[s.TextureType.unpacked]},l={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},c={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};e.softmax=(t,e,n)=>{g(e);const r=e[0].dims.slice(),o=i.ShapeUtil.normalizeAxis(n.axis,r.length),s=i.ShapeUtil.sizeToDimension(r,o),a=i.ShapeUtil.sizeFromDimension(r,o);return d(t,e,n,s,a)},e.parseSoftmaxAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",1)}),e.parseSoftmaxAttributesV13=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",-1)}),e.softmaxV13=(t,e,n)=>{g(e);const o=e[0].dims.slice(),s=i.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,l=s!==u-1,c=[];let h,p=[],f=[];l&&(p=Array.from({length:u}).map(((t,e)=>e)),p[s]=u-1,p[u-1]=s,p.map((t=>c.push(o[t]))),h=(0,r.createAttributeWithCacheKey)({perm:p}),f=(0,a.transpose)(t,e,h));const m=l?i.ShapeUtil.sizeToDimension(c,u-1):i.ShapeUtil.sizeToDimension(o,u-1),b=l?i.ShapeUtil.sizeFromDimension(c,u-1):i.ShapeUtil.sizeFromDimension(o,u-1),y=d(t,l?f:e,n,m,b);return l?(0,a.transpose)(t,y,h):y};const d=(t,e,n,r,i)=>{const o=h(t,e[0],r,i,[r]),s=t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>o}),e),a=p(t,e[0],r,i,o.output.dims,[r]),d=t.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>a}),[e[0],s]),g=f(t,e[0],r,i,o.output.dims,a.output.dims);return[t.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>g}),[e[0],s,d])]},h=(t,e,n,r,i)=>{const[a,l]=t.calculateTextureWidthAndHeight(e.dims,s.TextureType.unpacked),c=i.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==i.length)throw new Error("Dimensionality of the output should be 1");if(i[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const d=(0,o.getGlsl)(t.session.backend.glContext.version),h=`\n float process(int[${c}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset, ${a},\n ${l} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${a}, ${l})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},u),{output:{dims:i,type:e.type,textureType:s.TextureType.unpacked},shaderSource:h})},p=(t,e,n,r,i,a)=>{const[u,c]=t.calculateTextureWidthAndHeight(e.dims,s.TextureType.unpacked),d=a.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length)throw new Error("Dimensionality of the output should be 1");if(a[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==i.length)throw new Error("Dimensionality of the intermediate results should be 1");if(i[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const h=`\n float process(int[${d}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,o.getGlsl)(t.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${u}, ${c}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},l),{output:{dims:a,type:e.type,textureType:s.TextureType.unpacked},shaderSource:h})},f=(t,e,n,r,i,o)=>{const[a,u]=t.calculateTextureWidthAndHeight(e.dims,s.TextureType.unpacked),l=e.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==i.length||1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(i[0]!==n||o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const d=`\n float process(int[${l}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${a}, ${u});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:e.dims,type:e.type,textureType:s.TextureType.unpacked},shaderSource:d})},g=t=>{if(!t||1!==t.length)throw new Error("Softmax requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type")}},5975:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSplitAttributes=e.split=void 0;const r=n(246),i=n(2517),o=n(2039),s={name:"Split",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};e.split=(t,e,n)=>{l(e);const r=i.ShapeUtil.normalizeAxis(n.axis,e[0].dims.length),o=a(t,e,r,n),c=[];for(let i=0;iu(t,e[0],n,r,i)}),e));return c},e.parseSplitAttributes=t=>{const e=t.attributes.getInt("axis",0),n=t.attributes.getInts("split",[]),i=t.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:e,split:n,numOutputs:i})};const a=(t,e,n,r)=>{const[,o]=i.SplitUtil.splitShape(e[0].dims,n,r.split,r.numOutputs);return o.length},u=(t,e,n,r,a)=>{const[u,l]=i.SplitUtil.splitShape(e.dims,r,n.split,n.numOutputs),c=l[a],d=u[a],h=`\n float process(int indices[${d.length}]) {\n indices[${r}] += ${c};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},s),{cacheHint:`${n.cacheKey}:${a}`,output:{dims:d,type:e.type,textureType:o.TextureType.unpacked},shaderSource:h})},l=t=>{if(!t||1!==t.length)throw new Error("Split requires one input.");if("int8"!==t[0].type&&"uint8"!==t[0].type&&"int16"!==t[0].type&&"uint16"!==t[0].type&&"int32"!==t[0].type&&"uint32"!==t[0].type&&"float32"!==t[0].type&&"float64"!==t[0].type&&"bool"!==t[0].type)throw new Error("Invalid input type.")}},3933:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSqueezeAttributes=e.squeezeV13=e.squeeze=void 0;const r=n(2517);e.squeeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.squeezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.squeezeV13=(t,n)=>(o(n),(0,e.squeeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseSqueezeAttributes=t=>t.attributes.getInts("axes");const i=t=>{if(!t||1!==t.length)throw new Error("Squeeze requires 1 input.");if("string"===t[0].type)throw new Error("invalid input tensor types.")},o=t=>{if(!t||2!==t.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==t[1].type)throw new Error("Invalid input type.")}},6558:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sum=void 0;const r=n(5060),i=n(2039);e.sum=(t,e)=>{s(e);const n={name:"Sum",inputNames:e.map(((t,e)=>`X${e}`)),inputTypes:new Array(e.length).fill(i.TextureType.unpacked)};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const o=(0,r.getGlsl)(t.session.backend.glContext.version),s=e[0].dims.slice(),a=`\n void main() {\n vec4 result = ${e.map(((t,e)=>`${o.texture2D}(X${e},TexCoords)`)).join(" + ")};\n ${o.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:s,type:e[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:a})},s=t=>{if(!t||0===t.length)throw new Error("Sum requires inputs.");const e=t[0].dims.length;for(let n=1;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tile=void 0;const r=n(782),i=n(2039);e.tile=(t,e)=>{s(e);const n={name:"Tile",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const r=e[0].dims.slice(),o=new Array(r.length),s=[];for(let t=0;t{if(!t||2!==t.length)throw new Error("Tile requires 2 input.");if(1!==t[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(t[1].dims[0]!==t[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invalid repeat type.")}},3738:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTransposeAttributes=e.transpose=void 0;const r=n(246),i=n(2517),o=n(2039),s={name:"Transpose",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};e.transpose=(t,e,n)=>(d(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>a(t,e[0],n.perm)}),e)]),e.parseTransposeAttributes=t=>(0,r.createAttributeWithCacheKey)({perm:t.attributes.getInts("perm",[])});const a=(t,e,n)=>{const r=e.dims;n=u(r,n);const i=l(r,n),a=r.length,d=`\n ${c("perm",n,a)}\n float process(int indices[${a}]) {\n int a[${a}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},s),{output:{dims:i,type:e.type,textureType:o.TextureType.unpacked},shaderSource:d})},u=(t,e)=>(e&&e.length!==t.length&&(e=[...t.keys()].reverse()),e),l=(t,e)=>(e=u(t,e),i.ShapeUtil.sortBasedOnPerm(t,e)),c=(t,e,n)=>{const r=[];r.push(`void ${t}(out int a[${n}], int src[${n}]) {`);for(let t=0;t{if(!t||1!==t.length)throw new Error("Transpose requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("input should be float tensor")}},8710:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeAsUint8=void 0;const r=n(5060),i=n(2039);e.encodeAsUint8=(t,e)=>{const n=e.shape,o=(0,r.getGlsl)(t.session.backend.glContext.version),s=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${o.texture2D}(X,TexCoords).r;\n ${o.output} = encodeAsUint8(value);\n }`,a={name:"Uint8Encode",inputTypes:[i.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:e.tensor.type,textureType:i.TextureType.downloadUint8AsFloat},shaderSource:s,hasMain:!0};return t.executeProgram(a,[e.tensor])}},4909:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tanh=e.tan=e.sqrt=e.sin=e.sigmoid=e.relu=e.not=e.neg=e.log=e.parseLeakyReluAttributes=e.leakyRelu=e.identity=e.floor=e.exp=e.parseEluAttributes=e.elu=e.cos=e.ceil=e.clipV11=e.parseClipAttributes=e.clip=e.atan=e.asin=e.acos=e.abs=e.glslTanh=e.glslTan=e.glslSqrt=e.glslSigmoid=e.glslRelu=e.glslSin=e.glslNot=e.glslNeg=e.glslLog=e.glslLeakyRelu=e.glslIdentity=e.glslClip=e.glslFloor=e.glslExp=e.glslElu=e.glslCos=e.glslCeil=e.glslAtan=e.glslAsin=e.glslAcos=e.glslAbs=void 0;const r=n(246),i=n(2517),o=n(8520),s=n(5060),a=n(2039);function u(){return k("abs")}function l(){return k("acos")}function c(){return k("asin")}function d(){return k("atan")}function h(){return k("ceil")}function p(){return k("cos")}function f(t){const e="elu";return{body:`\n const float alpha = float(${t});\n\n float ${e}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function g(){return k("exp")}function m(){return k("floor")}function b(t,e){const n="clip";return{body:`\n const float min = float(${t});\n const float max = float(${e});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:o.FunctionType.ValueBased}}function y(){const t="indentity";return{body:`\n float ${t}_(float a) {\n return a;\n }\n vec4 ${t}_(vec4 v) {\n return v;\n }\n `,name:t,type:o.FunctionType.ValueBased}}function _(t){const e="leakyRelu";return{body:`\n const float alpha = float(${t});\n\n float ${e}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function w(){return k("log")}function v(){const t="neg";return{body:`\n float ${t}_(float a) {\n return -a;\n }\n vec4 ${t}_(vec4 v) {\n return -v;\n }\n `,name:t,type:o.FunctionType.ValueBased}}function x(){const t="not";return{body:`\n float ${t}_(float a) {\n return float( ! bool(a) );\n }\n bool ${t}_(bool a) {\n return !a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${t}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:t,type:o.FunctionType.ValueBased}}function T(){return k("sin")}function S(){const t="relu";return{body:`\n float ${t}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${t}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:t,type:o.FunctionType.ValueBased}}function O(){const t="sigmoid";return{body:`\n float ${t}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${t}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:t,type:o.FunctionType.ValueBased}}function A(){return k("sqrt")}function E(){return k("tan")}function I(){const t="tanh";return{body:`\n float ${t}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${t}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:t,type:o.FunctionType.ValueBased}}function k(t){return{body:`\n float ${t}_(float a) {\n return ${t}(a);\n }\n vec4 ${t}_(vec4 v) {\n return ${t}(v);\n }\n `,name:t,type:o.FunctionType.ValueBased}}e.glslAbs=u,e.glslAcos=l,e.glslAsin=c,e.glslAtan=d,e.glslCeil=h,e.glslCos=p,e.glslElu=f,e.glslExp=g,e.glslFloor=m,e.glslClip=b,e.glslIdentity=y,e.glslLeakyRelu=_,e.glslLog=w,e.glslNeg=v,e.glslNot=x,e.glslSin=T,e.glslRelu=S,e.glslSigmoid=O,e.glslSqrt=A,e.glslTan=E,e.glslTanh=I;const P=(t,e,n,r)=>{const i=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,o={name:n.name,inputTypes:[i],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},o),{get:()=>((t,e,n,r)=>{const i=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,o=(0,s.getGlsl)(t.session.backend.glContext.version);return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${o.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${o.output} = v;\n }\n `,hasMain:!0})})(t,o,e,n)})};e.abs=(t,e)=>[t.run(P(t,e[0],u()),e)],e.acos=(t,e)=>[t.run(P(t,e[0],l()),e)],e.asin=(t,e)=>[t.run(P(t,e[0],c()),e)],e.atan=(t,e)=>[t.run(P(t,e[0],d()),e)],e.clip=(t,e,n)=>[t.run(P(t,e[0],b(n.min,n.max),n.cacheKey),e)],e.parseClipAttributes=t=>(0,r.createAttributeWithCacheKey)({min:t.attributes.getFloat("min",i.MIN_CLIP),max:t.attributes.getFloat("max",i.MAX_CLIP)}),e.clipV11=(t,n)=>{const r=D(t,n);return(0,e.clip)(t,[n[0]],r)};const D=(t,e)=>{if(e.length>=3&&(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=e.length>=3?e[1].numberData[0]:i.MIN_CLIP,o=e.length>=3?e[2].numberData[0]:i.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:o})};e.ceil=(t,e)=>[t.run(P(t,e[0],h()),e)],e.cos=(t,e)=>[t.run(P(t,e[0],p()),e)],e.elu=(t,e,n)=>[t.run(P(t,e[0],f(n.alpha),n.cacheKey),e)],e.parseEluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",1)}),e.exp=(t,e)=>[t.run(P(t,e[0],g()),e)],e.floor=(t,e)=>[t.run(P(t,e[0],m()),e)],e.identity=(t,e)=>[t.run(P(t,e[0],y()),e)],e.leakyRelu=(t,e,n)=>[t.run(P(t,e[0],_(n.alpha),n.cacheKey),e)],e.parseLeakyReluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",.01)}),e.log=(t,e)=>[t.run(P(t,e[0],w()),e)],e.neg=(t,e)=>[t.run(P(t,e[0],v()),e)],e.not=(t,e)=>[t.run(P(t,e[0],x()),e)],e.relu=(t,e)=>[t.run(P(t,e[0],S()),e)],e.sigmoid=(t,e)=>[t.run(P(t,e[0],O()),e)],e.sin=(t,e)=>[t.run(P(t,e[0],T()),e)],e.sqrt=(t,e)=>[t.run(P(t,e[0],A()),e)],e.tan=(t,e)=>[t.run(P(t,e[0],E()),e)],e.tanh=(t,e)=>[t.run(P(t,e[0],I()),e)]},5611:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createUnpackProgramInfoLoader=e.createUnpackProgramInfo=void 0;const r=n(5060),i=n(2039),o=n(9390),s=n(2827),a={name:"unpack",inputNames:["A"],inputTypes:[i.TextureType.packed]};e.createUnpackProgramInfo=(t,e)=>{const n=e.dims.length,u=(0,s.getChannels)("rc",n),l=u.slice(-2),c=(0,o.getCoordsDataType)(n),d=(0,s.unpackFromChannel)(),h=0===e.dims.length?"":function(t,e){if(1===t)return"rc";let n="";for(let r=0;rObject.assign(Object.assign({},a),{get:()=>(0,e.createUnpackProgramInfo)(t,n)})},8428:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseUnsqueezeAttributes=e.unsqueezeV13=e.unsqueeze=void 0;const r=n(2517);e.unsqueeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.unsqueezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.unsqueezeV13=(t,n)=>(o(n),(0,e.unsqueeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseUnsqueezeAttributes=t=>t.attributes.getInts("axes");const i=t=>{if(!t||1!==t.length)throw new Error("Unsqueeze requires 1 input.");if("string"===t[0].type)throw new Error("invalid input tensor types.")},o=t=>{if(!t||2!==t.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==t[1].type)throw new Error("Invalid input type.")}},9793:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;const r=n(246),i=n(5060),o=n(2039),s={name:"Upsample",inputNames:["X"],inputTypes:[o.TextureType.unpacked]};e.upsample=(t,n,r)=>((0,e.validateInputs)(n,r),[t.run(Object.assign(Object.assign({},s),{cacheHint:r.cacheKey,get:()=>a(t,n,r)}),n)]),e.parseUpsampleAttributesV7=t=>(0,e.parseUpsampleAttributes)(t,7),e.parseUpsampleAttributesV9=t=>(0,e.parseUpsampleAttributes)(t,9),e.parseUpsampleAttributes=(t,n)=>{const i=n>=10,o=t.attributes.getString("mode","nearest");if("nearest"!==o&&"linear"!==o&&(n<11||"cubic"!==o))throw new Error(`unrecognized mode: ${o}`);let s=[];n<9&&(s=t.attributes.getFloats("scales"),(0,e.scalesValidation)(s,o,i));const a=t.attributes.getFloat("extrapolation_value",0),u=n>10?t.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(u))throw new Error(`coordinate_transform_mode '${u}' is not supported`);const l="tf_crop_and_resize"===u,c=l,d="nearest"===o&&n>=11?t.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(d))throw new Error(`nearest_mode '${d}' is not supported`);const h=t.attributes.getFloat("cubic_coeff_a",-.75),p=0!==t.attributes.getInt("exclude_outside",0);if(p&&"cubic"!==o)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const f=n<11||"nearest"===o&&"asymmetric"===u&&"floor"===d;let g=0,m=0,b=0;return n>10?t.inputs.length>2?(g=1,m=2,b=3):(m=1,b=2):9===n&&(m=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:i,mode:o,scales:s,extrapolationValue:a,coordinateTransformMode:u,useExtrapolation:c,needRoiInput:l,nearestMode:d,cubicCoefficientA:h,excludeOutside:p,useNearest2xOptimization:f,roiInputIdx:g,scalesInputIdx:m,sizesInputIdx:b})};const a=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),[a,u]=t.calculateTextureWidthAndHeight(e[0].dims,o.TextureType.unpacked),l=e[0].dims.map(((t,e)=>Math.floor(t*n.scales[e]))),[c,d]=t.calculateTextureWidthAndHeight(l,o.TextureType.unpacked),h=l.length,p=new Array(h),f=new Array(h);let g=`\n int output_pitches[${h}];\n int input_pitches[${h}];\n `;for(let t=h-1;t>=0;t--)p[t]=t===h-1?1:p[t+1]*l[t+1],f[t]=t===h-1?1:f[t+1]*e[0].dims[t+1],g+=`\n output_pitches[${t}] = ${p[t]};\n input_pitches[${t}] = ${f[t]};\n `;const m=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${a}, ${u});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,b="nearest"===n.mode?`\n ${m}\n float process(int indices[${h}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${g}\n\n int d, m;\n for (int dim = 0; dim < ${h}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===h?`\n ${m}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${e[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${m}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${e[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:b,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map((t=>Math.ceil(t)))}]})};e.validateInputs=(t,e)=>{if(!t||e.opset<9&&1!==t.length||e.opset>=9&&e.opset<11&&2!==t.length||e.opset>=11&&t.length<2)throw new Error("invalid inputs.");if(e.scales.length>0&&t[0].dims.length!==e.scales.length)throw new Error("Invalid input shape.");if("string"===t[0].type)throw new Error("Invalid input tensor types.")},e.scalesValidation=(t,e,n)=>{if(n){for(const e of t)if(e<=0)throw new Error("Scale value should be greater than 0.")}else for(const e of t)if(e<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==e&&"cubic"!==e||2===t.length||4===t.length&&1===t[0]&&1===t[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},1958:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProgramManager=void 0;const r=n(1670),i=n(6231),o=n(8879),s=n(5060);e.ProgramManager=class{constructor(t,e,n){this.profiler=t,this.glContext=e,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(t){return this.repo.get(t)}setArtifact(t,e){this.repo.set(t,e)}run(t,e,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=t.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,(()=>{var r;const o=this.glContext.gl,s=t.program;o.useProgram(s);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(t.attribLocations),this.bindUniforms(t.uniformLocations,null!==(r=t.programInfo.variables)&&void 0!==r?r:[],e)}catch(e){throw i.Logger.error("ProgramManager",t.programInfo.shaderSource),e}this.profiler.event("backend","GlContext.draw()",(()=>{this.glContext.draw()}))}),this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((t=>this.glContext.deleteProgram(t.program)))}build(t,e,n){return this.profiler.event("backend","ProgramManager.build",(()=>{const r=new o.GlslPreprocessor(this.glContext,t,e,n),i=r.preprocess(),s=this.compile(i);return{programInfo:t,program:s,uniformLocations:this.getUniformLocations(s,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(s)}}))}compile(t){if(!this.vertexShader){i.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const t=(0,s.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(t,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&i.Logger.verbose("ProrgramManager",`FragShader:\n${t}\n`);const e=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,e);return this.glContext.deleteShader(e),n}bindOutput(t){const e=t.width,n=t.height;i.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${e}/${n}, shape=${t.shape}, type=${t.tensor.type}`),this.glContext.attachFramebuffer(t.texture,e,n)}bindAttributes(t){const e=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(e,n),this.attributesBound=!0}bindUniforms(t,e,n){var r;const i=this.glContext.gl;let o=0;for(const{name:s,type:a,location:u,arrayLength:l}of t){const t=null===(r=e.find((t=>t.name===s)))||void 0===r?void 0:r.data;if("sampler2D"!==a&&!t)throw new Error(`variable '${s}' does not have data defined in program info`);switch(a){case"sampler2D":this.bindTexture(n[o],u,o),o++;break;case"float":l?i.uniform1fv(u,t):i.uniform1f(u,t);break;case"int":l?i.uniform1iv(u,t):i.uniform1i(u,t);break;default:throw new Error(`Uniform not implemented: ${a}`)}}}bindTexture(t,e,n){this.glContext.bindTextureToUniform(t.texture,n,e)}getAttribLocations(t){return{position:this.getAttribLocation(t,"position"),textureCoord:this.getAttribLocation(t,"textureCoord")}}getUniformLocations(t,e,n){const r=[];if(e)for(const n of e)r.push({name:n,type:"sampler2D",location:this.getUniformLocation(t,n)});if(n)for(const e of n)r.push(Object.assign(Object.assign({},e),{location:this.getUniformLocation(t,e.name)}));return r}getUniformLocation(t,e){const n=this.glContext.gl.getUniformLocation(t,e);if(null===n)throw new Error(`Uniform ${e} not found.`);return n}getAttribLocation(t,e){return this.glContext.gl.getAttribLocation(t,e)}}},6416:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLSessionHandler=void 0;const r=n(6231),i=n(1047),o=n(8316),s=n(1640),a=n(1958),u=n(7859),l=n(5702);e.WebGLSessionHandler=class{constructor(t,e){this.backend=t,this.context=e,this.layoutStrategy=new u.PreferLogicalStrategy(t.glContext.maxTextureSize),this.programManager=new a.ProgramManager(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new l.TextureManager(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===t.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new o.WebGLInferenceHandler(this)}onGraphInitialized(t){const e=t.getValues().filter((t=>-1===t.from&&t.tensor)).map((t=>t.tensor.dataId));this.initializers=new Set(e)}isInitializer(t){return!!this.initializers&&this.initializers.has(t)}addInitializer(t){this.initializers.add(t)}getTextureData(t,e){return e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(t,e):this.unpackedTextureDataCache.set(t,e)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.unpackedTextureDataCache=new Map}resolve(t,e,n){const r=(0,i.resolveOperator)(t,e,s.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(t,n):t}}}},7769:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;const r=n(6231);e.RedFloat32DataEncoder=class{constructor(t,e=1){if(1===e)this.internalFormat=t.R32F,this.format=t.RED,this.textureType=t.FLOAT,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA32F,this.format=t.RGBA,this.textureType=t.FLOAT,this.channelSize=e}}encode(t,e){let n,i;return t.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),i=new Float32Array(t)),e*this.channelSize>t.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),i=t,n=this.allocate(e*this.channelSize),i.forEach(((t,e)=>n[e]=t))):(i=t,n=i),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.RGBAFloatDataEncoder=class{constructor(t,e=1,n){if(1!==e&&4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.channelSize=e,this.textureType=n||t.FLOAT}encode(t,e){let n=t;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(e),t.forEach(((t,e)=>n[4*e]=t))),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.Uint8DataEncoder=class{constructor(t,e=1){if(this.channelSize=4,1===e)this.internalFormat=t.ALPHA,this.format=t.ALPHA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e}}encode(t,e){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}allocate(t){return new Uint8Array(t*this.channelSize)}decode(t,e){if(t instanceof Uint8Array)return t.subarray(0,e);throw new Error(`Invalid array type: ${t.constructor}`)}}},7859:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),i=n(2517);function o(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,o=null==e||i?null:s(e,t).sort();let a=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),r.push(e)),o[a]<=e&&a++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}}function s(t,e){const n=e.length;return t=null==t?e.map(((t,e)=>e)):[].concat(t),(0,i.assert)(t.every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),(0,i.assert)(t.every(a),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function a(t){return t%1==0}function u(t){if(0===t.length)return 1;let e=t[0];for(let n=1;n=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(i>n||o>n))return[i,o];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}const i=t.reduce(((t,e)=>t*e));let o=Math.floor(Math.sqrt(i));for(;o=n||i%o!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${t}`);return[o,i/o]}},e.PreferLogicalStrategy=class{constructor(t){this.maxTextureSize=t}computeTextureWH(t,e){const n=this.computeTexture(t,e);return e&&e.isPacked&&(n[0]/=2,n[1]/=2),e&&e.reverseWH?[n[1],n[0]]:n}computeTexture(t,e){const n=e&&e.isPacked;if(0===t.length)return n?[2,2]:[1,1];let i=this.maxTextureSize;if(e&&void 0!==e.breakAxis){const n=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(n>i||o>i))return[n,o];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}let s=t.slice(0);if(n&&(i*=2,s=s.map(((t,e)=>e>=s.length-2?s[e]%2==0?s[e]:s[e]+1:s[e])),1===s.length&&(s=[2,s[0]])),2!==s.length){const t=o(s);s=t.newShape}const a=u(s);return s.length<=1&&a<=i?[1,a]:2===s.length&&s[0]<=i&&s[1]<=i?s:3===s.length&&s[0]*s[1]<=i&&s[2]<=i?[s[0]*s[1],s[2]]:3===s.length&&s[0]<=i&&s[1]*s[2]<=i?[s[0],s[1]*s[2]]:4===s.length&&s[0]*s[1]*s[2]<=i&&s[3]<=i?[s[0]*s[1]*s[2],s[3]]:4===s.length&&s[0]<=i&&s[1]*s[2]*s[3]<=i?[s[0],s[1]*s[2]*s[3]]:n?l(a/4).map((t=>2*t)):l(a)}},e.squeezeShape=o,e.parseAxisParam=s,e.isInt=a,e.sizeFromShape=u,e.getRowsCols=function(t){if(0===t.length)throw Error("Cannot get rows and columns of an empty shape array.");return[t.length>1?t[t.length-2]:1,t[t.length-1]]},e.sizeToSquarishShape=l,e.getBatchDim=function(t,e=2){return u(t.slice(0,t.length-e))}},4057:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;const r=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=(t,n,r)=>{const o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,s=r===i.TextureType.packed,a=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,l=r===i.TextureType.packedLastDimension?n.map(((t,e)=>e===n.length-1?4*t:t)):void 0;return(0,e.createTextureLayoutFromShape)(t,n,o,l,{isPacked:s,reverseWH:a,breakAxis:u})},e.calculateTextureWidthAndHeight=(t,n,r)=>{const i=(0,e.createTextureLayoutFromTextureType)(t,n,r);return[i.width,i.height]},e.createTextureLayoutFromShape=(t,e,n=1,i,o)=>{const s=!(!o||!o.isPacked),[a,u]=t.computeTextureWH(s&&i||e,o),l=e.length;let c=e.slice(0);if(0===l&&(c=[1]),1===n)i=e;else if(s){if(4!==n)throw new Error("a packed texture must be 4-channel");i=e,l>0&&(c[l-1]=Math.ceil(c[l-1]/2)),l>1&&(c[l-2]=Math.ceil(c[l-2]/2))}else if(!i)throw new Error("Unpacked shape is needed when using channels > 1");return{width:a,height:u,channels:n,isPacked:s,shape:c,strides:r.ShapeUtil.computeStrides(c),unpackedShape:i,reversedWH:o&&o.reverseWH}}},5702:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextureManager=void 0;const r=n(6231);e.TextureManager=class{constructor(t,e,n,r){this.glContext=t,this.layoutStrategy=e,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(t,e,n,i){const o=this.toEncoderType(t),s=this.glContext.getEncoder(o,e.channels||1,i);if(e.isPacked&&1===i)throw new Error("not implemented");const a=e.width,u=e.height;let l,c;if(this.config.reuseTextures){l=`${a}x${u}_${s.format}_${s.internalFormat}_${s.textureType}`,c=this.inUseTextures.get(l),c||(c=[],this.inUseTextures.set(l,c));const e=this.idleTextures.get(l);if(e&&e.length>0){const r=e.pop();return c.push(r),1===i&&this.glContext.updateTexture(r,a,u,s,this.toTextureData(t,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${e.width}x${e.height}`);const d=this.glContext.allocateTexture(a,u,s,this.toTextureData(t,n));return this.config.reuseTextures&&(c.push(d),this.textureLookup.set(d,l)),d}readTexture(t,e,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",(()=>{const r=t.shape.reduce(((t,e)=>t*e))*n,i=this.glContext.readTexture(t.texture,t.width,t.height,r,this.toEncoderType(e),n);return this.toTensorData(e,i)}))}async readTextureAsync(t,e,n){const r=t.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const t=this.pendingRead.get(r);return new Promise((e=>null==t?void 0:t.push(e)))}return this.profiler.event("backend","TextureManager.readTextureAsync",(async()=>{this.pendingRead.set(r,[]);const i=t.shape.reduce(((t,e)=>t*e))*n;await this.glContext.createAndWaitForFence();const o=this.glContext.readTexture(t.texture,t.width,t.height,i,this.toEncoderType(e),n),s=this.toTensorData(e,o),a=this.pendingRead.get(r);return this.pendingRead.delete(r),null==a||a.forEach((t=>t(s))),s}))}readUint8TextureAsFloat(t){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",(()=>{const e=t.shape.reduce(((t,e)=>t*e)),n=this.glContext.readTexture(t.texture,t.width,t.height,4*e,"byte",4);return new Float32Array(n.buffer,n.byteOffset,e)}))}releaseTexture(t,e){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture),n)){e&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const e=r.indexOf(t.texture);if(-1!==e){r.splice(e,1);let i=this.idleTextures.get(n);i||(i=[],this.idleTextures.set(n,i)),i.push(t.texture)}}}n&&!e||(r.Logger.verbose("TextureManager",`Deleting texture of size ${t.width}x${t.height}`),this.glContext.deleteTexture(t.texture))}toTensorData(t,e){switch(t){case"int16":return e instanceof Int16Array?e:Int16Array.from(e);case"int32":return e instanceof Int32Array?e:Int32Array.from(e);case"int8":return e instanceof Int8Array?e:Int8Array.from(e);case"uint16":return e instanceof Uint16Array?e:Uint16Array.from(e);case"uint32":return e instanceof Uint32Array?e:Uint32Array.from(e);case"uint8":case"bool":return e instanceof Uint8Array?e:Uint8Array.from(e);case"float32":return e instanceof Float32Array?e:Float32Array.from(e);case"float64":return e instanceof Float64Array?e:Float64Array.from(e);default:throw new Error(`TensorData type ${t} is not supported`)}}toTextureData(t,e){if(e)return e instanceof Float32Array?e:new Float32Array(e)}toEncoderType(t){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TextureType=void 0,(n=e.TextureType||(e.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;const r=n(2517);e.getPackedShape=function(t){const e=t.length;return t.slice(0,e-1).concat(t[e-1]/4)},e.repeatedTry=async function(t,e=(t=>0),n){return new Promise(((r,i)=>{let o=0;const s=()=>{if(t())return void r();o++;const a=e(o);null!=n&&o>=n?i():setTimeout(s,a)};s()}))},e.generateShaderFuncNameFromInputSamplerName=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>"empty string found for sampler name")),"get"+t.charAt(0).toUpperCase()+t.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>"empty string found for sampler name")),"get"+t.charAt(0).toUpperCase()+t.slice(1)+"AtOutCoords"},e.squeezeInputShape=function(t,e){let n=JSON.parse(JSON.stringify(t));return n=e,n},e.getSqueezedParams=function(t,e){return e.map((e=>t[e])).join(", ")},e.getCoordsDataType=function(t){if(t<=1)return"int";if(2===t)return"ivec2";if(3===t)return"ivec3";if(4===t)return"ivec4";if(5===t)return"ivec5";if(6===t)return"ivec6";throw Error(`GPU for rank ${t} is not yet supported`)},e.getGlChannels=function(t=6){return["x","y","z","w","u","v"].slice(0,t)}},7305:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;const r=n(6231),i=n(1713),o={};function s(t){const e=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const t=document.createElement("canvas");return t.width=1,t.height=1,t}();let n;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t||"webgl2"===t)&&(n=e.getContext("webgl2",o),n))try{return new i.WebGLContext(n,2)}catch(t){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!t||"webgl"===t)&&(n=e.getContext("webgl",o)||e.getContext("experimental-webgl",o),n))try{return new i.WebGLContext(n,1)}catch(t){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error("WebGL is not supported")}e.createWebGLContext=function t(e){let n;e&&"webgl2"!==e||!("webgl2"in o)?e&&"webgl"!==e||!("webgl"in o)||(n=o.webgl):n=o.webgl2,n=n||s(e),e=e||1===n.version?"webgl":"webgl2";const r=n.gl;return o[e]=n,r.isContextLost()?(delete o[e],t(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},e.createNewWebGLContext=s},1713:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;const s=n(1670),a=o(n(7769)),u=n(9390);function l(t){let e=0;for(;ethis.isTimerResultAvailable(t))),this.getTimerResult(t)}async createAndWaitForFence(){const t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e;const n=t,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),e=null===r?()=>!0:()=>{const t=n.clientWaitSync(r,0,0);return t===n.ALREADY_SIGNALED||t===n.CONDITION_SATISFIED},{query:r,isFencePassed:e}}async pollFence(t){return new Promise((e=>{this.addItemToPoll((()=>t.isFencePassed()),(()=>e()))}))}pollItems(){const t=l(this.itemsToPoll.map((t=>t.isDoneFn)));for(let e=0;e<=t;++e){const{resolveFn:t}=this.itemsToPoll[e];t()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}async addItemToPoll(t,e){this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||await(0,u.repeatedTry)((()=>(this.pollItems(),0===this.itemsToPoll.length)))}}},1036:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExecutionPlan=void 0;const r=n(6231);class i{constructor(t,e){this.op=t,this.node=e}}e.ExecutionPlan=class{constructor(t,e,n){this.graph=t,this.profiler=n,this.initialize(e)}initialize(t){this.profiler.event("session","ExecutionPlan.initialize",(()=>{const e=this.graph.getNodes();if(e.length!==t.length)throw new Error("The size of nodes and OPs do not match.");this._ops=t.map(((t,n)=>new i(t,e[n]))),this.reset(),this._starter=[],this._ops.forEach(((t,e)=>{let n=!0;for(const e of t.node.inputs)if(!this._values[e]&&-1===this.graph.getInputIndices().indexOf(e)){n=!1;break}n&&this._starter.push(e)}))}))}reset(){this._values=this.graph.getValues().map((t=>t.tensor))}async execute(t,e){return this.profiler.event("session","ExecutionPlan.execute",(async()=>{this.reset();const n=t.createInferenceHandler(),i=this.graph.getInputIndices();if(e.length!==i.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${e.length} expected: ${i.length}`);e.forEach(((t,e)=>{const n=i[e];this._values[n]=t}));const o=this._starter.slice(0),s=this.graph.getValues(),a=this.graph.getNodes();let u=0;for(;uthis._values[t]));if(-1!==i.indexOf(void 0))throw new Error(`unresolved input detected: op: ${e.node}`);const l=i;r.Logger.verbose("ExecPlan",`Runing op:${e.node.name} (${l.map(((t,n)=>`'${e.node.inputs[n]}': ${t.type}[${t.dims.join(",")}]`)).join(", ")})`);const c=await this.profiler.event("node",e.node.name,(async()=>e.op.impl(n,l,e.op.context)));if(c.length!==e.node.outputs.length)throw new Error("the size of output does not match model definition.");c.forEach(((t,n)=>{const r=e.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${e.node.name}`);this._values[r]=t}));const d=new Set;c.forEach(((t,n)=>{const r=e.node.outputs[n];for(const t of s[r].to){const e=a[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&d.add(t)}})),o.push(...d)}const l=[];for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;const r=n(1446),i=n(7778),o=n(9395),s=n(9162),a=n(2517);var u=o.onnxruntime.experimental.fbs;e.Graph={from:(t,e)=>new d(t,e)};class l{constructor(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=a.ProtoUtil.tensorValueTypeFromProto(t.type.tensorType))}get from(){return this._from}get to(){return this._to}}class c{constructor(t,e){t instanceof r.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new i.Attribute(t.attribute)):t instanceof u.Node&&(this.name=null!=e?e:t.name(),this.opType=t.opType(),this.attributes=new i.Attribute(a.ProtoUtil.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class d{constructor(t,e){if(!t)throw new TypeError("graph is empty");this.buildGraph(t),this.transformGraph(e),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(t){if(t instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else{if(!(t instanceof u.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(t)}}buildGraphFromOnnxFormat(t){const e=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!t.input)throw new Error("missing information in graph: input");const r=[];for(const n of t.input){if(e.has(n.name))throw new Error(`duplicated input name: ${n.name}`);const t=this._allData.push(new l(n))-1;e.set(n.name,t),r.push(n.name)}if(!t.initializer)throw new Error("missing information in graph: initializer");for(const n of t.initializer){let t=e.get(n.name);if(void 0===t){const r=new l;r.type={shape:{dims:a.ProtoUtil.tensorDimsFromProto(n.dims)},tensorType:a.ProtoUtil.tensorDataTypeFromProto(n.dataType)},t=this._allData.push(r)-1,e.set(n.name,t)}this._allData[t]._from=-1,this._allData[t].tensor=s.Tensor.fromProto(n)}for(let t=0;t{this._allData[e]._to.forEach((e=>{t.add(e)}))}));const e=Array.from(t),n=new Array(this._nodes.length).fill("white");for(;e.length>0;){const t=e.pop();"gray"===n[t]?n[t]="black":(e.push(t),n[t]="gray",this._nodes[t].outputs.forEach((r=>{const i=this._allData[r];if(void 0!==i.tensor)throw new Error("node outputs should not be initialized");if(i._from!==t)throw new Error("from property of the Value object doesn't match index of Node being processed");i._to.forEach((t=>{if("gray"===n[t])throw new Error("model graph is cyclic");"white"===n[t]&&e.push(t)}))})))}}transformGraph(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let t=0;for(let e=0;e0&&(this._nodes[e].inputs.forEach((n=>{const r=this._allData[n]._to.indexOf(e+t);-1!==r&&(this._allData[n]._to[r]=e)})),this._nodes[e].outputs.forEach((n=>{this._allData[n]._from&&this._allData[n]._from===e+t&&(this._allData[n]._from=e)}))):(t++,this._nodes[e].outputs.forEach((t=>{this._allData[t]._from=-2})),this._nodes.splice(e,1),e--);t=0;for(let e=0;e0){let n=-1;void 0!==this._allData[e].from&&-1!==this._allData[e].from?(n=this._nodes[this._allData[e].from].outputs.indexOf(e+t),-1!==n&&(this._nodes[this._allData[e].from].outputs[n]=e)):(n=this._allInputIndices.indexOf(e+t),-1!==n&&(this._allInputIndices[n]=e)),this._allData[e].to.forEach((r=>{n=this._nodes[r].inputs.indexOf(e+t),-1!==n&&(this._nodes[r].inputs[n]=e)})),0===this._allData[e].to.length&&(n=this._allOutputIndices.indexOf(e+t),-1!==n&&(this._allOutputIndices[n]=e))}}else t++,this._allData.splice(e,1),e--}deleteNode(t){const e=this._nodes[t];if(e.outputs.length>1)for(let t=1;t0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");e.executeNode=!1;const n=e.inputs[0],r=e.outputs[0],i=this._allData[r].to,o=this._allData[n].to.indexOf(t);if(-1===o)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[n].to.splice(o,1),this._allData[r]._to=[];const s=this._allOutputIndices.indexOf(r);if(-1!==s&&(this._allOutputIndices[s]=n),i&&i.length>0)for(const t of i){const e=this._nodes[t].inputs.indexOf(r);if(-1===e)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[t].inputs[e]=n,this._allData[n].to.push(t)}}removeAllDropoutNodes(){let t=0;for(const e of this._nodes){if("Dropout"===e.opType){if(1!==e.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==e.outputs.length&&2!==e.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===e.outputs.length&&0!==this._allData[e.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(t)}t++}}removeAllIdentityNodes(){let t=0;for(const e of this._nodes)"Identity"===e.opType&&this.deleteNode(t),t++}isActivation(t){switch(t.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if("Conv"===t.opType){const e=this._allData[t.outputs[0]]._to;if(1===e.length&&this.isActivation(this._nodes[e[0]])){const n=this._nodes[e[0]];if("Clip"===n.opType)if(1===n.inputs.length)try{t.attributes.set("activation_params","floats",[n.attributes.getFloat("min"),n.attributes.getFloat("max")])}catch(e){t.attributes.set("activation_params","floats",[a.MIN_CLIP,a.MAX_CLIP])}else{if(!(n.inputs.length>=3&&void 0!==this._allData[n.inputs[1]].tensor&&void 0!==this._allData[n.inputs[2]].tensor))continue;t.attributes.set("activation_params","floats",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]])}t.attributes.set("activation","string",n.opType),this.deleteNode(e[0])}}}}},6231:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.now=e.Profiler=e.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(t,e,n){}},console:new class{log(t,e,n){console.log(`${this.color(t)} ${n?""+n+" ":""}${e}`)}color(t){switch(t){case"verbose":return"v";case"info":return"i";case"warning":return"w";case"error":return"e";case"fatal":return"f";default:throw new Error(`unsupported severity: ${t}`)}}}},i={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let o={"":i};function s(t,e,n,r){if(void 0===e)return i=t,{verbose:s.verbose.bind(null,i),info:s.info.bind(null,i),warning:s.warning.bind(null,i),error:s.error.bind(null,i),fatal:s.fatal.bind(null,i)};if(void 0===n)a(t,e);else if("number"==typeof n&&void 0===r)a(t,e);else if("string"==typeof n&&void 0===r)a(t,n,0,e);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");a(t,n,0,e)}var i}function a(t,e,i,s){const a=o[s||""]||o[""];n[t]{s.then((async e=>{i&&await i.end(),t(e)}),(async t=>{i&&await i.end(),e(t)}))}));if(!o&&i){const t=i.end();if(t&&"function"==typeof t.then)return new Promise(((e,n)=>{t.then((()=>{e(s)}),(t=>{n(t)}))}))}return s}begin(t,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,e.now)();return this.flush(r),new u(t,n,r,(t=>this.endSync(t)))}{const e=r.beginTimer();return new u(t,n,0,(async t=>this.end(t)),e,r)}}async end(t){const e=await t.checkTimer();this._timingEvents.length=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;const r=n(5686),i=n(1446),o=n(7070),s=n(9395),a=n(2517);var u=s.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(t,e,n){if(!n)try{return void this.loadFromOnnxFormat(t,e)}catch(t){if(void 0!==n)throw t}this.loadFromOrtFormat(t,e)}loadFromOnnxFormat(t,e){const n=i.onnx.ModelProto.decode(t);if(a.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map((t=>({domain:t.domain,version:a.LongUtil.longToNumber(t.version)}))),this._graph=o.Graph.from(n.graph,e)}loadFromOrtFormat(t,e){const n=new r.flatbuffers.ByteBuffer(t),i=u.InferenceSession.getRootAsInferenceSession(n).model();if(a.LongUtil.longToNumber(i.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],e.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],e.FLOAT_TYPES=["float32","float64"]},1047:(t,e)=>{"use strict";function n(t,e){if(e.endsWith("+")){const n=Number.parseInt(e.substring(0,e.length-1),10);return!isNaN(n)&&n<=t}if(2===e.split("-").length){const n=e.split("-"),r=Number.parseInt(n[0],10),i=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(i)&&r<=t&&t<=i}return Number.parseInt(e,10)===t}Object.defineProperty(e,"__esModule",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t,e,r){for(const i of r){const r=i[0],o=i[1],s=i[2],a=i[3],u=i[4];if(t.opType===r)for(const t of e)if((t.domain===o||"ai.onnx"===t.domain&&""===o)&&n(t.version,s))return{opImpl:a,opInit:u}}throw new TypeError(`cannot resolve operator '${t.opType}' with opsets: ${e.map((t=>`${t.domain||"ai.onnx"} v${t.version}`)).join(", ")}`)}},9395:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onnxruntime=void 0;const r=n(5686);var i,o;(function(t){let e;!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.FLOAT=1]="FLOAT",t[t.INT=2]="INT",t[t.STRING=3]="STRING",t[t.TENSOR=4]="TENSOR",t[t.GRAPH=5]="GRAPH",t[t.FLOATS=6]="FLOATS",t[t.INTS=7]="INTS",t[t.STRINGS=8]="STRINGS",t[t.TENSORS=9]="TENSORS",t[t.GRAPHS=10]="GRAPHS",t[t.SPARSE_TENSOR=11]="SPARSE_TENSOR",t[t.SPARSE_TENSORS=12]="SPARSE_TENSORS"}(e=t.AttributeType||(t.AttributeType={}))})((o=(i=e.onnxruntime||(e.onnxruntime={})).experimental||(i.experimental={})).fbs||(o.fbs={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VALUE=1]="VALUE",t[t.PARAM=2]="PARAM"}(e=t.DimensionValueType||(t.DimensionValueType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.FLOAT=1]="FLOAT",t[t.UINT8=2]="UINT8",t[t.INT8=3]="INT8",t[t.UINT16=4]="UINT16",t[t.INT16=5]="INT16",t[t.INT32=6]="INT32",t[t.INT64=7]="INT64",t[t.STRING=8]="STRING",t[t.BOOL=9]="BOOL",t[t.FLOAT16=10]="FLOAT16",t[t.DOUBLE=11]="DOUBLE",t[t.UINT32=12]="UINT32",t[t.UINT64=13]="UINT64",t[t.COMPLEX64=14]="COMPLEX64",t[t.COMPLEX128=15]="COMPLEX128",t[t.BFLOAT16=16]="BFLOAT16"}(e=t.TensorDataType||(t.TensorDataType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.Primitive=0]="Primitive",t[t.Fused=1]="Fused"}(e=t.NodeType||(t.NodeType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]="NONE",t[t.tensor_type=1]="tensor_type",t[t.sequence_type=2]="sequence_type",t[t.map_type=3]="map_type"}(e=t.TypeInfoValue||(t.TypeInfoValue={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dim(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return n.startShape(t),n.addDim(t,e),n.endShape(t)}}e.Shape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}value(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,r){return n.startDimension(t),n.addValue(t,e),n.addDenotation(t,r),n.endDimension(t)}}e.Dimension=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):t.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(e,n){e.addFieldInt8(0,n,t.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,r,i){return n.startDimensionValue(t),n.addDimType(t,e),n.addDimValue(t,r),n.addDimParam(t,i),n.endDimensionValue(t)}}e.DimensionValue=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}shape(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,r){return n.startTensorTypeAndShape(t),n.addElemType(t,e),n.addShape(t,r),n.endTensorTypeAndShape(t)}}e.TensorTypeAndShape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}valueType(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,r){return n.startMapType(t),n.addKeyType(t,e),n.addValueType(t,r),n.endMapType(t)}}e.MapType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return n.startSequenceType(t),n.addElemType(t,e),n.endSequenceType(t)}}e.SequenceType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){(t.fbs||(t.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(t,e,n,r){return t.prep(4,12),t.writeInt32(r),t.writeInt32(n),t.writeInt32(e),t.offset()}}}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,r,i){return n.startNodeEdge(t),n.addNodeIndex(t,e),n.addInputEdges(t,r),n.addOutputEdges(t,i),n.endNodeEdge(t)}}e.NodeEdge=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(e,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(e,n){e.addFieldInt32(6,n,t.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,r,i,o,s,a,u,l,c,d,h,p,f){return n.startNode(t),n.addName(t,e),n.addDocString(t,r),n.addDomain(t,i),n.addSinceVersion(t,o),n.addIndex(t,s),n.addOpType(t,a),n.addType(t,u),n.addExecutionProviderType(t,l),n.addInputs(t,c),n.addOutputs(t,d),n.addAttributes(t,h),n.addInputArgCounts(t,p),n.addImplicitInputs(t,f),n.endNode(t)}}e.Node=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,r,i){return n.startValueInfo(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.endValueInfo(t)}}e.ValueInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(e,n){e.addFieldInt8(1,n,t.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,r,i){return n.startTypeInfo(t),n.addDenotation(t,e),n.addValueType(t,r),n.addValue(t,i),n.endTypeInfo(t)}}e.TypeInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,n,r){return e.startOperatorSetId(t),e.addDomain(t,n),e.addVersion(t,r),e.endOperatorSetId(t)}}t.OperatorSetId=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(e,n){e.addFieldInt32(3,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,r,i,o,s,a){return n.startTensor(t),n.addName(t,e),n.addDocString(t,r),n.addDims(t,i),n.addDataType(t,o),n.addRawData(t,s),n.addStringData(t,a),n.endTensor(t)}}e.Tensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}values(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,r,i){return n.startSparseTensor(t),n.addValues(t,e),n.addIndices(t,r),n.addDims(t,i),n.endSparseTensor(t)}}e.SparseTensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(e){let n=this.bb.__offset(this.bb_pos,16);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(e,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(e,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(e,n){e.addFieldInt32(2,n,t.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,r,i,o,s,a,u,l,c,d,h,p,f){return n.startAttribute(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.addF(t,o),n.addI(t,s),n.addS(t,a),n.addT(t,u),n.addG(t,l),n.addFloats(t,c),n.addInts(t,d),n.addStrings(t,h),n.addTensors(t,p),n.addGraphs(t,f),n.endAttribute(t)}}e.Attribute=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}initializers(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(e,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(e,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,r,i,o,s,a,u,l){return n.startGraph(t),n.addInitializers(t,e),n.addNodeArgs(t,r),n.addNodes(t,i),n.addMaxNodeIndex(t,o),n.addNodeEdges(t,s),n.addInputs(t,a),n.addOutputs(t,u),n.addSparseInitializers(t,l),n.endGraph(t)}}e.Graph=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,r,i,o,s,a,u,l,c){return n.startModel(t),n.addIrVersion(t,e),n.addOpsetImport(t,r),n.addProducerName(t,i),n.addProducerVersion(t,o),n.addDomain(t,s),n.addModelVersion(t,a),n.addDocString(t,u),n.addGraph(t,l),n.addGraphDocString(t,c),n.endModel(t)}}e.Model=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,n,r){return e.startKernelCreateInfos(t),e.addNodeIndices(t,n),e.addKernelDefHashes(t,r),e.endKernelCreateInfos(t)}}t.KernelCreateInfos=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,r){return n.startSubGraphSessionState(t),n.addGraphId(t,e),n.addSessionState(t,r),n.endSubGraphSessionState(t)}}e.SubGraphSessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}kernels(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,r){return n.startSessionState(t),n.addKernels(t,e),n.addSubGraphSessionStates(t,r),n.endSessionState(t)}}e.SessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier("ORTM")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,"ORTM",!0)}static createInferenceSession(t,e,r,i){return n.startInferenceSession(t),n.addOrtVersion(t,e),n.addModel(t,r),n.addSessionState(t,i),n.endInferenceSession(t)}}e.InferenceSession=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxjsSessionHandler=void 0;const r=n(1670),i=n(9162);e.OnnxjsSessionHandler=class{constructor(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t,e,n){const o=new Map;for(const e in t)if(Object.hasOwnProperty.call(t,e)){const n=t[e];o.set(e,new i.Tensor(n.dims,n.type,void 0,void 0,n.data))}const s=await this.session.run(o),a={};return s.forEach(((t,e)=>{a[e]=new r.Tensor(t.type,t.data,t.dims)})),a}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;const r=n(7067),i=n(1296),o=n(7091),s=n(1036),a=n(6231),u=n(2644);e.Session=class{constructor(t={}){this._initialized=!1,this.backendHint=t.backendHint,this.profiler=a.Profiler.create(t.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(t,e,n){await this.profiler.event("session","Session.loadModel",(async()=>{const s=await(0,o.resolveBackend)(this.backendHint);if(this.sessionHandler=s.createSessionHandler(this.context),this._model=new u.Model,"string"==typeof t){const e=t.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,i.promisify)(r.readFile)(t);this.initialize(n,e)}else{const n=await fetch(t),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),e)}}else if(ArrayBuffer.isView(t))this.initialize(t);else{const r=new Uint8Array(t,e||0,n||t.byteLength);this.initialize(r)}}))}initialize(t,e){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",(()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t,n,e),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new s.ExecutionPlan(this._model.graph,this._ops,this.profiler)})),this._initialized=!0}async run(t){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",(async()=>{const e=this.normalizeAndValidateInputs(t),n=await this._executionPlan.execute(this.sessionHandler,e);return this.createOutput(n)}))}normalizeAndValidateInputs(t){const e=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==e.length)throw new Error(`incorrect input array length: expected ${e.length} but got ${t.length}`)}else{if(t.size!==e.length)throw new Error(`incorrect input map size: expected ${e.length} but got ${t.size}`);const n=new Array(t.size);let r=0;for(let i=0;i"string"==typeof t))))throw new TypeError("cache should be a string array");l&&(this.cache=new Array(a))}else{if(void 0!==o){const t=h(e);if(!(o instanceof t))throw new TypeError(`cache should be type ${t.name}`)}if(l){const t=new ArrayBuffer(a*function(t){switch(t){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${t}`)}}(e));this.cache=function(t,e){return new(h(e))(t)}(t,e)}}}static fromProto(t){if(!t)throw new Error("cannot construct Value from an empty tensor");const e=u.ProtoUtil.tensorDataTypeFromProto(t.dataType),n=u.ProtoUtil.tensorDimsFromProto(t.dims),r=new c(n,e);if("string"===e)t.stringData.forEach(((t,e)=>{r.data[e]=(0,u.decodeUtf8String)(t)}));else if(t.rawData&&"number"==typeof t.rawData.byteLength&&t.rawData.byteLength>0){const e=r.data,n=new DataView(t.rawData.buffer,t.rawData.byteOffset,t.rawData.byteLength),i=d(t.dataType),o=t.rawData.byteLength/i;if(t.rawData.byteLength%i!=0)throw new Error("invalid buffer length");if(e.length!==o)throw new Error("buffer length mismatch");for(let r=0;r0){const e=r.data,n=new DataView(t.rawDataArray().buffer,t.rawDataArray().byteOffset,t.rawDataLength()),i=d(t.dataType()),o=t.rawDataLength()/i;if(t.rawDataLength()%i!=0)throw new Error("invalid buffer length");if(e.length!==o)throw new Error("buffer length mismatch");for(let r=0;r1&&u>1)return;s[o-a]=Math.max(n,u)}return s}static index(t,e){const n=new Array(e.length);return l.fillIndex(t,e,n),n}static fillIndex(t,e,n){const r=t.length-e.length;for(let i=0;i=0;t--)r[t]=c%o[t],c=Math.floor(c/o[t]);p||(l.fillIndex(r,t.dims,i),d=t.get(i)),f||(l.fillIndex(r,e.dims,a),h=e.get(a)),u.set(r,n(d,h))}}return u}}static isValidBroadcast(t,e){const n=t.length,r=e.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(1!==t[n-i]&&t[n-i]!==e[r-i])return!1;return!0}static getBroadcastDims(t,e){const n=t.length,r=[];for(let i=0;i1&&1===s&&r.unshift(o)}return r}}e.BroadcastUtil=l,e.arrayCopyHelper=function(t,e,n,r,i){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let o=0;oo.default.isLong(t)?t.toNumber():t))}static tensorValueTypeFromProto(t){return{tensorType:c.tensorDataTypeFromProto(t.elemType),shape:{dims:c.tensorDimsFromProto(t.shape.dim.map((t=>t.dimValue)))}}}static tensorDimsFromORTFormat(t){const e=[];for(let n=0;nt.length)throw new Error(`invalid dimension of ${e} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return h.getSizeFromDimensionRange(t,e,t.length)}static sizeToDimension(t,e){if(e<0||e>t.length)throw new Error(`invalid dimension of ${e} for sizeToDimension as Tensor has ${t.length} dimensions.`);return h.getSizeFromDimensionRange(t,0,e)}static getSizeFromDimensionRange(t,e,n){let r=1;for(let i=e;i=0;--r)n[r]=n[r+1]*t[r+1];return n}static transpose(t){return t.slice().reverse()}static indicesToOffset(t,e,n){void 0===n&&(n=t.length);let r=0;for(let i=0;i=e)throw new Error("unsupported axis for this operation.");return t<0?t+e:t}static normalizeAxes(t,e){return t.map((t=>this.normalizeAxis(t,e)))}static incrementIndex(t,e,n){if(0===e.length||0===t.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=e.length;else if(n<=0||n>e.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(t[r]++,!(t[r]=t.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[s]=t[s]}else r[s]=e[s];o*=r[s]}}const s=h.size(t);if(-1!==i){if(s%o!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t}] Output shape: [${e}]`);r[i]=s/o}else if(o!==s)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(t,e){return e?e.map((e=>t[e])):t.slice().reverse()}static padShape(t,e){const n=t.length;return t.map(((t,r)=>t+e[r]+e[r+n]))}static areEqual(t,e){return t.length===e.length&&t.every(((t,n)=>t===e[n]))}static validateDimsAndCalcSize(t){if(t.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let e=1;for(const n of t){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);e*=n}return e}static flattenShape(t,e){e<0&&(e+=t.length);const n=t.reduce(((t,e)=>t*e),1),r=t.slice(e).reduce(((t,e)=>t*e),1);return[n/r,r]}static squeezeShape(t,e){const n=new Array;e=h.normalizeAxes(e,t.length);for(let r=0;r=0;if(i&&1!==t[r])throw new Error("squeeze an axis of size different than 1");(0===e.length&&t[r]>1||e.length>0&&!i)&&n.push(t[r])}return n}static unsqueezeShape(t,e){const n=new Array(t.length+e.length);n.fill(0);for(let t=0;t=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[r])throw new Error("'axes' has a duplicate axis");n[r]=1}let r=0;for(let e=0;e=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let o=0;o=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let s=0;s=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let s=0;s=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+i>e.length)throw new Error("source indices to be copied are outside bounds");if(n+i>t.length)throw new Error("target array is too small to hold result");for(let o=0;oe.push(n)));const s=f.calcReduceShape(o,e,!0),u=h.size(s),c=new a.Tensor(s,t.type),d=h.computeStrides(s),p=h.computeStrides(o),g=new Array(o.length);for(let n=0;n=e.length)return o(t[i]);const u=e[r],l=u>=n.length?1:h.size(n.slice(u+1));for(let c=0;c0!==t))}}e.ReduceUtil=f;class g{static adjustPoolAttributes(t,e,n,r,i,o){if(!t&&n.length!==e.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(t)for(let t=0;t=n.length?n.push(e[t+2]):n[t]=e[t+2];for(let t=0;t=n[t]||o[t+n.length]>=n[t])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(t,e,n,r,i,o){if(o){if(i.length!==2*(t.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(e.length!==t.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==t.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,i)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,o])=>{const s=n?n+t:t;if("object"==typeof o)(0,e.iterateExtraOptions)(o,s+".",r,i);else if("string"==typeof o||"number"==typeof o)i(s,o.toString());else{if("boolean"!=typeof o)throw new Error("Can't handle extra config type: "+typeof o);i(s,o?"1":"0")}}))}},2157:function(t,e,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;const a=n(1670),u=s(n(349)),l=n(6361),c=()=>!!a.env.wasm.proxy&&"undefined"!=typeof document;let d,h,p,f=!1,g=!1,m=!1;const b=[],y=[],_=[],w=[],v=[],x=[],T=()=>{if(f||!g||m||!d)throw new Error("worker not ready")},S=t=>{switch(t.data.type){case"init-wasm":f=!1,t.data.err?(m=!0,h[1](t.data.err)):(g=!0,h[0]());break;case"init-ort":t.data.err?p[1](t.data.err):p[0]();break;case"create_allocate":t.data.err?b.shift()[1](t.data.err):b.shift()[0](t.data.out);break;case"create_finalize":t.data.err?y.shift()[1](t.data.err):y.shift()[0](t.data.out);break;case"create":t.data.err?_.shift()[1](t.data.err):_.shift()[0](t.data.out);break;case"release":t.data.err?w.shift()[1](t.data.err):w.shift()[0]();break;case"run":t.data.err?v.shift()[1](t.data.err):v.shift()[0](t.data.out);break;case"end-profiling":t.data.err?x.shift()[1](t.data.err):x.shift()[0]()}},O="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;e.initWasm=async()=>{if(c()){if(g)return;if(f)throw new Error("multiple calls to 'initWasm()' detected.");if(m)throw new Error("previous call to 'initWasm()' failed.");return f=!0,void 0===a.env.wasm.wasmPaths&&O&&0!==O.indexOf("blob:")&&(a.env.wasm.wasmPaths=O.substr(0,+O.lastIndexOf("/")+1)),new Promise(((t,e)=>{null==d||d.terminate(),d=n(9710).Z(),d.onmessage=S,h=[t,e];const r={type:"init-wasm",in:a.env.wasm};d.postMessage(r)}))}return(0,l.initializeWebAssembly)(a.env.wasm)},e.initOrt=async(t,e)=>{if(c())return T(),new Promise(((n,r)=>{p=[n,r];const i={type:"init-ort",in:{numThreads:t,loggingLevel:e}};d.postMessage(i)}));u.initOrt(t,e)},e.createSessionAllocate=async t=>c()?(T(),new Promise(((e,n)=>{b.push([e,n]);const r={type:"create_allocate",in:{model:t}};d.postMessage(r,[t.buffer])}))):u.createSessionAllocate(t),e.createSessionFinalize=async(t,e)=>c()?(T(),new Promise(((n,r)=>{y.push([n,r]);const i={type:"create_finalize",in:{modeldata:t,options:e}};d.postMessage(i)}))):u.createSessionFinalize(t,e),e.createSession=async(t,e)=>c()?(T(),new Promise(((n,r)=>{_.push([n,r]);const i={type:"create",in:{model:t,options:e}};d.postMessage(i,[t.buffer])}))):u.createSession(t,e),e.releaseSession=async t=>{if(c())return T(),new Promise(((e,n)=>{w.push([e,n]);const r={type:"release",in:t};d.postMessage(r)}));u.releaseSession(t)},e.run=async(t,e,n,r,i)=>c()?(T(),new Promise(((o,s)=>{v.push([o,s]);const a={type:"run",in:{sessionId:t,inputIndices:e,inputs:n,outputIndices:r,options:i}};d.postMessage(a,u.extractTransferableBuffers(n))}))):u.run(t,e,n,r,i),e.endProfiling=async t=>{if(c())return T(),new Promise(((e,n)=>{x.push([e,n]);const r={type:"end-profiling",in:t};d.postMessage(r)}));u.endProfiling(t)}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setRunOptions=t=>{const e=(0,o.getInstance)();let n=0;const s=[],a=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))a.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))a.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(a.terminate=!1);let o=0;if(void 0!==(null==t?void 0:t.tag)&&(o=(0,i.allocWasmString)(t.tag,s)),n=e._OrtCreateRunOptions(a.logSeverityLevel,a.logVerbosityLevel,!!a.terminate,o),0===n)throw new Error("Can't create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,s),a=(0,i.allocWasmString)(r,s);if(0!==e._OrtAddRunConfigEntry(n,o,a))throw new Error(`Can't set a run config entry: ${t} - ${r}`)})),[n,s]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),s.forEach(e._free),t}}},2306:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),i=n(1670),o=n(2850),s=n(2157);let a;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(t){const e=await fetch(t),n=await e.arrayBuffer();return(0,s.createSessionAllocate)(new Uint8Array(n))}async loadModel(t,e){if(a||(await(0,s.initOrt)(i.env.wasm.numThreads,(t=>{switch(t){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${t}`)}})(i.env.logLevel)),a=!0),"string"==typeof t)if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(n,e)}else{const n=await this.createSessionAllocate(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSessionFinalize)(n,e)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(t,e)}async dispose(){return(0,s.releaseSession)(this.sessionId)}async run(t,e,n){const r=[],o=[];Object.entries(t).forEach((t=>{const e=t[0],n=t[1],i=this.inputNames.indexOf(e);if(-1===i)throw new Error(`invalid input '${e}'`);r.push(n),o.push(i)}));const a=[];Object.entries(e).forEach((t=>{const e=t[0],n=this.outputNames.indexOf(e);if(-1===n)throw new Error(`invalid output '${e}'`);a.push(n)}));const u=await(0,s.run)(this.sessionId,o,r.map((t=>[t.type,t.dims,t.data])),a,n),l={};for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setSessionOptions=t=>{const e=(0,o.getInstance)();let n=0;const s=[],a=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(a);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(a.graphOptimizationLevel="all");const u=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(a.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(a.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(a.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(a.executionMode="sequential");const l=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(a.executionMode);let c=0;if(void 0!==(null==t?void 0:t.logId)&&(c=(0,i.allocWasmString)(t.logId,s)),void 0===(null==t?void 0:t.logSeverityLevel))a.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))a.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(a.enableProfiling=!1),n=e._OrtCreateSessionOptions(u,!!a.enableCpuMemArena,!!a.enableMemPattern,l,!!a.enableProfiling,0,c,a.logSeverityLevel,a.logVerbosityLevel),0===n)throw new Error("Can't create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const s=(0,i.allocWasmString)(e,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,s))throw new Error(`Can't append execution provider: ${e}`)}})(n,t.executionProviders,s),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,s),a=(0,i.allocWasmString)(r,s);if(0!==e._OrtAddSessionConfigEntry(n,o,a))throw new Error(`Can't set a session config entry: ${t} - ${r}`)})),[n,s]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),s.forEach(e._free),t}}},4983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(6361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),i=n.lengthBytesUTF8(t)+1,o=n._malloc(i);return n.stringToUTF8(t,o,i),e.push(o),o}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),i=n(4919),o=n(4983),s=n(6361);e.initOrt=(t,e)=>{const n=(0,s.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const a=new Map;e.createSessionAllocate=t=>{const e=(0,s.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,s.getInstance)();let r=0,o=0,u=[];try{if([o,u]=(0,i.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],o),0===r)throw new Error("Can't create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(o),u.forEach(n._free)}const l=n._OrtGetInputCount(r),c=n._OrtGetOutputCount(r),d=[],h=[],p=[],f=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,s.getInstance)(),n=a.get(t);if(!n)throw new Error("invalid session id");const r=n[0],i=n[1],o=n[2];i.forEach(e._OrtFree),o.forEach(e._OrtFree),e._OrtReleaseSession(r),a.delete(t)};const u=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},c=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,i,d)=>{const h=(0,s.getInstance)(),p=a.get(t);if(!p)throw new Error("invalid session id");const f=p[0],g=p[1],m=p[2],b=e.length,y=i.length;let _=0,w=[];const v=[],x=[];try{[_,w]=(0,r.setRunOptions)(d);for(let t=0;th.HEAP32[t++]=e));const n=h._OrtCreateTensor(u(e),s,a,c,r.length);if(0===n)throw new Error("Can't create a tensor");v.push(n)}finally{h.stackRestore(l)}}const t=h.stackSave(),s=h.stackAlloc(4*b),a=h.stackAlloc(4*b),p=h.stackAlloc(4*y),T=h.stackAlloc(4*y);try{let t=s/4,n=a/4,r=p/4,o=T/4;for(let r=0;rt*e));if(i=l(n),"string"===i){const t=[];let e=o/4;for(let n=0;n{const e=(0,s.getInstance)(),n=a.get(t);if(!n)throw new Error("invalid session id");const r=n[0],i=e._OrtEndProfiling(r);if(0===i)throw new Error("Can't get an profile file name");e._OrtFree(i)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},6361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const a=o(n(6449)),u=s(n(932)),l=n(3474);let c,d=!1,h=!1,p=!1;const f=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(d)return Promise.resolve();if(h)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(p)throw new Error("previous call to 'initializeWebAssembly()' failed.");h=!0;const e=t.initTimeout,r=t.numThreads,i=t.simd,o=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),s=i&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),g="string"==typeof t.wasmPaths?t.wasmPaths:void 0,m=f(!1,o),b=f(s,o),y="object"==typeof t.wasmPaths?t.wasmPaths[b]:void 0;let _=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{_=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=o?l:u.default,i={locateFile:(t,e)=>o&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):t===m?null!=y?y:(null!=g?g:e)+b:e+t};if(o)if("undefined"==typeof Blob)i.mainScriptUrlOrBlob=a.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;i.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(i).then((e=>{h=!1,d=!0,c=e,t()}),(t=>{h=!1,p=!0,e(t)}))}))),await Promise.race(w),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(d&&c)return c;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!d||h||p||(h=!0,null===(t=c.PThread)||void 0===t||t.terminateAllThreads(),c=void 0,h=!1,d=!1,p=!0)}},9710:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:t=>{"use strict";t.exports=function(t,e,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([t])}catch(e){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(t),o=o.getBlob()}var s=i.URL||i.webkitURL,a=s.createObjectURL(o),u=new i[e](a,n);return s.revokeObjectURL(a),u}catch(r){return new i[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error("Inline worker is not supported");return new i[e](r,n)}}},4154:t=>{"use strict";t.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},1670:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e,n)=>{"use strict";n.r(e),n.d(e,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(n+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,s=this.space;t:for(e=0;e=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},r.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+e))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n=56320?i:(i<<10)+t.charCodeAt(n++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),n=0;for(var o=this.space,s=this.bb.bytes();n>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&s)))}return i},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return __nested_webpack_require_546802__.d(e,{a:e}),e},__nested_webpack_require_546802__.d=(t,e)=>{for(var n in e)__nested_webpack_require_546802__.o(e,n)&&!__nested_webpack_require_546802__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__nested_webpack_require_546802__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__nested_webpack_require_546802__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_546802__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__nested_webpack_require_546802__(6018);return __webpack_exports__})(),module.exports=e(__webpack_require__(/*! onnxruntime-common */"./node_modules/onnxruntime-common/dist/lib/index.js"))},"./src/backends/onnx.js": -/*!******************************!*\ - !*** ./src/backends/onnx.js ***! - \******************************/(t,e,n)=>{let r;const i=["wasm"];if("undefined"!=typeof process){try{r=n(Object(function(){var t=new Error("Cannot find module 'onnxruntime-node'");throw t.code="MODULE_NOT_FOUND",t}()))}catch(t){console.warn("Node.js environment detected, but `onnxruntime-node` was not found. Using `onnxruntime-web` as a fallback. We recommend installing `onnxruntime-node` as it generally improves performance (up to 5X)."),n.g.self=n.g,r=n(/*! onnxruntime-web */"./node_modules/onnxruntime-web/dist/ort-web.min.js"),r.env.wasm.numThreads=1}i.unshift("cpu")}else r=n(/*! onnxruntime-web */"./node_modules/onnxruntime-web/dist/ort-web.min.js");t.exports={ONNX:r,executionProviders:i}},"./src/env.js": -/*!********************!*\ - !*** ./src/env.js ***! - \********************/(t,e,n)=>{const r=n(/*! fs */"?569f"),i=n(/*! path */"?3f59"),{env:o}=n(/*! ./backends/onnx.js */"./src/backends/onnx.js").ONNX,s="undefined"!=typeof self&&"caches"in self,a=!p(r),u=!p(i),l=a&&u,c="/models/onnx/quantized/",d=l?i.join(i.dirname("/"),c):c;o.wasm.wasmPaths=l?i.join(i.dirname("/"),"/dist/"):"https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/";const h={onnx:o,remoteModels:!0,remoteURL:"https://huggingface.co/Xenova/transformers.js/resolve/main/quantized/",localURL:d,useCache:s,useFS:a};function p(t){return 0===Object.keys(t).length}t.exports={env:h}},"./src/fft.js": -/*!********************!*\ - !*** ./src/fft.js ***! - \********************/t=>{t.exports=class{constructor(t){if(this.size=0|t,this.size<=1||0!=(this.size&this.size-1))throw new Error("FFT size must be a power of two and bigger than 1");this._csize=t<<1,this.table=new Float64Array(2*this.size);for(let t=0;tt;t<<=1)++e;this._width=e%2==0?e-1:e,this._bitrev=new Int32Array(1<>>e&3)<>>1);for(let e=0;e>>1]=t[e];return n}toComplexArray(t,e){const n=e||this.createComplexArray();for(let e=0;e>>1],n[e+1]=0;return n}completeSpectrum(t){const e=this._csize,n=e>>>1;for(let r=2;r>=2;s>=2;s>>=2){a=r/s<<1;let e=a>>>2;for(i=0;i>>1,i>>>1)}else for(s=0,a=0;s>>1,i>>>1,n)}for(i>>=2;i>=2;i>>=2){o=r/i<<1;const e=o>>>1,a=e>>>1,u=a>>>1;for(s=0;s{const{Tensor:r}=n(/*! ./tensor_utils.js */"./src/tensor_utils.js"),{Callable:i,exists:o,log_softmax:s}=n(/*! ./utils.js */"./src/utils.js");class a extends i{constructor(){super(),this.processors=[]}push(t){this.processors.push(t)}extend(t){this.processors.push(...t)}_call(t,e){for(let n of e)this.processors.forEach((e=>e(t,n)))}[Symbol.iterator](){return this.processors.values()}}class u extends i{_call(t,e){throw Error("`_call` should be implemented in a subclass")}}t.exports={LogitsProcessor:u,LogitsProcessorList:a,GenerationConfig:class{constructor(t={}){this.max_length=t.max_length??20,this.max_new_tokens=t.max_new_tokens??null,this.min_length=t.min_length??0,this.min_new_tokens=t.min_new_tokens??null,this.early_stopping=t.early_stopping??!1,this.max_time=t.max_time??null,this.do_sample=t.do_sample??!1,this.num_beams=t.num_beams??1,this.num_beam_groups=t.num_beam_groups??1,this.penalty_alpha=t.penalty_alpha??null,this.use_cache=t.use_cache??!0,this.temperature=t.temperature??1,this.top_k=t.top_k??50,this.top_p=t.top_p??1,this.typical_p=t.typical_p??1,this.epsilon_cutoff=t.epsilon_cutoff??0,this.eta_cutoff=t.eta_cutoff??0,this.diversity_penalty=t.diversity_penalty??0,this.repetition_penalty=t.repetition_penalty??1,this.encoder_repetition_penalty=t.encoder_repetition_penalty??1,this.length_penalty=t.length_penalty??1,this.no_repeat_ngram_size=t.no_repeat_ngram_size??0,this.bad_words_ids=t.bad_words_ids??null,this.force_words_ids=t.force_words_ids??null,this.renormalize_logits=t.renormalize_logits??!1,this.constraints=t.constraints??null,this.forced_bos_token_id=t.forced_bos_token_id??null,this.forced_eos_token_id=t.forced_eos_token_id??null,this.remove_invalid_values=t.remove_invalid_values??!1,this.exponential_decay_length_penalty=t.exponential_decay_length_penalty??null,this.suppress_tokens=t.suppress_tokens??null,this.begin_suppress_tokens=t.begin_suppress_tokens??null,this.forced_decoder_ids=t.forced_decoder_ids??null,this.num_return_sequences=t.num_return_sequences??1,this.output_attentions=t.output_attentions??!1,this.output_hidden_states=t.output_hidden_states??!1,this.output_scores=t.output_scores??!1,this.return_dict_in_generate=t.return_dict_in_generate??!1,this.pad_token_id=t.pad_token_id??null,this.bos_token_id=t.bos_token_id??null,this.eos_token_id=t.eos_token_id??null,this.encoder_no_repeat_ngram_size=t.encoder_no_repeat_ngram_size??0,this.decoder_start_token_id=t.decoder_start_token_id??null,this.generation_kwargs=t.generation_kwargs??{}}},ForcedBOSTokenLogitsProcessor:class extends u{constructor(t){super(),this.bos_token_id=t}_call(t,e){1===t.length&&(e.data.fill(-1/0),e.data[this.bos_token_id]=0)}},ForcedEOSTokenLogitsProcessor:class extends u{constructor(t,e){super(),this.max_length=t,this.forced_eos_token_id=e}_call(t,e){}},WhisperTimeStampLogitsProcessor:class extends u{constructor(t){super(),this.eos_token_id=t.eos_token_id,this.no_timestamps_token_id=t.no_timestamps_token_id,this.timestamp_begin=this.no_timestamps_token_id+1,this.begin_index=(t.forced_decoder_ids||[]).length+2,t.forced_decoder_ids.slice(-1)[0][1]===this.no_timestamps_token_id&&(this.begin_index-=1),this.max_initial_timestamp_index=t.max_initial_timestamp_index}_call(t,e){if(e.data[this.no_timestamps_token_id]=-1/0,t.length===this.begin_index-1)return e.data.fill(-1/0),e.data[this.timestamp_begin]=0,e;const n=t.slice(this.begin_index),r=n.length>=1&&n[n.length-1]>=this.timestamp_begin,i=n.length<2||n[n.length-2]>=this.timestamp_begin;if(r&&(i?e.data.subarray(this.timestamp_begin).fill(-1/0):e.data.subarray(0,this.eos_token_id).fill(-1/0)),t.length===this.begin_index&&null!==this.max_initial_timestamp_index){const t=this.timestamp_begin+this.max_initial_timestamp_index;e.data.subarray(t+1).fill(-1/0)}const o=s(e.data);return Math.log(o.subarray(this.timestamp_begin).map(Math.exp).reduce(((t,e)=>t+e)))>Math.max(...o.subarray(0,this.timestamp_begin))&&e.data.subarray(0,this.timestamp_begin).fill(-1/0),e}},ForceTokensLogitsProcessor:class extends u{constructor(t){super(),this.force_token_map=Object.fromEntries(t??[])}_call(t,e){let n=this.force_token_map[t.length];return o(n)&&(e.data.fill(-1/0),e.data[n]=0),e}},NoRepeatNGramLogitsProcessor:class extends u{constructor(t){super(),this.no_repeat_ngram_size=t}getNgrams(t){const e=t.length,n=[];for(let r=0;r{const r=n(/*! fs */"?569f"),{getFile:i,isString:o}=n(/*! ./utils.js */"./src/utils.js"),{env:s}=n(/*! ./env.js */"./src/env.js"),a=n(/*! sharp */"?36f4");let u,l,c;if("undefined"!=typeof self)u=OffscreenCanvas,c=self.createImageBitmap,l=ImageData;else{if(!a)throw new Error("Unable to load image processing library.");c=async t=>{let{data:e,info:n}=await t.raw().toBuffer({resolveWithObject:!0});return new d(new Uint8ClampedArray(e),n.width,n.height,n.channels)}}class d{constructor(t,e,n,r){this._update(t,e,n,r)}static async read(t){if(t instanceof d)return t;if(o(t)||t instanceof URL)return await this.fromURL(t);throw new Error("Unsupported input type: "+typeof t)}static async fromURL(t){let e=await i(t),n=await e.blob();return this.fromBlob(n)}static async fromBlob(t){if(u){let e=await c(t);const n=new u(e.width,e.height).getContext("2d");return n.drawImage(e,0,0),new this(n.getImageData(0,0,e.width,e.height).data,e.width,e.height,4)}{let e=a(await t.arrayBuffer());return await c(e)}}grayscale(){if(1===this.channels)return this;let t=new Uint8ClampedArray(this.width*this.height*3);switch(this.channels){case 3:case 4:for(let e=0,n=0;e{t.exports={interpolate:function(t,[e,n,r],[i,o],s="bilinear",a=!1){const u=o/r,l=i/n,c=new t.constructor(i*o*e),d=n*r,h=i*o;for(let s=0;s=0;--t)i[t]=o,r[t]=e[n[t]],o*=r[t];const o=n.map(((t,e)=>i[n.indexOf(e)])),s=new t.constructor(t.length);for(let n=0;n=0;--t)r+=i%e[t]*o[t],i=Math.floor(i/e[t]);s[r]=t[n]}return[s,r]}}},"./src/models.js": -/*!***********************!*\ - !*** ./src/models.js ***! - \***********************/(t,e,n)=>{const{Callable:r,getModelFile:i,fetchJSON:o,dispatchCallback:s,isIntegralNumber:a}=n(/*! ./utils.js */"./src/utils.js"),{Sampler:u}=n(/*! ./samplers.js */"./src/samplers.js"),{LogitsProcessorList:l,GenerationConfig:c,ForceTokensLogitsProcessor:d,ForcedBOSTokenLogitsProcessor:h,ForcedEOSTokenLogitsProcessor:p,WhisperTimeStampLogitsProcessor:f,NoRepeatNGramLogitsProcessor:g,RepetitionPenaltyLogitsProcessor:m}=n(/*! ./generation.js */"./src/generation.js"),{executionProviders:b,ONNX:y}=n(/*! ./backends/onnx.js */"./src/backends/onnx.js"),{Tensor:_,cat:w}=n(/*! ./tensor_utils */"./src/tensor_utils.js"),{InferenceSession:v,Tensor:x}=y;async function T(t,e,n=null){let r=await i(t,e,n);try{return await v.create(r,{executionProviders:b})}catch(t){return console.warn(t),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await v.create(r,{executionProviders:["wasm"]})}}async function S(t,e){try{let n=await t.run(e);return n=function(t){for(let e in t)t[e]instanceof x&&(t[e]=new _(t[e]));return t}(n),n}catch(t){throw console.error(`An error occurred during model execution: "${t}".`),console.error("Inputs given to model:",e),t}}function O(t,e){let n=t.config.pad_token_id??null,r=t.config.eos_token_id??null;a(r)&&(r=[r]);let i=-1!==e.indexOf(n),o=null===r||!r.includes(n);if(i&&o){let t=BigInt64Array.from(e.data.map((t=>t!=n)));return new _("int64",t,e.dims)}return new _("int64",new BigInt64Array(e.data.length).fill(1n),e.dims)}function A(t){return new _("bool",[t],[1])}async function E(t,e){let n=await Promise.all([o(t,"config.json",e),T(t,"encoder_model.onnx",e),T(t,"decoder_model_merged.onnx",e),o(t,"generation_config.json",e,!1)]);return s(e,{status:"loaded",name:t}),n}async function I(t,e,{encoder_input_name:n="input_ids",add_decoder_pkv:r=!0}={}){let i=e.encoder_outputs,o=e.past_key_values;if(null===i){const r={[n]:e[n]};t.session.inputNames.includes("attention_mask")&&(r.attention_mask=e.attention_mask);i=(await S(t.session,r)).last_hidden_state}let s={input_ids:e.decoder_input_ids,encoder_hidden_states:i,use_cache_branch:A(null!==o)};t.decoder_merged_session.inputNames.includes("encoder_attention_mask")&&(s.encoder_attention_mask=e.attention_mask),t.addPastKeyValues(s,o,r);const a=await S(t.decoder_merged_session,s);let u=a.logits;return o=t.getPastKeyValues(a,o),new Kt(u,o,i)}function k(t,e,n,r=!0){let i=[],o=0;for(let n of e){n.dims=[1,...n.dims];let e={inputs:n,encoder_outputs:null,past_key_values:null,output_token_ids:[t.config.decoder_start_token_id],done:!1,score:0,id:o++};r&&(e.attention_mask=O(t,n)),i.push(e)}return i}async function P(t,e,{input_name:n="input_ids"}={}){let r={[n]:e.inputs,decoder_input_ids:t.toI64Tensor(e.output_token_ids.slice(-1)),encoder_outputs:e.encoder_outputs,past_key_values:e.past_key_values};e.attention_mask&&(r.attention_mask=e.attention_mask);let i=await t.forward(r);return e.past_key_values=i.past_key_values,e.encoder_outputs=i.encoder_outputs,i}async function D(t,e){let n=e.past_key_values,r={input_ids:e.input_ids,attention_mask:e.attention_mask,use_cache_branch:A(null!==n)};t.addPastKeyValues(r,n);let i=await S(t.session,r),o=i.logits;return n=t.getPastKeyValues(i,n),{logits:o,past_key_values:n}}function $(t,e,n,r){let i=[],o=0;for(let s of e){let e;s.dims=[1,...s.dims],r?(e=r.get(o),e.dims=[1,...e.dims]):e=O(t,s);let a={input:s,model_input_ids:s,attention_mask:e,past_key_values:null,output_token_ids:[],num_output_tokens:n,done:!1,score:0,id:o++};i.push(a)}return i}async function C(t,e){let n=new BigInt64Array(e.input.data.length+e.output_token_ids.length).fill(1n),r={input_ids:e.model_input_ids,attention_mask:new _("int64",n,[1,n.length]),past_key_values:e.past_key_values},i=await t.forward(r);return e.past_key_values=i.past_key_values,i}function F(t,e){t.output_token_ids=[...t.output_token_ids,e],t.model_input_ids=new _("int64",[BigInt(e)],[1,1])}class M extends r{constructor(t,e){super(),this.config=t,this.session=e}async dispose(){let t=[];for(let e of Object.keys(this)){let n=this[e];n instanceof v&&t.push(n.handler.dispose())}return await Promise.all(t)}static async from_pretrained(t,e=null){let n=await o(t,"config.json",e),r=n.is_encoder_decoder?"encoder_model.onnx":"model.onnx",i=await T(t,r,e);return s(e,{status:"loaded",name:t}),new this(n,i)}toI64Tensor(t){if(t instanceof _)return t;if(0===t.length)throw Error("items must be non-empty");if(Array.isArray(t[0])){if(t.some((e=>e.length!==t[0].length)))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.");return new _("int64",BigInt64Array.from(t.flat().map((t=>BigInt(t)))),[t.length,t[0].length])}return new _("int64",BigInt64Array.from(t.map((t=>BigInt(t)))),[1,t.length])}async _call(t){return await S(this.session,t)}async forward(t){throw Error("forward should be implemented in subclasses.")}_get_logits_processor(t,e,n=null){const r=new l;return null!==t.repetition_penalty&&1!==t.repetition_penalty&&r.push(new m(t.repetition_penalty)),null!==t.no_repeat_ngram_size&&t.no_repeat_ngram_size>0&&r.push(new g(t.no_repeat_ngram_size)),null!==t.forced_bos_token_id&&r.push(new h(t.forced_bos_token_id)),null!==t.forced_eos_token_id&&r.push(new p(t.max_length,t.forced_eos_token_id)),null!==t.forced_decoder_ids&&r.push(new d(t.forced_decoder_ids)),null!==n&&r.extend(n),r}_get_generation_config(t){let e=new c;return"generation_config"in this&&Object.assign(e,this.generation_config),null!==t&&Object.assign(e,t),e}async generate(t,e=null,n=null,{inputs_attention_mask:r=null}={}){if(0===t.length)throw Error("Must supply a non-empty array of input token ids.");e=this._get_generation_config(e),n=n??new l,n=this._get_logits_processor(e,t.length,n);let i=1;const o=i+(e.max_new_tokens??1/0);let s=u.getSampler(e),a=this.getStartBeams(t,i,r);for(;a.some((t=>!t.done))&&it.sort(((t,e)=>e.score-t.score)).slice(0,e.num_beams))),a=t.flat(),e.callback_function&&e.callback_function(a)}return this.groupBeams(a).map((t=>e.num_return_sequences>1?t.slice(0,e.num_return_sequences).map((t=>t.output_token_ids)):[t[0].output_token_ids]))}groupBeams(t){const e={};for(const n of t)void 0===e[n.id]?e[n.id]=[n]:e[n.id].push(n);return Object.values(e)}getPastKeyValues(t,e){const n={};for(const r in t)if(r.startsWith("present")){let i=r.replace("present","past_key_values");null!==e&&r.includes("encoder")?n[i]=e[i]:n[i]=t[r]}return n}addPastKeyValues(t,e,n=!1){if(null===e)if(n){let e=[1,this.num_encoder_heads,0,this.encoder_dim_kv];for(let n=0;n{const{Callable:r,softmax:i,indexOfMax:o,getTopItems:s,cos_sim:a,pathJoin:u,isString:l,getFile:c,dot:d}=n(/*! ./utils.js */"./src/utils.js"),{AutoTokenizer:h}=n(/*! ./tokenizers.js */"./src/tokenizers.js"),{AutoModel:p,AutoModelForSequenceClassification:f,AutoModelForTokenClassification:g,AutoModelForQuestionAnswering:m,AutoModelForMaskedLM:b,AutoModelForSeq2SeqLM:y,AutoModelForCausalLM:_,AutoModelForVision2Seq:w,AutoModelForImageClassification:v,AutoModelForImageSegmentation:x,AutoModelForObjectDetection:T}=n(/*! ./models.js */"./src/models.js"),{AutoProcessor:S,Processor:O}=n(/*! ./processors.js */"./src/processors.js"),{env:A}=n(/*! ./env.js */"./src/env.js"),{Tensor:E,transpose_data:I}=n(/*! ./tensor_utils.js */"./src/tensor_utils.js"),{CustomImage:k}=n(/*! ./image_utils.js */"./src/image_utils.js");async function P(t){return Array.isArray(t)||(t=[t]),t=await Promise.all(t.map((t=>k.read(t))))}class D extends r{constructor(t,e,n){super(),this.task=t,this.tokenizer=e,this.model=n}async dispose(){return await this.model.dispose()}async _call(t){let e=this.tokenizer(t,{padding:!0,truncation:!0});return[e,await this.model(e)]}}class $ extends D{_key=null;async _call(t,e={}){Array.isArray(t)||(t=[t]),this.model.config.prefix&&(t=t.map((t=>this.model.config.prefix+t)));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(t=t.map((t=>n[this.task].prefix+t)));let r=this.tokenizer(t,{padding:!0,truncation:!0}).input_ids,i=(await this.model.generate(r,e)).flat(),o=this.tokenizer.batch_decode(i,{skip_special_tokens:!0});return null!==this._key&&(o=o.map((t=>null===this._key?t:{[this._key]:t}))),o}}const C={"text-classification":{tokenizer:h,pipeline:class extends D{async _call(t,{topk:e=1}={}){let[n,r]=await super._call(t),o=this.model.config.id2label,a=[];for(let t of r.logits){let n=s(i(t.data),e).map((function(t){return{label:o[t[0]],score:t[1]}}));1===e?a.push(...n):a.push(n)}return Array.isArray(t)||1===e?a:a[0]}},model:f,default:{model:"distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:h,pipeline:class extends D{async _call(t,{ignore_labels:e=["O"]}={}){let n=Array.isArray(t);n||(t=[t]);let r=this.tokenizer,[s,a]=await super._call(t),u=a.logits,l=this.model.config.id2label,c=[];for(let t=0;t[t,e])).filter((t=>t[1]>a)),Array.from(i(o.end_logits.get(t).data)).map(((t,e)=>[t,e])).filter((t=>t[1]>a))).filter((t=>t[0][1]<=t[1][1])).map((t=>[t[0][1],t[1][1],t[0][0]*t[1][0]])).sort(((t,e)=>e[2]-t[2]));for(let t=0;t{let e=[...u];return e[l]=t[0],{score:t[1],token:t[0],token_str:o.model.vocab[t[0]],sequence:o.decode(e,{skip_special_tokens:!0})}})))}return Array.isArray(t)?a:a[0]}},model:b,default:{model:"bert-base-uncased"},type:"text"},summarization:{tokenizer:h,pipeline:class extends ${_key="summary_text"},model:y,default:{model:"sshleifer/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:h,pipeline:class extends ${_key="translation_text"},model:y,default:{model:"t5-small"},type:"text"},"text2text-generation":{tokenizer:h,pipeline:$,model:y,default:{model:"google/flan-t5-small"},type:"text"},"text-generation":{tokenizer:h,pipeline:class extends D{async _call(t,e={}){let n="string"==typeof t||t instanceof String;n&&(t=[t]),this.tokenizer.padding_side="left";let r=this.tokenizer(t,{padding:!0,truncation:!0}),i=r.input_ids,o=r.attention_mask,s=(await this.model.generate(i,e,null,{inputs_attention_mask:o})).map(((e,n)=>{let r=t[n].trim();return this.tokenizer.batch_decode(e,{skip_special_tokens:!0}).map((t=>({generated_text:r+t})))}));return n&&1===s.length?s[0]:s}},model:_,default:{model:"gpt2"},type:"text"},"zero-shot-classification":{tokenizer:h,pipeline:class extends D{constructor(t,e,n){super(t,e,n),this.label2id=Object.fromEntries(Object.entries(this.model.config.label2id).map((([t,e])=>[t.toLowerCase(),e]))),this.entailment_id=this.label2id.entailment,void 0===this.entailment_id&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction,void 0===this.contradiction_id&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(t,e,{hypothesis_template:n="This example is {}.",multi_label:r=!1}={}){let o=Array.isArray(t);o||(t=[t]),Array.isArray(e)||(e=[e]);let s=e.map((t=>n.replace("{}",t))),a=r||1===e.length,u=[];for(let n of t){let t,r=[];for(let t of s){let e=this.tokenizer(n,{text_pair:t}),i=await this.model(e);a?r.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):r.push(i.logits.data[this.entailment_id])}t=a?r.map((t=>i(t)[1])):i(r);let o=t.map(((t,e)=>[t,e])).sort(((t,e)=>e[0]-t[0]));u.push({sequence:n,labels:o.map((t=>e[t[1]])),scores:o.map((t=>t[0]))})}return o?u:u[0]}},model:f,default:{model:"typeform/distilbert-base-uncased-mnli"},type:"text"},"automatic-speech-recognition":{tokenizer:h,pipeline:class extends D{constructor(t,e,n,r){super(t,e,n),this.processor=r}async _preprocess(t,e){if(l(t)){if("undefined"==typeof AudioContext)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. As a result, audio data must be passed directly to the processor. If you are running in node.js, you can use an external library (e.g., https://github.com/audiojs/web-audio-api) to do this.");const n=await(await c(t)).arrayBuffer(),r=new AudioContext({sampleRate:e}),i=await r.decodeAudioData(n),o=Math.sqrt(2);let s=i.getChannelData(0),a=i.getChannelData(1);t=new Float32Array(s.length);for(let e=0;e0){if(null===i)i=r/6;else if(r<=i)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const e=u*r,n=u*i,o=e-2*n;let s=0;for(;s=a.length;t.push({stride:[r.length,u?0:n,l?0:n],input_features:i.input_features,is_last:l}),s+=o}}else t=[{stride:[a.length,0,0],input_features:(await this.processor(a)).input_features,is_last:!0}];for(let n of t){let t=await this.model.generate(n.input_features,e);n.tokens=t[0].flat(),n.stride=n.stride.map((t=>t/u)),null!==o&&o(n)}let[d,h]=this.tokenizer._decode_asr(t,{time_precision:l,return_timestamps:n,force_full_sequences:s});c.push({text:d,...h})}return a?c[0]:c}},model:y,processor:S,default:{model:"openai/whisper-tiny.en"},type:"multimodal"},"image-to-text":{tokenizer:h,pipeline:class extends D{constructor(t,e,n,r){super(t,e,n),this.processor=r}async _call(t,e={}){let n=Array.isArray(t);t=await P(t);let r=(await this.processor(t)).pixel_values,i=[];for(let t of r){t.dims=[1,...t.dims];let n=(await this.model.generate(t,e)).flat(),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map((t=>({generated_text:t.trim()})));i.push(r)}return n?i:i[0]}},model:w,processor:S,default:{model:"nlpconnect/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:class extends D{constructor(t,e,n){super(t,null,e),this.processor=n}async _call(t,{topk:e=1}={}){let n=Array.isArray(t);t=await P(t);let r=await this.processor(t),o=await this.model(r),a=this.model.config.id2label,u=[];for(let t of o.logits){let n=s(i(t.data),e).map((function(t){return{label:a[t[0]],score:t[1]}}));1===e?u.push(...n):u.push(n)}return n||1===e?u:u[0]}},model:v,processor:S,default:{model:"google/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:class extends D{constructor(t,e,n){super(t,null,e),this.processor=n,this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(t,{threshold:e=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:o=null,subtask:s=null}={}){if(Array.isArray(t)&&1!==t.length)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");let a=(t=await P(t)).map((t=>[t.height,t.width])),u=await this.processor(t),l=await this.model(u),c=null;if(null!==s)c=this.subtasks_mapping[s];else for(let[t,e]of Object.entries(this.subtasks_mapping))if(e in this.processor.feature_extractor){c=this.processor.feature_extractor[e].bind(this.processor.feature_extractor),s=t;break}let d=[];if("panoptic"!==s&&"instance"!==s)throw"semantic"===s?Error("semantic segmentation not yet supported."):Error(`Subtask ${s} not supported.`);{let t=c(l,e,n,r,i,o??a)[0],s=t.segmentation,u=this.model.config.id2label;for(let e of t.segments_info){let t=new Uint8ClampedArray(s.data.length);for(let n=0;nn.replace("{}",t))),s=this.tokenizer(o,{padding:!0,truncation:!0}),a=await this.processor(t),u=await this.model({...s,...a}),l=[];for(let t of u.logits_per_image){let n=i(t.data);l.push([...n].map(((t,n)=>({score:t,label:e[n]}))))}return r?l:l[0]}},model:p,processor:S,default:{model:"openai/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:class extends D{constructor(t,e,n){super(t,null,e),this.processor=n}async _call(t,{threshold:e=.5,percentage:n=!1}={}){let r=Array.isArray(t);if(r&&1!==t.length)throw Error("Object detection pipeline currently only supports a batch size of 1.");t=await P(t);let i=n?null:t.map((t=>[t.height,t.width])),o=await this.processor(t),s=await this.model(o),a=this.processor.feature_extractor.post_process_object_detection(s,e,i),u=this.model.config.id2label;return a.forEach((t=>t.labels=t.classes.map((t=>u[t])))),r?a:a[0]}},model:T,processor:S,default:{model:"facebook/detr-resnet-50"},type:"multimodal"},embeddings:{tokenizer:h,pipeline:class extends D{_mean_pooling(t,e){let n=[t.dims[0],t.dims[2]],r=new t.data.constructor(n[0]*n[1]),[i,o,s]=t.dims,a=0;for(let n=0;nt+e*e)));for(let n=0;nt.flatMap((t=>e.map((e=>[t,e]))))))}t.exports={pipeline:async function(t,e=null,{progress_callback:n=null}={}){t=j[t]??t;let r=C[t.split("_",1)[0]];if(!r)throw Error(`Unsupported pipeline: ${t}. Must be one of [${Object.keys(C)}]`);e||(e=r.default.model,console.log(`No model specified. Using default model: "${e}".`));let i=F[t];if(!i)for(const[e,n]of Object.entries(M))if(t.startsWith(e)){i=n;break}i||(i=t),e=u(A.remoteModels?A.remoteURL:A.localURL,e,i);let o=r.tokenizer,s=r.model,a=r.pipeline,l=r.processor,c=[];return o&&c.push(h.from_pretrained(e,n)),s&&c.push(s.from_pretrained(e,n)),l&&c.push(l.from_pretrained(e,n)),new a(t,...await Promise.all(c))}}},"./src/processors.js": -/*!***************************!*\ - !*** ./src/processors.js ***! - \***************************/(t,e,n)=>{const{Callable:r,fetchJSON:i,indexOfMax:o,softmax:s}=n(/*! ./utils.js */"./src/utils.js"),a=n(/*! ./fft.js */"./src/fft.js"),{Tensor:u,transpose:l,cat:c,interpolate:d}=n(/*! ./tensor_utils.js */"./src/tensor_utils.js"),{CustomImage:h}=n(/*! ./image_utils.js */"./src/image_utils.js");class p extends r{constructor(t){super(),this.config=t}}class f extends p{constructor(t){super(t),this.image_mean=this.config.image_mean,Array.isArray(this.image_mean)||(this.image_mean=new Array(3).fill(this.image_mean)),this.image_std=this.config.image_std,Array.isArray(this.image_std)||(this.image_std=new Array(3).fill(this.image_std)),this.do_rescale=this.config.do_rescale??!0,this.do_normalize=this.config.do_normalize,this.do_resize=this.config.do_resize,this.size=this.config.size,this.max_size=this.config.max_size,this.do_center_crop=this.config.do_center_crop,this.crop_size=this.config.crop_size}async preprocess(t){const e=t.width,n=t.height;if(this.do_resize)if(void 0!==this.max_size){const r=Math.max(this.size/e,this.size/n),i=e*r,o=n*r,s=Math.min(this.max_size/i,this.max_size/o,1);t=await t.resize(Math.floor(i*s),Math.floor(o*s))}else t=await t.resize(this.size,this.size);t=t.rgb();const r=Float32Array.from(t.data);if(this.do_rescale)for(let t=0;tthis.preprocess(t))))).forEach((t=>t.dims=[1,...t.dims])),{pixel_values:t=c(t)}}}class g extends f{}class m extends f{async _call(t){let e=await super._call(t),n=[e.pixel_values.dims[0],64,64];return e.pixel_mask=new u("int64",new BigInt64Array(n.reduce(((t,e)=>t*e))).fill(1n),n),e}center_to_corners_format([t,e,n,r]){return[t-n/2,e-r/2,t+n/2,e+r/2]}post_process_object_detection(t,e=.5,n=null){const r=t.logits,i=t.pred_boxes,[a,u,l]=r.dims;if(null!==n&&n.length!==a)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let c=[];for(let t=0;te){let e=p.get(t);e=this.center_to_corners_format(e),null!==a&&(e=e.map(((t,e)=>t*a[(e+1)%2]))),d.boxes.push(e),d.classes.push(r),d.scores.push(i)}}c.push(d)}return c}remove_low_and_no_objects(t,e,n,r){let i=[],a=[],u=[];for(let l=0;ln&&(i.push(d),a.push(p),u.push(h))}return[i,a,u]}check_segment_validity(t,e,n,r=.5,i=.8){let o=[],s=0,a=0;for(let i=0;i=r&&++a;let u=s>0&&a>0;if(u){u=s/a>i}return[u,o]}compute_segments(t,e,n,r,i,o=null,s=null){let[a,l]=s??t[0].dims,c=new u("int32",new Int32Array(a*l),[a,l]),h=[];if(null!==s)for(let e=0;ef[e]&&(p[e]=n,f[e]=t[n].data[e])}let g=0;for(let o=0;o>1;++t){const e=(t+1-n)**2/2,r=Math.sqrt(b**2+y**2)**e,i=e*Math.atan2(y,b);let o=2*t;l[o]=r*Math.cos(i),l[o+1]=r*Math.sin(i),c[o]=l[o],c[o+1]=-l[o+1]}const _=l.subarray(r,i),w=new a(o>>1);w.transform(p,c);for(let n=0;n>1,o=i[r]*e[r];d[t]=o*_[t],d[n]=o*_[n]}w.transform(f,d);for(let t=0;tr?o-r:0,n=o>1,u=new Float32Array(s*a);for(let t=0;tthis.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`.");let e=t.slice(0,this.config.n_samples),n=this._extract_fbank_features(e);return{input_features:new u("float32",n.data,[1,...n.dims])}}}class y extends r{constructor(t){super(),this.feature_extractor=t}async _call(t){return await this.feature_extractor(t)}}class _ extends y{async _call(t){return await this.feature_extractor(t)}}t.exports={AutoProcessor:class{static async from_pretrained(t,e=null){let n,r,o=await i(t,"preprocessor_config.json",e);switch(o.feature_extractor_type){case"WhisperFeatureExtractor":r=new b(o);break;case"ViTFeatureExtractor":r=new g(o);break;case"DetrFeatureExtractor":r=new m(o);break;default:if(void 0===o.size)throw new Error(`Unknown Feature Extractor type: ${o.feature_extractor_type}`);console.warn("Feature extractor type not specified, assuming ImageFeatureExtractor due to size parameter in config."),r=new f(o)}if("WhisperProcessor"===o.processor_class)n=_;else n=y;return new n(r)}},Processor:y}},"./src/samplers.js": -/*!*************************!*\ - !*** ./src/samplers.js ***! - \*************************/(t,e,n)=>{const{Callable:r,indexOfMax:i,softmax:o,log_softmax:s,getTopItems:a}=n(/*! ./utils.js */"./src/utils.js");class u extends r{constructor(t){super(),this.temperature=t}_call(t,e=-1){return this.sample(t,e)}sample(t,e){throw Error("sample should be implemented in subclasses.")}getLogits(t,e){let n=t.dims[2],r=t.data;if(-1===e)r=r.slice(-n);else{let t=e*n;r=r.slice(t,t+n)}return this.temperature>0&&(r=r.map((t=>t/this.temperature))),r}randomSelect(t){let e=t.reduce(((t,e)=>t+e),0),n=Math.random()*e;for(let e=0;e1)return new d(t.temperature,t.num_beams,t.do_sample,t.top_k);if(t.do_sample)return new c(t.temperature,t.top_k);if(t.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${t.num_return_sequences}.`);return new l(t.temperature)}}class l extends u{sample(t,e=-1){let n=this.getLogits(t,e);return[[i(n),0]]}}class c extends u{constructor(t,e){super(t),this.k=e}sample(t,e=-1){let[n,r,i]=t.dims,s=i;this.k>0&&(s=Math.min(this.k,s));let u=this.getLogits(t,e),l=a(u,s),c=o(l.map((t=>t[1]))),d=this.randomSelect(c);return[[l[d][0],Math.log(c[d])]]}}class d extends u{constructor(t,e,n,r){super(t),this.num_beams=e,this.do_sample=n,this.top_k=r}sample(t,e=-1){let n=this.getLogits(t,e);if(this.do_sample||this.top_k>0){const[e,r,i]=t.dims;let s=i;this.top_k>0&&(s=Math.min(this.top_k,s));const u=a(n,s),l=o(u.map((t=>t[1])));return Array.from({length:this.num_beams},(()=>{const t=this.randomSelect(l);return[u[t][0],Math.log(l[t])]}))}{const t=s(n);return a(t,this.num_beams)}}}t.exports={Sampler:u,GreedySampler:l,TopKSampler:c,BeamSearchSampler:d}},"./src/tensor_utils.js": -/*!*****************************!*\ - !*** ./src/tensor_utils.js ***! - \*****************************/(t,e,n)=>{const{ONNX:r}=n(/*! ./backends/onnx.js */"./src/backends/onnx.js"),{interpolate:i,transpose:o}=n(/*! ./math_utils.js */"./src/math_utils.js"),s=r.Tensor;class a extends s{constructor(...t){t[0]instanceof r.Tensor?super(t[0].type,t[0].data,t[0].dims):super(...t)}*[Symbol.iterator](){const[t,...e]=this.dims;if(e.length>0){const n=e.reduce(((t,e)=>t*e));for(let r=0;r0){const n=e.reduce(((t,e)=>t*e));return this._subarray(t,n,e)}return this.data[t]}indexOf(t){for(let e=0;et*e));if(n!==r)throw Error(`cannot reshape array of size ${n} into shape (${e})`);let i=t;for(let t=e.length-1;t>=0;t--)i=i.reduce(((n,r)=>{let i=n[n.length-1];return i.length{const{Callable:r,fetchJSON:i,reverseDictionary:o,escapeRegExp:s,isIntegralNumber:a,min:u}=n(/*! ./utils.js */"./src/utils.js"),{Tensor:l}=n(/*! ./tensor_utils.js */"./src/tensor_utils.js");class c extends r{constructor(t){super(),this.config=t}static fromConfig(t,...e){switch(t.type){case"WordPiece":return new d(t);case"Unigram":return new h(t,...e);case"BPE":return new g(t,...e);default:throw new Error(`Unknown TokenizerModel type: ${t.type}`)}}_call(t){return this.encode(t)}encode(t){throw Error("encode should be implemented in subclass.")}convert_tokens_to_ids(t){return t.map((t=>this.tokens_to_ids[t]??this.unk_token_id))}convert_ids_to_tokens(t){return t.map((t=>this.vocab[t]??this.unk_token))}}class d extends c{constructor(t){super(t),this.tokens_to_ids=t.vocab,this.unk_token_id=this.tokens_to_ids[t.unk_token],this.unk_token=t.unk_token;let e=Object.entries(this.tokens_to_ids);this.vocab=Array(e.length);for(const[t,n]of e)this.vocab[n]=t}encode(t){let e=[];for(let n of t){let t=[...n],r=!1,i=0,o=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.vocab.includes(r)){n=r;break}--e}if(null==n){r=!0;break}o.push(n),i=e}r?e.push(this.unk_token):e.push(...o)}return e}}class h extends c{constructor(t,e){super(t),this.vocab=t.vocab.map((t=>t[0])),this.scores=t.vocab.map((t=>t[1])),this.unk_token_id=t.unk_id,this.unk_token=this.vocab[t.unk_id],this.tokens_to_ids=Object.fromEntries(this.vocab.map(((t,e)=>[t,e]))),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids[this.bosToken],this.eosToken=e.eos_token,this.eosTokenId=this.tokens_to_ids[this.eosToken],this.unkToken=this.vocab[this.unk_token_id],this.minScore=u(this.scores),this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new et,this.trie.extend(this.vocab)}populateNodes(t){const e=t.sentence,n=e.length;let r=0;for(;r{const t=[...Array.from({length:"~".charCodeAt(0)-"!".charCodeAt(0)+1},((t,e)=>e+"!".charCodeAt(0))),...Array.from({length:"¬".charCodeAt(0)-"¡".charCodeAt(0)+1},((t,e)=>e+"¡".charCodeAt(0))),...Array.from({length:"ÿ".charCodeAt(0)-"®".charCodeAt(0)+1},((t,e)=>e+"®".charCodeAt(0)))];let e=t.slice(),n=0;for(let r=0;r<256;r++)t.includes(r)||(t.push(r),e.push(256+n),n+=1);let r=e.map((t=>String.fromCharCode(t)));return Object.fromEntries(t.map(((t,e)=>[t,r[e]])))})(),f=o(p);class g extends c{constructor(t){super(t),this.tokens_to_ids=t.vocab,this.unk_token_id=this.tokens_to_ids[t.unk_token],this.unk_token=t.unk_token;let e=Object.entries(this.tokens_to_ids);this.vocab=Array(e.length);for(const[t,n]of e)this.vocab[n]=t;this.bpe_ranks=Object.fromEntries(t.merges.map(((t,e)=>[t,e]))),this.merges=t.merges.map((t=>t.split(/\s+/))),this.end_of_word_suffix=t.end_of_word_suffix,this.byte_encoder=p,this.text_encoder=new TextEncoder,this.cache={}}get_pairs(t){let e=new Set,n=t[0];for(let r=1;r(this.bpe_ranks[t]??1/0)<=(this.bpe_ranks[e]??1/0)?t:e));if(!(t in this.bpe_ranks))break;let[r,i]=t.split(/\s+/g),o=[],s=0,a=-1;for(;sthis.byte_encoder[t])).join("");let t=this.bpe(n).split(" ");e.push(...t)}return e}}class m extends r{constructor(t){super(),this.config=t}static fromConfig(t){if(null===t)return null;switch(t.type){case"BertNormalizer":return new T(t);case"Precompiled":return new N(t);case"Sequence":return new x(t);case"Replace":return new b(t);case"NFC":return new y(t);case"NFKD":return new _(t);case"StripAccents":return new w(t);case"Lowercase":return new v(t);default:throw new Error(`Unknown Normalizer type: ${t.type}`)}}normalize(t){throw Error("normalize should be implemented in subclass.")}_call(t){return this.normalize(t)}}class b extends m{normalize(t){return this.config.pattern.Regex?t=t.replace(new RegExp(this.config.pattern.Regex,"g"),this.config.content):this.config.pattern.String?t=t.replace(this.config.pattern.String,this.config.content):console.warn("Unknown pattern type:",this.config.pattern),t}}class y extends m{normalize(t){return t=t.normalize("NFC")}}class _ extends m{normalize(t){return t=t.normalize("NFKD")}}class w extends m{normalize(t){return t=t.replace(/[\u0300-\u036f]/g,"")}}class v extends m{normalize(t){return t=t.toLowerCase()}}class x extends m{constructor(t){super(t),this.normalizers=t.normalizers.map((t=>m.fromConfig(t)))}normalize(t){for(let e of this.normalizers)t=e.normalize(t);return t}}class T extends m{_tokenize_chinese_chars(t){let e=[];for(let n=0;n=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=63744&&t<=64255||t>=194560&&t<=195103}stripAccents(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}normalize(t){return this.config.handle_chinese_chars&&(t=this._tokenize_chinese_chars(t)),this.config.lowercase?(t=t.toLowerCase(),!1!==this.config.strip_accents&&(t=this.stripAccents(t))):this.config.strip_accents&&(t=this.stripAccents(t)),t}}class S extends r{static fromConfig(t){switch(t.type){case"BertPreTokenizer":return new O(t);case"Sequence":return new L(t);case"WhitespaceSplit":return new R(t);case"Metaspace":return new M(t);case"ByteLevel":return new A(t);case"Split":return new E(t);default:throw new Error(`Unknown PreTokenizer type: ${t.type}`)}}pre_tokenize_text(t){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(t){let e=[];return e=Array.isArray(t)?t.map((t=>this.pre_tokenize_text(t))):this.pre_tokenize_text(t),e.flat()}_call(t){return this.pre_tokenize(t)}}class O extends S{constructor(t){super(),this.pattern=/\b\p{L}+\b|[^\s\p{L}]+/gu}pre_tokenize_text(t){return t.trim().match(this.pattern)||[]}}class A extends S{constructor(t){super(),this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu}pre_tokenize_text(t){return t.match(this.pattern)||[]}}class E extends S{constructor(t){super(),this.config=t}pre_tokenize_text(t){return this.config.pattern.Regex?t.match(new RegExp(this.config.pattern.Regex,"gu"))||[]:this.config.pattern.String?t.match(this.config.pattern.String)||[]:(console.warn("Unknown pattern type:",this.config.pattern),[])}}class I extends r{static fromConfig(t){switch(t.type){case"TemplateProcessing":return new P(t);case"ByteLevel":return new D(t);case"RobertaProcessing":return new k(t);default:throw new Error(`Unknown PostProcessor type: ${t.type}`)}}post_process(t,...e){throw Error("post_process should be implemented in subclass.")}_call(t,...e){return this.post_process(t,...e)}}class k extends I{constructor(t){super(),this.config=t}post_process(t,e=null){return t=[this.config.cls[0],...t,this.config.sep[0]],null!==e&&(t=[...t,this.config.sep[0],...e,this.config.sep[0]]),t}}class P extends I{constructor(t){super(),this.config=t}post_process(t,e=null){let n=null===e?this.config.single:this.config.pair,r=[];for(let i of n)"SpecialToken"in i?r.push(i.SpecialToken.id):"Sequence"in i&&("A"===i.Sequence.id?r.push(...t):"B"===i.Sequence.id&&r.push(...e));return r}}class D extends I{constructor(t){super(),this.config=t}post_process(t){return t}}class $ extends r{constructor(t){super(),this.config=t}static fromConfig(t){switch(t.type){case"WordPiece":return new C(t);case"Metaspace":return new j(t);case"ByteLevel":return new F(t);default:throw new Error(`Unknown Decoder type: ${t.type}`)}}convert_tokens_to_string(t){return t.join("").trim()}_call(t){return this.decode(t)}decode(t){throw Error("decode should be implemented in subclass.")}}class C extends ${constructor(t){super(t),this.convertRegex=new RegExp(` ${t.prefix}`,"g"),this.cleanup=t.cleanup}convert_tokens_to_string(t){return t.join(" ").replace(this.convertRegex,"").trim()}decode(t){return this.convert_tokens_to_string(t)}}class F extends ${constructor(t){super(t),this.byte_decoder=f,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(t){let e=t.join("");this.config.trim_offsets?e=e.trim():this.config.add_prefix_space&&(e=" "+e);let n=new Uint8Array([...e].map((t=>this.byte_decoder[t]))),r=this.text_decoder.decode(n);return this.end_of_word_suffix&&(r=r.replaceAll(this.end_of_word_suffix," ").trim()),r}decode(t){let e=[],n=[];for(let r of t)this.added_tokens.includes(r)?(n.length>0&&(e.push(this.convert_tokens_to_string(n)),n=[]),e.push(r)):n.push(r);return n.length>0&&e.push(this.convert_tokens_to_string(n)),e.join("")}}class M extends S{constructor(t){super(),this.addPrefixSpace=t.add_prefix_space,this.replacement=t.replacement,this.strRep=t.str_rep||this.replacement}pre_tokenize(t){("string"==typeof t||t instanceof String)&&(t=t.split(/\s+/));const e=[];for(let n of t){let t=n.replace(" ",this.strRep);this.addPrefixSpace&&!t.startsWith(this.replacement)&&(t=this.strRep+t),e.push(t)}return e}}class j extends ${constructor(t){super(t),this.addPrefixSpace=t.add_prefix_space,this.replacement=t.replacement}decode(t){let e=[],n=0;for(let r of t){let t=r.replace(this.replacement," ");this.addPrefixSpace&&0==n&&t.startsWith(" ")&&(t=t.substring(1)),e.push(t),++n}return this.convert_tokens_to_string(e)}}class N extends m{constructor(t){super(t),this.charsmap=t.precompiled_charsmap}normalize(t){return t}}class L extends S{constructor(t){super(),this.tokenizers=t.pretokenizers.map((t=>S.fromConfig(t)))}pre_tokenize_text(t){return"string"==typeof t&&(t=[t]),this.tokenizers.reduce(((t,e)=>e.pre_tokenize(t)),t)}}class R extends S{constructor(t){super()}pre_tokenize_text(t){return t.split(/\s+/)}}class z extends r{constructor(t,e){super(),this.tokenizerJSON=t,this.tokenizerConfig=e,this.normalizer=m.fromConfig(t.normalizer),this.pre_tokenizer=S.fromConfig(t.pre_tokenizer),this.model=c.fromConfig(t.model,e),this.post_processor=I.fromConfig(t.post_processor),this.decoder=$.fromConfig(t.decoder),this.decoder.added_tokens=[],this.decoder.end_of_word_suffix=this.model.end_of_word_suffix,this.special_tokens=[],this.all_special_ids=[];for(let e of t.added_tokens){let t=e.id,n=e.content;this.decoder.added_tokens.push(n),this.model.tokens_to_ids[n]=t,this.model.vocab[t]=n,e.special&&(this.special_tokens.push(n),this.all_special_ids.push(t))}this.special_tokens_regex=new RegExp("("+this.special_tokens.map(s).join("|")+")"),this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids[this.mask_token],this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids[this.pad_token],this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids[this.sep_token],this.model_max_length=this.tokenizerConfig.model_max_length,this.remove_space=this.tokenizerConfig.remove_space,this.padding_side="right"}getToken(...t){for(let e of t){let t=this.tokenizerConfig[e];if(t){if("object"==typeof t){if("AddedToken"===t.__type)return t.content;throw Error(`Unknown token: ${t}`)}return t}}return null}static async from_pretrained(t,e=null){let[n,r]=await Promise.all([i(t,"tokenizer.json",e),i(t,"tokenizer_config.json",e)]);return new this(n,r)}prepare_model_inputs(t){return t}_call(t,{text_pair:e=null,padding:n=!1,truncation:r=null,max_length:i=null,return_tensor:o=!0}={}){let s;if(Array.isArray(t)){if(0===t.length)throw Error("text array must be non-empty");if(null!==e){if(!Array.isArray(e))throw Error("text_pair must also be an array");if(t.length!==e.length)throw Error("text and text_pair must have the same length");s=t.map(((t,n)=>this.encode(t,e[n])))}else s=t.map((t=>this.encode(t)))}else{if(null===t)throw Error("text may not be null");if(Array.isArray(e))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");s=[this.encode(t,e)]}let a=Math.max(...s.map((t=>t.length)));null===i&&(i=a),i=Math.min(i,this.model_max_length);let u=[];if(n||r)for(let t=0;ti)r&&(s[t]=s[t].slice(0,i)),u.push(new Array(s[t].length).fill(1));else if(n){let e=i-s[t].length;"right"===this.padding_side?(u.push(new Array(s[t].length).fill(1).concat(new Array(e).fill(0))),s[t].push(...new Array(e).fill(this.pad_token_id))):(u.push(new Array(e).fill(0).concat(new Array(s[t].length).fill(1))),s[t].unshift(...new Array(e).fill(this.pad_token_id)))}else u.push(new Array(s[t].length).fill(1));else u.push(new Array(s[t].length).fill(1));else u=s.map((t=>new Array(t.length).fill(1)));if(o){if((!n||!r)&&s.some((t=>t.length!==s[0].length)))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");let t=[s.length,s[0].length];s=new l("int64",BigInt64Array.from(s.flat().map(BigInt)),t),u=new l("int64",BigInt64Array.from(u.flat().map(BigInt)),t)}let c={input_ids:s,attention_mask:u};return c=this.prepare_model_inputs(c),c}_encode_text(t){if(null===t)return null;return t.split(this.special_tokens_regex).filter((t=>t)).map((t=>{if(this.special_tokens.includes(t))return t;{!0===this.remove_space&&(t=t.trim().split(/\s+/).join(" ")),null!==this.normalizer&&(t=this.normalizer(t));let e=this.pre_tokenizer(t);return this.model(e)}})).flat()}encode(t,e=null){let n=this._encode_text(t),r=this._encode_text(e),i=this.post_processor(n,r);return this.model.convert_tokens_to_ids(i)}clean_up_tokenization(t){return t.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}batch_decode(t,e={}){return t.map((t=>this.decode(t,e)))}decode(t,e={}){if(!Array.isArray(t)||0===t.length||!a(t[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(t,e)}decode_single(t,{skip_special_tokens:e=!1,clean_up_tokenization_spaces:n=!0}){let r=this.model.convert_ids_to_tokens(t);e&&(r=r.filter((t=>!this.special_tokens.includes(t))));let i=this.decoder(r);return"cleanup"in this.decoder&&this.decoder.cleanup!==n&&(console.warn(`clean_up_tokenization_spaces disagrees with decoder's cleanup setting. Overriding to use decoder's cleanup setting (${this.decoder.cleanup})`),n=this.decoder.cleanup),n&&(i=this.clean_up_tokenization(i)),i}}function U(t){return t.token_type_ids=new l("int64",new BigInt64Array(t.input_ids.data.length),t.input_ids.dims),t}class B extends z{prepare_model_inputs(t){return U(t)}}class V extends z{prepare_model_inputs(t){return U(t)}}class G extends z{prepare_model_inputs(t){return U(t)}}class q extends z{prepare_model_inputs(t){return U(t)}}class H extends z{}class W extends z{}class X extends z{}class Y extends z{}class K extends z{}class Z extends z{static LANGUAGES={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese"};_decode_asr(t,{return_timestamps:e=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(null===r)throw Error("Must specify time_precision");let o=null;function s(){return{language:o,timestamp:[null,null],text:""}}const a=[];let u=s(),l=0;const c=this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1;let d=[],h=!1,p=null;const f=new Set(this.all_special_ids);for(let n of t){const t=n.tokens;let i=null,g=c;if("stride"in n){const[e,o,s]=n.stride;if(l-=o,p=e-s,o&&(g=o/r+c),s)for(let e=t.length-1;e>=0;--e){const n=t[e];if(n>=c){if(null!==i&&(n-c)*r=c){const t=(n-c)*r+l,e=Math.round(100*t)/100;if(null!==i&&n>=i)h=!0;else if(h||d.length>0&&n0?d.push(m):d.every((t=>0===t.length))&&(u=s(),d=[],m=[])}if(d.length>0){if(i&&e)throw new Error("There was an error while processing timestamps, we haven't found a timestamp as last token.");const t=this.findLongestCommonSequence(d),n=this.decode(t);u.text=n,a.push(u)}let g={};const m=a.map((t=>t.text)).join("");if(e||n){for(let t=0;tt===p[e])).length,g=f/t+r;f>1&&g>s&&(s=g,a=[i,l,d,h])}const[l,c,d,h]=a,p=Math.floor((c+l)/2),f=Math.floor((h+d)/2);r.push(...e.slice(0,p)),e=o.slice(f),n=e.length}return r.push(...e),r}}class J extends z{}class Q extends z{}class tt extends z{constructor(t,e){super(t,e),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter((t=>this.languageRegex.test(t)))}_encode_text(t){if(null===t)return null;let[e,...n]=t.trim().split(this.languageRegex);if(0===n.length)return super._encode_text(e);if(2===n.length){let[t,e]=n;return this.supported_language_codes.includes(t)||console.warn(`Unsupported language code "${t}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),[t,...super._encode_text(e)]}}}class et{constructor(){this.root=nt.default()}extend(t){for(let e of t)this.push(e)}push(t){let e=this.root;for(let n of t){let t=e.children.get(n);void 0===t&&(t=nt.default(),e.children.set(n,t)),e=t}e.isLeaf=!0}*commonPrefixSearch(t){let e=this.root,n="";for(let r=0;rn)&&(r=i.clone(),n=e)}if(null===r)return[];t.prev=r,t.backtraceScore=n}e++}const n=[],r=this.beginNodes[t][0].prev;if(null===r)return[];let i=r.clone();for(;null!==i.prev;){n.push(i.clone());const t=i.clone();i=t.prev.clone()}return n.reverse(),n}piece(t){return this.sentence.slice(t.pos,t.pos+t.length)}tokens(){return this.viterbi().map((t=>this.piece(t)))}tokenIds(){return this.viterbi().map((t=>t.tokenId))}}class it{constructor(t,e,n,r,i){this.tokenId=t,this.nodeId=e,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtraceScore=0}clone(){const t=new it(this.tokenId,this.nodeId,this.pos,this.length,this.score);return t.prev=this.prev,t.backtraceScore=this.backtraceScore,t}}t.exports={AutoTokenizer:class{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:W,DistilBertTokenizer:H,BertTokenizer:B,MobileBertTokenizer:G,SqueezeBertTokenizer:q,AlbertTokenizer:V,GPT2Tokenizer:X,BartTokenizer:Y,RobertaTokenizer:K,WhisperTokenizer:Z,CodeGenTokenizer:J,CLIPTokenizer:Q,MarianTokenizer:tt};static async from_pretrained(t,e=null){let[n,r]=await Promise.all([i(t,"tokenizer.json",e),i(t,"tokenizer_config.json",e)]),o=this.TOKENIZER_CLASS_MAPPING[r.tokenizer_class];return o||(console.warn(`Unknown tokenizer class "${r.tokenizer_class}", attempting to construct from base class.`),o=z),new o(n,r)}},BertTokenizer:B,DistilBertTokenizer:H,T5Tokenizer:W,GPT2Tokenizer:X}},"./src/transformers.js": -/*!*****************************!*\ - !*** ./src/transformers.js ***! - \*****************************/(t,e,n)=>{const{AutoTokenizer:r,BertTokenizer:i,DistilBertTokenizer:o,T5Tokenizer:s,GPT2Tokenizer:a}=n(/*! ./tokenizers.js */"./src/tokenizers.js"),{AutoModel:u,AutoModelForSequenceClassification:l,AutoModelForTokenClassification:c,AutoModelForSeq2SeqLM:d,AutoModelForCausalLM:h,AutoModelForMaskedLM:p,AutoModelForQuestionAnswering:f,AutoModelForVision2Seq:g,AutoModelForImageClassification:m,AutoModelForObjectDetection:b}=n(/*! ./models.js */"./src/models.js"),{AutoProcessor:y}=n(/*! ./processors.js */"./src/processors.js"),{pipeline:_}=n(/*! ./pipelines.js */"./src/pipelines.js"),{env:w}=n(/*! ./env.js */"./src/env.js"),{Tensor:v}=n(/*! ./tensor_utils.js */"./src/tensor_utils.js"),x={AutoTokenizer:r,BertTokenizer:i,DistilBertTokenizer:o,T5Tokenizer:s,GPT2Tokenizer:a,AutoModel:u,AutoModelForSeq2SeqLM:d,AutoModelForSequenceClassification:l,AutoModelForTokenClassification:c,AutoModelForCausalLM:h,AutoModelForMaskedLM:p,AutoModelForQuestionAnswering:f,AutoModelForVision2Seq:g,AutoModelForImageClassification:m,AutoModelForObjectDetection:b,AutoProcessor:y,pipeline:_,Tensor:v,env:w};"undefined"!=typeof self&&Object.assign(self,x),t.exports=x},"./src/utils.js": -/*!**********************!*\ - !*** ./src/utils.js ***! - \**********************/(t,e,n)=>{const r=n(/*! fs */"?569f"),{env:i}=n(/*! ./env.js */"./src/env.js");if(void 0===n.g.ReadableStream&&"undefined"!=typeof process)try{n.g.ReadableStream=Object(function(){var t=new Error("Cannot find module 'node:stream/web'");throw t.code="MODULE_NOT_FOUND",t}())}catch(t){console.warn("ReadableStream not defined and unable to import from node:stream/web")}class o{constructor(t){if(this.filePath=t,this.headers={},this.headers.get=t=>this.headers[t],this.exists=r.existsSync(t),this.exists){this.status=200,this.statusText="OK";let e=r.statSync(t);this.headers["content-length"]=e.size,this.updateContentType();let n=this;this.body=new ReadableStream({start(t){n.arrayBuffer().then((e=>{t.enqueue(new Uint8Array(e)),t.close()}))}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){switch(this.filePath.toString().split(".").pop().toLowerCase()){case"txt":this.headers["content-type"]="text/plain";break;case"html":this.headers["content-type"]="text/html";break;case"css":this.headers["content-type"]="text/css";break;case"js":this.headers["content-type"]="text/javascript";break;case"json":this.headers["content-type"]="application/json";break;case"png":this.headers["content-type"]="image/png";break;case"jpg":case"jpeg":this.headers["content-type"]="image/jpeg";break;case"gif":this.headers["content-type"]="image/gif";break;default:this.headers["content-type"]="application/octet-stream"}}clone(){let t=new o(this.filePath);return t.exists=this.exists,t.status=this.status,t.statusText=this.statusText,t.headers=this.headers,t}async arrayBuffer(){return(await r.promises.readFile(this.filePath)).buffer}async blob(){const t=await r.promises.readFile(this.filePath);return new Blob([t],{type:this.headers["content-type"]})}async text(){return await r.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}async function s(t){return i.useFS&&!function(t){let e;try{e=new URL(t)}catch(t){return!1}return"http:"===e.protocol||"https:"===e.protocol}(t)?new o(t):fetch(t)}function a(t,e){null!==t&&t(e)}async function u(t,e,n=null,r=!0){let o;a(n,{status:"initiate",name:t,file:e}),i.useCache&&(o=await caches.open("transformers-cache"));const u=l(t,e);let c,d;if(!i.useCache||void 0===(c=await o.match(u))){if(c=await s(u),404===c.status){if(r)throw Error(`File not found. Could not locate "${u}".`);return null}i.useCache&&(d=c.clone())}a(n,{status:"download",name:t,file:e});const h=await async function(t,e){const n=t.headers.get("Content-Length");null===n&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let r=parseInt(n??"0"),i=new Uint8Array(r),o=0;const s=t.body.getReader();async function a(){const{done:t,value:n}=await s.read();if(t)return;let u=o+n.length;if(u>r){r=u;let t=new Uint8Array(r);t.set(i),i=t}i.set(n,o),o=u;return e({progress:o/r*100,loaded:o,total:r}),a()}return await a(),i}(c,(r=>{a(n,{status:"progress",...r,name:t,file:e})}));return void 0!==d&&void 0===await o.match(u)&&o.put(u,d),a(n,{status:"done",name:t,file:e}),h}function l(...t){return(t=t.map(((e,n)=>(n&&(e=e.replace(new RegExp("^/"),"")),n!==t.length-1&&(e=e.replace(new RegExp("/$"),"")),e)))).join("/")}function c(t){const e=p(t),n=t.map((t=>Math.exp(t-e))),r=n.reduce(((t,e)=>t+e),0);return n.map((t=>t/r))}function d(t,e){return t.reduce(((t,n,r)=>t+n*e[r]),0)}function h(t){return Math.sqrt(t.reduce(((t,e)=>t+e*e),0))}function p(t){if(0===t.length)throw Error("Array must not be empty");let e=t[0];for(let n=1;ne&&(e=t[n]);return e}t.exports={Callable:class extends Function{constructor(){super();let t=function(...e){return t._call(...e)};return Object.setPrototypeOf(t,new.target.prototype)}_call(...t){throw Error("Must implement _call method in subclass")}},getModelFile:u,dispatchCallback:a,fetchJSON:async function(t,e,n=null,r=!0){let i=await u(t,e,n,r);if(null===i)return{};let o=new TextDecoder("utf-8").decode(i);return JSON.parse(o)},pathJoin:l,reverseDictionary:function(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[e,t])))},indexOfMax:function(t){if(0===t.length)return-1;for(var e=t[0],n=0,r=1;re&&(n=r,e=t[r]);return n},softmax:c,log_softmax:function(t){return c(t).map((t=>Math.log(t)))},escapeRegExp:function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},getTopItems:function(t,e=0){return t=Array.from(t).map(((t,e)=>[e,t])).sort(((t,e)=>e[1]-t[1])),e>0&&(t=t.slice(0,e)),t},dot:d,cos_sim:function(t,e){return d(t,e)/(h(t)*h(e))},magnitude:h,getFile:s,isIntegralNumber:function(t){return Number.isInteger(t)||"bigint"==typeof t},isString:function(t){return"string"==typeof t||t instanceof String},exists:function(t){return null!=t},min:function(t){if(0===t.length)throw Error("Array must not be empty");let e=t[0];for(let n=1;n{},"?3f59": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/()=>{},"?36f4": -/*!***********************!*\ - !*** sharp (ignored) ***! - \***********************/()=>{}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/transformers.js")})(); -//# sourceMappingURL=transformers.min.js.map \ No newline at end of file diff --git a/dist/transformers.min.js.map b/dist/transformers.min.js.map deleted file mode 100644 index 7915e227e..000000000 --- a/dist/transformers.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dist/transformers.min.js","mappings":";;;wJAEA,MAAMA,EAAW,CAAC,EACZC,EAA2B,GAWpBC,EAAkB,CAACC,EAAMC,EAASC,KAC3C,IAAID,GAAmC,mBAAjBA,EAAQE,MAA+D,mBAAjCF,EAAQG,qBA6BpE,MAAM,IAAIC,UAAU,uBA7BpB,CACI,MAAMC,EAAiBT,EAASG,GAChC,QAAuBO,IAAnBD,EACAT,EAASG,GAAQ,CAAEC,UAASC,gBAE3B,IAAII,EAAeJ,SAAWA,EAE/B,OAEC,GAAII,EAAeJ,WAAaA,GAC7BI,EAAeL,UAAYA,EAC3B,MAAM,IAAIO,MAAM,4BAA4BR,qBAAwBE,IAE5E,CACA,GAAIA,GAAY,EAAG,CACf,MAAMO,EAAIX,EAAyBY,QAAQV,IAChC,IAAPS,GACAX,EAAyBa,OAAOF,EAAG,GAEvC,IAAK,IAAIA,EAAI,EAAGA,EAAIX,EAAyBc,OAAQH,IACjD,GAAIZ,EAASC,EAAyBW,IAAIP,UAAYA,EAElD,YADAJ,EAAyBa,OAAOF,EAAG,EAAGT,GAI9CF,EAAyBe,KAAKb,EAClC,CAEJ,CAC0C,EAUjCc,EAAiBC,MAAOC,IACjC,MAAMC,EAAuC,IAAxBD,EAAaJ,OAAed,EAA2BkB,EACtEE,EAAS,GACf,IAAK,MAAMC,KAAeF,EAAc,CACpC,MAAMG,EAAcvB,EAASsB,GAC7B,GAAIC,EAAa,CACb,GAAIA,EAAYC,YACZ,OAAOD,EAAYnB,QAElB,GAAImB,EAAYE,QACjB,SAEJ,MAAMC,IAAmBH,EAAYI,YACrC,IAMI,OALKD,IACDH,EAAYI,YAAcJ,EAAYnB,QAAQE,cAE5CiB,EAAYI,YAClBJ,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AHAha,oBAAoB0hG,GAAUnnF,EAAQA,EAAOP,QAASynF,qBAG/ClnF,EAAOP,OACf,CCrBAynF,oBAAoBlgG,EAAI,CAACyY,EAAS4nF,KACjC,IAAI,IAAIzoG,KAAOyoG,EACXH,oBAAoB7gG,EAAEghG,EAAYzoG,KAASsoG,oBAAoB7gG,EAAEoZ,EAAS7gB,IAC5EP,OAAOmsB,eAAe/K,EAAS7gB,EAAK,CAAEm8B,YAAY,EAAM75B,IAAKmmG,EAAWzoG,IAE1E,ECNDsoG,oBAAoBhgG,EAAI,WACvB,GAA0B,iBAAfk9D,WAAyB,OAAOA,WAC3C,IACC,OAAOrnE,MAAQ,IAAIsnE,SAAS,cAAb,EAChB,CAAE,MAAO5nE,GACR,GAAsB,iBAAX+K,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxB0/F,oBAAoB7gG,EAAI,CAACk/D,EAAKsP,IAAUx2E,OAAO+b,UAAUvb,eAAeC,KAAKymE,EAAKsP,GCClFqyB,oBAAoBrhG,EAAK4Z,IACH,oBAAX6kD,QAA0BA,OAAOC,aAC1ClmE,OAAOmsB,eAAe/K,EAAS6kD,OAAOC,YAAa,CAAEnnE,MAAO,WAE7DiB,OAAOmsB,eAAe/K,EAAS,aAAc,CAAEriB,OAAO,GAAO,ECF9D,IAAIonE,oBAAsB0iC,oBAAoB,wB","sources":["webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/backend-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/env-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/env.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/inference-session.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/tensor-impl.js","webpack://@xenova/transformers/./node_modules/onnxruntime-common/dist/lib/tensor.js","webpack://@xenova/transformers/./node_modules/onnxruntime-web/dist/ort-web.min.js","webpack://@xenova/transformers/./src/backends/onnx.js","webpack://@xenova/transformers/./src/env.js","webpack://@xenova/transformers/./src/fft.js","webpack://@xenova/transformers/./src/generation.js","webpack://@xenova/transformers/./src/image_utils.js","webpack://@xenova/transformers/./src/math_utils.js","webpack://@xenova/transformers/./src/models.js","webpack://@xenova/transformers/./src/pipelines.js","webpack://@xenova/transformers/./src/processors.js","webpack://@xenova/transformers/./src/samplers.js","webpack://@xenova/transformers/./src/tensor_utils.js","webpack://@xenova/transformers/./src/tokenizers.js","webpack://@xenova/transformers/./src/transformers.js","webpack://@xenova/transformers/./src/utils.js","webpack://@xenova/transformers/webpack/bootstrap","webpack://@xenova/transformers/webpack/runtime/define property getters","webpack://@xenova/transformers/webpack/runtime/global","webpack://@xenova/transformers/webpack/runtime/hasOwnProperty shorthand","webpack://@xenova/transformers/webpack/runtime/make namespace object","webpack://@xenova/transformers/webpack/startup"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nconst backends = {};\nconst backendsSortedByPriority = [];\n/**\n * Register a backend.\n *\n * @param name - the name as a key to lookup as an execution provider.\n * @param backend - the backend object.\n * @param priority - an integer indicating the priority of the backend. Higher number means higher priority. if priority\n * < 0, it will be considered as a 'beta' version and will not be used as a fallback backend by default.\n *\n * @internal\n */\nexport const registerBackend = (name, backend, priority) => {\n if (backend && typeof backend.init === 'function' && typeof backend.createSessionHandler === 'function') {\n const currentBackend = backends[name];\n if (currentBackend === undefined) {\n backends[name] = { backend, priority };\n }\n else if (currentBackend.priority > priority) {\n // same name is already registered with a higher priority. skip registeration.\n return;\n }\n else if (currentBackend.priority === priority) {\n if (currentBackend.backend !== backend) {\n throw new Error(`cannot register backend \"${name}\" using priority ${priority}`);\n }\n }\n if (priority >= 0) {\n const i = backendsSortedByPriority.indexOf(name);\n if (i !== -1) {\n backendsSortedByPriority.splice(i, 1);\n }\n for (let i = 0; i < backendsSortedByPriority.length; i++) {\n if (backends[backendsSortedByPriority[i]].priority <= priority) {\n backendsSortedByPriority.splice(i, 0, name);\n return;\n }\n }\n backendsSortedByPriority.push(name);\n }\n return;\n }\n throw new TypeError('not a valid backend');\n};\n/**\n * Resolve backend by specified hints.\n *\n * @param backendHints - a list of execution provider names to lookup. If omitted use registered backends as list.\n * @returns a promise that resolves to the backend.\n *\n * @internal\n */\nexport const resolveBackend = async (backendHints) => {\n const backendNames = backendHints.length === 0 ? backendsSortedByPriority : backendHints;\n const errors = [];\n for (const backendName of backendNames) {\n const backendInfo = backends[backendName];\n if (backendInfo) {\n if (backendInfo.initialized) {\n return backendInfo.backend;\n }\n else if (backendInfo.aborted) {\n continue; // current backend is unavailable; try next\n }\n const isInitializing = !!backendInfo.initPromise;\n try {\n if (!isInitializing) {\n backendInfo.initPromise = backendInfo.backend.init();\n }\n await backendInfo.initPromise;\n backendInfo.initialized = true;\n return backendInfo.backend;\n }\n catch (e) {\n if (!isInitializing) {\n errors.push({ name: backendName, err: e });\n }\n backendInfo.aborted = true;\n }\n finally {\n delete backendInfo.initPromise;\n }\n }\n }\n throw new Error(`no available backend found. ERR: ${errors.map(e => `[${e.name}] ${e.err}`).join(', ')}`);\n};\n//# sourceMappingURL=backend-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nexport class EnvImpl {\n constructor() {\n this.wasm = {};\n this.webgl = {};\n this.logLevelInternal = 'warning';\n }\n // TODO standadize the getter and setter convention in env for other fields.\n set logLevel(value) {\n if (value === undefined) {\n return;\n }\n if (typeof value !== 'string' || ['verbose', 'info', 'warning', 'error', 'fatal'].indexOf(value) === -1) {\n throw new Error(`Unsupported logging level: ${value}`);\n }\n this.logLevelInternal = value;\n }\n get logLevel() {\n return this.logLevelInternal;\n }\n}\n//# sourceMappingURL=env-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { EnvImpl } from './env-impl';\n/**\n * Represent a set of flags as a global singleton.\n */\nexport const env = new EnvImpl();\n//# sourceMappingURL=env.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { resolveBackend } from './backend-impl';\nimport { Tensor } from './tensor';\nexport class InferenceSession {\n constructor(handler) {\n this.handler = handler;\n }\n async run(feeds, arg1, arg2) {\n const fetches = {};\n let options = {};\n // check inputs\n if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n throw new TypeError('\\'feeds\\' must be an object that use input names as keys and OnnxValue as corresponding values.');\n }\n let isFetchesEmpty = true;\n // determine which override is being used\n if (typeof arg1 === 'object') {\n if (arg1 === null) {\n throw new TypeError('Unexpected argument[1]: cannot be null.');\n }\n if (arg1 instanceof Tensor) {\n throw new TypeError('\\'fetches\\' cannot be a Tensor');\n }\n if (Array.isArray(arg1)) {\n if (arg1.length === 0) {\n throw new TypeError('\\'fetches\\' cannot be an empty array.');\n }\n isFetchesEmpty = false;\n // output names\n for (const name of arg1) {\n if (typeof name !== 'string') {\n throw new TypeError('\\'fetches\\' must be a string array or an object.');\n }\n if (this.outputNames.indexOf(name) === -1) {\n throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n }\n fetches[name] = null;\n }\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n // decide whether arg1 is fetches or options\n // if any output name is present and its value is valid OnnxValue, we consider it fetches\n let isFetches = false;\n const arg1Keys = Object.getOwnPropertyNames(arg1);\n for (const name of this.outputNames) {\n if (arg1Keys.indexOf(name) !== -1) {\n const v = arg1[name];\n if (v === null || v instanceof Tensor) {\n isFetches = true;\n isFetchesEmpty = false;\n fetches[name] = v;\n }\n }\n }\n if (isFetches) {\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else {\n options = arg1;\n }\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('Unexpected argument[1]: must be \\'fetches\\' or \\'options\\'.');\n }\n // check if all inputs are in feed\n for (const name of this.inputNames) {\n if (typeof feeds[name] === 'undefined') {\n throw new Error(`input '${name}' is missing in 'feeds'.`);\n }\n }\n // if no fetches is specified, we use the full output names list\n if (isFetchesEmpty) {\n for (const name of this.outputNames) {\n fetches[name] = null;\n }\n }\n // feeds, fetches and options are prepared\n const results = await this.handler.run(feeds, fetches, options);\n const returnValue = {};\n for (const key in results) {\n if (Object.hasOwnProperty.call(results, key)) {\n returnValue[key] = new Tensor(results[key].type, results[key].data, results[key].dims);\n }\n }\n return returnValue;\n }\n static async create(arg0, arg1, arg2, arg3) {\n // either load from a file or buffer\n let filePathOrUint8Array;\n let options = {};\n if (typeof arg0 === 'string') {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (arg0 instanceof Uint8Array) {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (arg0 instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && arg0 instanceof SharedArrayBuffer)) {\n const buffer = arg0;\n let byteOffset = 0;\n let byteLength = arg0.byteLength;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n }\n else if (typeof arg1 === 'number') {\n byteOffset = arg1;\n if (!Number.isSafeInteger(byteOffset)) {\n throw new RangeError('\\'byteOffset\\' must be an integer.');\n }\n if (byteOffset < 0 || byteOffset >= buffer.byteLength) {\n throw new RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`);\n }\n byteLength = arg0.byteLength - byteOffset;\n if (typeof arg2 === 'number') {\n byteLength = arg2;\n if (!Number.isSafeInteger(byteLength)) {\n throw new RangeError('\\'byteLength\\' must be an integer.');\n }\n if (byteLength <= 0 || byteOffset + byteLength > buffer.byteLength) {\n throw new RangeError(`'byteLength' is out of range (0, ${buffer.byteLength - byteOffset}].`);\n }\n if (typeof arg3 === 'object' && arg3 !== null) {\n options = arg3;\n }\n else if (typeof arg3 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n }\n else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'byteLength\\' must be a number.');\n }\n }\n else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n filePathOrUint8Array = new Uint8Array(buffer, byteOffset, byteLength);\n }\n else {\n throw new TypeError('Unexpected argument[0]: must be \\'path\\' or \\'buffer\\'.');\n }\n // get backend hints\n const eps = options.executionProviders || [];\n const backendHints = eps.map(i => typeof i === 'string' ? i : i.name);\n const backend = await resolveBackend(backendHints);\n const handler = await backend.createSessionHandler(filePathOrUint8Array, options);\n return new InferenceSession(handler);\n }\n startProfiling() {\n this.handler.startProfiling();\n }\n endProfiling() {\n this.handler.endProfiling();\n }\n get inputNames() {\n return this.handler.inputNames;\n }\n get outputNames() {\n return this.handler.outputNames;\n }\n}\n//# sourceMappingURL=inference-session-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { InferenceSession as InferenceSessionImpl } from './inference-session-impl';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const InferenceSession = InferenceSessionImpl;\n//# sourceMappingURL=inference-session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nconst isBigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined' && typeof BigInt64Array.from === 'function';\nconst isBigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined' && typeof BigUint64Array.from === 'function';\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nconst NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP = new Map([\n ['float32', Float32Array],\n ['uint8', Uint8Array],\n ['int8', Int8Array],\n ['uint16', Uint16Array],\n ['int16', Int16Array],\n ['int32', Int32Array],\n ['bool', Uint8Array],\n ['float64', Float64Array],\n ['uint32', Uint32Array],\n]);\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nconst NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP = new Map([\n [Float32Array, 'float32'],\n [Uint8Array, 'uint8'],\n [Int8Array, 'int8'],\n [Uint16Array, 'uint16'],\n [Int16Array, 'int16'],\n [Int32Array, 'int32'],\n [Float64Array, 'float64'],\n [Uint32Array, 'uint32'],\n]);\nif (isBigInt64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('int64', BigInt64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array, 'int64');\n}\nif (isBigUint64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('uint64', BigUint64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array, 'uint64');\n}\n/**\n * calculate size from dims.\n *\n * @param dims the dims array. May be an illegal input.\n */\nconst calculateSize = (dims) => {\n let size = 1;\n for (let i = 0; i < dims.length; i++) {\n const dim = dims[i];\n if (typeof dim !== 'number' || !Number.isSafeInteger(dim)) {\n throw new TypeError(`dims[${i}] must be an integer, got: ${dim}`);\n }\n if (dim < 0) {\n throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${dim}`);\n }\n size *= dim;\n }\n return size;\n};\nexport class Tensor {\n constructor(arg0, arg1, arg2) {\n let type;\n let data;\n let dims;\n // check whether arg0 is type or data\n if (typeof arg0 === 'string') {\n //\n // Override: constructor(type, data, ...)\n //\n type = arg0;\n dims = arg2;\n if (arg0 === 'string') {\n // string tensor\n if (!Array.isArray(arg1)) {\n throw new TypeError('A string tensor\\'s data must be a string array.');\n }\n // we don't check whether every element in the array is string; this is too slow. we assume it's correct and\n // error will be populated at inference\n data = arg1;\n }\n else {\n // numeric tensor\n const typedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(arg0);\n if (typedArrayConstructor === undefined) {\n throw new TypeError(`Unsupported tensor type: ${arg0}.`);\n }\n if (Array.isArray(arg1)) {\n // use 'as any' here because TypeScript's check on type of 'SupportedTypedArrayConstructors.from()' produces\n // incorrect results.\n // 'typedArrayConstructor' should be one of the typed array prototype objects.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = typedArrayConstructor.from(arg1);\n }\n else if (arg1 instanceof typedArrayConstructor) {\n data = arg1;\n }\n else {\n throw new TypeError(`A ${type} tensor's data must be type of ${typedArrayConstructor}`);\n }\n }\n }\n else {\n //\n // Override: constructor(data, ...)\n //\n dims = arg1;\n if (Array.isArray(arg0)) {\n // only boolean[] and string[] is supported\n if (arg0.length === 0) {\n throw new TypeError('Tensor type cannot be inferred from an empty array.');\n }\n const firstElementType = typeof arg0[0];\n if (firstElementType === 'string') {\n type = 'string';\n data = arg0;\n }\n else if (firstElementType === 'boolean') {\n type = 'bool';\n // 'arg0' is of type 'boolean[]'. Uint8Array.from(boolean[]) actually works, but typescript thinks this is\n // wrong type. We use 'as any' to make it happy.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = Uint8Array.from(arg0);\n }\n else {\n throw new TypeError(`Invalid element type of data array: ${firstElementType}.`);\n }\n }\n else {\n // get tensor type from TypedArray\n const mappedType = NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(arg0.constructor);\n if (mappedType === undefined) {\n throw new TypeError(`Unsupported type for tensor data: ${arg0.constructor}.`);\n }\n type = mappedType;\n data = arg0;\n }\n }\n // type and data is processed, now processing dims\n if (dims === undefined) {\n // assume 1-D tensor if dims omitted\n dims = [data.length];\n }\n else if (!Array.isArray(dims)) {\n throw new TypeError('A tensor\\'s dims must be a number array');\n }\n // perform check\n const size = calculateSize(dims);\n if (size !== data.length) {\n throw new Error(`Tensor's size(${size}) does not match data length(${data.length}).`);\n }\n this.dims = dims;\n this.type = type;\n this.data = data;\n this.size = size;\n }\n // #endregion\n /**\n * Create a new tensor object from image object\n *\n * @param buffer - Extracted image buffer data - assuming RGBA format\n * @param imageFormat - input image configuration - required configurations height, width, format\n * @param tensorFormat - output tensor configuration - Default is RGB format\n */\n static bufferToTensor(buffer, options) {\n if (buffer === undefined) {\n throw new Error('Image buffer must be defined');\n }\n if (options.height === undefined || options.width === undefined) {\n throw new Error('Image height and width must be defined');\n }\n const { height, width } = options;\n const norm = options.norm;\n let normMean;\n let normBias;\n if (norm === undefined || norm.mean === undefined) {\n normMean = 255;\n }\n else {\n normMean = norm.mean;\n }\n if (norm === undefined || norm.bias === undefined) {\n normBias = 0;\n }\n else {\n normBias = norm.bias;\n }\n const inputformat = options.bitmapFormat !== undefined ? options.bitmapFormat : 'RGBA';\n // default value is RGBA since imagedata and HTMLImageElement uses it\n const outputformat = options.tensorFormat !== undefined ?\n (options.tensorFormat !== undefined ? options.tensorFormat : 'RGB') :\n 'RGB';\n const offset = height * width;\n const float32Data = outputformat === 'RGBA' ? new Float32Array(offset * 4) : new Float32Array(offset * 3);\n // Default pointer assignments\n let step = 4, rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = offset, bTensorPointer = offset * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGB') {\n step = 3;\n rImagePointer = 0;\n gImagePointer = 1;\n bImagePointer = 2;\n aImagePointer = -1;\n }\n // Updating the pointer assignments based on the output tensor format\n if (outputformat === 'RGBA') {\n aTensorPointer = offset * 3;\n }\n else if (outputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = offset;\n gTensorPointer = offset * 2;\n }\n else if (outputformat === 'BGR') {\n bTensorPointer = 0;\n gTensorPointer = offset;\n rTensorPointer = offset * 2;\n }\n for (let i = 0; i < offset; i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step) {\n float32Data[rTensorPointer++] = (buffer[rImagePointer] + normBias) / normMean;\n float32Data[gTensorPointer++] = (buffer[gImagePointer] + normBias) / normMean;\n float32Data[bTensorPointer++] = (buffer[bImagePointer] + normBias) / normMean;\n if (aTensorPointer !== -1 && aImagePointer !== -1) {\n float32Data[aTensorPointer++] = (buffer[aImagePointer] + normBias) / normMean;\n }\n }\n // Float32Array -> ort.Tensor\n const outputTensor = outputformat === 'RGBA' ? new Tensor('float32', float32Data, [1, 4, height, width]) :\n new Tensor('float32', float32Data, [1, 3, height, width]);\n return outputTensor;\n }\n static async fromImage(image, options) {\n // checking the type of image object\n const isHTMLImageEle = typeof (HTMLImageElement) !== 'undefined' && image instanceof HTMLImageElement;\n const isImageDataEle = typeof (ImageData) !== 'undefined' && image instanceof ImageData;\n const isImageBitmap = typeof (ImageBitmap) !== 'undefined' && image instanceof ImageBitmap;\n const isURL = typeof (String) !== 'undefined' && (image instanceof String || typeof image === 'string');\n let data;\n let tensorConfig = {};\n // filling and checking image configuration options\n if (isHTMLImageEle) {\n // HTMLImageElement - image object - format is RGBA by default\n const canvas = document.createElement('canvas');\n const pixels2DContext = canvas.getContext('2d');\n if (pixels2DContext != null) {\n let height = image.naturalHeight;\n let width = image.naturalWidth;\n if (options !== undefined && options.resizedHeight !== undefined && options.resizedWidth !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n if (options !== undefined) {\n tensorConfig = options;\n if (options.tensorFormat !== undefined) {\n throw new Error('Image input config format must be RGBA for HTMLImageElement');\n }\n else {\n tensorConfig.tensorFormat = 'RGBA';\n }\n if (options.height !== undefined && options.height !== height) {\n throw new Error('Image input config height doesn\\'t match HTMLImageElement height');\n }\n else {\n tensorConfig.height = height;\n }\n if (options.width !== undefined && options.width !== width) {\n throw new Error('Image input config width doesn\\'t match HTMLImageElement width');\n }\n else {\n tensorConfig.width = width;\n }\n }\n else {\n tensorConfig.tensorFormat = 'RGBA';\n tensorConfig.height = height;\n tensorConfig.width = width;\n }\n canvas.width = width;\n canvas.height = height;\n pixels2DContext.drawImage(image, 0, 0, width, height);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else if (isImageDataEle) {\n // ImageData - image object - format is RGBA by default\n const format = 'RGBA';\n let height;\n let width;\n if (options !== undefined && options.resizedWidth !== undefined && options.resizedHeight !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n else {\n height = image.height;\n width = image.width;\n }\n if (options !== undefined) {\n tensorConfig = options;\n if (options.bitmapFormat !== undefined && options.bitmapFormat !== format) {\n throw new Error('Image input config format must be RGBA for ImageData');\n }\n else {\n tensorConfig.bitmapFormat = 'RGBA';\n }\n }\n else {\n tensorConfig.bitmapFormat = 'RGBA';\n }\n tensorConfig.height = height;\n tensorConfig.width = width;\n if (options !== undefined) {\n const tempCanvas = document.createElement('canvas');\n tempCanvas.width = width;\n tempCanvas.height = height;\n const pixels2DContext = tempCanvas.getContext('2d');\n if (pixels2DContext != null) {\n pixels2DContext.putImageData(image, 0, 0);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else {\n data = image.data;\n }\n }\n else if (isImageBitmap) {\n // ImageBitmap - image object - format must be provided by user\n if (options === undefined) {\n throw new Error('Please provide image config with format for Imagebitmap');\n }\n if (options.bitmapFormat !== undefined) {\n throw new Error('Image input config format must be defined for ImageBitmap');\n }\n const pixels2DContext = document.createElement('canvas').getContext('2d');\n if (pixels2DContext != null) {\n const height = image.height;\n const width = image.width;\n pixels2DContext.drawImage(image, 0, 0, width, height);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n if (options !== undefined) {\n // using square brackets to avoid TS error - type 'never'\n if (options.height !== undefined && options.height !== height) {\n throw new Error('Image input config height doesn\\'t match ImageBitmap height');\n }\n else {\n tensorConfig.height = height;\n }\n // using square brackets to avoid TS error - type 'never'\n if (options.width !== undefined && options.width !== width) {\n throw new Error('Image input config width doesn\\'t match ImageBitmap width');\n }\n else {\n tensorConfig.width = width;\n }\n }\n else {\n tensorConfig.height = height;\n tensorConfig.width = width;\n }\n return Tensor.bufferToTensor(data, tensorConfig);\n }\n else {\n throw new Error('Can not access image data');\n }\n }\n else if (isURL) {\n return new Promise((resolve, reject) => {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!image || !context) {\n return reject();\n }\n const newImage = new Image();\n newImage.crossOrigin = 'Anonymous';\n newImage.src = image;\n newImage.onload = () => {\n canvas.width = newImage.width;\n canvas.height = newImage.height;\n context.drawImage(newImage, 0, 0, canvas.width, canvas.height);\n const img = context.getImageData(0, 0, canvas.width, canvas.height);\n if (options !== undefined) {\n // using square brackets to avoid TS error - type 'never'\n if (options.height !== undefined && options.height !== canvas.height) {\n throw new Error('Image input config height doesn\\'t match ImageBitmap height');\n }\n else {\n tensorConfig.height = canvas.height;\n }\n // using square brackets to avoid TS error - type 'never'\n if (options.width !== undefined && options.width !== canvas.width) {\n throw new Error('Image input config width doesn\\'t match ImageBitmap width');\n }\n else {\n tensorConfig.width = canvas.width;\n }\n }\n else {\n tensorConfig.height = canvas.height;\n tensorConfig.width = canvas.width;\n }\n resolve(Tensor.bufferToTensor(img.data, tensorConfig));\n };\n });\n }\n else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n if (data !== undefined) {\n return Tensor.bufferToTensor(data, tensorConfig);\n }\n else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n }\n toImageData(options) {\n var _a, _b;\n const pixels2DContext = document.createElement('canvas').getContext('2d');\n let image;\n if (pixels2DContext != null) {\n // Default values for height and width & format\n const width = this.dims[3];\n const height = this.dims[2];\n const channels = this.dims[1];\n const inputformat = options !== undefined ? (options.format !== undefined ? options.format : 'RGB') : 'RGB';\n const normMean = options !== undefined ? (((_a = options.norm) === null || _a === void 0 ? void 0 : _a.mean) !== undefined ? options.norm.mean : 255) : 255;\n const normBias = options !== undefined ? (((_b = options.norm) === null || _b === void 0 ? void 0 : _b.bias) !== undefined ? options.norm.bias : 0) : 0;\n const offset = height * width;\n if (options !== undefined) {\n if (options.height !== undefined && options.height !== height) {\n throw new Error('Image output config height doesn\\'t match tensor height');\n }\n if (options.width !== undefined && options.width !== width) {\n throw new Error('Image output config width doesn\\'t match tensor width');\n }\n if (options.format !== undefined && (channels === 4 && options.format !== 'RGBA') ||\n (channels === 3 && (options.format !== 'RGB' && options.format !== 'BGR'))) {\n throw new Error('Tensor format doesn\\'t match input tensor dims');\n }\n }\n // Default pointer assignments\n const step = 4;\n let rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = offset, bTensorPointer = offset * 2, aTensorPointer = -1;\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGBA') {\n rTensorPointer = 0;\n gTensorPointer = offset;\n bTensorPointer = offset * 2;\n aTensorPointer = offset * 3;\n }\n else if (inputformat === 'RGB') {\n rTensorPointer = 0;\n gTensorPointer = offset;\n bTensorPointer = offset * 2;\n }\n else if (inputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = offset;\n gTensorPointer = offset * 2;\n }\n image = pixels2DContext.createImageData(width, height);\n for (let i = 0; i < height * width; rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++) {\n image.data[rImagePointer] = (this.data[rTensorPointer++] - normBias) * normMean; // R value\n image.data[gImagePointer] = (this.data[gTensorPointer++] - normBias) * normMean; // G value\n image.data[bImagePointer] = (this.data[bTensorPointer++] - normBias) * normMean; // B value\n image.data[aImagePointer] =\n aTensorPointer === -1 ? 255 : (this.data[aTensorPointer++] - normBias) * normMean; // A value\n }\n }\n else {\n throw new Error('Can not access image data');\n }\n return image;\n }\n // #endregion\n // #region tensor utilities\n reshape(dims) {\n return new Tensor(this.type, this.data, dims);\n }\n}\n//# sourceMappingURL=tensor-impl.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nimport { Tensor as TensorImpl } from './tensor-impl';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Tensor = TensorImpl;\n//# sourceMappingURL=tensor.js.map","/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n!function(t,e){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=e(require(\"onnxruntime-common\"));else if(\"function\"==typeof define&&define.amd)define([],e);else{var n=\"object\"==typeof exports?e(require(\"onnxruntime-common\")):e(t.ort);for(var r in n)(\"object\"==typeof exports?exports:t)[r]=n[r]}}(self,(__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){function e(){return $.buffer!=C&&H($.buffer),F}function r(){return $.buffer!=C&&H($.buffer),N}function i(){return $.buffer!=C&&H($.buffer),L}function o(){return $.buffer!=C&&H($.buffer),R}function a(){return $.buffer!=C&&H($.buffer),j}var s,u,c;t=t||{},s||(s=void 0!==t?t:{}),s.ready=new Promise((function(t,e){u=t,c=e}));var l,p,f,d,h,g,b=Object.assign({},s),m=\"./this.program\",y=(t,e)=>{throw e},_=\"object\"==typeof window,v=\"function\"==typeof importScripts,w=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,x=s.ENVIRONMENT_IS_PTHREAD||!1,T=\"\";function S(t){return s.locateFile?s.locateFile(t,T):T+t}if(w){let e;T=v?n(908).dirname(T)+\"/\":\"//\",g=()=>{h||(d=n(1384),h=n(908))},l=function(t,e){return g(),t=h.normalize(t),d.readFileSync(t,e?void 0:\"utf8\")},f=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),p=(t,e,n)=>{g(),t=h.normalize(t),d.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(J())throw process.exitCode=t,e;e instanceof ut||P(\"exiting due to exception: \"+e),process.exit(t)},s.inspect=function(){return\"[Emscripten Module object]\"};try{e=n(9925)}catch(t){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),t}n.g.Worker=e.Worker}else(_||v)&&(v?T=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(T=document.currentScript.src),_scriptDir&&(T=_scriptDir),T=0!==T.indexOf(\"blob:\")?T.substr(0,T.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",w||(l=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},v&&(f=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),p=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));w&&\"undefined\"==typeof performance&&(n.g.performance=n(6953).performance);var O=console.log.bind(console),A=console.warn.bind(console);w&&(g(),O=t=>d.writeSync(1,t+\"\\n\"),A=t=>d.writeSync(2,t+\"\\n\"));var E,I=s.print||O,P=s.printErr||A;Object.assign(s,b),b=null,s.thisProgram&&(m=s.thisProgram),s.quit&&(y=s.quit),s.wasmBinary&&(E=s.wasmBinary);var D=s.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&it(\"no native wasm support detected\");var $,k,C,F,N,L,R,j,M=!1,U=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function V(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function B(t,e){return(t>>>=0)?V(r(),t,e):\"\"}function z(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-i}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function H(t){C=t,s.HEAP8=F=new Int8Array(t),s.HEAP16=new Int16Array(t),s.HEAP32=L=new Int32Array(t),s.HEAPU8=N=new Uint8Array(t),s.HEAPU16=new Uint16Array(t),s.HEAPU32=R=new Uint32Array(t),s.HEAPF32=new Float32Array(t),s.HEAPF64=j=new Float64Array(t)}x&&(C=s.buffer);var W=s.INITIAL_MEMORY||16777216;if(x)$=s.wasmMemory,C=s.buffer;else if(s.wasmMemory)$=s.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),w&&console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\"),Error(\"bad memory\");$&&(C=$.buffer),W=C.byteLength,H(C);var q,X=[],Y=[],K=[],Z=[];function J(){return D||!1}function Q(){var t=s.preRun.shift();X.unshift(t)}var tt,et=0,nt=null,rt=null;function it(t){throw x?postMessage({cmd:\"onAbort\",arg:t}):s.onAbort&&s.onAbort(t),P(t=\"Aborted(\"+t+\")\"),M=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),c(t),t}function ot(){return tt.startsWith(\"data:application/octet-stream;base64,\")}function at(){var t=tt;try{if(t==tt&&E)return new Uint8Array(E);if(f)return f(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){it(t)}}tt=\"ort-wasm-threaded.wasm\",ot()||(tt=S(tt));var st={};function ut(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function ct(t){(t=dt.Vb[t])||it(),dt.mc(t)}function lt(t){var e=dt.Cc();if(!e)return 6;dt.ac.push(e),dt.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:\"run\",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function pt(t){if(x)return qt(1,1,t);J()||(dt.oc(),s.onExit&&s.onExit(t),M=!0),y(t,new ut(t))}function ft(t,e){if(!e&&x)throw bt(t),\"unwind\";J()||x||(me(),ht(K),be(0),re[1].length&&ie(1,10),re[2].length&&ie(2,10),dt.oc()),pt(t)}var dt={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&dt.Ec()},Pc:function(){},Ec:function(){dt.receiveObjectTransfer=dt.Gc,dt.threadInitTLS=dt.pc,dt.setExitStatus=dt.nc,D=!1},nc:function(){},oc:function(){for(var t of Object.values(dt.Vb))dt.mc(t);for(t of dt.Yb)t.terminate();dt.Yb=[]},mc:function(t){var e=t.Ub;delete dt.Vb[e],dt.Yb.push(t),dt.ac.splice(dt.ac.indexOf(t),1),t.Ub=0,xe(e)},Gc:function(){},pc:function(){dt.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(dt.Bc=t.Ub),n.targetThread&&n.targetThread!=de()){var i=dt.Vb[n.Qc];i?i.postMessage(n,n.transferList):P('Internal error! Worker sent a message \"'+r+'\" to target pthread '+n.targetThread+\", but that thread no longer exists!\")}else\"processProxyingQueue\"===r?Vt(n.queue):\"spawnThread\"===r?lt(n):\"cleanupThread\"===r?ct(n.thread):\"killThread\"===r?(n=n.thread,r=dt.Vb[n],delete dt.Vb[n],r.terminate(),xe(n),dt.ac.splice(dt.ac.indexOf(r),1),r.Ub=0):\"cancelThread\"===r?dt.Vb[n.thread].postMessage({cmd:\"cancel\"}):\"loaded\"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):\"print\"===r?I(\"Thread \"+n.threadId+\": \"+n.text):\"printErr\"===r?P(\"Thread \"+n.threadId+\": \"+n.text):\"alert\"===r?alert(\"Thread \"+n.threadId+\": \"+n.text):\"setimmediate\"===n.target?t.postMessage(n):\"onAbort\"===r?s.onAbort&&s.onAbort(n.arg):r&&P(\"worker sent an unknown command \"+r);dt.Bc=void 0},t.onerror=t=>{throw P(\"worker sent an error! \"+t.filename+\":\"+t.lineno+\": \"+t.message),t},w&&(t.on(\"message\",(function(e){t.onmessage({data:e})})),t.on(\"error\",(function(e){t.onerror(e)})),t.on(\"detachedExit\",(function(){}))),t.postMessage({cmd:\"load\",urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:$,wasmModule:k})},yc:function(){var t=S(\"ort-wasm-threaded.worker.js\");dt.Yb.push(new Worker(t))},Cc:function(){return 0==dt.Yb.length&&(dt.yc(),dt.Fc(dt.Yb[0])),dt.Yb.pop()}};function ht(t){for(;0>2>>>0];t=i()[t+48>>2>>>0],Oe(e,e-t),Ee(e)};var mt=[];function yt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=q.get(t)),e}s.invokeEntryPoint=function(t,e){t=yt(t)(e),J()?dt.nc(t):Te(t)};var _t,vt,wt=[],xt=0,Tt=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){o()[this.Sb+4>>2>>>0]=t},this.bc=function(){return o()[this.Sb+4>>2>>>0]},this.wc=function(t){o()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return o()[this.Sb+8>>2>>>0]},this.rc=function(){i()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(i(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(i(),this.Sb>>2,1)},this.cc=function(t){o()[this.Sb+16>>2>>>0]=t},this.tc=function(){return o()[this.Sb+16>>2>>>0]},this.vc=function(){if(De(this.bc()))return o()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Ot(t){return ge(new St(t).Sb)}function At(t,e,n,r){return x?qt(3,1,t,e,n,r):Et(t,e,n,r)}function Et(t,e,n,r){if(\"undefined\"==typeof SharedArrayBuffer)return P(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var i=[];return x&&0===i.length?At(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:i},x?(t.Oc=\"spawnThread\",postMessage(t,i),0):lt(t))}function It(t,e,n){return x?qt(4,1,t,e,n):0}function Pt(t,e){if(x)return qt(5,1,t,e)}function Dt(t,e){if(x)return qt(6,1,t,e)}function $t(t,e,n){if(x)return qt(7,1,t,e,n)}function kt(t,e,n){return x?qt(8,1,t,e,n):0}function Ct(t,e){if(x)return qt(9,1,t,e)}function Ft(t,e,n){if(x)return qt(10,1,t,e,n)}function Nt(t,e,n,r){if(x)return qt(11,1,t,e,n,r)}function Lt(t,e,n,r){if(x)return qt(12,1,t,e,n,r)}function Rt(t,e,n,r){if(x)return qt(13,1,t,e,n,r)}function jt(t){if(x)return qt(14,1,t)}function Mt(t,e){if(x)return qt(15,1,t,e)}function Ut(t,e,n){if(x)return qt(16,1,t,e,n)}function Vt(t){Atomics.store(i(),t>>2,1),de()&&we(t),Atomics.compareExchange(i(),t>>2,1,0)}function Bt(t){return o()[t>>>2]+4294967296*i()[t+4>>>2]}function zt(t,e,n,r,i,o){return x?qt(17,1,t,e,n,r,i,o):-52}function Gt(t,e,n,r,i,o){if(x)return qt(18,1,t,e,n,r,i,o)}function Ht(t){var n=G(t)+1,r=he(n);return r&&z(t,e(),r,n),r}function Wt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:\"GMT\"}if(x)return qt(19,1,t,e,n);var a=(new Date).getFullYear(),s=new Date(a,0,1),u=new Date(a,6,1);a=s.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(a,c);i()[t>>2>>>0]=60*l,i()[e>>2>>>0]=Number(a!=c),t=r(s),e=r(u),t=Ht(t),e=Ht(e),c>2>>>0]=t,o()[n+4>>2>>>0]=e):(o()[n>>2>>>0]=e,o()[n+4>>2>>>0]=t)}function qt(t,e){var n=arguments.length-2,r=arguments;return gt((()=>{for(var i=Ie(8*n),o=i>>3,s=0;s>>0]=u}return ve(t,n,i,e)}))}s.executeNotifiedProxyingQueue=Vt,vt=w?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:x?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Xt,Yt=[],Kt={};function Zt(){if(!Xt){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:m||\"./this.program\"};for(t in Kt)void 0===Kt[t]?delete e[t]:e[t]=Kt[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);Xt=n}return Xt}function Jt(t,n){if(x)return qt(20,1,t,n);var r=0;return Zt().forEach((function(i,a){var s=n+r;for(a=o()[t+4*a>>2>>>0]=s,s=0;s>0>>>0]=i.charCodeAt(s);e()[a>>0>>>0]=0,r+=i.length+1})),0}function Qt(t,e){if(x)return qt(21,1,t,e);var n=Zt();o()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),o()[e>>2>>>0]=r,0}function te(t){return x?qt(22,1,t):52}function ee(t,e,n,r){return x?qt(23,1,t,e,n,r):52}function ne(t,e,n,r,i){return x?qt(24,1,t,e,n,r,i):70}var re=[null,[],[]];function ie(t,e){var n=re[t];0===e||10===e?((1===t?I:P)(V(n,0)),n.length=0):n.push(e)}function oe(t,e,n,i){if(x)return qt(25,1,t,e,n,i);for(var a=0,s=0;s>2>>>0],c=o()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);a+=c}return o()[i>>2>>>0]=a,0}var ae=0;function se(t){return 0==t%4&&(0!=t%100||0==t%400)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,o){function a(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=c(new Date(t.getFullYear(),0,4)),n=c(n),0>=u(e,t)?0>=u(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var p=i()[o+40>>2>>>0];for(var f in o={Lc:i()[o>>2>>>0],Kc:i()[o+4>>2>>>0],dc:i()[o+8>>2>>>0],jc:i()[o+12>>2>>>0],ec:i()[o+16>>2>>>0],Xb:i()[o+20>>2>>>0],Tb:i()[o+24>>2>>>0],Wb:i()[o+28>>2>>>0],Rc:i()[o+32>>2>>>0],Jc:i()[o+36>>2>>>0],Mc:p?B(p):\"\"},r=B(r),p={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})r=r.replace(new RegExp(f,\"g\"),p[f]);var d=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),h=\"January February March April May June July August September October November December\".split(\" \");for(f in p={\"%a\":function(t){return d[t.Tb].substring(0,3)},\"%A\":function(t){return d[t.Tb]},\"%b\":function(t){return h[t.ec].substring(0,3)},\"%B\":function(t){return h[t.ec]},\"%C\":function(t){return s((t.Xb+1900)/100|0,2)},\"%d\":function(t){return s(t.jc,2)},\"%e\":function(t){return a(t.jc,2,\" \")},\"%g\":function(t){return l(t).toString().substring(2)},\"%G\":function(t){return l(t)},\"%H\":function(t){return s(t.dc,2)},\"%I\":function(t){return 0==(t=t.dc)?t=12:12t.dc?\"AM\":\"PM\"},\"%S\":function(t){return s(t.Lc,2)},\"%t\":function(){return\"\\t\"},\"%u\":function(t){return t.Tb||7},\"%U\":function(t){return s(Math.floor((t.Wb+7-t.Tb)/7),2)},\"%V\":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&se(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&se(t.Xb%400-1))&&e++}return s(e,2)},\"%w\":function(t){return t.Tb},\"%W\":function(t){return s(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},\"%y\":function(t){return(t.Xb+1900).toString().substring(2)},\"%Y\":function(t){return t.Xb+1900},\"%z\":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.Mc},\"%%\":function(){return\"%\"}},r=r.replace(/%%/g,\"\\0\\0\"),p)r.includes(f)&&(r=r.replace(new RegExp(f,\"g\"),p[f](o)));return f=function(t){var e=Array(G(t)+1);return z(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,\"%\")),f.length>n?0:(function(t,n){e().set(t,n>>>0)}(f,t),f.length-1)}dt.fc();var pe=[null,pt,bt,At,It,Pt,Dt,$t,kt,Ct,Ft,Nt,Lt,Rt,jt,Mt,Ut,zt,Gt,Wt,Jt,Qt,te,ee,ne,oe],fe={b:function(t){return he(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),xt--),t.ic(!1),wt.push(t),t.sc(),t.vc()},ma:function(t){throw P(\"Unexpected exception thrown, this is not properly supported - aborting\"),M=!0,t},x:function(){Se(0);var t=wt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&yt(e)(t.Zb),Ot(t.Zb)}Tt=0},e:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;iVt(r)));else if(x)postMessage({targetThread:t,cmd:\"processProxyingQueue\",queue:r});else{if(!(t=dt.Vb[t]))return;t.postMessage({cmd:\"processProxyingQueue\",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Bt(t)),i()[e>>2>>>0]=t.getUTCSeconds(),i()[e+4>>2>>>0]=t.getUTCMinutes(),i()[e+8>>2>>>0]=t.getUTCHours(),i()[e+12>>2>>>0]=t.getUTCDate(),i()[e+16>>2>>>0]=t.getUTCMonth(),i()[e+20>>2>>>0]=t.getUTCFullYear()-1900,i()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,i()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Bt(t)),i()[e>>2>>>0]=t.getSeconds(),i()[e+4>>2>>>0]=t.getMinutes(),i()[e+8>>2>>>0]=t.getHours(),i()[e+12>>2>>>0]=t.getDate(),i()[e+16>>2>>>0]=t.getMonth(),i()[e+20>>2>>>0]=t.getFullYear()-1900,i()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;i()[e+28>>2>>>0]=r,i()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),i()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(i()[t+20>>2>>>0]+1900,i()[t+16>>2>>>0],i()[t+12>>2>>>0],i()[t+8>>2>>>0],i()[t+4>>2>>>0],i()[t>>2>>>0],0),n=i()[t+32>>2>>>0],r=e.getTimezoneOffset(),o=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),u=Math.min(s,a);return 0>n?i()[t+32>>2>>>0]=Number(a!=s&&u==r):0>2>>>0]=e.getDay(),n=(e.getTime()-o.getTime())/864e5|0,i()[t+28>>2>>>0]=n,i()[t>>2>>>0]=e.getSeconds(),i()[t+4>>2>>>0]=e.getMinutes(),i()[t+8>>2>>>0]=e.getHours(),i()[t+12>>2>>>0]=e.getDate(),i()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:zt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Wt(e,n,r))},y:function(){it(\"\")},U:function(){if(!w&&!v){var t=\"Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread\";_t||(_t={}),_t[t]||(_t[t]=1,w&&(t=\"warning: \"+t),P(t))}},ra:function(){return 4294901760},B:vt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return w?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Yt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?st[-t-1]:pe[t]).apply(null,Yt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var i=e*(1+.2/n);i=Math.min(i,t+100663296);var o=Math;i=Math.max(t,i),o=o.min.call(o,4294901760,i+(65536-i%65536)%65536);t:{try{$.grow(o-C.byteLength+65535>>>16),H($.buffer);var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Na:function(){throw\"unwind\"},Ga:Jt,Ha:Qt,J:ft,I:te,S:ee,ga:ne,R:oe,d:function(){return ae},na:function t(r,i){t.lc||(t.lc=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(w)try{var e=n(Object(function(){var t=new Error(\"Cannot find module 'crypto'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>it(\"randomDevice\")}());for(var o=0;o>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ae();try{return yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ae();try{return yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ae();try{return yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var i=Ae();try{return yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,i){var o=Ae();try{return yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,i,o){var a=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,i,o){var a=Ae();try{return yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,i,o,a){var s=Ae();try{return yt(t)(e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,i,o,a,s){var u=Ae();try{return yt(t)(e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Ae();try{return yt(t)(e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,i,o,a,s){var u=Ae();try{return Me(t,e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,i,o,a){var s=Ae();try{return ke(t,e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,i){var o=Ae();try{return Ue(t,e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var i=Ae();try{return Re(t,e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ae();try{return $e(t)}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ae();try{return je(t,e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ae();try{return Ce(t,e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ae();try{yt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ae();try{yt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ae();try{yt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var i=Ae();try{yt(t)(e,n,r)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,i){var o=Ae();try{yt(t)(e,n,r,i)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,i,o){var a=Ae();try{yt(t)(e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,i,o,a){var s=Ae();try{yt(t)(e,n,r,i,o,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,i,o,a,s){var u=Ae();try{yt(t)(e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,i,o,a,s,u){var c=Ae();try{yt(t)(e,n,r,i,o,a,s,u)}catch(t){if(Ee(c),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,i,o,a,s,u,c,l){var p=Ae();try{yt(t)(e,n,r,i,o,a,s,u,c,l)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,i,o,a,s,u,c,l,p,f,d,h,g){var b=Ae();try{yt(t)(e,n,r,i,o,a,s,u,c,l,p,f,d,h,g)}catch(t){if(Ee(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,i,o,a,s){var u=Ae();try{Fe(t,e,n,r,i,o,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Ae();try{Le(t,e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,i,o){var a=Ae();try{Ne(t,e,n,r,i,o)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:$||s.wasmMemory,G:function(t){ae=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){s.asm=t.exports,dt.qc.push(s.asm.sb),q=s.asm.ub,Y.unshift(s.asm.Va),k=e,x||(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!E&&(_||v)){if(\"function\"==typeof fetch&&!tt.startsWith(\"file://\"))return fetch(tt,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at '\"+tt+\"'\";return t.arrayBuffer()})).catch((function(){return at()}));if(p)return new Promise((function(t,e){p(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return at()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){P(\"failed to asynchronously prepare wasm: \"+t),it(t)}))}var r={a:fe};if(x||(et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(t){return P(\"Module.instantiateWasm callback failed with error: \"+t),!1}(E||\"function\"!=typeof WebAssembly.instantiateStreaming||ot()||tt.startsWith(\"file://\")||w||\"function\"!=typeof fetch?n(e):fetch(tt,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return P(\"wasm streaming compile failed: \"+t),P(\"falling back to ArrayBuffer instantiation\"),n(e)}))}))).catch(c)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Va).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Wa).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Xa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Ya).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Za).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm._a).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.$a).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.ab).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.bb).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.cb).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.db).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.eb).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.fb).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.gb).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.hb).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.ib).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.jb).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.kb).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.lb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.mb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.nb).apply(null,arguments)};var de=s._pthread_self=function(){return(de=s._pthread_self=s.asm.ob).apply(null,arguments)},he=s._malloc=function(){return(he=s._malloc=s.asm.pb).apply(null,arguments)},ge=s._free=function(){return(ge=s._free=s.asm.qb).apply(null,arguments)},be=s._fflush=function(){return(be=s._fflush=s.asm.rb).apply(null,arguments)};s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.sb).apply(null,arguments)};var me=s.___funcs_on_exit=function(){return(me=s.___funcs_on_exit=s.asm.tb).apply(null,arguments)},ye=s.__emscripten_thread_init=function(){return(ye=s.__emscripten_thread_init=s.asm.vb).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.wb).apply(null,arguments)};var _e,ve=s._emscripten_run_in_main_runtime_thread_js=function(){return(ve=s._emscripten_run_in_main_runtime_thread_js=s.asm.xb).apply(null,arguments)},we=s.__emscripten_proxy_execute_task_queue=function(){return(we=s.__emscripten_proxy_execute_task_queue=s.asm.yb).apply(null,arguments)},xe=s.__emscripten_thread_free_data=function(){return(xe=s.__emscripten_thread_free_data=s.asm.zb).apply(null,arguments)},Te=s.__emscripten_thread_exit=function(){return(Te=s.__emscripten_thread_exit=s.asm.Ab).apply(null,arguments)},Se=s._setThrew=function(){return(Se=s._setThrew=s.asm.Bb).apply(null,arguments)},Oe=s._emscripten_stack_set_limits=function(){return(Oe=s._emscripten_stack_set_limits=s.asm.Cb).apply(null,arguments)},Ae=s.stackSave=function(){return(Ae=s.stackSave=s.asm.Db).apply(null,arguments)},Ee=s.stackRestore=function(){return(Ee=s.stackRestore=s.asm.Eb).apply(null,arguments)},Ie=s.stackAlloc=function(){return(Ie=s.stackAlloc=s.asm.Fb).apply(null,arguments)},Pe=s.___cxa_can_catch=function(){return(Pe=s.___cxa_can_catch=s.asm.Gb).apply(null,arguments)},De=s.___cxa_is_pointer_type=function(){return(De=s.___cxa_is_pointer_type=s.asm.Hb).apply(null,arguments)},$e=s.dynCall_j=function(){return($e=s.dynCall_j=s.asm.Ib).apply(null,arguments)},ke=s.dynCall_iiiiij=function(){return(ke=s.dynCall_iiiiij=s.asm.Jb).apply(null,arguments)},Ce=s.dynCall_jii=function(){return(Ce=s.dynCall_jii=s.asm.Kb).apply(null,arguments)},Fe=s.dynCall_viiiiij=function(){return(Fe=s.dynCall_viiiiij=s.asm.Lb).apply(null,arguments)},Ne=s.dynCall_vjji=function(){return(Ne=s.dynCall_vjji=s.asm.Mb).apply(null,arguments)},Le=s.dynCall_viiijjjii=function(){return(Le=s.dynCall_viiijjjii=s.asm.Nb).apply(null,arguments)},Re=s.dynCall_iij=function(){return(Re=s.dynCall_iij=s.asm.Ob).apply(null,arguments)},je=s.dynCall_ji=function(){return(je=s.dynCall_ji=s.asm.Pb).apply(null,arguments)},Me=s.dynCall_iiiiiij=function(){return(Me=s.dynCall_iiiiiij=s.asm.Qb).apply(null,arguments)},Ue=s.dynCall_iiij=function(){return(Ue=s.dynCall_iiij=s.asm.Rb).apply(null,arguments)};function Ve(){function t(){if(!_e&&(_e=!0,s.calledRun=!0,!M)&&(x||ht(Y),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!x)){if(s.postRun)for(\"function\"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var t=s.postRun.shift();Z.unshift(t)}ht(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){var e,r,i;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,i=e}));var o,a,s,u,c,l,p=Object.assign({},e),f=\"./this.program\",d=(t,e)=>{throw e},h=\"object\"==typeof window,g=\"function\"==typeof importScripts,b=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,m=\"\";b?(m=g?n(908).dirname(m)+\"/\":\"//\",l=()=>{c||(u=n(1384),c=n(908))},o=function(t,e){return l(),t=c.normalize(t),u.readFileSync(t,e?void 0:\"utf8\")},s=t=>((t=o(t,!0)).buffer||(t=new Uint8Array(t)),t),a=(t,e,n)=>{l(),t=c.normalize(t),u.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(w||0{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},g&&(s=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),a=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var y,_=e.print||console.log.bind(console),v=e.printErr||console.warn.bind(console);Object.assign(e,p),p=null,e.thisProgram&&(f=e.thisProgram),e.quit&&(d=e.quit),e.wasmBinary&&(y=e.wasmBinary);var w=e.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&W(\"no native wasm support detected\");var x,T,S,O,A,E,I=!1,P=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function D(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function $(t,e){return(t>>>=0)?D(O,t,e):\"\"}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var o=0;o=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-i}function C(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function F(){var t=x.buffer;T=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=A=new Int32Array(t),e.HEAPU8=O=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=E=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var N,L=[],R=[],j=[],M=[],U=0;function V(){var t=e.preRun.shift();L.unshift(t)}var B,z=0,G=null,H=null;function W(t){throw e.onAbort&&e.onAbort(t),v(t=\"Aborted(\"+t+\")\"),I=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),i(t),t}function q(){return B.startsWith(\"data:application/octet-stream;base64,\")}if(B=\"ort-wasm.wasm\",!q()){var X=B;B=e.locateFile?e.locateFile(X,m):m+X}function Y(){var t=B;try{if(t==B&&y)return new Uint8Array(y);if(s)return s(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){W(t)}}function K(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return E[this.zb+4>>2>>>0]},this.Sb=function(t){E[this.zb+8>>2>>>0]=t},this.Wb=function(){return E[this.zb+8>>2>>>0]},this.Tb=function(){A[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){A[this.zb>>2>>>0]+=1},this.Xb=function(){var t=A[this.zb>>2>>>0];return A[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){E[this.zb+16>>2>>>0]=t},this.Ob=function(){return E[this.zb+16>>2>>>0]},this.Qb=function(){if(Et(this.Eb()))return E[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return _t(new et(t).zb)}var rt=[];function it(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=N.get(t)),e}function ot(t){var e=C(t)+1,n=yt(e);return n&&k(t,S,n,e),n}var at={};function st(){if(!ut){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:f||\"./this.program\"};for(t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);ut=n}return ut}var ut,ct=[null,[],[]];function lt(t,e){var n=ct[t];0===e||10===e?((1===t?_:v)(D(n,0)),n.length=0):n.push(e)}var pt=0;function ft(t){return 0==t%4&&(0!=t%100||0==t%400)}var dt=[31,29,31,30,31,30,31,31,30,31,30,31],ht=[31,28,31,30,31,30,31,31,30,31,30,31];function gt(t,e,n,r){function i(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=a(e,t)?0>=a(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=A[r+40>>2>>>0];for(var l in r={$b:A[r>>2>>>0],Zb:A[r+4>>2>>>0],Gb:A[r+8>>2>>>0],Kb:A[r+12>>2>>>0],Hb:A[r+16>>2>>>0],Cb:A[r+20>>2>>>0],Ab:A[r+24>>2>>>0],Bb:A[r+28>>2>>>0],bc:A[r+32>>2>>>0],Yb:A[r+36>>2>>>0],ac:c?$(c):\"\"},n=$(n),c={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})n=n.replace(new RegExp(l,\"g\"),c[l]);var p=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),f=\"January February March April May June July August September October November December\".split(\" \");for(l in c={\"%a\":function(t){return p[t.Ab].substring(0,3)},\"%A\":function(t){return p[t.Ab]},\"%b\":function(t){return f[t.Hb].substring(0,3)},\"%B\":function(t){return f[t.Hb]},\"%C\":function(t){return o((t.Cb+1900)/100|0,2)},\"%d\":function(t){return o(t.Kb,2)},\"%e\":function(t){return i(t.Kb,2,\" \")},\"%g\":function(t){return u(t).toString().substring(2)},\"%G\":function(t){return u(t)},\"%H\":function(t){return o(t.Gb,2)},\"%I\":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?\"AM\":\"PM\"},\"%S\":function(t){return o(t.$b,2)},\"%t\":function(){return\"\\t\"},\"%u\":function(t){return t.Ab||7},\"%U\":function(t){return o(Math.floor((t.Bb+7-t.Ab)/7),2)},\"%V\":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&ft(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&ft(t.Cb%400-1))&&e++}return o(e,2)},\"%w\":function(t){return t.Ab},\"%W\":function(t){return o(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},\"%y\":function(t){return(t.Cb+1900).toString().substring(2)},\"%Y\":function(t){return t.Cb+1900},\"%z\":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.ac},\"%%\":function(){return\"%\"}},n=n.replace(/%%/g,\"\\0\\0\"),c)n.includes(l)&&(n=n.replace(new RegExp(l,\"g\"),c[l](r)));return l=function(t){var e=Array(C(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,\"%\")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return yt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),Q--),t.Jb(!1),J.push(t),t.Nb(),t.Qb()},ia:function(t){throw v(\"Unexpected exception thrown, this is not properly supported - aborting\"),I=!0,t},w:function(){xt(0);var t=J.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&it(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return pt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return pt=0,t;for(var r=Array.prototype.slice.call(arguments),i=0;i>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getUTCSeconds(),A[e+4>>2>>>0]=t.getUTCMinutes(),A[e+8>>2>>>0]=t.getUTCHours(),A[e+12>>2>>>0]=t.getUTCDate(),A[e+16>>2>>>0]=t.getUTCMonth(),A[e+20>>2>>>0]=t.getUTCFullYear()-1900,A[e+24>>2>>>0]=t.getUTCDay(),A[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(E[t>>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getSeconds(),A[e+4>>2>>>0]=t.getMinutes(),A[e+8>>2>>>0]=t.getHours(),A[e+12>>2>>>0]=t.getDate(),A[e+16>>2>>>0]=t.getMonth(),A[e+20>>2>>>0]=t.getFullYear()-1900,A[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);A[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,A[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),A[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(A[t+20>>2>>>0]+1900,A[t+16>>2>>>0],A[t+12>>2>>>0],A[t+8>>2>>>0],A[t+4>>2>>>0],A[t>>2>>>0],0),n=A[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=i.getTimezoneOffset(),s=Math.min(a,o);return 0>n?A[t+32>>2>>>0]=Number(o!=a&&s==r):0>2>>>0]=e.getDay(),A[t+28>>2>>>0]=(e.getTime()-i.getTime())/864e5|0,A[t>>2>>>0]=e.getSeconds(),A[t+4>>2>>>0]=e.getMinutes(),A[t+8>>2>>>0]=e.getHours(),A[t+12>>2>>>0]=e.getDate(),A[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:\"GMT\"}var i=(new Date).getFullYear(),o=new Date(i,0,1),a=new Date(i,6,1);i=o.getTimezoneOffset();var s=a.getTimezoneOffset();A[t>>2>>>0]=60*Math.max(i,s),A[e>>2>>>0]=Number(i!=s),t=r(o),e=r(a),t=ot(t),e=ot(e),s>2>>>0]=t,E[n+4>>2>>>0]=e):(E[n>>2>>>0]=e,E[n+4>>2>>>0]=t)}(e,n,r))},B:function(){W(\"\")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){O.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=O.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var i=Math;r=Math.max(t,r),i=i.min.call(i,4294901760,r+(65536-r%65536)%65536);t:{try{x.grow(i-T.byteLength+65535>>>16),F();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},va:function(t,e){var n=0;return st().forEach((function(r,i){var o=e+n;for(i=E[t+4*i>>2>>>0]=o,o=0;o>0>>>0]=r.charCodeAt(o);S[i>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=st();E[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),E[e>>2>>>0]=r,0},ba:function(t){w||0>2>>>0],s=E[e+4>>2>>>0];e+=8;for(var u=0;u>>0]);i+=s}return E[r>>2>>>0]=i,0},c:function(){return pt},ja:function t(e,r){t.Mb||(t.Mb=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error(\"Cannot find module 'crypto'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>W(\"randomDevice\")}());for(var i=0;i>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},fa:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},J:function(t){var e=Tt();try{return it(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},e:function(t,e){var n=Tt();try{return it(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},N:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},O:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},j:function(t,e,n){var r=Tt();try{return it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},o:function(t,e,n,r){var i=Tt();try{return it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},p:function(t,e,n,r,i){var o=Tt();try{return it(t)(e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},M:function(t,e,n,r,i,o){var a=Tt();try{return it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},r:function(t,e,n,r,i,o){var a=Tt();try{return it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},v:function(t,e,n,r,i,o,a){var s=Tt();try{return it(t)(e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},K:function(t,e,n,r,i,o,a,s){var u=Tt();try{return it(t)(e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},D:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Tt();try{return it(t)(e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},X:function(t,e,n,r,i,o,a,s){var u=Tt();try{return Lt(t,e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},V:function(t,e,n,r,i,o,a){var s=Tt();try{return Pt(t,e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},U:function(t,e,n,r,i){var o=Tt();try{return Rt(t,e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},Z:function(t,e,n,r){var i=Tt();try{return Ft(t,e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},W:function(t){var e=Tt();try{return It(t)}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},Y:function(t,e){var n=Tt();try{return Nt(t,e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},T:function(t,e,n){var r=Tt();try{return Dt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},f:function(t){var e=Tt();try{it(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},q:function(t,e){var n=Tt();try{it(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},h:function(t,e,n){var r=Tt();try{it(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},da:function(t,e,n,r){var i=Tt();try{it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},l:function(t,e,n,r){var i=Tt();try{it(t)(e,n,r)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},t:function(t,e,n,r,i){var o=Tt();try{it(t)(e,n,r,i)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},u:function(t,e,n,r,i,o){var a=Tt();try{it(t)(e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},x:function(t,e,n,r,i,o,a){var s=Tt();try{it(t)(e,n,r,i,o,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},z:function(t,e,n,r,i,o,a,s){var u=Tt();try{it(t)(e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},ga:function(t,e,n,r,i,o,a,s,u){var c=Tt();try{it(t)(e,n,r,i,o,a,s,u)}catch(t){if(St(c),t!==t+0)throw t;xt(1,0)}},A:function(t,e,n,r,i,o,a,s,u,c,l){var p=Tt();try{it(t)(e,n,r,i,o,a,s,u,c,l)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},C:function(t,e,n,r,i,o,a,s,u,c,l,p,f,d,h,g){var b=Tt();try{it(t)(e,n,r,i,o,a,s,u,c,l,p,f,d,h,g)}catch(t){if(St(b),t!==t+0)throw t;xt(1,0)}},aa:function(t,e,n,r,i,o,a,s){var u=Tt();try{$t(t,e,n,r,i,o,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},_:function(t,e,n,r,i,o,a,s,u,c,l,p){var f=Tt();try{Ct(t,e,n,r,i,o,a,s,u,c,l,p)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},$:function(t,e,n,r,i,o){var a=Tt();try{kt(t,e,n,r,i,o)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},n:function(t){return t},F:function(t){pt=t},ha:gt,y:function(t,e,n,r){return gt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,x=e.asm.Ka,F(),N=e.asm.ib,R.unshift(e.asm.La),z--,e.monitorRunDependencies&&e.monitorRunDependencies(z),0==z&&(null!==G&&(clearInterval(G),G=null),H&&(t=H,H=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!y&&(h||g)){if(\"function\"==typeof fetch&&!B.startsWith(\"file://\"))return fetch(B,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at '\"+B+\"'\";return t.arrayBuffer()})).catch((function(){return Y()}));if(a)return new Promise((function(t,e){a(B,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Y()}))}().then((function(t){return WebAssembly.instantiate(t,o)})).then((function(t){return t})).then(t,(function(t){v(\"failed to asynchronously prepare wasm: \"+t),W(t)}))}var o={a:bt};if(z++,e.monitorRunDependencies&&e.monitorRunDependencies(z),e.instantiateWasm)try{return e.instantiateWasm(o,t)}catch(t){return v(\"Module.instantiateWasm callback failed with error: \"+t),!1}(y||\"function\"!=typeof WebAssembly.instantiateStreaming||q()||B.startsWith(\"file://\")||b||\"function\"!=typeof fetch?r(n):fetch(B,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,o).then(n,(function(t){return v(\"wasm streaming compile failed: \"+t),v(\"falling back to ArrayBuffer instantiation\"),r(n)}))}))).catch(i)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,yt=e._malloc=function(){return(yt=e._malloc=e.asm.eb).apply(null,arguments)},_t=e._free=function(){return(_t=e._free=e.asm.fb).apply(null,arguments)},vt=e._fflush=function(){return(vt=e._fflush=e.asm.gb).apply(null,arguments)},wt=e.___funcs_on_exit=function(){return(wt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},xt=e._setThrew=function(){return(xt=e._setThrew=e.asm.jb).apply(null,arguments)},Tt=e.stackSave=function(){return(Tt=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Ot=e.stackAlloc=function(){return(Ot=e.stackAlloc=e.asm.mb).apply(null,arguments)},At=e.___cxa_can_catch=function(){return(At=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Et=e.___cxa_is_pointer_type=function(){return(Et=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},It=e.dynCall_j=function(){return(It=e.dynCall_j=e.asm.pb).apply(null,arguments)},Pt=e.dynCall_iiiiij=function(){return(Pt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Dt=e.dynCall_jii=function(){return(Dt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},$t=e.dynCall_viiiiij=function(){return($t=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Ct=e.dynCall_viiijjjii=function(){return(Ct=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Ft=e.dynCall_iij=function(){return(Ft=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Nt=e.dynCall_ji=function(){return(Nt=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Lt=e.dynCall_iiiiiij=function(){return(Lt=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},Rt=e.dynCall_iiij=function(){return(Rt=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function jt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!I)){if(Z(R),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for(\"function\"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();M.unshift(t)}Z(M)}}if(!(0{\"use strict\";t.exports=function(t,e){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i{\"use strict\";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&\"=\"===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t,e,n){for(var i,o=null,a=[],s=0,u=0;e>2],i=(3&c)<<4,u=1;break;case 1:a[s++]=r[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[s++]=r[i|c>>6],a[s++]=r[63&c],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join(\"\")):String.fromCharCode.apply(String,a.slice(0,s))};var a=\"invalid encoding\";n.decode=function(t,e,n){for(var r,o=n,s=0,u=0;u1)break;if(void 0===(c=i[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:e[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:e[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:e[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-o},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},9211:t=>{\"use strict\";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r{\"use strict\";function e(t){return\"undefined\"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(t,r,i){e[0]=t,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function s(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?i:o,t.writeFloatBE=r?o:i,t.readFloatLE=r?a:s,t.readFloatBE=r?s:a}():function(){function e(t,e,n,r){var i=e<0?1:0;if(i&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((i<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((i<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((i<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,n,r)}}function a(t,e,n){var r=t(e,n),i=2*(r>>31)+1,o=r>>>23&255,a=8388607&r;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=a.bind(null,i),t.readFloatBE=a.bind(null,o)}(),\"undefined\"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function i(t,r,i){e[0]=t,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(t,r,i){e[0]=t,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function s(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?i:o,t.writeDoubleBE=r?o:i,t.readDoubleLE=r?a:s,t.readDoubleBE=r?s:a}():function(){function e(t,e,n,r,i,o){var a=r<0?1:0;if(a&&(r=-r),0===r)t(0,i,o+e),t(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))t(0,i,o+e),t(2146959360,i,o+n);else if(r>17976931348623157e292)t(0,i,o+e),t((a<<31|2146435072)>>>0,i,o+n);else{var s;if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,i,o+e),t((a<<31|s/4294967296)>>>0,i,o+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(s=r*Math.pow(2,-u))>>>0,i,o+e),t((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+n)}}}function a(t,e,n,r,i){var o=t(r,i+e),a=t(r,i+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=a.bind(null,i,0,4),t.readDoubleBE=a.bind(null,o,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},7199:module=>{\"use strict\";function inquire(moduleName){try{var mod=eval(\"quire\".replace(/^/,\"re\"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:t=>{\"use strict\";t.exports=function(t,e,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){if(n<1||n>i)return t(n);a+n>r&&(o=t(r),a=0);var s=e.call(o,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4997:(t,e)=>{\"use strict\";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r191&&r<224?o[a++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join(\"\")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(t,e,n){for(var r,i,o=n,a=0;a>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=t.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-o}},3442:(t,e)=>{\"use strict\";e.__esModule=!0;var n=function(){function t(e){if(!e)throw new TypeError(\"Invalid argument; `value` has no value.\");this.value=t.EMPTY,e&&t.isGuid(e)&&(this.value=e)}return t.isGuid=function(e){var n=e.toString();return e&&(e instanceof t||t.validator.test(n))},t.create=function(){return new t([t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join(\"-\"))},t.createEmpty=function(){return new t(\"emptyguid\")},t.parse=function(e){return new t(e)},t.raw=function(){return[t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join(\"-\")},t.gen=function(t){for(var e=\"\",n=0;n{t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,\"__isLong__\",{value:!0}),n.isLong=r;var i={},o={};function a(t,e){var n,r,a;return e?(a=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(o[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=i[t])?r:(n=u(t,t<0?-1:0,!1),a&&(i[t]=n),n)}function s(t,e){if(isNaN(t))return e?m:b;if(e){if(t<0)return m;if(t>=d)return x}else{if(t<=-h)return T;if(t+1>=h)return w}return t<0?s(-t,e).neg():u(t%f|0,t/f|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t,e,n){if(0===t.length)throw Error(\"empty string\");if(\"NaN\"===t||\"Infinity\"===t||\"+Infinity\"===t||\"-Infinity\"===t)return b;if(\"number\"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error(\"interior hyphen\");if(0===r)return l(t.substring(1),e,n).neg();for(var i=s(c(n,8)),o=b,a=0;a>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((o=u).isZero())return l+a;for(;l.length<6;)l=\"0\"+l;a=\"\"+l+a}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(t){return r(t)||(t=p(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(r(t)||(t=p(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(y)},S.neg=S.negate,S.add=function(t){r(t)||(t=p(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,l=0,f=0,d=0,h=0;return d+=(h+=o+(65535&t.low))>>>16,f+=(d+=i+c)>>>16,l+=(f+=n+s)>>>16,l+=e+a,u((d&=65535)<<16|(h&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},S.subtract=function(t){return r(t)||(t=p(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return b;if(r(t)||(t=p(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return b;if(this.eq(T))return t.isOdd()?T:b;if(t.eq(T))return this.isOdd()?T:b;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,a=65535&this.low,c=t.high>>>16,l=65535&t.high,f=t.low>>>16,d=65535&t.low,h=0,m=0,y=0,_=0;return y+=(_+=a*d)>>>16,m+=(y+=o*d)>>>16,y&=65535,m+=(y+=a*f)>>>16,h+=(m+=i*d)>>>16,m&=65535,h+=(m+=o*f)>>>16,m&=65535,h+=(m+=a*l)>>>16,h+=n*d+i*f+o*l+a*c,u((y&=65535)<<16|(_&=65535),(h&=65535)<<16|(m&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(r(t)||(t=p(t)),t.isZero())throw Error(\"division by zero\");var n,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:b;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return _;o=m}else{if(this.eq(T))return t.eq(y)||t.eq(v)?T:t.eq(T)?y:(n=this.shr(1).div(t).shl(1)).eq(b)?t.isNegative()?y:v:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(T))return this.unsigned?m:b;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=b}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:c(2,a-48),f=s(n),d=f.mul(t);d.isNegative()||d.gt(i);)d=(f=s(n-=l,this.unsigned)).mul(t);f.isZero()&&(f=y),o=o.add(f),i=i.sub(d)}return o},S.div=S.divide,S.modulo=function(t){return r(t)||(t=p(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t){return r(t)||(t=p(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return r(t)||(t=p(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return r(t)||(t=p(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},1446:(t,e,n)=>{\"use strict\";var r,i,o,a=n(2100),s=a.Reader,u=a.Writer,c=a.util,l=a.roots.default||(a.roots.default={});l.onnx=((o={}).Version=(r={},(i=Object.create(r))[r[0]=\"_START_VERSION\"]=0,i[r[1]=\"IR_VERSION_2017_10_10\"]=1,i[r[2]=\"IR_VERSION_2017_10_30\"]=2,i[r[3]=\"IR_VERSION_2017_11_3\"]=3,i[r[4]=\"IR_VERSION_2019_1_22\"]=4,i[r[5]=\"IR_VERSION\"]=5,i),o.AttributeProto=function(){function t(t){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.name=t.string();break;case 21:r.refAttrName=t.string();break;case 13:r.docString=t.string();break;case 20:r.type=t.int32();break;case 2:r.f=t.float();break;case 3:r.i=t.int64();break;case 4:r.s=t.bytes();break;case 5:r.t=l.onnx.TensorProto.decode(t,t.uint32());break;case 6:r.g=l.onnx.GraphProto.decode(t,t.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.i.high>>>0).toNumber())),null!=t.s&&(\"string\"==typeof t.s?c.base64.decode(t.s,e.s=c.newBuffer(c.base64.length(t.s)),0):t.s.length&&(e.s=t.s)),null!=t.t){if(\"object\"!=typeof t.t)throw TypeError(\".onnx.AttributeProto.t: object expected\");e.t=l.onnx.TensorProto.fromObject(t.t)}if(null!=t.g){if(\"object\"!=typeof t.g)throw TypeError(\".onnx.AttributeProto.g: object expected\");e.g=l.onnx.GraphProto.fromObject(t.g)}if(t.floats){if(!Array.isArray(t.floats))throw TypeError(\".onnx.AttributeProto.floats: array expected\");e.floats=[];for(var n=0;n>>0,t.ints[n].high>>>0).toNumber())}if(t.strings){if(!Array.isArray(t.strings))throw TypeError(\".onnx.AttributeProto.strings: array expected\");for(e.strings=[],n=0;n>>0,t.i.high>>>0).toNumber():t.i),null!=t.s&&t.hasOwnProperty(\"s\")&&(n.s=e.bytes===String?c.base64.encode(t.s,0,t.s.length):e.bytes===Array?Array.prototype.slice.call(t.s):t.s),null!=t.t&&t.hasOwnProperty(\"t\")&&(n.t=l.onnx.TensorProto.toObject(t.t,e)),null!=t.g&&t.hasOwnProperty(\"g\")&&(n.g=l.onnx.GraphProto.toObject(t.g,e)),t.floats&&t.floats.length){n.floats=[];for(var i=0;i>>0,t.ints[i].high>>>0).toNumber():t.ints[i];if(t.strings&&t.strings.length)for(n.strings=[],i=0;i>>3){case 1:r.name=t.string();break;case 2:r.type=l.onnx.TypeProto.decode(t,t.uint32());break;case 3:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.name&&t.hasOwnProperty(\"name\")&&!c.isString(t.name))return\"name: string expected\";if(null!=t.type&&t.hasOwnProperty(\"type\")){var e=l.onnx.TypeProto.verify(t.type);if(e)return\"type.\"+e}return null!=t.docString&&t.hasOwnProperty(\"docString\")&&!c.isString(t.docString)?\"docString: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.ValueInfoProto)return t;var e=new l.onnx.ValueInfoProto;if(null!=t.name&&(e.name=String(t.name)),null!=t.type){if(\"object\"!=typeof t.type)throw TypeError(\".onnx.ValueInfoProto.type: object expected\");e.type=l.onnx.TypeProto.fromObject(t.type)}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name=\"\",n.type=null,n.docString=\"\"),null!=t.name&&t.hasOwnProperty(\"name\")&&(n.name=t.name),null!=t.type&&t.hasOwnProperty(\"type\")&&(n.type=l.onnx.TypeProto.toObject(t.type,e)),null!=t.docString&&t.hasOwnProperty(\"docString\")&&(n.docString=t.docString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o.NodeProto=function(){function t(t){if(this.input=[],this.output=[],this.attribute=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(t.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(t.string());break;case 3:r.name=t.string();break;case 4:r.opType=t.string();break;case 7:r.domain=t.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(l.onnx.AttributeProto.decode(t,t.uint32()));break;case 6:r.docString=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.input&&t.hasOwnProperty(\"input\")){if(!Array.isArray(t.input))return\"input: array expected\";for(var e=0;e>>3){case 1:r.irVersion=t.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t,t.uint32()));break;case 2:r.producerName=t.string();break;case 3:r.producerVersion=t.string();break;case 4:r.domain=t.string();break;case 5:r.modelVersion=t.int64();break;case 6:r.docString=t.string();break;case 7:r.graph=l.onnx.GraphProto.decode(t,t.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.irVersion&&t.hasOwnProperty(\"irVersion\")&&!(c.isInteger(t.irVersion)||t.irVersion&&c.isInteger(t.irVersion.low)&&c.isInteger(t.irVersion.high)))return\"irVersion: integer|Long expected\";if(null!=t.opsetImport&&t.hasOwnProperty(\"opsetImport\")){if(!Array.isArray(t.opsetImport))return\"opsetImport: array expected\";for(var e=0;e>>0,t.irVersion.high>>>0).toNumber())),t.opsetImport){if(!Array.isArray(t.opsetImport))throw TypeError(\".onnx.ModelProto.opsetImport: array expected\");e.opsetImport=[];for(var n=0;n>>0,t.modelVersion.high>>>0).toNumber())),null!=t.docString&&(e.docString=String(t.docString)),null!=t.graph){if(\"object\"!=typeof t.graph)throw TypeError(\".onnx.ModelProto.graph: object expected\");e.graph=l.onnx.GraphProto.fromObject(t.graph)}if(t.metadataProps){if(!Array.isArray(t.metadataProps))throw TypeError(\".onnx.ModelProto.metadataProps: array expected\");for(e.metadataProps=[],n=0;n>>0,t.irVersion.high>>>0).toNumber():t.irVersion),null!=t.producerName&&t.hasOwnProperty(\"producerName\")&&(n.producerName=t.producerName),null!=t.producerVersion&&t.hasOwnProperty(\"producerVersion\")&&(n.producerVersion=t.producerVersion),null!=t.domain&&t.hasOwnProperty(\"domain\")&&(n.domain=t.domain),null!=t.modelVersion&&t.hasOwnProperty(\"modelVersion\")&&(\"number\"==typeof t.modelVersion?n.modelVersion=e.longs===String?String(t.modelVersion):t.modelVersion:n.modelVersion=e.longs===String?c.Long.prototype.toString.call(t.modelVersion):e.longs===Number?new c.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber():t.modelVersion),null!=t.docString&&t.hasOwnProperty(\"docString\")&&(n.docString=t.docString),null!=t.graph&&t.hasOwnProperty(\"graph\")&&(n.graph=l.onnx.GraphProto.toObject(t.graph,e)),t.opsetImport&&t.opsetImport.length){n.opsetImport=[];for(var i=0;i>>3){case 1:r.key=t.string();break;case 2:r.value=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return\"object\"!=typeof t||null===t?\"object expected\":null!=t.key&&t.hasOwnProperty(\"key\")&&!c.isString(t.key)?\"key: string expected\":null!=t.value&&t.hasOwnProperty(\"value\")&&!c.isString(t.value)?\"value: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.StringStringEntryProto)return t;var e=new l.onnx.StringStringEntryProto;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key=\"\",n.value=\"\"),null!=t.key&&t.hasOwnProperty(\"key\")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty(\"value\")&&(n.value=t.value),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o.TensorAnnotation=function(){function t(t){if(this.quantParameterTensorNames=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorName=t.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.tensorName&&t.hasOwnProperty(\"tensorName\")&&!c.isString(t.tensorName))return\"tensorName: string expected\";if(null!=t.quantParameterTensorNames&&t.hasOwnProperty(\"quantParameterTensorNames\")){if(!Array.isArray(t.quantParameterTensorNames))return\"quantParameterTensorNames: array expected\";for(var e=0;e>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(l.onnx.NodeProto.decode(t,t.uint32()));break;case 2:r.name=t.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(l.onnx.TensorProto.decode(t,t.uint32()));break;case 10:r.docString=t.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t,t.uint32()));break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.node&&t.hasOwnProperty(\"node\")){if(!Array.isArray(t.node))return\"node: array expected\";for(var e=0;e>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&i))for(var o=t.uint32()+t.pos;t.pos>>0,t.dims[n].high>>>0).toNumber())}if(null!=t.dataType&&(e.dataType=0|t.dataType),null!=t.segment){if(\"object\"!=typeof t.segment)throw TypeError(\".onnx.TensorProto.segment: object expected\");e.segment=l.onnx.TensorProto.Segment.fromObject(t.segment)}if(t.floatData){if(!Array.isArray(t.floatData))throw TypeError(\".onnx.TensorProto.floatData: array expected\");for(e.floatData=[],n=0;n>>0,t.int64Data[n].high>>>0).toNumber())}if(null!=t.name&&(e.name=String(t.name)),null!=t.docString&&(e.docString=String(t.docString)),null!=t.rawData&&(\"string\"==typeof t.rawData?c.base64.decode(t.rawData,e.rawData=c.newBuffer(c.base64.length(t.rawData)),0):t.rawData.length&&(e.rawData=t.rawData)),t.externalData){if(!Array.isArray(t.externalData))throw TypeError(\".onnx.TensorProto.externalData: array expected\");for(e.externalData=[],n=0;n>>0,t.uint64Data[n].high>>>0).toNumber(!0))}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),e.defaults&&(n.dataType=0,n.segment=null,n.name=\"\",e.bytes===String?n.rawData=\"\":(n.rawData=[],e.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString=\"\",n.dataLocation=e.enums===String?\"DEFAULT\":0),t.dims&&t.dims.length){n.dims=[];for(var r=0;r>>0,t.dims[r].high>>>0).toNumber():t.dims[r]}if(null!=t.dataType&&t.hasOwnProperty(\"dataType\")&&(n.dataType=t.dataType),null!=t.segment&&t.hasOwnProperty(\"segment\")&&(n.segment=l.onnx.TensorProto.Segment.toObject(t.segment,e)),t.floatData&&t.floatData.length)for(n.floatData=[],r=0;r>>0,t.int64Data[r].high>>>0).toNumber():t.int64Data[r];if(null!=t.name&&t.hasOwnProperty(\"name\")&&(n.name=t.name),null!=t.rawData&&t.hasOwnProperty(\"rawData\")&&(n.rawData=e.bytes===String?c.base64.encode(t.rawData,0,t.rawData.length):e.bytes===Array?Array.prototype.slice.call(t.rawData):t.rawData),t.doubleData&&t.doubleData.length)for(n.doubleData=[],r=0;r>>0,t.uint64Data[r].high>>>0).toNumber(!0):t.uint64Data[r];if(null!=t.docString&&t.hasOwnProperty(\"docString\")&&(n.docString=t.docString),t.externalData&&t.externalData.length)for(n.externalData=[],r=0;r>>3){case 1:r.begin=t.int64();break;case 2:r.end=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return\"object\"!=typeof t||null===t?\"object expected\":null!=t.begin&&t.hasOwnProperty(\"begin\")&&!(c.isInteger(t.begin)||t.begin&&c.isInteger(t.begin.low)&&c.isInteger(t.begin.high))?\"begin: integer|Long expected\":null!=t.end&&t.hasOwnProperty(\"end\")&&!(c.isInteger(t.end)||t.end&&c.isInteger(t.end.low)&&c.isInteger(t.end.high))?\"end: integer|Long expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorProto.Segment)return t;var e=new l.onnx.TensorProto.Segment;return null!=t.begin&&(c.Long?(e.begin=c.Long.fromValue(t.begin)).unsigned=!1:\"string\"==typeof t.begin?e.begin=parseInt(t.begin,10):\"number\"==typeof t.begin?e.begin=t.begin:\"object\"==typeof t.begin&&(e.begin=new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber())),null!=t.end&&(c.Long?(e.end=c.Long.fromValue(t.end)).unsigned=!1:\"string\"==typeof t.end?e.end=parseInt(t.end,10):\"number\"==typeof t.end?e.end=t.end:\"object\"==typeof t.end&&(e.end=new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.begin=e.longs===String?\"0\":0;c.Long?(r=new c.Long(0,0,!1),n.end=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.end=e.longs===String?\"0\":0}return null!=t.begin&&t.hasOwnProperty(\"begin\")&&(\"number\"==typeof t.begin?n.begin=e.longs===String?String(t.begin):t.begin:n.begin=e.longs===String?c.Long.prototype.toString.call(t.begin):e.longs===Number?new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber():t.begin),null!=t.end&&t.hasOwnProperty(\"end\")&&(\"number\"==typeof t.end?n.end=e.longs===String?String(t.end):t.end:n.end=e.longs===String?c.Long.prototype.toString.call(t.end):e.longs===Number?new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber():t.end),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t.DataLocation=function(){var t={},e=Object.create(t);return e[t[0]=\"DEFAULT\"]=0,e[t[1]=\"EXTERNAL\"]=1,e}(),t}(),o.TensorShapeProto=function(){function t(t){if(this.dim=[],t)for(var e=Object.keys(t),n=0;n>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t,t.uint32()))):t.skipType(7&i)}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.dim&&t.hasOwnProperty(\"dim\")){if(!Array.isArray(t.dim))return\"dim: array expected\";for(var e=0;e>>3){case 1:r.dimValue=t.int64();break;case 2:r.dimParam=t.string();break;case 3:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";var e={};if(null!=t.dimValue&&t.hasOwnProperty(\"dimValue\")&&(e.value=1,!(c.isInteger(t.dimValue)||t.dimValue&&c.isInteger(t.dimValue.low)&&c.isInteger(t.dimValue.high))))return\"dimValue: integer|Long expected\";if(null!=t.dimParam&&t.hasOwnProperty(\"dimParam\")){if(1===e.value)return\"value: multiple values\";if(e.value=1,!c.isString(t.dimParam))return\"dimParam: string expected\"}return null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&!c.isString(t.denotation)?\"denotation: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorShapeProto.Dimension)return t;var e=new l.onnx.TensorShapeProto.Dimension;return null!=t.dimValue&&(c.Long?(e.dimValue=c.Long.fromValue(t.dimValue)).unsigned=!1:\"string\"==typeof t.dimValue?e.dimValue=parseInt(t.dimValue,10):\"number\"==typeof t.dimValue?e.dimValue=t.dimValue:\"object\"==typeof t.dimValue&&(e.dimValue=new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber())),null!=t.dimParam&&(e.dimParam=String(t.dimParam)),null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=\"\"),null!=t.dimValue&&t.hasOwnProperty(\"dimValue\")&&(\"number\"==typeof t.dimValue?n.dimValue=e.longs===String?String(t.dimValue):t.dimValue:n.dimValue=e.longs===String?c.Long.prototype.toString.call(t.dimValue):e.longs===Number?new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber():t.dimValue,e.oneofs&&(n.value=\"dimValue\")),null!=t.dimParam&&t.hasOwnProperty(\"dimParam\")&&(n.dimParam=t.dimParam,e.oneofs&&(n.value=\"dimParam\")),null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),o.TypeProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorType=l.onnx.TypeProto.Tensor.decode(t,t.uint32());break;case 6:r.denotation=t.string();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.tensorType&&t.hasOwnProperty(\"tensorType\")){var e=l.onnx.TypeProto.Tensor.verify(t.tensorType);if(e)return\"tensorType.\"+e}return null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&!c.isString(t.denotation)?\"denotation: string expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto)return t;var e=new l.onnx.TypeProto;if(null!=t.tensorType){if(\"object\"!=typeof t.tensorType)throw TypeError(\".onnx.TypeProto.tensorType: object expected\");e.tensorType=l.onnx.TypeProto.Tensor.fromObject(t.tensorType)}return null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=\"\"),null!=t.tensorType&&t.hasOwnProperty(\"tensorType\")&&(n.tensorType=l.onnx.TypeProto.Tensor.toObject(t.tensorType,e),e.oneofs&&(n.value=\"tensorType\")),null!=t.denotation&&t.hasOwnProperty(\"denotation\")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.Tensor=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.elemType=t.int32();break;case 2:r.shape=l.onnx.TensorShapeProto.decode(t,t.uint32());break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if(\"object\"!=typeof t||null===t)return\"object expected\";if(null!=t.elemType&&t.hasOwnProperty(\"elemType\")&&!c.isInteger(t.elemType))return\"elemType: integer expected\";if(null!=t.shape&&t.hasOwnProperty(\"shape\")){var e=l.onnx.TensorShapeProto.verify(t.shape);if(e)return\"shape.\"+e}return null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto.Tensor)return t;var e=new l.onnx.TypeProto.Tensor;if(null!=t.elemType&&(e.elemType=0|t.elemType),null!=t.shape){if(\"object\"!=typeof t.shape)throw TypeError(\".onnx.TypeProto.Tensor.shape: object expected\");e.shape=l.onnx.TensorShapeProto.fromObject(t.shape)}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.elemType=0,n.shape=null),null!=t.elemType&&t.hasOwnProperty(\"elemType\")&&(n.elemType=t.elemType),null!=t.shape&&t.hasOwnProperty(\"shape\")&&(n.shape=l.onnx.TensorShapeProto.toObject(t.shape,e)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),o.OperatorSetIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.domain=t.string();break;case 2:r.version=t.int64();break;default:t.skipType(7&i)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return\"object\"!=typeof t||null===t?\"object expected\":null!=t.domain&&t.hasOwnProperty(\"domain\")&&!c.isString(t.domain)?\"domain: string expected\":null!=t.version&&t.hasOwnProperty(\"version\")&&!(c.isInteger(t.version)||t.version&&c.isInteger(t.version.low)&&c.isInteger(t.version.high))?\"version: integer|Long expected\":null},t.fromObject=function(t){if(t instanceof l.onnx.OperatorSetIdProto)return t;var e=new l.onnx.OperatorSetIdProto;return null!=t.domain&&(e.domain=String(t.domain)),null!=t.version&&(c.Long?(e.version=c.Long.fromValue(t.version)).unsigned=!1:\"string\"==typeof t.version?e.version=parseInt(t.version,10):\"number\"==typeof t.version?e.version=t.version:\"object\"==typeof t.version&&(e.version=new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults)if(n.domain=\"\",c.Long){var r=new c.Long(0,0,!1);n.version=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.version=e.longs===String?\"0\":0;return null!=t.domain&&t.hasOwnProperty(\"domain\")&&(n.domain=t.domain),null!=t.version&&t.hasOwnProperty(\"version\")&&(\"number\"==typeof t.version?n.version=e.longs===String?String(t.version):t.version:n.version=e.longs===String?c.Long.prototype.toString.call(t.version):e.longs===Number?new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber():t.version),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),o),t.exports=l},2100:(t,e,n)=>{\"use strict\";t.exports=n(9482)},9482:(t,e,n)=>{\"use strict\";var r=e;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build=\"minimal\",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=i,i()},1408:(t,e,n)=>{\"use strict\";t.exports=u;var r,i=n(9693),o=i.LongBits,a=i.utf8;function s(t,e){return RangeError(\"index out of range: \"+t.pos+\" + \"+(e||1)+\" > \"+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var c,l=\"undefined\"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error(\"illegal buffer\")}:function(t){if(Array.isArray(t))return new u(t);throw Error(\"illegal buffer\")},p=function(){return i.Buffer?function(t){return(u.create=function(t){return i.Buffer.isBuffer(t)?new r(t):l(t)})(t)}:l};function f(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error(\"invalid varint encoding\")}function d(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)},u.prototype.string=function(){var t=this.bytes();return a.read(t,0,t.length)},u.prototype.skip=function(t){if(\"number\"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+t+\" at offset \"+this.pos)}return this},u._configure=function(t){r=t,u.create=p(),r._configure();var e=i.Long?\"toLong\":\"toNumber\";i.merge(u.prototype,{int64:function(){return f.call(this)[e](!1)},uint64:function(){return f.call(this)[e](!0)},sint64:function(){return f.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},593:(t,e,n)=>{\"use strict\";t.exports=o;var r=n(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(t){r.call(this,t)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString(\"utf-8\",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},5054:t=>{\"use strict\";t.exports={}},5994:(t,e,n)=>{\"use strict\";e.Service=n(7948)},7948:(t,e,n)=>{\"use strict\";t.exports=i;var r=n(9693);function i(t,e,n){if(\"function\"!=typeof t)throw TypeError(\"rpcImpl must be a function\");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function t(e,n,i,o,a){if(!o)throw TypeError(\"request must be specified\");var s=this;if(!a)return r.asPromise(t,s,e,n,i,o);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?\"encodeDelimited\":\"encode\"](o).finish(),(function(t,n){if(t)return s.emit(\"error\",t,e),a(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?\"decodeDelimited\":\"decode\"](n)}catch(t){return s.emit(\"error\",t,e),a(t)}return s.emit(\"data\",n,e),a(null,n)}s.end(!0)}))}catch(t){return s.emit(\"error\",t,e),void setTimeout((function(){a(t)}),0)}else setTimeout((function(){a(Error(\"already ended\"))}),0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(\"end\").off()),this}},1945:(t,e,n)=>{\"use strict\";t.exports=i;var r=n(9693);function i(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash=\"\\0\\0\\0\\0\\0\\0\\0\\0\";i.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(t){if(\"number\"==typeof t)return i.fromNumber(t);if(r.isString(t)){if(!r.Long)return i.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new i(t.low>>>0,t.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;i.fromHash=function(t){return t===a?o:new i((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},9693:function(t,e,n){\"use strict\";var r=e;function i(t,e,n){for(var r=Object.keys(e),i=0;i0)},r.Buffer=function(){try{var t=r.inquire(\"buffer\").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return\"number\"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):\"undefined\"==typeof Uint8Array?t:new Uint8Array(t)},r.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire(\"long\"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=i,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o(\"ProtocolError\"),r.oneOfGetter=function(t){for(var e={},n=0;n-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n{\"use strict\";t.exports=p;var r,i=n(9693),o=i.LongBits,a=i.base64,s=i.utf8;function u(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function c(){}function l(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function p(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function d(t,e,n){e[n]=255&t}function h(t,e){this.len=t,this.next=void 0,this.val=e}function g(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function b(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}p.create=f(),p.alloc=function(t){return new i.Array(t)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(t,e,n){return this.tail=this.tail.next=new u(t,e,n),this.len+=e,this},h.prototype=Object.create(u.prototype),h.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},p.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new h((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},p.prototype.int32=function(t){return t<0?this._push(g,10,o.fromNumber(t)):this.uint32(t)},p.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},p.prototype.uint64=function(t){var e=o.from(t);return this._push(g,e.length(),e)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(g,e.length(),e)},p.prototype.bool=function(t){return this._push(d,1,t?1:0)},p.prototype.fixed32=function(t){return this._push(b,4,t>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(t){var e=o.from(t);return this._push(b,4,e.lo)._push(b,4,e.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(t){return this._push(i.float.writeFloatLE,4,t)},p.prototype.double=function(t){return this._push(i.float.writeDoubleLE,8,t)};var m=i.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r>>0;if(!e)return this._push(d,1,0);if(i.isString(t)){var n=p.alloc(e=a.length(t));a.decode(t,n,0),t=n}return this.uint32(e)._push(m,e,t)},p.prototype.string=function(t){var e=s.length(t);return e?this.uint32(e)._push(s.write,e,t):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},p.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},p._configure=function(t){r=t,p.create=f(),r._configure()}},3155:(t,e,n)=>{\"use strict\";t.exports=o;var r=n(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(){r.call(this)}function a(t,e,n){t.length<40?i.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&\"set\"===i.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=i.Buffer.byteLength(t);return this.uint32(e),e&&this._push(a,e,t),this},o._configure()},7714:(t,e,n)=>{\"use strict\";e.R=void 0;const r=n(6919),i=n(7448);e.R=new class{async init(){}async createSessionHandler(t,e){const n=new r.Session(e);return await n.loadModel(t),new i.OnnxjsSessionHandler(n)}}},4200:(t,e,n)=>{\"use strict\";e.c8=e.rX=void 0;const r=n(1670),i=n(5381),o=n(2157),a=n(2306);e.rX=()=>{if((\"number\"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),\"boolean\"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),\"boolean\"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),\"number\"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const t=\"undefined\"==typeof navigator?(0,i.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,o.initWasm)()}async createSessionHandler(t,e){const n=new a.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(t,e),Promise.resolve(n)}}},6018:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)\"default\"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(n(1670),e);const o=n(1670);{const t=n(7714).R;(0,o.registerBackend)(\"webgl\",t,-10)}{const t=n(4200).c8;(0,o.registerBackend)(\"cpu\",t,10),(0,o.registerBackend)(\"wasm\",t,10),(0,o.registerBackend)(\"xnnpack\",t,9)}},246:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createAttributeWithCacheKey=void 0;class n{constructor(t){Object.assign(this,t)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((t=>`${this[t]}`)).join(\";\")),this._cacheKey}}e.createAttributeWithCacheKey=t=>new n(t)},7778:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Attribute=void 0;const r=n(1446),i=n(9395),o=n(9162),a=n(2517);var s=i.onnxruntime.experimental.fbs;class u{constructor(t){if(this._attributes=new Map,null!=t){for(const e of t)e instanceof r.onnx.AttributeProto?this._attributes.set(e.name,[u.getValue(e),u.getType(e)]):e instanceof s.Attribute&&this._attributes.set(e.name(),[u.getValue(e),u.getType(e)]);if(this._attributes.sizeo.Tensor.fromProto(t)));if(t instanceof s.Attribute)return n.map((t=>o.Tensor.fromOrtTensor(t)))}if(e===r.onnx.AttributeProto.AttributeType.STRING&&t instanceof r.onnx.AttributeProto){const t=n;return(0,a.decodeUtf8String)(t)}return e===r.onnx.AttributeProto.AttributeType.STRINGS&&t instanceof r.onnx.AttributeProto?n.map(a.decodeUtf8String):n}static getValueNoCheck(t){return t instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(t):this.getValueNoCheckFromOrtFormat(t)}static getValueNoCheckFromOnnxFormat(t){switch(t.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return t.f;case r.onnx.AttributeProto.AttributeType.INT:return t.i;case r.onnx.AttributeProto.AttributeType.STRING:return t.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return t.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return t.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return t.floats;case r.onnx.AttributeProto.AttributeType.INTS:return t.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return t.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return t.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return t.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t.type]}`)}}static getValueNoCheckFromOrtFormat(t){switch(t.type()){case s.AttributeType.FLOAT:return t.f();case s.AttributeType.INT:return t.i();case s.AttributeType.STRING:return t.s();case s.AttributeType.TENSOR:return t.t();case s.AttributeType.GRAPH:return t.g();case s.AttributeType.FLOATS:return t.floatsArray();case s.AttributeType.INTS:{const e=[];for(let n=0;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.resolveBackend=e.backend=void 0;const r=n(5038),i=new Map;async function o(t){const n=e.backend;if(void 0!==n[t]&&function(t){const e=t;return\"initialize\"in e&&\"function\"==typeof e.initialize&&\"createSessionHandler\"in e&&\"function\"==typeof e.createSessionHandler&&\"dispose\"in e&&\"function\"==typeof e.dispose}(n[t])){const e=n[t];let r=e.initialize();if(\"object\"==typeof r&&\"then\"in r&&(r=await r),r)return i.set(t,e),e}}e.backend={webgl:new r.WebGLBackend},e.resolveBackend=async function t(e){if(!e)return t([\"webgl\"]);{const t=\"string\"==typeof e?[e]:e;for(const e of t){const t=i.get(e);if(t)return t;const n=await o(e);if(n)return n}}throw new Error(\"no available backend to use\")}},5038:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLBackend=void 0;const r=n(1670),i=n(6231),o=n(6416),a=n(7305);e.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(t){r.env.webgl.contextId=t}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(t){r.env.webgl.matmulMaxBatchSize=t}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(t){r.env.webgl.textureCacheMode=t}get pack(){return r.env.webgl.pack}set pack(t){r.env.webgl.pack=t}get async(){return r.env.webgl.async}set async(t){r.env.webgl.async=t}initialize(){try{return this.glContext=(0,a.createWebGLContext)(this.contextId),\"number\"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),\"string\"!=typeof this.textureCacheMode&&(this.textureCacheMode=\"full\"),\"boolean\"!=typeof this.pack&&(this.pack=!1),\"boolean\"!=typeof this.async&&(this.async=!1),i.Logger.setWithEnv(r.env),i.Logger.verbose(\"WebGLBackend\",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(t){return i.Logger.warning(\"WebGLBackend\",`Unable to initialize WebGLBackend. ${t}`),!1}}createSessionHandler(t){return new o.WebGLSessionHandler(this,t)}dispose(){this.glContext.dispose()}}},5107:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.CoordsGlslLib=void 0;const r=n(2517),i=n(8520),o=n(5060),a=n(7859),s=n(9390);class u extends i.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new i.GlslLibRoutine(\"\\n vec2 offsetToCoords(int offset, int width, int height) {\\n int t = offset / width;\\n int s = offset - t*width;\\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\\n return coords;\\n }\\n \")}}coordsToOffset(){return{coordsToOffset:new i.GlslLibRoutine(\"\\n int coordsToOffset(vec2 coords, int width, int height) {\\n float s = coords.s * float(width);\\n float t = coords.t * float(height);\\n int offset = int(t) * width + int(s);\\n return offset;\\n }\\n \")}}getOutputSamplingSnippet(){const t=this.context.outputTextureLayout;return t.isPacked?this.getPackedOutputSamplingSnippet(t):this.getUnpackedOutputSamplingSnippet(t)}getPackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},a=\"getOutputCoords\";switch(e.length){case 0:r[a]=this.getOutputScalarCoords();break;case 1:r[a]=this.getOutputPacked1DCoords(e,n);break;case 2:r[a]=this.getOutputPacked2DCoords(e,n);break;case 3:r[a]=this.getOutputPacked3DCoords(e,n);break;default:r[a]=this.getOutputPackedNDCoords(e,n)}const s=`\\n void setOutput(vec4 val) {\\n ${(0,o.getGlsl)(this.context.glContext.version).output} = val;\\n }\\n `;return r.floatTextureSetRGBA=new i.GlslLibRoutine(s),r}getUnpackedOutputSamplingSnippet(t){const e=t.unpackedShape,n=[t.width,t.height],r={},a=\"getOutputCoords\";switch(e.length){case 0:r[a]=this.getOutputScalarCoords();break;case 1:r[a]=this.getOutputUnpacked1DCoords(e,n);break;case 2:r[a]=this.getOutputUnpacked2DCoords(e,n);break;case 3:r[a]=this.getOutputUnpacked3DCoords(e,n);break;case 4:r[a]=this.getOutputUnpacked4DCoords(e,n);break;case 5:r[a]=this.getOutputUnpacked5DCoords(e,n);break;case 6:r[a]=this.getOutputUnpacked6DCoords(e,n);break;default:throw new Error(`Unsupported output dimensionality: ${e.length}`)}const s=`\\n void setOutput(float val) {\\n ${(0,o.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\\n }\\n `;return r.floatTextureSetR=new i.GlslLibRoutine(s),r}getOutputScalarCoords(){return new i.GlslLibRoutine(\"\\n int getOutputCoords() {\\n return 0;\\n }\\n \")}getOutputPacked1DCoords(t,e){const n=e;let r=\"\";return 1===n[0]?(r=`\\n int getOutputCoords() {\\n return 2 * int(TexCoords.y * ${n[1]}.0);\\n }\\n `,new i.GlslLibRoutine(r)):1===n[1]?(r=`\\n int getOutputCoords() {\\n return 2 * int(TexCoords.x * ${n[0]}.0);\\n }\\n `,new i.GlslLibRoutine(r)):(r=`\\n int getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${n[0]}, ${n[1]}));\\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\\n }\\n `,new i.GlslLibRoutine(r))}getOutputPacked2DCoords(t,e){let n=\"\";if(r.ArrayUtil.arraysEqual(t,e))return n=`\\n ivec2 getOutputCoords() {\\n return 2 * ivec2(TexCoords.xy * vec2(${e[0]}, ${e[1]}));\\n }\\n `,new i.GlslLibRoutine(n);const o=e,a=Math.ceil(t[1]/2);return n=`\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${o[0]}, ${o[1]}));\\n\\n int index = resTexRC.y * ${o[0]} + resTexRC.x;\\n\\n // reverse r and c order for packed texture\\n int r = imod(index, ${a}) * 2;\\n int c = 2 * (index / ${a});\\n\\n return ivec2(r, c);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputPacked3DCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[2]/2),o=r*Math.ceil(t[1]/2),a=`\\n ivec3 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${n[0]}, ${n[1]}));\\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\\n\\n int b = index / ${o};\\n index -= b * ${o};\\n\\n // reverse r and c order for packed texture\\n int r = imod(index, ${r}) * 2;\\n int c = 2 * (index / ${r});\\n\\n return ivec3(b, r, c);\\n }\\n `;return new i.GlslLibRoutine(a)}getOutputPackedNDCoords(t,e){const n=[e[0],e[1]],r=Math.ceil(t[t.length-1]/2),o=r*Math.ceil(t[t.length-2]/2);let a=o,s=\"\",u=\"b, r, c\";for(let e=2;e=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec3 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec3(r, c, d);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputUnpacked4DCoords(t,e){let n=\"\";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\",\"d2\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec4 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec4(r, c, d, d2);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputUnpacked5DCoords(t,e){let n=\"\";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\",\"d2\",\"d3\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec5 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec5(r, c, d, d2, d3);\\n }\\n `,new i.GlslLibRoutine(n)}getOutputUnpacked6DCoords(t,e){let n=\"\";const r=t.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=t[r-1];for(let e=r-3;e>=0;--e)o[e]=o[e+1]*t[e+1];const a=[\"r\",\"c\",\"d\",\"d2\",\"d3\",\"d4\"],s=o.map(((t,e)=>`int ${a[e]} = index / ${t}; ${e===o.length-1?`int ${a[e+1]} = index - ${a[e]} * ${t}`:`index -= ${a[e]} * ${t}`};`)).join(\"\");return n=`\\n ivec6 getOutputCoords() {\\n ivec2 resTexRC = ivec2(TexCoords.xy *\\n vec2(${e[0]}, ${e[1]}));\\n int index = resTexRC.y * ${e[0]} + resTexRC.x;\\n ${s}\\n return ivec6(r, c, d, d2, d3, d4);\\n }\\n `,new i.GlslLibRoutine(n)}getCommonUtilFuncs(){const t={};let e=\"uvFromFlat\";t[e]=new i.GlslLibRoutine(\"\\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\\n int texC = index / texNumR;\\n int texR = index - texC * texNumR;\\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\\n // v.\\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\\n }\\n \"),e=\"packedUVfrom1D\",t[e]=new i.GlslLibRoutine(\"\\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\\n int texelIndex = index / 2;\\n int texR = texelIndex / texNumC;\\n int texC = texelIndex - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n }\\n \"),e=\"packedUVfrom2D\",t[e]=new i.GlslLibRoutine(\"\\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\\n int texR = texelIndex / texNumC;\\n int texC = texelIndex - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n }\\n \"),e=\"packedUVfrom3D\",t[e]=new i.GlslLibRoutine(\"\\n vec2 packedUVfrom3D(int texNumR, int texNumC,\\n int texelsInBatch, int texelsInLogicalRow, int b,\\n int row, int col) {\\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n }\\n \"),e=\"sampleTexture\";const n=(0,o.getGlsl)(this.context.glContext.version);return t[e]=new i.GlslLibRoutine(`\\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\\n return ${n.texture2D}(textureSampler, uv).r;\\n }`),t}getInputsSamplingSnippets(){const t={},e=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach(((n,r)=>{const i=this.context.inputTextureLayouts[r],o=(0,s.generateShaderFuncNameFromInputSamplerName)(n);i.isPacked?t[o]=this.getPackedSamplerFromInput(o,n,i):t[o]=this.getUnpackedSamplerFromInput(o,n,i);const a=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);i.unpackedShape.length<=e.unpackedShape.length&&(i.isPacked?t[a]=this.getPackedSamplerAtOutputCoords(a,i,e,n):t[a]=this.getUnpackedSamplerAtOutputCoords(a,i,e,n))})),t}getPackedSamplerAtOutputCoords(t,e,n,o){const a=e.unpackedShape,u=n.unpackedShape,c=o,l=(0,s.generateShaderFuncNameFromInputSamplerName)(c),p=a.length,f=u.length,d=r.BroadcastUtil.getBroadcastDims(a,u),h=(0,s.getCoordsDataType)(f),g=f-p;let b;const m=(0,s.getGlChannels)();b=0===p?\"\":f<2&&d.length>=1?\"coords = 0;\":d.map((t=>`coords.${m[t+g]} = 0;`)).join(\"\\n\");let y=\"\";y=f<2&&p>0?\"coords\":a.map(((t,e)=>`coords.${m[e+g]}`)).join(\", \");let _=\"return outputValue;\";const v=1===r.ShapeUtil.size(a),w=1===r.ShapeUtil.size(u);if(1!==p||v||w){if(v&&!w)_=1===f?\"\\n return vec4(outputValue.x, outputValue.x, 0., 0.);\\n \":\"\\n return vec4(outputValue.x);\\n \";else if(d.length){const t=p-2,e=p-1;d.indexOf(t)>-1&&d.indexOf(e)>-1?_=\"return vec4(outputValue.x);\":d.indexOf(t)>-1?_=\"return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);\":d.indexOf(e)>-1&&(_=\"return vec4(outputValue.xx, outputValue.zz);\")}}else _=\"\\n return vec4(outputValue.xy, outputValue.xy);\\n \";const x=`\\n vec4 ${t}() {\\n ${h} coords = getOutputCoords();\\n \\n int lastDim = coords.${m[f-1]};\\n coords.${m[f-1]} = coords.${m[f-2]};\\n coords.${m[f-2]} = lastDim;\\n \\n ${b}\\n vec4 outputValue = ${l}(${y});\\n ${_}\\n }\\n `;return new i.GlslLibRoutine(x,[\"coordinates.getOutputCoords\"])}getUnpackedSamplerAtOutputCoords(t,e,n,o){const a=[n.width,n.height],u=[e.width,e.height],c=e.unpackedShape.length,l=n.unpackedShape.length,p=e.unpackedShape,f=n.unpackedShape,d=(0,s.generateShaderFuncNameFromInputSamplerName)(o);if(c===l&&r.ArrayUtil.arraysEqual(u,a)){const e=`\\n float ${t}() {\\n return sampleTexture(${o}, TexCoords);\\n }\\n `;return new i.GlslLibRoutine(e,[\"coordinates.sampleTexture\"])}const h=(0,s.getCoordsDataType)(l),g=r.BroadcastUtil.getBroadcastDims(p,f),b=l-c;let m;const y=(0,s.getGlChannels)();m=0===c?\"\":l<2&&g.length>=1?\"coords = 0;\":g.map((t=>`coords.${y[t+b]} = 0;`)).join(\"\\n\");let _=\"\";_=l<2&&c>0?\"coords\":e.unpackedShape.map(((t,e)=>`coords.${y[e+b]}`)).join(\", \");const v=`\\n float ${t}() {\\n ${h} coords = getOutputCoords();\\n ${m}\\n return ${d}(${_});\\n }\\n `;return new i.GlslLibRoutine(v,[\"coordinates.getOutputCoords\"])}getPackedSamplerFromInput(t,e,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t,e);case 1:return this.getPackedSampler1D(t,e,n);case 2:return this.getPackedSampler2D(t,e,n);case 3:return this.getPackedSampler3D(t,e,n);default:return this.getPackedSamplerND(t,e,n)}}getUnpackedSamplerFromInput(t,e,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(t,e,n);case 1:return this.getUnpackedSampler1D(t,e,n);case 2:return this.getUnpackedSampler2D(t,e,n);case 3:return this.getUnpackedSampler3D(t,e,n);case 4:return this.getUnpackedSampler4D(t,e,n);case 5:return this.getUnpackedSampler5D(t,e,n);case 6:return this.getUnpackedSampler6D(t,e,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(t,e){const n=`\\n vec4 ${t}() {\\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e}, halfCR);\\n }\\n `;return new i.GlslLibRoutine(n)}getPackedSampler1D(t,e,n){const r=[n.width,n.height],a=[r[1],r[0]],s=(0,o.getGlsl)(this.context.glContext.version),u=`vec4 ${t}(int index) {\\n vec2 uv = packedUVfrom1D(\\n ${a[0]}, ${a[1]}, index);\\n return ${s.texture2D}(${e}, uv);\\n }`;return new i.GlslLibRoutine(u,[\"coordinates.packedUVfrom1D\"])}getPackedSampler2D(t,e,n){const a=n.unpackedShape,s=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=s[0],l=s[1];if(null!=s&&r.ArrayUtil.arraysEqual(a,s)){const n=`vec4 ${t}(int row, int col) {\\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${c}.0);\\n return ${u.texture2D}(${e}, uv);\\n }`;return new i.GlslLibRoutine(n)}const p=s,f=Math.ceil(a[1]/2),d=`vec4 ${t}(int row, int col) {\\n vec2 uv = packedUVfrom2D(${p[1]}, ${p[0]}, ${f}, row, col);\\n return ${u.texture2D}(${e}, uv);\\n }`;return new i.GlslLibRoutine(d,[\"coordinates.packedUVfrom2D\"])}getPackedSampler3D(t,e,n){const r=n.unpackedShape,a=[n.width,n.height],u=[a[0],a[1]],c=(0,o.getGlsl)(this.context.glContext.version);if(1===r[0]){const o=r.slice(1),a=[1,2],u=(0,s.squeezeInputShape)(r,o),c=[\"b\",\"row\",\"col\"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=u;const p=this.getPackedSamplerFromInput(t,e,l),f=`${p.routineBody}\\n vec4 ${t}(int b, int row, int col) {\\n return ${t}(${(0,s.getSqueezedParams)(c,a)});\\n } `;return new i.GlslLibRoutine(f,p.dependencies)}const l=u[0],p=u[1],f=Math.ceil(r[2]/2),d=`vec4 ${t}(int b, int row, int col) {\\n vec2 uv = packedUVfrom3D(\\n ${p}, ${l}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\\n return ${c.texture2D}(${e}, uv);}`;return new i.GlslLibRoutine(d,[\"coordinates.packedUVfrom3D\"])}getPackedSamplerND(t,e,n){const r=n.unpackedShape,a=r.length,s=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=[s[0],s[1]],l=c[1],p=c[0],f=Math.ceil(r[a-1]/2);let d=f*Math.ceil(r[a-2]/2),h=\"int b, int row, int col\",g=`b * ${d} + (row / 2) * ${f} + (col / 2)`;for(let t=2;t{const r=this.context.inputTextureLayouts[n],o=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let a=`_${e}`;t[a]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!1),[`shapeUtils.indicesToOffset${a}`,\"coordinates.offsetToCoords\",\"fragcolor.getColorAsFloat\"]),a+=\"_T\",t[a]=new i.GlslLibRoutine(this.getValueFromSingle(e,o,r.width,r.height,!0),[`shapeUtils.indicesToOffset${a}`,\"coordinates.offsetToCoords\",\"fragcolor.getColorAsFloat\"])})),t}getValueFromSingle(t,e,n,r,i){let a=`_${t}`;return i&&(a+=\"_T\"),`\\n float ${a}(int m[${e}]) {\\n int offset = indicesToOffset${a}(m);\\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\\n float value = getColorAsFloat(${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords));\\n return value;\\n }\\n `}getPackedValueFrom(t,e,n,r,i){let a=`_${t}_Pack`;return i&&(a+=\"_T\"),`\\n vec4 ${a}(int m[${e}]) {\\n int offset = indicesToOffset_${t}(m);\\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, coords);\\n }\\n `}}e.CoordsGlslLib=u},8520:(t,e)=>{\"use strict\";var n;Object.defineProperty(e,\"__esModule\",{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||(e.FunctionType={}))[n.ValueBased=0]=\"ValueBased\",n[n.Positional=1]=\"Positional\",e.GlslContext=class{constructor(t,e,n,r){this.glContext=t,this.programInfo=e,this.inputTextureLayouts=n,this.outputTextureLayout=r}},e.GlslLib=class{constructor(t){this.context=t}},e.GlslLibRoutine=class{constructor(t,e){this.routineBody=t,this.dependencies=e}},e.GlslLibRoutineNode=class{constructor(t,e,n){this.name=t,this.dependencies=n||[],e&&(this.routineBody=e)}addDependency(t){t&&this.dependencies.push(t)}},e.TopologicalSortGlslRoutines=class{static returnOrderedNodes(t){if(!t||0===t.length)return[];if(1===t.length)return t;const e=new Set,n=new Set,r=new Array;return this.createOrderedNodes(t,e,n,r),r}static createOrderedNodes(t,e,n,r){for(let i=0;i0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.EncodingGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine(\"highp vec4 encode(highp float f) {\\n return vec4(f, 0.0, 0.0, 0.0);\\n }\\n \")}}decodeFloat32(){return{decode:new r.GlslLibRoutine(\"highp float decode(highp vec4 rgba) {\\n return rgba.r;\\n }\\n \")}}encodeUint8(){const t=i.isLittleEndian()?\"rgba.rgba=rgba.abgr;\":\"\";return{encode:new r.GlslLibRoutine(`\\n highp vec4 encode(highp float f) {\\n highp float F = abs(f);\\n highp float Sign = step(0.0,-f);\\n highp float Exponent = floor(log2(F));\\n highp float Mantissa = (exp2(- Exponent) * F);\\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\\n highp vec4 rgba;\\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\\n ${t}\\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\\n return rgba;\\n }\\n `)}}decodeUint8(){const t=i.isLittleEndian()?\"rgba.rgba=rgba.abgr;\":\"\";return{decode:new r.GlslLibRoutine(`\\n highp float decode(highp vec4 rgba) {\\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\\n ${t}\\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\\n return Result;\\n }\\n `)}}static isLittleEndian(){const t=new ArrayBuffer(4),e=new Uint32Array(t),n=new Uint8Array(t);if(e[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error(\"unknown endianness\")}}e.EncodingGlslLib=i},9894:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.FragColorGlslLib=void 0;const r=n(8520),i=n(5060);class o extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const t=(0,i.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\\n void setFragColor(float value) {\\n ${t.output} = encode(value);\\n }\\n `,[\"encoding.encode\"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine(\"\\n float getColorAsFloat(vec4 color) {\\n return decode(color);\\n }\\n \",[\"encoding.decode\"])}}}e.FragColorGlslLib=o},2848:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.replaceInlines=void 0;const n=/@inline[\\s\\n\\r]+(\\w+)[\\s\\n\\r]+([0-9a-zA-Z_]+)\\s*\\(([^)]*)\\)\\s*{(([^}]|[\\n\\r])*)}/gm;e.replaceInlines=function(t){const e={};let r;for(;null!==(r=n.exec(t));){const t=r[3].split(\",\").map((t=>{const e=t.trim().split(\" \");return e&&2===e.length?{type:e[0],name:e[1]}:null})).filter((t=>null!==t));e[r[2]]={params:t,body:r[4]}}for(const n in e){const i=\"(\\\\w+)?\\\\s+([_0-9a-zA-Z]+)\\\\s+=\\\\s+__FUNC__\\\\((.*)\\\\)\\\\s*;\".replace(\"__FUNC__\",n),o=new RegExp(i,\"gm\");for(;null!==(r=o.exec(t));){const i=r[1],o=r[2],a=r[3].split(\",\"),s=i?`${i} ${o};`:\"\";let u=e[n].body,c=\"\";e[n].params.forEach(((t,e)=>{t&&(c+=`${t.type} ${t.name} = ${a[e]};\\n`)})),u=`${c}\\n ${u}`,u=u.replace(\"return\",`${o} = `);const l=`\\n ${s}\\n {\\n ${u}\\n }\\n `;t=t.replace(r[0],l)}}return t.replace(n,\"\")}},8879:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.GlslPreprocessor=void 0;const r=n(8520),i=n(2848),o=n(5483),a=n(5060);e.GlslPreprocessor=class{constructor(t,e,n,i){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(t,e,n,i),Object.keys(o.glslRegistry).forEach((t=>{const e=new o.glslRegistry[t](this.context);this.libs[t]=e}));const a=this.glslLibRoutineDependencyGraph;for(const t in this.libs){const e=this.libs[t].getFunctions();for(const n in e){const i=t+\".\"+n;let o;a[i]?(o=a[i],o.routineBody=e[n].routineBody):(o=new r.GlslLibRoutineNode(i,e[n].routineBody),a[i]=o);const s=e[n].dependencies;if(s)for(let t=0;t{const r=n.split(\".\")[1];-1!==t.indexOf(r)&&e.push(this.glslLibRoutineDependencyGraph[n])})),r.TopologicalSortGlslRoutines.returnOrderedNodes(e)}getUniforms(t,e){const n=[];if(t)for(const e of t)n.push(`uniform sampler2D ${e};`);if(e)for(const t of e)n.push(`uniform ${t.type} ${t.name}${t.arrayLength?`[${t.arrayLength}]`:\"\"};`);return n.join(\"\\n\")}}},5483:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.glslRegistry=void 0;const r=n(5107),i=n(7341),o=n(9894),a=n(2655),s=n(3891);e.glslRegistry={encoding:i.EncodingGlslLib,fragcolor:o.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:a.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeUtilsGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const t=this.context.outputTextureLayout.shape.length,e={};return this.context.programInfo.inputNames.forEach(((n,i)=>{const o=this.context.inputTextureLayouts[i].unpackedShape;if(o.length<=t){const i=o.length,a=t-i,s=`bcastIndices_${n}`;let u=\"\";for(let t=0;t{const o=this.context.inputTextureLayouts[i].shape;if(!(o.length<2||o.length>t)){const i=o.length,a=t-i,s=`bcastMatmulIndices_${n}`;let u=\"\";for(let t=0;t{const o=this.context.inputTextureLayouts[n].shape,a=this.context.inputTextureLayouts[n].strides,s=o.length;let u=`indicesToOffset_${e}`;t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a)),u=`indicesToOffset_${e}_T`,t[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a.slice().reverse()))})),t}static indexToOffsetSingle(t,e,n){let r=\"\";for(let t=e-1;t>=0;--t)r+=`\\n offset += indices[${t}] * ${n[t]};\\n `;return`\\n int ${t}(int indices[${e}]) {\\n int offset = 0;\\n ${r}\\n return offset;\\n }\\n `}offsetToIndices(){const t={};return this.context.programInfo.inputNames.forEach(((e,n)=>{const o=this.context.inputTextureLayouts[n].shape,a=this.context.inputTextureLayouts[n].strides,s=o.length;let u=`offsetToIndices_${e}`;t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a)),u=`offsetToIndices_${e}_T`,t[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a.slice().reverse()))})),t}static offsetToIndicesSingle(t,e,n){const r=[];for(let t=0;t{const i=this.context.inputTextureLayouts[n].shape,o=i.length,a=`incrementIndices_${e}`;let s=\"\";for(let t=0;t= 0; --i) {\\n if(i > axis) continue;\\n indices[i] += 1;\\n if(indices[i] < shape[i]) {\\n break;\\n }\\n indices[i] = 0;\\n }\\n }\\n `;t[a]=new r.GlslLibRoutine(u)})),t}}e.ShapeUtilsGlslLib=i},5060:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;const n={version:\"\",attribute:\"attribute\",varyingVertex:\"varying\",varyingFrag:\"varying\",texture2D:\"texture2D\",output:\"gl_FragColor\",outputDeclaration:\"\"},r={version:\"#version 300 es\",attribute:\"in\",varyingVertex:\"out\",varyingFrag:\"in\",texture2D:\"texture\",output:\"outputColor\",outputDeclaration:\"out vec4 outputColor;\"};function i(t){return 1===t?n:r}e.getGlsl=i,e.getVertexShaderSource=function(t){const e=i(t);return`${e.version}\\n precision highp float;\\n ${e.attribute} vec3 position;\\n ${e.attribute} vec2 textureCoord;\\n\\n ${e.varyingVertex} vec2 TexCoords;\\n\\n void main()\\n {\\n gl_Position = vec4(position, 1.0);\\n TexCoords = textureCoord;\\n }`},e.getFragShaderPreamble=function(t){const e=i(t);return`${e.version}\\n precision highp float;\\n precision highp int;\\n precision highp sampler2D;\\n ${e.varyingFrag} vec2 TexCoords;\\n ${e.outputDeclaration}\\n const vec2 halfCR = vec2(0.5, 0.5);\\n\\n // Custom vector types to handle higher dimenalities.\\n struct ivec5\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n };\\n\\n struct ivec6\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n int v;\\n };\\n\\n int imod(int x, int y) {\\n return x - y * (x / y);\\n }\\n\\n `},e.getDefaultFragShaderMain=function(t,e){return`\\n void main() {\\n int indices[${e}];\\n toVec(TexCoords, indices);\\n vec4 result = vec4(process(indices));\\n ${i(t).output} = result;\\n }\\n `}},3891:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.VecGlslLib=void 0;const r=n(8520);class i extends r.GlslLib{constructor(t){super(t)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const t=this.context.outputTextureLayout.shape.length,e={add:\"+=\",sub:\"-=\",mul:\"*=\",div:\"/=\"},n={};for(const i in e){const o=`${i}Vec`;let a=\"\";for(let n=0;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLInferenceHandler=void 0;const r=n(6231),i=n(9162),o=n(2517),a=n(2403),s=n(7019),u=n(8710),c=n(5611),l=n(4057),p=n(2039);e.WebGLInferenceHandler=class{constructor(t){this.session=t,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(t,e){return(0,l.calculateTextureWidthAndHeight)(this.session.layoutStrategy,t,e)}executeProgram(t,e){if(e.length{const n=e.map((t=>`${t.unpackedShape.join(\",\")};${t.width}x${t.height}`)).join(\"_\");let r=t.name;return t.cacheHint&&(r+=\"[\"+t.cacheHint+\"]\"),r+=\":\"+n,r})(t,n);let i=this.session.programManager.getArtifact(r);const o=i?i.programInfo:\"function\"==typeof t.get?t.get():t,a=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o.output.dims,o.output.textureType),s=this.createTextureData(a,o.output.type);return i||(i=this.session.programManager.build(o,n,s),this.session.programManager.setArtifact(r,i)),this.runProgram(i,n,s),s}run(t,e){return this.executeProgram(t,e).tensor}runProgram(t,e,n){for(let n=0;nthis.readTexture(a)),(async t=>this.readTextureAsync(a)),void 0,o),texture:n});return this.setTextureData(a.tensor.dataId,a,t.isPacked),a}getTextureData(t,e=!1){return this.session.isInitializer(t)?this.session.getTextureData(t,e):e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){this.session.isInitializer(t)?this.session.setTextureData(t,e,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(t,e)}isTextureLayoutCached(t,e=!1){return!!this.getTextureData(t.dataId,e)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.session.textureManager.releaseTexture(t))),this.unpackedTextureDataCache=new Map}readTexture(t){return t.isPacked?this.readTexture(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}async readTextureAsync(t){return t.isPacked?this.readTextureAsync(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t))}pack(t){return this.executeProgram((0,a.createPackProgramInfoLoader)(this,t.tensor),[t.tensor])}unpack(t){return this.executeProgram((0,c.createUnpackProgramInfoLoader)(this,t.tensor),[t.tensor])}}},1640:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.WEBGL_OP_RESOLVE_RULES=void 0;const a=n(2898),s=o(n(7839)),u=n(4196),c=n(2069),l=n(8138),p=n(9663),f=n(5193),d=n(7992),h=n(1253),g=n(4776),b=n(6572),m=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),x=n(718),T=n(2268),S=n(8117),O=n(2278),A=n(5524),E=n(5975),I=n(3933),P=n(6558),D=n(5723),$=n(3738),k=o(n(4909)),C=n(8428),F=n(9793);e.WEBGL_OP_RESOLVE_RULES=[[\"Abs\",\"\",\"6+\",k.abs],[\"Acos\",\"\",\"7+\",k.acos],[\"Add\",\"\",\"7+\",s.add],[\"And\",\"\",\"7+\",s.and],[\"Asin\",\"\",\"7+\",k.asin],[\"Atan\",\"\",\"7+\",k.atan],[\"AveragePool\",\"\",\"7+\",v.averagePool,v.parseAveragePoolAttributes],[\"BatchNormalization\",\"\",\"7+\",a.batchNormalization,a.parseBatchNormalizationAttributes],[\"Cast\",\"\",\"6+\",u.cast,u.parseCastAttributes],[\"Ceil\",\"\",\"6+\",k.ceil],[\"Clip\",\"\",\"6-10\",k.clip,k.parseClipAttributes],[\"Clip\",\"\",\"11+\",k.clipV11],[\"Concat\",\"\",\"4+\",c.concat,c.parseConcatAttributes],[\"Conv\",\"\",\"1+\",l.conv,l.parseConvAttributes],[\"ConvTranspose\",\"\",\"1+\",p.convTranspose,p.parseConvTransposeAttributes],[\"Cos\",\"\",\"7+\",k.cos],[\"Div\",\"\",\"7+\",s.div],[\"Dropout\",\"\",\"7+\",k.identity],[\"DepthToSpace\",\"\",\"1+\",f.depthToSpace,f.parseDepthToSpaceAttributes],[\"Equal\",\"\",\"7+\",s.equal],[\"Elu\",\"\",\"6+\",k.elu,k.parseEluAttributes],[\"Exp\",\"\",\"6+\",k.exp],[\"Flatten\",\"\",\"1+\",d.flatten,d.parseFlattenAttributes],[\"Floor\",\"\",\"6+\",k.floor],[\"FusedConv\",\"com.microsoft\",\"1+\",l.conv,l.parseConvAttributes],[\"Gather\",\"\",\"1+\",h.gather,h.parseGatherAttributes],[\"Gemm\",\"\",\"7-10\",g.gemm,g.parseGemmAttributesV7],[\"Gemm\",\"\",\"11+\",g.gemm,g.parseGemmAttributesV11],[\"GlobalAveragePool\",\"\",\"1+\",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],[\"GlobalMaxPool\",\"\",\"1+\",v.globalMaxPool],[\"Greater\",\"\",\"7+\",s.greater],[\"Identity\",\"\",\"1+\",k.identity],[\"ImageScaler\",\"\",\"1+\",b.imageScaler,b.parseImageScalerAttributes],[\"InstanceNormalization\",\"\",\"6+\",m.instanceNormalization,m.parseInstanceNormalizationAttributes],[\"LeakyRelu\",\"\",\"6+\",k.leakyRelu,k.parseLeakyReluAttributes],[\"Less\",\"\",\"7+\",s.less],[\"Log\",\"\",\"6+\",k.log],[\"MatMul\",\"\",\"1+\",y.matMul,y.parseMatMulAttributes],[\"MaxPool\",\"\",\"1+\",v.maxPool,v.parseMaxPoolAttributes],[\"Mul\",\"\",\"7+\",s.mul],[\"Neg\",\"\",\"6+\",k.neg],[\"Not\",\"\",\"1+\",k.not],[\"Or\",\"\",\"7+\",s.or],[\"Pad\",\"\",\"2-10\",_.padV2,_.parsePadAttributesV2],[\"Pad\",\"\",\"11+\",_.padV11,_.parsePadAttributesV11],[\"Pow\",\"\",\"7+\",s.pow],[\"PRelu\",\"\",\"7+\",s.pRelu],[\"ReduceLogSum\",\"\",\"1+\",w.reduceLogSum,w.parseReduceAttributes],[\"ReduceMax\",\"\",\"1+\",w.reduceMax,w.parseReduceAttributes],[\"ReduceMean\",\"\",\"1+\",w.reduceMean,w.parseReduceAttributes],[\"ReduceMin\",\"\",\"1+\",w.reduceMin,w.parseReduceAttributes],[\"ReduceProd\",\"\",\"1+\",w.reduceProd,w.parseReduceAttributes],[\"ReduceSum\",\"\",\"1-12\",w.reduceSum,w.parseReduceAttributes],[\"ReduceSumSquare\",\"\",\"1+\",w.reduceLogSumSquare,w.parseReduceAttributes],[\"Relu\",\"\",\"6+\",k.relu],[\"Reshape\",\"\",\"5+\",x.reshape],[\"Resize\",\"\",\"10\",T.resize,T.parseResizeAttributesV10],[\"Resize\",\"\",\"11+\",T.resize,T.parseResizeAttributesV11],[\"Shape\",\"\",\"1+\",S.shape],[\"Sigmoid\",\"\",\"6+\",k.sigmoid],[\"Sin\",\"\",\"7+\",k.sin],[\"Slice\",\"\",\"10+\",O.sliceV10],[\"Slice\",\"\",\"1-9\",O.slice,O.parseSliceAttributes],[\"Softmax\",\"\",\"1-12\",A.softmax,A.parseSoftmaxAttributes],[\"Softmax\",\"\",\"13+\",A.softmaxV13,A.parseSoftmaxAttributesV13],[\"Split\",\"\",\"2-12\",E.split,E.parseSplitAttributes],[\"Sqrt\",\"\",\"6+\",k.sqrt],[\"Squeeze\",\"\",\"1-12\",I.squeeze,I.parseSqueezeAttributes],[\"Squeeze\",\"\",\"13+\",I.squeezeV13],[\"Sub\",\"\",\"7+\",s.sub],[\"Sum\",\"\",\"6+\",P.sum],[\"Tan\",\"\",\"7+\",k.tan],[\"Tanh\",\"\",\"6+\",k.tanh],[\"Tile\",\"\",\"6+\",D.tile],[\"Transpose\",\"\",\"1+\",$.transpose,$.parseTransposeAttributes],[\"Upsample\",\"\",\"7-8\",F.upsample,F.parseUpsampleAttributesV7],[\"Upsample\",\"\",\"9\",F.upsample,F.parseUpsampleAttributesV9],[\"Unsqueeze\",\"\",\"1-12\",C.unsqueeze,C.parseUnsqueezeAttributes],[\"Unsqueeze\",\"\",\"13+\",C.unsqueezeV13],[\"Xor\",\"\",\"7+\",s.xor]]},2898:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;const r=n(246),i=n(5060),o=n(2039),a={name:\"BatchNormalization\",inputNames:[\"A\",\"Scale\",\"B\",\"Mean\",\"Variance\"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};e.batchNormalization=(t,e,n)=>(u(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>s(t,e,n)}),e)]),e.parseBatchNormalizationAttributes=t=>{const e=t.attributes.getFloat(\"epsilon\",1e-5),n=t.attributes.getFloat(\"momentum\",.9),i=t.attributes.getInt(\"spatial\",1);return(0,r.createAttributeWithCacheKey)({epsilon:e,momentum:n,spatial:i})};const s=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),s=e[0].dims.length,[u,c]=t.calculateTextureWidthAndHeight(e[1].dims,o.TextureType.unpacked),l=`\\n float process(int[${s}] indices) {\\n vec2 position = offsetToCoords(indices[1], ${u}, ${c});\\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\\n float b = getColorAsFloat(${r.texture2D}(B, position));\\n\\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\\n }`;return Object.assign(Object.assign({},a),{output:{dims:e[0].dims,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},u=t=>{if(!t||5!==t.length)throw new Error(\"BatchNormalization requires 5 inputs.\");const e=t[0],n=t[1],r=t[2],i=t[3],o=t[4];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==i.dims.length||1!==o.dims.length)throw new Error(\"invalid input shape.\");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1]||i.dims[0]!==e.dims[1]||o.dims[0]!==e.dims[1])throw new Error(\"invalid input shape.\");if(\"float32\"!==e.type&&\"float64\"!==e.type||\"float32\"!==n.type&&\"float64\"!==n.type||\"float32\"!==r.type&&\"float64\"!==r.type||\"float32\"!==i.type&&\"float64\"!==i.type||\"float32\"!==o.type&&\"float64\"!==o.type)throw new Error(\"invalid input tensor types.\")}},7839:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;const r=n(2517),i=n(8520),o=n(5060),a=n(2039);function s(){const t=\"add_\";return{body:`\\n float ${t}(float a, float b) {\\n return a + b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 + v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function u(){const t=\"div_\";return{body:`\\n float ${t}(float a, float b) {\\n return a / b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 / v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function c(){const t=\"mul_\";return{body:`\\n float ${t}(float a, float b) {\\n return a * b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 * v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function l(){const t=\"sub_\";return{body:`\\n float ${t}(float a, float b) {\\n return a - b;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return v1 - v2;\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function p(){const t=\"equal_\";return{body:`\\n float ${t}(float a, float b) {\\n return float(a == b);\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4(equal(v1, v2));\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function f(){const t=\"greater_\";return{body:`\\n float ${t}(float a, float b) {\\n return float(a > b);\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4( v1.r > v2.r ,\\n v1.g > v2.g,\\n v1.b > v2.b,\\n v1.a > v2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function d(){const t=\"less_\";return{body:`\\n float ${t}(float a, float b) {\\n return float(a < b);\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4( v1.r < v2.r ,\\n v1.g < v2.g,\\n v1.b < v2.b,\\n v1.a < v2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function h(){const t=\"and_\";return{body:`\\n float ${t}(float a, float b) {\\n return float( bool(a) && bool(b) );\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n bvec4 b1 = bvec4(v1);\\n bvec4 b2 = bvec4(v2);\\n return vec4( b1.r && b2.r ,\\n b1.g && b2.g,\\n b1.b && b2.b,\\n b1.a && b2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function g(){const t=\"or_\";return{body:`\\n float ${t}(float a, float b) {\\n return float( bool(a) || bool(b) );\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n bvec4 b1 = bvec4(v1);\\n bvec4 b2 = bvec4(v2);\\n return vec4( b1.r || b2.r ,\\n b1.g || b2.g,\\n b1.b || b2.b,\\n b1.a || b2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function b(){const t=\"xor_\";return{body:`\\n float ${t}(float a, float b) {\\n return float( bool(a) ^^ bool(b) );\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n bvec4 b1 = bvec4(v1);\\n bvec4 b2 = bvec4(v2);\\n return vec4( b1.r ^^ b2.r ,\\n b1.g ^^ b2.g,\\n b1.b ^^ b2.b,\\n b1.a ^^ b2.a );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}function m(){return function(t){const e=`${t}_`;return{body:`\\n float ${e}(float a, float b) {\\n return ${t}(a, b);\\n }\\n vec4 ${e}(vec4 v1, vec4 v2) {\\n return ${t}(v1, v2);\\n }\\n `,name:e,type:i.FunctionType.ValueBased}}(\"pow\")}function y(){const t=\"prelu_\";return{body:`\\n float ${t}(float a, float b) {\\n return a < 0.0 ? a * b: a;\\n }\\n vec4 ${t}(vec4 v1, vec4 v2) {\\n return vec4(\\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\\n v1.a < 0.0 ? v1.a * v2.a: v1.a\\n );\\n }\\n `,name:t,type:i.FunctionType.ValueBased}}e.glslAdd=s,e.glslDiv=u,e.glslMul=c,e.glslSub=l,e.glslEqual=p,e.glslGreater=f,e.glslLess=d,e.glslAnd=h,e.glslOr=g,e.glslXor=b,e.glslPow=m,e.glslPRelu=y;const _=(t,e,n,r=e[0].type,i)=>{const o=t.session.pack?a.TextureType.packed:a.TextureType.unpacked;return{name:n.name,inputNames:[\"A\",\"B\"],inputTypes:[o,o],cacheHint:i,get:()=>v(t,e,n,r)}},v=(t,e,n,i=e[0].type)=>{const s=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,u=!r.ShapeUtil.areEqual(e[0].dims,e[1].dims);let c=e[0].dims;const l=t.session.pack;if(u){const a=r.BroadcastUtil.calcShape(e[0].dims,e[1].dims,!1);if(!a)throw new Error(\"Can't perform binary op on the given tensors\");c=a;const u=c.length,p=0!==e[0].dims.length?e[0].dims.length:1,f=0!==e[1].dims.length?e[1].dims.length:1,d=0!==e[0].dims.length?\"bcastIndices_A(indices, aindices);\":\"aindices[0] = 0;\",h=0!==e[1].dims.length?\"bcastIndices_B(indices, bindices);\":\"bindices[0] = 0;\",g=(0,o.getGlsl)(t.session.backend.glContext.version),b=l?`\\n ${n.body}\\n void main() {\\n vec4 a = getAAtOutCoords();\\n vec4 b = getBAtOutCoords();\\n vec4 result = ${n.name}(a, b);\\n ${g.output} = result;\\n }`:`\\n ${n.body}\\n float process(int indices[${u}]) {\\n int aindices[${p}];\\n int bindices[${f}];\\n ${d}\\n ${h}\\n return ${n.name}(_A(aindices), _B(bindices));\\n }`;return{name:n.name,inputNames:[\"A\",\"B\"],inputTypes:[s,s],output:{dims:c,type:i,textureType:s},shaderSource:b,hasMain:l}}const p=(0,o.getGlsl)(t.session.backend.glContext.version),f=`\\n ${n.body}\\n void main() {\\n vec4 v1 = ${p.texture2D}(A, TexCoords);\\n vec4 v2 = ${p.texture2D}(B, TexCoords);\\n vec4 result = ${n.name}(v1, v2);\\n ${p.output} = result;\\n }\\n `;return{name:n.name,inputNames:[\"A\",\"B\"],inputTypes:[s,s],output:{dims:e[0].dims,type:i,textureType:s},shaderSource:f,hasMain:!0}};e.add=(t,e)=>[t.run(_(t,e,s()),e)],e.and=(t,e)=>[t.run(_(t,e,h(),\"bool\"),e)],e.div=(t,e)=>[t.run(_(t,e,u()),e)],e.equal=(t,e)=>[t.run(_(t,e,p(),\"bool\"),e)],e.greater=(t,e)=>[t.run(_(t,e,f(),\"bool\"),e)],e.less=(t,e)=>[t.run(_(t,e,d(),\"bool\"),e)],e.mul=(t,e)=>[t.run(_(t,e,c()),e)],e.or=(t,e)=>[t.run(_(t,e,g(),\"bool\"),e)],e.pow=(t,e)=>[t.run(_(t,e,m()),e)],e.pRelu=(t,e)=>[t.run(_(t,e,y()),e)],e.sub=(t,e)=>[t.run(_(t,e,l()),e)],e.xor=(t,e)=>[t.run(_(t,e,b(),\"bool\"),e)]},4196:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseCastAttributes=e.cast=void 0;const r=n(2517);e.cast=(t,e,n)=>(i(e),[t.cast(e[0],n)]),e.parseCastAttributes=t=>r.ProtoUtil.tensorDataTypeFromProto(t.attributes.getInt(\"to\"));const i=t=>{if(!t||1!==t.length)throw new Error(\"Cast requires 1 input.\");if(\"string\"===t[0].type)throw new Error(\"Invalid input type.\")}},1163:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827);e.createPackedConcatProgramInfoLoader=(t,e,n)=>{const u=(c=e.length,l=n.cacheKey,{name:\"Concat (packed)\",inputNames:Array.from({length:c},((t,e)=>`X${e}`)),inputTypes:Array(c).fill(i.TextureType.packed),cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const c=n[0].dims.slice();if(u>=c.length||u<-1*c.length)throw new Error(\"axis specified for concat doesn't match input dimensionality\");u<0&&(u=c.length+u);const l=c.slice(0);for(let t=1;tt.dims)),b=(0,o.getGlChannels)(p),m=new Array(g.length-1);m[0]=g[0][u];for(let t=1;t= ${m[t-1]}) {\\n return getChannel(\\n getX${t}(${s(b,y,e)}),\\n vec2(${s(_,y,e)}));\\n }`}const x=m.length,T=m[m.length-1];w+=`\\n return getChannel(\\n getX${x}(${s(b,y,T)}),\\n vec2(${s(_,y,T)}));`;const S=(0,r.getGlsl)(t.session.backend.glContext.version),O=`\\n ${h}\\n float getValue(${b.map((t=>\"int \"+t))}) {\\n ${w}\\n }\\n\\n void main() {\\n ${d} coords = getOutputCoords();\\n int lastDim = coords.${b[p-1]};\\n coords.${b[p-1]} = coords.${b[p-2]};\\n coords.${b[p-2]} = lastDim;\\n\\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\\n\\n ${f[p-1]} = ${f[p-1]} + 1;\\n if (${f[p-1]} < ${l[p-1]}) {\\n result.g = getValue(${f});\\n }\\n\\n ${f[p-2]} = ${f[p-2]} + 1;\\n if (${f[p-2]} < ${l[p-2]}) {\\n result.a = getValue(${f});\\n }\\n\\n ${f[p-1]} = ${f[p-1]} - 1;\\n if (${f[p-2]} < ${l[p-2]} &&\\n ${f[p-1]} < ${l[p-1]}) {\\n result.b = getValue(${f});\\n }\\n ${S.output} = result;\\n }\\n `;return Object.assign(Object.assign({},e),{output:{dims:l,type:n[0].type,textureType:i.TextureType.packed},shaderSource:O,hasMain:!0})})(t,u,e,n.axis)})};const s=(t,e,n)=>{const r=t.indexOf(e);return t.map(((t,e)=>e===r?`${t} - ${n}`:t)).join()}},2069:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseConcatAttributes=e.concat=void 0;const r=n(246),i=n(2039),o=n(1163);e.concat=(t,e,n)=>(p(e),t.session.pack&&e[0].dims.length>1?[t.run((0,o.createPackedConcatProgramInfoLoader)(t,e,n),e)]:[t.run(a(t,e,n),e)]);const a=(t,e,n)=>{const r=(o=e.length,a=n.cacheKey,{name:\"Concat\",inputNames:Array.from({length:o},((t,e)=>`X${e}`)),inputTypes:Array(o).fill(i.TextureType.unpacked),cacheHint:a});var o,a;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice();if(r>=o.length||r<-1*o.length)throw new Error(\"axis specified for concat doesn't match input dimensionality\");r<0&&(r=o.length+r);const a=o.slice(0);for(let t=1;t`int getTextureWhereDataResides(int index) {\\n ${t.map(((t,e)=>`if(index<${t}) {return ${e};}\\n`)).join(\"\")}\\n }`,u=t=>s(t),c=(t,e)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${e}]) {`];for(let e=0;e{const e=[\"int getSizeInConcatAxisValueFromIndex(int index) {\"];for(let n=0;n(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\")});const p=t=>{if(!t||t.length<1)throw new Error(\"too few inputs\");const e=t[0].type,n=t[0].dims.length;if(\"string\"===e)throw new Error(\"string tensor is not supported yet\");for(const r of t){if(r.type!==e)throw new Error(\"input tensors should be one type\");if(r.dims.length!==n)throw new Error(\"input tensors should have the same shape\")}}},4770:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),i=n(5060),o=n(2039),a=n(8138),s=n(2823);e.createUnpackedGroupedConvProgramInfoLoader=(t,e,n)=>{const u=(c=e.length>2,l=n.cacheKey,{name:\"GroupedConv\",inputNames:c?[\"X\",\"W\",\"Bias\"]:[\"X\",\"W\"],inputTypes:c?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,u)=>{const c=e.length>2?\"value += getBias(output_channel);\":\"\",l=e[0].dims.slice(),p=e[1].dims.slice(),f=p[0]/u.group;r.Logger.verbose(\"GroupedConv\",`autpPad:${u.autoPad}, dilations:${u.dilations}, group:${u.group}, kernelShape:${u.kernelShape}, pads:${u.pads}, strides:${u.strides}`);const d=(0,a.calculateOutputShape)(l,p,u.dilations,u.pads,u.strides),h=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:g,applyActivation:b}=(0,s.getActivationSnippet)(u),m=`\\n const ivec2 strides = ivec2(${u.strides[0]}, ${u.strides[1]});\\n const ivec2 pads = ivec2(${u.pads[0]}, ${u.pads[1]});\\n ${g}\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords.x;\\n int output_channel = coords.y;\\n ivec2 xRCCorner = coords.zw * strides - pads;\\n int group_id = output_channel / ${f};\\n\\n float value = 0.0;\\n for (int wInChannel = 0; wInChannel < ${p[1]}; wInChannel++) {\\n int input_channel = group_id * ${p[1]} + wInChannel;\\n for (int wHeight = 0; wHeight < ${p[2]}; wHeight++) {\\n int xHeight = xRCCorner.x + wHeight * ${u.dilations[0]};\\n\\n if (xHeight < 0 || xHeight >= ${l[2]}) {\\n continue;\\n }\\n\\n for (int wWidth = 0; wWidth < ${p[3]}; wWidth++) {\\n int xWidth = xRCCorner.y + wWidth * ${u.dilations[1]};\\n if (xWidth < 0 || xWidth >= ${l[3]}) {\\n continue;\\n }\\n\\n float xVal = getX(batch, input_channel, xWidth, xHeight);\\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\\n value += xVal*wVal;\\n }\\n }\\n }\\n ${c}\\n ${b}\\n ${h.output} = vec4(value, .0, .0, .0);\\n }\\n`;return Object.assign(Object.assign({},n),{output:{dims:d,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,hasMain:!0})})(t,e,u,n)})}},1386:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;const r=n(8138),i=n(8555),o=n(708);e.conv2DPackedPointwise=(t,e,n)=>{const i=e[0].dims,a=e[1].dims,s=(0,r.calculateOutputShape)(i,a,n.dilations,n.pads,n.strides),u=t.reshapePacked(e[0],[i[1],i[2]*i[3]]),c=t.reshapePacked(e[1],[a[0],a[1]]),l=e.length>2?[c,u,e[2]]:[c,u],p=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,l,n),l);return t.reshapePacked(p,s)},e.conv2DPacked=(t,e,n)=>{const a=e[0].dims,s=e[1].dims,u=(0,r.calculateOutputShape)(a,s,n.dilations,n.pads,n.strides),c=t.run((0,i.createPackedIm2ColProgramInfoLoader)(t,e[0],e[1],u,n),[e[0]]),l=t.reshapePacked(e[1],[s[0],s[1]*s[2]*s[3]]),p=3===e.length?[l,c,e[2]]:[l,c],f=t.run((0,o.createPackedMatmulProgramInfoLoader)(t,p,n),p);return t.reshapePacked(f,u)}},9663:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseConvTransposeAttributes=e.convTranspose=void 0;const r=n(246),i=n(5060),o=n(2039),a=n(2823),s=(t,e,n,r,i,o)=>(t-1)*e+n+(r-1)*i+1-o,u=(t,e,n,r,i)=>{const o=Math.floor(t/2);\"SAME_UPPER\"===e?(n[r]=o,n[i]=t-o):\"SAME_LOWER\"===e&&(n[r]=t-o,n[i]=o)};e.convTranspose=(t,e,n)=>(f(e,n),c(t,e,n));const c=(t,e,n)=>{const r=p(n,e);return[l(t,e,r)]},l=(t,e,n)=>t.run(((t,e,n)=>{const r=(s=e.length>2,u=n.cacheKey,{name:\"ConvTranspose\",inputNames:s?[\"X\",\"W\",\"B\"]:[\"X\",\"W\"],inputTypes:s?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:u});var s,u;return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const s=e.length>2?\"getB(output_channel)\":\"0.0\",u=e[0].dims,c=e[1].dims,l=c[1],p=c[0]/r.group,f=[e[0].dims[0],e[1].dims[1]*r.group,...r.outputShape],d=(0,i.getGlsl)(t.session.backend.glContext.version),{activationFunction:h,applyActivation:g}=(0,a.getActivationSnippet)(r),b=`\\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\\n ${h}\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords.x;\\n int output_channel = coords.y;\\n\\n ivec2 loc = coords.zw + pads;\\n\\n int group_id = output_channel / ${l};\\n int wOutChannel = output_channel - group_id * ${l};\\n\\n float value = ${s};\\n for (int inChannelOffset = 0; inChannelOffset < ${p}; inChannelOffset++) {\\n int input_channel = group_id * ${p} + inChannelOffset;\\n for (int wWOff = 0; wWOff < ${c[2]}; wWOff++) {\\n for (int wHOff = 0; wHOff < ${c[3]}; wHOff++) {\\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\\n ivec2 wLoc = loc - wOff;\\n ivec2 wLocIn = wLoc / strides;\\n if (\\n wLocIn * strides == wLoc &&\\n wLocIn.x >= 0 && wLocIn.x < ${u[2]} &&\\n wLocIn.y >= 0 && wLocIn.y < ${u[3]}\\n ) {\\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\\n value += xVal * wVal;\\n }\\n }\\n }\\n }\\n ${g}\\n ${d.output} = vec4(value, .0, .0, .0);\\n }\\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:b,hasMain:!0})})(t,e,r,n)})})(t,e,n),e),p=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const l=t.length-2,p=0===c.length;for(let f=0;f{const e=t.attributes,n=(0,a.parseInternalActivationAttributes)(e),i=e.getString(\"auto_pad\",\"NOTSET\"),o=e.getInts(\"dilations\",[1,1]),s=e.getInt(\"group\",1),u=e.getInts(\"kernel_shape\",[]),c=e.getInts(\"output_padding\",[0,0]),l=e.getInts(\"output_shape\",[]),p=e.getInts(\"pads\",[0,0,0,0]),f=e.getInts(\"strides\",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:s,kernelShape:u,outputPadding:c,outputShape:l,pads:p,strides:f},n))};const f=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error(\"Conv requires 2 or 3 inputs\");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error(\"currently only support 2-dimensional conv\");if(t[0].dims[1]!==t[1].dims[0])throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");const n=t[1].dims[1]*e.group;if(3===t.length&&(1!==t[2].dims.length||t[2].dims[0]!==n))throw new Error(\"invalid bias\");const r=t[0].dims.length-2;if(e.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(e.strides.length!==r)throw new Error(`strides should be ${r}D`);if(e.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(e.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(0!==e.outputShape.length&&e.outputShape.length!==t[0].dims.length-2)throw new Error(\"invalid output shape\");if(\"float32\"!==t[0].type||\"float32\"!==t[1].type)throw new Error(\"ConvTranspose input(X,W) should be float tensor\");if(3===t.length&&\"float32\"!==t[2].type)throw new Error(\"ConvTranspose input(bias) should be float tensor\")}},8138:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseConvAttributes=e.conv=e.calculateOutputShape=void 0;const r=n(246),i=n(2517),o=n(4770),a=n(1386),s=n(9828),u=n(2823),c=n(3248),l=n(5623);e.calculateOutputShape=(t,e,n,r,i)=>{const o=t[0],a=t.slice(2),s=a.length,u=e[0],c=e.slice(2).map(((t,e)=>t+(t-1)*(n[e]-1))),l=a.map(((t,e)=>t+r[e]+r[e+s])).map(((t,e)=>Math.floor((t-c[e]+i[e])/i[e])));return[o,u].concat(...l)},e.conv=(t,e,n)=>(g(e,n),p(t,e,n));const p=(t,e,n)=>{const r=h(n,e),i=t.session.pack,s=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[t.run((0,o.createUnpackedGroupedConvProgramInfoLoader)(t,e,r),e)]:s&&i?[f(t,e,r)]:i&&4===e[0].dims.length&&1===e[0].dims[0]&&!s?[(0,a.conv2DPacked)(t,e,r)]:[d(t,e,r)]},f=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,a=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),s=t.reshapeUnpacked(n[0],[i[1],i[2]*i[3]]),u=t.reshapeUnpacked(n[1],[o[0],o[1]]),c=n.length>2?[u,s,n[2]]:[u,s],p=t.run((0,l.createMatmulProgramInfoLoader)(c,r),c);return t.reshapeUnpacked(p,a)},d=(t,n,r)=>{const i=n[0].dims,o=n[1].dims,a=(0,e.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),u=t.run((0,c.createIm2ColProgramInfoLoader)(t,n[0],n[1],a,r),[n[0]]),l=3===n.length?[u,n[1],n[2]]:[u,n[1]];return t.run((0,s.createDotProductProgramInfoLoader)(t,n,a,r),l)},h=(t,e)=>{const n=t.kernelShape.slice();if(0===t.kernelShape.length)for(let t=2;t{const e=t.attributes,n=(0,u.parseInternalActivationAttributes)(e),i=e.getString(\"auto_pad\",\"NOTSET\"),o=e.getInts(\"dilations\",[1,1]),a=e.getInt(\"group\",1),s=e.getInts(\"kernel_shape\",[]),c=e.getInts(\"pads\",[0,0,0,0]),l=e.getInts(\"strides\",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:a,kernelShape:s,pads:c,strides:l},n))};const g=(t,e)=>{if(!t||2!==t.length&&3!==t.length)throw new Error(\"Conv requires 2 or 3 inputs\");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error(\"currently only support 2-dimensional conv\");if(t[0].dims[1]!==t[1].dims[1]*e.group)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");if(3===t.length&&(1!==t[2].dims.length||t[1].dims[0]!==t[2].dims[0]))throw new Error(\"invalid bias\");const n=t[0].dims.length-2;if(e.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(e.strides.length!==n)throw new Error(`strides should be ${n}D`);if(e.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(\"float32\"!==t[0].type||\"float32\"!==t[1].type)throw new Error(\"Conv input(X,W) should be float tensor\");if(3===t.length&&\"float32\"!==t[2].type)throw new Error(\"Conv input(bias) should be float tensor\")}},5193:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;const r=n(3738);e.depthToSpace=(t,e,n)=>{i(e);const o=n.blocksize,a=o*o,s=\"DCR\"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],u=\"DCR\"===n.mode?[e[0].dims[0],o,o,e[0].dims[1]/a,e[0].dims[2],e[0].dims[3]]:[e[0].dims[0],e[0].dims[1]/a,o,o,e[0].dims[2],e[0].dims[3]],c=t.reshapeUnpacked(e[0],u),l={perm:s,cacheKey:`${s}`},[p]=(0,r.transpose)(t,[c],l),f=[e[0].dims[0],e[0].dims[1]/a,e[0].dims[2]*o,e[0].dims[3]*o];return[t.reshapeUnpacked(p,f)]},e.parseDepthToSpaceAttributes=t=>{const e=t.attributes.getInt(\"blocksize\");if(e<1)throw new Error(`blocksize must be >= 1, but got : ${e} for DepthToSpace`);const n=t.attributes.getString(\"mode\",\"DCR\");if(\"DCR\"!==n&&\"CRD\"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:e}};const i=t=>{if(1!==t.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${t.length}`);if(\"string\"===t[0].type||4!==t[0].dims.length)throw new TypeError(\"DepthToSpace input should be a 4-D numeric tensor\")}},9828:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createDotProductProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(2823),s=n(3248);e.createDotProductProgramInfoLoader=(t,e,n,u)=>{const c=((t,e)=>({name:\"ConvDotProduct\",inputNames:t?[\"Im2Col\",\"K\",\"B\"]:[\"Im2Col\",\"K\"],inputTypes:t?[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.packedLastDimension],cacheKey:e.activationCacheKey}))(e.length>2,u);return Object.assign(Object.assign({},c),{get:()=>((t,e,n,u,c)=>{const l=n[0].dims,p=n[1].dims,f=[p[0],Math.ceil(l[1]*p[2]*p[3]/4)],d=(0,s.calculateIm2ColDims)(l,p,u),[h,g]=t.calculateTextureWidthAndHeight(f,o.TextureType.packedLastDimension),b=r.ShapeUtil.computeStrides(d),[m,y]=t.calculateTextureWidthAndHeight(d,o.TextureType.packedLastDimension),_=u.length,v=n.length<3?\"0.0\":\"_B(b)\",w=Math.ceil(l[1]*p[2]*p[3]/4),{activationFunction:x,applyActivation:T}=(0,a.getActivationSnippet)(c),S=(0,i.getGlsl)(t.session.backend.glContext.version),O=`\\n${x}\\nfloat process(int indices[${_}]) {\\n int b[1];\\n b[0] = indices[1];\\n int im2col[4];\\n im2col[0] = indices[0];\\n im2col[1] = indices[2];\\n im2col[2] = indices[3];\\n int im2colOffset = im2col[0] * ${b[0]} + im2col[1] * ${b[1]} + im2col[2] * ${b[2]};\\n int kernelOffset = indices[1] * ${f[1]};\\n float value = ${v};\\n for (int i = 0; i < ${w}; ++i) {\\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${m}, ${y});\\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${g});\\n value += dot(${S.texture2D}(Im2Col, im2colCoords), ${S.texture2D}(K, kernelCoords));\\n ++im2colOffset;\\n ++kernelOffset;\\n }\\n ${T}\\n return value;\\n}`;return Object.assign(Object.assign({},e),{output:{dims:u,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:O})})(t,c,e,n,u)})}},7992:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;const r=n(2517);e.flatten=(t,e,n)=>{i(e,n);const o=r.ShapeUtil.flattenShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.parseFlattenAttributes=t=>t.attributes.getInt(\"axis\",1);const i=(t,e)=>{if(!t||1!==t.length)throw new Error(\"Flatten requires 1 input.\");const n=t[0].dims.length;if(0===n)throw new Error(\"scalar tensor is not supported.\");if(e<-n||e>n)throw new Error(\"Invalid axis\");if(\"string\"===t[0].type)throw new Error(\"string tensor is not supported.\")}},2823:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;const r=n(2517),i=n(4909);e.getActivationSnippet=function(t){let e;switch(t.activation){case\"Relu\":e=(0,i.glslRelu)();break;case\"Sigmoid\":e=(0,i.glslSigmoid)();break;case\"Clip\":e=(0,i.glslClip)(t.clipMin,t.clipMax);break;default:return{activationFunction:\"\",applyActivation:\"\"}}const n=e.name;return{activationFunction:e.body,applyActivation:`value = ${n}_(value);`}},e.parseInternalActivationAttributes=t=>{const e=t.getString(\"activation\",\"\");if(\"Clip\"===e){const[n,i]=t.getFloats(\"activation_params\",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:e,clipMax:i,clipMin:n,activationCacheKey:`${e}:${n},${i}`}}return{activation:e,activationCacheKey:e}}},1253:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseGatherAttributes=e.gather=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039);e.gather=(t,e,n)=>(c(e,n.axis),[t.run(u(t,e,n),e)]),e.parseGatherAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\",0)});const s={name:\"Gather\",inputNames:[\"A\",\"B\"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},u=(t,e,n)=>{const r=Object.assign(Object.assign({},s),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const i=n[0].dims.slice(),s=n[1].dims.slice(),u=new Array(i.length+s.length-1);r=o.ShapeUtil.normalizeAxis(r,i.length);const c=[];for(let t=0;t{if(!t||2!==t.length)throw new Error(\"Gather requires 2 inputs.\");const n=t[0].dims.length;if(n<1)throw new Error(\"Invalid input shape.\");if(e<-n||e>n-1)throw new Error(\"Invalid axis.\");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invaid input type.\");if(\"int32\"!==t[1].type&&\"int16\"!==t[1].type)throw new Error(\"Invaid input type.\")}},4776:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;const r=n(246),i=n(2517),o=n(2039);e.gemm=(t,e,n)=>(c(e,n),[t.run(s(e,n),e)]);const a=(t,e)=>{const n=0!==t.attributes.getInt(\"transA\",0),i=0!==t.attributes.getInt(\"transB\",0),o=t.attributes.getFloat(\"alpha\",1),a=t.attributes.getFloat(\"beta\",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:i,alpha:o,beta:a,isOptionalC:e})};e.parseGemmAttributesV7=t=>a(t,!1),e.parseGemmAttributesV11=t=>a(t,!0);const s=(t,e)=>{const n={name:\"Gemm\",inputNames:3===t.length?[\"A\",\"B\",\"C\"]:[\"A\",\"B\"],inputTypes:3===t.length?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],key:e.cacheKey};return Object.assign(Object.assign({},n),{get:()=>u(n,t,e)})},u=(t,e,n)=>{const r=e[0].dims.slice(),a=e[1].dims.slice(),[s,u]=i.GemmUtil.getShapeOfGemmResult(r,n.transA,a,n.transB,3===e.length?e[2].dims:void 0),c=[s,u];if(!c)throw new Error(\"Can't use gemm on the given tensors\");let l=r[r.length-1],p=\"\";n.transA&&(l=r[0]),n.transA&&n.transB?p=\"value += _A_T(a) * _B_T(b);\":n.transA&&!n.transB?p=\"value += _A_T(a) * _B(b);\":!n.transA&&n.transB?p=\"value += _A(a) * _B_T(b);\":n.transA||n.transB||(p=\"value += _A(a) * _B(b);\");const f=c.length,d=`\\n float process(int indices[${f}]) {\\n int a[${f}];\\n int b[${f}];\\n ${3===e.length?`int c[${e[2].dims.length}];`:\"\"}\\n\\n copyVec(indices, a);\\n copyVec(indices, b);\\n ${3===e.length?\"bcastIndices_C(indices, c);\":\"\"}\\n\\n float value = 0.0;\\n for (int k=0; k<${l}; ++k) {\\n a[${f-1}] = k;\\n b[${f-2}] = k;\\n ${p}\\n }\\n\\n value = value * alpha;\\n ${3===e.length?\"value += beta * _C(c);\":\"\"}\\n return value;\\n }`;return Object.assign(Object.assign({},t),{output:{dims:c,type:e[0].type,textureType:o.TextureType.unpacked},variables:[{name:\"alpha\",type:\"float\",data:n.alpha},{name:\"beta\",type:\"float\",data:n.beta}],shaderSource:d})},c=(t,e)=>{if(!t)throw new Error(\"Input is missing\");if(e.isOptionalC&&(t.length<2||t.length>3))throw new Error(\"Invaid input shape.\");if(!e.isOptionalC&&3!==t.length)throw new Error(\"Gemm requires 3 inputs\");if(3===t.length&&1!==t[2].dims.length&&2!==t[2].dims.length)throw new Error(\"Invalid input shape of C\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type||\"float32\"!==t[1].type&&\"float64\"!==t[1].type||3===t.length&&\"float32\"!==t[2].type&&\"float64\"!==t[2].type)throw new Error(\"Invalid input type.\");if(t[0].type!==t[1].type||3===t.length&&t[0].type!==t[2].type)throw new Error(\"Input types are mismatched\")}},8555:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(2827);e.createPackedIm2ColProgramInfoLoader=(t,e,n,a,s)=>{const u=(c=s.cacheKey,{name:\"Im2Col (packed)\",inputNames:[\"A\"],inputTypes:[i.TextureType.packed],cacheHint:c});var c;return Object.assign(Object.assign({},u),{get:()=>((t,e,n,a,s,u)=>{const c=n.dims,l=a.dims,p=s.length,f=[l[1]*l[2]*l[3],s[2]*s[3]],d=l[2]*l[3],h=(0,o.unpackFromChannel)(),g=(0,r.getGlsl)(t.session.backend.glContext.version);let b=\"\";for(let t=0;t<=1;t++)for(let e=0;e<=1;e++)b+=`\\n blockIndex = rc.x + ${e};\\n pos = rc.y + ${t};\\n\\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\\n offsetY = int(blockIndex / (${s[p-1]})) * ${u.strides[0]} -\\n ${u.pads[0]};\\n d0 = offsetY + ${u.dilations[0]} * (imod(pos, ${d}) / ${l[2]});\\n\\n if(d0 < ${c[2]} && d0 >= 0) {\\n offsetX = imod(blockIndex, ${s[p-1]}) * ${u.strides[1]} -\\n ${u.pads[1]};\\n d1 = offsetX + ${u.dilations[1]} * imod(imod(pos, ${d}), ${l[2]});\\n\\n if(d1 < ${c[3]} && d1 >= 0) {\\n\\n ch = int(float(pos)/ ${d}.);\\n innerDims = vec2(d0, d1);\\n result[${2*t+e}] = getChannel(\\n getA(0, ch, int(innerDims.x),\\n int(innerDims.y)), innerDims);\\n }\\n }\\n }\\n\\n `;const m=`\\n ${h}\\n\\n void main() {\\n ivec2 rc = getOutputCoords();\\n vec4 result = vec4(0.0);\\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\\n vec2 innerDims;\\n ${b}\\n ${g.output} = result;\\n }\\n `;return Object.assign(Object.assign({},e),{output:{dims:f,type:n.type,textureType:i.TextureType.packed},shaderSource:m,hasMain:!0})})(t,u,e,n,a,s)})}},3248:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.calculateIm2ColDims=e.createIm2ColProgramInfoLoader=void 0;const r=n(2039);e.createIm2ColProgramInfoLoader=(t,n,i,o,a)=>{const s=(u=a.cacheKey,{name:\"Im2Col\",inputNames:[\"X\"],inputTypes:[r.TextureType.unpacked],cacheHint:u});var u;return Object.assign(Object.assign({},s),{get:()=>((t,n,i,o,a,s)=>{const u=i.dims,c=o.dims,l=a.length,p=(0,e.calculateIm2ColDims)(u,c,a,4),f=`\\n const int XC = ${u[1]};\\n const int XH = ${u[2]};\\n const int XW = ${u[3]};\\n const int KH = ${s.kernelShape[0]};\\n const int KW = ${s.kernelShape[1]};\\n const int dilationH = ${s.dilations[0]};\\n const int dilationW = ${s.dilations[1]};\\n const int strideH = ${s.strides[0]};\\n const int strideW = ${s.strides[1]};\\n const int padH = ${s.pads[0]};\\n const int padW = ${s.pads[1]};\\n const int KHKW = KH*KW;\\n const int XCKHKW = XC * KHKW;\\n const int outputChannels = 4;\\n vec4 process(int indices[${l}]) {\\n int b = indices[0]; // batch size\\n int oh = indices[1] * strideH - padH; //output height\\n int ow = indices[2] * strideW - padW; //output width\\n int p = indices[3] * outputChannels; //patch\\n vec4 value = vec4(0.0);\\n for(int i=0; i < outputChannels; ++i) {\\n if(p < XCKHKW) {\\n int patchC = p / KHKW;\\n int patchH = (p - patchC*KHKW) / KW;\\n int patchW = (p - patchC*KHKW) - patchH * KW;\\n int xh2 = oh + patchH * dilationH;\\n int xw2 = ow + patchW * dilationW;\\n int x[${u.length}];\\n x[0] = b;\\n x[1] = patchC;\\n x[2] = xh2;\\n x[3] = xw2;\\n if(xh2 >= 0 &&\\n xh2 < XH &&\\n xw2 >= 0 &&\\n xw2 < XW) {\\n value[i] = _X(x);\\n }\\n }\\n ++p;\\n }\\n return value;\\n }\\n `;return Object.assign(Object.assign({},n),{output:{dims:p,type:i.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n,i,o,a)})},e.calculateIm2ColDims=(t,e,n,r=4)=>[n[0],n[2],n[3],Math.ceil(t[1]*e[2]*e[3]/r)]},6572:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseImageScalerAttributes=e.imageScaler=void 0;const r=n(246),i=n(2039);e.imageScaler=(t,e,n)=>(u(e),[t.run(a(t,e,n),e)]),e.parseImageScalerAttributes=t=>{const e=t.attributes.getFloat(\"scale\"),n=t.attributes.getFloats(\"bias\");return(0,r.createAttributeWithCacheKey)({scale:e,bias:n})};const o={name:\"ImageScaler\",inputNames:[\"X\"],inputTypes:[i.TextureType.unpacked]},a=(t,e,n)=>{const r=Object.assign(Object.assign({},o),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((t,e,n,r)=>{const o=n[0].dims.slice(),a=o.length,u=`\\n ${s(r.bias.length)}\\n float process(int indices[${a}]) {\\n return _X(indices) * scale + getBias(bias, indices[1]);\\n }`;return Object.assign(Object.assign({},e),{output:{dims:o,type:n[0].type,textureType:i.TextureType.unpacked},variables:[{name:\"bias\",type:\"float\",arrayLength:r.bias.length,data:r.bias},{name:\"scale\",type:\"float\",data:r.scale}],shaderSource:u})})(0,r,e,n)})},s=t=>{const e=[`float getBias(float bias[${t}], int channel) {`];for(let n=0;n{if(!t||1!==t.length)throw new Error(\"ImageScaler requires 1 input.\");if(4!==t[0].dims.length)throw new Error(\"Invalid input shape.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type.\")}},3346:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;const r=n(5060),i=n(2039);e.instanceNormalization=(t,e,n)=>{c(e);const r=t.run(a(e[0]),e);return[t.run(u(t,e[0],n,r.dims),[e[0],r,e[1],e[2]])]},e.parseInstanceNormalizationAttributes=t=>t.attributes.getFloat(\"epsilon\",1e-5);const o={name:\"InstanceNormalization_MeanAndVariance\",inputNames:[\"X\"],inputTypes:[i.TextureType.unpacked]},a=t=>Object.assign(Object.assign({},o),{get:()=>((t,e)=>{const n=e.dims.slice(),r=n[1],o=n[2]*n[3],a=[n[0],r],s=`\\n vec4 process(int[2] indices) {\\n vec4 v = vec4(0.0);\\n int a[4];\\n a[0] = indices[0];\\n a[1] = indices[1];\\n float temp = 0.0;\\n for(int a2=0; a2<${n[2]}; a2++) {\\n a[2] = a2;\\n for(int a3=0; a3<${n[3]}; a3++) {\\n a[3] = a3;\\n float x = _X(a);\\n temp += x;\\n }\\n }\\n float mean = temp / float(${o});\\n temp = 0.0;\\n for(int a2=0; a2<${n[2]}; a2++) {\\n a[2] = a2;\\n for(int a3=0; a3<${n[3]}; a3++) {\\n a[3] = a3;\\n float x = _X(a);\\n temp += (x - mean) * (x - mean);\\n }\\n }\\n v.r = mean;\\n v.g = temp / float(${o});\\n\\n return v;\\n }`;return Object.assign(Object.assign({},t),{output:{dims:a,type:e.type,textureType:i.TextureType.packedLastDimension},shaderSource:s})})(o,t)}),s={name:\"InstanceNormalization_ComputeOutput\",inputNames:[\"X\",\"MeanAndVariance\",\"Scale\",\"B\"],inputTypes:[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked,i.TextureType.unpacked]},u=(t,e,n,o)=>{const a=Object.assign(Object.assign({},s),{cacheHint:`${n}`});return Object.assign(Object.assign({},a),{get:()=>((t,e,n,o,a)=>{const s=(0,r.getGlsl)(t.session.backend.glContext.version),[u,c]=t.calculateTextureWidthAndHeight(a,i.TextureType.packedLastDimension),[l,p]=[u/4,c],f=`\\n vec4 get_MeanAndVariance(int[2] mv) {\\n int offset = indicesToOffset_MeanAndVariance(mv);\\n vec2 coords = offsetToCoords(offset, ${l}, ${p});\\n return ${s.texture2D}(MeanAndVariance, coords);\\n }\\n\\n float process(int[4] indices) {\\n int mv[2];\\n mv[0] = indices[0];\\n mv[1] = indices[1];\\n vec4 mean_and_variance = get_MeanAndVariance(mv);\\n float mean = mean_and_variance.r;\\n float variance = mean_and_variance.g;\\n\\n int sb[1];\\n sb[0] = indices[1];\\n float scale = _Scale(sb);\\n float b = _B(sb);\\n\\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\\n }`;return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i.TextureType.unpacked},variables:[{name:\"epsilon\",type:\"float\",data:o}],shaderSource:f})})(t,a,e,n,o)})},c=t=>{if(!t||3!==t.length)throw new Error(\"InstanceNormalization requires 3 inputs.\");const e=t[0],n=t[1],r=t[2];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error(\"Invalid input shape.\");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1])throw new Error(\"Input shapes are mismatched.\");if(\"float32\"!==e.type&&\"float64\"!==e.type||\"float32\"!==n.type&&\"float64\"!==n.type||\"float32\"!==r.type&&\"float64\"!==r.type)throw new Error(\"Invalid input type.\");if(4!==t[0].dims.length)throw new Error(\"Only support 4-D input shape.\")}},708:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(9390),s=n(2823),u=n(5623);e.createPackedMatmulProgramInfoLoader=(t,e,n)=>{const c=(l=e.length>2,p=n.activationCacheKey,{name:\"MatMul (packed)\",inputNames:l?[\"A\",\"B\",\"Bias\"]:[\"A\",\"B\"],inputTypes:l?[o.TextureType.packed,o.TextureType.packed,o.TextureType.packed]:[o.TextureType.packed,o.TextureType.packed],cacheHint:p});var l,p;return Object.assign(Object.assign({},c),{get:()=>((t,e,n,c)=>{const l=n.length>2,p=l?\"value += getBiasForMatmul();\":\"\",f=n[0].dims,d=n[1].dims,h=r.BroadcastUtil.calcShape(f,d,!0),g=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error(\"Can't use matmul on the given tensors\");const b=f[f.length-1],m=Math.ceil(b/2),y=f.length,_=d.length,v=(0,i.getGlsl)(t.session.backend.glContext.version),w=(0,a.getCoordsDataType)(h.length),x=h.length,T=(0,a.getGlChannels)(),{activationFunction:S,applyActivation:O}=(0,s.getActivationSnippet)(c),A=l?`${(0,u.getBiasForMatmul)(w,T,n[2].dims,h,!0)}`:\"\",E=g?`${function(t,e,n,i){let o=[],a=[];const s=n[0].dims,u=n[1].dims,c=s.length,l=u.length,p=i.length,f=p-c,d=p-l;o=s.map(((t,n)=>`coords.${e[n+f]}`)),o[c-1]=\"i*2\",o.join(\", \"),a=u.map(((t,n)=>`coords.${e[n+d]}`)),a[l-2]=\"i*2\",a.join(\", \");const h=r.BroadcastUtil.getBroadcastDims(s,i),g=r.BroadcastUtil.getBroadcastDims(u,i),b=h.map((t=>`coords.${e[t+f]} = 0;`)).join(\"\\n\"),m=g.map((t=>`coords.${e[t+d]} = 0;`)).join(\"\\n\"),y=`int lastDim = coords.${e[p-1]};\\n coords.${e[p-1]} = coords.${e[p-2]};\\n coords.${e[p-2]} = lastDim;`;return`\\nvec4 getAAtOutCoordsMatmul(int i) {\\n ${t} coords = getOutputCoords();\\n ${y}\\n ${b}\\n vec4 outputValue = getA(${o});\\n return outputValue;\\n}\\n\\nvec4 getBAtOutCoordsMatmul(int i) {\\n ${t} coords = getOutputCoords();\\n ${y}\\n ${m}\\n vec4 outputValue = getB(${a});\\n return outputValue;\\n}`}(w,T,n,h)}`:\"\",I=g?\"getAAtOutCoordsMatmul(i)\":`getA(${function(t,e){let n=\"\";for(let r=0;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getBiasForMatmul=e.createMatmulProgramInfoLoader=e.parseMatMulAttributes=e.matMul=void 0;const r=n(2517),i=n(2039),o=n(9390),a=n(2823),s=n(708);function u(t,e){const n=(s=t.length>2,u=e.activationCacheKey,{name:\"MatMul\",inputNames:s?[\"A\",\"B\",\"Bias\"]:[\"A\",\"B\"],inputTypes:s?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});var s,u;return Object.assign(Object.assign({},n),{get:()=>function(t,e,n){const s=e[0].dims,u=e[1].dims,c=r.BroadcastUtil.calcShape(s,u,!0);if(!c)throw new Error(\"Can't use matmul on the given tensors\");const p=(0,o.getCoordsDataType)(c.length),f=(0,o.getGlChannels)(),{activationFunction:d,applyActivation:h}=(0,a.getActivationSnippet)(n),g=e.length>2,b=g?\"value += getBiasForMatmul();\":\"\",m=g?`${l(p,f,e[2].dims,c,!1)}`:\"\",y=c.length,_=s.length,v=u.length,w=`\\n ${d}\\n ${m}\\n float process(int indices[${y}]) {\\n int a[${_}];\\n int b[${v}];\\n bcastMatmulIndices_A(indices, a);\\n bcastMatmulIndices_B(indices, b);\\n\\n float value;\\n for (int k=0; k<${s[s.length-1]}; ++k) {\\n a[${_-1}] = k;\\n b[${v-2}] = k;\\n value += _A(a) * _B(b);\\n }\\n ${b}\\n ${h}\\n return value;\\n }`;return Object.assign(Object.assign({},t),{output:{dims:c,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:w})}(n,t,e)})}e.matMul=(t,e,n)=>(c(e),t.session.pack?[t.run((0,s.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(u(e,n),e)]),e.parseMatMulAttributes=t=>(0,a.parseInternalActivationAttributes)(t.attributes),e.createMatmulProgramInfoLoader=u;const c=t=>{if(!t||2!==t.length)throw new Error(\"MatMul requires 2 inputs.\");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error(\"shared dimension does not match.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type||\"float32\"!==t[1].type&&\"float64\"!==t[1].type)throw new Error(\"inputs should be float type\");if(t[0].type!==t[1].type)throw new Error(\"inputs types should match\")};function l(t,e,n,i,o){let a=\"\";const s=n.length,u=i.length,c=u-s;a=u<2&&s>0?\"coords\":n.map(((t,n)=>`coords.${e[n+c]}`)).join(\", \");const l=r.BroadcastUtil.getBroadcastDims(n,i).map((t=>`coords.${e[t+c]} = 0;`)).join(\"\\n\");let p=\"vec4(outputValue.xx, outputValue.yy)\";return 1===r.ShapeUtil.size(n)&&(p=\"vec4(outputValue.x)\"),o?`\\nvec4 getBiasForMatmul() {\\n ${t} coords = getOutputCoords();\\n ${l}\\n vec4 outputValue = getBias(${a});\\n return ${p};\\n}`:`\\nfloat getBiasForMatmul() {\\n ${t} coords = getOutputCoords();\\n ${l}\\n return getBias(coords.x);\\n}`}e.getBiasForMatmul=l},2403:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPackProgramInfoLoader=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:\"pack\",inputNames:[\"A\"],inputTypes:[i.TextureType.unpackedReversed]};e.createPackProgramInfoLoader=(t,e)=>Object.assign(Object.assign({},s),{get:()=>((t,e)=>{const n=(0,r.getGlsl)(t.session.backend.glContext.version),u=e.dims,c=u.length,l=e.dims.length,p=(0,o.getCoordsDataType)(l),f=(0,a.getChannels)(\"rc\",l),d=(h=l,g=f,b=u[u.length-2],m=u[u.length-1],0===h||1===h?\"\":`\\n int r = ${g[h-2]};\\n int c = ${g[h-1]};\\n int rp1 = ${g[h-2]} + 1;\\n int cp1 = ${g[h-1]} + 1;\\n bool rEdge = rp1 >= ${m};\\n bool cEdge = cp1 >= ${b};\\n `);var h,g,b,m;let y;y=0===c?[1,1]:1===c?[u[0],1]:[u[l-1],u[l-2]];const _=function(t,e,n){if(0===t)return\"false\";if(1===t)return`rc > ${e[0]}`;let r=\"\";for(let i=t-2;i= ${e[i-t+2]}`,i= ${t[0]} ? 0. : getA(rc + 1),\\n 0, 0`;let r=\"\";if(n>2)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.unpackFromChannel=e.getChannels=e.getVecChannels=void 0;const r=n(9390);function i(t,e){return(0,r.getGlChannels)(e).map((e=>`${t}.${e}`))}e.getVecChannels=i,e.getChannels=function(t,e){return 1===e?[t]:i(t,e)},e.unpackFromChannel=function(){return\"\\n float getChannel(vec4 frag, int dim) {\\n int modCoord = imod(dim, 2);\\n return modCoord == 0 ? frag.r : frag.g;\\n }\\n\\n float getChannel(vec4 frag, vec2 innerDims) {\\n vec2 modCoord = mod(innerDims, 2.);\\n return modCoord.x == 0. ?\\n (modCoord.y == 0. ? frag.r : frag.g) :\\n (modCoord.y == 0. ? frag.b : frag.a);\\n }\\n \"}},2870:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;const r=n(246),i=n(2517),o=n(5060),a=n(2039),s={name:\"Pad\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]};e.padV2=(t,e,n)=>(l(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>c(t,e[0],n)}),e)]),e.parsePadAttributesV2=t=>{const e=t.attributes.getString(\"mode\",\"constant\"),n=t.attributes.getFloat(\"value\",0),i=t.attributes.getInts(\"pads\");return(0,r.createAttributeWithCacheKey)({mode:e,value:n,pads:i})},e.padV11=(t,n,r)=>{p(n);const i=u(t,n,r);return(0,e.padV2)(t,[n[0]],i)},e.parsePadAttributesV11=t=>t.attributes.getString(\"mode\",\"constant\");const u=(t,e,n)=>{if(!t.session.isInitializer(e[1].dataId)||e.length>=3&&!t.session.isInitializer(e[2].dataId))throw new Error(\"dynamic pad attributes are not allowed\");const i=Array.from(e[1].integerData),o=e.length>=3?e[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:i,value:o})},c=(t,e,n)=>{const r=i.ShapeUtil.padShape(e.dims.slice(),n.pads),o=r.length,s=`\\n ${f(t,e,n)}\\n float process(int[${o}] indices) {\\n return padA(indices);\\n }`;return{name:\"Pad\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked],output:{dims:r,type:e.type,textureType:a.TextureType.unpacked},shaderSource:s}},l=t=>{if(!t||1!==t.length)throw new Error(\"Pad requires 1 input\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type.\")},p=t=>{if(!t||2!==t.length&&3!==t.length)throw new Error(\"Pad requires 2 or 3 inputs\");if(\"int32\"!==t[1].type)throw new Error(\"Invalid input type.\");if(t.length>=3&&\"string\"===t[2].type)throw new Error(\"Invalid input type.\")},f=(t,e,n)=>{const r=(0,o.getGlsl)(t.session.backend.glContext.version),[s,u]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),c=i.ShapeUtil.computeStrides(e.dims);switch(n.mode){case\"constant\":return d(r,e.dims,c,s,u,n.pads,n.value);case\"reflect\":return h(r,e.dims,c,s,u,n.pads);case\"edge\":return g(r,e.dims,c,s,u,n.pads);default:throw new Error(\"Invalid mode\")}},d=(t,e,n,r,i,o,a)=>{const s=e.length;let u=\"\";for(let t=s-1;t>=0;--t)u+=`\\n k = m[${t}] - ${o[t]};\\n if (k < 0) return constant;\\n if (k >= ${e[t]}) return constant;\\n offset += k * ${n[t]};\\n `;return`\\n float padA(int m[${s}]) {\\n const float constant = float(${a});\\n int offset = 0;\\n int k = 0;\\n ${u}\\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\\n float value = getColorAsFloat(${t.texture2D}(A, coords));\\n return value;\\n }\\n `},h=(t,e,n,r,i,o)=>{const a=e.length;let s=\"\";for(let t=a-1;t>=0;--t)s+=`\\n k = m[${t}] - ${o[t]};\\n if (k < 0) { k = -k; }\\n {\\n const int _2n_1 = ${2*(e[t]-1)};\\n k = int( mod( float(k), float(_2n_1) ) ) ;\\n if(k >= ${e[t]}) { k = _2n_1 - k; }\\n }\\n offset += k * ${n[t]};\\n `;return`\\n float padA(int m[${a}]) {\\n int offset = 0;\\n int k = 0;\\n ${s}\\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\\n float value = getColorAsFloat(${t.texture2D}(A, coords));\\n return value;\\n }\\n `},g=(t,e,n,r,i,o)=>{const a=e.length;let s=\"\";for(let t=a-1;t>=0;--t)s+=`\\n k = m[${t}] - ${o[t]};\\n if (k < 0) k = 0;\\n if (k >= ${e[t]}) k = ${e[t]-1};\\n offset += k * ${n[t]};\\n `;return`\\n float padA(int m[${a}]) {\\n int offset = 0;\\n int k = 0;\\n ${s}\\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\\n float value = getColorAsFloat(${t.texture2D}(A, coords));\\n return value;\\n }\\n `}},2143:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;const r=n(246),i=n(2517),o=n(2039);e.averagePool=(t,e,n)=>{p(e);const r={name:\"AveragePool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!1,n)}),e)]},e.parseAveragePoolAttributes=t=>{const e=t.attributes.getString(\"auto_pad\",\"NOTSET\"),n=t.attributes.getInt(\"ceil_mode\",0),i=0!==t.attributes.getInt(\"count_include_pad\",0),o=t.attributes.getInts(\"kernel_shape\"),a=t.attributes.getInts(\"strides\",[]),s=t.attributes.getInts(\"pads\",[]);if(0!==n)throw new Error(\"using ceil() in shape computation is not yet supported for AveragePool\");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:i,kernelShape:o,strides:a,pads:s})};const a=(t,e,n,r)=>{const[a,s]=u(t,r,n),c=i.ShapeUtil.size(a.kernelShape);let l=\"\";a.countIncludePad?l+=`value /= float(${c});`:l+=`value /= float(${c} - pad);`;const p=`\\n ${f(t[0].dims,a,\"value += _X(x);\",l,\"0.0\")}\\n `;return Object.assign(Object.assign({},e),{output:{dims:s,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:p})};e.globalAveragePool=(t,e,n)=>{p(e);const r={name:\"GlobalAveragePool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[t.run(Object.assign(Object.assign({},r),{get:()=>a(e,r,!0,n)}),e)]},e.parseGlobalAveragePoolAttributes=t=>{const e=0!==t.attributes.getInt(\"count_include_pad\",0);return(0,r.createAttributeWithCacheKey)({autoPad:\"\",ceilMode:0,countIncludePad:e,kernelShape:[],strides:[],pads:[]})},e.maxPool=(t,e,n)=>{p(e);const r={name:\"MaxPool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(Object.assign(Object.assign({},r),{get:()=>s(e,r,!1,n)}),e)]},e.parseMaxPoolAttributes=t=>{const e=t.attributes.getString(\"auto_pad\",\"NOTSET\"),n=t.attributes.getInt(\"ceil_mode\",0),i=t.attributes.getInts(\"kernel_shape\"),o=t.attributes.getInts(\"strides\",[]),a=t.attributes.getInts(\"pads\",[]),s=t.attributes.getInt(\"storage_order\",0),u=t.attributes.getInts(\"dilations\",[]);if(0!==s)throw new Error(\"column major storage order is not yet supported for MaxPool\");if(0!==n)throw new Error(\"using ceil() in shape computation is not yet supported for MaxPool\");return(0,r.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:!1,kernelShape:i,strides:o,pads:a,storageOrder:s,dilations:u})};const s=(t,e,n,r)=>{const[i,a]=u(t,r,n),s=`\\n ${f(t[0].dims,i,\"\\n value = max(_X(x), value);\\n \",\"\",\"-1e5\")}\\n `;return Object.assign(Object.assign({},e),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:s})},u=(t,e,n)=>{const r=t[0].dims.slice(),o=Object.hasOwnProperty.call(e,\"dilations\"),a=e.kernelShape.slice(),s=e.strides.slice(),u=o?e.dilations.slice():[],c=e.pads.slice();i.PoolConvUtil.adjustPoolAttributes(n,r,a,s,u,c);const l=i.PoolConvUtil.computePoolOutputShape(n,r,s,u,a,c,e.autoPad),p=Object.assign({},e);return o?Object.assign(p,{kernelShape:a,strides:s,pads:c,dilations:u,cacheKey:e.cacheKey}):Object.assign(p,{kernelShape:a,strides:s,pads:c,cacheKey:e.cacheKey}),[p,l]},c={autoPad:\"\",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:\"\"},l={name:\"GlobalMaxPool\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked]};e.globalMaxPool=(t,e)=>(p(e),[t.run(Object.assign(Object.assign({},l),{get:()=>s(e,l,!0,c)}),e)]);const p=t=>{if(!t||1!==t.length)throw new Error(\"Pool ops requires 1 input.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type.\")},f=(t,e,n,r,o)=>{const a=t.length;if(e.kernelShape.length<=2){const i=e.kernelShape[e.kernelShape.length-1],s=e.strides[e.strides.length-1],u=e.pads[e.pads.length/2-1],c=e.pads[e.pads.length-1],l=t[a-1];let p=\"\",f=\"\",d=\"\";if(p=u+c!==0?`\\n for (int i = 0; i < ${i}; i++) {\\n x[${a} - 1] = indices[${a} - 1] * ${s} - ${u} + i;\\n if (x[${a} - 1] < 0 || x[${a} - 1] >= ${l}) {\\n pad++;\\n continue;\\n }\\n ${n}\\n }`:`\\n for (int i = 0; i < ${i}; i++) {\\n x[${a} - 1] = indices[${a} - 1] * ${s} - ${u} + i;\\n ${n}\\n }`,2===e.kernelShape.length){const n=e.kernelShape[e.kernelShape.length-2],r=e.strides[e.strides.length-2],o=e.pads[e.pads.length/2-2],s=e.pads[e.pads.length-2],u=t[a-2];f=o+s!==0?`\\n for (int j = 0; j < ${n}; j++) {\\n x[${a} - 2] = indices[${a} - 2] * ${r} - ${o} + j;\\n if (x[${a} - 2] < 0 || x[${a} - 2] >= ${u}) {\\n pad+= ${i};\\n continue;\\n }\\n `:`\\n for (int j = 0; j < ${n}; j++) {\\n x[${a} - 2] = indices[${a} - 2] * ${r} - ${o} + j;\\n `,d=\"\\n }\\n \"}return`\\n float process(int indices[${a}]) {\\n int x[${a}];\\n copyVec(indices, x);\\n\\n float value = ${o};\\n int pad = 0;\\n ${f}\\n ${p}\\n ${d}\\n ${r}\\n return value;\\n }\\n `}{const s=i.ShapeUtil.size(e.kernelShape),u=i.ShapeUtil.computeStrides(e.kernelShape),c=u.length,l=e.pads.length,p=h(c),f=d(t,\"inputDims\"),g=d(e.pads,\"pads\"),b=d(u,\"kernelStrides\"),m=d(e.strides,\"strides\");let y=\"\";return y=e.pads.reduce(((t,e)=>t+e))?`\\n if (x[j] >= inputDims[j] || x[j] < 0) {\\n pad++;\\n isPad = true;\\n break;\\n }\\n }\\n if (!isPad) {\\n ${n}\\n }`:`\\n }\\n ${n}\\n `,`\\n ${p}\\n float process(int indices[${a}]) {\\n int x[${a}];\\n copyVec(indices, x);\\n int offset[${c}];\\n int pads[${l}];\\n int inputDims[${a}];\\n int kernelStrides[${c}];\\n int strides[${c}];\\n ${g}\\n ${f}\\n ${m}\\n ${b}\\n\\n float value = ${o};\\n int pad = 0;\\n bool isPad = false;\\n for (int i = 0; i < ${s}; i++) {\\n offsetToIndices(i, kernelStrides, offset);\\n isPad = false;\\n for (int j = ${a} - ${c}; j < ${a}; j++) {\\n x[j] = indices[j] * strides[j - ${a} + ${c}]\\n + offset[j - ${a} + ${c}] - pads[j - 2];\\n ${y}\\n }\\n ${r}\\n\\n return value;\\n }\\n `}},d=(t,e)=>{let n=\"\";for(let r=0;r`\\n void offsetToIndices(int offset, int[${t}] strides, out int[${t}] indices) {\\n if (${t} == 0) {\\n return;\\n }\\n for (int i = 0; i < ${t} - 1; ++i) {\\n indices[i] = offset / strides[i];\\n offset -= indices[i] * strides[i];\\n }\\n indices[${t} - 1] = offset;\\n }`},4939:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.reduceLogSumSquare=e.reduceLogSum=e.reduceProd=e.reduceMin=e.reduceMax=e.reduceMean=e.reduceSum=e.parseReduceAttributes=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039),s=(t,e,n,r,i)=>{c(e);const o={name:r,inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},o),{cacheHint:n.cacheKey,get:()=>u(t,e,n,r,i,o)}),e)]};e.parseReduceAttributes=t=>{const e=t.attributes.getInts(\"axes\",[]),n=1===t.attributes.getInt(\"keepdims\",1);return(0,r.createAttributeWithCacheKey)({axes:e,keepDims:n})};const u=(t,e,n,r,i,s)=>{const u=[],c=e[0].dims.length||1,l=[],p=o.ShapeUtil.normalizeAxes(n.axes,e[0].dims.length),f=i(e,p);let d=f[1];for(let t=0;t=0||0===p.length?(n.keepDims&&u.push(1),d=`\\n for(int j${t} = 0; j${t} < ${e[0].dims[t]}; j${t}++) {\\n inputIdx[${t}] = j${t};\\n ${d}\\n }`):(l.push(`inputIdx[${t}] = outputIdx[${u.length}];`),u.push(e[0].dims[t]));const h=`\\n float process(int outputIdx[${u.length||1}]) {\\n float value; // final result\\n int inputIdx[${c}]; // addressing input data\\n ${l.join(\"\\n\")}\\n ${f[0]} // init ops for reduce max/min\\n ${d}\\n ${f[2]} // final computation for reduce mean\\n return value;\\n }`;return Object.assign(Object.assign({},s),{output:{dims:u,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:h})},c=t=>{if(!t||1!==t.length)throw new Error(\"Reduce op requires 1 input.\");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invalid input type.\")};e.reduceSum=(t,e,n)=>s(t,e,n,\"ReduceSum\",(()=>[\"value = 0.0;\",\"value += _A(inputIdx);\",\"\"])),e.reduceMean=(t,e,n)=>s(t,e,n,\"ReduceMean\",((t,e)=>{let n=1;for(let r=0;r=0||0===e.length)&&(n*=t[0].dims[r]);return[\"value = 0.0;\",\"value += _A(inputIdx);\",`value /= ${n}.;`]})),e.reduceMax=(t,e,n)=>s(t,e,n,\"ReduceMax\",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join(\"\\n\")}\\nvalue = _A(inputIdx);`,\"value = max(value, _A(inputIdx));\",\"\"]})),e.reduceMin=(t,e,n)=>s(t,e,n,\"ReduceMin\",((t,e)=>{const n=[];for(let r=0;r=0||0===e.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join(\"\\n\")}\\nvalue = _A(inputIdx);`,\"value = min(value, _A(inputIdx));\",\"\"]})),e.reduceProd=(t,e,n)=>s(t,e,n,\"ReduceProd\",(()=>[\"value = 1.0;\",\"value *= _A(inputIdx);\",\"\"])),e.reduceLogSum=(t,e,n)=>s(t,e,n,\"ReduceLogSum\",(()=>[\"value = 0.0;\",\"value += _A(inputIdx);\",\"value = log(value);\"])),e.reduceLogSumSquare=(t,e,n)=>s(t,e,n,\"ReduceLogSumSquare\",(()=>[\"float t; value = 0.0;\",\"t = _A(inputIdx); value += t * t;\",\"\"]))},7019:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.isReshapeCheap=e.processDims3D=e.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),i=n(5060),o=n(2039),a=n(2827);e.createPackedReshape3DProgramInfoLoader=(t,e,n)=>{const s=(t=>({name:\"Reshape (packed)\",inputTypes:[o.TextureType.packed],inputNames:[\"A\"],cacheHint:`${t}`}))(n);return Object.assign(Object.assign({},s),{get:()=>((t,e,n,s)=>{const u=e.dims,c=s;let l=\"\";for(let t=0;t<4;t++){let e=\"\";switch(t){case 0:e=\"outputCoords = rc;\";break;case 1:e=\"outputCoords = ivec3(rc.x, rc.y+1, rc.z);\";break;case 2:e=\"outputCoords = ivec3(rc.x, rc.y, rc.z+1);\";break;case 3:e=\"outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);\";break;default:throw new Error}l+=`\\n ${e}\\n ${t>0?\"if(outputCoords.y < rows && outputCoords.z < cols){\":\"\"}\\n int flattenedIndex = getFlattenedIndex(outputCoords);\\n\\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\\n\\n result[${t}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\\n\\n ${t>0?\"}\":\"\"}\\n `}const p=(0,i.getGlsl)(t.session.backend.glContext.version),f=`\\n ${function(t){const e=r.ShapeUtil.computeStrides(t),n=[\"b\",\"r\",\"c\"],i=\"index\";return`\\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\\n ${e.map(((t,r)=>`int ${n[r]} = ${i} / ${t}; ${r===e.length-1?`int ${n[r+1]} = ${i} - ${n[r]} * ${t}`:`index -= ${n[r]} * ${t}`};`)).join(\"\")}\\n return ivec3(b, r, c);\\n }\\n `}(u)}\\n ${function(t){const e=r.ShapeUtil.computeStrides(t);return`\\n int getFlattenedIndex(ivec3 coords) {\\n // reverse y, z order\\n return coords.x * ${e[0]} + coords.z * ${e[1]} + coords.y;\\n }\\n`}(c)}\\n ${(0,a.unpackFromChannel)()}\\n\\n void main() {\\n ivec3 rc = getOutputCoords();\\n\\n vec4 result = vec4(0.0);\\n\\n ivec3 outputCoords;\\n int rows = ${c[2]};\\n int cols = ${c[1]};\\n\\n ${l}\\n ${p.output} = result;\\n }\\n `;return Object.assign(Object.assign({},n),{output:{dims:c,type:e.type,textureType:o.TextureType.packed},shaderSource:f,hasMain:!0})})(t,e,s,n)})},e.processDims3D=function(t){if(0===t.length)return[1,1,1];let e=1;for(let n=0;n1?t[t.length-2]:1,t[t.length-1]]},e.isReshapeCheap=function(t,e){let n=!1;return n=0===t.length||0===e.length||(t.length<2||e.length<2?t[t.length-1]===e[e.length-1]:t[t.length-1]===e[e.length-1]&&t[t.length-2]===e[e.length-2]),n}},718:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.reshape=void 0;const r=n(2517);e.reshape=(t,e)=>{const n=r.ShapeUtil.calculateReshapedDims(e[0].dims,e[1].integerData);return t.session.pack?[t.reshapePacked(e[0],n)]:[t.reshapeUnpacked(e[0],n)]}},2268:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s=n(9793),u={name:\"Resize\",inputNames:[\"A\"],inputTypes:[i.TextureType.packed]};e.resize=(t,e,n)=>((0,s.validateInputs)(e,n),[t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>c(t,e,n)}),e)]),e.parseResizeAttributesV10=t=>(0,s.parseUpsampleAttributes)(t,10),e.parseResizeAttributesV11=t=>(0,s.parseUpsampleAttributes)(t,11);const c=(t,e,n)=>{const s=(0,r.getGlsl)(t.session.backend.glContext.version),[c,p]=l(e,n);if(c.every((t=>1===t))&&\"tf_crop_and_resize\"!==n.coordinateTransformMode)return Object.assign(Object.assign({},u),{output:{dims:p,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:`void main() {\\n vec4 v = ${s.texture2D}(X, TexCoords);\\n ${s.output} = v;\\n }`});const f=p.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const d=p[f-2],h=p[f-1],g=e[0].dims;if(f!==g.length)throw new Error(`output dimension should match input ${g.length}, but got ${f}`);const b=g[f-2],m=g[f-1],y=c[f-2],_=c[f-1];let v=\"\";if(\"linear\"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case\"asymmetric\":v=\"\\n vec4 getSourceFracIndex(ivec4 coords) {\\n return vec4(coords) / scaleWHWH;\\n }\\n \";break;case\"half_pixel\":v=\"\\n vec4 getSourceFracIndex(ivec4 coords) {\\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\\n }\\n \";break;case\"pytorch_half_pixel\":v=`\\n vec4 getSourceFracIndex(ivec4 coords) {\\n vec4 fcoords = vec4(coords);\\n return vec4(\\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\\n ${d}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\\n ${d}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\\n );\\n }\\n `;break;case\"align_corners\":v=`\\n vec4 getSourceFracIndex(ivec4 coords) {\\n vec4 resized = vec4(${h}.0 - 1.0, ${d}.0 - 1.0, ${h}.0 - 1.0,\\n ${d}.0 - 1.0);\\n vec4 original = vec4(${m}.0 - 1.0, ${b}.0 - 1.0, ${m}.0 - 1.0,\\n ${b}.0 - 1.0);\\n vec4 new_scale = original / resized;\\n return vec4(coords) * new_scale;\\n }\\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,o.getCoordsDataType)(f),x=`\\n const vec2 inputWH = vec2(${b}.0, ${m}.0);\\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\\n ${(0,a.unpackFromChannel)()}\\n ${v}\\n float getAValue(int x10, int r, int c, int d) {\\n return getChannel(getA(x10, r, c, d), vec2(c, d));\\n }\\n void main() {\\n ${w} rc = getOutputCoords();\\n\\n int batch = rc[0];\\n int depth = rc[1];\\n\\n // retrieve the 4 coordinates that is used in the 4 packed output values.\\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\\n\\n // calculate the source index in fraction\\n vec4 sourceFrac = getSourceFracIndex(coords);\\n\\n // get the lower and upper bound of the 4 values that will be packed into one texel.\\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\\n\\n bool hasNextRow = rc.w < ${d-1};\\n bool hasNextCol = rc.z < ${h-1};\\n\\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\\n vec4 topLeft = vec4(\\n getAValue(batch, depth, x00.x, x00.y),\\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\\n\\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\\n vec4 topRight = vec4(\\n getAValue(batch, depth, x00.x, x00.w),\\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\\n\\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\\n vec4 bottomLeft = vec4(\\n getAValue(batch, depth, x00.z, x00.y),\\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\\n\\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\\n vec4 bottomRight = vec4(\\n getAValue(batch, depth, x00.z, x00.w),\\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\\n\\n // calculate the interpolation fraction on u and v direction\\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\\n\\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\\n\\n ${s.output} = vec4(newValue);\\n }\\n `;return Object.assign(Object.assign({},u),{output:{dims:p,type:e[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:x})},l=(t,e)=>{const n=t[0].dims;let r,i=e.scales;if(0===i.length){const o=t[e.scalesInputIdx];if(o&&0!==o.size){if(t[e.sizesInputIdx])throw new Error(\"Only one of scales or sizes must be provided as input.\");i=p(o,e.mode,e.isResize)}else{const o=t[e.sizesInputIdx];if(!o||0===o.size)throw new Error(\"Either scales or sizes MUST be provided as input.\");r=Array.from(o.integerData),i=f(r,n,e.mode,e.isResize)}}else if(t[e.sizesInputIdx])throw new Error(\"Only one of scales or sizes must be provided as input.\");const o=r||n.map(((t,e)=>Math.floor(t*i[e])));return[i,o]},p=(t,e,n)=>{const r=Array.from(t.floatData);return(0,s.scalesValidation)(r,e,n),r},f=(t,e,n,r)=>{const i=e.length,o=new Array(i);for(let n=0,r=i;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.shape=void 0;const r=n(9162);e.shape=(t,e)=>(i(e),[new r.Tensor([e[0].dims.length],\"int32\",void 0,void 0,new Int32Array(e[0].dims))]);const i=t=>{if(!t||1!==t.length)throw new Error(\"Shape requires 1 input.\")}},2278:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sliceV10=e.parseSliceAttributes=e.slice=void 0;const r=n(246),i=n(782),o=n(2517),a=n(2039),s={name:\"Slice\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]};e.slice=(t,e,n)=>(c(e),[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),e)]),e.parseSliceAttributes=t=>{const e=t.attributes.getInts(\"starts\"),n=t.attributes.getInts(\"ends\"),i=t.attributes.getInts(\"axes\",[]);return(0,r.createAttributeWithCacheKey)({starts:e,ends:n,axes:i})};const u=(t,e,n)=>{const r=0===n.axes.length?e.dims.slice(0).map(((t,e)=>e)):n.axes,i=o.ShapeUtil.normalizeAxes(r,e.dims.length),u=n.starts.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),c=n.ends.map(((t,n)=>t>e.dims[i[n]]-1?e.dims[i[n]]:o.ShapeUtil.normalizeAxis(t,e.dims[i[n]]))),l=e.dims.slice(),p=[];for(let t=0;t0&&p.push(`outputIdx[${i[t]}] += ${u[t]};`);const f=`\\n float process(int outputIdx[${l.length}]) {\\n ${p.join(\"\\n \")}\\n return _A(outputIdx);\\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},c=t=>{if(!t||1!==t.length)throw new Error(\"Slice requires 1 input.\");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invalid input type.\")};e.sliceV10=(t,e)=>{p(e);const n=l(t,e);return[t.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(t,e[0],n)}),[e[0]])]};const l=(t,e)=>{if(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)||e.length>=4&&!t.session.isInitializer(e[3].dataId)||e.length>=5&&!t.session.isInitializer(e[4].dataId))throw new Error(\"dynamic slice attributes are not allowed\");if(e.length>=5&&e[4].integerData.some((t=>1!==t)))throw new Error(\"currently non-1 steps is not supported for Slice\");const n=Array.from(e[1].integerData),r=Array.from(e[2].integerData),i=e.length>=4?Array.from(e[3].integerData):[];return{starts:n,ends:r,axes:i,cacheKey:`${i};${n};${r}`}},p=t=>{if(!t||t.length<3||t.length>5)throw new Error(\"Invalid input number.\");if(\"int32\"!==t[1].type||1!==t[1].dims.length)throw new Error(\"Invalid input type.\");if(\"int32\"!==t[2].type||1!==t[2].dims.length)throw new Error(\"Invalid input type.\");if(t.length>=4&&(\"int32\"!==t[3].type||1!==t[3].dims.length))throw new Error(\"Invalid input type.\");if(t.length>=5&&(\"int32\"!==t[4].type||1!==t[4].dims.length))throw new Error(\"Invalid input type.\")}},5524:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;const r=n(246),i=n(2517),o=n(5060),a=n(2039),s=n(3738),u={name:\"SoftmaxComputeMax\",inputNames:[\"A\"],inputTypes:[a.TextureType.unpacked]},c={name:\"SoftmaxComputeScale\",inputNames:[\"A\",\"Max\"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},l={name:\"SoftMax\",inputNames:[\"A\",\"Max\",\"Norm\"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};e.softmax=(t,e,n)=>{g(e);const r=e[0].dims.slice(),o=i.ShapeUtil.normalizeAxis(n.axis,r.length),a=i.ShapeUtil.sizeToDimension(r,o),s=i.ShapeUtil.sizeFromDimension(r,o);return p(t,e,n,a,s)},e.parseSoftmaxAttributes=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\",1)}),e.parseSoftmaxAttributesV13=t=>(0,r.createAttributeWithCacheKey)({axis:t.attributes.getInt(\"axis\",-1)}),e.softmaxV13=(t,e,n)=>{g(e);const o=e[0].dims.slice(),a=i.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,c=a!==u-1,l=[];let f,d=[],h=[];c&&(d=Array.from({length:u}).map(((t,e)=>e)),d[a]=u-1,d[u-1]=a,d.map((t=>l.push(o[t]))),f=(0,r.createAttributeWithCacheKey)({perm:d}),h=(0,s.transpose)(t,e,f));const b=c?i.ShapeUtil.sizeToDimension(l,u-1):i.ShapeUtil.sizeToDimension(o,u-1),m=c?i.ShapeUtil.sizeFromDimension(l,u-1):i.ShapeUtil.sizeFromDimension(o,u-1),y=p(t,c?h:e,n,b,m);return c?(0,s.transpose)(t,y,f):y};const p=(t,e,n,r,i)=>{const o=f(t,e[0],r,i,[r]),a=t.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>o}),e),s=d(t,e[0],r,i,o.output.dims,[r]),p=t.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>s}),[e[0],a]),g=h(t,e[0],r,i,o.output.dims,s.output.dims);return[t.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>g}),[e[0],a,p])]},f=(t,e,n,r,i)=>{const[s,c]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),l=i.length;if(n<1||r<1)throw new Error(\"Logical row count N and feature count D must be greater than or equal to 1\");if(1!==i.length)throw new Error(\"Dimensionality of the output should be 1\");if(i[0]!==n)throw new Error(\"Shape of the output should be equal to logical row count\");const p=(0,o.getGlsl)(t.session.backend.glContext.version),f=`\\n float process(int[${l}] indices) {\\n int logical_row_start_offset = indices[0] * ${r};\\n\\n float max = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s},\\n ${c} )));\\n for(int i=1; i<${r}; ++i)\\n {\\n float current = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\\n ${s}, ${c})));\\n if(current > max)\\n max = current;\\n }\\n\\n return max;\\n }`;return Object.assign(Object.assign({},u),{output:{dims:i,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},d=(t,e,n,r,i,s)=>{const[u,l]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),p=s.length;if(n<1||r<1)throw new Error(\"Logical row count N and feature count D must be greater than or equal to 1\");if(1!==s.length)throw new Error(\"Dimensionality of the output should be 1\");if(s[0]!==n)throw new Error(\"Shape of the output should be equal to logical row count\");if(1!==i.length)throw new Error(\"Dimensionality of the intermediate results should be 1\");if(i[0]!==n)throw new Error(\"Shape of the intermediate results should be equal to logical row count\");const f=`\\n float process(int[${p}] indices) {\\n int logical_row_start_offset = indices[0] * ${r};\\n\\n float norm_factor = 0.0;\\n float max = _Max(indices);\\n for(int i=0; i<${r}; ++i)\\n {\\n norm_factor += exp(getColorAsFloat(${(0,o.getGlsl)(t.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\\n ${u}, ${l}))) - max);\\n }\\n\\n return norm_factor;\\n }`;return Object.assign(Object.assign({},c),{output:{dims:s,type:e.type,textureType:a.TextureType.unpacked},shaderSource:f})},h=(t,e,n,r,i,o)=>{const[s,u]=t.calculateTextureWidthAndHeight(e.dims,a.TextureType.unpacked),c=e.dims.length;if(n<1||r<1)throw new Error(\"Logical row count N and feature count D must be greater than or equal to 1\");if(1!==i.length||1!==o.length)throw new Error(\"Dimensionality of the intermediate results should be 1\");if(i[0]!==n||o[0]!==n)throw new Error(\"Shape of the intermediate results should be equal to logical row count\");const p=`\\n float process(int[${c}] indices) {\\n\\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\\n int offset = coordsToOffset(TexCoords, ${s}, ${u});\\n\\n //determine the logical row for this index\\n int logical_row_index[1];\\n logical_row_index[0] = offset / ${r};\\n\\n float norm_factor = _Norm(logical_row_index);\\n\\n // avoid possible division by 0\\n // if norm_facor is 0, all elements are zero\\n // if so, return 0\\n if(norm_factor == 0.0)\\n return 0.0;\\n\\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\\n }`;return Object.assign(Object.assign({},l),{output:{dims:e.dims,type:e.type,textureType:a.TextureType.unpacked},shaderSource:p})},g=t=>{if(!t||1!==t.length)throw new Error(\"Softmax requires 1 input.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"Invalid input type\")}},5975:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseSplitAttributes=e.split=void 0;const r=n(246),i=n(2517),o=n(2039),a={name:\"Split\",inputNames:[\"A\"],inputTypes:[o.TextureType.unpacked]};e.split=(t,e,n)=>{c(e);const r=i.ShapeUtil.normalizeAxis(n.axis,e[0].dims.length),o=s(t,e,r,n),l=[];for(let i=0;iu(t,e[0],n,r,i)}),e));return l},e.parseSplitAttributes=t=>{const e=t.attributes.getInt(\"axis\",0),n=t.attributes.getInts(\"split\",[]),i=t.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:e,split:n,numOutputs:i})};const s=(t,e,n,r)=>{const[,o]=i.SplitUtil.splitShape(e[0].dims,n,r.split,r.numOutputs);return o.length},u=(t,e,n,r,s)=>{const[u,c]=i.SplitUtil.splitShape(e.dims,r,n.split,n.numOutputs),l=c[s],p=u[s],f=`\\n float process(int indices[${p.length}]) {\\n indices[${r}] += ${l};\\n return _A(indices);\\n }\\n `;return Object.assign(Object.assign({},a),{cacheHint:`${n.cacheKey}:${s}`,output:{dims:p,type:e.type,textureType:o.TextureType.unpacked},shaderSource:f})},c=t=>{if(!t||1!==t.length)throw new Error(\"Split requires one input.\");if(\"int8\"!==t[0].type&&\"uint8\"!==t[0].type&&\"int16\"!==t[0].type&&\"uint16\"!==t[0].type&&\"int32\"!==t[0].type&&\"uint32\"!==t[0].type&&\"float32\"!==t[0].type&&\"float64\"!==t[0].type&&\"bool\"!==t[0].type)throw new Error(\"Invalid input type.\")}},3933:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseSqueezeAttributes=e.squeezeV13=e.squeeze=void 0;const r=n(2517);e.squeeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.squeezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.squeezeV13=(t,n)=>(o(n),(0,e.squeeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseSqueezeAttributes=t=>t.attributes.getInts(\"axes\");const i=t=>{if(!t||1!==t.length)throw new Error(\"Squeeze requires 1 input.\");if(\"string\"===t[0].type)throw new Error(\"invalid input tensor types.\")},o=t=>{if(!t||2!==t.length)throw new Error(\"Squeeze requires 2 inputs.\");if(\"int32\"!==t[1].type)throw new Error(\"Invalid input type.\")}},6558:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.sum=void 0;const r=n(5060),i=n(2039);e.sum=(t,e)=>{a(e);const n={name:\"Sum\",inputNames:e.map(((t,e)=>`X${e}`)),inputTypes:new Array(e.length).fill(i.TextureType.unpacked)};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const o=(0,r.getGlsl)(t.session.backend.glContext.version),a=e[0].dims.slice(),s=`\\n void main() {\\n vec4 result = ${e.map(((t,e)=>`${o.texture2D}(X${e},TexCoords)`)).join(\" + \")};\\n ${o.output} = result;\\n }\\n `;return Object.assign(Object.assign({},n),{output:{dims:a,type:e[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:s})},a=t=>{if(!t||0===t.length)throw new Error(\"Sum requires inputs.\");const e=t[0].dims.length;for(let n=1;n{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.tile=void 0;const r=n(782),i=n(2039);e.tile=(t,e)=>{a(e);const n={name:\"Tile\",inputNames:[\"A\"],inputTypes:[i.TextureType.unpacked]};return[t.run(Object.assign(Object.assign({},n),{get:()=>o(t,e,n)}),e)]};const o=(t,e,n)=>{const r=e[0].dims.slice(),o=new Array(r.length),a=[];for(let t=0;t{if(!t||2!==t.length)throw new Error(\"Tile requires 2 input.\");if(1!==t[1].dims.length)throw new Error(\"The second input shape must 1 dimension.\");if(t[1].dims[0]!==t[0].dims.length)throw new Error(\"Invalid input shape.\");if(-1===r.NUMBER_TYPES.indexOf(t[0].type))throw new Error(\"Invalid input type.\");if(\"int32\"!==t[1].type&&\"int16\"!==t[1].type)throw new Error(\"Invalid repeat type.\")}},3738:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseTransposeAttributes=e.transpose=void 0;const r=n(246),i=n(2517),o=n(2039),a={name:\"Transpose\",inputNames:[\"A\"],inputTypes:[o.TextureType.unpacked]};e.transpose=(t,e,n)=>(p(e),[t.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>s(t,e[0],n.perm)}),e)]),e.parseTransposeAttributes=t=>(0,r.createAttributeWithCacheKey)({perm:t.attributes.getInts(\"perm\",[])});const s=(t,e,n)=>{const r=e.dims;n=u(r,n);const i=c(r,n),s=r.length,p=`\\n ${l(\"perm\",n,s)}\\n float process(int indices[${s}]) {\\n int a[${s}];\\n perm(a, indices);\\n return _A(a);\\n }`;return Object.assign(Object.assign({},a),{output:{dims:i,type:e.type,textureType:o.TextureType.unpacked},shaderSource:p})},u=(t,e)=>(e&&e.length!==t.length&&(e=[...t.keys()].reverse()),e),c=(t,e)=>(e=u(t,e),i.ShapeUtil.sortBasedOnPerm(t,e)),l=(t,e,n)=>{const r=[];r.push(`void ${t}(out int a[${n}], int src[${n}]) {`);for(let t=0;t{if(!t||1!==t.length)throw new Error(\"Transpose requires 1 input.\");if(\"float32\"!==t[0].type&&\"float64\"!==t[0].type)throw new Error(\"input should be float tensor\")}},8710:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.encodeAsUint8=void 0;const r=n(5060),i=n(2039);e.encodeAsUint8=(t,e)=>{const n=e.shape,o=(0,r.getGlsl)(t.session.backend.glContext.version),a=`\\n const float FLOAT_MAX = 1.70141184e38;\\n const float FLOAT_MIN = 1.17549435e-38;\\n\\n bool isNaN(float val) {\\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\\n }\\n\\n highp vec4 encodeAsUint8(highp float v) {\\n if (isNaN(v)) {\\n return vec4(255, 255, 255, 255);\\n }\\n\\n highp float av = abs(v);\\n\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\\n } else if(v < -FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\\n }\\n\\n highp vec4 c = vec4(0,0,0,0);\\n\\n highp float e = floor(log2(av));\\n highp float m = exp2(fract(log2(av))) - 1.0;\\n\\n c[2] = floor(128.0 * m);\\n m -= c[2] / 128.0;\\n c[1] = floor(32768.0 * m);\\n m -= c[1] / 32768.0;\\n c[0] = floor(8388608.0 * m);\\n\\n highp float ebias = e + 127.0;\\n c[3] = floor(ebias / 2.0);\\n ebias -= c[3] * 2.0;\\n c[2] += floor(ebias) * 128.0;\\n\\n c[3] += 128.0 * step(0.0, -v);\\n\\n return c / 255.0;\\n }\\n\\n void main() {\\n float value = ${o.texture2D}(X,TexCoords).r;\\n ${o.output} = encodeAsUint8(value);\\n }`,s={name:\"Uint8Encode\",inputTypes:[i.TextureType.unpacked],inputNames:[\"X\"],output:{dims:n,type:e.tensor.type,textureType:i.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return t.executeProgram(s,[e.tensor])}},4909:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.tanh=e.tan=e.sqrt=e.sin=e.sigmoid=e.relu=e.not=e.neg=e.log=e.parseLeakyReluAttributes=e.leakyRelu=e.identity=e.floor=e.exp=e.parseEluAttributes=e.elu=e.cos=e.ceil=e.clipV11=e.parseClipAttributes=e.clip=e.atan=e.asin=e.acos=e.abs=e.glslTanh=e.glslTan=e.glslSqrt=e.glslSigmoid=e.glslRelu=e.glslSin=e.glslNot=e.glslNeg=e.glslLog=e.glslLeakyRelu=e.glslIdentity=e.glslClip=e.glslFloor=e.glslExp=e.glslElu=e.glslCos=e.glslCeil=e.glslAtan=e.glslAsin=e.glslAcos=e.glslAbs=void 0;const r=n(246),i=n(2517),o=n(8520),a=n(5060),s=n(2039);function u(){return P(\"abs\")}function c(){return P(\"acos\")}function l(){return P(\"asin\")}function p(){return P(\"atan\")}function f(){return P(\"ceil\")}function d(){return P(\"cos\")}function h(t){const e=\"elu\";return{body:`\\n const float alpha = float(${t});\\n\\n float ${e}_(float a) {\\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\\n }\\n vec4 ${e}_(vec4 v) {\\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\\n }\\n `,name:e,type:o.FunctionType.ValueBased}}function g(){return P(\"exp\")}function b(){return P(\"floor\")}function m(t,e){const n=\"clip\";return{body:`\\n const float min = float(${t});\\n const float max = float(${e});\\n\\n float ${n}_(float a) {\\n return clamp(a, min, max);\\n }\\n vec4 ${n}_(vec4 v) {\\n return clamp(v, min, max);\\n }\\n `,name:n,type:o.FunctionType.ValueBased}}function y(){const t=\"indentity\";return{body:`\\n float ${t}_(float a) {\\n return a;\\n }\\n vec4 ${t}_(vec4 v) {\\n return v;\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function _(t){const e=\"leakyRelu\";return{body:`\\n const float alpha = float(${t});\\n\\n float ${e}_(float a) {\\n return a < 0.0 ? a * alpha : a;\\n }\\n vec4 ${e}_(vec4 v) {\\n return vec4(${e}_(v.x), ${e}_(v.y), ${e}_(v.z), ${e}_(v.w));\\n }\\n `,name:e,type:o.FunctionType.ValueBased}}function v(){return P(\"log\")}function w(){const t=\"neg\";return{body:`\\n float ${t}_(float a) {\\n return -a;\\n }\\n vec4 ${t}_(vec4 v) {\\n return -v;\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function x(){const t=\"not\";return{body:`\\n float ${t}_(float a) {\\n return float( ! bool(a) );\\n }\\n bool ${t}_(bool a) {\\n return !a;\\n }\\n vec4 ${t}_(vec4 v) {\\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\\n }\\n bvec4 ${t}_(bvec4 v) {\\n return bvec4(!v.x, !v.y, !v.z, !v.w);\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function T(){return P(\"sin\")}function S(){const t=\"relu\";return{body:`\\n float ${t}_(float a) {\\n return max( a, 0.0 );\\n }\\n vec4 ${t}_(vec4 v) {\\n return max( v, 0.0 );\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function O(){const t=\"sigmoid\";return{body:`\\n float ${t}_(float a) {\\n return 1.0 / (1.0 + exp(-a));\\n }\\n vec4 ${t}_(vec4 v) {\\n return 1.0 / (1.0 + exp(-v));\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function A(){return P(\"sqrt\")}function E(){return P(\"tan\")}function I(){const t=\"tanh\";return{body:`\\n float ${t}_(float a) {\\n a = clamp(a, -10., 10.);\\n a = exp(2.*a);\\n return (a - 1.) / (a + 1.);\\n }\\n vec4 ${t}_(vec4 v) {\\n v = clamp(v, -10., 10.);\\n v = exp(2.*v);\\n return (v - 1.) / (v + 1.);\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}function P(t){return{body:`\\n float ${t}_(float a) {\\n return ${t}(a);\\n }\\n vec4 ${t}_(vec4 v) {\\n return ${t}(v);\\n }\\n `,name:t,type:o.FunctionType.ValueBased}}e.glslAbs=u,e.glslAcos=c,e.glslAsin=l,e.glslAtan=p,e.glslCeil=f,e.glslCos=d,e.glslElu=h,e.glslExp=g,e.glslFloor=b,e.glslClip=m,e.glslIdentity=y,e.glslLeakyRelu=_,e.glslLog=v,e.glslNeg=w,e.glslNot=x,e.glslSin=T,e.glslRelu=S,e.glslSigmoid=O,e.glslSqrt=A,e.glslTan=E,e.glslTanh=I;const D=(t,e,n,r)=>{const i=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,o={name:n.name,inputTypes:[i],inputNames:[\"A\"],cacheHint:r};return Object.assign(Object.assign({},o),{get:()=>((t,e,n,r)=>{const i=t.session.pack?s.TextureType.packed:s.TextureType.unpacked,o=(0,a.getGlsl)(t.session.backend.glContext.version);return Object.assign(Object.assign({},e),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:`\\n ${r.body}\\n void main() {\\n vec4 v = ${o.texture2D}(A, TexCoords);\\n v = ${r.name}_(v);\\n ${o.output} = v;\\n }\\n `,hasMain:!0})})(t,o,e,n)})};e.abs=(t,e)=>[t.run(D(t,e[0],u()),e)],e.acos=(t,e)=>[t.run(D(t,e[0],c()),e)],e.asin=(t,e)=>[t.run(D(t,e[0],l()),e)],e.atan=(t,e)=>[t.run(D(t,e[0],p()),e)],e.clip=(t,e,n)=>[t.run(D(t,e[0],m(n.min,n.max),n.cacheKey),e)],e.parseClipAttributes=t=>(0,r.createAttributeWithCacheKey)({min:t.attributes.getFloat(\"min\",i.MIN_CLIP),max:t.attributes.getFloat(\"max\",i.MAX_CLIP)}),e.clipV11=(t,n)=>{const r=$(t,n);return(0,e.clip)(t,[n[0]],r)};const $=(t,e)=>{if(e.length>=3&&(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)))throw new Error(\"dynamic clip attributes are not allowed\");const n=e.length>=3?e[1].numberData[0]:i.MIN_CLIP,o=e.length>=3?e[2].numberData[0]:i.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:o})};e.ceil=(t,e)=>[t.run(D(t,e[0],f()),e)],e.cos=(t,e)=>[t.run(D(t,e[0],d()),e)],e.elu=(t,e,n)=>[t.run(D(t,e[0],h(n.alpha),n.cacheKey),e)],e.parseEluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat(\"alpha\",1)}),e.exp=(t,e)=>[t.run(D(t,e[0],g()),e)],e.floor=(t,e)=>[t.run(D(t,e[0],b()),e)],e.identity=(t,e)=>[t.run(D(t,e[0],y()),e)],e.leakyRelu=(t,e,n)=>[t.run(D(t,e[0],_(n.alpha),n.cacheKey),e)],e.parseLeakyReluAttributes=t=>(0,r.createAttributeWithCacheKey)({alpha:t.attributes.getFloat(\"alpha\",.01)}),e.log=(t,e)=>[t.run(D(t,e[0],v()),e)],e.neg=(t,e)=>[t.run(D(t,e[0],w()),e)],e.not=(t,e)=>[t.run(D(t,e[0],x()),e)],e.relu=(t,e)=>[t.run(D(t,e[0],S()),e)],e.sigmoid=(t,e)=>[t.run(D(t,e[0],O()),e)],e.sin=(t,e)=>[t.run(D(t,e[0],T()),e)],e.sqrt=(t,e)=>[t.run(D(t,e[0],A()),e)],e.tan=(t,e)=>[t.run(D(t,e[0],E()),e)],e.tanh=(t,e)=>[t.run(D(t,e[0],I()),e)]},5611:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createUnpackProgramInfoLoader=e.createUnpackProgramInfo=void 0;const r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:\"unpack\",inputNames:[\"A\"],inputTypes:[i.TextureType.packed]};e.createUnpackProgramInfo=(t,e)=>{const n=e.dims.length,u=(0,a.getChannels)(\"rc\",n),c=u.slice(-2),l=(0,o.getCoordsDataType)(n),p=(0,a.unpackFromChannel)(),f=0===e.dims.length?\"\":function(t,e){if(1===t)return\"rc\";let n=\"\";for(let r=0;rObject.assign(Object.assign({},s),{get:()=>(0,e.createUnpackProgramInfo)(t,n)})},8428:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseUnsqueezeAttributes=e.unsqueezeV13=e.unsqueeze=void 0;const r=n(2517);e.unsqueeze=(t,e,n)=>{i(e);const o=r.ShapeUtil.unsqueezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],o)]},e.unsqueezeV13=(t,n)=>(o(n),(0,e.unsqueeze)(t,[n[0]],Array.from(n[1].integerData))),e.parseUnsqueezeAttributes=t=>t.attributes.getInts(\"axes\");const i=t=>{if(!t||1!==t.length)throw new Error(\"Unsqueeze requires 1 input.\");if(\"string\"===t[0].type)throw new Error(\"invalid input tensor types.\")},o=t=>{if(!t||2!==t.length)throw new Error(\"Unsqueeze requires 2 inputs.\");if(\"int32\"!==t[1].type)throw new Error(\"Invalid input type.\")}},9793:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;const r=n(246),i=n(5060),o=n(2039),a={name:\"Upsample\",inputNames:[\"X\"],inputTypes:[o.TextureType.unpacked]};e.upsample=(t,n,r)=>((0,e.validateInputs)(n,r),[t.run(Object.assign(Object.assign({},a),{cacheHint:r.cacheKey,get:()=>s(t,n,r)}),n)]),e.parseUpsampleAttributesV7=t=>(0,e.parseUpsampleAttributes)(t,7),e.parseUpsampleAttributesV9=t=>(0,e.parseUpsampleAttributes)(t,9),e.parseUpsampleAttributes=(t,n)=>{const i=n>=10,o=t.attributes.getString(\"mode\",\"nearest\");if(\"nearest\"!==o&&\"linear\"!==o&&(n<11||\"cubic\"!==o))throw new Error(`unrecognized mode: ${o}`);let a=[];n<9&&(a=t.attributes.getFloats(\"scales\"),(0,e.scalesValidation)(a,o,i));const s=t.attributes.getFloat(\"extrapolation_value\",0),u=n>10?t.attributes.getString(\"coordinate_transformation_mode\",\"half_pixel\"):\"asymmetric\";if(-1===[\"asymmetric\",\"pytorch_half_pixel\",\"tf_half_pixel_for_nn\",\"align_corners\",\"tf_crop_and_resize\",\"half_pixel\"].indexOf(u))throw new Error(`coordinate_transform_mode '${u}' is not supported`);const c=\"tf_crop_and_resize\"===u,l=c,p=\"nearest\"===o&&n>=11?t.attributes.getString(\"nearest_mode\",\"round_prefer_floor\"):\"\";if(-1===[\"round_prefer_floor\",\"round_prefer_ceil\",\"floor\",\"ceil\",\"\"].indexOf(p))throw new Error(`nearest_mode '${p}' is not supported`);const f=t.attributes.getFloat(\"cubic_coeff_a\",-.75),d=0!==t.attributes.getInt(\"exclude_outside\",0);if(d&&\"cubic\"!==o)throw new Error(\"exclude_outside can be set to 1 only when mode is CUBIC.\");const h=n<11||\"nearest\"===o&&\"asymmetric\"===u&&\"floor\"===p;let g=0,b=0,m=0;return n>10?t.inputs.length>2?(g=1,b=2,m=3):(b=1,m=2):9===n&&(b=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:i,mode:o,scales:a,extrapolationValue:s,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:p,cubicCoefficientA:f,excludeOutside:d,useNearest2xOptimization:h,roiInputIdx:g,scalesInputIdx:b,sizesInputIdx:m})};const s=(t,e,n)=>{const r=(0,i.getGlsl)(t.session.backend.glContext.version),[s,u]=t.calculateTextureWidthAndHeight(e[0].dims,o.TextureType.unpacked),c=e[0].dims.map(((t,e)=>Math.floor(t*n.scales[e]))),[l,p]=t.calculateTextureWidthAndHeight(c,o.TextureType.unpacked),f=c.length,d=new Array(f),h=new Array(f);let g=`\\n int output_pitches[${f}];\\n int input_pitches[${f}];\\n `;for(let t=f-1;t>=0;t--)d[t]=t===f-1?1:d[t+1]*c[t+1],h[t]=t===f-1?1:h[t+1]*e[0].dims[t+1],g+=`\\n output_pitches[${t}] = ${d[t]};\\n input_pitches[${t}] = ${h[t]};\\n `;const b=`\\n float getInputFloat(int index) {\\n vec2 coords = offsetToCoords(index, ${s}, ${u});\\n float value = getColorAsFloat(${r.texture2D}(X, coords));\\n return value;\\n }\\n `,m=\"nearest\"===n.mode?`\\n ${b}\\n float process(int indices[${f}]) {\\n int input_index = 0;\\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\\n\\n ${g}\\n\\n int d, m;\\n for (int dim = 0; dim < ${f}; ++dim) {\\n d = output_index / output_pitches[dim];\\n m = output_index - d * output_pitches[dim];\\n output_index = m;\\n\\n if (scales[dim] != 1 && d > 0) {\\n int d2 = d / scales[dim];\\n m = d - d2 * scales[dim];\\n d = d2;\\n }\\n input_index += input_pitches[dim] * d;\\n }\\n\\n return getInputFloat(input_index);\\n }`:4===f?`\\n ${b}\\n float process(int indices[4]) {\\n int input_index = 0;\\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\\n\\n ${g}\\n\\n int m;\\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\\n index_of_dim0 = output_index / output_pitches[0];\\n m = output_index - index_of_dim0 * output_pitches[0];\\n index_of_dim1 = m / output_pitches[1];\\n m = m - index_of_dim1 * output_pitches[1];\\n index_of_dim2 = m / output_pitches[2];\\n m = m - index_of_dim2 * output_pitches[2];\\n index_of_dim3 = m;\\n\\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\\n index_of_input_dim2 = index_of_dim2 / scales[2];\\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\\n index_of_input_dim3 = index_of_dim3 / scales[3];\\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\\n\\n input_index = index_of_dim0 * input_pitches[0] +\\n index_of_dim1 * input_pitches[1] +\\n index_of_input_dim2 * input_pitches[2] +\\n index_of_input_dim3;\\n\\n float x00 = getInputFloat(input_index);\\n float x10, x01, x11;\\n\\n bool end_of_dim2 = false;\\n if (index_of_input_dim2 == (${e[0].dims[2]} - 1)) {\\n // It's the end in dimension 2\\n x01 = x00;\\n end_of_dim2 = true;\\n } else {\\n x01 = getInputFloat(input_index + input_pitches[2]);\\n }\\n\\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\\n // It's the end in dimension 3\\n x10 = x00;\\n x11 = x01;\\n }\\n else {\\n x10 = getInputFloat(input_index + 1);\\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\\n }\\n\\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\\n }`:`\\n ${b}\\n float process(int indices[2]) {\\n int input_index = 0;\\n int output_index = coordsToOffset(TexCoords, ${l}, ${p});\\n\\n ${g}\\n\\n int m;\\n int index_of_dim0, index_of_dim1;\\n index_of_dim0 = output_index / output_pitches[0];\\n m = output_index - index_of_dim0 * output_pitches[0];\\n index_of_dim1 = m;\\n\\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\\n index_of_input_dim0 = index_of_dim0 / scales[0];\\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\\n index_of_input_dim1 = index_of_dim1 / scales[1];\\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\\n\\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\\n\\n float x00 = getInputFloat(input_index);\\n float x10, x01, x11;\\n\\n bool end_of_dim0 = false;\\n if (index_of_input_dim0 == (${e[0].dims[0]} - 1)) {\\n // It's the end in dimension 0\\n x01 = x00;\\n end_of_dim0 = true;\\n } else {\\n x01 = getInputFloat(input_index + input_pitches[0]);\\n }\\n\\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\\n // It's the end in dimension 1\\n x10 = x00;\\n x11 = x01;\\n }\\n else {\\n x10 = getInputFloat(input_index + 1);\\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\\n }\\n\\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\\n }`;return Object.assign(Object.assign({},a),{output:{dims:c,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:m,variables:[{name:\"scales\",type:\"int\",arrayLength:n.scales.length,data:n.scales.map((t=>Math.ceil(t)))}]})};e.validateInputs=(t,e)=>{if(!t||e.opset<9&&1!==t.length||e.opset>=9&&e.opset<11&&2!==t.length||e.opset>=11&&t.length<2)throw new Error(\"invalid inputs.\");if(e.scales.length>0&&t[0].dims.length!==e.scales.length)throw new Error(\"Invalid input shape.\");if(\"string\"===t[0].type)throw new Error(\"Invalid input tensor types.\")},e.scalesValidation=(t,e,n)=>{if(n){for(const e of t)if(e<=0)throw new Error(\"Scale value should be greater than 0.\")}else for(const e of t)if(e<1)throw new Error(\"Scale value should be greater than or equal to 1.\");if(!(\"linear\"!==e&&\"cubic\"!==e||2===t.length||4===t.length&&1===t[0]&&1===t[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?\"Resize\":\"Upsample\"} opeartor.`)}},1958:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ProgramManager=void 0;const r=n(1670),i=n(6231),o=n(8879),a=n(5060);e.ProgramManager=class{constructor(t,e,n){this.profiler=t,this.glContext=e,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(t){return this.repo.get(t)}setArtifact(t,e){this.repo.set(t,e)}run(t,e,n){var r;this.profiler.event(\"op\",`ProgramManager.run ${null!==(r=t.programInfo.name)&&void 0!==r?r:\"unknown kernel\"}`,(()=>{var r;const o=this.glContext.gl,a=t.program;o.useProgram(a);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(t.attribLocations),this.bindUniforms(t.uniformLocations,null!==(r=t.programInfo.variables)&&void 0!==r?r:[],e)}catch(e){throw i.Logger.error(\"ProgramManager\",t.programInfo.shaderSource),e}this.profiler.event(\"backend\",\"GlContext.draw()\",(()=>{this.glContext.draw()}))}),this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((t=>this.glContext.deleteProgram(t.program)))}build(t,e,n){return this.profiler.event(\"backend\",\"ProgramManager.build\",(()=>{const r=new o.GlslPreprocessor(this.glContext,t,e,n),i=r.preprocess(),a=this.compile(i);return{programInfo:t,program:a,uniformLocations:this.getUniformLocations(a,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(a)}}))}compile(t){if(!this.vertexShader){i.Logger.verbose(\"ProrgramManager\",\"Compiling and caching Vertex shader for the first time\");const t=(0,a.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(t,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&i.Logger.verbose(\"ProrgramManager\",`FragShader:\\n${t}\\n`);const e=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,e);return this.glContext.deleteShader(e),n}bindOutput(t){const e=t.width,n=t.height;i.Logger.verbose(\"ProrgramManager\",`Binding output texture to Framebuffer: w/h=${e}/${n}, shape=${t.shape}, type=${t.tensor.type}`),this.glContext.attachFramebuffer(t.texture,e,n)}bindAttributes(t){const e=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(e,n),this.attributesBound=!0}bindUniforms(t,e,n){var r;const i=this.glContext.gl;let o=0;for(const{name:a,type:s,location:u,arrayLength:c}of t){const t=null===(r=e.find((t=>t.name===a)))||void 0===r?void 0:r.data;if(\"sampler2D\"!==s&&!t)throw new Error(`variable '${a}' does not have data defined in program info`);switch(s){case\"sampler2D\":this.bindTexture(n[o],u,o),o++;break;case\"float\":c?i.uniform1fv(u,t):i.uniform1f(u,t);break;case\"int\":c?i.uniform1iv(u,t):i.uniform1i(u,t);break;default:throw new Error(`Uniform not implemented: ${s}`)}}}bindTexture(t,e,n){this.glContext.bindTextureToUniform(t.texture,n,e)}getAttribLocations(t){return{position:this.getAttribLocation(t,\"position\"),textureCoord:this.getAttribLocation(t,\"textureCoord\")}}getUniformLocations(t,e,n){const r=[];if(e)for(const n of e)r.push({name:n,type:\"sampler2D\",location:this.getUniformLocation(t,n)});if(n)for(const e of n)r.push(Object.assign(Object.assign({},e),{location:this.getUniformLocation(t,e.name)}));return r}getUniformLocation(t,e){const n=this.glContext.gl.getUniformLocation(t,e);if(null===n)throw new Error(`Uniform ${e} not found.`);return n}getAttribLocation(t,e){return this.glContext.gl.getAttribLocation(t,e)}}},6416:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLSessionHandler=void 0;const r=n(6231),i=n(1047),o=n(8316),a=n(1640),s=n(1958),u=n(7859),c=n(5702);e.WebGLSessionHandler=class{constructor(t,e){this.backend=t,this.context=e,this.layoutStrategy=new u.PreferLogicalStrategy(t.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:\"full\"===t.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new o.WebGLInferenceHandler(this)}onGraphInitialized(t){const e=t.getValues().filter((t=>-1===t.from&&t.tensor)).map((t=>t.tensor.dataId));this.initializers=new Set(e)}isInitializer(t){return!!this.initializers&&this.initializers.has(t)}addInitializer(t){this.initializers.add(t)}getTextureData(t,e){return e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,e,n=!1){r.Logger.verbose(\"WebGLSessionHandler\",\"Storing Texture data in cache\"),n?this.packedTextureDataCache.set(t,e):this.unpackedTextureDataCache.set(t,e)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((t=>this.textureManager.releaseTexture(t,!0))),this.unpackedTextureDataCache=new Map}resolve(t,e,n){const r=(0,i.resolveOperator)(t,e,a.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(t,n):t}}}},7769:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;const r=n(6231);e.RedFloat32DataEncoder=class{constructor(t,e=1){if(1===e)this.internalFormat=t.R32F,this.format=t.RED,this.textureType=t.FLOAT,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA32F,this.format=t.RGBA,this.textureType=t.FLOAT,this.channelSize=e}}encode(t,e){let n,i;return t.constructor!==Float32Array&&(r.Logger.warning(\"Encoder\",\"data was not of type Float32; creating new Float32Array\"),i=new Float32Array(t)),e*this.channelSize>t.length?(r.Logger.warning(\"Encoder\",\"Source data too small. Allocating larger array\"),i=t,n=this.allocate(e*this.channelSize),i.forEach(((t,e)=>n[e]=t))):(i=t,n=i),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.RGBAFloatDataEncoder=class{constructor(t,e=1,n){if(1!==e&&4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.channelSize=e,this.textureType=n||t.FLOAT}encode(t,e){let n=t;return 1===this.channelSize&&(r.Logger.verbose(\"Encoder\",\"Exploding into a larger array\"),n=this.allocate(e),t.forEach(((t,e)=>n[4*e]=t))),n}allocate(t){return new Float32Array(4*t)}decode(t,e){return 1===this.channelSize?t.filter(((t,e)=>e%4==0)).subarray(0,e):t.subarray(0,e)}},e.Uint8DataEncoder=class{constructor(t,e=1){if(this.channelSize=4,1===e)this.internalFormat=t.ALPHA,this.format=t.ALPHA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e;else{if(4!==e)throw new Error(`Invalid number of channels: ${e}`);this.internalFormat=t.RGBA,this.format=t.RGBA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e}}encode(t,e){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}allocate(t){return new Uint8Array(t*this.channelSize)}decode(t,e){if(t instanceof Uint8Array)return t.subarray(0,e);throw new Error(`Invalid array type: ${t.constructor}`)}}},7859:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),i=n(2517);function o(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,o=null==e||i?null:a(e,t).sort();let s=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),r.push(e)),o[s]<=e&&s++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}}function a(t,e){const n=e.length;return t=null==t?e.map(((t,e)=>e)):[].concat(t),(0,i.assert)(t.every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),(0,i.assert)(t.every(s),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function s(t){return t%1==0}function u(t){if(0===t.length)return 1;let e=t[0];for(let n=1;n=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(i>n||o>n))return[i,o];r.Logger.verbose(\"TextureLayout\",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}const i=t.reduce(((t,e)=>t*e));let o=Math.floor(Math.sqrt(i));for(;o=n||i%o!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${t}`);return[o,i/o]}},e.PreferLogicalStrategy=class{constructor(t){this.maxTextureSize=t}computeTextureWH(t,e){const n=this.computeTexture(t,e);return e&&e.isPacked&&(n[0]/=2,n[1]/=2),e&&e.reverseWH?[n[1],n[0]]:n}computeTexture(t,e){const n=e&&e.isPacked;if(0===t.length)return n?[2,2]:[1,1];let i=this.maxTextureSize;if(e&&void 0!==e.breakAxis){const n=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce(((t,e)=>t*e)),o=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce(((t,e)=>t*e));if(!(n>i||o>i))return[n,o];r.Logger.verbose(\"TextureLayout\",`Given width/height preferences were unattainable: shape:${t}, breakAxis:${e.breakAxis}`)}let a=t.slice(0);if(n&&(i*=2,a=a.map(((t,e)=>e>=a.length-2?a[e]%2==0?a[e]:a[e]+1:a[e])),1===a.length&&(a=[2,a[0]])),2!==a.length){const t=o(a);a=t.newShape}const s=u(a);return a.length<=1&&s<=i?[1,s]:2===a.length&&a[0]<=i&&a[1]<=i?a:3===a.length&&a[0]*a[1]<=i&&a[2]<=i?[a[0]*a[1],a[2]]:3===a.length&&a[0]<=i&&a[1]*a[2]<=i?[a[0],a[1]*a[2]]:4===a.length&&a[0]*a[1]*a[2]<=i&&a[3]<=i?[a[0]*a[1]*a[2],a[3]]:4===a.length&&a[0]<=i&&a[1]*a[2]*a[3]<=i?[a[0],a[1]*a[2]*a[3]]:n?c(s/4).map((t=>2*t)):c(s)}},e.squeezeShape=o,e.parseAxisParam=a,e.isInt=s,e.sizeFromShape=u,e.getRowsCols=function(t){if(0===t.length)throw Error(\"Cannot get rows and columns of an empty shape array.\");return[t.length>1?t[t.length-2]:1,t[t.length-1]]},e.sizeToSquarishShape=c,e.getBatchDim=function(t,e=2){return u(t.slice(0,t.length-e))}},4057:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;const r=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=(t,n,r)=>{const o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,a=r===i.TextureType.packed,s=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,c=r===i.TextureType.packedLastDimension?n.map(((t,e)=>e===n.length-1?4*t:t)):void 0;return(0,e.createTextureLayoutFromShape)(t,n,o,c,{isPacked:a,reverseWH:s,breakAxis:u})},e.calculateTextureWidthAndHeight=(t,n,r)=>{const i=(0,e.createTextureLayoutFromTextureType)(t,n,r);return[i.width,i.height]},e.createTextureLayoutFromShape=(t,e,n=1,i,o)=>{const a=!(!o||!o.isPacked),[s,u]=t.computeTextureWH(a&&i||e,o),c=e.length;let l=e.slice(0);if(0===c&&(l=[1]),1===n)i=e;else if(a){if(4!==n)throw new Error(\"a packed texture must be 4-channel\");i=e,c>0&&(l[c-1]=Math.ceil(l[c-1]/2)),c>1&&(l[c-2]=Math.ceil(l[c-2]/2))}else if(!i)throw new Error(\"Unpacked shape is needed when using channels > 1\");return{width:s,height:u,channels:n,isPacked:a,shape:l,strides:r.ShapeUtil.computeStrides(l),unpackedShape:i,reversedWH:o&&o.reverseWH}}},5702:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.TextureManager=void 0;const r=n(6231);e.TextureManager=class{constructor(t,e,n,r){this.glContext=t,this.layoutStrategy=e,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(t,e,n,i){const o=this.toEncoderType(t),a=this.glContext.getEncoder(o,e.channels||1,i);if(e.isPacked&&1===i)throw new Error(\"not implemented\");const s=e.width,u=e.height;let c,l;if(this.config.reuseTextures){c=`${s}x${u}_${a.format}_${a.internalFormat}_${a.textureType}`,l=this.inUseTextures.get(c),l||(l=[],this.inUseTextures.set(c,l));const e=this.idleTextures.get(c);if(e&&e.length>0){const r=e.pop();return l.push(r),1===i&&this.glContext.updateTexture(r,s,u,a,this.toTextureData(t,n)),r}}r.Logger.verbose(\"TextureManager\",`Creating new texture of size ${e.width}x${e.height}`);const p=this.glContext.allocateTexture(s,u,a,this.toTextureData(t,n));return this.config.reuseTextures&&(l.push(p),this.textureLookup.set(p,c)),p}readTexture(t,e,n){return n||(n=1),this.profiler.event(\"backend\",\"TextureManager.readTexture\",(()=>{const r=t.shape.reduce(((t,e)=>t*e))*n,i=this.glContext.readTexture(t.texture,t.width,t.height,r,this.toEncoderType(e),n);return this.toTensorData(e,i)}))}async readTextureAsync(t,e,n){const r=t.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const t=this.pendingRead.get(r);return new Promise((e=>null==t?void 0:t.push(e)))}return this.profiler.event(\"backend\",\"TextureManager.readTextureAsync\",(async()=>{this.pendingRead.set(r,[]);const i=t.shape.reduce(((t,e)=>t*e))*n;await this.glContext.createAndWaitForFence();const o=this.glContext.readTexture(t.texture,t.width,t.height,i,this.toEncoderType(e),n),a=this.toTensorData(e,o),s=this.pendingRead.get(r);return this.pendingRead.delete(r),null==s||s.forEach((t=>t(a))),a}))}readUint8TextureAsFloat(t){return this.profiler.event(\"backend\",\"TextureManager.readUint8TextureAsFloat\",(()=>{const e=t.shape.reduce(((t,e)=>t*e)),n=this.glContext.readTexture(t.texture,t.width,t.height,4*e,\"byte\",4);return new Float32Array(n.buffer,n.byteOffset,e)}))}releaseTexture(t,e){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture),n)){e&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const e=r.indexOf(t.texture);if(-1!==e){r.splice(e,1);let i=this.idleTextures.get(n);i||(i=[],this.idleTextures.set(n,i)),i.push(t.texture)}}}n&&!e||(r.Logger.verbose(\"TextureManager\",`Deleting texture of size ${t.width}x${t.height}`),this.glContext.deleteTexture(t.texture))}toTensorData(t,e){switch(t){case\"int16\":return e instanceof Int16Array?e:Int16Array.from(e);case\"int32\":return e instanceof Int32Array?e:Int32Array.from(e);case\"int8\":return e instanceof Int8Array?e:Int8Array.from(e);case\"uint16\":return e instanceof Uint16Array?e:Uint16Array.from(e);case\"uint32\":return e instanceof Uint32Array?e:Uint32Array.from(e);case\"uint8\":case\"bool\":return e instanceof Uint8Array?e:Uint8Array.from(e);case\"float32\":return e instanceof Float32Array?e:Float32Array.from(e);case\"float64\":return e instanceof Float64Array?e:Float64Array.from(e);default:throw new Error(`TensorData type ${t} is not supported`)}}toTextureData(t,e){if(e)return e instanceof Float32Array?e:new Float32Array(e)}toEncoderType(t){return\"float\"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(t,e)=>{\"use strict\";var n;Object.defineProperty(e,\"__esModule\",{value:!0}),e.TextureType=void 0,(n=e.TextureType||(e.TextureType={}))[n.unpacked=0]=\"unpacked\",n[n.unpackedReversed=1]=\"unpackedReversed\",n[n.packed=2]=\"packed\",n[n.downloadUint8AsFloat=3]=\"downloadUint8AsFloat\",n[n.packedLastDimension=4]=\"packedLastDimension\"},9390:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;const r=n(2517);e.getPackedShape=function(t){const e=t.length;return t.slice(0,e-1).concat(t[e-1]/4)},e.repeatedTry=async function(t,e=(t=>0),n){return new Promise(((r,i)=>{let o=0;const a=()=>{if(t())return void r();o++;const s=e(o);null!=n&&o>=n?i():setTimeout(a,s)};a()}))},e.generateShaderFuncNameFromInputSamplerName=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>\"empty string found for sampler name\")),\"get\"+t.charAt(0).toUpperCase()+t.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t){return(0,r.assert)(void 0!==t&&0!==t.length,(()=>\"empty string found for sampler name\")),\"get\"+t.charAt(0).toUpperCase()+t.slice(1)+\"AtOutCoords\"},e.squeezeInputShape=function(t,e){let n=JSON.parse(JSON.stringify(t));return n=e,n},e.getSqueezedParams=function(t,e){return e.map((e=>t[e])).join(\", \")},e.getCoordsDataType=function(t){if(t<=1)return\"int\";if(2===t)return\"ivec2\";if(3===t)return\"ivec3\";if(4===t)return\"ivec4\";if(5===t)return\"ivec5\";if(6===t)return\"ivec6\";throw Error(`GPU for rank ${t} is not yet supported`)},e.getGlChannels=function(t=6){return[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"].slice(0,t)}},7305:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;const r=n(6231),i=n(1713),o={};function a(t){const e=function(){if(\"undefined\"==typeof document){if(\"undefined\"==typeof OffscreenCanvas)throw new TypeError(\"failed to create canvas: OffscreenCanvas is not supported\");return new OffscreenCanvas(1,1)}const t=document.createElement(\"canvas\");return t.width=1,t.height=1,t}();let n;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t||\"webgl2\"===t)&&(n=e.getContext(\"webgl2\",o),n))try{return new i.WebGLContext(n,2)}catch(t){r.Logger.warning(\"GlContextFactory\",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!t||\"webgl\"===t)&&(n=e.getContext(\"webgl\",o)||e.getContext(\"experimental-webgl\",o),n))try{return new i.WebGLContext(n,1)}catch(t){r.Logger.warning(\"GlContextFactory\",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error(\"WebGL is not supported\")}e.createWebGLContext=function t(e){let n;e&&\"webgl2\"!==e||!(\"webgl2\"in o)?e&&\"webgl\"!==e||!(\"webgl\"in o)||(n=o.webgl):n=o.webgl2,n=n||a(e),e=e||1===n.version?\"webgl\":\"webgl2\";const r=n.gl;return o[e]=n,r.isContextLost()?(delete o[e],t(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},e.createNewWebGLContext=a},1713:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;const a=n(1670),s=o(n(7769)),u=n(9390);function c(t){let e=0;for(;ethis.isTimerResultAvailable(t))),this.getTimerResult(t)}async createAndWaitForFence(){const t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e;const n=t,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),e=null===r?()=>!0:()=>{const t=n.clientWaitSync(r,0,0);return t===n.ALREADY_SIGNALED||t===n.CONDITION_SATISFIED},{query:r,isFencePassed:e}}async pollFence(t){return new Promise((e=>{this.addItemToPoll((()=>t.isFencePassed()),(()=>e()))}))}pollItems(){const t=c(this.itemsToPoll.map((t=>t.isDoneFn)));for(let e=0;e<=t;++e){const{resolveFn:t}=this.itemsToPoll[e];t()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}async addItemToPoll(t,e){this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||await(0,u.repeatedTry)((()=>(this.pollItems(),0===this.itemsToPoll.length)))}}},1036:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ExecutionPlan=void 0;const r=n(6231);class i{constructor(t,e){this.op=t,this.node=e}}e.ExecutionPlan=class{constructor(t,e,n){this.graph=t,this.profiler=n,this.initialize(e)}initialize(t){this.profiler.event(\"session\",\"ExecutionPlan.initialize\",(()=>{const e=this.graph.getNodes();if(e.length!==t.length)throw new Error(\"The size of nodes and OPs do not match.\");this._ops=t.map(((t,n)=>new i(t,e[n]))),this.reset(),this._starter=[],this._ops.forEach(((t,e)=>{let n=!0;for(const e of t.node.inputs)if(!this._values[e]&&-1===this.graph.getInputIndices().indexOf(e)){n=!1;break}n&&this._starter.push(e)}))}))}reset(){this._values=this.graph.getValues().map((t=>t.tensor))}async execute(t,e){return this.profiler.event(\"session\",\"ExecutionPlan.execute\",(async()=>{this.reset();const n=t.createInferenceHandler(),i=this.graph.getInputIndices();if(e.length!==i.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${e.length} expected: ${i.length}`);e.forEach(((t,e)=>{const n=i[e];this._values[n]=t}));const o=this._starter.slice(0),a=this.graph.getValues(),s=this.graph.getNodes();let u=0;for(;uthis._values[t]));if(-1!==i.indexOf(void 0))throw new Error(`unresolved input detected: op: ${e.node}`);const c=i;r.Logger.verbose(\"ExecPlan\",`Runing op:${e.node.name} (${c.map(((t,n)=>`'${e.node.inputs[n]}': ${t.type}[${t.dims.join(\",\")}]`)).join(\", \")})`);const l=await this.profiler.event(\"node\",e.node.name,(async()=>e.op.impl(n,c,e.op.context)));if(l.length!==e.node.outputs.length)throw new Error(\"the size of output does not match model definition.\");l.forEach(((t,n)=>{const r=e.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${e.node.name}`);this._values[r]=t}));const p=new Set;l.forEach(((t,n)=>{const r=e.node.outputs[n];for(const t of a[r].to){const e=s[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&p.add(t)}})),o.push(...p)}const c=[];for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Graph=void 0;const r=n(1446),i=n(7778),o=n(9395),a=n(9162),s=n(2517);var u=o.onnxruntime.experimental.fbs;e.Graph={from:(t,e)=>new p(t,e)};class c{constructor(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(t.type.tensorType))}get from(){return this._from}get to(){return this._to}}class l{constructor(t,e){t instanceof r.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new i.Attribute(t.attribute)):t instanceof u.Node&&(this.name=null!=e?e:t.name(),this.opType=t.opType(),this.attributes=new i.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class p{constructor(t,e){if(!t)throw new TypeError(\"graph is empty\");this.buildGraph(t),this.transformGraph(e),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(t){if(t instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else{if(!(t instanceof u.Graph))throw new TypeError(\"Graph type is not supported.\");this.buildGraphFromOrtFormat(t)}}buildGraphFromOnnxFormat(t){const e=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!t.input)throw new Error(\"missing information in graph: input\");const r=[];for(const n of t.input){if(e.has(n.name))throw new Error(`duplicated input name: ${n.name}`);const t=this._allData.push(new c(n))-1;e.set(n.name,t),r.push(n.name)}if(!t.initializer)throw new Error(\"missing information in graph: initializer\");for(const n of t.initializer){let t=e.get(n.name);if(void 0===t){const r=new c;r.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(n.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(n.dataType)},t=this._allData.push(r)-1,e.set(n.name,t)}this._allData[t]._from=-1,this._allData[t].tensor=a.Tensor.fromProto(n)}for(let t=0;t{this._allData[e]._to.forEach((e=>{t.add(e)}))}));const e=Array.from(t),n=new Array(this._nodes.length).fill(\"white\");for(;e.length>0;){const t=e.pop();\"gray\"===n[t]?n[t]=\"black\":(e.push(t),n[t]=\"gray\",this._nodes[t].outputs.forEach((r=>{const i=this._allData[r];if(void 0!==i.tensor)throw new Error(\"node outputs should not be initialized\");if(i._from!==t)throw new Error(\"from property of the Value object doesn't match index of Node being processed\");i._to.forEach((t=>{if(\"gray\"===n[t])throw new Error(\"model graph is cyclic\");\"white\"===n[t]&&e.push(t)}))})))}}transformGraph(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let t=0;for(let e=0;e0&&(this._nodes[e].inputs.forEach((n=>{const r=this._allData[n]._to.indexOf(e+t);-1!==r&&(this._allData[n]._to[r]=e)})),this._nodes[e].outputs.forEach((n=>{this._allData[n]._from&&this._allData[n]._from===e+t&&(this._allData[n]._from=e)}))):(t++,this._nodes[e].outputs.forEach((t=>{this._allData[t]._from=-2})),this._nodes.splice(e,1),e--);t=0;for(let e=0;e0){let n=-1;void 0!==this._allData[e].from&&-1!==this._allData[e].from?(n=this._nodes[this._allData[e].from].outputs.indexOf(e+t),-1!==n&&(this._nodes[this._allData[e].from].outputs[n]=e)):(n=this._allInputIndices.indexOf(e+t),-1!==n&&(this._allInputIndices[n]=e)),this._allData[e].to.forEach((r=>{n=this._nodes[r].inputs.indexOf(e+t),-1!==n&&(this._nodes[r].inputs[n]=e)})),0===this._allData[e].to.length&&(n=this._allOutputIndices.indexOf(e+t),-1!==n&&(this._allOutputIndices[n]=e))}}else t++,this._allData.splice(e,1),e--}deleteNode(t){const e=this._nodes[t];if(e.outputs.length>1)for(let t=1;t0)throw new Error(\"Node deletion with more than one output connected to other nodes is not supported. \");e.executeNode=!1;const n=e.inputs[0],r=e.outputs[0],i=this._allData[r].to,o=this._allData[n].to.indexOf(t);if(-1===o)throw new Error(\"The Value object doesn't have the current Node in it's 'to' property \");this._allData[n].to.splice(o,1),this._allData[r]._to=[];const a=this._allOutputIndices.indexOf(r);if(-1!==a&&(this._allOutputIndices[a]=n),i&&i.length>0)for(const t of i){const e=this._nodes[t].inputs.indexOf(r);if(-1===e)throw new Error(\"The Node object doesn't have the output Value in it's 'inputs' property \");this._nodes[t].inputs[e]=n,this._allData[n].to.push(t)}}removeAllDropoutNodes(){let t=0;for(const e of this._nodes){if(\"Dropout\"===e.opType){if(1!==e.inputs.length)throw new Error(\"Dropout nodes should only contain one input. \");if(1!==e.outputs.length&&2!==e.outputs.length)throw new Error(\"Dropout nodes should contain either 1 or 2 output(s)\");if(2===e.outputs.length&&0!==this._allData[e.outputs[1]]._to.length)throw new Error(\"Dropout nodes's second output should not be referenced by other nodes\");this.deleteNode(t)}t++}}removeAllIdentityNodes(){let t=0;for(const e of this._nodes)\"Identity\"===e.opType&&this.deleteNode(t),t++}isActivation(t){switch(t.opType){case\"Relu\":case\"Sigmoid\":case\"Clip\":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if(\"Conv\"===t.opType){const e=this._allData[t.outputs[0]]._to;if(1===e.length&&this.isActivation(this._nodes[e[0]])){const n=this._nodes[e[0]];if(\"Clip\"===n.opType)if(1===n.inputs.length)try{t.attributes.set(\"activation_params\",\"floats\",[n.attributes.getFloat(\"min\"),n.attributes.getFloat(\"max\")])}catch(e){t.attributes.set(\"activation_params\",\"floats\",[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(n.inputs.length>=3&&void 0!==this._allData[n.inputs[1]].tensor&&void 0!==this._allData[n.inputs[2]].tensor))continue;t.attributes.set(\"activation_params\",\"floats\",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]])}t.attributes.set(\"activation\",\"string\",n.opType),this.deleteNode(e[0])}}}}},6231:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.now=e.Profiler=e.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(t,e,n){}},console:new class{log(t,e,n){console.log(`${this.color(t)} ${n?\"\u001b[35m\"+n+\"\u001b[0m \":\"\"}${e}`)}color(t){switch(t){case\"verbose\":return\"\u001b[34;40mv\u001b[0m\";case\"info\":return\"\u001b[32mi\u001b[0m\";case\"warning\":return\"\u001b[30;43mw\u001b[0m\";case\"error\":return\"\u001b[31;40me\u001b[0m\";case\"fatal\":return\"\u001b[101mf\u001b[0m\";default:throw new Error(`unsupported severity: ${t}`)}}}},i={provider:\"console\",minimalSeverity:\"warning\",logDateTime:!0,logSourceLocation:!1};let o={\"\":i};function a(t,e,n,r){if(void 0===e)return i=t,{verbose:a.verbose.bind(null,i),info:a.info.bind(null,i),warning:a.warning.bind(null,i),error:a.error.bind(null,i),fatal:a.fatal.bind(null,i)};if(void 0===n)s(t,e);else if(\"number\"==typeof n&&void 0===r)s(t,e);else if(\"string\"==typeof n&&void 0===r)s(t,n,0,e);else{if(\"string\"!=typeof n||\"number\"!=typeof r)throw new TypeError(\"input is valid\");s(t,n,0,e)}var i}function s(t,e,i,a){const s=o[a||\"\"]||o[\"\"];n[t]{a.then((async e=>{i&&await i.end(),t(e)}),(async t=>{i&&await i.end(),e(t)}))}));if(!o&&i){const t=i.end();if(t&&\"function\"==typeof t.then)return new Promise(((e,n)=>{t.then((()=>{e(a)}),(t=>{n(t)}))}))}return a}begin(t,n,r){if(!this._started)throw new Error(\"profiler is not started yet\");if(void 0===r){const r=(0,e.now)();return this.flush(r),new u(t,n,r,(t=>this.endSync(t)))}{const e=r.beginTimer();return new u(t,n,0,(async t=>this.end(t)),e,r)}}async end(t){const e=await t.checkTimer();this._timingEvents.length=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Model=void 0;const r=n(5686),i=n(1446),o=n(7070),a=n(9395),s=n(2517);var u=a.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(t,e,n){if(!n)try{return void this.loadFromOnnxFormat(t,e)}catch(t){if(void 0!==n)throw t}this.loadFromOrtFormat(t,e)}loadFromOnnxFormat(t,e){const n=i.onnx.ModelProto.decode(t);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error(\"only support ONNX model with IR_VERSION>=3\");this._opsets=n.opsetImport.map((t=>({domain:t.domain,version:s.LongUtil.longToNumber(t.version)}))),this._graph=o.Graph.from(n.graph,e)}loadFromOrtFormat(t,e){const n=new r.flatbuffers.ByteBuffer(t),i=u.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(i.irVersion())<3)throw new Error(\"only support ONNX model with IR_VERSION>=3\");this._opsets=[];for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=[\"float32\",\"float64\",\"int32\",\"int16\",\"int8\",\"uint16\",\"uint32\",\"uint8\"],e.INT_TYPES=[\"int32\",\"int16\",\"int8\",\"uint16\",\"uint32\",\"uint8\"],e.FLOAT_TYPES=[\"float32\",\"float64\"]},1047:(t,e)=>{\"use strict\";function n(t,e){if(e.endsWith(\"+\")){const n=Number.parseInt(e.substring(0,e.length-1),10);return!isNaN(n)&&n<=t}if(2===e.split(\"-\").length){const n=e.split(\"-\"),r=Number.parseInt(n[0],10),i=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(i)&&r<=t&&t<=i}return Number.parseInt(e,10)===t}Object.defineProperty(e,\"__esModule\",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t,e,r){for(const i of r){const r=i[0],o=i[1],a=i[2],s=i[3],u=i[4];if(t.opType===r)for(const t of e)if((t.domain===o||\"ai.onnx\"===t.domain&&\"\"===o)&&n(t.version,a))return{opImpl:s,opInit:u}}throw new TypeError(`cannot resolve operator '${t.opType}' with opsets: ${e.map((t=>`${t.domain||\"ai.onnx\"} v${t.version}`)).join(\", \")}`)}},9395:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.onnxruntime=void 0;const r=n(5686);var i,o;i=e.onnxruntime||(e.onnxruntime={}),function(t){let e;!function(t){t[t.UNDEFINED=0]=\"UNDEFINED\",t[t.FLOAT=1]=\"FLOAT\",t[t.INT=2]=\"INT\",t[t.STRING=3]=\"STRING\",t[t.TENSOR=4]=\"TENSOR\",t[t.GRAPH=5]=\"GRAPH\",t[t.FLOATS=6]=\"FLOATS\",t[t.INTS=7]=\"INTS\",t[t.STRINGS=8]=\"STRINGS\",t[t.TENSORS=9]=\"TENSORS\",t[t.GRAPHS=10]=\"GRAPHS\",t[t.SPARSE_TENSOR=11]=\"SPARSE_TENSOR\",t[t.SPARSE_TENSORS=12]=\"SPARSE_TENSORS\"}(e=t.AttributeType||(t.AttributeType={}))}((o=i.experimental||(i.experimental={})).fbs||(o.fbs={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNKNOWN=0]=\"UNKNOWN\",t[t.VALUE=1]=\"VALUE\",t[t.PARAM=2]=\"PARAM\"}(e=t.DimensionValueType||(t.DimensionValueType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.UNDEFINED=0]=\"UNDEFINED\",t[t.FLOAT=1]=\"FLOAT\",t[t.UINT8=2]=\"UINT8\",t[t.INT8=3]=\"INT8\",t[t.UINT16=4]=\"UINT16\",t[t.INT16=5]=\"INT16\",t[t.INT32=6]=\"INT32\",t[t.INT64=7]=\"INT64\",t[t.STRING=8]=\"STRING\",t[t.BOOL=9]=\"BOOL\",t[t.FLOAT16=10]=\"FLOAT16\",t[t.DOUBLE=11]=\"DOUBLE\",t[t.UINT32=12]=\"UINT32\",t[t.UINT64=13]=\"UINT64\",t[t.COMPLEX64=14]=\"COMPLEX64\",t[t.COMPLEX128=15]=\"COMPLEX128\",t[t.BFLOAT16=16]=\"BFLOAT16\"}(e=t.TensorDataType||(t.TensorDataType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.Primitive=0]=\"Primitive\",t[t.Fused=1]=\"Fused\"}(e=t.NodeType||(t.NodeType={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]=\"NONE\",t[t.tensor_type=1]=\"tensor_type\",t[t.sequence_type=2]=\"sequence_type\",t[t.map_type=3]=\"map_type\"}(e=t.TypeInfoValue||(t.TypeInfoValue={}))}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dim(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return n.startShape(t),n.addDim(t,e),n.endShape(t)}}e.Shape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}value(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,r){return n.startDimension(t),n.addValue(t,e),n.addDenotation(t,r),n.endDimension(t)}}e.Dimension=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):t.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(e,n){e.addFieldInt8(0,n,t.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,r,i){return n.startDimensionValue(t),n.addDimType(t,e),n.addDimValue(t,r),n.addDimParam(t,i),n.endDimensionValue(t)}}e.DimensionValue=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}shape(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,r){return n.startTensorTypeAndShape(t),n.addElemType(t,e),n.addShape(t,r),n.endTensorTypeAndShape(t)}}e.TensorTypeAndShape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}valueType(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,r){return n.startMapType(t),n.addKeyType(t,e),n.addValueType(t,r),n.endMapType(t)}}e.MapType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}elemType(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return n.startSequenceType(t),n.addElemType(t,e),n.endSequenceType(t)}}e.SequenceType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){(t.fbs||(t.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(t,e,n,r){return t.prep(4,12),t.writeInt32(r),t.writeInt32(n),t.writeInt32(e),t.offset()}}}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,r,i){return n.startNodeEdge(t),n.addNodeIndex(t,e),n.addInputEdges(t,r),n.addOutputEdges(t,i),n.endNodeEdge(t)}}e.NodeEdge=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(e,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(e,n){e.addFieldInt32(6,n,t.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,r,i,o,a,s,u,c,l,p,f,d,h){return n.startNode(t),n.addName(t,e),n.addDocString(t,r),n.addDomain(t,i),n.addSinceVersion(t,o),n.addIndex(t,a),n.addOpType(t,s),n.addType(t,u),n.addExecutionProviderType(t,c),n.addInputs(t,l),n.addOutputs(t,p),n.addAttributes(t,f),n.addInputArgCounts(t,d),n.addImplicitInputs(t,h),n.endNode(t)}}e.Node=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,r,i){return n.startValueInfo(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.endValueInfo(t)}}e.ValueInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(e,n){e.addFieldInt8(1,n,t.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,r,i){return n.startTypeInfo(t),n.addDenotation(t,e),n.addValueType(t,r),n.addValue(t,i),n.endTypeInfo(t)}}e.TypeInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,n,r){return e.startOperatorSetId(t),e.addDomain(t,n),e.addVersion(t,r),e.endOperatorSetId(t)}}t.OperatorSetId=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(e,n){e.addFieldInt32(3,n,t.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,r,i,o,a,s){return n.startTensor(t),n.addName(t,e),n.addDocString(t,r),n.addDims(t,i),n.addDataType(t,o),n.addRawData(t,a),n.addStringData(t,s),n.endTensor(t)}}e.Tensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}values(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,r,i){return n.startSparseTensor(t),n.addValues(t,e),n.addIndices(t,r),n.addDims(t,i),n.endSparseTensor(t)}}e.SparseTensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(e){let n=this.bb.__offset(this.bb_pos,16);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(e,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(e,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(e,n){e.addFieldInt32(2,n,t.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,r,i,o,a,s,u,c,l,p,f,d,h){return n.startAttribute(t),n.addName(t,e),n.addDocString(t,r),n.addType(t,i),n.addF(t,o),n.addI(t,a),n.addS(t,s),n.addT(t,u),n.addG(t,c),n.addFloats(t,l),n.addInts(t,p),n.addStrings(t,f),n.addTensors(t,d),n.addGraphs(t,h),n.endAttribute(t)}}e.Attribute=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}initializers(e,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(e,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(e,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(e,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,r,i,o,a,s,u,c){return n.startGraph(t),n.addInitializers(t,e),n.addNodeArgs(t,r),n.addNodes(t,i),n.addMaxNodeIndex(t,o),n.addNodeEdges(t,a),n.addInputs(t,s),n.addOutputs(t,u),n.addSparseInitializers(t,c),n.endGraph(t)}}e.Graph=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,r,i,o,a,s,u,c,l){return n.startModel(t),n.addIrVersion(t,e),n.addOpsetImport(t,r),n.addProducerName(t,i),n.addProducerVersion(t,o),n.addDomain(t,a),n.addModelVersion(t,s),n.addDocString(t,u),n.addGraph(t,c),n.addGraphDocString(t,l),n.endModel(t)}}e.Model=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,n){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,n,r){return e.startKernelCreateInfos(t),e.addNodeIndices(t,n),e.addKernelDefHashes(t,r),e.endKernelCreateInfos(t)}}t.KernelCreateInfos=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,r){return n.startSubGraphSessionState(t),n.addGraphId(t,e),n.addSessionState(t,r),n.endSubGraphSessionState(t)}}e.SubGraphSessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}kernels(e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(e,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,r){return n.startSessionState(t),n.addKernels(t,e),n.addSubGraphSessionStates(t,r),n.endSessionState(t)}}e.SessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"ORTM\")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,\"ORTM\")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,\"ORTM\",!0)}static createInferenceSession(t,e,r,i){return n.startInferenceSession(t),n.addOrtVersion(t,e),n.addModel(t,r),n.addSessionState(t,i),n.endInferenceSession(t)}}e.InferenceSession=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.OnnxjsSessionHandler=void 0;const r=n(1670),i=n(9162);e.OnnxjsSessionHandler=class{constructor(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t,e,n){const o=new Map;for(const e in t)if(Object.hasOwnProperty.call(t,e)){const n=t[e];o.set(e,new i.Tensor(n.dims,n.type,void 0,void 0,n.data))}const a=await this.session.run(o),s={};return a.forEach(((t,e)=>{s[e]=new r.Tensor(t.type,t.data,t.dims)})),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Session=void 0;const r=n(7067),i=n(1296),o=n(7091),a=n(1036),s=n(6231),u=n(2644);e.Session=class{constructor(t={}){this._initialized=!1,this.backendHint=t.backendHint,this.profiler=s.Profiler.create(t.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(t,e,n){await this.profiler.event(\"session\",\"Session.loadModel\",(async()=>{const a=await(0,o.resolveBackend)(this.backendHint);if(this.sessionHandler=a.createSessionHandler(this.context),this._model=new u.Model,\"string\"==typeof t){const e=t.endsWith(\".ort\");if(\"undefined\"==typeof fetch){const n=await(0,i.promisify)(r.readFile)(t);this.initialize(n,e)}else{const n=await fetch(t),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),e)}}else if(ArrayBuffer.isView(t))this.initialize(t);else{const r=new Uint8Array(t,e||0,n||t.byteLength);this.initialize(r)}}))}initialize(t,e){if(this._initialized)throw new Error(\"already initialized\");this.profiler.event(\"session\",\"Session.initialize\",(()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t,n,e),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new a.ExecutionPlan(this._model.graph,this._ops,this.profiler)})),this._initialized=!0}async run(t){if(!this._initialized)throw new Error(\"session not initialized yet\");return this.profiler.event(\"session\",\"Session.run\",(async()=>{const e=this.normalizeAndValidateInputs(t),n=await this._executionPlan.execute(this.sessionHandler,e);return this.createOutput(n)}))}normalizeAndValidateInputs(t){const e=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==e.length)throw new Error(`incorrect input array length: expected ${e.length} but got ${t.length}`)}else{if(t.size!==e.length)throw new Error(`incorrect input map size: expected ${e.length} but got ${t.size}`);const n=new Array(t.size);let r=0;for(let i=0;i\"string\"==typeof t))))throw new TypeError(\"cache should be a string array\");c&&(this.cache=new Array(s))}else{if(void 0!==o){const t=f(e);if(!(o instanceof t))throw new TypeError(`cache should be type ${t.name}`)}if(c){const t=new ArrayBuffer(s*function(t){switch(t){case\"bool\":case\"int8\":case\"uint8\":return 1;case\"int16\":case\"uint16\":return 2;case\"int32\":case\"uint32\":case\"float32\":return 4;case\"float64\":return 8;default:throw new Error(`cannot calculate sizeof() on type ${t}`)}}(e));this.cache=function(t,e){return new(f(e))(t)}(t,e)}}}static fromProto(t){if(!t)throw new Error(\"cannot construct Value from an empty tensor\");const e=u.ProtoUtil.tensorDataTypeFromProto(t.dataType),n=u.ProtoUtil.tensorDimsFromProto(t.dims),r=new l(n,e);if(\"string\"===e)t.stringData.forEach(((t,e)=>{r.data[e]=(0,u.decodeUtf8String)(t)}));else if(t.rawData&&\"number\"==typeof t.rawData.byteLength&&t.rawData.byteLength>0){const e=r.data,n=new DataView(t.rawData.buffer,t.rawData.byteOffset,t.rawData.byteLength),i=p(t.dataType),o=t.rawData.byteLength/i;if(t.rawData.byteLength%i!=0)throw new Error(\"invalid buffer length\");if(e.length!==o)throw new Error(\"buffer length mismatch\");for(let r=0;r0){const e=r.data,n=new DataView(t.rawDataArray().buffer,t.rawDataArray().byteOffset,t.rawDataLength()),i=p(t.dataType()),o=t.rawDataLength()/i;if(t.rawDataLength()%i!=0)throw new Error(\"invalid buffer length\");if(e.length!==o)throw new Error(\"buffer length mismatch\");for(let r=0;r1&&u>1)return;a[o-s]=Math.max(n,u)}return a}static index(t,e){const n=new Array(e.length);return c.fillIndex(t,e,n),n}static fillIndex(t,e,n){const r=t.length-e.length;for(let i=0;i=0;t--)r[t]=l%o[t],l=Math.floor(l/o[t]);d||(c.fillIndex(r,t.dims,i),p=t.get(i)),h||(c.fillIndex(r,e.dims,s),f=e.get(s)),u.set(r,n(p,f))}}return u}}static isValidBroadcast(t,e){const n=t.length,r=e.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(1!==t[n-i]&&t[n-i]!==e[r-i])return!1;return!0}static getBroadcastDims(t,e){const n=t.length,r=[];for(let i=0;i1&&1===a&&r.unshift(o)}return r}}e.BroadcastUtil=c,e.arrayCopyHelper=function(t,e,n,r,i){if(r<0||r>=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let o=0;oo.default.isLong(t)?t.toNumber():t))}static tensorValueTypeFromProto(t){return{tensorType:l.tensorDataTypeFromProto(t.elemType),shape:{dims:l.tensorDimsFromProto(t.shape.dim.map((t=>t.dimValue)))}}}static tensorDimsFromORTFormat(t){const e=[];for(let n=0;nt.length)throw new Error(`invalid dimension of ${e} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return f.getSizeFromDimensionRange(t,e,t.length)}static sizeToDimension(t,e){if(e<0||e>t.length)throw new Error(`invalid dimension of ${e} for sizeToDimension as Tensor has ${t.length} dimensions.`);return f.getSizeFromDimensionRange(t,0,e)}static getSizeFromDimensionRange(t,e,n){let r=1;for(let i=e;i=0;--r)n[r]=n[r+1]*t[r+1];return n}static transpose(t){return t.slice().reverse()}static indicesToOffset(t,e,n){void 0===n&&(n=t.length);let r=0;for(let i=0;i=e)throw new Error(\"unsupported axis for this operation.\");return t<0?t+e:t}static normalizeAxes(t,e){return t.map((t=>this.normalizeAxis(t,e)))}static incrementIndex(t,e,n){if(0===e.length||0===t.length)throw new Error(\"Index incrementing unsupported for scalar Tensor\");if(void 0===n)n=e.length;else if(n<=0||n>e.length)throw new Error(\"Incorrect axis to increment on\");for(let r=n-1;r>=0&&(t[r]++,!(t[r]=t.length)throw new Error(\"the dimension with value zero exceeds the dimension size of the input tensor\");r[a]=t[a]}else r[a]=e[a];o*=r[a]}}const a=f.size(t);if(-1!==i){if(a%o!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t}] Output shape: [${e}]`);r[i]=a/o}else if(o!==a)throw new Error(\"reshapedDims and originalDims don't have matching sizes\");return r}static sortBasedOnPerm(t,e){return e?e.map((e=>t[e])):t.slice().reverse()}static padShape(t,e){const n=t.length;return t.map(((t,r)=>t+e[r]+e[r+n]))}static areEqual(t,e){return t.length===e.length&&t.every(((t,n)=>t===e[n]))}static validateDimsAndCalcSize(t){if(t.length>6)throw new TypeError(\"Only rank 0 to 6 is supported for tensor shape.\");let e=1;for(const n of t){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);e*=n}return e}static flattenShape(t,e){e<0&&(e+=t.length);const n=t.reduce(((t,e)=>t*e),1),r=t.slice(e).reduce(((t,e)=>t*e),1);return[n/r,r]}static squeezeShape(t,e){const n=new Array;e=f.normalizeAxes(e,t.length);for(let r=0;r=0;if(i&&1!==t[r])throw new Error(\"squeeze an axis of size different than 1\");(0===e.length&&t[r]>1||e.length>0&&!i)&&n.push(t[r])}return n}static unsqueezeShape(t,e){const n=new Array(t.length+e.length);n.fill(0);for(let t=0;t=n.length)throw new Error(\"'axes' has an out of range axis\");if(0!==n[r])throw new Error(\"'axes' has a duplicate axis\");n[r]=1}let r=0;for(let e=0;e=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let o=0;o=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let a=0;a=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let a=0;a=e.length)throw new Error(\"sourceIndex out of bounds\");if(n<0||n>=t.length)throw new Error(\"targetIndex out of bounds\");if(r+i>e.length)throw new Error(\"source indices to be copied are outside bounds\");if(n+i>t.length)throw new Error(\"target array is too small to hold result\");for(let o=0;oe.push(n)));const a=h.calcReduceShape(o,e,!0),u=f.size(a),l=new s.Tensor(a,t.type),p=f.computeStrides(a),d=f.computeStrides(o),g=new Array(o.length);for(let n=0;n=e.length)return o(t[i]);const u=e[r],c=u>=n.length?1:f.size(n.slice(u+1));for(let l=0;l0!==t))}}e.ReduceUtil=h;class g{static adjustPoolAttributes(t,e,n,r,i,o){if(!t&&n.length!==e.length-2)throw new Error(\"length of specified kernel shapes should be 2 less than length of input dimensions\");if(t)for(let t=0;t=n.length?n.push(e[t+2]):n[t]=e[t+2];for(let t=0;t=n[t]||o[t+n.length]>=n[t])throw new Error(\"pads should be smaller than kernel\")}}static adjustPadsBasedOnAutoPad(t,e,n,r,i,o){if(o){if(i.length!==2*(t.length-2))throw new Error(\"length of pads should be twice the length of data dimensions\");if(e.length!==t.length-2)throw new Error(\"length of strides should be the length of data dimensions\");if(r.length!==t.length-2)throw new Error(\"length of kernel shapes should be the length of data dimensions\");for(let a=0;a{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,i)=>{if(\"object\"==typeof t&&null!==t){if(r.has(t))throw new Error(\"Circular reference in options\");r.add(t)}Object.entries(t).forEach((([t,o])=>{const a=n?n+t:t;if(\"object\"==typeof o)(0,e.iterateExtraOptions)(o,a+\".\",r,i);else if(\"string\"==typeof o||\"number\"==typeof o)i(a,o.toString());else{if(\"boolean\"!=typeof o)throw new Error(\"Can't handle extra config type: \"+typeof o);i(a,o?\"1\":\"0\")}}))}},2157:function(t,e,n){\"use strict\";var r,i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;const s=n(1670),u=a(n(349)),c=n(6361),l=()=>!!s.env.wasm.proxy&&\"undefined\"!=typeof document;let p,f,d,h=!1,g=!1,b=!1;const m=[],y=[],_=[],v=[],w=[],x=[],T=()=>{if(h||!g||b||!p)throw new Error(\"worker not ready\")},S=t=>{switch(t.data.type){case\"init-wasm\":h=!1,t.data.err?(b=!0,f[1](t.data.err)):(g=!0,f[0]());break;case\"init-ort\":t.data.err?d[1](t.data.err):d[0]();break;case\"create_allocate\":t.data.err?m.shift()[1](t.data.err):m.shift()[0](t.data.out);break;case\"create_finalize\":t.data.err?y.shift()[1](t.data.err):y.shift()[0](t.data.out);break;case\"create\":t.data.err?_.shift()[1](t.data.err):_.shift()[0](t.data.out);break;case\"release\":t.data.err?v.shift()[1](t.data.err):v.shift()[0]();break;case\"run\":t.data.err?w.shift()[1](t.data.err):w.shift()[0](t.data.out);break;case\"end-profiling\":t.data.err?x.shift()[1](t.data.err):x.shift()[0]()}},O=\"undefined\"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;e.initWasm=async()=>{if(l()){if(g)return;if(h)throw new Error(\"multiple calls to 'initWasm()' detected.\");if(b)throw new Error(\"previous call to 'initWasm()' failed.\");return h=!0,void 0===s.env.wasm.wasmPaths&&O&&0!==O.indexOf(\"blob:\")&&(s.env.wasm.wasmPaths=O.substr(0,+O.lastIndexOf(\"/\")+1)),new Promise(((t,e)=>{null==p||p.terminate(),p=n(9710).Z(),p.onmessage=S,f=[t,e];const r={type:\"init-wasm\",in:s.env.wasm};p.postMessage(r)}))}return(0,c.initializeWebAssembly)(s.env.wasm)},e.initOrt=async(t,e)=>{if(l())return T(),new Promise(((n,r)=>{d=[n,r];const i={type:\"init-ort\",in:{numThreads:t,loggingLevel:e}};p.postMessage(i)}));u.initOrt(t,e)},e.createSessionAllocate=async t=>l()?(T(),new Promise(((e,n)=>{m.push([e,n]);const r={type:\"create_allocate\",in:{model:t}};p.postMessage(r,[t.buffer])}))):u.createSessionAllocate(t),e.createSessionFinalize=async(t,e)=>l()?(T(),new Promise(((n,r)=>{y.push([n,r]);const i={type:\"create_finalize\",in:{modeldata:t,options:e}};p.postMessage(i)}))):u.createSessionFinalize(t,e),e.createSession=async(t,e)=>l()?(T(),new Promise(((n,r)=>{_.push([n,r]);const i={type:\"create\",in:{model:t,options:e}};p.postMessage(i,[t.buffer])}))):u.createSession(t,e),e.releaseSession=async t=>{if(l())return T(),new Promise(((e,n)=>{v.push([e,n]);const r={type:\"release\",in:t};p.postMessage(r)}));u.releaseSession(t)},e.run=async(t,e,n,r,i)=>l()?(T(),new Promise(((o,a)=>{w.push([o,a]);const s={type:\"run\",in:{sessionId:t,inputIndices:e,inputs:n,outputIndices:r,options:i}};p.postMessage(s,u.extractTransferableBuffers(n))}))):u.run(t,e,n,r,i),e.endProfiling=async t=>{if(l())return T(),new Promise(((e,n)=>{x.push([e,n]);const r={type:\"end-profiling\",in:t};p.postMessage(r)}));u.endProfiling(t)}},586:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setRunOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setRunOptions=t=>{const e=(0,o.getInstance)();let n=0;const a=[],s=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))s.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(s.terminate=!1);let o=0;if(void 0!==(null==t?void 0:t.tag)&&(o=(0,i.allocWasmString)(t.tag,a)),n=e._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,o),0===n)throw new Error(\"Can't create run options\");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,a),s=(0,i.allocWasmString)(r,a);if(0!==e._OrtAddRunConfigEntry(n,o,s))throw new Error(`Can't set a run config entry: ${t} - ${r}`)})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),a.forEach(e._free),t}}},2306:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),i=n(1670),o=n(2850),a=n(2157);let s;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(t){const e=await fetch(t),n=await e.arrayBuffer();return(0,a.createSessionAllocate)(new Uint8Array(n))}async loadModel(t,e){if(s||(await(0,a.initOrt)(i.env.wasm.numThreads,(t=>{switch(t){case\"verbose\":return 0;case\"info\":return 1;case\"warning\":return 2;case\"error\":return 3;case\"fatal\":return 4;default:throw new Error(`unsupported logging level: ${t}`)}})(i.env.logLevel)),s=!0),\"string\"==typeof t)if(\"undefined\"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(n,e)}else{const n=await this.createSessionAllocate(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSessionFinalize)(n,e)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(t,e)}async dispose(){return(0,a.releaseSession)(this.sessionId)}async run(t,e,n){const r=[],o=[];Object.entries(t).forEach((t=>{const e=t[0],n=t[1],i=this.inputNames.indexOf(e);if(-1===i)throw new Error(`invalid input '${e}'`);r.push(n),o.push(i)}));const s=[];Object.entries(e).forEach((t=>{const e=t[0],n=this.outputNames.indexOf(e);if(-1===n)throw new Error(`invalid output '${e}'`);s.push(n)}));const u=await(0,a.run)(this.sessionId,o,r.map((t=>[t.type,t.dims,t.data])),s,n),c={};for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setSessionOptions=void 0;const r=n(7967),i=n(4983),o=n(6361);e.setSessionOptions=t=>{const e=(0,o.getInstance)();let n=0;const a=[],s=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly=\"1\")})(s);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(s.graphOptimizationLevel=\"all\");const u=(t=>{switch(t){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(s.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(s.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(s.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(s.executionMode=\"sequential\");const c=(t=>{switch(t){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(s.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,i.allocWasmString)(t.logId,a)),void 0===(null==t?void 0:t.logSeverityLevel))s.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(s.enableProfiling=!1),n=e._OrtCreateSessionOptions(u,!!s.enableCpuMemArena,!!s.enableMemPattern,c,!!s.enableProfiling,0,l,s.logSeverityLevel,s.logVerbosityLevel),0===n)throw new Error(\"Can't create session options\");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e=\"string\"==typeof r?r:r.name;switch(e){case\"xnnpack\":e=\"XNNPACK\";break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported EP: ${e}`)}const a=(0,i.allocWasmString)(e,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,a))throw new Error(`Can't append execution provider: ${e}`)}})(n,t.executionProviders,a),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const o=(0,i.allocWasmString)(t,a),s=(0,i.allocWasmString)(r,a);if(0!==e._OrtAddSessionConfigEntry(n,o,s))throw new Error(`Can't set a session config entry: ${t} - ${r}`)})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),a.forEach(e._free),t}}},4983:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.allocWasmString=void 0;const r=n(6361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),i=n.lengthBytesUTF8(t)+1,o=n._malloc(i);return n.stringToUTF8(t,o,i),e.push(o),o}},349:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),i=n(4919),o=n(4983),a=n(6361);e.initOrt=(t,e)=>{const n=(0,a.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const s=new Map;e.createSessionAllocate=t=>{const e=(0,a.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,a.getInstance)();let r=0,o=0,u=[];try{if([o,u]=(0,i.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],o),0===r)throw new Error(\"Can't create a session\")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(o),u.forEach(n._free)}const c=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),p=[],f=[],d=[],h=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,a.getInstance)(),n=s.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],i=n[1],o=n[2];i.forEach(e._OrtFree),o.forEach(e._OrtFree),e._OrtReleaseSession(r),s.delete(t)};const u=t=>{switch(t){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${t}`)}},c=t=>{switch(t){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case\"float32\":return Float32Array;case\"uint8\":case\"bool\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,i,p)=>{const f=(0,a.getInstance)(),d=s.get(t);if(!d)throw new Error(\"invalid session id\");const h=d[0],g=d[1],b=d[2],m=e.length,y=i.length;let _=0,v=[];const w=[],x=[];try{[_,v]=(0,r.setRunOptions)(p);for(let t=0;tf.HEAP32[t++]=e));const n=f._OrtCreateTensor(u(e),a,s,l,r.length);if(0===n)throw new Error(\"Can't create a tensor\");w.push(n)}finally{f.stackRestore(c)}}const t=f.stackSave(),a=f.stackAlloc(4*m),s=f.stackAlloc(4*m),d=f.stackAlloc(4*y),T=f.stackAlloc(4*y);try{let n=a/4,r=s/4,o=d/4,u=T/4;for(let t=0;tt*e));if(i=c(a),\"string\"===i){const t=[];let e=o/4;for(let n=0;n{const e=(0,a.getInstance)(),n=s.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],i=e._OrtEndProfiling(r);if(0===i)throw new Error(\"Can't get an profile file name\");e._OrtFree(i)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},6361:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const s=o(n(6449)),u=a(n(932)),c=n(3474);let l,p=!1,f=!1,d=!1;const h=(t,e)=>e?t?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-threaded.wasm\":t?\"ort-wasm-simd.wasm\":\"ort-wasm.wasm\";e.initializeWebAssembly=async t=>{if(p)return Promise.resolve();if(f)throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");if(d)throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");f=!0;const e=t.initTimeout,r=t.numThreads,i=t.simd,o=r>1&&(()=>{try{return\"undefined\"!=typeof SharedArrayBuffer&&(\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),a=i&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),g=\"string\"==typeof t.wasmPaths?t.wasmPaths:void 0,b=h(!1,o),m=h(a,o),y=\"object\"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let _=!1;const v=[];if(e>0&&v.push(new Promise((t=>{setTimeout((()=>{_=!0,t()}),e)}))),v.push(new Promise(((t,e)=>{const r=o?c:u.default,i={locateFile:(t,e)=>o&&t.endsWith(\".worker.js\")&&\"undefined\"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:\"text/javascript\"})):t===b?null!=y?y:(null!=g?g:e)+m:e+t};if(o)if(\"undefined\"==typeof Blob)i.mainScriptUrlOrBlob=s.join(\"/\",\"ort-wasm-threaded.js\");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;i.mainScriptUrlOrBlob=new Blob([t],{type:\"text/javascript\"})}r(i).then((e=>{f=!1,p=!0,l=e,t()}),(t=>{f=!1,d=!0,e(t)}))}))),await Promise.race(v),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(p&&l)return l;throw new Error(\"WebAssembly is not initialized yet.\")},e.dispose=()=>{var t;!p||f||d||(f=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,f=!1,p=!1,d=!0)}},9710:(t,e,n)=>{\"use strict\";n.d(e,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*!\\n* ONNX Runtime Web v1.14.0\\n* Copyright (c) Microsoft Corporation. All rights reserved.\\n* Licensed under the MIT License.\\n*/\\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m=\"./this.program\",g=(t,e)=>{throw e},v=\"object\"==typeof window,w=\"function\"==typeof importScripts,_=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A=\"\";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+\"/\":\"//\",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:\"utf8\")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x(\"exiting due to exception: \"+e),process.exit(t)},u.inspect=function(){return\"[Emscripten Module object]\"};try{e=n(925)}catch(t){throw console.error(\\'The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?\\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf(\"blob:\")?A.substr(0,A.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",_||(l=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&\"undefined\"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+\"\\\\n\"),E=t=>h.writeSync(2,t+\"\\\\n\"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&at(\"no native wasm support detected\");var j,k,D,P,U,F,I,W,H=!1,L=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):\"\"}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),_&&console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\"),Error(\"bad memory\");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:\"onAbort\",arg:t}):u.onAbort&&u.onAbort(t),x(t=\"Aborted(\"+t+\")\"),H=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),s(t),t}function it(){return tt.startsWith(\"data:application/octet-stream;base64,\")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){at(t)}}tt=\"ort-wasm-threaded.wasm\",it()||(tt=S(tt));var ut={};function ct(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:\"run\",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),\"unwind\";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\\'Internal error! Worker sent a message \"\\'+r+\\'\" to target pthread \\'+n.targetThread+\", but that thread no longer exists!\")}else\"processProxyingQueue\"===r?zt(n.queue):\"spawnThread\"===r?lt(n):\"cleanupThread\"===r?st(n.thread):\"killThread\"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):\"cancelThread\"===r?ht.Vb[n.thread].postMessage({cmd:\"cancel\"}):\"loaded\"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):\"print\"===r?C(\"Thread \"+n.threadId+\": \"+n.text):\"printErr\"===r?x(\"Thread \"+n.threadId+\": \"+n.text):\"alert\"===r?alert(\"Thread \"+n.threadId+\": \"+n.text):\"setimmediate\"===n.target?t.postMessage(n):\"onAbort\"===r?u.onAbort&&u.onAbort(n.arg):r&&x(\"worker sent an unknown command \"+r);ht.Bc=void 0},t.onerror=t=>{throw x(\"worker sent an error! \"+t.filename+\":\"+t.lineno+\": \"+t.message),t},_&&(t.on(\"message\",(function(e){t.onmessage({data:e})})),t.on(\"error\",(function(e){t.onerror(e)})),t.on(\"detachedExit\",(function(){}))),t.postMessage({cmd:\"load\",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S(\"ort-wasm-threaded.worker.js\");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if(\"undefined\"==typeof SharedArrayBuffer)return x(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc=\"spawnThread\",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\\\(([A-Za-z ]+)\\\\)$/))?t[1]:\"GMT\"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:m||\"./this.program\"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):\"\"},r=Y(r),f={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})r=r.replace(new RegExp(p,\"g\"),f[p]);var h=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),d=\"January February March April May June July August September October November December\".split(\" \");for(p in f={\"%a\":function(t){return h[t.Tb].substring(0,3)},\"%A\":function(t){return h[t.Tb]},\"%b\":function(t){return d[t.ec].substring(0,3)},\"%B\":function(t){return d[t.ec]},\"%C\":function(t){return u((t.Xb+1900)/100|0,2)},\"%d\":function(t){return u(t.jc,2)},\"%e\":function(t){return o(t.jc,2,\" \")},\"%g\":function(t){return l(t).toString().substring(2)},\"%G\":function(t){return l(t)},\"%H\":function(t){return u(t.dc,2)},\"%I\":function(t){return 0==(t=t.dc)?t=12:12t.dc?\"AM\":\"PM\"},\"%S\":function(t){return u(t.Lc,2)},\"%t\":function(){return\"\\\\t\"},\"%u\":function(t){return t.Tb||7},\"%U\":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},\"%V\":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},\"%w\":function(t){return t.Tb},\"%W\":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},\"%y\":function(t){return(t.Xb+1900).toString().substring(2)},\"%Y\":function(t){return t.Xb+1900},\"%z\":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.Mc},\"%%\":function(){return\"%\"}},r=r.replace(/%%/g,\"\\\\0\\\\0\"),f)r.includes(p)&&(r=r.replace(new RegExp(p,\"g\"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\\\0\\\\0/g,\"%\")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x(\"Unexpected exception thrown, this is not properly supported - aborting\"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:\"processProxyingQueue\",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:\"processProxyingQueue\",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at(\"\")},U:function(){if(!_&&!w){var t=\"Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread\";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t=\"warning: \"+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw\"unwind\"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error(\"Cannot find module \\'crypto\\'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at(\"randomDevice\")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if(\"function\"==typeof fetch&&!tt.startsWith(\"file://\"))return fetch(tt,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at \\'\"+tt+\"\\'\";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x(\"failed to asynchronously prepare wasm: \"+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x(\"Module.instantiateWasm callback failed with error: \"+t),!1}(M||\"function\"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith(\"file://\")||_||\"function\"!=typeof fetch?n(e):fetch(tt,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x(\"wasm streaming compile failed: \"+t),x(\"falling back to ArrayBuffer instantiation\"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for(\"function\"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||\"/index.js\",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p=\"./this.program\",h=(t,e)=>{throw e},d=\"object\"==typeof window,y=\"function\"==typeof importScripts,b=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,m=\"\";b?(m=y?n(908).dirname(m)+\"/\":\"//\",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:\"utf8\")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open(\"GET\",t,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;\"object\"!=typeof WebAssembly&&V(\"no native wasm support detected\");var O,A,S,T,E,M,C=!1,x=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):\"\"}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t=\"Aborted(\"+t+\")\"),C=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),a(t),t}function $(){return Y.startsWith(\"data:application/octet-stream;base64,\")}if(Y=\"ort-wasm.wasm\",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw\"both async and sync fetching of the wasm failed\"}catch(t){V(t)}}function J(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:p||\"./this.program\"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+\"=\"+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t=\"number\"==typeof t?t.toString():t||\"\";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):\"\"},n=j(n),s={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"})n=n.replace(new RegExp(l,\"g\"),s[l]);var f=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),p=\"January February March April May June July August September October November December\".split(\" \");for(l in s={\"%a\":function(t){return f[t.Ab].substring(0,3)},\"%A\":function(t){return f[t.Ab]},\"%b\":function(t){return p[t.Hb].substring(0,3)},\"%B\":function(t){return p[t.Hb]},\"%C\":function(t){return i((t.Cb+1900)/100|0,2)},\"%d\":function(t){return i(t.Kb,2)},\"%e\":function(t){return a(t.Kb,2,\" \")},\"%g\":function(t){return c(t).toString().substring(2)},\"%G\":function(t){return c(t)},\"%H\":function(t){return i(t.Gb,2)},\"%I\":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?\"AM\":\"PM\"},\"%S\":function(t){return i(t.$b,2)},\"%t\":function(){return\"\\\\t\"},\"%u\":function(t){return t.Ab||7},\"%U\":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},\"%V\":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},\"%w\":function(t){return t.Ab},\"%W\":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},\"%y\":function(t){return(t.Cb+1900).toString().substring(2)},\"%Y\":function(t){return t.Cb+1900},\"%z\":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?\"+\":\"-\")+String(\"0000\"+(t/60*100+t%60)).slice(-4)},\"%Z\":function(t){return t.ac},\"%%\":function(){return\"%\"}},n=n.replace(/%%/g,\"\\\\0\\\\0\"),s)n.includes(l)&&(n=n.replace(new RegExp(l,\"g\"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\\\0\\\\0/g,\"%\")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w(\"Unexpected exception thrown, this is not properly supported - aborting\"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\\\(([A-Za-z ]+)\\\\)$/))?t[1]:\"GMT\"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V(\"\")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error(\"Cannot find module \\'crypto\\'\");throw t.code=\"MODULE_NOT_FOUND\",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V(\"randomDevice\")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if(\"function\"==typeof fetch&&!Y.startsWith(\"file://\"))return fetch(Y,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at \\'\"+Y+\"\\'\";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w(\"failed to asynchronously prepare wasm: \"+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w(\"Module.instantiateWasm callback failed with error: \"+t),!1}(g||\"function\"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith(\"file://\")||b||\"function\"!=typeof fetch?r(n):fetch(Y,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w(\"wasm streaming compile failed: \"+t),w(\"falling back to ArrayBuffer instantiation\"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for(\"function\"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if(\"object\"==typeof t&&null!==t){if(r.has(t))throw new Error(\"Circular reference in options\");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if(\"object\"==typeof i)(0,e.iterateExtraOptions)(i,o+\".\",r,a);else if(\"string\"==typeof i||\"number\"==typeof i)a(o,i.toString());else{if(\"boolean\"!=typeof i)throw new Error(\"Can\\'t handle extra config type: \"+typeof i);a(o,i?\"1\":\"0\")}}))}},586:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error(\"Can\\'t create run options\");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly=\"1\")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel=\"all\");const c=(t=>{switch(t){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode=\"sequential\");const s=(t=>{switch(t){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if(\"number\"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if(\"number\"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error(\"Can\\'t create session options\");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e=\"string\"==typeof r?r:r.name;switch(e){case\"xnnpack\":e=\"XNNPACK\";break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,\"\",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error(\"Can\\'t create a session\")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case\"float32\":return Float32Array;case\"uint8\":case\"bool\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error(\"invalid session id\");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error(\"Can\\'t create a tensor\");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),\"string\"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error(\"invalid session id\");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error(\"Can\\'t get an profile file name\");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!(\"get\"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)\"default\"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-threaded.wasm\":t?\"ort-wasm-simd.wasm\":\"ort-wasm.wasm\";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error(\"multiple calls to \\'initializeWebAssembly()\\' detected.\");if(h)throw new Error(\"previous call to \\'initializeWebAssembly()\\' failed.\");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return\"undefined\"!=typeof SharedArrayBuffer&&(\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y=\"string\"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g=\"object\"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(\".worker.js\")&&\"undefined\"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:\"text/javascript\"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if(\"undefined\"==typeof Blob)a.mainScriptUrlOrBlob=u.join(\"/\",\"ort-wasm-threaded.js\");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:\"text/javascript\"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error(\"WebAssembly is not initialized yet.\")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{\"use strict\";t.exports=\\'\"use strict\";var e={},t=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node;if(t){var r=require(\"worker_threads\"),a=r.parentPort;a.on(\"message\",(e=>onmessage({data:e})));var o=require(\"fs\");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,\"utf8\"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(\" \");t?o.writeSync(2,e+\"\\\\\\\\n\"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if(\"load\"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,\"string\"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if(\"run\"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if(\"unwind\"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else\"cancel\"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):\"setimmediate\"===t.data.target||(\"processProxyingQueue\"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i(\"worker.js received unknown command \"+t.data.cmd),i(t.data)))}catch(t){throw i(\"worker.js onmessage() captured an uncaught exception: \"+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\\\n\\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),(()=>{\"use strict\";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case\"init-wasm\":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:\"init-wasm\"})),(t=>postMessage({type:\"init-wasm\",err:t})));break;case\"init-ort\":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:\"init-ort\"})}catch(t){postMessage({type:\"init-ort\",err:t})}break;case\"create_allocate\":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:\"create_allocate\",out:r})}catch(t){postMessage({type:\"create_allocate\",err:t})}break;case\"create_finalize\":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:\"create_finalize\",out:a})}catch(t){postMessage({type:\"create_finalize\",err:t})}break;case\"create\":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:\"create\",out:a})}catch(t){postMessage({type:\"create\",err:t})}break;case\"release\":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:\"release\"})}catch(t){postMessage({type:\"release\",err:t})}break;case\"run\":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:\"run\",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:\"run\",err:t})}break;case\"end-profiling\":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:\"end-profiling\"})}catch(t){postMessage({type:\"end-profiling\",err:t})}}}})()})();\\n',\"Worker\",void 0,void 0)}},477:t=>{\"use strict\";t.exports=function(t,e,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([t])}catch(e){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(t),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),u=new i[e](s,n);return a.revokeObjectURL(s),u}catch(r){return new i[e](\"data:application/javascript,\".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error(\"Inline worker is not supported\");return new i[e](r,n)}}},4154:t=>{\"use strict\";t.exports='\"use strict\";var e={},t=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node;if(t){var r=require(\"worker_threads\"),a=r.parentPort;a.on(\"message\",(e=>onmessage({data:e})));var o=require(\"fs\");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,\"utf8\"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(\" \");t?o.writeSync(2,e+\"\\\\n\"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if(\"load\"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,\"string\"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if(\"run\"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if(\"unwind\"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else\"cancel\"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):\"setimmediate\"===t.data.target||(\"processProxyingQueue\"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i(\"worker.js received unknown command \"+t.data.cmd),i(t.data)))}catch(t){throw i(\"worker.js onmessage() captured an uncaught exception: \"+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n'},1670:t=>{\"use strict\";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e,n)=>{\"use strict\";n.r(e),n.d(e,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(n+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;t:for(e=0;e=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},r.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+e))throw new Error(\"FlatBuffers: field \"+e+\" must be set\")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n=56320?i:(i<<10)+t.charCodeAt(n++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),n=0;for(var o=this.space,a=this.bb.bytes();n>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return i},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error(\"FlatBuffers: file identifier must be length \"+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})()));\n//# sourceMappingURL=ort-web.min.js.map","let ONNX;\r\n\r\n// TODO support more execution providers (e.g., webgpu)\r\nconst executionProviders = ['wasm'];\r\n\r\nif (typeof process !== 'undefined') {\r\n // Running in a node-like environment.\r\n // Try to import onnxruntime-node, using onnxruntime-web as a fallback\r\n try {\r\n ONNX = require('onnxruntime-node');\r\n } catch (err) {\r\n console.warn(\r\n \"Node.js environment detected, but `onnxruntime-node` was not found. \" +\r\n \"Using `onnxruntime-web` as a fallback. We recommend installing `onnxruntime-node` \" +\r\n \"as it generally improves performance (up to 5X).\"\r\n )\r\n\r\n // Fix \"ReferenceError: self is not defined\" bug when running directly with node\r\n // https://github.com/microsoft/onnxruntime/issues/13072\r\n // @ts-ignore\r\n global.self = global;\r\n\r\n ONNX = require('onnxruntime-web');\r\n\r\n // Disable spawning worker threads for testing.\r\n // This is done by setting numThreads to 1\r\n // https://github.com/microsoft/onnxruntime/issues/10311\r\n ONNX.env.wasm.numThreads = 1;\r\n }\r\n\r\n // Add `cpu` execution provider, with higher precedence that `wasm`.\r\n executionProviders.unshift('cpu');\r\n\r\n} else {\r\n // Running in a browser-environment, so we just import `onnxruntime-web`\r\n ONNX = require('onnxruntime-web');\r\n}\r\n\r\nmodule.exports = {\r\n ONNX,\r\n executionProviders,\r\n}\r\n","const fs = require('fs');\r\nconst path = require('path');\r\n\r\nconst { env: onnx_env } = require('./backends/onnx.js').ONNX;\r\n\r\n// check if various APIs are available (depends on environment)\r\nconst CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self;\r\nconst FS_AVAILABLE = !isEmpty(fs); // check if file system is available\r\nconst PATH_AVAILABLE = !isEmpty(path); // check if path is available\r\n\r\nconst RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE;\r\n\r\n// set local model path, based on available APIs\r\nconst DEFAULT_LOCAL_PATH = '/models/onnx/quantized/';\r\nconst localURL = RUNNING_LOCALLY\r\n ? path.join(path.dirname(__dirname), DEFAULT_LOCAL_PATH)\r\n : DEFAULT_LOCAL_PATH;\r\n\r\n// First, set path to wasm files. This is needed when running in a web worker.\r\n// https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths\r\n// We use remote wasm files by default to make it easier for newer users.\r\n// In practice, users should probably self-host the necessary .wasm files.\r\nonnx_env.wasm.wasmPaths = RUNNING_LOCALLY\r\n ? path.join(path.dirname(__dirname), '/dist/')\r\n : 'https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/';\r\n\r\n\r\n// Global variable used to control exection, with suitable defaults\r\nconst env = {\r\n // access onnxruntime-web's environment variables\r\n onnx: onnx_env,\r\n\r\n // whether to support loading models from the HuggingFace hub\r\n remoteModels: true,\r\n\r\n // URL to load models from\r\n remoteURL: 'https://huggingface.co/Xenova/transformers.js/resolve/main/quantized/',\r\n\r\n // Local URL to load models from.\r\n localURL: localURL,\r\n\r\n // Whether to use Cache API to cache models. By default, it is true if available.\r\n useCache: CACHE_AVAILABLE,\r\n\r\n // Whether to use the file system to load files. By default, it is true available.\r\n useFS: FS_AVAILABLE,\r\n}\r\n\r\n\r\n/**\r\n * @param {object} obj\r\n */\r\nfunction isEmpty(obj) {\r\n return Object.keys(obj).length === 0;\r\n}\r\n\r\nmodule.exports = {\r\n env\r\n}\r\n","\r\n/**\r\n * FFT class provides functionality for performing Fast Fourier Transform on arrays\r\n * Code adapted from https://www.npmjs.com/package/fft.js\r\n */\r\nclass FFT {\r\n /**\r\n * @param {number} size - The size of the input array. Must be a power of two and bigger than 1.\r\n * @throws {Error} FFT size must be a power of two and bigger than 1.\r\n */\r\n constructor(size) {\r\n this.size = size | 0; // convert to a 32-bit signed integer\r\n if (this.size <= 1 || (this.size & (this.size - 1)) !== 0)\r\n throw new Error('FFT size must be a power of two and bigger than 1');\r\n\r\n this._csize = size << 1;\r\n\r\n this.table = new Float64Array(this.size * 2);\r\n for (let i = 0; i < this.table.length; i += 2) {\r\n const angle = Math.PI * i / this.size;\r\n this.table[i] = Math.cos(angle);\r\n this.table[i + 1] = -Math.sin(angle);\r\n }\r\n\r\n // Find size's power of two\r\n let power = 0;\r\n for (let t = 1; this.size > t; t <<= 1)\r\n ++power;\r\n\r\n // Calculate initial step's width:\r\n // * If we are full radix-4 - it is 2x smaller to give inital len=8\r\n // * Otherwise it is the same as `power` to give len=4\r\n this._width = power % 2 === 0 ? power - 1 : power;\r\n\r\n // Pre-compute bit-reversal patterns\r\n this._bitrev = new Int32Array(1 << this._width);\r\n for (let j = 0; j < this._bitrev.length; ++j) {\r\n this._bitrev[j] = 0;\r\n for (let shift = 0; shift < this._width; shift += 2) {\r\n const revShift = this._width - shift - 2;\r\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Create a complex number array with size `2 * size`\r\n *\r\n * @returns {Float64Array} - A complex number array with size `2 * size`\r\n */\r\n createComplexArray() {\r\n return new Float64Array(this._csize);\r\n }\r\n\r\n /**\r\n * Converts a complex number representation stored in a Float64Array to an array of real numbers.\r\n * \r\n * @param {Float64Array} complex - The complex number representation to be converted.\r\n * @param {number[]} [storage] - An optional array to store the result in.\r\n * @returns {number[]} An array of real numbers representing the input complex number representation.\r\n */\r\n fromComplexArray(complex, storage) {\r\n const res = storage || new Array(complex.length >>> 1);\r\n for (let i = 0; i < complex.length; i += 2)\r\n res[i >>> 1] = complex[i];\r\n return res;\r\n }\r\n\r\n /**\r\n * Convert a real-valued input array to a complex-valued output array.\r\n * @param {Float64Array} input - The real-valued input array.\r\n * @param {Float64Array} [storage] - Optional buffer to store the output array.\r\n * @returns {Float64Array} The complex-valued output array.\r\n */\r\n toComplexArray(input, storage) {\r\n const res = storage || this.createComplexArray();\r\n for (let i = 0; i < res.length; i += 2) {\r\n res[i] = input[i >>> 1];\r\n res[i + 1] = 0;\r\n }\r\n return res;\r\n }\r\n\r\n /**\r\n * Completes the spectrum by adding its mirrored negative frequency components.\r\n * @param {Float64Array} spectrum - The input spectrum.\r\n * @returns {void}\r\n */\r\n completeSpectrum(spectrum) {\r\n const size = this._csize;\r\n const half = size >>> 1;\r\n for (let i = 2; i < half; i += 2) {\r\n spectrum[size - i] = spectrum[i];\r\n spectrum[size - i + 1] = -spectrum[i + 1];\r\n }\r\n }\r\n\r\n /**\r\n * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer.\r\n * \r\n * @param {Float64Array} out - The output buffer to store the result.\r\n * @param {Float64Array} data - The input data to transform.\r\n * \r\n * @throws {Error} Input and output buffers must be different.\r\n * \r\n * @returns {void}\r\n */\r\n transform(out, data) {\r\n if (out === data)\r\n throw new Error('Input and output buffers must be different');\r\n\r\n this._transform4(out, data, 1 /* DONE */);\r\n }\r\n\r\n /**\r\n * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer.\r\n * The input buffer must contain real values only, while the output buffer will contain complex values. The input and\r\n * output buffers must be different.\r\n *\r\n * @param {Float64Array} out - The output buffer.\r\n * @param {Float64Array} data - The input buffer containing real values.\r\n *\r\n * @throws {Error} If the input and output buffers are the same.\r\n */\r\n realTransform(out, data) {\r\n if (out === data)\r\n throw new Error('Input and output buffers must be different');\r\n\r\n this._realTransform4(out, data, 1 /* DONE */);\r\n }\r\n\r\n /**\r\n * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`.\r\n * The `out` array must be a different buffer than the `data` array. The `out` array will contain the\r\n * result of the transformation. The `data` array will not be modified.\r\n * \r\n * @param {Float64Array} out - The output buffer for the transformed data.\r\n * @param {Float64Array} data - The input data to transform.\r\n * @throws {Error} If `out` and `data` refer to the same buffer.\r\n * @returns {void}\r\n */\r\n inverseTransform(out, data) {\r\n if (out === data)\r\n throw new Error('Input and output buffers must be different');\r\n\r\n this._transform4(out, data, -1 /* DONE */);\r\n for (let i = 0; i < out.length; ++i)\r\n out[i] /= this.size;\r\n }\r\n\r\n /**\r\n * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data.\r\n *\r\n * @param {Float64Array} out - The output buffer for the transformed data.\r\n * @param {Float64Array} data - The input buffer of data to be transformed.\r\n * @param {number} inv - A scaling factor to apply to the transform.\r\n * @returns {void}\r\n */\r\n _transform4(out, data, inv) {\r\n // radix-4 implementation\r\n\r\n const size = this._csize;\r\n\r\n // Initial step (permute and transform)\r\n const width = this._width;\r\n let step = 1 << width;\r\n let len = (size / step) << 1;\r\n\r\n let outOff;\r\n let t;\r\n let bitrev = this._bitrev;\r\n if (len === 4) {\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleTransform2(data, out, outOff, off, step);\r\n }\r\n } else {\r\n // len === 8\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleTransform4(data, out, outOff, off, step, inv);\r\n }\r\n }\r\n\r\n // Loop through steps in decreasing order\r\n for (step >>= 2; step >= 2; step >>= 2) {\r\n len = (size / step) << 1;\r\n let quarterLen = len >>> 2;\r\n\r\n // Loop through offsets in the data\r\n for (outOff = 0; outOff < size; outOff += len) {\r\n // Full case\r\n let limit = outOff + quarterLen;\r\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\r\n const A = i;\r\n const B = A + quarterLen;\r\n const C = B + quarterLen;\r\n const D = C + quarterLen;\r\n\r\n // Original values\r\n const Ar = out[A];\r\n const Ai = out[A + 1];\r\n const Br = out[B];\r\n const Bi = out[B + 1];\r\n const Cr = out[C];\r\n const Ci = out[C + 1];\r\n const Dr = out[D];\r\n const Di = out[D + 1];\r\n\r\n const tableBr = this.table[k];\r\n const tableBi = inv * this.table[k + 1];\r\n const MBr = Br * tableBr - Bi * tableBi;\r\n const MBi = Br * tableBi + Bi * tableBr;\r\n\r\n const tableCr = this.table[2 * k];\r\n const tableCi = inv * this.table[2 * k + 1];\r\n const MCr = Cr * tableCr - Ci * tableCi;\r\n const MCi = Cr * tableCi + Ci * tableCr;\r\n\r\n const tableDr = this.table[3 * k];\r\n const tableDi = inv * this.table[3 * k + 1];\r\n const MDr = Dr * tableDr - Di * tableDi;\r\n const MDi = Dr * tableDi + Di * tableDr;\r\n\r\n // Pre-Final values\r\n const T0r = Ar + MCr;\r\n const T0i = Ai + MCi;\r\n const T1r = Ar - MCr;\r\n const T1i = Ai - MCi;\r\n const T2r = MBr + MDr;\r\n const T2i = MBi + MDi;\r\n const T3r = inv * (MBr - MDr);\r\n const T3i = inv * (MBi - MDi);\r\n\r\n // Final values\r\n out[A] = T0r + T2r;\r\n out[A + 1] = T0i + T2i;\r\n out[B] = T1r + T3i;\r\n out[B + 1] = T1i - T3r;\r\n out[C] = T0r - T2r;\r\n out[C + 1] = T0i - T2i;\r\n out[D] = T1r - T3i;\r\n out[D + 1] = T1i + T3r;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data.\r\n *\r\n * @param {Float64Array} data - The input buffer of data to be transformed.\r\n * @param {Float64Array} out - The output buffer for the transformed data.\r\n * @param {number} outOff - The offset at which to write the output data.\r\n * @param {number} off - The offset at which to begin reading the input data.\r\n * @param {number} step - The step size for indexing the input data.\r\n * @returns {void}\r\n */\r\n _singleTransform2(data, out, outOff, off, step) {\r\n // radix-2 implementation\r\n // NOTE: Only called for len=4\r\n\r\n const evenR = data[off];\r\n const evenI = data[off + 1];\r\n const oddR = data[off + step];\r\n const oddI = data[off + step + 1];\r\n\r\n out[outOff] = evenR + oddR;\r\n out[outOff + 1] = evenI + oddI;\r\n out[outOff + 2] = evenR - oddR;\r\n out[outOff + 3] = evenI - oddI;\r\n }\r\n\r\n /**\r\n * Performs radix-4 transformation on input data of length 8\r\n *\r\n * @param {Float64Array} data - Input data array of length 8\r\n * @param {Float64Array} out - Output data array of length 8\r\n * @param {number} outOff - Index of output array to start writing from\r\n * @param {number} off - Index of input array to start reading from\r\n * @param {number} step - Step size between elements in input array\r\n * @param {number} inv - Scaling factor for inverse transform\r\n * \r\n * @returns {void}\r\n */\r\n _singleTransform4(data, out, outOff, off, step, inv) {\r\n // radix-4\r\n // NOTE: Only called for len=8\r\n const step2 = step * 2;\r\n const step3 = step * 3;\r\n\r\n // Original values\r\n const Ar = data[off];\r\n const Ai = data[off + 1];\r\n const Br = data[off + step];\r\n const Bi = data[off + step + 1];\r\n const Cr = data[off + step2];\r\n const Ci = data[off + step2 + 1];\r\n const Dr = data[off + step3];\r\n const Di = data[off + step3 + 1];\r\n\r\n // Pre-Final values\r\n const T0r = Ar + Cr;\r\n const T0i = Ai + Ci;\r\n const T1r = Ar - Cr;\r\n const T1i = Ai - Ci;\r\n const T2r = Br + Dr;\r\n const T2i = Bi + Di;\r\n const T3r = inv * (Br - Dr);\r\n const T3i = inv * (Bi - Di);\r\n\r\n // Final values\r\n out[outOff] = T0r + T2r;\r\n out[outOff + 1] = T0i + T2i;\r\n out[outOff + 2] = T1r + T3i;\r\n out[outOff + 3] = T1i - T3r;\r\n out[outOff + 4] = T0r - T2r;\r\n out[outOff + 5] = T0i - T2i;\r\n out[outOff + 6] = T1r - T3i;\r\n out[outOff + 7] = T1i + T3r;\r\n }\r\n\r\n /**\r\n * Real input radix-4 implementation\r\n * @param {Float64Array} out - Output array for the transformed data\r\n * @param {Float64Array} data - Input array of real data to be transformed\r\n * @param {number} inv - The scale factor used to normalize the inverse transform\r\n */\r\n _realTransform4(out, data, inv) {\r\n // Real input radix-4 implementation\r\n const size = this._csize;\r\n\r\n // Initial step (permute and transform)\r\n const width = this._width;\r\n let step = 1 << width;\r\n let len = (size / step) << 1;\r\n\r\n var outOff;\r\n var t;\r\n var bitrev = this._bitrev;\r\n if (len === 4) {\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1);\r\n }\r\n } else {\r\n // len === 8\r\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\r\n const off = bitrev[t];\r\n this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv);\r\n }\r\n }\r\n\r\n // Loop through steps in decreasing order\r\n for (step >>= 2; step >= 2; step >>= 2) {\r\n len = (size / step) << 1;\r\n const halfLen = len >>> 1;\r\n const quarterLen = halfLen >>> 1;\r\n const hquarterLen = quarterLen >>> 1;\r\n\r\n // Loop through offsets in the data\r\n for (outOff = 0; outOff < size; outOff += len) {\r\n for (let i = 0, k = 0; i <= hquarterLen; i += 2, k += step) {\r\n const A = outOff + i;\r\n const B = A + quarterLen;\r\n const C = B + quarterLen;\r\n const D = C + quarterLen;\r\n\r\n // Original values\r\n const Ar = out[A];\r\n const Ai = out[A + 1];\r\n const Br = out[B];\r\n const Bi = out[B + 1];\r\n const Cr = out[C];\r\n const Ci = out[C + 1];\r\n const Dr = out[D];\r\n const Di = out[D + 1];\r\n\r\n const tableBr = this.table[k];\r\n const tableBi = inv * this.table[k + 1];\r\n const MBr = Br * tableBr - Bi * tableBi;\r\n const MBi = Br * tableBi + Bi * tableBr;\r\n\r\n const tableCr = this.table[2 * k];\r\n const tableCi = inv * this.table[2 * k + 1];\r\n const MCr = Cr * tableCr - Ci * tableCi;\r\n const MCi = Cr * tableCi + Ci * tableCr;\r\n\r\n const tableDr = this.table[3 * k];\r\n const tableDi = inv * this.table[3 * k + 1];\r\n const MDr = Dr * tableDr - Di * tableDi;\r\n const MDi = Dr * tableDi + Di * tableDr;\r\n\r\n // Pre-Final values\r\n const T0r = Ar + MCr;\r\n const T0i = Ai + MCi;\r\n const T1r = Ar - MCr;\r\n const T1i = Ai - MCi;\r\n const T2r = MBr + MDr;\r\n const T2i = MBi + MDi;\r\n const T3r = inv * (MBr - MDr);\r\n const T3i = inv * (MBi - MDi);\r\n\r\n // Final values\r\n out[A] = T0r + T2r;\r\n out[A + 1] = T0i + T2i;\r\n out[B] = T1r + T3i;\r\n out[B + 1] = T1i - T3r;\r\n\r\n // Output final middle point\r\n if (i === 0) {\r\n out[C] = T0r - T2r;\r\n out[C + 1] = T0i - T2i;\r\n continue;\r\n }\r\n\r\n // Do not overwrite ourselves\r\n if (i === hquarterLen)\r\n continue;\r\n\r\n const SA = outOff + quarterLen - i;\r\n const SB = outOff + halfLen - i;\r\n\r\n out[SA] = T1r + -inv * T3i;\r\n out[SA + 1] = -T1i - inv * T3r;\r\n out[SB] = T0r + -inv * T2r;\r\n out[SB + 1] = -T0i + inv * T2i;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Performs a single real input radix-2 transformation on the provided data\r\n * \r\n * @param {Float64Array} data - The input data array\r\n * @param {Float64Array} out - The output data array\r\n * @param {number} outOff - The output offset\r\n * @param {number} off - The input offset\r\n * @param {number} step - The step\r\n * \r\n * @returns {void}\r\n */\r\n _singleRealTransform2(data, out, outOff, off, step) {\r\n // radix-2 implementation\r\n // NOTE: Only called for len=4\r\n\r\n const evenR = data[off];\r\n const oddR = data[off + step];\r\n\r\n out[outOff] = evenR + oddR;\r\n out[outOff + 1] = 0;\r\n out[outOff + 2] = evenR - oddR;\r\n out[outOff + 3] = 0;\r\n }\r\n\r\n /**\r\n * Computes a single real-valued transform using radix-4 algorithm.\r\n * This method is only called for len=8.\r\n *\r\n * @param {Float64Array} data - The input data array.\r\n * @param {Float64Array} out - The output data array.\r\n * @param {number} outOff - The offset into the output array.\r\n * @param {number} off - The offset into the input array.\r\n * @param {number} step - The step size for the input array.\r\n * @param {number} inv - The value of inverse.\r\n */\r\n _singleRealTransform4(data, out, outOff, off, step, inv) {\r\n // radix-4\r\n // NOTE: Only called for len=8\r\n const step2 = step * 2;\r\n const step3 = step * 3;\r\n\r\n // Original values\r\n const Ar = data[off];\r\n const Br = data[off + step];\r\n const Cr = data[off + step2];\r\n const Dr = data[off + step3];\r\n\r\n // Pre-Final values\r\n const T0r = Ar + Cr;\r\n const T1r = Ar - Cr;\r\n const T2r = Br + Dr;\r\n const T3r = inv * (Br - Dr);\r\n\r\n // Final values\r\n out[outOff] = T0r + T2r;\r\n out[outOff + 1] = 0;\r\n out[outOff + 2] = T1r;\r\n out[outOff + 3] = -T3r;\r\n out[outOff + 4] = T0r - T2r;\r\n out[outOff + 5] = 0;\r\n out[outOff + 6] = T1r;\r\n out[outOff + 7] = T3r;\r\n }\r\n}\r\n\r\nmodule.exports = FFT\r\n","const { Tensor } = require(\"./tensor_utils.js\");\r\nconst {\r\n Callable,\r\n exists,\r\n log_softmax\r\n} = require(\"./utils.js\");\r\n\r\n/**\r\n * A class representing a list of logits processors. A logits processor is a function that modifies the logits\r\n * output of a language model. This class provides methods for adding new processors and applying all processors to a\r\n * batch of logits.\r\n *\r\n * @extends Callable\r\n */\r\nclass LogitsProcessorList extends Callable {\r\n /**\r\n * Constructs a new instance of `LogitsProcessorList`.\r\n */\r\n constructor() {\r\n super();\r\n this.processors = [];\r\n }\r\n\r\n /**\r\n * Adds a new logits processor to the list.\r\n *\r\n * @param {function} item - The logits processor function to add.\r\n */\r\n push(item) {\r\n this.processors.push(item);\r\n }\r\n\r\n /**\r\n * Adds multiple logits processors to the list.\r\n *\r\n * @param {function[]} items - The logits processor functions to add.\r\n */\r\n extend(items) {\r\n this.processors.push(...items);\r\n }\r\n\r\n /**\r\n * Applies all logits processors in the list to a batch of logits, modifying them in-place.\r\n *\r\n * @param {number[]} input_ids - The input IDs for the language model.\r\n * @param {number[][]} batchedLogits - A 2D array of logits, where each row corresponds to a single\r\n * input sequence in the batch.\r\n */\r\n _call(input_ids, batchedLogits) {\r\n // NOTE: This is different from the Python code, since vanilla JS does not support vectorized operations. \r\n // As a result, we apply each processor to each item in the batch.\r\n for (let logits of batchedLogits) {\r\n // Modifies logits inplace\r\n this.processors.forEach(\r\n func => func(input_ids, logits)\r\n )\r\n }\r\n }\r\n\r\n [Symbol.iterator]() {\r\n return this.processors.values();\r\n }\r\n}\r\n\r\n/**\r\n * Base class for processing logits.\r\n * @extends Callable\r\n */\r\nclass LogitsProcessor extends Callable {\r\n /**\r\n * Apply the processor to the input logits.\r\n *\r\n * @abstract\r\n * @param {Array} input_ids The input ids.\r\n * @param {Tensor} logits The logits to process.\r\n * @throws {Error} Throws an error if `_call` is not implemented in the subclass.\r\n */\r\n _call(input_ids, logits) {\r\n throw Error(\"`_call` should be implemented in a subclass\")\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that forces a specific token to be generated by the decoder.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass ForceTokensLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Constructs a new instance of `ForceTokensLogitsProcessor`.\r\n * \r\n * @param {Array} forced_decoder_ids The ids of tokens that should be forced.\r\n */\r\n constructor(forced_decoder_ids) {\r\n super();\r\n this.force_token_map = Object.fromEntries(forced_decoder_ids ?? []);\r\n }\r\n\r\n /**\r\n * Apply the processor to the input logits.\r\n *\r\n * @param {Array} input_ids The input ids.\r\n * @param {any} logits The logits to process.\r\n * @returns {Array} The processed logits.\r\n */\r\n _call(input_ids, logits) {\r\n let map = this.force_token_map[input_ids.length];\r\n if (exists(map)) { // There exists a mapping\r\n logits.data.fill(-Infinity)\r\n logits.data[map] = 0;\r\n }\r\n return logits;\r\n }\r\n}\r\n\r\n/**\r\n * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence.\r\n * @extends LogitsProcessor\r\n */\r\nclass ForcedBOSTokenLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a ForcedBOSTokenLogitsProcessor.\r\n * @param {number} bos_token_id - The ID of the beginning-of-sequence token to be forced.\r\n */\r\n constructor(bos_token_id) {\r\n super();\r\n this.bos_token_id = bos_token_id;\r\n }\r\n\r\n /**\r\n * Apply the BOS token forcing to the logits.\r\n * @param {Array} input_ids - The input IDs.\r\n * @param {Object} logits - The logits.\r\n * @returns {Object} The logits with BOS token forcing.\r\n */\r\n _call(input_ids, logits) {\r\n if (input_ids.length === 1) {\r\n logits.data.fill(-Infinity)\r\n logits.data[this.bos_token_id] = 0;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that forces end-of-sequence token probability to 1.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass ForcedEOSTokenLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a ForcedEOSTokenLogitsProcessor.\r\n * @param {number} max_length - Max length of the sequence.\r\n * @param {number} forced_eos_token_id - The ID of the end-of-sequence token to be forced.\r\n */\r\n constructor(max_length, forced_eos_token_id) {\r\n super();\r\n this.max_length = max_length;\r\n this.forced_eos_token_id = forced_eos_token_id;\r\n }\r\n\r\n /**\r\n * Apply the processor to input_ids and logits.\r\n * \r\n * @param {number[]} input_ids - The input ids.\r\n * @param {any} logits - The logits tensor.\r\n */\r\n _call(input_ids, logits) {\r\n // console.log('call ForcedEOSTokenLogitsProcessor')\r\n // TODO\r\n }\r\n}\r\n\r\n/**\r\n * A LogitsProcessor that handles adding timestamps to generated text.\r\n * @extends LogitsProcessor\r\n */\r\nclass WhisperTimeStampLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Constructs a new WhisperTimeStampLogitsProcessor.\r\n * @param {object} generate_config - The config object passed to the `generate()` method of a transformer model.\r\n * @param {number} generate_config.eos_token_id - The ID of the end-of-sequence token.\r\n * @param {number} generate_config.no_timestamps_token_id - The ID of the token used to indicate that a token should not have a timestamp.\r\n * @param {number[][]} [generate_config.forced_decoder_ids] - An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp.\r\n * @param {number} [generate_config.max_initial_timestamp_index] - The maximum index at which an initial timestamp can appear.\r\n */\r\n constructor(generate_config) {\r\n super();\r\n this.eos_token_id = generate_config.eos_token_id;\r\n this.no_timestamps_token_id = generate_config.no_timestamps_token_id;\r\n this.timestamp_begin = this.no_timestamps_token_id + 1;\r\n\r\n this.begin_index = (generate_config.forced_decoder_ids || []).length + 2;\r\n if (generate_config.forced_decoder_ids.slice(-1)[0][1] === this.no_timestamps_token_id) {\r\n this.begin_index -= 1;\r\n }\r\n this.max_initial_timestamp_index = generate_config.max_initial_timestamp_index;\r\n\r\n }\r\n\r\n /**\r\n * Modify the logits to handle timestamp tokens.\r\n * @param {Array} input_ids - The input sequence of tokens.\r\n * @param {Tensor} logits - The logits output by the model.\r\n * @returns {Tensor} - The modified logits.\r\n */\r\n _call(input_ids, logits) {\r\n // suppress <|notimestamps|> which is handled by without_timestamps\r\n logits.data[this.no_timestamps_token_id] = -Infinity;\r\n\r\n if (input_ids.length === this.begin_index - 1) {\r\n logits.data.fill(-Infinity);\r\n logits.data[this.timestamp_begin] = 0;\r\n return logits;\r\n }\r\n\r\n // timestamps have to appear in pairs, except directly before eos_token; mask logits accordingly\r\n const seq = input_ids.slice(this.begin_index);\r\n const last_was_timestamp = seq.length >= 1 && seq[seq.length - 1] >= this.timestamp_begin;\r\n const penultimate_was_timestamp = seq.length < 2 || seq[seq.length - 2] >= this.timestamp_begin;\r\n\r\n if (last_was_timestamp) {\r\n if (penultimate_was_timestamp) { // has to be non-timestamp\r\n logits.data.subarray(this.timestamp_begin).fill(-Infinity);\r\n } else { // cannot be normal text tokens\r\n logits.data.subarray(0, this.eos_token_id).fill(-Infinity);\r\n }\r\n }\r\n\r\n // apply the `max_initial_timestamp` option\r\n if (input_ids.length === this.begin_index && this.max_initial_timestamp_index !== null) {\r\n const last_allowed = this.timestamp_begin + this.max_initial_timestamp_index;\r\n logits.data.subarray(last_allowed + 1).fill(-Infinity);\r\n }\r\n\r\n // if sum of probability over timestamps is above any other token, sample timestamp\r\n const logprobs = log_softmax(logits.data);\r\n const timestamp_logprob = Math.log(logprobs.subarray(this.timestamp_begin).map(Math.exp).reduce((a, b) => a + b));\r\n const max_text_token_logprob = Math.max(...logprobs.subarray(0, this.timestamp_begin));\r\n if (timestamp_logprob > max_text_token_logprob) {\r\n logits.data.subarray(0, this.timestamp_begin).fill(-Infinity);\r\n }\r\n\r\n return logits;\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that disallows ngrams of a certain size to be repeated.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass NoRepeatNGramLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a NoRepeatNGramLogitsProcessor.\r\n * @param {number} no_repeat_ngram_size - The no-repeat-ngram size. All ngrams of this size can only occur once.\r\n */\r\n constructor(no_repeat_ngram_size) {\r\n super();\r\n this.no_repeat_ngram_size = no_repeat_ngram_size;\r\n }\r\n\r\n /**\r\n * Generate n-grams from a sequence of token ids.\r\n * @param {number[]} prevInputIds - List of previous input ids\r\n * @returns {Map} - Map of generated n-grams\r\n */\r\n getNgrams(prevInputIds) {\r\n const curLen = prevInputIds.length;\r\n\r\n /**@type {number[][]} */\r\n const ngrams = [];\r\n for (let j = 0; j < curLen + 1 - this.no_repeat_ngram_size; ++j) {\r\n const ngram = [];\r\n for (let k = 0; k < this.no_repeat_ngram_size; ++k) {\r\n ngram.push(prevInputIds[j + k]);\r\n }\r\n ngrams.push(ngram);\r\n }\r\n\r\n /** @type {Map} */\r\n const generatedNgram = new Map();\r\n for (const ngram of ngrams) {\r\n const prevNgram = ngram.slice(0, ngram.length - 1);\r\n const prevNgramKey = JSON.stringify(prevNgram);\r\n const prevNgramValue = generatedNgram.get(prevNgramKey) ?? [];\r\n prevNgramValue.push(ngram[ngram.length - 1]);\r\n generatedNgram.set(prevNgramKey, prevNgramValue);\r\n }\r\n return generatedNgram;\r\n }\r\n\r\n /**\r\n * Generate n-grams from a sequence of token ids.\r\n * @param {Map} bannedNgrams - Map of banned n-grams\r\n * @param {number[]} prevInputIds - List of previous input ids\r\n * @returns {number[]} - Map of generated n-grams\r\n */\r\n getGeneratedNgrams(bannedNgrams, prevInputIds) {\r\n const ngramIdx = prevInputIds.slice(prevInputIds.length + 1 - this.no_repeat_ngram_size, prevInputIds.length);\r\n const banned = bannedNgrams.get(JSON.stringify(ngramIdx)) ?? [];\r\n return banned;\r\n }\r\n\r\n /**\r\n * Calculate banned n-gram tokens\r\n * @param {number[]} prevInputIds - List of previous input ids\r\n * @returns {number[]} - Map of generated n-grams\r\n */\r\n calcBannedNgramTokens(prevInputIds) {\r\n const bannedTokens = [];\r\n if (prevInputIds.length + 1 < this.no_repeat_ngram_size) {\r\n // return no banned tokens if we haven't generated no_repeat_ngram_size tokens yet\r\n return bannedTokens;\r\n\r\n } else {\r\n const generatedNgrams = this.getNgrams(prevInputIds);\r\n const bannedTokens = this.getGeneratedNgrams(generatedNgrams, prevInputIds);\r\n return bannedTokens;\r\n }\r\n }\r\n\r\n /**\r\n * Apply the no-repeat-ngram processor to the logits.\r\n * @param {Array} input_ids - The input IDs.\r\n * @param {Object} logits - The logits.\r\n * @returns {Object} The logits with no-repeat-ngram processing.\r\n */\r\n _call(input_ids, logits) {\r\n const bannedTokens = this.calcBannedNgramTokens(input_ids);\r\n\r\n for (const token of bannedTokens) {\r\n logits.data[token] = -Infinity;\r\n }\r\n return logits;\r\n }\r\n}\r\n\r\n/**\r\n * A logits processor that penalises repeated output tokens.\r\n * \r\n * @extends LogitsProcessor\r\n */\r\nclass RepetitionPenaltyLogitsProcessor extends LogitsProcessor {\r\n /**\r\n * Create a RepetitionPenaltyLogitsProcessor.\r\n * @param {number} penalty - The penalty to apply for repeated tokens.\r\n */\r\n constructor(penalty) {\r\n super();\r\n this.penalty = penalty;\r\n }\r\n\r\n /**\r\n * Apply the repetition penalty to the logits.\r\n * @param {Array} input_ids - The input IDs.\r\n * @param {Object} logits - The logits.\r\n * @returns {Object} The logits with repetition penalty processing.\r\n */\r\n _call(input_ids, logits) {\r\n // Modify the logits corresponding to each element in `input_ids`.\r\n // As a consequence, the logits corresponding to tokens that appear\r\n // many times in the output will be penalised more.\r\n for (const input_id of input_ids) {\r\n if (logits.data[input_id] < 0) {\r\n logits.data[input_id] *= this.penalty;\r\n } else {\r\n logits.data[input_id] /= this.penalty;\r\n }\r\n }\r\n return logits\r\n }\r\n}\r\n\r\n\r\nclass GenerationConfig {\r\n constructor(kwargs = {}) {\r\n // Parameters that control the length of the output\r\n // TODO: extend the configuration with correct types\r\n /**\r\n * Create a GenerationConfig object\r\n * @constructor\r\n * @param {Object} [kwargs={}] - The configuration parameters\r\n * @param {number} [kwargs.max_length=20] - The maximum length of the generated text\r\n * @param {number} [kwargs.max_new_tokens=null] - The maximum number of new tokens to generate\r\n * @param {number} [kwargs.min_length=0] - The minimum length of the generated text\r\n * @param {number} [kwargs.min_new_tokens=null] - The minimum number of new tokens to generate\r\n * @param {boolean} [kwargs.early_stopping=false] - Whether to stop generation early if a stop token is encountered\r\n * @param {number} [kwargs.max_time=null] - The maximum amount of time to spend generating text\r\n * @param {boolean} [kwargs.do_sample=false] - Whether to use sampling when generating text\r\n * @param {number} [kwargs.num_beams=1] - The number of beams to use when generating text\r\n * @param {number} [kwargs.num_beam_groups=1] - The number of beam groups to use when generating text\r\n * @param {number} [kwargs.penalty_alpha=null] - The value of the alpha penalty to use when generating text\r\n * @param {boolean} [kwargs.use_cache=true] - Whether to use cache when generating text\r\n * @param {number} [kwargs.temperature=1.0] - The temperature to use when generating text\r\n * @param {number} [kwargs.top_k=50] - The value of k to use when generating text\r\n * @param {number} [kwargs.top_p=1.0] - The value of p to use when generating text\r\n * @param {number} [kwargs.typical_p=1.0] - The typical value of p to use when generating text\r\n * @param {number} [kwargs.epsilon_cutoff=0.0] - The value of epsilon cutoff to use when generating text\r\n * @param {number} [kwargs.eta_cutoff=0.0] - The value of eta cutoff to use when generating text\r\n * @param {number} [kwargs.diversity_penalty=0.0] - The value of diversity penalty to use when generating text\r\n * @param {number} [kwargs.repetition_penalty=1.0] - The value of repetition penalty to use when generating text\r\n * @param {number} [kwargs.encoder_repetition_penalty=1.0] - The value of encoder repetition penalty to use when generating text\r\n * @param {number} [kwargs.length_penalty=1.0] - The value of length\r\n * @param {number} [kwargs.no_repeat_ngram_size=0] - The size of the n-grams to avoid repeating in the generated output.\r\n * @param {?number[]} [kwargs.bad_words_ids=null] - An array of IDs representing tokens that should not be generated.\r\n * @param {?number[]} [kwargs.force_words_ids=null] - An array of IDs representing tokens that must be generated.\r\n * @param {boolean} [kwargs.renormalize_logits=false] - Whether or not to renormalize the logits before generating new tokens.\r\n * @param {?Object[]} [kwargs.constraints=null] - An array of constraint objects to apply during generation.\r\n */\r\n this.max_length = kwargs.max_length ?? 20;\r\n this.max_new_tokens = kwargs.max_new_tokens ?? null;\r\n this.min_length = kwargs.min_length ?? 0;\r\n this.min_new_tokens = kwargs.min_new_tokens ?? null;\r\n this.early_stopping = kwargs.early_stopping ?? false;\r\n this.max_time = kwargs.max_time ?? null;\r\n\r\n // Parameters that control the generation strategy used\r\n this.do_sample = kwargs.do_sample ?? false;\r\n this.num_beams = kwargs.num_beams ?? 1;\r\n this.num_beam_groups = kwargs.num_beam_groups ?? 1;\r\n this.penalty_alpha = kwargs.penalty_alpha ?? null;\r\n this.use_cache = kwargs.use_cache ?? true;\r\n\r\n // Parameters for manipulation of the model output logits\r\n this.temperature = kwargs.temperature ?? 1.0;\r\n this.top_k = kwargs.top_k ?? 50;\r\n this.top_p = kwargs.top_p ?? 1.0;\r\n this.typical_p = kwargs.typical_p ?? 1.0;\r\n this.epsilon_cutoff = kwargs.epsilon_cutoff ?? 0.0;\r\n this.eta_cutoff = kwargs.eta_cutoff ?? 0.0;\r\n this.diversity_penalty = kwargs.diversity_penalty ?? 0.0;\r\n this.repetition_penalty = kwargs.repetition_penalty ?? 1.0;\r\n this.encoder_repetition_penalty = kwargs.encoder_repetition_penalty ?? 1.0;\r\n this.length_penalty = kwargs.length_penalty ?? 1.0;\r\n this.no_repeat_ngram_size = kwargs.no_repeat_ngram_size ?? 0;\r\n this.bad_words_ids = kwargs.bad_words_ids ?? null;\r\n this.force_words_ids = kwargs.force_words_ids ?? null;\r\n this.renormalize_logits = kwargs.renormalize_logits ?? false;\r\n this.constraints = kwargs.constraints ?? null;\r\n this.forced_bos_token_id = kwargs.forced_bos_token_id ?? null;\r\n this.forced_eos_token_id = kwargs.forced_eos_token_id ?? null;\r\n this.remove_invalid_values = kwargs.remove_invalid_values ?? false;\r\n this.exponential_decay_length_penalty = kwargs.exponential_decay_length_penalty ?? null;\r\n this.suppress_tokens = kwargs.suppress_tokens ?? null;\r\n this.begin_suppress_tokens = kwargs.begin_suppress_tokens ?? null;\r\n this.forced_decoder_ids = kwargs.forced_decoder_ids ?? null;\r\n\r\n // Parameters that define the output variables of `generate`\r\n this.num_return_sequences = kwargs.num_return_sequences ?? 1;\r\n this.output_attentions = kwargs.output_attentions ?? false;\r\n this.output_hidden_states = kwargs.output_hidden_states ?? false;\r\n this.output_scores = kwargs.output_scores ?? false;\r\n this.return_dict_in_generate = kwargs.return_dict_in_generate ?? false;\r\n\r\n // Special tokens that can be used at generation time\r\n this.pad_token_id = kwargs.pad_token_id ?? null;\r\n this.bos_token_id = kwargs.bos_token_id ?? null;\r\n this.eos_token_id = kwargs.eos_token_id ?? null;\r\n\r\n // Generation parameters exclusive to encoder-decoder models\r\n this.encoder_no_repeat_ngram_size = kwargs.encoder_no_repeat_ngram_size ?? 0;\r\n this.decoder_start_token_id = kwargs.decoder_start_token_id ?? null;\r\n\r\n // Wild card\r\n this.generation_kwargs = kwargs.generation_kwargs ?? {};\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n LogitsProcessor,\r\n LogitsProcessorList,\r\n GenerationConfig,\r\n ForcedBOSTokenLogitsProcessor,\r\n ForcedEOSTokenLogitsProcessor,\r\n WhisperTimeStampLogitsProcessor,\r\n ForceTokensLogitsProcessor,\r\n NoRepeatNGramLogitsProcessor,\r\n RepetitionPenaltyLogitsProcessor\r\n};\r\n","\r\nconst fs = require('fs');\r\nconst { getFile, isString } = require('./utils.js');\r\nconst { env } = require('./env.js');\r\n\r\n// Will be empty (or not used) if running in browser or web-worker\r\nconst sharp = require('sharp');\r\n\r\nlet CanvasClass;\r\nlet ImageDataClass;\r\nlet loadImageFunction;\r\nif (typeof self !== 'undefined') {\r\n // Running in browser or web-worker\r\n CanvasClass = OffscreenCanvas;\r\n loadImageFunction = self.createImageBitmap;\r\n ImageDataClass = ImageData;\r\n\r\n} else if (sharp) {\r\n // Running in Node.js, electron, or other non-browser environment\r\n\r\n loadImageFunction = async (/**@type {sharp.Sharp}*/img) => {\r\n let { data, info } = await img.raw().toBuffer({ resolveWithObject: true });\r\n return new CustomImage(new Uint8ClampedArray(data), info.width, info.height, info.channels);\r\n }\r\n\r\n} else {\r\n throw new Error('Unable to load image processing library.');\r\n}\r\n\r\n\r\nclass CustomImage {\r\n\r\n /**\r\n * Create a new CustomImage object.\r\n * @param {Uint8ClampedArray} data - The pixel data.\r\n * @param {number} width - The width of the image.\r\n * @param {number} height - The height of the image.\r\n * @param {1|2|3|4} channels - The number of channels.\r\n */\r\n constructor(data, width, height, channels) {\r\n this._update(data, width, height, channels);\r\n }\r\n\r\n /**\r\n * Helper method for reading an image from a variety of input types.\r\n * @param {CustomImage|string|URL} input \r\n * @returns The image object.\r\n */\r\n static async read(input) {\r\n if (input instanceof CustomImage) {\r\n return input;\r\n } else if (isString(input) || input instanceof URL) {\r\n return await this.fromURL(input);\r\n } else {\r\n throw new Error(`Unsupported input type: ${typeof input}`);\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Read an image from a URL or file path.\r\n * @param {string|URL} url - The URL or file path to read the image from.\r\n * @returns {Promise} - The image object.\r\n */\r\n static async fromURL(url) {\r\n let response = await getFile(url);\r\n let blob = await response.blob();\r\n return this.fromBlob(blob);\r\n }\r\n\r\n /**\r\n * Helper method to create a new Image from a blob.\r\n * @param {Blob} blob - The blob to read the image from.\r\n * @returns {Promise} - The image object.\r\n */\r\n static async fromBlob(blob) {\r\n if (CanvasClass) {\r\n // Running in environment with canvas\r\n let img = await loadImageFunction(blob);\r\n\r\n const ctx = new CanvasClass(img.width, img.height).getContext('2d');\r\n\r\n // Draw image to context\r\n ctx.drawImage(img, 0, 0);\r\n\r\n return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4);\r\n\r\n } else {\r\n // Use sharp.js to read (and possible resize) the image.\r\n let img = sharp(await blob.arrayBuffer());\r\n\r\n return await loadImageFunction(img);\r\n }\r\n }\r\n\r\n /**\r\n * Convert the image to grayscale format.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n grayscale() {\r\n if (this.channels === 1) {\r\n return this;\r\n }\r\n\r\n let newData = new Uint8ClampedArray(this.width * this.height * 3);\r\n switch (this.channels) {\r\n case 3: // rgb to grayscale\r\n case 4: // rgba to grayscale\r\n for (let i = 0, offset = 0; i < this.data.length; i += this.channels) {\r\n const red = this.data[i];\r\n const green = this.data[i + 1];\r\n const blue = this.data[i + 2];\r\n\r\n newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue);\r\n }\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n return this._update(newData, this.width, this.height, 1);\r\n }\r\n\r\n /**\r\n * Convert the image to RGB format.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n rgb() {\r\n if (this.channels === 3) {\r\n return this;\r\n }\r\n\r\n let newData = new Uint8ClampedArray(this.width * this.height * 3);\r\n\r\n switch (this.channels) {\r\n case 1: // grayscale to rgb\r\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n }\r\n break;\r\n case 4: // rgba to rgb\r\n for (let i = 0, offset = 0; i < this.data.length; i += 4) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i + 1];\r\n newData[offset++] = this.data[i + 2];\r\n }\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n return this._update(newData, this.width, this.height, 3);\r\n\r\n }\r\n\r\n /**\r\n * Convert the image to RGBA format.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n rgba() {\r\n if (this.channels === 4) {\r\n return this;\r\n }\r\n\r\n let newData = new Uint8ClampedArray(this.width * this.height * 4);\r\n\r\n switch (this.channels) {\r\n case 1: // grayscale to rgba\r\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = 255;\r\n }\r\n break;\r\n case 3: // rgb to rgba\r\n for (let i = 0, offset = 0; i < this.data.length; i += 3) {\r\n newData[offset++] = this.data[i];\r\n newData[offset++] = this.data[i + 1];\r\n newData[offset++] = this.data[i + 2];\r\n newData[offset++] = 255;\r\n }\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n\r\n return this._update(newData, this.width, this.height, 4);\r\n }\r\n\r\n /**\r\n * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing.\r\n * @param {number} width - The width of the new image.\r\n * @param {number} height - The height of the new image.\r\n * @returns {Promise} - `this` to support chaining.\r\n */\r\n async resize(width, height) {\r\n if (CanvasClass) {\r\n // Store number of channels before resizing\r\n let numChannels = this.channels;\r\n\r\n // Create canvas object for this image\r\n let canvas = this.toCanvas();\r\n\r\n // Actually perform resizing using the canvas API\r\n const ctx = new CanvasClass(width, height).getContext('2d');\r\n\r\n // Draw image to context, resizing in the process\r\n ctx.drawImage(canvas, 0, 0, width, height);\r\n\r\n // Create image from the resized data\r\n let resizedImage = new CustomImage(ctx.getImageData(0, 0, width, height).data, width, height, 4);\r\n\r\n // Convert back so that image has the same number of channels as before\r\n return resizedImage.convert(numChannels);\r\n\r\n } else {\r\n // Create sharp image from raw data, and resize\r\n let img = sharp(this.data, {\r\n raw: {\r\n width: this.width,\r\n height: this.height,\r\n channels: this.channels\r\n }\r\n }).resize({\r\n // https://github.com/lovell/sharp/blob/main/docs/api-resize.md\r\n width, height,\r\n fit: 'fill',\r\n kernel: 'cubic'\r\n });\r\n return await loadImageFunction(img);\r\n }\r\n\r\n }\r\n\r\n toCanvas() {\r\n // Clone, and convert data to RGBA before drawing to canvas.\r\n // This is because the canvas API only supports RGBA\r\n let cloned = this.clone().rgba();\r\n\r\n // Create canvas object for the cloned image\r\n let clonedCanvas = new CanvasClass(cloned.width, cloned.height);\r\n\r\n // Draw image to context\r\n let data = new ImageDataClass(cloned.data, cloned.width, cloned.height);\r\n clonedCanvas.getContext('2d').putImageData(data, 0, 0);\r\n\r\n return clonedCanvas;\r\n }\r\n\r\n /**\r\n * Helper method to update the image data.\r\n * @param {Uint8ClampedArray} data - The new image data.\r\n * @param {number} width - The new width of the image.\r\n * @param {number} height - The new height of the image.\r\n * @param {1|2|3|4} channels - The new number of channels of the image.\r\n */\r\n _update(data, width, height, channels = null) {\r\n this.data = data;\r\n this.width = width;\r\n this.height = height;\r\n if (channels !== null) {\r\n this.channels = channels;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Clone the image\r\n * @returns {CustomImage} - The cloned image\r\n */\r\n clone() {\r\n return new CustomImage(this.data.slice(), this.width, this.height, this.channels);\r\n }\r\n\r\n /**\r\n * Helper method for converting image to have a certain number of channels\r\n * @param {number} numChannels - The number of channels. Must be 1, 3, or 4.\r\n * @returns {CustomImage} - `this` to support chaining.\r\n */\r\n convert(numChannels) {\r\n if (this.channels === numChannels) return this; // Already correct number of channels\r\n\r\n switch (numChannels) {\r\n case 1:\r\n this.grayscale();\r\n break;\r\n case 3:\r\n this.rgb();\r\n break;\r\n case 4:\r\n this.rgba();\r\n break;\r\n default:\r\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Save the image to the given path. This method is only available in environments with access to the FileSystem.\r\n * @param {string|Buffer|URL} path - The path to save the image to.\r\n * @param {string} [mime='image/png'] - The mime type of the image.\r\n */\r\n save(path, mime = 'image/png') {\r\n if (!env.useFS) {\r\n throw new Error('Unable to save the image because filesystem is disabled in this environment.')\r\n }\r\n\r\n let canvas = this.toCanvas();\r\n const buffer = canvas.toBuffer(mime);\r\n fs.writeFileSync(path, buffer);\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n CustomImage,\r\n};\r\n","\r\n/**\r\n * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray\r\n * @typedef {BigInt64Array | BigUint64Array} BigTypedArray\r\n * @typedef {TypedArray | BigTypedArray} AnyTypedArray\r\n */\r\n\r\n/**\r\n * @param {TypedArray} input\r\n */\r\nfunction interpolate(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) {\r\n // TODO use mode and align_corners\r\n\r\n // Output image dimensions\r\n const x_scale = out_width / in_width;\r\n const y_scale = out_height / in_height;\r\n\r\n // Output image\r\n // @ts-ignore\r\n const out_img = new input.constructor(out_height * out_width * in_channels);\r\n\r\n // Pre-calculate strides\r\n const inStride = in_height * in_width;\r\n const outStride = out_height * out_width;\r\n\r\n for (let i = 0; i < out_height; ++i) {\r\n for (let j = 0; j < out_width; ++j) {\r\n // Calculate output offset\r\n const outOffset = i * out_width + j;\r\n\r\n // Calculate input pixel coordinates\r\n const x = (j + 0.5) / x_scale - 0.5;\r\n const y = (i + 0.5) / y_scale - 0.5;\r\n\r\n // Calculate the four nearest input pixels\r\n // We also check if the input pixel coordinates are within the image bounds\r\n let x1 = Math.floor(x);\r\n let y1 = Math.floor(y);\r\n const x2 = Math.min(x1 + 1, in_width - 1);\r\n const y2 = Math.min(y1 + 1, in_height - 1);\r\n\r\n x1 = Math.max(x1, 0);\r\n y1 = Math.max(y1, 0);\r\n\r\n\r\n // Calculate the fractional distances between the input pixel and the four nearest pixels\r\n const s = x - x1;\r\n const t = y - y1;\r\n\r\n // Perform bilinear interpolation\r\n const w1 = (1 - s) * (1 - t);\r\n const w2 = s * (1 - t);\r\n const w3 = (1 - s) * t;\r\n const w4 = s * t;\r\n\r\n // Calculate the four nearest input pixel indices\r\n const yStride = y1 * in_width;\r\n const xStride = y2 * in_width;\r\n const idx1 = yStride + x1;\r\n const idx2 = yStride + x2;\r\n const idx3 = xStride + x1;\r\n const idx4 = xStride + x2;\r\n\r\n for (let k = 0; k < in_channels; ++k) {\r\n // Calculate channel offset\r\n const cOffset = k * inStride;\r\n\r\n out_img[k * outStride + outOffset] =\r\n w1 * input[cOffset + idx1] +\r\n w2 * input[cOffset + idx2] +\r\n w3 * input[cOffset + idx3] +\r\n w4 * input[cOffset + idx4];\r\n }\r\n }\r\n }\r\n\r\n return out_img;\r\n}\r\n\r\n\r\n/**\r\n * Helper method to transpose a AnyTypedArray directly\r\n * @param {T} array \r\n * @template {AnyTypedArray} T \r\n * @param {number[]} dims \r\n * @param {number[]} axes \r\n * @returns {[T, number[]]} The transposed array and the new shape.\r\n */\r\nfunction transpose_data(array, dims, axes) {\r\n // Calculate the new shape of the transposed array\r\n // and the stride of the original array\r\n const shape = new Array(axes.length);\r\n const stride = new Array(axes.length);\r\n\r\n for (let i = axes.length - 1, s = 1; i >= 0; --i) {\r\n stride[i] = s;\r\n shape[i] = dims[axes[i]];\r\n s *= shape[i];\r\n }\r\n\r\n // Precompute inverse mapping of stride\r\n const invStride = axes.map((_, i) => stride[axes.indexOf(i)]);\r\n\r\n // Create the transposed array with the new shape\r\n // @ts-ignore\r\n const transposedData = new array.constructor(array.length);\r\n\r\n // Transpose the original array to the new array\r\n for (let i = 0; i < array.length; ++i) {\r\n let newIndex = 0;\r\n for (let j = dims.length - 1, k = i; j >= 0; --j) {\r\n newIndex += (k % dims[j]) * invStride[j];\r\n k = Math.floor(k / dims[j]);\r\n }\r\n transposedData[newIndex] = array[i];\r\n }\r\n\r\n return [transposedData, shape];\r\n}\r\n\r\nmodule.exports = {\r\n interpolate,\r\n transpose: transpose_data,\r\n}\r\n","const {\r\n Callable,\r\n getModelFile,\r\n fetchJSON,\r\n dispatchCallback,\r\n isIntegralNumber,\r\n} = require(\"./utils.js\");\r\n\r\nconst {\r\n Sampler,\r\n} = require(\"./samplers.js\");\r\n\r\n\r\nconst {\r\n LogitsProcessorList,\r\n GenerationConfig,\r\n ForceTokensLogitsProcessor,\r\n ForcedBOSTokenLogitsProcessor,\r\n ForcedEOSTokenLogitsProcessor,\r\n WhisperTimeStampLogitsProcessor,\r\n NoRepeatNGramLogitsProcessor,\r\n RepetitionPenaltyLogitsProcessor\r\n} = require(\"./generation.js\");\r\n\r\nconst { executionProviders, ONNX } = require('./backends/onnx.js');\r\nconst {\r\n Tensor,\r\n cat\r\n} = require('./tensor_utils');\r\nconst { InferenceSession, Tensor: ONNXTensor } = ONNX;\r\n\r\n//////////////////////////////////////////////////\r\n// Helper functions\r\n/**\r\n * Constructs an InferenceSession using a model file located at the specified path.\r\n * @param {string} modelPath - The path to the directory containing the model file.\r\n * @param {string} fileName - The name of the model file.\r\n * @param {function} [progressCallback=null] - An optional function to track progress during the creation of the session.\r\n * @returns {Promise} - A Promise that resolves to an InferenceSession object.\r\n */\r\nasync function constructSession(modelPath, fileName, progressCallback = null) {\r\n let buffer = await getModelFile(modelPath, fileName, progressCallback);\r\n\r\n // TODO add option for user to force specify their desired execution provider\r\n try {\r\n return await InferenceSession.create(buffer, {\r\n executionProviders,\r\n });\r\n } catch (err) {\r\n console.warn(err);\r\n console.warn(\r\n 'Something went wrong during model construction (most likely a missing operation). ' +\r\n 'Using `wasm` as a fallback. '\r\n )\r\n return await InferenceSession.create(buffer, {\r\n executionProviders: ['wasm']\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Executes an InferenceSession using the specified inputs.\r\n * @param {InferenceSession} session - The InferenceSession object to run.\r\n * @param {Object} inputs - An object that maps input names to input tensors.\r\n * @returns {Promise} - A Promise that resolves to an object that maps output names to output tensors.\r\n */\r\nasync function sessionRun(session, inputs) {\r\n try {\r\n let output = await session.run(inputs);\r\n output = replaceTensors(output);\r\n return output;\r\n } catch (e) {\r\n console.error(`An error occurred during model execution: \"${e}\".`);\r\n console.error('Inputs given to model:', inputs);\r\n throw e;\r\n }\r\n}\r\n\r\n/**\r\n * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions.\r\n * @param {Object} obj - The object to replace tensor objects in.\r\n * @returns {Object} - The object with tensor objects replaced by custom Tensor objects.\r\n */\r\nfunction replaceTensors(obj) {\r\n // Convert ONNX Tensors with our custom Tensor class\r\n // to support additional functions\r\n for (let prop in obj) {\r\n if (obj[prop] instanceof ONNXTensor) {\r\n obj[prop] = new Tensor(obj[prop]);\r\n }\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Prepares an attention mask for a sequence of tokens based on configuration options.\r\n * @param {Object} self - The calling object instance.\r\n * @param {Tensor} tokens - The input tokens.\r\n * @returns {Tensor} - The attention mask tensor.\r\n */\r\nfunction _prepare_attention_mask(self, tokens) {\r\n\r\n // Prepare attention mask\r\n let pad_token_id = self.config.pad_token_id ?? null;\r\n let eos_token_id = self.config.eos_token_id ?? null;\r\n if (isIntegralNumber(eos_token_id)) {\r\n eos_token_id = [eos_token_id];\r\n }\r\n\r\n let is_pad_token_in_inputs = tokens.indexOf(pad_token_id) !== -1;\r\n let is_pad_token_not_equal_to_eos_token_id = (eos_token_id === null) || !eos_token_id.includes(pad_token_id)\r\n\r\n if (is_pad_token_in_inputs && is_pad_token_not_equal_to_eos_token_id) {\r\n let data = BigInt64Array.from(\r\n // Note: != so that int matches bigint\r\n tokens.data.map(x => x != pad_token_id)\r\n )\r\n return new Tensor('int64', data, tokens.dims)\r\n } else {\r\n return new Tensor(\r\n 'int64',\r\n new BigInt64Array(tokens.data.length).fill(1n),\r\n tokens.dims\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * Creates a boolean tensor with a single value.\r\n * @param {boolean} value - The value of the tensor.\r\n * @returns {Tensor} - The boolean tensor.\r\n */\r\nfunction boolTensor(value) {\r\n // Create boolean tensor\r\n return new Tensor('bool', [value], [1]);\r\n}\r\n\r\n// JS doesn't support mixins, so we define some reused functions here, and allow \"this\" to be passed in\r\n/**\r\n * Loads a sequence-to-sequence model from the specified path.\r\n * @param {string} modelPath - The path to the model directory.\r\n * @param {function} progressCallback - The optional progress callback function.\r\n * @returns {Promise<[any, any, any, any]>} - A promise that resolves with information about the loaded model.\r\n */\r\nasync function seq2seqLoadModel(modelPath, progressCallback) {\r\n let info = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'encoder_model.onnx', progressCallback),\r\n constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback),\r\n fetchJSON(modelPath, 'generation_config.json', progressCallback, false),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n return info;\r\n}\r\n\r\n/**\r\n * Perform forward pass on the seq2seq model.\r\n * @async\r\n * @function\r\n * @param {Object} self - The seq2seq model object.\r\n * @param {Object} model_inputs - The input object for the model containing encoder and decoder inputs.\r\n * @param {Object} options - The options\r\n * @param {string} [options.encoder_input_name='input_ids'] - The name of the input tensor for the encoder.\r\n * @param {boolean} [options.add_decoder_pkv=true] - Flag to add the decoder past key values.\r\n * @returns {Promise} - Promise that resolves with the output of the seq2seq model.\r\n */\r\nasync function seq2seq_forward(self, model_inputs, {\r\n encoder_input_name = 'input_ids',\r\n add_decoder_pkv = true\r\n} = {}) {\r\n let encoderOutputs = model_inputs.encoder_outputs;\r\n let pastKeyValues = model_inputs.past_key_values;\r\n\r\n if (encoderOutputs === null) {\r\n const encoderFeeds = {\r\n [encoder_input_name]: model_inputs[encoder_input_name],\r\n }\r\n\r\n if (self.session.inputNames.includes('attention_mask')) {\r\n encoderFeeds.attention_mask = model_inputs.attention_mask\r\n }\r\n const encoderResults = await sessionRun(self.session, encoderFeeds);\r\n encoderOutputs = encoderResults.last_hidden_state;\r\n }\r\n let decoderFeeds = {\r\n input_ids: model_inputs.decoder_input_ids,\r\n encoder_hidden_states: encoderOutputs,\r\n use_cache_branch: boolTensor(pastKeyValues !== null)\r\n };\r\n\r\n if (self.decoder_merged_session.inputNames.includes('encoder_attention_mask')) {\r\n decoderFeeds.encoder_attention_mask = model_inputs.attention_mask\r\n }\r\n self.addPastKeyValues(decoderFeeds, pastKeyValues, add_decoder_pkv);\r\n\r\n const decoderResults = await sessionRun(self.decoder_merged_session, decoderFeeds);\r\n let logits = decoderResults.logits;\r\n pastKeyValues = self.getPastKeyValues(decoderResults, pastKeyValues);\r\n return new Seq2SeqLMOutput(logits, pastKeyValues, encoderOutputs);\r\n}\r\n\r\n/**\r\n * Start the beam search process for the seq2seq model.\r\n * @function\r\n * @param {Object} self - The seq2seq model object.\r\n * @param {Object[]} inputTokenIds - Array of input token ids for each input sequence.\r\n * @param {number} numOutputTokens - The maximum number of output tokens for the model.\r\n * @param {boolean} [requires_attention_mask=true] - Flag to indicate if the model requires an attention mask.\r\n * @returns {Object[]} - Array of beam search objects.\r\n */\r\nfunction seq2seqStartBeams(self, inputTokenIds, numOutputTokens, requires_attention_mask = true) {\r\n let beams = [];\r\n let beamId = 0;\r\n for (let tokens of inputTokenIds) {\r\n // TODO: Improve\r\n // Currently, just add back batch dimension.\r\n // In future, allow for true parallel execution\r\n tokens.dims = [1, ...tokens.dims]\r\n\r\n // Create beam\r\n let start = {\r\n inputs: tokens,\r\n encoder_outputs: null,\r\n past_key_values: null,\r\n\r\n // decoder_input_ids == output_token_ids\r\n output_token_ids: [self.config.decoder_start_token_id],\r\n done: false,\r\n score: 0,\r\n id: beamId++ // assign unique id to beams\r\n }\r\n\r\n if (requires_attention_mask) {\r\n start.attention_mask = _prepare_attention_mask(self, tokens);\r\n }\r\n\r\n beams.push(start);\r\n }\r\n\r\n return beams;\r\n}\r\n\r\n/**\r\n * Run beam search on the seq2seq model for a single beam.\r\n * @async\r\n * @function\r\n * @param {Object} self - The seq2seq model object.\r\n * @param {Object} beam - The beam search object for which to run the model.\r\n * @param {Object} options - options\r\n * @param {string} [options.input_name='input_ids'] - The name of the input tensor for the encoder.\r\n * @returns {Promise} - Promise that resolves with the output of the seq2seq model for the given beam.\r\n */\r\nasync function seq2seqRunBeam(self, beam, {\r\n input_name = 'input_ids',\r\n} = {}\r\n) {\r\n // 1. Prepare\r\n let model_inputs = {\r\n [input_name]: beam.inputs,\r\n decoder_input_ids: self.toI64Tensor(beam.output_token_ids.slice(-1)),\r\n encoder_outputs: beam.encoder_outputs,\r\n past_key_values: beam.past_key_values,\r\n }\r\n if (beam.attention_mask) {\r\n model_inputs.attention_mask = beam.attention_mask\r\n }\r\n\r\n // 2. Run\r\n let output = await self.forward(model_inputs);\r\n\r\n // 3. Update\r\n beam.past_key_values = output.past_key_values;\r\n beam.encoder_outputs = output.encoder_outputs;\r\n\r\n return output;\r\n}\r\n\r\n/**\r\n * Forward pass of the text generation model.\r\n * @async\r\n * @function\r\n * @param {Object} self - The text generation model object.\r\n * @param {Object} model_inputs - The input data to be used for the forward pass.\r\n * @returns {Promise} - Promise that resolves with an object containing the logits and past key values.\r\n */\r\nasync function textgen_forward(self, model_inputs) {\r\n let past_key_values = model_inputs.past_key_values;\r\n let decoderFeeds = {\r\n input_ids: model_inputs.input_ids,\r\n attention_mask: model_inputs.attention_mask,\r\n use_cache_branch: boolTensor(past_key_values !== null)\r\n }\r\n self.addPastKeyValues(decoderFeeds, past_key_values)\r\n\r\n let decoderResults = await sessionRun(self.session, decoderFeeds);\r\n let logits = decoderResults.logits;\r\n\r\n past_key_values = self.getPastKeyValues(decoderResults, past_key_values);\r\n return { logits, past_key_values };\r\n}\r\n\r\n/**\r\n * Starts the generation of text by initializing the beams for the given input token IDs.\r\n * @param {Object} self - The text generation model object.\r\n * @param {any} inputTokenIds - An array of input token IDs to generate text from.\r\n * @param {number} numOutputTokens - The maximum number of tokens to generate for each beam.\r\n * @param {Tensor} [inputs_attention_mask] - The attention mask tensor for the input token IDs.\r\n * @returns {Object[]} An array of beams initialized with the given inputs and parameters.\r\n */\r\nfunction textgenStartBeams(self, inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n let beams = [];\r\n\r\n let beamId = 0;\r\n for (let tokens of inputTokenIds) {\r\n // TODO: Improve\r\n // Currently, just add back batch dimension.\r\n // In future, allow for true parallel execution\r\n tokens.dims = [1, ...tokens.dims]\r\n\r\n let attn_mask;\r\n if (inputs_attention_mask) {\r\n attn_mask = inputs_attention_mask.get(beamId)\r\n attn_mask.dims = [1, ...attn_mask.dims]\r\n\r\n } else {\r\n attn_mask = _prepare_attention_mask(self, tokens)\r\n }\r\n\r\n let start = {\r\n input: tokens,\r\n model_input_ids: tokens,\r\n attention_mask: attn_mask,\r\n past_key_values: null,\r\n\r\n output_token_ids: [],\r\n num_output_tokens: numOutputTokens,\r\n\r\n done: false,\r\n score: 0,\r\n id: beamId++ // assign unique id to beams\r\n }\r\n\r\n beams.push(start);\r\n }\r\n return beams;\r\n}\r\n\r\n/**\r\n * Runs a single step of the text generation process for a given beam.\r\n *\r\n * @async\r\n * @function textgenRunBeam\r\n * @param {Object} self - The textgen object.\r\n * @param {Object} beam - The beam to run.\r\n * @param {Tensor} beam.input - The input tensor.\r\n * @param {Tensor} beam.model_input_ids - The input ids to the model.\r\n * @param {Tensor} beam.attention_mask - The attention mask.\r\n * @param {Object} beam.past_key_values - The past key values.\r\n * @param {number[]} beam.output_token_ids - The output token ids.\r\n * @returns {Promise} The output of the generation step.\r\n */\r\nasync function textgenRunBeam(self, beam) {\r\n let attnMaskData = new BigInt64Array(beam.input.data.length + beam.output_token_ids.length).fill(1n)\r\n\r\n // 1. Prepare\r\n let model_inputs = {\r\n input_ids: beam.model_input_ids,\r\n attention_mask: new Tensor(\r\n 'int64',\r\n attnMaskData,\r\n [1, attnMaskData.length]\r\n ),\r\n past_key_values: beam.past_key_values,\r\n }\r\n\r\n // 2. Run\r\n let output = await self.forward(model_inputs);\r\n\r\n // 3. Update\r\n beam.past_key_values = output.past_key_values;\r\n\r\n return output;\r\n}\r\n\r\n/**\r\n * Update a beam with a new token ID.\r\n * @param {object} beam - The beam to update.\r\n * @param {number} newTokenId - The new token ID to add to the beam's output.\r\n */\r\nfunction textgenUpdatebeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n beam.model_input_ids = new Tensor('int64', [BigInt(newTokenId)], [1, 1]);\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// Base class\r\n/**\r\n * A base class for pre-trained models that provides the model configuration and an ONNX session.\r\n * @extends Callable\r\n */\r\nclass PreTrainedModel extends Callable {\r\n /**\r\n * Creates a new instance of the `PreTrainedModel` class.\r\n * @param {object} config - The model configuration.\r\n * @param {any} session - session for the model.\r\n */\r\n constructor(config, session) {\r\n super();\r\n\r\n this.config = config;\r\n this.session = session;\r\n }\r\n\r\n /**\r\n * Disposes of all the ONNX sessions that were created during inference.\r\n * @returns {Promise} - An array of promises, one for each ONNX session that is being disposed.\r\n */\r\n async dispose() {\r\n // Dispose of all ONNX sessions sessions\r\n // TODO use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\r\n\r\n let promises = [];\r\n for (let key of Object.keys(this)) {\r\n let item = this[key];\r\n if (item instanceof InferenceSession) {\r\n promises.push(item.handler.dispose())\r\n }\r\n }\r\n return await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from the given modelPath.\r\n * @static\r\n * @async\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} progressCallback - A function to be called with progress updates.\r\n * @returns {Promise} A new instance of the PreTrainedModel class.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let config = await fetchJSON(modelPath, 'config.json', progressCallback);\r\n let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx';\r\n\r\n // Load model\r\n let session = await constructSession(modelPath, modelName, progressCallback);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n return new this(config, session);\r\n }\r\n\r\n /**\r\n * Converts an array or Tensor of integers to an int64 Tensor.\r\n * @param {Array|Tensor} items - The input integers to be converted.\r\n * @returns {Tensor} The int64 Tensor with the converted values.\r\n * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length.\r\n */\r\n toI64Tensor(items) {\r\n if (items instanceof Tensor) {\r\n return items;\r\n }\r\n // items is an array\r\n if (items.length === 0) {\r\n throw Error(\"items must be non-empty\");\r\n }\r\n\r\n if (Array.isArray(items[0])) {\r\n // batched\r\n if (items.some(x => x.length !== items[0].length)) {\r\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.\")\r\n }\r\n\r\n return new Tensor('int64',\r\n BigInt64Array.from(items.flat().map(x => BigInt(x))),\r\n [items.length, items[0].length]\r\n );\r\n } else {\r\n //flat\r\n return new Tensor('int64',\r\n BigInt64Array.from(items.map(x => BigInt(x))),\r\n [1, items.length]\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Runs the model with the provided inputs\r\n * @param {Object} model_inputs - Object containing input tensors\r\n * @returns {Promise} - Object containing output tensors\r\n */\r\n async _call(model_inputs) {\r\n return await sessionRun(this.session, model_inputs);\r\n }\r\n\r\n /**\r\n * Forward method should be implemented in subclasses.\r\n * @abstract\r\n * @param {object} model_inputs - The input data to the model in the format specified in the ONNX model.\r\n * @returns {Promise} - The output data from the model in the format specified in the ONNX model.\r\n * @throws {Error} - This method must be implemented in subclasses.\r\n */\r\n async forward(model_inputs) {\r\n throw Error(\"forward should be implemented in subclasses.\")\r\n }\r\n\r\n /**\r\n * @param {GenerationConfig} generation_config \r\n * @param {number} input_ids_seq_length \r\n * @returns {LogitsProcessorList}\r\n */\r\n _get_logits_processor(\r\n generation_config,\r\n input_ids_seq_length,\r\n // encoder_input_ids, TODO\r\n // prefix_allowed_tokens_fn, TODO\r\n logits_processor = null\r\n ) {\r\n const processors = new LogitsProcessorList();\r\n\r\n // if (generation_config.diversity_penalty !== null && generation_config.diversity_penalty > 0.0) {\r\n // processors.push(new HammingDiversityLogitsProcessor(\r\n // generation_config.diversity_penalty,\r\n // generation_config.num_beams,\r\n // generation_config.num_beam_groups\r\n // ));\r\n // }\r\n\r\n // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== 1.0) {\r\n // processors.push(new EncoderRepetitionPenaltyLogitsProcessor(\r\n // generation_config.encoder_repetition_penalty,\r\n // encoder_input_ids\r\n // ));\r\n // }\r\n\r\n if (generation_config.repetition_penalty !== null && generation_config.repetition_penalty !== 1.0) {\r\n processors.push(new RepetitionPenaltyLogitsProcessor(generation_config.repetition_penalty));\r\n }\r\n\r\n if (generation_config.no_repeat_ngram_size !== null && generation_config.no_repeat_ngram_size > 0) {\r\n processors.push(new NoRepeatNGramLogitsProcessor(generation_config.no_repeat_ngram_size));\r\n }\r\n\r\n // if (generation_config.encoder_no_repeat_ngram_size !== null && generation_config.encoder_no_repeat_ngram_size > 0) {\r\n // if (this.config.is_encoder_decoder) {\r\n // processors.push(new EncoderNoRepeatNGramLogitsProcessor(\r\n // generation_config.encoder_no_repeat_ngram_size,\r\n // encoder_input_ids\r\n // ));\r\n // } else {\r\n // throw new Error(\"It's impossible to use `encoder_no_repeat_ngram_size` with decoder-only architecture\");\r\n // }\r\n // }\r\n\r\n // if (generation_config.bad_words_ids !== null) {\r\n // processors.push(new NoBadWordsLogitsProcessor(generation_config.bad_words_ids, generation_config.eos_token_id));\r\n // }\r\n\r\n // if (generation_config.min_length !== null && generation_config.eos_token_id !== null && generation_config.min_length > 0) {\r\n // processors.push(new MinLengthLogitsProcessor(generation_config.min_length, generation_config.eos_token_id));\r\n // }\r\n\r\n // if (generation_config.min_new_tokens !== null && generation_config.eos_token_id !== null && generation_config.min_new_tokens > 0) {\r\n // processors.push(new MinNewTokensLengthLogitsProcessor(\r\n // input_ids_seq_length,\r\n // generation_config.min_new_tokens,\r\n // generation_config.eos_token_id\r\n // ));\r\n // }\r\n\r\n // if (prefix_allowed_tokens_fn !== null) {\r\n // processors.push(new PrefixConstrainedLogitsProcessor(\r\n // prefix_allowed_tokens_fn,\r\n // generation_config.num_beams / generation_config.num_beam_groups\r\n // ));\r\n // }\r\n\r\n\r\n if (generation_config.forced_bos_token_id !== null) {\r\n processors.push(new ForcedBOSTokenLogitsProcessor(generation_config.forced_bos_token_id));\r\n }\r\n\r\n if (generation_config.forced_eos_token_id !== null) {\r\n processors.push(new ForcedEOSTokenLogitsProcessor(\r\n generation_config.max_length,\r\n generation_config.forced_eos_token_id\r\n ));\r\n }\r\n\r\n // if (generation_config.remove_invalid_values === true) {\r\n // processors.push(new InfNanRemoveLogitsProcessor());\r\n // }\r\n\r\n // if (generation_config.exponential_decay_length_penalty !== null) {\r\n // processors.push(new ExponentialDecayLengthPenalty(\r\n // generation_config.exponential_decay_length_penalty,\r\n // generation_config.eos_token_id,\r\n // input_ids_seq_length\r\n // ));\r\n // }\r\n\r\n // if (generation_config.suppress_tokens !== null) {\r\n // processors.push(new SuppressTokensLogitsProcessor(generation_config.suppress_tokens));\r\n // }\r\n\r\n // if (generation_config.begin_suppress_tokens !== null) {\r\n // let begin_index = input_ids_seq_length;\r\n // begin_index = (input_ids_seq_length > 1 || generation_config.forced_bos_token_id === null) ? begin_index : begin_index + 1;\r\n // if (generation_config.forced_decoder_ids !== null) {\r\n // begin_index += generation_config.forced_decoder_ids[generation_config.forced_decoder_ids.length - 1][0];\r\n // }\r\n // processors.push(new SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, begin_index));\r\n // }\r\n\r\n if (generation_config.forced_decoder_ids !== null) {\r\n processors.push(new ForceTokensLogitsProcessor(generation_config.forced_decoder_ids));\r\n }\r\n\r\n if (logits_processor !== null) {\r\n processors.extend(logits_processor)\r\n }\r\n\r\n // `LogitNormalization` should always be the last logit processor, when present\r\n // if (generation_config.renormalize_logits === true) {\r\n // processors.push(new LogitNormalization());\r\n // }\r\n\r\n return processors;\r\n }\r\n\r\n /**\r\n * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation.\r\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.\r\n *\r\n * @param {GenerationConfig} generation_config - A `GenerationConfig` object containing generation parameters.\r\n * @returns {GenerationConfig} The final generation config object to be used by the model for text generation.\r\n */\r\n _get_generation_config(generation_config) {\r\n // Create empty generation config (contains defaults)\r\n let gen_config = new GenerationConfig();\r\n\r\n // Apply model's generation config, if it exists\r\n if ('generation_config' in this) {\r\n Object.assign(gen_config, this.generation_config);\r\n }\r\n\r\n // Finally, use any generation config specified by the user\r\n // when calling `generate`\r\n if (generation_config !== null) {\r\n Object.assign(gen_config, generation_config);\r\n }\r\n return gen_config;\r\n }\r\n\r\n /**\r\n * Generates text based on the given inputs and generation configuration using the model.\r\n * @param {Array} inputs - An array of input token IDs.\r\n * @param {Object|null} generation_config - The generation configuration to use. If null, default configuration will be used.\r\n * @param {Object|null} logits_processor - An optional logits processor to use. If null, a new LogitsProcessorList instance will be created.\r\n * @param {Object} options - options\r\n * @param {Object} [options.inputs_attention_mask=null] - An optional attention mask for the inputs.\r\n * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs.\r\n * @throws {Error} Throws an error if the inputs array is empty.\r\n */\r\n async generate(\r\n inputs,\r\n generation_config = null,\r\n logits_processor = null,\r\n {\r\n inputs_attention_mask = null\r\n } = {},\r\n ) {\r\n\r\n if (inputs.length === 0) {\r\n throw Error(\"Must supply a non-empty array of input token ids.\")\r\n }\r\n\r\n // Update generation config with defaults\r\n generation_config = this._get_generation_config(generation_config);\r\n\r\n logits_processor = logits_processor ?? new LogitsProcessorList()\r\n\r\n // TODO Update generation config\r\n // this.generation_config\r\n\r\n // Update logits processor\r\n logits_processor = this._get_logits_processor(\r\n generation_config,\r\n inputs.length,\r\n logits_processor\r\n )\r\n\r\n // TODO implement early_stopping\r\n // https://huggingface.co/blog/how-to-generate\r\n\r\n let numOutputTokens = 1;\r\n const maxOutputTokens = numOutputTokens + (generation_config.max_new_tokens ?? Infinity);\r\n\r\n let sampler = Sampler.getSampler(generation_config);\r\n\r\n let beams = this.getStartBeams(inputs, numOutputTokens, inputs_attention_mask);\r\n\r\n while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) {\r\n let newest_beams = [];\r\n for (let beam of beams) {\r\n if (beam.done) {\r\n // TODO add length penalty (for ending early)\r\n // Add this beam back into the pool\r\n newest_beams.push(beam);\r\n continue\r\n }\r\n\r\n let output = await this.runBeam(beam);\r\n\r\n // Logits are of the form [batch_size, out_seq_length, vocab_size]\r\n // In most cases, this will be [batch_size, 1, vocab_size]\r\n // So, we select the last token's logits:\r\n // (equivalent to `logits = outputs.logits[:, -1, :]`)\r\n let extractedLogits = [];\r\n for (const batch of output.logits) {\r\n // Extract logits corresponding to the last token\r\n let lastLogits = batch.get(batch.dims[0] - 1);\r\n\r\n // Add back batch dimension (needed for `cat`)\r\n lastLogits.dims = [1, ...lastLogits.dims];\r\n extractedLogits.push(lastLogits)\r\n }\r\n let logits = cat(extractedLogits);\r\n logits_processor(beam.output_token_ids, logits)\r\n\r\n let sampledTokens = sampler(logits);\r\n for (let [newTokenId, logProb] of sampledTokens) {\r\n // use previous beam as a starting point\r\n let newBeam = { ...beam };\r\n\r\n // update new beam\r\n this.updateBeam(newBeam, newTokenId);\r\n\r\n newBeam.score += logProb;\r\n\r\n if (newTokenId === this.config.eos_token_id) {\r\n newBeam.done = true;\r\n }\r\n newest_beams.push(newBeam);\r\n }\r\n }\r\n ++numOutputTokens;\r\n\r\n // Next, we get the best beams, per ID\r\n newest_beams = this.groupBeams(newest_beams).map(\r\n group => group\r\n .sort((a, b) => b.score - a.score) // sort based on score\r\n .slice(0, generation_config.num_beams) // remove outside beam width\r\n );\r\n\r\n // Flatten beams\r\n beams = newest_beams.flat();\r\n\r\n // Run callback\r\n if (generation_config.callback_function) {\r\n generation_config.callback_function(beams);\r\n }\r\n }\r\n\r\n return this.groupBeams(beams).map(\r\n batch => {\r\n if (generation_config.num_return_sequences > 1) {\r\n return batch.slice(0, generation_config.num_return_sequences).map(x => x.output_token_ids);\r\n } else {\r\n return [batch[0].output_token_ids];\r\n }\r\n }\r\n )\r\n }\r\n\r\n /**\r\n * Groups an array of beam objects by their ids.\r\n *\r\n * @param {Array} beams - The array of beam objects to group.\r\n * @returns {Array} - An array of arrays, where each inner array contains beam objects with the same id.\r\n */\r\n groupBeams(beams) {\r\n // Group beams by their ids\r\n const groups = {};\r\n for (const obj of beams) {\r\n if (groups[obj.id] === undefined) {\r\n groups[obj.id] = [obj];\r\n } else {\r\n groups[obj.id].push(obj);\r\n }\r\n }\r\n\r\n return Object.values(groups);\r\n }\r\n\r\n /**\r\n * Returns an object containing past key values from the given decoder results object.\r\n *\r\n * @param {Object} decoderResults - The decoder results object.\r\n * @param {Object} pastKeyValues - The previous past key values.\r\n * @returns {Object} - An object containing past key values.\r\n */\r\n getPastKeyValues(decoderResults, pastKeyValues) {\r\n\r\n const pkvs = {};\r\n\r\n for (const name in decoderResults) {\r\n if (name.startsWith('present')) {\r\n let newName = name.replace('present', 'past_key_values');\r\n\r\n if (pastKeyValues !== null && name.includes('encoder')) {\r\n // Optimization introduced by optimum to reuse past key values. So, we just replace the constant\r\n // outputs with the previous past key values.\r\n // https://github.com/huggingface/optimum/blob/0bf2c05fb7e1182b52d21b703cfc95fd9e4ea3dc/optimum/onnxruntime/base.py#L677-L704\r\n pkvs[newName] = pastKeyValues[newName];\r\n } else {\r\n pkvs[newName] = decoderResults[name];\r\n }\r\n }\r\n }\r\n return pkvs;\r\n }\r\n\r\n /**\r\n * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.\r\n *\r\n * @param {Object} decoderFeeds - The decoder feeds object to add past key values to.\r\n * @param {Object} pastKeyValues - An object containing past key values.\r\n * @param {boolean} [hasDecoder=false] - Whether the model has a decoder.\r\n */\r\n addPastKeyValues(decoderFeeds, pastKeyValues, hasDecoder = false) {\r\n if (pastKeyValues === null) {\r\n // TODO support batches (i.e., batch_size > 1)\r\n if (hasDecoder) {\r\n let encoder_dims = [1, this.num_encoder_heads, 0, this.encoder_dim_kv];\r\n for (let i = 0; i < this.num_encoder_layers; ++i) {\r\n decoderFeeds[`past_key_values.${i}.encoder.key`] = new Tensor('float32', [], encoder_dims)\r\n decoderFeeds[`past_key_values.${i}.encoder.value`] = new Tensor('float32', [], encoder_dims)\r\n }\r\n\r\n let decoder_dims = [1, this.num_decoder_heads, 0, this.decoder_dim_kv];\r\n for (let i = 0; i < this.num_decoder_layers; ++i) {\r\n decoderFeeds[`past_key_values.${i}.decoder.key`] = new Tensor('float32', [], decoder_dims)\r\n decoderFeeds[`past_key_values.${i}.decoder.value`] = new Tensor('float32', [], decoder_dims)\r\n }\r\n\r\n } else {\r\n let dims = [1, this.num_heads, 0, this.dim_kv]\r\n for (let i = 0; i < this.num_layers; ++i) {\r\n decoderFeeds[`past_key_values.${i}.key`] = new Tensor('float32', [], dims)\r\n decoderFeeds[`past_key_values.${i}.value`] = new Tensor('float32', [], dims)\r\n }\r\n }\r\n\r\n } else {\r\n Object.assign(decoderFeeds, pastKeyValues)\r\n }\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n// Base model output class\r\nclass ModelOutput { }\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// Bert models\r\nclass BertPreTrainedModel extends PreTrainedModel { }\r\nclass BertModel extends BertPreTrainedModel { }\r\n\r\n/**\r\n * BertForMaskedLM is a class representing a BERT model for masked language modeling.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForMaskedLM extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for masked language modeling.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * BertForSequenceClassification is a class representing a BERT model for sequence classification.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForSequenceClassification extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for sequence classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * BertForTokenClassification is a class representing a BERT model for token classification.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForTokenClassification extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for token classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new TokenClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * BertForQuestionAnswering is a class representing a BERT model for question answering.\r\n * @extends BertPreTrainedModel\r\n */\r\nclass BertForQuestionAnswering extends BertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for question answering.\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// DistilBert models\r\nclass DistilBertPreTrainedModel extends PreTrainedModel { }\r\nclass DistilBertModel extends DistilBertPreTrainedModel { }\r\n\r\n/**\r\n * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForSequenceClassification extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for sequence classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForTokenClassification extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for token classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new TokenClassifierOutput(logits)\r\n }\r\n}\r\n\r\n\r\n/**\r\n * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForQuestionAnswering extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for question answering.\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n\r\n/**\r\n * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task.\r\n * @extends DistilBertPreTrainedModel\r\n */\r\nclass DistilBertForMaskedLM extends DistilBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// MobileBert models\r\nclass MobileBertPreTrainedModel extends PreTrainedModel { }\r\nclass MobileBertModel extends MobileBertPreTrainedModel { }\r\n\r\n/**\r\n * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task.\r\n * @extends MobileBertPreTrainedModel\r\n */\r\nclass MobileBertForMaskedLM extends MobileBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * @extends MobileBertPreTrainedModel\r\n */\r\nclass MobileBertForSequenceClassification extends MobileBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * @extends MobileBertPreTrainedModel\r\n */\r\nclass MobileBertForQuestionAnswering extends MobileBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// SqueezeBert models\r\nclass SqueezeBertPreTrainedModel extends PreTrainedModel { }\r\nclass SqueezeBertModel extends SqueezeBertPreTrainedModel { }\r\nclass SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\nclass SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\nclass SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// Albert models\r\nclass AlbertPreTrainedModel extends PreTrainedModel { }\r\nclass AlbertModel extends AlbertPreTrainedModel { }\r\nclass AlbertForSequenceClassification extends AlbertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\nclass AlbertForQuestionAnswering extends AlbertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\nclass AlbertForMaskedLM extends AlbertPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// T5 models\r\nclass T5PreTrainedModel extends PreTrainedModel { };\r\n\r\nclass T5Model extends T5PreTrainedModel {\r\n /**\r\n * Generates text based on the provided arguments.\r\n * @throws {Error} - Throws an error as the current model class (T5Model) is not compatible with `.generate()`.\r\n * @returns {Promise}\r\n * @param {any[]} args\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * T5Model is a class representing a T5 model for conditional generation.\r\n * @extends T5PreTrainedModel\r\n */\r\nclass T5ForConditionalGeneration extends T5PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `T5ForConditionalGeneration` class.\r\n * @param {object} config - The model configuration.\r\n * @param {any} session - session for the model.\r\n * @param {any} decoder_merged_session - session for the decoder.\r\n * @param {GenerationConfig} generation_config - The generation configuration.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.num_decoder_layers;\r\n this.num_decoder_heads = this.config.num_heads;\r\n this.decoder_dim_kv = this.config.d_kv;\r\n\r\n this.num_encoder_layers = this.config.num_layers;\r\n this.num_encoder_heads = this.config.num_heads;\r\n this.encoder_dim_kv = this.config.d_kv;\r\n }\r\n\r\n /**\r\n * Loads the pre-trained model from a given path.\r\n * @async\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} progressCallback - A function to call with progress updates (optional).\r\n * @returns {Promise} The loaded model instance.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Generates the start beams for a given set of inputs and output length.\r\n * @param {number[][]} inputs - The input token IDs.\r\n * @param {number} numOutputTokens - The desired output length.\r\n * @returns {Array} The start beams.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with a new token ID.\r\n * @param {any} beam - The current beam.\r\n * @param {number} newTokenId - The new token ID to add to the output sequence.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model for a given set of inputs.\r\n * @async\r\n * @param {Object} model_inputs - The model inputs.\r\n * @returns {Promise} The model output.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// MT5 models\r\nclass MT5PreTrainedModel extends PreTrainedModel { };\r\n\r\nclass MT5Model extends MT5PreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args\r\n * @returns {Promise}\r\n * @throws {Error}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (MT5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'MT5ForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * A class representing a conditional sequence-to-sequence model based on the MT5 architecture.\r\n *\r\n * @extends MT5PreTrainedModel\r\n */\r\nclass MT5ForConditionalGeneration extends MT5PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `MT5ForConditionalGeneration` class.\r\n * @param {any} config - The model configuration.\r\n * @param {any} session - The ONNX session containing the encoder weights.\r\n * @param {any} decoder_merged_session - The ONNX session containing the merged decoder weights.\r\n * @param {GenerationConfig} generation_config - The generation configuration.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.num_decoder_layers;\r\n this.num_decoder_heads = this.config.num_heads;\r\n this.decoder_dim_kv = this.config.d_kv;\r\n\r\n this.num_encoder_layers = this.config.num_layers;\r\n this.num_encoder_heads = this.config.num_heads;\r\n this.encoder_dim_kv = this.config.d_kv;\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from the given path.\r\n *\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function that is called with the download progress percentage (0-100).\r\n * @returns {Promise} - A Promise that resolves to a new `MT5ForConditionalGeneration` instance.\r\n * @static\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Generates the start beams for the given input tokens and output sequence length.\r\n *\r\n * @param {any[]} inputs - The input sequence.\r\n * @param {number} numOutputTokens - The desired length of the output sequence.\r\n * @param {...*} args - Additional arguments to pass to the `seq2seqStartBeams` function.\r\n * @returns {any[]} - An array of `Beam` objects representing the start beams.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new predicted token.\r\n * @param {any} beam - The beam to update.\r\n * @param {number} newTokenId - The index of the predicted token.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model on the given inputs.\r\n * @param {any} model_inputs - The model inputs.\r\n * @returns {Promise} - A Promise that resolves to the model outputs.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// Bart models\r\nclass BartPretrainedModel extends PreTrainedModel { };\r\n\r\n/**\r\n * BART encoder and decoder model.\r\n * \r\n * @hideconstructor\r\n * @extends BartPretrainedModel\r\n */\r\nclass BartModel extends BartPretrainedModel {\r\n /**\r\n * Throws an error because the current model class (BartModel) is not compatible with `.generate()`.\r\n * \r\n * @async\r\n * @throws {Error} The current model class (BartModel) is not compatible with `.generate()`.\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (BartModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'BartForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * BART model with a language model head for conditional generation.\r\n * @extends BartPretrainedModel\r\n */\r\nclass BartForConditionalGeneration extends BartPretrainedModel {\r\n /**\r\n * Creates a new instance of the `BartForConditionalGeneration` class.\r\n * @param {object} config - The configuration object for the Bart model.\r\n * @param {object} session - The ONNX session used to execute the model.\r\n * @param {object} decoder_merged_session - The ONNX session used to execute the decoder.\r\n * @param {object} generation_config - The generation configuration object.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.decoder_layers;\r\n this.num_decoder_heads = this.config.decoder_attention_heads;\r\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\r\n\r\n this.num_encoder_layers = this.config.encoder_layers;\r\n this.num_encoder_heads = this.config.encoder_attention_heads;\r\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\r\n }\r\n\r\n /**\r\n * Loads a BartForConditionalGeneration instance from a pretrained model stored on disk.\r\n * @param {string} modelPath - The path to the directory containing the pretrained model.\r\n * @param {function} [progressCallback=null] - An optional callback function to track the download progress.\r\n * @returns {Promise} - The pretrained BartForConditionalGeneration instance.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Returns the initial beam for generating output text.\r\n * @param {object} inputs - The input object containing the encoded input text.\r\n * @param {number} numOutputTokens - The maximum number of output tokens to generate.\r\n * @param {...any} args - Additional arguments to pass to the sequence-to-sequence generation function.\r\n * @returns {any} - The initial beam for generating output text.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the beam by appending the newly generated token ID to the list of output token IDs.\r\n * @param {any} beam - The current beam being generated.\r\n * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model for a given set of inputs.\r\n * @async\r\n * @param {Object} model_inputs - The model inputs.\r\n * @returns {Promise} The model output.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n\r\nclass BartForSequenceClassification extends BartPretrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - An object containing the model's output logits for sequence classification.\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// Roberta models\r\nclass RobertaPreTrainedModel extends PreTrainedModel { }\r\nclass RobertaModel extends RobertaPreTrainedModel { }\r\n\r\n/**\r\n * RobertaForMaskedLM class for performing masked language modeling on Roberta models.\r\n * @extends RobertaPreTrainedModel\r\n */\r\nclass RobertaForMaskedLM extends RobertaPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new MaskedLMOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * RobertaForSequenceClassification class for performing sequence classification on Roberta models.\r\n * @extends RobertaPreTrainedModel\r\n */\r\nclass RobertaForSequenceClassification extends RobertaPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n\r\n/**\r\n * RobertaForQuestionAnswering class for performing question answering on Roberta models.\r\n * @extends RobertaPreTrainedModel\r\n */\r\nclass RobertaForQuestionAnswering extends RobertaPreTrainedModel {\r\n /**\r\n * Calls the model on new inputs.\r\n *\r\n * @param {Object} model_inputs - The inputs to the model.\r\n * @returns {Promise} - returned object\r\n */\r\n async _call(model_inputs) {\r\n let outputs = await super._call(model_inputs);\r\n return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// T5 models\r\nclass WhisperPreTrainedModel extends PreTrainedModel { };\r\n\r\n/**\r\n * WhisperModel class for training Whisper models without a language model head.\r\n * @extends WhisperPreTrainedModel\r\n */\r\nclass WhisperModel extends WhisperPreTrainedModel {\r\n /**\r\n * Throws an error when attempting to generate output since this model doesn't have a language model head.\r\n * @throws Error\r\n * @returns {Promise}\r\n * @param {any[]} args\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (WhisperModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'WhisperForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.\r\n * @extends WhisperPreTrainedModel\r\n */\r\nclass WhisperForConditionalGeneration extends WhisperPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `WhisperForConditionalGeneration` class.\r\n * @param {Object} config - Configuration object for the model.\r\n * @param {Object} session - ONNX Session object for the model.\r\n * @param {Object} decoder_merged_session - ONNX Session object for the decoder.\r\n * @param {Object} generation_config - Configuration object for the generation process.\r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.decoder_layers;\r\n this.num_decoder_heads = this.config.decoder_attention_heads;\r\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\r\n\r\n this.num_encoder_layers = this.config.encoder_layers;\r\n this.num_encoder_heads = this.config.encoder_attention_heads;\r\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\r\n\r\n\r\n }\r\n\r\n /**\r\n * Generates outputs based on input and generation configuration.\r\n * @param {Object} inputs - Input data for the model.\r\n * @param {Object} generation_config - Configuration object for the generation process.\r\n * @param {Object} logits_processor - Optional logits processor object.\r\n * @returns {Promise} Promise object represents the generated outputs.\r\n */\r\n async generate(\r\n inputs,\r\n generation_config = null,\r\n logits_processor = null,\r\n ) {\r\n // Create generation config object\r\n generation_config = this._get_generation_config(generation_config);\r\n\r\n\r\n // Whisper has additional options for returning timestamps\r\n generation_config.return_timestamps ??= false;\r\n\r\n // TODO add language and task\r\n\r\n if (generation_config.return_timestamps) {\r\n logits_processor = [new WhisperTimeStampLogitsProcessor(generation_config)]\r\n }\r\n\r\n return super.generate(inputs, generation_config, logits_processor)\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from a saved model directory.\r\n * @param {string} modelPath - Path to the saved model directory.\r\n * @param {function} progressCallback - Optional function for tracking loading progress.\r\n * @returns {Promise} Promise object represents the loaded model.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Gets the start beams for generating outputs.\r\n * @param {Array} inputTokenIds - Array of input token IDs.\r\n * @param {number} numOutputTokens - Number of output tokens to generate.\r\n * @returns {Array} Array of start beams.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, ...args) {\r\n // arguments ignored in this case\r\n return seq2seqStartBeams(this, inputTokenIds, numOutputTokens, false);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam, {\r\n input_name: 'input_features',\r\n });\r\n }\r\n\r\n /**\r\n * Updates the beam by appending the newly generated token ID to the list of output token IDs.\r\n * @param {any} beam - The current beam being generated.\r\n * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Runs the forward pass of the model for a given set of inputs.\r\n * @async\r\n * @param {Object} model_inputs - The model inputs.\r\n * @returns {Promise} The model output.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs, {\r\n encoder_input_name: 'input_features',\r\n });\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n/**\r\n * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks\r\n * @extends PreTrainedModel\r\n */\r\nclass VisionEncoderDecoderModel extends PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `VisionEncoderDecoderModel` class.\r\n * @param {object} config - The configuration object specifying the hyperparameters and other model settings.\r\n * @param {object} session - The ONNX session containing the encoder model.\r\n * @param {any} decoder_merged_session - The ONNX session containing the merged decoder model.\r\n */\r\n constructor(config, session, decoder_merged_session) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n\r\n this.num_layers = this.config.decoder.n_layer;\r\n this.num_heads = this.config.decoder.n_head;\r\n this.dim_kv = this.config.decoder.n_embd / this.num_heads;\r\n }\r\n\r\n /**\r\n * Loads a VisionEncoderDecoderModel from the given path.\r\n *\r\n * @param {string} modelPath - The path to the folder containing the saved model files.\r\n * @param {function} [progressCallback=null] - Optional callback function to track the progress of model loading.\r\n * @returns {Promise} A Promise that resolves with the loaded VisionEncoderDecoderModel instance.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session, decoder_merged_session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'encoder_model.onnx', progressCallback),\r\n constructSession(modelPath, 'decoder_merged_session.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n return new this(config, session, decoder_merged_session);\r\n }\r\n\r\n /**\r\n * Generate beam search outputs for the given input pixels and number of output tokens.\r\n *\r\n * @param {array} inputs - The input pixels as a Tensor.\r\n * @param {number} numOutputTokens - The number of output tokens to generate.\r\n * @param {...*} args - Optional additional arguments to pass to seq2seqStartBeams.\r\n * @returns {any} An array of Beam objects representing the top-K output sequences.\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return seq2seqRunBeam(this, beam, {\r\n input_name: 'pixel_values',\r\n });\r\n }\r\n\r\n /**\r\n * Update the given beam with the additional predicted token ID.\r\n *\r\n * @param {any} beam - The current beam.\r\n * @param {number} newTokenId - The new predicted token ID to add to the beam's output sequence.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * Compute the forward pass of the model on the given input tensors.\r\n *\r\n * @param {object} model_inputs - The input tensors as an object with keys 'pixel_values' and 'decoder_input_ids'.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs, {\r\n encoder_input_name: 'pixel_values',\r\n add_decoder_pkv: false\r\n })\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// CLIP models\r\nclass CLIPPreTrainedModel extends PreTrainedModel { }\r\nclass CLIPModel extends CLIPPreTrainedModel {\r\n\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\n// GPT2 models\r\nclass GPT2PreTrainedModel extends PreTrainedModel { }\r\n/**\r\n * GPT2Model is not compatible with `.generate()`, as it doesn't have a language model head.\r\n * @extends GPT2PreTrainedModel\r\n */\r\nclass GPT2Model extends GPT2PreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args \r\n * @throws {Error}\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (GPT2Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'GPT2LMHeadModel'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks.\r\n * @extends GPT2PreTrainedModel\r\n */\r\nclass GPT2LMHeadModel extends GPT2PreTrainedModel {\r\n /**\r\n * Creates a new instance of the `GPT2LMHeadModel` class.\r\n * @param {object} config - The configuration of the model.\r\n * @param {any} session - The ONNX session containing the model weights.\r\n */\r\n constructor(config, session) {\r\n super(config, session);\r\n\r\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\r\n this.config.pad_token_id = this.config.eos_token_id\r\n\r\n this.num_heads = this.config.n_head\r\n this.num_layers = this.config.n_layer\r\n this.dim_kv = this.config.n_embd / this.num_heads;\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {Tensor} inputTokenIds - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @param {Tensor} inputs_attention_mask - Optional input attention mask.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask)\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await textgenRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new generated token id.\r\n * @param {any} beam - The Beam object representing the beam.\r\n * @param {number} newTokenId - The new generated token id to be added to the beam.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n return textgenUpdatebeam(beam, newTokenId);\r\n }\r\n\r\n /**\r\n * Forward pass for the model.\r\n * @param {object} model_inputs - The inputs for the model.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await textgen_forward(this, model_inputs)\r\n }\r\n\r\n}\r\n// class GPT2ForSequenceClassification extends GPT2PreTrainedModel {\r\n// TODO\r\n// }\r\n//////////////////////////////////////////////////\r\nclass GPTNeoPreTrainedModel extends PreTrainedModel { }\r\nclass GPTNeoModel extends GPTNeoPreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args \r\n * @throws {Error}\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (GPTNeoModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'GPTNeoForCausalLM'}\"\r\n )\r\n }\r\n}\r\n\r\nclass GPTNeoForCausalLM extends GPTNeoPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `GPTNeoForCausalLM` class.\r\n * @param {object} config - The configuration of the model.\r\n * @param {any} session - The ONNX session containing the model weights.\r\n */\r\n constructor(config, session) {\r\n super(config, session);\r\n\r\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\r\n this.config.pad_token_id = this.config.eos_token_id\r\n\r\n this.num_heads = this.config.num_heads;\r\n this.num_layers = this.config.num_layers;\r\n this.dim_kv = this.config.hidden_size / this.num_heads;\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {Tensor} inputTokenIds - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @param {Tensor} inputs_attention_mask - Optional input attention mask.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask)\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await textgenRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new generated token id.\r\n * @param {any} beam - The Beam object representing the beam.\r\n * @param {number} newTokenId - The new generated token id to be added to the beam.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n return textgenUpdatebeam(beam, newTokenId);\r\n }\r\n\r\n /**\r\n * Forward pass for the model.\r\n * @param {object} model_inputs - The inputs for the model.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await textgen_forward(this, model_inputs)\r\n }\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n// CodeGen models\r\nclass CodeGenPreTrainedModel extends PreTrainedModel { }\r\n/**\r\n * CodeGenModel is a class representing a code generation model without a language model head.\r\n * \r\n * @extends CodeGenPreTrainedModel\r\n */\r\nclass CodeGenModel extends CodeGenPreTrainedModel {\r\n /**\r\n * Throws an error indicating that the current model class is not compatible with `.generate()`,\r\n * as it doesn't have a language model head.\r\n * \r\n * @throws {Error} The current model class is not compatible with `.generate()`\r\n * \r\n * @param {...any} args - Arguments passed to the generate function\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (CodeGenModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'CodeGenForCausalLM'}\"\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class.\r\n * @extends CodeGenPreTrainedModel\r\n */\r\nclass CodeGenForCausalLM extends CodeGenPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `CodeGenForCausalLM` class.\r\n * @param {object} config The model configuration object.\r\n * @param {object} session The ONNX session object.\r\n */\r\n constructor(config, session) {\r\n super(config, session);\r\n\r\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\r\n this.config.pad_token_id = this.config.eos_token_id\r\n\r\n this.num_heads = this.config.n_head\r\n this.num_layers = this.config.n_layer\r\n this.dim_kv = this.config.n_embd / this.num_heads;\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {Tensor} inputTokenIds - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @param {Tensor} inputs_attention_mask - Optional input attention mask.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n */\r\n getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) {\r\n return textgenStartBeams(this, inputTokenIds, numOutputTokens, inputs_attention_mask)\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await textgenRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * Updates the given beam with the new generated token id.\r\n * @param {any} beam - The Beam object representing the beam.\r\n * @param {number} newTokenId - The new generated token id to be added to the beam.\r\n */\r\n updateBeam(beam, newTokenId) {\r\n return textgenUpdatebeam(beam, newTokenId);\r\n }\r\n\r\n /**\r\n * Forward pass for the model.\r\n * @param {object} model_inputs - The inputs for the model.\r\n * @returns {Promise} The output tensor of the model.\r\n */\r\n async forward(model_inputs) {\r\n return await textgen_forward(this, model_inputs)\r\n }\r\n\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\nclass ViTPreTrainedModel extends PreTrainedModel { }\r\nclass ViTForImageClassification extends ViTPreTrainedModel {\r\n /**\r\n * @param {any} model_inputs\r\n */\r\n async _call(model_inputs) {\r\n let logits = (await super._call(model_inputs)).logits;\r\n return new SequenceClassifierOutput(logits)\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\nclass DetrPreTrainedModel extends PreTrainedModel { }\r\nclass DetrForObjectDetection extends DetrPreTrainedModel {\r\n /**\r\n * @param {any} model_inputs\r\n */\r\n async _call(model_inputs) {\r\n let output = (await super._call(model_inputs));\r\n return new DetrObjectDetectionOutput(output.logits, output.pred_boxes)\r\n }\r\n}\r\n\r\nclass DetrForSegmentation extends DetrPreTrainedModel {\r\n /**\r\n * Runs the model with the provided inputs\r\n * @param {Object} model_inputs - Model inputs\r\n * @returns {Promise} - Object containing segmentation outputs\r\n */\r\n async _call(model_inputs) {\r\n let output = (await super._call(model_inputs));\r\n return new DetrSegmentationOutput(output.logits, output.pred_boxes, output.pred_masks);\r\n }\r\n}\r\n\r\nclass DetrObjectDetectionOutput extends ModelOutput {\r\n /**\r\n * @param {any} logits\r\n * @param {any} pred_boxes\r\n */\r\n constructor(logits, pred_boxes) {\r\n super();\r\n this.logits = logits;\r\n this.pred_boxes = pred_boxes;\r\n }\r\n}\r\n\r\nclass DetrSegmentationOutput extends ModelOutput {\r\n\r\n /**\r\n * @param {Tensor} logits - The output logits of the model.\r\n * @param {Tensor} pred_boxes - Predicted boxes.\r\n * @param {Tensor} pred_masks - Predicted masks.\r\n */\r\n constructor(logits, pred_boxes, pred_masks) {\r\n super();\r\n this.logits = logits;\r\n this.pred_boxes = pred_boxes;\r\n this.pred_masks = pred_masks;\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// MarianMT models\r\nclass MarianPreTrainedModel extends PreTrainedModel { };\r\n\r\nclass MarianModel extends MarianPreTrainedModel {\r\n /**\r\n * \r\n * @param {...any} args \r\n * @throws {Error}\r\n * @returns {Promise}\r\n */\r\n async generate(...args) {\r\n throw Error(\r\n \"The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}\"\r\n )\r\n }\r\n}\r\n\r\nclass MarianMTModel extends MarianPreTrainedModel {\r\n /**\r\n * Creates a new instance of the `MarianMTModel` class.\r\n * @param {object} config The model configuration object.\r\n * @param {object} session The ONNX session object.\r\n * @param {any} decoder_merged_session \r\n * @param {any} generation_config \r\n */\r\n constructor(config, session, decoder_merged_session, generation_config) {\r\n super(config, session);\r\n this.decoder_merged_session = decoder_merged_session;\r\n this.generation_config = generation_config;\r\n\r\n this.num_decoder_layers = this.config.decoder_layers;\r\n this.num_decoder_heads = this.config.decoder_attention_heads;\r\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\r\n\r\n this.num_encoder_layers = this.config.encoder_layers;\r\n this.num_encoder_heads = this.config.encoder_attention_heads;\r\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\r\n }\r\n\r\n /**\r\n * @param {string} modelPath\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n return new this(...info);\r\n }\r\n\r\n /**\r\n * Initializes and returns the beam for text generation task\r\n * @param {any[]} inputs - The input token ids.\r\n * @param {number} numOutputTokens - The number of tokens to be generated.\r\n * @returns {any} A Beam object representing the initialized beam.\r\n * @param {any[]} args\r\n */\r\n getStartBeams(inputs, numOutputTokens, ...args) {\r\n return seq2seqStartBeams(this, inputs, numOutputTokens);\r\n }\r\n\r\n /**\r\n * Runs a single step of the beam search generation algorithm.\r\n * @param {any} beam - The current beam being generated.\r\n * @returns {Promise} - The updated beam after a single generation step.\r\n */\r\n async runBeam(beam) {\r\n return await seq2seqRunBeam(this, beam);\r\n }\r\n\r\n /**\r\n * @param {any} beam\r\n * @param {any} newTokenId\r\n */\r\n updateBeam(beam, newTokenId) {\r\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\r\n }\r\n\r\n /**\r\n * @param {any} model_inputs\r\n * @returns {Promise}\r\n */\r\n async forward(model_inputs) {\r\n return await seq2seq_forward(this, model_inputs);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n// AutoModels, used to simplify construction of PreTrainedModels\r\n// (uses config to instantiate correct class)\r\n/**\r\n * Helper class to determine model type from config\r\n */\r\nclass AutoModel {\r\n // Helper class to determine model type from config\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertModel,\r\n 'albert': AlbertModel,\r\n 'distilbert': DistilBertModel,\r\n 't5': T5Model,\r\n 'mt5': MT5Model,\r\n 'gpt2': GPT2Model,\r\n 'gpt_neo': GPTNeoModel,\r\n 'codegen': CodeGenModel,\r\n 'bart': BartModel,\r\n 'roberta': RobertaModel,\r\n 'whisper': WhisperModel,\r\n 'clip': CLIPModel,\r\n 'mobilebert': MobileBertModel,\r\n 'squeezebert': SqueezeBertModel,\r\n 'marian': MarianModel,\r\n }\r\n\r\n /**\r\n * Instantiates a pre-trained model based on the given model path and config.\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} progressCallback - Optional. A callback function that can be used to track loading progress.\r\n * @returns {Promise} - A promise that resolves to an instance of a pre-trained model.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let config = await fetchJSON(modelPath, 'config.json', progressCallback);\r\n let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx';\r\n\r\n let session = await constructSession(modelPath, modelName, progressCallback);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n console.warn(`Unknown model class \"${config.model_type}\", attempting to construct from base class.`);\r\n cls = PreTrainedModel;\r\n }\r\n return new cls(config, session)\r\n }\r\n}\r\n\r\n/**\r\n * Helper class for loading sequence classification models from pretrained checkpoints\r\n */\r\nclass AutoModelForSequenceClassification {\r\n\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForSequenceClassification,\r\n 'albert': AlbertForSequenceClassification,\r\n 'distilbert': DistilBertForSequenceClassification,\r\n 'roberta': RobertaForSequenceClassification,\r\n 'bart': BartForSequenceClassification,\r\n 'mobilebert': MobileBertForSequenceClassification,\r\n 'squeezebert': SqueezeBertForSequenceClassification,\r\n }\r\n\r\n /**\r\n * Load a sequence classification model from a pretrained checkpoint\r\n * @param {string} modelPath - The path to the model checkpoint directory\r\n * @param {function} [progressCallback=null] - An optional callback function to receive progress updates\r\n * @returns {Promise} A promise that resolves to a pre-trained sequence classification model\r\n * @throws {Error} if an unsupported model type is encountered\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback)\r\n ]);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Helper class for loading token classification models from pretrained checkpoints\r\n */\r\nclass AutoModelForTokenClassification {\r\n\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForTokenClassification,\r\n 'distilbert': DistilBertForTokenClassification,\r\n }\r\n\r\n /**\r\n * Load a token classification model from a pretrained checkpoint\r\n * @param {string} modelPath - The path to the model checkpoint directory\r\n * @param {function} [progressCallback=null] - An optional callback function to receive progress updates\r\n * @returns {Promise} A promise that resolves to a pre-trained token classification model\r\n * @throws {Error} if an unsupported model type is encountered\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback)\r\n ]);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Class representing an automatic sequence-to-sequence language model.\r\n */\r\nclass AutoModelForSeq2SeqLM {\r\n static MODEL_CLASS_MAPPING = {\r\n 't5': T5ForConditionalGeneration,\r\n 'mt5': MT5ForConditionalGeneration,\r\n 'bart': BartForConditionalGeneration,\r\n 'whisper': WhisperForConditionalGeneration,\r\n 'marian': MarianMTModel,\r\n }\r\n\r\n /**\r\n * Loads a pretrained sequence-to-sequence language model from a file path.\r\n * @param {string} modelPath - The path to the model files.\r\n * @param {function} [progressCallback=null] - A callback function to track loading progress.\r\n * @returns {Promise} A Promise that resolves to an instance of the appropriate model class.\r\n * @throws {Error} If the model type is unsupported.\r\n * @static\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n let info = await seq2seqLoadModel(modelPath, progressCallback);\r\n let config = info[0];\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(...info)\r\n }\r\n}\r\n\r\n/**\r\n * A class for loading pre-trained models for causal language modeling tasks.\r\n */\r\nclass AutoModelForCausalLM {\r\n static MODEL_CLASS_MAPPING = {\r\n 'gpt2': GPT2LMHeadModel,\r\n 'gpt_neo': GPTNeoForCausalLM,\r\n 'codegen': CodeGenForCausalLM,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from the given path and returns an instance of the appropriate class.\r\n * @param {string} modelPath - The path to the pre-trained model.\r\n * @param {function} [progressCallback=null] - An optional callback function to track the progress of the loading process.\r\n * @returns {Promise} An instance of the appropriate class for the loaded model.\r\n * @throws {Error} If the loaded model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback)\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n\r\n }\r\n}\r\n\r\n/**\r\n * A class to automatically select the appropriate model for Masked Language Modeling (MLM) tasks.\r\n */\r\nclass AutoModelForMaskedLM {\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForMaskedLM,\r\n 'albert': AlbertForMaskedLM,\r\n 'distilbert': DistilBertForMaskedLM,\r\n 'roberta': RobertaForMaskedLM,\r\n 'mobilebert': MobileBertForMaskedLM,\r\n 'squeezebert': SqueezeBertForMaskedLM,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained model from a given directory and returns an instance of the appropriate model class.\r\n *\r\n * @async\r\n * @param {string} modelPath - The path to the pre-trained model directory.\r\n * @param {function} [progressCallback=null] - An optional callback function to track the loading progress.\r\n * @returns {Promise} An instance of the appropriate model class for MLM tasks.\r\n * @throws {Error} If an unsupported model type is encountered.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let config = await fetchJSON(modelPath, 'config.json', progressCallback);\r\n let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx';\r\n\r\n let session = await constructSession(modelPath, modelName, progressCallback);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n/**\r\n * Automatic model class for question answering tasks.\r\n */\r\nclass AutoModelForQuestionAnswering {\r\n static MODEL_CLASS_MAPPING = {\r\n 'bert': BertForQuestionAnswering,\r\n 'albert': AlbertForQuestionAnswering,\r\n 'distilbert': DistilBertForQuestionAnswering,\r\n 'roberta': RobertaForQuestionAnswering,\r\n 'mobilebert': MobileBertForQuestionAnswering,\r\n 'squeezebert': SqueezeBertForQuestionAnswering,\r\n }\r\n\r\n /**\r\n * Loads and returns a question answering model from a pretrained model path.\r\n * @param {string} modelPath - The path to the pretrained model.\r\n * @param {function} [progressCallback=null] - Optional callback function to track loading progress.\r\n * @returns {Promise} - The loaded question answering model.\r\n * @throws Will throw an error if an unsupported model type is encountered.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback)\r\n ]);\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n\r\n/**\r\n * Class representing an autoencoder-decoder model for vision-to-sequence tasks.\r\n */\r\nclass AutoModelForVision2Seq {\r\n static MODEL_CLASS_MAPPING = {\r\n 'vision-encoder-decoder': VisionEncoderDecoderModel\r\n }\r\n\r\n /**\r\n * Loads a pretrained model from a given path.\r\n * @param {string} modelPath - The path to the pretrained model.\r\n * @param {function} progressCallback - Optional callback function to track progress of the model loading.\r\n * @returns {Promise} - A Promise that resolves to a new instance of VisionEncoderDecoderModel.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session, decoder_merged_session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'encoder_model.onnx', progressCallback),\r\n constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback)\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session, decoder_merged_session);\r\n\r\n }\r\n}\r\n\r\n//////////////////////////////////////////////////\r\n/**\r\n * AutoModelForImageClassification is a class for loading pre-trained image classification models from ONNX format.\r\n */\r\nclass AutoModelForImageClassification {\r\n static MODEL_CLASS_MAPPING = {\r\n 'vit': ViTForImageClassification,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained image classification model from a given directory path.\r\n * @param {string} modelPath - The path to the directory containing the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function to monitor the loading progress.\r\n * @returns {Promise} A Promise that resolves with the model.\r\n * @throws {Error} If the specified model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\n/**\r\n * AutoModelForImageSegmentation is a class for loading pre-trained image classification models from ONNX format.\r\n */\r\nclass AutoModelForImageSegmentation {\r\n static MODEL_CLASS_MAPPING = {\r\n 'detr': DetrForSegmentation,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained image classification model from a given directory path.\r\n * @param {string} modelPath - The path to the directory containing the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function to monitor the loading progress.\r\n * @returns {Promise} A Promise that resolves with the model.\r\n * @throws {Error} If the specified model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n\r\n//////////////////////////////////////////////////\r\nclass AutoModelForObjectDetection {\r\n static MODEL_CLASS_MAPPING = {\r\n 'detr': DetrForObjectDetection,\r\n }\r\n\r\n /**\r\n * Loads a pre-trained image classification model from a given directory path.\r\n * @param {string} modelPath - The path to the directory containing the pre-trained model.\r\n * @param {function} [progressCallback=null] - A callback function to monitor the loading progress.\r\n * @returns {Promise} A Promise that resolves with the model.\r\n * @throws {Error} If the specified model type is not supported.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [config, session] = await Promise.all([\r\n fetchJSON(modelPath, 'config.json', progressCallback),\r\n constructSession(modelPath, 'model.onnx', progressCallback),\r\n ])\r\n\r\n // Called when all parts are loaded\r\n dispatchCallback(progressCallback, {\r\n status: 'loaded',\r\n name: modelPath\r\n });\r\n\r\n let cls = this.MODEL_CLASS_MAPPING[config.model_type];\r\n if (!cls) {\r\n throw Error(`Unsupported model type: ${config.model_type}`)\r\n }\r\n return new cls(config, session);\r\n }\r\n}\r\n//////////////////////////////////////////////////\r\n\r\n//////////////////////////////////////////////////\r\nclass Seq2SeqLMOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits - The output logits of the model.\r\n * @param {Array} past_key_values - An array of key/value pairs that represent the previous state of the model.\r\n * @param {Tensor} encoder_outputs - The output of the encoder in a sequence-to-sequence model.\r\n */\r\n constructor(logits, past_key_values, encoder_outputs) {\r\n super();\r\n this.logits = logits;\r\n this.past_key_values = past_key_values;\r\n this.encoder_outputs = encoder_outputs;\r\n }\r\n}\r\n\r\nclass SequenceClassifierOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits \r\n */\r\n constructor(logits) {\r\n super();\r\n this.logits = logits;\r\n }\r\n}\r\n\r\nclass TokenClassifierOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits \r\n */\r\n constructor(logits) {\r\n super();\r\n this.logits = logits;\r\n }\r\n}\r\n\r\n\r\nclass MaskedLMOutput extends ModelOutput {\r\n /**\r\n * @param {Tensor} logits \r\n */\r\n constructor(logits) {\r\n super();\r\n this.logits = logits;\r\n }\r\n}\r\n\r\nclass QuestionAnsweringModelOutput extends ModelOutput {\r\n /**\r\n * @param {Float32Array} start_logits - The logits for start positions of the answer.\r\n * @param {Float32Array} end_logits - The logits for end positions of the answer.\r\n */\r\n constructor(start_logits, end_logits) {\r\n super();\r\n this.start_logits = start_logits;\r\n this.end_logits = end_logits;\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n AutoModel,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForCausalLM,\r\n AutoModelForMaskedLM,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForObjectDetection,\r\n AutoModelForImageSegmentation,\r\n};\r\n","const {\r\n Callable,\r\n softmax,\r\n indexOfMax,\r\n getTopItems,\r\n cos_sim,\r\n pathJoin,\r\n isString,\r\n getFile,\r\n dot\r\n} = require(\"./utils.js\");\r\n\r\nconst {\r\n AutoTokenizer\r\n} = require(\"./tokenizers.js\");\r\nconst {\r\n AutoModel,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForMaskedLM,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForCausalLM,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForImageSegmentation,\r\n AutoModelForObjectDetection\r\n} = require(\"./models.js\");\r\nconst {\r\n AutoProcessor,\r\n Processor\r\n} = require(\"./processors.js\");\r\n\r\n\r\nconst {\r\n env\r\n} = require('./env.js');\r\n\r\nconst { Tensor, transpose_data } = require(\"./tensor_utils.js\");\r\nconst { CustomImage } = require(\"./image_utils.js\");\r\n\r\n/**\r\n * Prepare images for further tasks.\r\n * @param {any[]} images - images to prepare.\r\n * @returns {Promise} - returns processed images.\r\n * @async\r\n */\r\nasync function prepareImages(images) {\r\n if (!Array.isArray(images)) {\r\n images = [images];\r\n }\r\n\r\n // Possibly convert any non-images to images\r\n images = await Promise.all(images.map(x => CustomImage.read(x)));\r\n return images;\r\n}\r\n\r\n/**\r\n * Pipeline class for executing a natural language processing task.\r\n * @extends Callable\r\n */\r\nclass Pipeline extends Callable {\r\n /**\r\n * Creates a new instance of Pipeline.\r\n * @param {string} task - The natural language processing task to be performed.\r\n * @param {object} tokenizer - The tokenizer object to be used for tokenizing input texts.\r\n * @param {object} model - The model object to be used for processing input texts.\r\n */\r\n constructor(task, tokenizer, model) {\r\n super();\r\n this.task = task;\r\n this.tokenizer = tokenizer;\r\n this.model = model;\r\n }\r\n\r\n /**\r\n * Disposes the model.\r\n * @returns {Promise} - A promise that resolves when the model has been disposed.\r\n */\r\n async dispose() {\r\n return await this.model.dispose();\r\n }\r\n\r\n /**\r\n * Executes the natural language processing task.\r\n * @param {any} texts - The input texts to be processed.\r\n * @returns {Promise} - A promise that resolves to an array containing the inputs and outputs of the task.\r\n */\r\n async _call(texts) {\r\n // Run tokenization\r\n let inputs = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true\r\n });\r\n\r\n // Run model\r\n let outputs = await this.model(inputs)\r\n\r\n return [inputs, outputs];\r\n }\r\n}\r\n\r\n/**\r\n * TextClassificationPipeline class for executing a text classification task.\r\n * @extends Pipeline\r\n */\r\nclass TextClassificationPipeline extends Pipeline {\r\n /**\r\n * Executes the text classification task.\r\n * @param {any} texts - The input texts to be classified.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @param {number} [options.topk=1] - The number of top predictions to be returned.\r\n * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores.\r\n */\r\n async _call(texts, {\r\n topk = 1\r\n } = {}) {\r\n\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n let id2label = this.model.config.id2label;\r\n let toReturn = [];\r\n for (let batch of outputs.logits) {\r\n let scores = getTopItems(softmax(batch.data), topk);\r\n\r\n let vals = scores.map(function (x) {\r\n return {\r\n label: id2label[x[0]],\r\n score: x[1],\r\n }\r\n });\r\n if (topk === 1) {\r\n toReturn.push(...vals);\r\n } else {\r\n toReturn.push(vals);\r\n }\r\n }\r\n\r\n return Array.isArray(texts) || topk === 1 ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n\r\n/**\r\n * TokenClassificationPipeline class for executing a token classification task.\r\n * @extends Pipeline\r\n */\r\nclass TokenClassificationPipeline extends Pipeline {\r\n /**\r\n * Executes the token classification task.\r\n * @param {any} texts - The input texts to be classified.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores.\r\n */\r\n async _call(texts, {\r\n ignore_labels = ['O'], // TODO init param?\r\n } = {}) {\r\n\r\n let isBatched = Array.isArray(texts);\r\n\r\n if (!isBatched) {\r\n texts = [texts];\r\n }\r\n\r\n let tokenizer = this.tokenizer;\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n let logits = outputs.logits;\r\n let id2label = this.model.config.id2label;\r\n\r\n let toReturn = [];\r\n for (let i = 0; i < logits.dims[0]; ++i) {\r\n let ids = inputs.input_ids.get(i);\r\n let batch = logits.get(i);\r\n\r\n // List of tokens that aren't ignored\r\n let tokens = [];\r\n for (let j = 0; j < batch.dims[0]; ++j) {\r\n let tokenData = batch.get(j);\r\n let topScoreIndex = indexOfMax(tokenData.data);\r\n\r\n let entity = id2label[topScoreIndex];\r\n if (ignore_labels.includes(entity)) {\r\n // We predicted a token that should be ignored. So, we skip it.\r\n continue;\r\n }\r\n\r\n // TODO add option to keep special tokens?\r\n let word = tokenizer.decode([ids.get(j)], { skip_special_tokens: true });\r\n if (word === '') {\r\n // Was a special token. So, we skip it.\r\n continue;\r\n }\r\n\r\n let scores = softmax(tokenData.data);\r\n\r\n tokens.push({\r\n entity: entity,\r\n score: scores[topScoreIndex],\r\n index: j,\r\n word: word,\r\n\r\n // TODO: null for now, but will add\r\n start: null,\r\n end: null,\r\n });\r\n }\r\n toReturn.push(tokens);\r\n }\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n/**\r\n * QuestionAnsweringPipeline class for executing a question answering task.\r\n * @extends Pipeline\r\n */\r\nclass QuestionAnsweringPipeline extends Pipeline {\r\n /**\r\n * Executes the question answering task.\r\n * @param {string|string[]} question - The question(s) to be answered.\r\n * @param {string|string[]} context - The context(s) where the answer(s) can be found.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @param {number} [options.topk=1] - The number of top answer predictions to be returned.\r\n * @todo fix error below\r\n * @returns {Promise} - A promise that resolves to an array or object containing the predicted answers and scores.\r\n */\r\n async _call(question, context, {\r\n topk = 1\r\n } = {}) {\r\n\r\n let inputs = this.tokenizer(question, {\r\n text_pair: context\r\n })\r\n\r\n let output = await this.model(inputs);\r\n\r\n let toReturn = [];\r\n for (let j = 0; j < output.start_logits.dims[0]; ++j) {\r\n let ids = inputs.input_ids.get(j);\r\n let sepIndex = ids.indexOf(this.tokenizer.sep_token_id);\r\n\r\n let s1 = Array.from(softmax(output.start_logits.get(j).data))\r\n .map((x, i) => [x, i])\r\n .filter(x => x[1] > sepIndex);\r\n let e1 = Array.from(softmax(output.end_logits.get(j).data))\r\n .map((x, i) => [x, i])\r\n .filter(x => x[1] > sepIndex);\r\n\r\n let options = product(s1, e1)\r\n .filter(x => x[0][1] <= x[1][1])\r\n .map(x => [x[0][1], x[1][1], x[0][0] * x[1][0]])\r\n .sort((a, b) => b[2] - a[2]);\r\n\r\n for (let k = 0; k < Math.min(options.length, topk); ++k) {\r\n let [start, end, score] = options[k];\r\n\r\n let answer_tokens = [...ids].slice(start, end + 1)\r\n\r\n let answer = this.tokenizer.decode(answer_tokens, {\r\n skip_special_tokens: true,\r\n });\r\n\r\n // TODO add start and end?\r\n // NOTE: HF returns character index\r\n toReturn.push({\r\n answer, score\r\n });\r\n }\r\n }\r\n\r\n // Mimic HF's return type based on topk\r\n return (topk === 1) ? toReturn[0] : toReturn;\r\n\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a fill-mask pipeline for natural language processing.\r\n * @extends Pipeline\r\n */\r\nclass FillMaskPipeline extends Pipeline {\r\n /**\r\n * @param {any} texts\r\n */\r\n async _call(texts, {\r\n topk = 5\r\n } = {}) {\r\n // Fill the masked token in the text(s) given as inputs.\r\n\r\n // Run tokenization\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n // Determine indices of mask tokens\r\n // let mask_token_indices = inputs.input_ids.data.map(x => )\r\n\r\n // let logits = reshape(outputs.logits.data, outputs.logits.dims);\r\n\r\n let tokenizer = this.tokenizer;\r\n\r\n let toReturn = [];\r\n\r\n for (let i = 0; i < inputs.input_ids.dims[0]; ++i) {\r\n let ids = inputs.input_ids.get(i);\r\n let mask_token_index = ids.indexOf(this.tokenizer.mask_token_id)\r\n\r\n if (mask_token_index === -1) {\r\n throw Error(`Mask token (${tokenizer.mask_token}) not found in text.`)\r\n }\r\n let logits = outputs.logits.get(i);\r\n let itemLogits = logits.get(mask_token_index);\r\n\r\n let scores = getTopItems(softmax(itemLogits.data), topk);\r\n\r\n toReturn.push(scores.map(x => {\r\n let sequence = [...ids];\r\n sequence[mask_token_index] = x[0];\r\n\r\n return {\r\n score: x[1],\r\n token: x[0],\r\n token_str: tokenizer.model.vocab[x[0]],\r\n sequence: tokenizer.decode(sequence, { skip_special_tokens: true }),\r\n }\r\n }));\r\n }\r\n return Array.isArray(texts) ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n/**\r\n * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks.\r\n * @extends Pipeline\r\n */\r\nclass Text2TextGenerationPipeline extends Pipeline {\r\n _key = null;\r\n\r\n /**\r\n * Fill the masked token in the text(s) given as inputs.\r\n * @async\r\n * @param {string|string[]} texts - The text or array of texts to be processed.\r\n * @param {Object} [options={}] - Options for the fill-mask pipeline.\r\n * @param {number} [options.topk=5] - The number of top-k predictions to return.\r\n * @returns {Promise} An array of objects containing the score, predicted token, predicted token string,\r\n * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text).\r\n * If only one input text is given, the output will be an array of objects.\r\n * @throws {Error} When the mask token is not found in the input text.\r\n */\r\n async _call(texts, generate_kwargs = {}) {\r\n if (!Array.isArray(texts)) {\r\n texts = [texts];\r\n }\r\n\r\n // Add global prefix, if present\r\n if (this.model.config.prefix) {\r\n texts = texts.map(x => this.model.config.prefix + x)\r\n }\r\n\r\n // Handle task specific params:\r\n let task_specific_params = this.model.config.task_specific_params\r\n if (task_specific_params && task_specific_params[this.task]) {\r\n // Add prefixes, if present\r\n if (task_specific_params[this.task].prefix) {\r\n texts = texts.map(x => task_specific_params[this.task].prefix + x)\r\n }\r\n\r\n // TODO update generation config\r\n }\r\n\r\n let input_ids = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true\r\n }).input_ids\r\n\r\n let outputTokenIds = (await this.model.generate(input_ids, generate_kwargs)).flat();\r\n\r\n /**\r\n * @type {any[]}\r\n */\r\n let toReturn = this.tokenizer.batch_decode(outputTokenIds, {\r\n skip_special_tokens: true,\r\n });\r\n if (this._key !== null) {\r\n toReturn = toReturn.map(text => {\r\n return (this._key === null) ? text : { [this._key]: text }\r\n })\r\n }\r\n return toReturn\r\n }\r\n}\r\n\r\n\r\n/**\r\n * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline.\r\n * @extends Text2TextGenerationPipeline\r\n */\r\nclass SummarizationPipeline extends Text2TextGenerationPipeline {\r\n _key = 'summary_text';\r\n}\r\n\r\n/**\r\n * TranslationPipeline class to translate text from one language to another using the provided model and tokenizer.\r\n * @extends Text2TextGenerationPipeline\r\n */\r\nclass TranslationPipeline extends Text2TextGenerationPipeline {\r\n _key = 'translation_text';\r\n}\r\n\r\n/**\r\n * A pipeline for generating text based on an input prompt.\r\n * @extends Pipeline\r\n */\r\nclass TextGenerationPipeline extends Pipeline {\r\n /**\r\n * Generates text based on an input prompt.\r\n * @async\r\n * @param {any} texts - The input prompt or prompts to generate text from.\r\n * @param {object} [generate_kwargs={}] - Additional arguments for text generation.\r\n * @returns {Promise} - The generated text or texts.\r\n */\r\n async _call(texts, generate_kwargs = {}) {\r\n let stringInput = typeof texts === 'string' || texts instanceof String;\r\n if (stringInput) {\r\n texts = [texts];\r\n }\r\n\r\n this.tokenizer.padding_side = 'left';\r\n let inputs = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true,\r\n });\r\n\r\n let input_ids = inputs.input_ids;\r\n let attention_mask = inputs.attention_mask;\r\n\r\n /**\r\n * @type {any[]}\r\n */\r\n let outputTokenIds = await this.model.generate(input_ids, generate_kwargs, null, {\r\n inputs_attention_mask: attention_mask\r\n });\r\n\r\n let toReturn = outputTokenIds.map((outTokens, i) => {\r\n let startText = texts[i].trim();\r\n let decoded = this.tokenizer.batch_decode(outTokens, {\r\n skip_special_tokens: true,\r\n }).map(x => {\r\n return {\r\n generated_text: startText + x\r\n }\r\n });\r\n\r\n return decoded\r\n });\r\n\r\n return (stringInput && toReturn.length === 1) ? toReturn[0] : toReturn;\r\n }\r\n}\r\n\r\n/**\r\n * Class representing an Zero Shot Classification Pipeline that should only be used with zero shot classification tasks.\r\n * @extends Pipeline\r\n */\r\nclass ZeroShotClassificationPipeline extends Pipeline {\r\n\r\n /**\r\n * @param {string} task\r\n * @param {any} tokenizer\r\n * @param {any} model\r\n */\r\n constructor(task, tokenizer, model) {\r\n super(task, tokenizer, model);\r\n\r\n // Use model config to get label2id mapping\r\n this.label2id = Object.fromEntries(\r\n Object.entries(this.model.config.label2id).map(\r\n ([k, v]) => [k.toLowerCase(), v]\r\n )\r\n );\r\n\r\n this.entailment_id = this.label2id['entailment'];\r\n if (this.entailment_id === undefined) {\r\n console.warn(\"Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.\");\r\n this.entailment_id = 2;\r\n }\r\n\r\n this.contradiction_id = this.label2id['contradiction'];\r\n if (this.contradiction_id === undefined) {\r\n console.warn(\"Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.\");\r\n this.contradiction_id = 0;\r\n }\r\n }\r\n /**\r\n * @param {any[]} texts\r\n * @param {string[]} candidate_labels\r\n * @todo fix error below\r\n * @return {Promise<*>}\r\n */\r\n async _call(texts, candidate_labels, {\r\n hypothesis_template = \"This example is {}.\",\r\n multi_label = false,\r\n } = {}) {\r\n\r\n let isBatched = Array.isArray(texts);\r\n\r\n if (!isBatched) {\r\n texts = [texts];\r\n }\r\n if (!Array.isArray(candidate_labels)) {\r\n candidate_labels = [candidate_labels];\r\n }\r\n\r\n // Insert labels into hypothesis template\r\n let hypotheses = candidate_labels.map(\r\n x => hypothesis_template.replace('{}', x)\r\n );\r\n\r\n // How to perform the softmax over the logits:\r\n // - true: softmax over the entailment vs. contradiction dim for each label independently\r\n // - false: softmax the \"entailment\" logits over all candidate labels\r\n let softmaxEach = multi_label || candidate_labels.length === 1;\r\n\r\n let toReturn = [];\r\n for (let premise of texts) {\r\n let entails_logits = [];\r\n\r\n for (let hypothesis of hypotheses) {\r\n let inputs = this.tokenizer(premise, {\r\n text_pair: hypothesis,\r\n })\r\n let outputs = await this.model(inputs)\r\n\r\n if (softmaxEach) {\r\n entails_logits.push([\r\n outputs.logits.data[this.contradiction_id],\r\n outputs.logits.data[this.entailment_id]\r\n ])\r\n } else {\r\n entails_logits.push(outputs.logits.data[this.entailment_id])\r\n }\r\n }\r\n\r\n let scores;\r\n if (softmaxEach) {\r\n scores = entails_logits.map(x => softmax(x)[1]);\r\n } else {\r\n scores = softmax(entails_logits);\r\n }\r\n\r\n // Sort by scores (desc) and return scores with indices\r\n let scores_sorted = scores\r\n .map((x, i) => [x, i])\r\n .sort((a, b) => {\r\n return b[0] - a[0];\r\n });\r\n\r\n toReturn.push({\r\n sequence: premise,\r\n labels: scores_sorted.map(x => candidate_labels[x[1]]),\r\n scores: scores_sorted.map(x => x[0]),\r\n });\r\n }\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Class representing an Embeddings Pipeline that should only be used with sentence-transformers.\r\n * If you want to get the raw outputs from the model, use `AutoModel.from_pretrained(...)`.\r\n * @extends Pipeline\r\n */\r\nclass EmbeddingsPipeline extends Pipeline {\r\n // Should only be used with sentence-transformers\r\n // If you want to get the raw outputs from the model,\r\n // use `AutoModel.from_pretrained(...)`\r\n /**\r\n * Private method to perform mean pooling of the last hidden state followed by a normalization step.\r\n * @param {Tensor} last_hidden_state - Tensor of shape [batchSize, seqLength, embedDim]\r\n * @param {Tensor} attention_mask - Tensor of shape [batchSize, seqLength]\r\n * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim].\r\n * @private\r\n */\r\n _mean_pooling(last_hidden_state, attention_mask) {\r\n // last_hidden_state: [batchSize, seqLength, embedDim]\r\n // attention_mask: [batchSize, seqLength]\r\n\r\n let shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]];\r\n let returnedData = new last_hidden_state.data.constructor(shape[0] * shape[1])\r\n let [batchSize, seqLength, embedDim] = last_hidden_state.dims;\r\n\r\n let outIndex = 0;\r\n for (let i = 0; i < batchSize; ++i) {\r\n let offset = i * embedDim * seqLength;\r\n\r\n for (let k = 0; k < embedDim; ++k) {\r\n let sum = 0;\r\n let count = 0;\r\n\r\n let attnMaskOffset = i * seqLength;\r\n let offset2 = offset + k;\r\n // Pool over all words in sequence\r\n for (let j = 0; j < seqLength; ++j) {\r\n // index into attention mask\r\n let attn = Number(attention_mask.data[attnMaskOffset + j]);\r\n\r\n count += attn;\r\n sum += last_hidden_state.data[offset2 + j * embedDim] * attn;\r\n }\r\n\r\n let avg = sum / count;\r\n returnedData[outIndex++] = avg;\r\n }\r\n }\r\n\r\n return new Tensor(\r\n last_hidden_state.type,\r\n returnedData,\r\n shape\r\n )\r\n }\r\n\r\n /**\r\n * Private method to normalize the input tensor along dim=1. \r\n * NOTE: only works for tensors of shape [batchSize, embedDim]. Operates in-place.\r\n * @param {any} tensor - Tensor of shape [batchSize, embedDim]\r\n * @returns {any} Returns the same Tensor object after performing normalization.\r\n * @private\r\n */\r\n _normalize(tensor) {\r\n for (let batch of tensor) {\r\n let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b))\r\n\r\n for (let i = 0; i < batch.data.length; ++i) {\r\n batch.data[i] /= norm;\r\n }\r\n }\r\n return tensor;\r\n }\r\n\r\n /**\r\n * Method to perform mean pooling and normalization of the input texts.\r\n * @param {string[]} texts - An array of texts to embed.\r\n * @returns {Promise} Returns a new Tensor of shape [batchSize, embedDim].\r\n */\r\n async _call(texts) {\r\n let [inputs, outputs] = await super._call(texts);\r\n\r\n // Perform mean pooling, followed by a normalization step\r\n return this._normalize(this._mean_pooling(outputs.last_hidden_state, inputs.attention_mask));\r\n }\r\n\r\n /**\r\n * @param {number[]} arr1\r\n * @param {number[]} arr2\r\n */\r\n cos_sim(arr1, arr2, is_normalised = false) {\r\n // Compute cosine similarity. If `is_normalised`, then\r\n // use the dot product instead of the cosine similarity\r\n return is_normalised ? dot(arr1, arr2) : cos_sim(arr1, arr2);\r\n }\r\n}\r\n\r\n/**\r\n * A class representing an automatic speech recognition pipeline.\r\n * @extends Pipeline\r\n */\r\nclass AutomaticSpeechRecognitionPipeline extends Pipeline {\r\n\r\n /**\r\n * Creates an instance of AutomaticSpeechRecognitionPipeline.\r\n * @param {string} task - The type of the task for this pipeline. Currently only \"asr\" is supported.\r\n * @param {object} tokenizer - The tokenizer to be used for pre-processing inputs.\r\n * @param {object} model - The model to be used for the task.\r\n * @param {object} processor - The processor to be used for pre-processing audio inputs.\r\n */\r\n constructor(task, tokenizer, model, processor) {\r\n super(task, tokenizer, model);\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * Preprocesses the input audio for the AutomaticSpeechRecognitionPipeline.\r\n * @param {any} audio - The audio to be preprocessed.\r\n * @param {number} sampling_rate - The sampling rate of the audio.\r\n * @returns {Promise} - A promise that resolves to the preprocessed audio data.\r\n * @private\r\n */\r\n async _preprocess(audio, sampling_rate) {\r\n if (isString(audio)) {\r\n // Attempting to load from path\r\n\r\n if (typeof AudioContext === 'undefined') {\r\n // Running in node or an environment without AudioContext\r\n throw Error(\r\n \"Unable to load audio from path/URL since `AudioContext` is not available in your environment. \" +\r\n \"As a result, audio data must be passed directly to the processor. \" +\r\n \"If you are running in node.js, you can use an external library (e.g., https://github.com/audiojs/web-audio-api) to do this.\"\r\n )\r\n }\r\n const response = await (await getFile(audio)).arrayBuffer();\r\n const audioCTX = new AudioContext({ sampleRate: sampling_rate });\r\n const decoded = await audioCTX.decodeAudioData(response);\r\n\r\n // We now replicate HuggingFace's `ffmpeg_read` method:\r\n // \r\n // When downmixing a stereo audio file to mono using the -ac 1 option in FFmpeg,\r\n // the audio signal is summed across both channels to create a single mono channel.\r\n // However, if the audio is at full scale (i.e. the highest possible volume level),\r\n // the summing of the two channels can cause the audio signal to clip or distort.\r\n\r\n // To prevent this clipping, FFmpeg applies a scaling factor of 1/sqrt(2) (~ 0.707)\r\n // to the audio signal before summing the two channels. This scaling factor ensures\r\n // that the combined audio signal will not exceed the maximum possible level, even\r\n // if both channels are at full scale.\r\n\r\n // After applying this scaling factor, the audio signal from both channels is summed\r\n // to create a single mono channel. It's worth noting that this scaling factor is\r\n // only applied when downmixing stereo audio to mono using the -ac 1 option in FFmpeg.\r\n // If you're using a different downmixing method, or if you're not downmixing the\r\n // audio at all, this scaling factor may not be needed.\r\n const SCALING_FACTOR = Math.sqrt(2);\r\n\r\n let left = decoded.getChannelData(0);\r\n let right = decoded.getChannelData(1);\r\n\r\n audio = new Float32Array(left.length);\r\n for (let i = 0; i < decoded.length; i++) {\r\n audio[i] = SCALING_FACTOR * (left[i] + right[i]) / 2;\r\n }\r\n }\r\n\r\n return audio;\r\n }\r\n\r\n /**\r\n * Asynchronously processes audio and generates text transcription using the model.\r\n * @param {Array} audio - The audio to be transcribed. Can be a single Float32Array or an array of Float32Arrays.\r\n * @param {Object} [kwargs={}] - Optional arguments.\r\n * @param {boolean} [kwargs.return_timestamps] - Whether to return timestamps or not. Default is false.\r\n * @param {number} [kwargs.chunk_length_s] - The length of audio chunks to process in seconds. Default is 0 (no chunking).\r\n * @param {number} [kwargs.stride_length_s] - The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to chunk_length_s / 6.\r\n * @param {function} [kwargs.chunk_callback] - Callback function to be called with each chunk processed.\r\n * @param {boolean} [kwargs.force_full_sequences] - Whether to force outputting full sequences or not. Default is false.\r\n * @returns {Promise} A Promise that resolves to an object containing the transcription text and optionally timestamps if return_timestamps is true.\r\n */\r\n async _call(audio, kwargs = {}) {\r\n let return_timestamps = kwargs.return_timestamps ?? false;\r\n let chunk_length_s = kwargs.chunk_length_s ?? 0;\r\n let stride_length_s = kwargs.stride_length_s ?? null;\r\n let chunk_callback = kwargs.chunk_callback ?? null;\r\n let force_full_sequences = kwargs.force_full_sequences ?? false;\r\n\r\n // TODO\r\n // task = 'transcribe',\r\n // language = 'en',\r\n\r\n let single = !Array.isArray(audio)\r\n if (single) {\r\n audio = [audio]\r\n }\r\n\r\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\r\n const time_precision = this.processor.feature_extractor.config.chunk_length / this.model.config.max_source_positions;\r\n\r\n let toReturn = [];\r\n for (let aud of audio) {\r\n aud = await this._preprocess(aud, sampling_rate)\r\n\r\n /** @type {any[]} */\r\n let chunks = [];\r\n if (chunk_length_s > 0) {\r\n if (stride_length_s === null) {\r\n stride_length_s = chunk_length_s / 6;\r\n } else if (chunk_length_s <= stride_length_s) {\r\n throw Error(\"`chunk_length_s` must be larger than `stride_length_s`.\")\r\n }\r\n\r\n // TODO support different stride_length_s (for left and right)\r\n\r\n const window = sampling_rate * chunk_length_s;\r\n const stride = sampling_rate * stride_length_s;\r\n const jump = window - 2 * stride;\r\n let offset = 0;\r\n\r\n // Create subarrays of audio with overlaps\r\n\r\n while (offset < aud.length) {\r\n let subarr = aud.subarray(offset, offset + window);\r\n let feature = await this.processor(subarr);\r\n\r\n let isFirst = offset === 0;\r\n let isLast = offset + jump >= aud.length;\r\n chunks.push({\r\n stride: [\r\n subarr.length,\r\n isFirst ? 0 : stride,\r\n isLast ? 0 : stride\r\n ],\r\n input_features: feature.input_features,\r\n is_last: isLast\r\n })\r\n offset += jump;\r\n }\r\n\r\n } else {\r\n chunks = [{\r\n stride: [aud.length, 0, 0],\r\n input_features: (await this.processor(aud)).input_features,\r\n is_last: true\r\n }]\r\n }\r\n\r\n // Generate for each set of input features\r\n for (let chunk of chunks) {\r\n // NOTE: doing sequentially for now\r\n let data = await this.model.generate(chunk.input_features, kwargs);\r\n\r\n // Get top beam\r\n chunk.tokens = data[0].flat()\r\n\r\n // convert stride to seconds\r\n chunk.stride = chunk.stride.map(x => x / sampling_rate);\r\n\r\n if (chunk_callback !== null) {\r\n chunk_callback(chunk)\r\n }\r\n }\r\n\r\n // Merge text chunks\r\n let [full_text, optional] = this.tokenizer._decode_asr(chunks, {\r\n time_precision: time_precision,\r\n return_timestamps: return_timestamps,\r\n force_full_sequences: force_full_sequences\r\n });\r\n\r\n toReturn.push({ text: full_text, ...optional })\r\n }\r\n return single ? toReturn[0] : toReturn;\r\n }\r\n}\r\n\r\n/**\r\n * A pipeline for performing image-to-text tasks.\r\n * @extends Pipeline\r\n */\r\nclass ImageToTextPipeline extends Pipeline {\r\n /**\r\n * Create an instance of ImageToTextPipeline.\r\n * @param {string} task - The task name.\r\n * @param {object} tokenizer - The tokenizer to use.\r\n * @param {object} model - The generator model to use.\r\n * @param {object} processor - The image processor to use.\r\n */\r\n constructor(task, tokenizer, model, processor) {\r\n super(task, tokenizer, model);\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * @param {any[]} images\r\n */\r\n async _call(images, generate_kwargs = {}) {\r\n let isBatched = Array.isArray(images);\r\n\r\n images = await prepareImages(images);\r\n\r\n let pixel_values = (await this.processor(images)).pixel_values;\r\n\r\n let toReturn = [];\r\n for (let batch of pixel_values) {\r\n batch.dims = [1, ...batch.dims]\r\n let output = (await this.model.generate(batch, generate_kwargs)).flat();\r\n let decoded = this.tokenizer.batch_decode(output, {\r\n skip_special_tokens: true,\r\n }).map(x => {\r\n return { generated_text: x.trim() }\r\n })\r\n toReturn.push(decoded);\r\n }\r\n\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n/**\r\n * A class representing an image classification pipeline.\r\n * @extends Pipeline\r\n */\r\nclass ImageClassificationPipeline extends Pipeline {\r\n /**\r\n * Create a new ImageClassificationPipeline.\r\n * @param {string} task - The task of the pipeline.\r\n * @param {Object} model - The model to use for classification.\r\n * @param {Function} processor - The function to preprocess images.\r\n */\r\n constructor(task, model, processor) {\r\n super(task, null, model); // TODO tokenizer\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * Classify the given images.\r\n * @async\r\n * @param {any} images - The images to classify.\r\n * @param {Object} options - The options to use for classification.\r\n * @param {number} [options.topk=1] - The number of top results to return.\r\n * @returns {Promise} - The top classification results for the images.\r\n */\r\n async _call(images, {\r\n topk = 1\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n images = await prepareImages(images);\r\n\r\n let inputs = await this.processor(images);\r\n let output = await this.model(inputs);\r\n\r\n let id2label = this.model.config.id2label;\r\n let toReturn = [];\r\n for (let batch of output.logits) {\r\n let scores = getTopItems(softmax(batch.data), topk);\r\n\r\n let vals = scores.map(function (x) {\r\n return {\r\n label: id2label[x[0]],\r\n score: x[1],\r\n }\r\n });\r\n if (topk === 1) {\r\n toReturn.push(...vals);\r\n } else {\r\n toReturn.push(vals);\r\n }\r\n }\r\n\r\n return isBatched || topk === 1 ? toReturn : toReturn[0];\r\n }\r\n\r\n}\r\n\r\n/**\r\n * ImageSegmentationPipeline class for executing an image-segmentation task.\r\n * @extends Pipeline\r\n */\r\nclass ImageSegmentationPipeline extends Pipeline {\r\n /**\r\n * Create a new ImageSegmentationPipeline.\r\n * @param {string} task - The task of the pipeline.\r\n * @param {Object} model - The model to use for classification.\r\n * @param {Processor} processor - The function to preprocess images.\r\n */\r\n constructor(task, model, processor) {\r\n super(task, null, model); // TODO tokenizer\r\n this.processor = processor;\r\n\r\n this.subtasks_mapping = {\r\n // Mapping of subtasks to their corresponding post-processing function names.\r\n panoptic: 'post_process_panoptic_segmentation',\r\n instance: 'post_process_instance_segmentation',\r\n semantic: 'post_process_semantic_segmentation'\r\n }\r\n }\r\n\r\n /**\r\n * Segment the input images.\r\n * @param {Array} images - The input images.\r\n * @param {Object} options - The options to use for segmentation.\r\n * @param {number} [options.threshold=0.5] - Probability threshold to filter out predicted masks.\r\n * @param {number} [options.mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values.\r\n * @param {number} [options.overlap_mask_area_threshold=0.8] - Mask overlap threshold to eliminate small, disconnected segments.\r\n * @param {null|string} [options.subtask=null] - Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`], depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order).\r\n * @param {Array} [options.label_ids_to_fuse=null] - List of label ids to fuse. If not set, do not fuse any labels.\r\n * @param {Array} [options.target_sizes=null] - List of target sizes for the input images. If not set, use the original image sizes.\r\n * @returns {Promise} - The annotated segments.\r\n */\r\n async _call(images, {\r\n threshold = 0.5,\r\n mask_threshold = 0.5,\r\n overlap_mask_area_threshold = 0.8,\r\n label_ids_to_fuse = null,\r\n target_sizes = null,\r\n subtask = null, // TODO use\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n\r\n if (isBatched && images.length !== 1) {\r\n throw Error(\"Image segmentation pipeline currently only supports a batch size of 1.\");\r\n }\r\n\r\n images = await prepareImages(images);\r\n let imageSizes = images.map(x => [x.height, x.width]);\r\n\r\n let inputs = await this.processor(images);\r\n let output = await this.model(inputs);\r\n\r\n let fn = null;\r\n if (subtask !== null) {\r\n fn = this.subtasks_mapping[subtask];\r\n } else {\r\n for (let [task, func] of Object.entries(this.subtasks_mapping)) {\r\n if (func in this.processor.feature_extractor) {\r\n fn = this.processor.feature_extractor[func].bind(this.processor.feature_extractor);\r\n subtask = task;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // add annotations\r\n let annotation = [];\r\n\r\n if (subtask === 'panoptic' || subtask === 'instance') {\r\n\r\n let processed = fn(\r\n output,\r\n threshold,\r\n mask_threshold,\r\n overlap_mask_area_threshold,\r\n label_ids_to_fuse,\r\n target_sizes ?? imageSizes, // TODO FIX?\r\n )[0];\r\n\r\n let segmentation = processed.segmentation;\r\n let id2label = this.model.config.id2label;\r\n\r\n for (let segment of processed.segments_info) {\r\n let maskData = new Uint8ClampedArray(segmentation.data.length);\r\n for (let i = 0; i < segmentation.data.length; ++i) {\r\n if (segmentation.data[i] === segment.id) {\r\n maskData[i] = 255;\r\n }\r\n }\r\n\r\n let mask = new CustomImage(maskData, segmentation.dims[1], segmentation.dims[0], 1)\r\n\r\n annotation.push({\r\n score: segment.score,\r\n label: id2label[segment.label_id],\r\n mask: mask\r\n })\r\n }\r\n\r\n } else if (subtask === 'semantic') {\r\n throw Error(`semantic segmentation not yet supported.`);\r\n\r\n } else {\r\n throw Error(`Subtask ${subtask} not supported.`);\r\n }\r\n\r\n return annotation;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Class representing a zero-shot image classification pipeline.\r\n * @extends Pipeline\r\n */\r\nclass ZeroShotImageClassificationPipeline extends Pipeline {\r\n\r\n /**\r\n * Create a zero-shot image classification pipeline.\r\n * @param {string} task - The task of the pipeline.\r\n * @param {Object} tokenizer - The tokenizer to use.\r\n * @param {Object} model - The model to use.\r\n * @param {Function} processor - The image processing function.\r\n */\r\n constructor(task, tokenizer, model, processor) {\r\n super(task, tokenizer, model);\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * Classify the input images with candidate labels using a zero-shot approach.\r\n * @param {Array} images - The input images.\r\n * @param {Array} candidate_labels - The candidate labels.\r\n * @param {Object} options - The options for the classification.\r\n * @param {string} [options.hypothesis_template] - The hypothesis template to use for zero-shot classification. Default: \"This is a photo of {}\".\r\n * @todo fix error below\r\n * @returns {Promise} An array of classifications for each input image or a single classification object if only one input image is provided.\r\n */\r\n async _call(images, candidate_labels, {\r\n hypothesis_template = \"This is a photo of {}\"\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n images = await prepareImages(images);\r\n\r\n // Insert label into hypothesis template \r\n let texts = candidate_labels.map(\r\n x => hypothesis_template.replace('{}', x)\r\n );\r\n\r\n // Run tokenization\r\n let text_inputs = this.tokenizer(texts, {\r\n padding: true,\r\n truncation: true\r\n });\r\n\r\n // Compare each image with each candidate label\r\n let image_inputs = await this.processor(images);\r\n let output = await this.model({ ...text_inputs, ...image_inputs });\r\n\r\n let toReturn = [];\r\n for (let batch of output.logits_per_image) {\r\n // Compute softmax per image\r\n let probs = softmax(batch.data);\r\n\r\n toReturn.push([...probs].map((x, i) => {\r\n return {\r\n score: x,\r\n label: candidate_labels[i]\r\n }\r\n }));\r\n }\r\n\r\n return isBatched ? toReturn : toReturn[0];\r\n }\r\n}\r\n\r\n\r\nclass ObjectDetectionPipeline extends Pipeline {\r\n /**\r\n * @param {string} task\r\n * @param {any} model\r\n * @param {any} processor\r\n */\r\n constructor(task, model, processor) {\r\n super(task, null, model); // TODO tokenizer\r\n this.processor = processor;\r\n }\r\n\r\n /**\r\n * @param {any[]} images\r\n */\r\n async _call(images, {\r\n threshold = 0.5,\r\n percentage = false, // get in percentage (true) or in pixels (false)\r\n } = {}) {\r\n let isBatched = Array.isArray(images);\r\n\r\n if (isBatched && images.length !== 1) {\r\n throw Error(\"Object detection pipeline currently only supports a batch size of 1.\");\r\n }\r\n images = await prepareImages(images);\r\n\r\n let imageSizes = percentage ? null : images.map(x => [x.height, x.width]);\r\n\r\n let inputs = await this.processor(images);\r\n let output = await this.model(inputs);\r\n\r\n let processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes);\r\n\r\n // Add labels\r\n let id2label = this.model.config.id2label;\r\n processed.forEach(x => x.labels = x.classes.map(y => id2label[y]));\r\n\r\n return isBatched ? processed : processed[0];\r\n }\r\n}\r\n\r\nconst SUPPORTED_TASKS = {\r\n \"text-classification\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TextClassificationPipeline,\r\n \"model\": AutoModelForSequenceClassification,\r\n \"default\": {\r\n \"model\": \"distilbert-base-uncased-finetuned-sst-2-english\",\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"token-classification\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TokenClassificationPipeline,\r\n \"model\": AutoModelForTokenClassification,\r\n \"default\": {\r\n \"model\": \"Davlan/bert-base-multilingual-cased-ner-hrl\",\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"question-answering\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": QuestionAnsweringPipeline,\r\n \"model\": AutoModelForQuestionAnswering,\r\n \"default\": {\r\n \"model\": \"distilbert-base-cased-distilled-squad\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n\r\n \"fill-mask\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": FillMaskPipeline,\r\n \"model\": AutoModelForMaskedLM,\r\n \"default\": {\r\n \"model\": \"bert-base-uncased\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"summarization\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": SummarizationPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"default\": {\r\n \"model\": \"sshleifer/distilbart-cnn-6-6\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"translation\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TranslationPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"default\": {\r\n \"model\": \"t5-small\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"text2text-generation\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": Text2TextGenerationPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"default\": {\r\n \"model\": \"google/flan-t5-small\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"text-generation\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": TextGenerationPipeline,\r\n \"model\": AutoModelForCausalLM,\r\n \"default\": {\r\n \"model\": \"gpt2\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n \"zero-shot-classification\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": ZeroShotClassificationPipeline,\r\n \"model\": AutoModelForSequenceClassification,\r\n \"default\": {\r\n \"model\": \"typeform/distilbert-base-uncased-mnli\",\r\n },\r\n \"type\": \"text\",\r\n },\r\n\r\n \"automatic-speech-recognition\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": AutomaticSpeechRecognitionPipeline,\r\n \"model\": AutoModelForSeq2SeqLM,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"openai/whisper-tiny.en\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"image-to-text\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": ImageToTextPipeline,\r\n \"model\": AutoModelForVision2Seq,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"nlpconnect/vit-gpt2-image-captioning\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"image-classification\": {\r\n // no tokenizer\r\n \"pipeline\": ImageClassificationPipeline,\r\n \"model\": AutoModelForImageClassification,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"google/vit-base-patch16-224\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"image-segmentation\": {\r\n // no tokenizer\r\n \"pipeline\": ImageSegmentationPipeline,\r\n \"model\": AutoModelForImageSegmentation,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"facebook/detr-resnet-50-panoptic\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"zero-shot-image-classification\": {\r\n // no tokenizer\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": ZeroShotImageClassificationPipeline,\r\n \"model\": AutoModel,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"openai/clip-vit-base-patch32\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n \"object-detection\": {\r\n // no tokenizer\r\n \"pipeline\": ObjectDetectionPipeline,\r\n \"model\": AutoModelForObjectDetection,\r\n \"processor\": AutoProcessor,\r\n \"default\": {\r\n \"model\": \"facebook/detr-resnet-50\"\r\n },\r\n \"type\": \"multimodal\",\r\n },\r\n\r\n // This task is not supported in HuggingFace transformers, but serves as a useful interface\r\n // for dealing with sentence-transformers (https://huggingface.co/sentence-transformers)\r\n \"embeddings\": {\r\n \"tokenizer\": AutoTokenizer,\r\n \"pipeline\": EmbeddingsPipeline,\r\n \"model\": AutoModel,\r\n \"default\": {\r\n \"model\": \"sentence-transformers/all-MiniLM-L6-v2\"\r\n },\r\n \"type\": \"text\",\r\n },\r\n}\r\n\r\nconst TASK_NAME_MAPPING = {\r\n // Fix mismatch between pipeline's task name and exports (folder name)\r\n 'text-classification': 'sequence-classification',\r\n 'embeddings': 'default',\r\n 'fill-mask': 'masked-lm',\r\n\r\n 'text2text-generation': 'seq2seq-lm-with-past',\r\n 'summarization': 'seq2seq-lm-with-past',\r\n 'text-generation': 'causal-lm-with-past',\r\n\r\n 'automatic-speech-recognition': 'speech2seq-lm-with-past',\r\n 'image-to-text': 'vision2seq-lm-with-past',\r\n\r\n 'zero-shot-image-classification': 'default',\r\n 'zero-shot-classification': 'sequence-classification'\r\n}\r\n\r\nconst TASK_PREFIX_MAPPING = {\r\n // if task starts with one of these, set the corresponding folder name\r\n 'translation': 'seq2seq-lm-with-past',\r\n}\r\n\r\n\r\nconst TASK_ALIASES = {\r\n \"sentiment-analysis\": \"text-classification\",\r\n \"ner\": \"token-classification\",\r\n \"vqa\": \"visual-question-answering\",\r\n}\r\n\r\n/**\r\n * Constructs a pipeline for a specified task with optional model and progress callback.\r\n *\r\n * @async\r\n * @function\r\n * @param {string} task - The task to perform, e.g. \"text-generation\".\r\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.\r\n * @param {object} [options] - Optional parameters for the pipeline.\r\n * @param {function} [options.progress_callback=null] - A function to call with progress updates.\r\n * @returns {Promise} A Pipeline object for the specified task.\r\n * @todo fix error below\r\n * @throws {Error} If an unsupported pipeline is requested.\r\n */\r\nasync function pipeline(\r\n task,\r\n model = null,\r\n {\r\n progress_callback = null\r\n } = {}\r\n) {\r\n // Helper method to construct pipeline\r\n\r\n // Apply aliases\r\n task = TASK_ALIASES[task] ?? task;\r\n\r\n // Get pipeline info\r\n let pipelineInfo = SUPPORTED_TASKS[task.split('_', 1)[0]];\r\n if (!pipelineInfo) {\r\n throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`)\r\n }\r\n\r\n\r\n // Use model if specified, otherwise, use default\r\n if (!model) {\r\n model = pipelineInfo.default.model\r\n console.log(`No model specified. Using default model: \"${model}\".`);\r\n }\r\n\r\n // determine suffix\r\n let suffix = TASK_NAME_MAPPING[task];\r\n if (!suffix) {\r\n // try get from suffix\r\n for (const [prefix, mapping] of Object.entries(TASK_PREFIX_MAPPING)) {\r\n if (task.startsWith(prefix)) {\r\n suffix = mapping;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!suffix) {\r\n // Still not set... so, we default to the name given\r\n suffix = task;\r\n }\r\n\r\n // Construct model path\r\n model = pathJoin(\r\n (env.remoteModels) ? env.remoteURL : env.localURL, // host prefix\r\n model, // model name\r\n suffix, // task suffix\r\n )\r\n\r\n let tokenizerClass = pipelineInfo.tokenizer;\r\n let modelClass = pipelineInfo.model;\r\n let pipelineClass = pipelineInfo.pipeline;\r\n let processorClass = pipelineInfo.processor;\r\n\r\n let promises = [];\r\n\r\n if (tokenizerClass) {\r\n promises.push(\r\n AutoTokenizer.from_pretrained(model, progress_callback),\r\n )\r\n }\r\n if (modelClass) {\r\n promises.push(\r\n modelClass.from_pretrained(model, progress_callback)\r\n )\r\n }\r\n\r\n if (processorClass) {\r\n promises.push(\r\n processorClass.from_pretrained(model, progress_callback)\r\n )\r\n }\r\n\r\n // Load tokenizer and model\r\n let items = await Promise.all(promises)\r\n // TODO: fix error below\r\n return new pipelineClass(task, ...items);\r\n\r\n}\r\n\r\n/**\r\n * Compute the Cartesian product of given arrays\r\n * @param {...Array} a - Arrays to compute the product\r\n * @returns {Array} - Returns the computed Cartesian product as an array\r\n */\r\nfunction product(...a) {\r\n // Cartesian product of items\r\n // Adapted from https://stackoverflow.com/a/43053803\r\n return a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e])));\r\n}\r\n\r\nmodule.exports = {\r\n pipeline\r\n};\r\n","\r\nconst {\r\n Callable,\r\n fetchJSON,\r\n indexOfMax,\r\n softmax,\r\n} = require(\"./utils.js\");\r\n\r\n\r\nconst FFT = require('./fft.js');\r\nconst { Tensor, transpose, cat, interpolate } = require(\"./tensor_utils.js\");\r\n\r\nconst { CustomImage } = require('./image_utils.js');\r\n/**\r\n * Helper class to determine model type from config\r\n */\r\nclass AutoProcessor {\r\n /**\r\n * Returns a new instance of a Processor with a feature extractor\r\n * based on the configuration file located at `modelPath`.\r\n *\r\n * @param {string} modelPath - The path to the model directory.\r\n * @param {function} progressCallback - A callback function to track the loading progress (optional).\r\n * @returns {Promise} A Promise that resolves with a new instance of a Processor.\r\n * @throws {Error} If the feature extractor type specified in the configuration file is unknown.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let preprocessorConfig = await fetchJSON(modelPath, 'preprocessor_config.json', progressCallback)\r\n\r\n let processor_class;\r\n let feature_extractor;\r\n\r\n switch (preprocessorConfig.feature_extractor_type) {\r\n case 'WhisperFeatureExtractor':\r\n feature_extractor = new WhisperFeatureExtractor(preprocessorConfig)\r\n break;\r\n case 'ViTFeatureExtractor':\r\n feature_extractor = new ViTFeatureExtractor(preprocessorConfig)\r\n break;\r\n case 'DetrFeatureExtractor':\r\n feature_extractor = new DetrFeatureExtractor(preprocessorConfig)\r\n break;\r\n default:\r\n if (preprocessorConfig.size !== undefined) {\r\n // Assume ImageFeatureExtractor\r\n console.warn('Feature extractor type not specified, assuming ImageFeatureExtractor due to size parameter in config.')\r\n feature_extractor = new ImageFeatureExtractor(preprocessorConfig)\r\n\r\n } else {\r\n throw new Error(`Unknown Feature Extractor type: ${preprocessorConfig.feature_extractor_type}`);\r\n\r\n }\r\n }\r\n\r\n switch (preprocessorConfig.processor_class) {\r\n case 'WhisperProcessor':\r\n processor_class = WhisperProcessor;\r\n break;\r\n default:\r\n // No associated processor class, use default\r\n processor_class = Processor;\r\n }\r\n\r\n return new processor_class(feature_extractor);\r\n }\r\n}\r\n\r\n/**\r\n * Base class for feature extractors.\r\n *\r\n * @extends Callable\r\n */\r\nclass FeatureExtractor extends Callable {\r\n /**\r\n * Constructs a new FeatureExtractor instance.\r\n *\r\n * @param {object} config - The configuration for the feature extractor.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config\r\n }\r\n}\r\n\r\n/**\r\n * Feature extractor for Vision Transformer (ViT) models.\r\n *\r\n * @extends FeatureExtractor\r\n */\r\nclass ImageFeatureExtractor extends FeatureExtractor {\r\n\r\n /**\r\n * Constructs a new ViTFeatureExtractor instance.\r\n *\r\n * @param {object} config - The configuration for the feature extractor.\r\n * @param {number[]} config.image_mean - The mean values for image normalization.\r\n * @param {number[]} config.image_std - The standard deviation values for image normalization.\r\n * @param {boolean} config.do_rescale - Whether to rescale the image pixel values to the [0,1] range.\r\n * @param {boolean} config.do_normalize - Whether to normalize the image pixel values.\r\n * @param {boolean} config.do_resize - Whether to resize the image.\r\n * @param {number} config.size - The size to resize the image to.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.image_mean = this.config.image_mean;\r\n if (!Array.isArray(this.image_mean)) {\r\n this.image_mean = new Array(3).fill(this.image_mean);\r\n }\r\n\r\n this.image_std = this.config.image_std;\r\n if (!Array.isArray(this.image_std)) {\r\n this.image_std = new Array(3).fill(this.image_std);\r\n }\r\n\r\n this.do_rescale = this.config.do_rescale ?? true;\r\n this.do_normalize = this.config.do_normalize;\r\n\r\n this.do_resize = this.config.do_resize;\r\n this.size = this.config.size;\r\n\r\n this.max_size = this.config.max_size;\r\n\r\n // TODO use these\r\n this.do_center_crop = this.config.do_center_crop;\r\n this.crop_size = this.config.crop_size;\r\n }\r\n\r\n /**\r\n * Preprocesses the given image.\r\n *\r\n * @param {CustomImage} image - The image to preprocess.\r\n * @returns {Promise} The preprocessed image as a Tensor.\r\n */\r\n async preprocess(image) {\r\n\r\n const srcWidth = image.width; // original width\r\n const srcHeight = image.height; // original height\r\n\r\n // First, resize all images\r\n if (this.do_resize) {\r\n // If `max_size` is set, maintain aspect ratio and resize to `size`\r\n // while keeping the largest dimension <= `max_size`\r\n if (this.max_size !== undefined) {\r\n // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/\r\n // Try resize so that shortest edge is `this.size` (target)\r\n const ratio = Math.max(this.size / srcWidth, this.size / srcHeight);\r\n const newWidth = srcWidth * ratio;\r\n const newHeight = srcHeight * ratio;\r\n\r\n // The new width and height might be greater than `this.max_size`, so\r\n // we downscale again to ensure the largest dimension is `this.max_size` \r\n const downscaleFactor = Math.min(this.max_size / newWidth, this.max_size / newHeight, 1);\r\n\r\n // Perform resize\r\n image = await image.resize(Math.floor(newWidth * downscaleFactor), Math.floor(newHeight * downscaleFactor));\r\n\r\n } else {\r\n image = await image.resize(this.size, this.size);\r\n }\r\n }\r\n\r\n // Convert image to RGB\r\n image = image.rgb();\r\n\r\n const pixelData = Float32Array.from(image.data);\r\n\r\n if (this.do_rescale) {\r\n for (let i = 0; i < pixelData.length; ++i) {\r\n pixelData[i] = pixelData[i] / 255;\r\n }\r\n }\r\n\r\n if (this.do_normalize) {\r\n for (let i = 0; i < pixelData.length; i += 3) {\r\n for (let j = 0; j < 3; ++j) {\r\n pixelData[i + j] = (pixelData[i + j] - this.image_mean[j]) / this.image_std[j];\r\n }\r\n }\r\n }\r\n\r\n let imgDims = [image.height, image.width, 3];\r\n let img = new Tensor('float32', pixelData, imgDims);\r\n let transposed = transpose(img, [2, 0, 1]); // hwc -> chw\r\n\r\n return transposed;\r\n }\r\n\r\n /**\r\n * Calls the feature extraction process on an array of image\r\n * URLs, preprocesses each image, and concatenates the resulting\r\n * features into a single Tensor.\r\n * @param {any} images - The URL(s) of the image(s) to extract features from.\r\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\r\n */\r\n async _call(images) {\r\n if (!Array.isArray(images)) {\r\n images = [images];\r\n }\r\n images = await Promise.all(images.map(x => this.preprocess(x)));\r\n\r\n images.forEach(x => x.dims = [1, ...x.dims]); // add batch dimension\r\n\r\n images = cat(images);\r\n // TODO concatenate on dim=0\r\n return {\r\n pixel_values: images\r\n }\r\n }\r\n\r\n}\r\n\r\nclass ViTFeatureExtractor extends ImageFeatureExtractor { }\r\n\r\n/**\r\n * Detr Feature Extractor.\r\n *\r\n * @extends ImageFeatureExtractor\r\n */\r\nclass DetrFeatureExtractor extends ImageFeatureExtractor {\r\n /**\r\n * Calls the feature extraction process on an array of image\r\n * URLs, preprocesses each image, and concatenates the resulting\r\n * features into a single Tensor.\r\n * @param {any} urls - The URL(s) of the image(s) to extract features from.\r\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\r\n */\r\n async _call(urls) {\r\n let result = await super._call(urls);\r\n\r\n // TODO support differently-sized images, for now assume all images are the same size.\r\n // TODO support different mask sizes (not just 64x64)\r\n // Currently, just fill pixel mask with 1s\r\n let maskSize = [result.pixel_values.dims[0], 64, 64];\r\n result.pixel_mask = new Tensor(\r\n 'int64',\r\n // TODO: fix error below\r\n new BigInt64Array(maskSize.reduce((a, b) => a * b)).fill(1n),\r\n maskSize\r\n );\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * @param {number[]} arr - The URL(s) of the image(s) to extract features from.\r\n * @returns {number[]} An object containing the concatenated pixel values of the preprocessed images.\r\n */\r\n center_to_corners_format([centerX, centerY, width, height]) {\r\n return [\r\n centerX - width / 2,\r\n centerY - height / 2,\r\n centerX + width / 2,\r\n centerY + height / 2\r\n ];\r\n }\r\n\r\n /**\r\n * @param {{ logits: any; pred_boxes: any; }} outputs\r\n * @return {any}\r\n */\r\n post_process_object_detection(outputs, threshold = 0.5, target_sizes = null) {\r\n const out_logits = outputs.logits;\r\n const out_bbox = outputs.pred_boxes;\r\n const [batch_size, num_boxes, num_classes] = out_logits.dims;\r\n\r\n if (target_sizes !== null && target_sizes.length !== batch_size) {\r\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\r\n }\r\n let toReturn = [];\r\n for (let i = 0; i < batch_size; ++i) {\r\n let target_size = target_sizes !== null ? target_sizes[i] : null;\r\n let info = {\r\n boxes: [],\r\n classes: [],\r\n scores: []\r\n }\r\n let logits = out_logits.get(i);\r\n let bbox = out_bbox.get(i);\r\n\r\n for (let j = 0; j < num_boxes; ++j) {\r\n let logit = logits.get(j);\r\n\r\n // Get most probable class\r\n let maxIndex = indexOfMax(logit.data);\r\n\r\n if (maxIndex === num_classes - 1) {\r\n // This is the background class, skip it\r\n continue;\r\n }\r\n\r\n // Compute softmax over classes\r\n let probs = softmax(logit.data);\r\n\r\n let score = probs[maxIndex];\r\n if (score > threshold) {\r\n // Some class has a high enough probability\r\n /** @type {number[]} */\r\n let box = bbox.get(j);\r\n\r\n // convert to [x0, y0, x1, y1] format\r\n box = this.center_to_corners_format(box)\r\n if (target_size !== null) {\r\n box = box.map((x, i) => x * target_size[(i + 1) % 2])\r\n }\r\n\r\n info.boxes.push(box);\r\n info.classes.push(maxIndex);\r\n info.scores.push(score);\r\n }\r\n }\r\n toReturn.push(info);\r\n }\r\n return toReturn;\r\n }\r\n\r\n /**\r\n * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`.\r\n * @param {Tensor} class_logits - The class logits.\r\n * @param {Tensor} mask_logits - The mask logits.\r\n * @param {number} object_mask_threshold - A number between 0 and 1 used to binarize the masks.\r\n * @param {number} num_labels - The number of labels.\r\n * @returns {[Tensor[], number[], number[]]} - The binarized masks, the scores, and the labels.\r\n */\r\n remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) {\r\n\r\n let mask_probs_item = [];\r\n let pred_scores_item = [];\r\n let pred_labels_item = [];\r\n\r\n for (let j = 0; j < class_logits.dims[0]; ++j) {\r\n let cls = class_logits.get(j);\r\n let mask = mask_logits.get(j);\r\n\r\n let pred_label = indexOfMax(cls.data);\r\n if (pred_label === num_labels) {\r\n // Is the background, so we ignore it\r\n continue;\r\n }\r\n\r\n let scores = softmax(cls.data);\r\n let pred_score = scores[pred_label];\r\n if (pred_score > object_mask_threshold) {\r\n mask_probs_item.push(mask);\r\n pred_scores_item.push(pred_score);\r\n pred_labels_item.push(pred_label);\r\n }\r\n }\r\n\r\n return [mask_probs_item, pred_scores_item, pred_labels_item];\r\n\r\n }\r\n\r\n /**\r\n * Checks whether the segment is valid or not.\r\n * @param {Int32Array} mask_labels - Labels for each pixel in the mask.\r\n * @param {Tensor[]} mask_probs - Probabilities for each pixel in the masks.\r\n * @param {number} k - The class id of the segment.\r\n * @param {number} mask_threshold - The mask threshold.\r\n * @param {number} overlap_mask_area_threshold - The overlap mask area threshold.\r\n * @returns {[boolean, number[]]} - Whether the segment is valid or not, and the indices of the valid labels.\r\n */\r\n check_segment_validity(\r\n mask_labels,\r\n mask_probs,\r\n k,\r\n mask_threshold = 0.5,\r\n overlap_mask_area_threshold = 0.8\r\n ) {\r\n // mask_k is a 1D array of indices, indicating where the mask is equal to k\r\n let mask_k = [];\r\n let mask_k_area = 0;\r\n let original_area = 0;\r\n\r\n // Compute the area of all the stuff in query k\r\n for (let i = 0; i < mask_labels.length; ++i) {\r\n if (mask_labels[i] === k) {\r\n mask_k.push(i);\r\n ++mask_k_area;\r\n }\r\n\r\n if (mask_probs[k].data[i] >= mask_threshold) {\r\n ++original_area;\r\n }\r\n }\r\n let mask_exists = mask_k_area > 0 && original_area > 0;\r\n\r\n // Eliminate disconnected tiny segments\r\n if (mask_exists) {\r\n // Perform additional check\r\n let area_ratio = mask_k_area / original_area;\r\n mask_exists = area_ratio > overlap_mask_area_threshold;\r\n }\r\n\r\n return [mask_exists, mask_k]\r\n }\r\n\r\n /**\r\n * Computes the segments.\r\n * @param {Tensor[]} mask_probs - The mask probabilities.\r\n * @param {number[]} pred_scores - The predicted scores.\r\n * @param {number[]} pred_labels - The predicted labels.\r\n * @param {number} mask_threshold - The mask threshold.\r\n * @param {number} overlap_mask_area_threshold - The overlap mask area threshold.\r\n * @param {Set} label_ids_to_fuse - The label ids to fuse.\r\n * @param {number[]} target_size - The target size of the image.\r\n * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} - The computed segments.\r\n */\r\n compute_segments(\r\n mask_probs,\r\n pred_scores,\r\n pred_labels,\r\n mask_threshold,\r\n overlap_mask_area_threshold,\r\n label_ids_to_fuse = null,\r\n target_size = null,\r\n ) {\r\n let [height, width] = target_size ?? mask_probs[0].dims;\r\n\r\n let segmentation = new Tensor(\r\n 'int32',\r\n new Int32Array(height * width),\r\n [height, width]\r\n );\r\n let segments = [];\r\n\r\n // 1. If target_size is not null, we need to resize the masks to the target size\r\n if (target_size !== null) {\r\n // resize the masks to the target size\r\n for (let i = 0; i < mask_probs.length; ++i) {\r\n mask_probs[i] = interpolate(mask_probs[i], target_size, 'bilinear', false);\r\n }\r\n }\r\n\r\n // 2. Weigh each mask by its prediction score\r\n // NOTE: `mask_probs` is updated in-place\r\n // \r\n // Temporary storage for the best label/scores for each pixel ([height, width]):\r\n let mask_labels = new Int32Array(mask_probs[0].data.length);\r\n let bestScores = new Float32Array(mask_probs[0].data.length);\r\n\r\n for (let i = 0; i < mask_probs.length; ++i) {\r\n let score = pred_scores[i];\r\n\r\n for (let j = 0; j < mask_probs[i].data.length; ++j) {\r\n mask_probs[i].data[j] *= score\r\n if (mask_probs[i].data[j] > bestScores[j]) {\r\n mask_labels[j] = i;\r\n bestScores[j] = mask_probs[i].data[j];\r\n }\r\n }\r\n }\r\n\r\n let current_segment_id = 0;\r\n\r\n // let stuff_memory_list = {}\r\n for (let k = 0; k < pred_labels.length; ++k) {\r\n let pred_class = pred_labels[k];\r\n\r\n // TODO add `should_fuse`\r\n // let should_fuse = pred_class in label_ids_to_fuse\r\n\r\n // Check if mask exists and large enough to be a segment\r\n let [mask_exists, mask_k] = this.check_segment_validity(\r\n mask_labels,\r\n mask_probs,\r\n k,\r\n mask_threshold,\r\n overlap_mask_area_threshold\r\n )\r\n\r\n if (!mask_exists) {\r\n // Nothing to see here\r\n continue;\r\n }\r\n\r\n // TODO\r\n // if (pred_class in stuff_memory_list) {\r\n // current_segment_id = stuff_memory_list[pred_class]\r\n // } else {\r\n // current_segment_id += 1;\r\n // }\r\n ++current_segment_id;\r\n\r\n\r\n // Add current object segment to final segmentation map\r\n for (let index of mask_k) {\r\n segmentation.data[index] = current_segment_id;\r\n }\r\n\r\n segments.push({\r\n id: current_segment_id,\r\n label_id: pred_class,\r\n // was_fused: should_fuse, TODO\r\n score: pred_scores[k],\r\n })\r\n\r\n // TODO\r\n // if(should_fuse){\r\n // stuff_memory_list[pred_class] = current_segment_id\r\n // }\r\n }\r\n\r\n return [segmentation, segments];\r\n }\r\n\r\n /**\r\n * Post-process the model output to generate the final panoptic segmentation.\r\n * @param {*} outputs - The model output to post process\r\n * @param {number} [threshold=0.5] - The probability score threshold to keep predicted instance masks.\r\n * @param {number} [mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values.\r\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.\r\n * @param {Set} [label_ids_to_fuse=null] - The labels in this state will have all their instances be fused together.\r\n * @param {number[][]} [target_sizes=null] - The target sizes to resize the masks to.\r\n * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>}\r\n */\r\n post_process_panoptic_segmentation(\r\n outputs,\r\n threshold = 0.5,\r\n mask_threshold = 0.5,\r\n overlap_mask_area_threshold = 0.8,\r\n label_ids_to_fuse = null,\r\n target_sizes = null,\r\n ) {\r\n if (label_ids_to_fuse === null) {\r\n console.warn(\"`label_ids_to_fuse` unset. No instance will be fused.\")\r\n label_ids_to_fuse = new Set();\r\n }\r\n\r\n const class_queries_logits = outputs.logits; // [batch_size, num_queries, num_classes+1]\r\n const masks_queries_logits = outputs.pred_masks; // [batch_size, num_queries, height, width]\r\n\r\n const mask_probs = masks_queries_logits.sigmoid() // [batch_size, num_queries, height, width]\r\n\r\n let [batch_size, num_queries, num_labels] = class_queries_logits.dims;\r\n num_labels -= 1; // Remove last class (background)\r\n\r\n if (target_sizes !== null && target_sizes.length !== batch_size) {\r\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\r\n }\r\n\r\n let toReturn = [];\r\n for (let i = 0; i < batch_size; ++i) {\r\n let target_size = target_sizes !== null ? target_sizes[i] : null;\r\n\r\n let class_logits = class_queries_logits.get(i);\r\n let mask_logits = mask_probs.get(i);\r\n\r\n let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels);\r\n\r\n if (pred_labels_item.length === 0) {\r\n // No mask found\r\n let [height, width] = target_size ?? mask_logits.dims.slice(-2);\r\n\r\n let segmentation = new Tensor(\r\n 'int32',\r\n new Int32Array(height * width).fill(-1),\r\n [height, width]\r\n )\r\n toReturn.push({\r\n segmentation: segmentation,\r\n segments_info: []\r\n });\r\n continue;\r\n }\r\n\r\n\r\n // Get segmentation map and segment information of batch item\r\n let [segmentation, segments] = this.compute_segments(\r\n mask_probs_item,\r\n pred_scores_item,\r\n pred_labels_item,\r\n mask_threshold,\r\n overlap_mask_area_threshold,\r\n label_ids_to_fuse,\r\n target_size,\r\n )\r\n\r\n toReturn.push({\r\n segmentation: segmentation,\r\n segments_info: segments\r\n })\r\n }\r\n\r\n return toReturn;\r\n }\r\n\r\n post_process_instance_segmentation() {\r\n // TODO\r\n throw Error(\"Not implemented yet\");\r\n }\r\n}\r\n\r\n\r\nclass WhisperFeatureExtractor extends FeatureExtractor {\r\n\r\n /**\r\n * Calculates the index offset for a given index and window size.\r\n * @param {number} i - The index.\r\n * @param {number} w - The window size.\r\n * @returns {number} The index offset.\r\n */\r\n calcOffset(i, w) {\r\n return Math.abs((i + w) % (2 * w) - w);\r\n }\r\n\r\n /**\r\n * Pads an array with a reflected version of itself on both ends.\r\n * @param {Float32Array} array - The array to pad.\r\n * @param {number} left - The amount of padding to add to the left.\r\n * @param {number} right - The amount of padding to add to the right.\r\n * @returns {Float32Array} The padded array.\r\n */\r\n padReflect(array, left, right) {\r\n const padded = new Float32Array(array.length + left + right);\r\n const w = array.length - 1;\r\n\r\n for (let i = 0; i < array.length; ++i) {\r\n padded[left + i] = array[i];\r\n }\r\n\r\n for (let i = 1; i <= left; ++i) {\r\n padded[left - i] = array[this.calcOffset(i, w)];\r\n }\r\n\r\n for (let i = 1; i <= right; ++i) {\r\n padded[w + left + i] = array[this.calcOffset(w - i, w)];\r\n }\r\n\r\n return padded;\r\n }\r\n\r\n /**\r\n * Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal.\r\n * \r\n * @param {number[][]} frames - A 2D array representing the signal frames.\r\n * @param {number[]} window - A 1D array representing the window to be applied to the frames.\r\n * @returns {Object} An object with the following properties:\r\n * - data: A 1D array representing the complex STFT of the signal.\r\n * - dims: An array representing the dimensions of the STFT data, i.e. [num_frames, num_fft_bins].\r\n */\r\n stft(frames, window) {\r\n // Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal.\r\n // \r\n // NOTE: Since the window width is not a power of 2, we must \r\n // perform Fast Fourier Transform with chirp-z transform:\r\n // https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156\r\n\r\n // Helper variables\r\n const fft_size = this.config.n_fft;\r\n const a = 2 * (fft_size - 1);\r\n const b = 2 * (2 * fft_size - 1);\r\n const nextP2 = 2 ** (Math.ceil(Math.log2(b)))\r\n const num_fft_bins = fft_size + 2;\r\n\r\n // Preallocate array to store output\r\n // double since we store complex numbers\r\n const data = new Float32Array(num_fft_bins * frames.length);\r\n\r\n // Define buffers\r\n // Compute chirp for transform\r\n const chirp = new Float32Array(b);\r\n const ichirp = new Float32Array(nextP2);\r\n const buffer1 = new Float32Array(nextP2);\r\n const buffer2 = new Float32Array(nextP2);\r\n const outBuffer = new Float32Array(nextP2);\r\n const outBuffer2 = new Float32Array(nextP2);\r\n const outBuffer3 = new Float32Array(nextP2);\r\n\r\n // Compute complex exponentiation\r\n const theta = -2 * Math.PI / fft_size;\r\n const baseR = Math.cos(theta);\r\n const baseI = Math.sin(theta);\r\n\r\n // Precompute helper for chirp-z transform\r\n for (let i = 0; i < b >> 1; ++i) {\r\n // Compute complex power:\r\n const e = (i + 1 - fft_size) ** 2 / 2.0;\r\n\r\n // Compute the modulus and argument of the result\r\n const result_mod = Math.sqrt(baseR ** 2 + baseI ** 2) ** e;\r\n const result_arg = e * Math.atan2(baseI, baseR);\r\n\r\n // Convert the result back to rectangular form\r\n // and assign to chirp and ichirp\r\n let i2 = 2 * i;\r\n chirp[i2] = result_mod * Math.cos(result_arg);\r\n chirp[i2 + 1] = result_mod * Math.sin(result_arg);\r\n\r\n // conjugate\r\n ichirp[i2] = chirp[i2];\r\n ichirp[i2 + 1] = - chirp[i2 + 1];\r\n }\r\n const slicedChirp = chirp.subarray(a, b);\r\n\r\n // create object to perform Fast Fourier Transforms\r\n // with `nextP2` complex numbers\r\n const f = new FFT(nextP2 >> 1);\r\n // TODO: decide between Float32Array and Float64Array\r\n f.transform(outBuffer, ichirp);\r\n\r\n for (let i = 0; i < frames.length; ++i) {\r\n const frame = frames[i];\r\n\r\n for (let j = 0; j < slicedChirp.length; j += 2) {\r\n const j2 = j + 1\r\n const j3 = j >> 1;\r\n\r\n const a_real = frame[j3] * window[j3];\r\n buffer1[j] = a_real * slicedChirp[j];\r\n buffer1[j2] = a_real * slicedChirp[j2];\r\n }\r\n // TODO: decide between Float32Array and Float64Array\r\n f.transform(outBuffer2, buffer1);\r\n\r\n for (let j = 0; j < outBuffer.length; j += 2) {\r\n const j2 = j + 1;\r\n\r\n buffer2[j] = outBuffer2[j] * outBuffer[j] - outBuffer2[j2] * outBuffer[j2]\r\n buffer2[j2] = outBuffer2[j] * outBuffer[j2] + outBuffer2[j2] * outBuffer[j]\r\n }\r\n // TODO: decide between Float32Array and Float64Array\r\n f.inverseTransform(outBuffer3, buffer2)\r\n\r\n const offset = i * num_fft_bins;\r\n for (let j = 0; j < num_fft_bins; j += 2) {\r\n const a_real = outBuffer3[j + a];\r\n const a_imag = outBuffer3[j + a + 1];\r\n const b_real = slicedChirp[j];\r\n const b_imag = slicedChirp[j + 1];\r\n\r\n // TODO write as transpose\r\n const o1 = offset + j;\r\n data[o1] = a_real * b_real - a_imag * b_imag\r\n data[o1 + 1] = a_real * b_imag + a_imag * b_real\r\n }\r\n }\r\n\r\n return {\r\n data: data,\r\n dims: [frames.length, num_fft_bins] // [3001, 402]\r\n };\r\n }\r\n\r\n /**\r\n * Creates an array of frames from a given waveform.\r\n *\r\n * @param {Float32Array} waveform - The waveform to create frames from.\r\n * @param {boolean} [center=true] - Whether to center the frames on their corresponding positions in the waveform. Defaults to true.\r\n * @returns {Array} An array of frames.\r\n */\r\n fram_wave(waveform, center = true) {\r\n const frames = [];\r\n const half_window = Math.floor((this.config.n_fft - 1) / 2) + 1;\r\n const waveformLength = waveform.length;\r\n\r\n for (let i = 0; i < waveformLength + 1; i += this.config.hop_length) {\r\n\r\n let frame;\r\n if (center) {\r\n\r\n let frameStart = i > half_window ? i - half_window : 0;\r\n let frameEnd =\r\n i < waveformLength - half_window\r\n ? i + half_window\r\n : waveformLength;\r\n\r\n frame = waveform.subarray(frameStart, frameEnd)\r\n\r\n if (frameStart === 0) {\r\n frame = this.padReflect(\r\n frame,\r\n -i + half_window,\r\n 0\r\n )\r\n\r\n } else if (frameEnd === waveformLength) {\r\n frame = this.padReflect(\r\n frame,\r\n 0,\r\n i - waveformLength + half_window\r\n )\r\n }\r\n\r\n } else {\r\n frame = new Float32Array(this.config.n_fft);\r\n const frameArray = waveform.subarray(i, i + this.config.n_fft);\r\n\r\n if (frameArray.length < this.config.n_fft) {\r\n frame.set(frameArray);\r\n frame.fill(0, frameArray.length, this.config.n_fft)\r\n } else {\r\n frame = frameArray;\r\n }\r\n\r\n }\r\n frames.push(frame);\r\n }\r\n\r\n return frames;\r\n }\r\n\r\n /**\r\n * Generates a Hanning window of length M.\r\n *\r\n * @param {number} M - The length of the Hanning window to generate.\r\n * @returns {*} - The generated Hanning window.\r\n */\r\n hanning(M) {\r\n if (M < 1) {\r\n return [];\r\n }\r\n if (M === 1) {\r\n return [1];\r\n }\r\n const denom = M - 1;\r\n const cos_vals = new Float32Array(denom);\r\n for (let i = 0; i < denom; ++i) {\r\n const n = 2 * i - M + 1;\r\n cos_vals[i] = 0.5 + 0.5 * Math.cos(Math.PI * n / denom);\r\n }\r\n return cos_vals;\r\n }\r\n\r\n /**\r\n * Computes the log-Mel spectrogram of the provided audio waveform.\r\n * @param {Float32Array} waveform - The audio waveform to process.\r\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\r\n */\r\n _extract_fbank_features(waveform) {\r\n // Compute the log-Mel spectrogram of the provided audio\r\n\r\n const buffer = new Float32Array(this.config.n_samples);\r\n buffer.set(waveform)\r\n\r\n const window = this.hanning(this.config.n_fft + 1)\r\n const frames = this.fram_wave(buffer)\r\n\r\n const stft = this.stft(frames, window)\r\n\r\n const stftData = stft.data;\r\n const d1 = stft.dims[0] - 1; // Ignore last row\r\n const d2 = stft.dims[1] >> 1; // Only need to store real numbers now\r\n\r\n // compute magnitudes\r\n // NOTE: Unlinke the original implementation, we do not\r\n // transpose since we perform matrix multiplication later\r\n const magnitudes = new Float32Array(d1 * d2);\r\n for (let i = 0; i < d1; ++i) {\r\n for (let j = 0; j < d2; ++j) {\r\n // let outOffset = (j * d1 + i); // transpose\r\n let outOffset = i * d2 + j;\r\n let inOffset = outOffset << 1; // * 2 since complex\r\n let magnitude = stftData[inOffset] ** 2 + stftData[inOffset + 1] ** 2\r\n magnitudes[outOffset] = magnitude;\r\n }\r\n }\r\n\r\n const mel_filters = this.config.mel_filters\r\n const num_mel_filters = mel_filters.length;\r\n\r\n const mel_spec = new Float32Array(num_mel_filters * d1);\r\n let mIndex = 0;\r\n\r\n // Perform matrix muliplication:\r\n // mel_spec = filters @ magnitudes\r\n // - filters.shape=(80, 201)\r\n // - magnitudes.shape=(201, 3000)\r\n // - mel_spec.shape=(80, 3000)\r\n for (let i = 0; i < num_mel_filters; ++i) {\r\n const mel_filter = mel_filters[i];\r\n\r\n for (let j = 0; j < d1; ++j) {\r\n let sum = 0;\r\n\r\n // perform dot product\r\n for (let k = 0; k < d2; ++k) {\r\n sum += mel_filter[k] * magnitudes[j * d2 + k];\r\n }\r\n\r\n mel_spec[mIndex++] = sum;\r\n }\r\n }\r\n\r\n const a_min = 1e-10;\r\n const log_spec = new Float32Array(mel_spec.length);\r\n\r\n let maxLogSpec = 0;\r\n for (let i = 0; i < mel_spec.length; i++) {\r\n const clipped = Math.max(a_min, mel_spec[i]);\r\n const log10 = Math.log10(clipped);\r\n log_spec[i] = log10;\r\n maxLogSpec = Math.max(log10, maxLogSpec)\r\n }\r\n\r\n for (let i = 0; i < log_spec.length; i++) {\r\n log_spec[i] = Math.max(log_spec[i], maxLogSpec - 8);\r\n log_spec[i] = (log_spec[i] + 4) / 4;\r\n }\r\n\r\n return {\r\n data: log_spec,\r\n dims: [num_mel_filters, d1]\r\n };\r\n }\r\n\r\n /**\r\n * Asynchronously extracts features from a given audio using the provided configuration.\r\n * @param {Float32Array} audio - The audio data as a Float32Array.\r\n * @returns {Promise<{ input_features: Tensor }>} - A Promise resolving to an object containing the extracted input features as a Tensor.\r\n * @async\r\n */\r\n async _call(audio) {\r\n // audio is a float32array\r\n\r\n if (audio.length > this.config.n_samples) {\r\n console.warn(\r\n \"Attempting to extract features for audio longer than 30 seconds. \" +\r\n \"If using a pipeline to extract transcript from a long audio clip, \" +\r\n \"remember to specify `chunk_length_s` and/or `stride_length_s`.\"\r\n );\r\n }\r\n let waveform = audio.slice(0, this.config.n_samples)\r\n\r\n let features = this._extract_fbank_features(waveform);\r\n\r\n return {\r\n input_features: new Tensor('float32',\r\n features.data,\r\n [1, ...features.dims]\r\n )\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Represents a Processor that extracts features from an input.\r\n * @extends Callable\r\n */\r\nclass Processor extends Callable {\r\n /**\r\n * Creates a new Processor with the given feature extractor.\r\n * @param {function} feature_extractor - The function used to extract features from the input.\r\n */\r\n constructor(feature_extractor) {\r\n super();\r\n this.feature_extractor = feature_extractor;\r\n // TODO use tokenizer here?\r\n }\r\n\r\n /**\r\n * Calls the feature_extractor function with the given input.\r\n * @param {any} input - The input to extract features from.\r\n * @returns {Promise} A Promise that resolves with the extracted features.\r\n * @async\r\n */\r\n async _call(input) {\r\n return await this.feature_extractor(input);\r\n }\r\n}\r\n\r\n/**\r\n * Represents a WhisperProcessor that extracts features from an audio input.\r\n * @extends Processor\r\n */\r\nclass WhisperProcessor extends Processor {\r\n /**\r\n * Calls the feature_extractor function with the given audio input.\r\n * @param {any} audio - The audio input to extract features from.\r\n * @returns {Promise} A Promise that resolves with the extracted features.\r\n * @async\r\n */\r\n async _call(audio) {\r\n return await this.feature_extractor(audio)\r\n }\r\n}\r\n\r\n\r\nmodule.exports = {\r\n AutoProcessor,\r\n Processor,\r\n}\r\n","const {\r\n Callable,\r\n indexOfMax,\r\n softmax,\r\n log_softmax,\r\n getTopItems\r\n} = require(\"./utils.js\");\r\n\r\n/**\r\n * Sampler is a base class for all sampling methods used for text generation.\r\n */\r\nclass Sampler extends Callable {\r\n /**\r\n * Creates a new Sampler object with the specified temperature.\r\n * @param {number} temperature - The temperature to use when sampling. Higher values result in more random samples.\r\n */\r\n constructor(temperature) {\r\n super();\r\n this.temperature = temperature;\r\n }\r\n\r\n /**\r\n * Executes the sampler, using the specified logits.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @returns {void}\r\n */\r\n _call(logits, index = -1) {\r\n // Sample from logits, of dims [batch, sequence_length, vocab_size].\r\n // If index is specified, sample from [batch, index, vocab_size].\r\n return this.sample(logits, index);\r\n }\r\n\r\n /**\r\n * Abstract method for sampling the logits.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @throws {Error}\r\n */\r\n sample(logits, index) {\r\n throw Error(\"sample should be implemented in subclasses.\")\r\n }\r\n\r\n /**\r\n * Returns the specified logits as an array, with temperature applied.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @returns {Array}\r\n */\r\n getLogits(logits, index) {\r\n let vocabSize = logits.dims[2];\r\n\r\n let logs = logits.data;\r\n\r\n if (index === -1) {\r\n logs = logs.slice(-vocabSize);\r\n } else {\r\n let startIndex = index * vocabSize;\r\n logs = logs.slice(startIndex, startIndex + vocabSize);\r\n }\r\n\r\n // add temperature\r\n if (this.temperature > 0) {\r\n logs = logs.map(x => x / this.temperature)\r\n }\r\n return logs;\r\n }\r\n\r\n /**\r\n * Selects an item randomly based on the specified probabilities.\r\n * @param {Array} probabilities - An array of probabilities to use for selection.\r\n * @returns {number} The index of the selected item.\r\n */\r\n randomSelect(probabilities) {\r\n // Return index of chosen item\r\n let sumProbabilities = probabilities.reduce((acc, curr) => acc + curr, 0);\r\n\r\n let r = Math.random() * sumProbabilities;\r\n for (let i = 0; i < probabilities.length; ++i) {\r\n r -= probabilities[i];\r\n if (r <= 0) {\r\n return i;\r\n }\r\n }\r\n return 0; // return first (most probable) as a fallback\r\n }\r\n\r\n /**\r\n * Returns a Sampler object based on the specified options.\r\n * @param {object} generation_config - An object containing options for the sampler.\r\n * @returns {Sampler} A Sampler object.\r\n */\r\n static getSampler(generation_config) {\r\n if (generation_config.num_beams > 1) {\r\n return new BeamSearchSampler(\r\n generation_config.temperature,\r\n generation_config.num_beams,\r\n generation_config.do_sample,\r\n generation_config.top_k,\r\n );\r\n\r\n } else if (generation_config.do_sample) {\r\n return new TopKSampler(\r\n generation_config.temperature,\r\n generation_config.top_k,\r\n );\r\n\r\n } else {\r\n if (generation_config.num_return_sequences > 1) {\r\n throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${generation_config.num_return_sequences}.`)\r\n }\r\n return new GreedySampler(generation_config.temperature);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a Greedy Sampler.\r\n * @extends Sampler\r\n */\r\nclass GreedySampler extends Sampler {\r\n /**\r\n * Sample the maximum probability of a given logits tensor.\r\n * @param {any} logits\r\n * @param {number} [index=-1]\r\n * @returns {Array} - An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search).\r\n */\r\n sample(logits, index = -1) {\r\n // NOTE: no need to do log_softmax here since we only take the maximum\r\n let logs = this.getLogits(logits, index);\r\n let argmax = indexOfMax(logs);\r\n\r\n // Note: score is meaningless in this context, since we are performing\r\n // greedy search (p = 1 => log(p) = 0)\r\n return [\r\n [argmax, 0]\r\n ];\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a TopKSampler.\r\n * @extends Sampler\r\n */\r\nclass TopKSampler extends Sampler {\r\n /**\r\n * Create a TopKSampler.\r\n * @param {number} temperature\r\n * @param {number} k\r\n */\r\n constructor(temperature, k) {\r\n super(temperature);\r\n this.k = k;\r\n }\r\n\r\n /**\r\n * Sample from the logits using the top-k sampling strategy.\r\n * @param {any} logits\r\n * @param {number} index\r\n * @returns {Array}\r\n */\r\n sample(logits, index = -1) {\r\n let [batchSize, seqLength, vocabSize] = logits.dims;\r\n let k = vocabSize;\r\n if (this.k > 0) {\r\n k = Math.min(this.k, k);\r\n }\r\n\r\n let logs = this.getLogits(logits, index);\r\n\r\n // Get top k tokens\r\n let topLogits = getTopItems(logs, k);\r\n\r\n // Compute softmax over logits\r\n let probabilities = softmax(topLogits.map(x => x[1]));\r\n\r\n let sampledIndex = this.randomSelect(probabilities);\r\n\r\n let tokenId = topLogits[sampledIndex][0];\r\n let score = Math.log(probabilities[sampledIndex]);\r\n return [\r\n [tokenId, score]\r\n ];\r\n }\r\n}\r\n\r\n/**\r\n * Class representing a beam search sampler for generating sequences.\r\n * @extends Sampler\r\n */\r\nclass BeamSearchSampler extends Sampler {\r\n /**\r\n * Create a BeamSearchSampler.\r\n * @param {number} temperature\r\n * @param {number} num_beams\r\n * @param {boolean} do_sample\r\n * @param {number} top_k\r\n */\r\n constructor(temperature, num_beams, do_sample, top_k) {\r\n super(temperature);\r\n this.num_beams = num_beams; // maximum number of beams\r\n this.do_sample = do_sample; // if true, perform multinomial sampling\r\n\r\n this.top_k = top_k; // if do_sample, sample from top k items\r\n }\r\n\r\n /**\r\n * Samples from the logits to generate a sequence using beam search.\r\n * @param {any} logits - The logits to sample from.\r\n * @param {number} [index=-1] - The index to sample from, if applicable.\r\n * @returns {Array} - An array of arrays containing tokens and scores.\r\n */\r\n sample(logits, index = -1) {\r\n\r\n let logs = this.getLogits(logits, index);\r\n\r\n if (this.do_sample || this.top_k > 0) {\r\n const [batchSize, seqLength, vocabSize] = logits.dims;\r\n\r\n let k = vocabSize;\r\n if (this.top_k > 0) {\r\n k = Math.min(this.top_k, k);\r\n }\r\n const topLogits = getTopItems(logs, k);\r\n\r\n // Compute softmax over top k logits\r\n const probabilities = softmax(topLogits.map(x => x[1]));\r\n\r\n return Array.from({ length: this.num_beams }, () => {\r\n const sampledIndex = this.randomSelect(probabilities);\r\n const tokenId = topLogits[sampledIndex][0];\r\n return [tokenId, Math.log(probabilities[sampledIndex])];\r\n });\r\n\r\n } else {\r\n // first perform log softmax to get scores over whole distribution\r\n const logProbabilities = log_softmax(logs);\r\n const topLogits = getTopItems(logProbabilities, this.num_beams);\r\n return topLogits;\r\n }\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n Sampler,\r\n GreedySampler,\r\n TopKSampler,\r\n BeamSearchSampler\r\n}\r\n","const { ONNX } = require('./backends/onnx.js');\r\n\r\nconst { interpolate: interpolate_data, transpose: transpose_data } = require('./math_utils.js');\r\n\r\n\r\n/**\r\n * @typedef {import('./math_utils.js').AnyTypedArray} AnyTypedArray\r\n */\r\n\r\nconst ONNXTensor = ONNX.Tensor;\r\n\r\n// TODO: fix error below\r\nclass Tensor extends ONNXTensor {\r\n /**\r\n * Create a new Tensor or copy an existing Tensor.\r\n * @param {[string, Array|AnyTypedArray, number[]]|[ONNXTensor]} args \r\n */\r\n constructor(...args) {\r\n if (args[0] instanceof ONNX.Tensor) {\r\n // Create shallow copy\r\n super(args[0].type, args[0].data, args[0].dims);\r\n\r\n } else {\r\n // Create new\r\n super(...args)\r\n }\r\n }\r\n\r\n /**\r\n * Returns an iterator object for iterating over the tensor data in row-major order.\r\n * If the tensor has more than one dimension, the iterator will yield subarrays.\r\n * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order.\r\n */\r\n *[Symbol.iterator]() {\r\n const [iterLength, ...iterDims] = this.dims;\r\n\r\n if (iterDims.length > 0) {\r\n const iterSize = iterDims.reduce((a, b) => a * b);\r\n for (let i = 0; i < iterLength; ++i) {\r\n yield this._subarray(i, iterSize, iterDims);\r\n }\r\n } else {\r\n yield* this.data\r\n }\r\n\r\n }\r\n\r\n /**\r\n * \r\n * @param {number} index \r\n * @returns {Tensor}\r\n * @todo Set type based on dims\r\n */\r\n get(index) {\r\n const iterDims = this.dims.slice(1);\r\n if (iterDims.length > 0) {\r\n const iterSize = iterDims.reduce((a, b) => a * b);\r\n return this._subarray(index, iterSize, iterDims);\r\n } else {\r\n return this.data[index];\r\n }\r\n }\r\n\r\n /**\r\n * @param {any} item \r\n * @returns {number}\r\n */\r\n indexOf(item) {\r\n for (let index = 0; index < this.data.length; ++index) {\r\n // Note: == instead of === so we can match Ints with BigInts\r\n if (this.data[index] == item) {\r\n return index;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n /**\r\n * @param {number} index \r\n * @param {number} iterSize \r\n * @param {any} iterDims \r\n * @returns {Tensor}\r\n */\r\n _subarray(index, iterSize, iterDims) {\r\n let data = this.data.subarray(index * iterSize, (index + 1) * iterSize);\r\n return new Tensor(this.type, data, iterDims);\r\n }\r\n\r\n tolist() {\r\n // Convert tensor data to a n-dimensional JS list\r\n return reshape(this.data, this.dims)\r\n }\r\n\r\n /**\r\n * Return a new Tensor the sigmoid function applied to each element.\r\n * @returns {Tensor} - The tensor with the sigmoid function applied.\r\n */\r\n sigmoid() {\r\n return this.clone().sigmoid_();\r\n }\r\n\r\n /**\r\n * Applies the sigmoid function to the tensor in place.\r\n * @returns {Tensor} - Returns `this`.\r\n */\r\n sigmoid_() {\r\n for (let i = 0; i < this.data.length; ++i) {\r\n this.data[i] = 1 / (1 + Math.exp(-this.data[i]));\r\n }\r\n return this;\r\n }\r\n\r\n clone() {\r\n return new Tensor(this.type, this.data.slice(), this.dims.slice());\r\n }\r\n\r\n // TODO add .slice()\r\n\r\n /**\r\n * Return a transposed version of this Tensor, according to the provided dimensions.\r\n * @param {...number} dims - Dimensions to transpose.\r\n * @returns {Tensor} - The transposed tensor.\r\n */\r\n transpose(...dims) {\r\n return transpose(this, dims);\r\n }\r\n}\r\n\r\n/**\r\n * This creates a nested array of a given type and depth (see examples).\r\n * \r\n * @example\r\n * NestArray; // string[]\r\n * @example\r\n * NestArray; // number[][]\r\n * @example\r\n * NestArray; // string[][][] etc.\r\n * @template T\r\n * @template {number} Depth\r\n * @template {never[]} [Acc=[]]\r\n * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray\r\n */\r\n\r\n/**\r\n * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions.\r\n *\r\n * @example\r\n * reshape([10 ], [1 ]); // Type: number[] Value: [10]\r\n * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]]\r\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\r\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]]\r\n * @param {T[]} data - The input array to reshape.\r\n * @param {DIM} dimensions - The target shape/dimensions.\r\n * @template T\r\n * @template {[number]|[number, number]|[number, number, number]|[number, number, number, number]} DIM\r\n * @returns {NestArray} The reshaped array.\r\n */\r\nfunction reshape(data, dimensions) {\r\n\r\n const totalElements = data.length;\r\n const dimensionSize = dimensions.reduce((a, b) => a * b);\r\n\r\n if (totalElements !== dimensionSize) {\r\n throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`);\r\n }\r\n\r\n /** @type {any} */\r\n let reshapedArray = data;\r\n\r\n for (let i = dimensions.length - 1; i >= 0; i--) {\r\n reshapedArray = reshapedArray.reduce((acc, val) => {\r\n let lastArray = acc[acc.length - 1];\r\n\r\n if (lastArray.length < dimensions[i]) {\r\n lastArray.push(val);\r\n } else {\r\n acc.push([val]);\r\n }\r\n\r\n return acc;\r\n }, [[]]);\r\n }\r\n\r\n return reshapedArray[0];\r\n}\r\n\r\n/**\r\n * Transposes a tensor according to the provided axes.\r\n * @param {any} tensor - The input tensor to transpose.\r\n * @param {Array} axes - The axes to transpose the tensor along.\r\n * @returns {Tensor} The transposed tensor.\r\n */\r\nfunction transpose(tensor, axes) {\r\n const [transposedData, shape] = transpose_data(tensor.data, tensor.dims, axes);\r\n return new Tensor(tensor.type, transposedData, shape);\r\n}\r\n\r\n\r\n/**\r\n * Concatenates an array of tensors along the 0th dimension.\r\n *\r\n * @param {any} tensors - The array of tensors to concatenate.\r\n * @returns {Tensor} - The concatenated tensor.\r\n */\r\nfunction cat(tensors) {\r\n if (tensors.length === 0) {\r\n return tensors[0];\r\n }\r\n // NOTE: tensors must be batched\r\n // NOTE: currently only supports dim=0\r\n // TODO: add support for dim != 0\r\n\r\n\r\n let tensorType = tensors[0].type;\r\n let tensorShape = [...tensors[0].dims];\r\n tensorShape[0] = tensors.length;\r\n\r\n // Calculate total size to allocate\r\n let total = 0;\r\n for (let t of tensors) {\r\n total += t.data.length;\r\n }\r\n\r\n // Create output tensor of same type as first\r\n let data = new tensors[0].data.constructor(total);\r\n\r\n let offset = 0;\r\n for (let t of tensors) {\r\n data.set(t.data, offset);\r\n offset += t.data.length;\r\n }\r\n\r\n return new Tensor(tensorType, data, tensorShape)\r\n}\r\n\r\n/**\r\n * Interpolates an Tensor to the given size.\r\n * @param {Tensor} input - The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])\r\n * @param {number[]} size - The output size of the image\r\n * @param {string} mode - The interpolation mode\r\n * @param {boolean} align_corners - Whether to align corners.\r\n * @returns {Tensor} - The interpolated tensor.\r\n */\r\nfunction interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) {\r\n\r\n // Input image dimensions\r\n const in_channels = input.dims.at(-3) ?? 1;\r\n const in_height = input.dims.at(-2);\r\n const in_width = input.dims.at(-1);\r\n\r\n let output = interpolate_data(\r\n input.data,\r\n [in_channels, in_height, in_width],\r\n [out_height, out_width],\r\n mode,\r\n align_corners\r\n );\r\n return new Tensor(input.type, output, [in_channels, out_height, out_width]);\r\n}\r\n\r\nmodule.exports = {\r\n Tensor,\r\n transpose,\r\n cat,\r\n interpolate,\r\n transpose_data,\r\n}\r\n","const {\r\n Callable,\r\n fetchJSON,\r\n reverseDictionary,\r\n escapeRegExp,\r\n isIntegralNumber,\r\n min,\r\n} = require('./utils.js');\r\n\r\nconst { Tensor } = require('./tensor_utils.js')\r\n\r\n/**\r\n * Abstract base class for tokenizer models.\r\n *\r\n * @extends Callable\r\n */\r\nclass TokenizerModel extends Callable {\r\n /**\r\n * Creates a new instance of TokenizerModel.\r\n * @param {object} config - The configuration object for the TokenizerModel.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n /**\r\n * Instantiates a new TokenizerModel instance based on the configuration object provided.\r\n * @param {object} config - The configuration object for the TokenizerModel.\r\n * @param {...*} args - Optional arguments to pass to the specific TokenizerModel constructor.\r\n * @returns {TokenizerModel} A new instance of a TokenizerModel.\r\n * @throws Will throw an error if the TokenizerModel type in the config is not recognized.\r\n */\r\n static fromConfig(config, ...args) {\r\n switch (config.type) {\r\n case 'WordPiece':\r\n return new WordPieceTokenizer(config);\r\n case 'Unigram':\r\n // TODO: fix error below\r\n return new Unigram(config, ...args);\r\n\r\n case 'BPE':\r\n // TODO: fix error below\r\n return new BPE(config, ...args);\r\n default:\r\n throw new Error(`Unknown TokenizerModel type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Internal function to call the TokenizerModel instance.\r\n * @param {string[]} tokens - The tokens to encode.\r\n * @returns {number[]} The encoded token IDs.\r\n */\r\n _call(tokens) {\r\n return this.encode(tokens);\r\n }\r\n\r\n /**\r\n * Encodes a list of tokens into a list of token IDs.\r\n * @param {string[]} tokens - The tokens to encode.\r\n * @returns {number[]} The encoded token IDs.\r\n * @throws Will throw an error if not implemented in a subclass.\r\n */\r\n encode(tokens) {\r\n throw Error(\"encode should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Converts a list of tokens into a list of token IDs.\r\n * @param {string[]} tokens - The tokens to convert.\r\n * @returns {number[]} The converted token IDs.\r\n */\r\n convert_tokens_to_ids(tokens) {\r\n return tokens.map(t => this.tokens_to_ids[t] ?? this.unk_token_id);\r\n }\r\n\r\n /**\r\n * Converts a list of token IDs into a list of tokens.\r\n * @param {number[]} ids - The token IDs to convert.\r\n * @returns {string[]} The converted tokens.\r\n */\r\n convert_ids_to_tokens(ids) {\r\n return ids.map(i => this.vocab[i] ?? this.unk_token);\r\n }\r\n}\r\n\r\n/**\r\n * A subclass of TokenizerModel that uses WordPiece encoding to encode tokens.\r\n * @extends TokenizerModel\r\n */\r\nclass WordPieceTokenizer extends TokenizerModel {\r\n /**\r\n * @param {Object} config - The configuration object.\r\n * @param {Object.} config.vocab - A mapping of tokens to ids.\r\n * @param {string} config.unk_token - The unknown token string.\r\n * @param {string} config.continuing_subword_prefix - The prefix to use for continuing subwords.\r\n */\r\n constructor(config) {\r\n super(config);\r\n /**\r\n * A mapping of tokens to ids.\r\n * @type {Object.}\r\n */\r\n this.tokens_to_ids = config.vocab;\r\n\r\n /**\r\n * The id of the unknown token.\r\n * @type {number}\r\n */\r\n this.unk_token_id = this.tokens_to_ids[config.unk_token];\r\n\r\n /**\r\n * The unknown token string.\r\n * @type {string}\r\n */\r\n this.unk_token = config.unk_token;\r\n\r\n let e = Object.entries(this.tokens_to_ids);\r\n\r\n /**\r\n * An array of tokens.\r\n * @type {string[]}\r\n */\r\n this.vocab = Array(e.length);\r\n\r\n for (const [key, value] of e) {\r\n this.vocab[value] = key;\r\n }\r\n }\r\n\r\n /**\r\n * Encodes an array of tokens using WordPiece encoding.\r\n * @param {Array} tokens - The tokens to encode.\r\n * @returns {Array} An array of encoded tokens.\r\n */\r\n encode(tokens) {\r\n let outputTokens = [];\r\n for (let token of tokens) {\r\n let chars = [...token];\r\n // TODO add\r\n // if len(chars) > self.max_input_chars_per_word:\r\n // output_tokens.append(self.unk_token)\r\n // continue\r\n\r\n let isUnknown = false;\r\n let start = 0;\r\n let subTokens = [];\r\n\r\n while (start < chars.length) {\r\n let end = chars.length;\r\n let currentSubstring = null;\r\n while (start < end) {\r\n let substr = chars.slice(start, end).join('');\r\n\r\n if (start > 0) {\r\n substr = this.config.continuing_subword_prefix + substr;\r\n }\r\n if (this.vocab.includes(substr)) {\r\n currentSubstring = substr;\r\n break;\r\n }\r\n\r\n --end;\r\n }\r\n if (currentSubstring == null) {\r\n isUnknown = true;\r\n break;\r\n }\r\n subTokens.push(currentSubstring);\r\n start = end;\r\n }\r\n if (isUnknown) {\r\n outputTokens.push(this.unk_token);\r\n } else {\r\n outputTokens.push(...subTokens);\r\n }\r\n }\r\n\r\n return outputTokens;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Class representing a Unigram tokenizer model.\r\n * @extends TokenizerModel\r\n */\r\nclass Unigram extends TokenizerModel {\r\n /**\r\n * Create a new Unigram tokenizer model.\r\n * @param {object} config - The configuration object for the Unigram model.\r\n * @param {object} moreConfig - Additional configuration object for the Unigram model.\r\n */\r\n constructor(config, moreConfig) {\r\n super(config);\r\n\r\n this.vocab = config.vocab.map(x => x[0]);\r\n this.scores = config.vocab.map(x => x[1]);\r\n\r\n this.unk_token_id = config.unk_id;\r\n this.unk_token = this.vocab[config.unk_id];\r\n\r\n this.tokens_to_ids = Object.fromEntries(this.vocab.map((x, i) => [x, i]));\r\n this.bosToken = ' '; // beginning of a sentence token\r\n\r\n this.bosTokenId = this.tokens_to_ids[this.bosToken];\r\n this.eosToken = moreConfig.eos_token;\r\n\r\n this.eosTokenId = this.tokens_to_ids[this.eosToken];\r\n this.unkToken = this.vocab[this.unk_token_id];\r\n\r\n this.minScore = min(this.scores);\r\n\r\n this.unkScore = this.minScore - 10.0;\r\n this.scores[this.unk_token_id] = this.unkScore;\r\n\r\n this.trie = new CharTrie();\r\n this.trie.extend(this.vocab)\r\n }\r\n\r\n /**\r\n * Populates lattice nodes.\r\n * @param {TokenLattice} lattice - The token lattice to populate with nodes.\r\n */\r\n populateNodes(lattice) {\r\n const sentence = lattice.sentence;\r\n const len = sentence.length;\r\n let beginPos = 0;\r\n while (beginPos < len) {\r\n const mblen = 1;\r\n let hasSingleNode = false;\r\n const tokens = [];\r\n // TODO: fix error below\r\n for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) {\r\n tokens.push(token);\r\n const tokenId = this.tokens_to_ids[token];\r\n const tokenScore = this.scores[tokenId];\r\n const n = token.length;\r\n lattice.insert(beginPos, n, tokenScore, tokenId);\r\n if (!hasSingleNode && n == mblen) {\r\n hasSingleNode = true;\r\n }\r\n }\r\n if (!hasSingleNode) {\r\n lattice.insert(beginPos, mblen, this.unkScore, this.unk_token_id);\r\n }\r\n beginPos += mblen;\r\n }\r\n }\r\n\r\n /**\r\n * Encodes an array of tokens into an array of subtokens using the unigram model.\r\n *\r\n * @param {string} normalized - The normalized string.\r\n * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model.\r\n */\r\n tokenize(normalized) {\r\n const lattice = new TokenLattice(normalized, this.bosTokenId, this.eosTokenId);\r\n this.populateNodes(lattice);\r\n return lattice.tokens();\r\n }\r\n\r\n /**\r\n * Encodes an array of tokens using WordPiece encoding.\r\n * @param {Array} tokens - The tokens to encode.\r\n * @returns {Array} An array of encoded tokens.\r\n */\r\n encode(tokens) {\r\n let toReturn = [];\r\n for (let token of tokens) {\r\n const tokenized = this.tokenize(token);\r\n toReturn.push(...tokenized);\r\n }\r\n return toReturn;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Returns list of utf-8 byte and a mapping to unicode strings.\r\n * Specifically avoids mapping to whitespace/control characters the BPE code barfs on.\r\n * @returns {Object} Object with utf-8 byte keys and unicode string values.\r\n */\r\nconst BYTES_TO_UNICODE = (() => {\r\n // Returns list of utf-8 byte and a mapping to unicode strings.\r\n // We specifically avoids mapping to whitespace/control characters\r\n // the bpe code barfs on.\r\n\r\n const bs = [\r\n ...Array.from({ length: \"~\".charCodeAt(0) - \"!\".charCodeAt(0) + 1 }, (_, i) => i + \"!\".charCodeAt(0)),\r\n ...Array.from({ length: \"¬\".charCodeAt(0) - \"¡\".charCodeAt(0) + 1 }, (_, i) => i + \"¡\".charCodeAt(0)),\r\n ...Array.from({ length: \"ÿ\".charCodeAt(0) - \"®\".charCodeAt(0) + 1 }, (_, i) => i + \"®\".charCodeAt(0)),\r\n ];\r\n let cs = bs.slice();\r\n let n = 0;\r\n for (let b = 0; b < 256; b++) {\r\n if (!bs.includes(b)) {\r\n bs.push(b);\r\n cs.push(256 + n);\r\n n += 1;\r\n }\r\n }\r\n let ccs = cs.map(n => String.fromCharCode(n));\r\n return Object.fromEntries(bs.map((b, i) => [b, ccs[i]]));\r\n})();\r\n\r\nconst UNICODE_TO_BYTES = reverseDictionary(BYTES_TO_UNICODE);\r\n\r\n/**\r\n * BPE class for encoding text into Byte-Pair-Encoding (BPE) tokens.\r\n * @extends TokenizerModel\r\n */\r\nclass BPE extends TokenizerModel {\r\n /**\r\n * Create a BPE instance.\r\n * @param {Object} config - The configuration object for BPE.\r\n * @param {Object} config.vocab - A dictionary containing the vocabulary with tokens as keys and their corresponding indices as values.\r\n * @param {string} config.unk_token - The unknown token used for out of vocabulary words.\r\n * @param {Array} config.merges - An array of BPE merges as strings.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.tokens_to_ids = config.vocab;\r\n\r\n this.unk_token_id = this.tokens_to_ids[config.unk_token];\r\n this.unk_token = config.unk_token;\r\n\r\n let e = Object.entries(this.tokens_to_ids);\r\n this.vocab = Array(e.length);\r\n\r\n for (const [key, value] of e) {\r\n this.vocab[value] = key;\r\n }\r\n\r\n this.bpe_ranks = Object.fromEntries(config.merges.map((x, i) => [x, i]));\r\n this.merges = config.merges.map(x => x.split(/\\s+/))\r\n\r\n this.end_of_word_suffix = config.end_of_word_suffix;\r\n\r\n this.byte_encoder = BYTES_TO_UNICODE;\r\n this.text_encoder = new TextEncoder();\r\n\r\n this.cache = {}\r\n }\r\n\r\n /**\r\n * Get all the possible pairs of characters in a word.\r\n * @param {string[]} word - The word to get pairs from.\r\n * @returns {Array} - An array of pairs.\r\n */\r\n get_pairs(word) {\r\n let pairs = new Set();\r\n let prev_char = word[0];\r\n for (let i = 1; i < word.length; i++) {\r\n let char = word[i];\r\n pairs.add(`${prev_char} ${char}`);\r\n prev_char = char;\r\n }\r\n // TODO: fix error below\r\n return [...pairs];\r\n }\r\n\r\n /**\r\n * Apply Byte-Pair-Encoding (BPE) to a given token.\r\n * @param {string} token - The token to encode.\r\n * @returns {string} - The BPE encoded token.\r\n */\r\n bpe(token) {\r\n if (token in this.cache) {\r\n return this.cache[token];\r\n }\r\n let word = Array.from(token);\r\n if (this.end_of_word_suffix) {\r\n word[word.length - 1] += this.end_of_word_suffix;\r\n }\r\n let pairs = this.get_pairs(word);\r\n\r\n if (!pairs.length) {\r\n if (this.end_of_word_suffix) {\r\n token += this.end_of_word_suffix;\r\n }\r\n return token;\r\n }\r\n\r\n while (true) {\r\n let bigram = pairs.reduce((a, b) => {\r\n let c = this.bpe_ranks[a] ?? Infinity\r\n let d = this.bpe_ranks[b] ?? Infinity\r\n return c <= d ? a : b;\r\n });\r\n if (!(bigram in this.bpe_ranks)) {\r\n break;\r\n }\r\n let [first, second] = bigram.split(/\\s+/g)\r\n let new_word = [];\r\n let i = 0;\r\n let j = -1;\r\n\r\n while (i < word.length) {\r\n try {\r\n j = word.indexOf(first, i);\r\n if (j === -1) throw \"Error\";\r\n } catch (e) {\r\n new_word.push(...word.slice(i));\r\n break;\r\n }\r\n new_word.push(...word.slice(i, j));\r\n i = j;\r\n\r\n if (word[i] === first && i < word.length - 1 && word[i + 1] === second) {\r\n new_word.push(first + second);\r\n i += 2;\r\n } else {\r\n new_word.push(word[i]);\r\n i += 1;\r\n }\r\n }\r\n word = new_word\r\n if (word.length === 1) {\r\n break;\r\n } else {\r\n pairs = this.get_pairs(word);\r\n }\r\n }\r\n let final_word = word.join(\" \");\r\n this.cache[token] = final_word;\r\n return final_word;\r\n }\r\n\r\n /**\r\n * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens.\r\n * @param {Array} tokens - The input sequence of tokens to encode.\r\n * @returns {Array} - The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens.\r\n */\r\n encode(tokens) {\r\n let outputTokens = [];\r\n\r\n for (let token of tokens) {\r\n token = Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join('');\r\n let bpe_token_list = this.bpe(token).split(' ');\r\n outputTokens.push(...bpe_token_list);\r\n }\r\n\r\n return outputTokens;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * A base class for text normalization.\r\n * @abstract\r\n */\r\nclass Normalizer extends Callable {\r\n /**\r\n * @param {object} config - The configuration object for the normalizer.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Factory method for creating normalizers from config objects.\r\n * @static\r\n * @param {object} config - The configuration object for the normalizer.\r\n * @returns {Normalizer} - A Normalizer object.\r\n * @throws {Error} - If an unknown Normalizer type is specified in the config.\r\n */\r\n static fromConfig(config) {\r\n if (config === null) return null;\r\n switch (config.type) {\r\n case 'BertNormalizer':\r\n return new BertNormalizer(config);\r\n case 'Precompiled':\r\n return new Precompiled(config);\r\n case 'Sequence':\r\n return new NormalizerSequence(config);\r\n case 'Replace':\r\n return new Replace(config);\r\n case 'NFC':\r\n return new NFC(config);\r\n case 'NFKD':\r\n return new NFKD(config);\r\n case 'StripAccents':\r\n return new StripAccents(config);\r\n case 'Lowercase':\r\n return new Lowercase(config);\r\n default:\r\n throw new Error(`Unknown Normalizer type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Normalize the input text.\r\n * @abstract\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n * @throws {Error} - If this method is not implemented in a subclass.\r\n */\r\n normalize(text) {\r\n throw Error(\"normalize should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Alias for {@link Normalizer#normalize}.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n */\r\n _call(text) {\r\n return this.normalize(text);\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Replace normalizer that replaces occurrences of a pattern with a given string or regular expression.\r\n * @extends Normalizer\r\n */\r\nclass Replace extends Normalizer {\r\n /**\r\n * Normalize the input text by replacing the pattern with the content.\r\n * @param {string} text - The input text to be normalized.\r\n * @returns {string} The normalized text after replacing the pattern with the content.\r\n */\r\n normalize(text) {\r\n if (this.config.pattern.Regex) {\r\n text = text.replace(new RegExp(this.config.pattern.Regex, 'g'), this.config.content)\r\n\r\n } else if (this.config.pattern.String) {\r\n text = text.replace(this.config.pattern.String, this.config.content)\r\n\r\n } else {\r\n console.warn('Unknown pattern type:', this.config.pattern)\r\n }\r\n\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A normalizer that applies Unicode normalization form C (NFC) to the input text.\r\n * @extends Normalizer\r\n */\r\nclass NFC extends Normalizer {\r\n /**\r\n * Normalize the input text by applying Unicode normalization form C (NFC).\r\n * @param {string} text - The input text to be normalized.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n text = text.normalize('NFC')\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * NFKD Normalizer.\r\n * @extends Normalizer\r\n */\r\nclass NFKD extends Normalizer {\r\n /**\r\n * Normalize text using NFKD normalization.\r\n * @param {string} text - The text to be normalized.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n text = text.normalize('NFKD')\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * StripAccents normalizer removes all accents from the text.\r\n * @extends Normalizer\r\n */\r\nclass StripAccents extends Normalizer {\r\n /**\r\n * Remove all accents from the text.\r\n * @param {string} text - The input text.\r\n * @returns {string} The normalized text without accents.\r\n */\r\n normalize(text) {\r\n text = text.replace(/[\\u0300-\\u036f]/g, '');\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A Normalizer that lowercases the input string.\r\n * @extends Normalizer\r\n */\r\nclass Lowercase extends Normalizer {\r\n /**\r\n * Lowercases the input string.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n text = text.toLowerCase();\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A Normalizer that applies a sequence of Normalizers.\r\n * @extends Normalizer\r\n */\r\nclass NormalizerSequence extends Normalizer {\r\n /**\r\n * Create a new instance of NormalizerSequence.\r\n * @param {object} config - The configuration object.\r\n * @param {object[]} config.normalizers - An array of Normalizer configuration objects.\r\n */\r\n constructor(config) {\r\n super(config);\r\n this.normalizers = config.normalizers.map(x => Normalizer.fromConfig(x));\r\n }\r\n /**\r\n * Apply a sequence of Normalizers to the input text.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} The normalized text.\r\n */\r\n normalize(text) {\r\n // TODO use reduce?\r\n for (let normalizer of this.normalizers) {\r\n text = normalizer.normalize(text);\r\n }\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A class representing a normalizer used in BERT tokenization.\r\n * @extends Normalizer\r\n */\r\nclass BertNormalizer extends Normalizer {\r\n /**\r\n * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text.\r\n *\r\n * @param {string} text - The input text to tokenize.\r\n * @returns {string} - The tokenized text with whitespace added around CJK characters.\r\n */\r\n _tokenize_chinese_chars(text) {\r\n /* Adds whitespace around any CJK character. */\r\n let output = [];\r\n for (let i = 0; i < text.length; ++i) {\r\n let char = text[i];\r\n let cp = char.charCodeAt(0);\r\n if (this._is_chinese_char(cp)) {\r\n output.push(\" \");\r\n output.push(char);\r\n output.push(\" \");\r\n } else {\r\n output.push(char);\r\n }\r\n }\r\n return output.join(\"\");\r\n }\r\n\r\n /**\r\n * Checks whether the given Unicode codepoint represents a CJK (Chinese, Japanese, or Korean) character.\r\n *\r\n * A \"chinese character\" is defined as anything in the CJK Unicode block:\r\n * https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)\r\n *\r\n * Note that the CJK Unicode block is NOT all Japanese and Korean characters, despite its name.\r\n * The modern Korean Hangul alphabet is a different block, as is Japanese Hiragana and Katakana.\r\n * Those alphabets are used to write space-separated words, so they are not treated specially\r\n * and are handled like all other languages.\r\n *\r\n * @param {number} cp - The Unicode codepoint to check.\r\n * @returns {boolean} - True if the codepoint represents a CJK character, false otherwise.\r\n */\r\n _is_chinese_char(cp) {\r\n return (\r\n (cp >= 0x4E00 && cp <= 0x9FFF)\r\n || (cp >= 0x3400 && cp <= 0x4DBF)\r\n || (cp >= 0x20000 && cp <= 0x2A6DF)\r\n || (cp >= 0x2A700 && cp <= 0x2B73F)\r\n || (cp >= 0x2B740 && cp <= 0x2B81F)\r\n || (cp >= 0x2B820 && cp <= 0x2CEAF)\r\n || (cp >= 0xF900 && cp <= 0xFAFF)\r\n || (cp >= 0x2F800 && cp <= 0x2FA1F)\r\n )\r\n }\r\n /**\r\n * Strips accents from the given text.\r\n * @param {string} text - The text to strip accents from.\r\n * @returns {string} - The text with accents removed.\r\n */\r\n stripAccents(text) {\r\n return text.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\r\n }\r\n\r\n /**\r\n * Normalizes the given text based on the configuration.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n */\r\n normalize(text) {\r\n // TODO use rest of config\r\n // config.clean_text,\r\n // config.handle_chinese_chars,\r\n // config.strip_accents,\r\n // config.lowercase,\r\n\r\n if (this.config.handle_chinese_chars) {\r\n text = this._tokenize_chinese_chars(text);\r\n }\r\n\r\n if (this.config.lowercase) {\r\n text = text.toLowerCase();\r\n\r\n if (this.config.strip_accents !== false) {\r\n text = this.stripAccents(text);\r\n }\r\n } else if (this.config.strip_accents) {\r\n text = this.stripAccents(text);\r\n }\r\n\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A callable class representing a pre-tokenizer used in tokenization. Subclasses\r\n * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic.\r\n * @extends Callable\r\n */\r\nclass PreTokenizer extends Callable {\r\n /**\r\n * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration.\r\n *\r\n * @static\r\n * @param {Object} config - A configuration object for the pre-tokenizer.\r\n * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`.\r\n * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer.\r\n */\r\n static fromConfig(config) {\r\n switch (config.type) {\r\n case 'BertPreTokenizer':\r\n return new BertPreTokenizer(config);\r\n case 'Sequence':\r\n return new PreTokenizerSequence(config);\r\n case 'WhitespaceSplit':\r\n return new WhitespaceSplit(config);\r\n case 'Metaspace':\r\n return new MetaspacePreTokenizer(config);\r\n\r\n case 'ByteLevel':\r\n return new ByteLevelPreTokenizer(config);\r\n case 'Split':\r\n return new SplitPreTokenizer(config);\r\n\r\n default:\r\n throw new Error(`Unknown PreTokenizer type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Method that should be implemented by subclasses to define the specific pre-tokenization logic.\r\n *\r\n * @abstract\r\n * @param {string} text - The text to pre-tokenize.\r\n * @returns {string[]} The pre-tokenized text.\r\n * @throws {Error} If the method is not implemented in the subclass.\r\n */\r\n pre_tokenize_text(text) {\r\n throw Error(\"pre_tokenize_text should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Tokenizes the given text into pre-tokens.\r\n * @param {string|string[]} text - The text or array of texts to pre-tokenize.\r\n * @returns {string[]} An array of pre-tokens.\r\n */\r\n pre_tokenize(text) {\r\n let result = [];\r\n if (Array.isArray(text)) {\r\n result = text.map(x => this.pre_tokenize_text(x))\r\n } else {\r\n result = this.pre_tokenize_text(text);\r\n }\r\n return result.flat();\r\n }\r\n\r\n /**\r\n * Alias for {@link PreTokenizer#pre_tokenize}.\r\n * @param {string|string[]} text - The text or array of texts to pre-tokenize.\r\n * @returns {string[]} An array of pre-tokens.\r\n */\r\n _call(text) {\r\n return this.pre_tokenize(text);\r\n }\r\n}\r\n\r\n/**\r\n * @extends PreTokenizer\r\n */\r\nclass BertPreTokenizer extends PreTokenizer {\r\n /**\r\n * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme\r\n * similar to that used in the original implementation of BERT.\r\n * \r\n * @param {object} config - The configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n // TODO use config\r\n this.pattern = /\\b\\p{L}+\\b|[^\\s\\p{L}]+/gu\r\n }\r\n /**\r\n * Tokenizes a single text using the BERT pre-tokenization scheme.\r\n * \r\n * @param {string} text - The text to tokenize.\r\n * @returns {Array.} - An array of tokens.\r\n */\r\n pre_tokenize_text(text) {\r\n // Split on whitespace and punctuation\r\n return text.trim().match(this.pattern) || [];\r\n }\r\n}\r\n\r\n/**\r\n * A pre-tokenizer that splits text into Byte-Pair-Encoding (BPE) subwords.\r\n * @extends PreTokenizer\r\n */\r\nclass ByteLevelPreTokenizer extends PreTokenizer {\r\n /**\r\n * Creates a new instance of the `ByteLevelPreTokenizer` class.\r\n * @param {Object} config - The configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n // TODO use config\r\n this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+/gu;\r\n }\r\n\r\n /**\r\n * Tokenizes a single piece of text using byte-level tokenization.\r\n * @param {string} text - The text to tokenize.\r\n * @returns {string[]} - An array of tokens.\r\n */\r\n pre_tokenize_text(text) {\r\n // Split on whitespace and punctuation\r\n return text.match(this.pattern) || [];\r\n }\r\n}\r\n\r\n/**\r\n * Splits text using a given pattern.\r\n * @extends PreTokenizer\r\n */\r\nclass SplitPreTokenizer extends PreTokenizer {\r\n /**\r\n * @param {Object} config - The configuration options for the pre-tokenizer.\r\n * @param {Object} config.pattern - The pattern used to split the text. Can be a string or a regex object.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Tokenizes text by splitting it using the given pattern.\r\n * @param {string} text - The text to tokenize.\r\n * @returns {string[]} An array of tokens.\r\n */\r\n pre_tokenize_text(text) {\r\n if (this.config.pattern.Regex) {\r\n return text.match(new RegExp(this.config.pattern.Regex, 'gu')) || [];\r\n\r\n } else if (this.config.pattern.String) {\r\n return text.match(this.config.pattern.String) || [];\r\n\r\n } else {\r\n console.warn('Unknown pattern type:', this.config.pattern)\r\n }\r\n\r\n return [];\r\n }\r\n\r\n}\r\n\r\n/**\r\n * @extends Callable\r\n */\r\nclass PostProcessor extends Callable {\r\n\r\n /**\r\n * Factory method to create a PostProcessor object from a configuration object.\r\n *\r\n * @param {Object} config - Configuration object representing a PostProcessor.\r\n * @returns {PostProcessor} A PostProcessor object created from the given configuration.\r\n * @throws {Error} If an unknown PostProcessor type is encountered.\r\n */\r\n static fromConfig(config) {\r\n switch (config.type) {\r\n case 'TemplateProcessing':\r\n return new TemplateProcessing(config);\r\n\r\n case 'ByteLevel':\r\n return new ByteLevelPostProcessor(config);\r\n\r\n case 'RobertaProcessing':\r\n return new RobertaProcessing(config);\r\n\r\n default:\r\n throw new Error(`Unknown PostProcessor type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Method to be implemented in subclass to apply post-processing on the given tokens.\r\n *\r\n * @param {Array} tokens - The input tokens to be post-processed.\r\n * @param {...*} args - Additional arguments required by the post-processing logic.\r\n * @returns {Array} The post-processed tokens.\r\n * @throws {Error} If the method is not implemented in subclass.\r\n */\r\n post_process(tokens, ...args) {\r\n throw Error(\"post_process should be implemented in subclass.\")\r\n }\r\n\r\n /**\r\n * Alias for {@link PostProcessor#post_process}.\r\n * @param {Array} tokens - The text or array of texts to post-process.\r\n * @param {...*} args - Additional arguments required by the post-processing logic.\r\n * @returns {Array} An array of post-processed tokens.\r\n */\r\n _call(tokens, ...args) {\r\n return this.post_process(tokens, ...args);\r\n }\r\n}\r\n\r\n/**\r\n * A post-processor that adds special tokens to the beginning and end of the input.\r\n * @extends PostProcessor\r\n */\r\nclass RobertaProcessing extends PostProcessor {\r\n /**\r\n * @param {Object} config - The configuration for the post-processor.\r\n * @param {string[]} config.cls - The special tokens to add to the beginning of the input.\r\n * @param {string[]} config.sep - The special tokens to add to the end of the input.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n\r\n // TODO use all of config:\r\n // add_prefix_space, cls, sep, trim_offsets\r\n\r\n }\r\n\r\n /**\r\n * Adds the special tokens to the beginning and end of the input.\r\n * @param {string[]} tokens - The input tokens.\r\n * @param {string[]|null} tokens_pair - An optional second set of input tokens.\r\n * @returns {string[]} The input tokens with the special tokens added to the beginning and end.\r\n */\r\n post_process(tokens, tokens_pair = null) {\r\n tokens = [this.config.cls[0], ...tokens, this.config.sep[0]]\r\n\r\n // NOTE: It is intended to add 2 EOS tokens after the first set of tokens\r\n // https://github.com/huggingface/tokenizers/issues/983\r\n if (tokens_pair !== null) {\r\n tokens = [...tokens, this.config.sep[0], ...tokens_pair, this.config.sep[0]]\r\n }\r\n return tokens;\r\n }\r\n}\r\n\r\n/**\r\n * Post processor that replaces special tokens in a template with actual tokens.\r\n * @extends PostProcessor\r\n */\r\nclass TemplateProcessing extends PostProcessor {\r\n /**\r\n * Creates a new instance of `TemplateProcessing`.\r\n * @param {Object} config - The configuration options for the post processor.\r\n * @param {Array} config.single - The template for a single sequence of tokens.\r\n * @param {Array} config.pair - The template for a pair of sequences of tokens.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Replaces special tokens in the template with actual tokens.\r\n * @param {Array} tokens - The list of tokens for the first sequence.\r\n * @param {Array} [tokens_pair=null] - The list of tokens for the second sequence (optional).\r\n * @returns {Array} - The list of tokens with the special tokens replaced with actual tokens.\r\n */\r\n post_process(tokens, tokens_pair = null) {\r\n let type = tokens_pair === null ? this.config.single : this.config.pair\r\n\r\n let toReturn = [];\r\n for (let item of type) {\r\n if ('SpecialToken' in item) {\r\n toReturn.push(item.SpecialToken.id);\r\n\r\n } else if ('Sequence' in item) {\r\n if (item.Sequence.id === 'A') {\r\n toReturn.push(...tokens);\r\n\r\n } else if (item.Sequence.id === 'B') {\r\n toReturn.push(...tokens_pair);\r\n }\r\n }\r\n }\r\n return toReturn;\r\n }\r\n}\r\n\r\n/**\r\n * A PostProcessor that returns the given tokens as is.\r\n * @extends PostProcessor\r\n */\r\nclass ByteLevelPostProcessor extends PostProcessor {\r\n /**\r\n * Create a new instance of ByteLevelPostProcessor.\r\n * @param {object} config - Configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Post process the given tokens.\r\n * @param {string[]} tokens - The tokens to be post processed.\r\n * @returns {string[]} The post processed tokens.\r\n */\r\n post_process(tokens) {\r\n return tokens;\r\n }\r\n}\r\n\r\n/**\r\n * The base class for token decoders.\r\n * @extends Callable\r\n */\r\nclass Decoder extends Callable {\r\n\r\n /**\r\n * Creates an instance of `Decoder`.\r\n *\r\n * @param {Object} config - The configuration object.\r\n */\r\n constructor(config) {\r\n super();\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Creates a decoder instance based on the provided configuration.\r\n *\r\n * @param {Object} config - The configuration object.\r\n * @returns {Decoder} A decoder instance.\r\n * @throws {Error} If an unknown decoder type is provided.\r\n */\r\n static fromConfig(config) {\r\n switch (config.type) {\r\n case 'WordPiece':\r\n return new WordPieceDecoder(config);\r\n case 'Metaspace':\r\n return new MetaspaceDecoder(config);\r\n case 'ByteLevel':\r\n return new ByteLevelDecoder(config);\r\n default:\r\n throw new Error(`Unknown Decoder type: ${config.type}`);\r\n }\r\n }\r\n\r\n /**\r\n * Converts a list of tokens to a string.\r\n *\r\n * @param {string[]} tokens - The list of tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n convert_tokens_to_string(tokens) {\r\n return tokens.join('').trim();\r\n }\r\n\r\n /**\r\n * Calls the `decode` method.\r\n *\r\n * @param {string[]} tokens - The list of tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n _call(tokens) {\r\n return this.decode(tokens);\r\n }\r\n\r\n /**\r\n * Decodes a list of tokens.\r\n * @param {string[]} tokens - The list of tokens.\r\n * @returns {string} The decoded string.\r\n * @throws {Error} If the `decode` method is not implemented in the subclass.\r\n */\r\n decode(tokens) {\r\n throw Error(\"decode should be implemented in subclass.\")\r\n }\r\n\r\n\r\n}\r\n\r\n/**\r\n * A decoder that decodes a list of WordPiece tokens into a single string.\r\n * @extends Decoder\r\n */\r\nclass WordPieceDecoder extends Decoder {\r\n\r\n /**\r\n * Creates a new instance of WordPieceDecoder.\r\n * @param {Object} config - The configuration object.\r\n * @param {string} config.prefix - The prefix used for WordPiece encoding.\r\n * @param {boolean} config.cleanup - Whether to cleanup the decoded string.\r\n */\r\n constructor(config) {\r\n super(config);\r\n this.convertRegex = new RegExp(` ${config.prefix}`, 'g');\r\n this.cleanup = config.cleanup;\r\n }\r\n\r\n /**\r\n * Converts a list of WordPiece tokens to a single string.\r\n * @param {Array} tokens - The list of WordPiece tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n convert_tokens_to_string(tokens) {\r\n return tokens.join(' ').replace(this.convertRegex, '').trim();\r\n }\r\n\r\n /**\r\n * Decodes a list of WordPiece tokens into a single string.\r\n * @param {Array} tokens - The list of WordPiece tokens.\r\n * @returns {string} The decoded string.\r\n */\r\n decode(tokens) {\r\n return this.convert_tokens_to_string(tokens);\r\n }\r\n}\r\n\r\n/**\r\n * Byte-level decoder for tokenization output. Inherits from the `Decoder` class.\r\n * @extends Decoder\r\n */\r\nclass ByteLevelDecoder extends Decoder {\r\n\r\n /**\r\n * Create a `ByteLevelDecoder` object.\r\n * @param {object} config - Configuration object.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.byte_decoder = UNICODE_TO_BYTES;\r\n this.text_decoder = new TextDecoder(\"utf-8\", {\r\n fatal: false,\r\n ignoreBOM: true,\r\n });\r\n\r\n this.end_of_word_suffix = null;\r\n }\r\n\r\n /**\r\n * Convert an array of tokens to string by decoding each byte.\r\n * @param {string[]} tokens - Array of tokens to be decoded.\r\n * @returns {string} - The decoded string.\r\n */\r\n convert_tokens_to_string(tokens) {\r\n let text = tokens.join('');\r\n\r\n if (this.config.trim_offsets) {\r\n text = text.trim();\r\n } else if (this.config.add_prefix_space) {\r\n text = ' ' + text;\r\n }\r\n\r\n // @ts-ignore\r\n let byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c]));\r\n let decoded_text = this.text_decoder.decode(byteArray);\r\n\r\n if (this.end_of_word_suffix) {\r\n decoded_text = decoded_text.replaceAll(this.end_of_word_suffix, ' ').trim();\r\n }\r\n return decoded_text;\r\n }\r\n\r\n /**\r\n * Decode an array of tokens to string.\r\n * @param {string[]} tokens - Array of tokens to be decoded.\r\n * @returns {string} - The decoded string.\r\n */\r\n decode(tokens) {\r\n // TODO move to base class (like HF)\r\n // tokens === filtered_tokens\r\n\r\n // To avoid mixing byte-level and unicode for byte-level BPT\r\n // we need to build string separately for added tokens and byte-level tokens\r\n // cf. https://github.com/huggingface/transformers/issues/1133\r\n let sub_texts = [];\r\n let current_sub_text = [];\r\n for (let token of tokens) {\r\n // tokens sent here are already filtered, so we don't need to do this\r\n // if (skip_special_tokens && this.all_special_ids.includes(token)) {\r\n // continue;\r\n // }\r\n\r\n if (this.added_tokens.includes(token)) {\r\n if (current_sub_text.length > 0) {\r\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\r\n current_sub_text = [];\r\n }\r\n sub_texts.push(token);\r\n } else {\r\n current_sub_text.push(token);\r\n }\r\n }\r\n if (current_sub_text.length > 0) {\r\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\r\n }\r\n\r\n // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options\r\n let text = sub_texts.join('');\r\n\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested,\r\n * and returns a list of tokens.\r\n * @extends PreTokenizer\r\n */\r\nclass MetaspacePreTokenizer extends PreTokenizer {\r\n /**\r\n * @param {Object} config - The configuration object for the MetaspacePreTokenizer.\r\n * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the first token.\r\n * @param {string} config.replacement - The character to replace spaces with.\r\n * @param {string} [config.str_rep=config.replacement] - An optional string representation of the replacement character.\r\n */\r\n constructor(config) {\r\n super();\r\n\r\n this.addPrefixSpace = config.add_prefix_space;\r\n this.replacement = config.replacement;\r\n this.strRep = config.str_rep || this.replacement;\r\n }\r\n\r\n /**\r\n * This method takes a list of normalized tokens, replaces spaces with the replacement character,\r\n * adds a prefix space if requested, and returns a new list of tokens.\r\n * @param {string[]|string} normalizedTokens - The list of normalized tokens to pre-tokenize.\r\n * @returns {string[]} A new list of pre-tokenized tokens.\r\n */\r\n pre_tokenize(normalizedTokens) {\r\n if (typeof normalizedTokens === 'string' || normalizedTokens instanceof String) {\r\n // Metaspace acts on a list of tokens. If passing in a string, first split on whitespace\r\n normalizedTokens = normalizedTokens.split(/\\s+/);\r\n }\r\n\r\n const result = [];\r\n for (let token of normalizedTokens) {\r\n let normalized = token.replace(' ', this.strRep);\r\n if (this.addPrefixSpace && !normalized.startsWith(this.replacement)) {\r\n normalized = this.strRep + normalized;\r\n }\r\n result.push(normalized);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * MetaspaceDecoder class extends the Decoder class and decodes Metaspace tokenization.\r\n * @extends Decoder\r\n */\r\nclass MetaspaceDecoder extends Decoder {\r\n /**\r\n * Constructs a new MetaspaceDecoder object.\r\n * @param {Object} config - The configuration object for the MetaspaceDecoder.\r\n * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the decoded string.\r\n * @param {string} config.replacement - The string to replace spaces with.\r\n */\r\n constructor(config) {\r\n super(config);\r\n\r\n this.addPrefixSpace = config.add_prefix_space;\r\n this.replacement = config.replacement;\r\n }\r\n\r\n /**\r\n * Decodes the given tokens back into a string.\r\n * @param {Array} tokens - The tokens to decode.\r\n * @returns {string} - The decoded string.\r\n */\r\n decode(tokens) {\r\n let result = [];\r\n let i = 0;\r\n for (let token of tokens) {\r\n let normalized = token.replace(this.replacement, ' ');\r\n if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) {\r\n normalized = normalized.substring(1);\r\n }\r\n result.push(normalized);\r\n ++i;\r\n }\r\n\r\n return this.convert_tokens_to_string(result);\r\n }\r\n}\r\n\r\n/**\r\n * A normalizer that applies a precompiled charsmap.\r\n * This is useful for applying complex normalizations in C++ and exposing them to JavaScript.\r\n * @extends Normalizer\r\n * @param {Object} config - The configuration object for the Precompiled normalizer.\r\n * @param {Object} config.precompiled_charsmap - The precompiled charsmap object.\r\n */\r\nclass Precompiled extends Normalizer {\r\n /**\r\n * Create a new instance of Precompiled normalizer.\r\n * @param {object} config - The configuration object.\r\n * @param {any} config.precompiled_charsmap - Precompiled chars mapping.\r\n */\r\n constructor(config) {\r\n super(config);\r\n this.charsmap = config.precompiled_charsmap;\r\n }\r\n\r\n /**\r\n * Normalizes the given text by applying the precompiled charsmap.\r\n * @param {string} text - The text to normalize.\r\n * @returns {string} - The normalized text.\r\n */\r\n normalize(text) {\r\n // TODO use this.charsmap\r\n return text;\r\n }\r\n}\r\n\r\n/**\r\n * A pre-tokenizer that applies a sequence of pre-tokenizers to the input text.\r\n * @extends PreTokenizer\r\n */\r\nclass PreTokenizerSequence extends PreTokenizer {\r\n /**\r\n * Creates an instance of PreTokenizerSequence.\r\n * @param {object} config - The configuration object for the pre-tokenizer sequence.\r\n * @param {object[]} config.pretokenizers - An array of pre-tokenizer configurations.\r\n */\r\n constructor(config) {\r\n super();\r\n this.tokenizers = config.pretokenizers.map(x => PreTokenizer.fromConfig(x));\r\n }\r\n\r\n /**\r\n * Applies each pre-tokenizer in the sequence to the input text in turn.\r\n * @param {string|string[]} text - The text(s) to pre-tokenize.\r\n * @returns {string[]} The pre-tokenized text.\r\n */\r\n pre_tokenize_text(text) {\r\n if (typeof text === 'string') {\r\n text = [text];\r\n }\r\n // Use reduce to apply each tokenizer to the text\r\n return this.tokenizers.reduce((preTokenizedText, tokenizer) => {\r\n return tokenizer.pre_tokenize(preTokenizedText);\r\n }, text);\r\n }\r\n}\r\n\r\n/**\r\n * Splits a string of text by whitespace characters into individual tokens.\r\n * @extends PreTokenizer\r\n */\r\nclass WhitespaceSplit extends PreTokenizer {\r\n /**\r\n * Creates an instance of WhitespaceSplit.\r\n * @param {object} config - The configuration object for the pre-tokenizer sequence.\r\n */\r\n constructor(config) {\r\n super();\r\n }\r\n /**\r\n * Pre-tokenizes the input text by splitting it on whitespace characters.\r\n * @param {string} text - The text to be pre-tokenized.\r\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\r\n */\r\n pre_tokenize_text(text) {\r\n return text.split(/\\s+/);\r\n }\r\n}\r\n\r\nclass PreTrainedTokenizer extends Callable {\r\n /**\r\n * Create a new PreTrainedTokenizer instance.\r\n * @param {Object} tokenizerJSON - The JSON of the tokenizer.\r\n * @param {Object} tokenizerConfig - The config of the tokenizer.\r\n */\r\n constructor(tokenizerJSON, tokenizerConfig) {\r\n super();\r\n\r\n this.tokenizerJSON = tokenizerJSON;\r\n this.tokenizerConfig = tokenizerConfig;\r\n\r\n this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer);\r\n this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer);\r\n this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig);\r\n this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor);\r\n\r\n // TODO - maybe, allow this to be null; in which case, we use model as decoder too?\r\n this.decoder = Decoder.fromConfig(tokenizerJSON.decoder);\r\n\r\n // Slight hack, but it prevents code duplication:\r\n // Add added_tokens to this.decoder\r\n this.decoder.added_tokens = [];\r\n\r\n // Another slight hack to add `end_of_word_suffix` (if present) to the decoder\r\n // This is needed for cases where BPE model and ByteLevel decoder are used\r\n // For more information, see https://github.com/xenova/transformers.js/issues/74\r\n // TODO - save this to the decoder when exporting?\r\n this.decoder.end_of_word_suffix = this.model.end_of_word_suffix;\r\n\r\n // Add added_tokens to model\r\n this.special_tokens = [];\r\n this.all_special_ids = [];\r\n for (let addedToken of tokenizerJSON.added_tokens) {\r\n let id = addedToken.id;\r\n let content = addedToken.content;\r\n this.decoder.added_tokens.push(content);\r\n\r\n this.model.tokens_to_ids[content] = id;\r\n this.model.vocab[id] = content;\r\n\r\n if (addedToken.special) {\r\n this.special_tokens.push(content);\r\n this.all_special_ids.push(id);\r\n }\r\n }\r\n this.special_tokens_regex = new RegExp(\r\n '(' + this.special_tokens.map(escapeRegExp).join('|') + ')'\r\n );\r\n\r\n\r\n // Set mask token if present (otherwise will be undefined, which is fine)\r\n this.mask_token = this.getToken('mask_token');\r\n this.mask_token_id = this.model.tokens_to_ids[this.mask_token];\r\n\r\n this.pad_token = this.getToken('pad_token', 'eos_token');\r\n this.pad_token_id = this.model.tokens_to_ids[this.pad_token];\r\n\r\n this.sep_token = this.getToken('sep_token');\r\n this.sep_token_id = this.model.tokens_to_ids[this.sep_token];\r\n\r\n this.model_max_length = this.tokenizerConfig.model_max_length;\r\n\r\n this.remove_space = this.tokenizerConfig.remove_space;\r\n\r\n // TODO allow user to change this\r\n this.padding_side = 'right';\r\n }\r\n\r\n /**\r\n * Returns the value of the first matching key in the tokenizer config object.\r\n * @param {...string} keys - One or more keys to search for in the tokenizer config object.\r\n * @returns {string|null} - The value associated with the first matching key, or null if no match is found.\r\n * @throws {Error} - If an object is found for a matching key and its __type property is not \"AddedToken\".\r\n */\r\n getToken(...keys) {\r\n for (let key of keys) {\r\n let item = this.tokenizerConfig[key];\r\n\r\n if (!item) continue;\r\n\r\n if (typeof item === 'object') {\r\n if (item.__type === 'AddedToken') {\r\n return item.content;\r\n } else {\r\n throw Error(`Unknown token: ${item}`);\r\n }\r\n } else {\r\n return item;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates a new Tokenizer instance with the tokenizer configuration and files\r\n * downloaded from a pretrained model located at the given model path.\r\n *\r\n * @param {string} modelPath - The path to the pretrained model.\r\n * @param {function} [progressCallback=null] - Optional callback function that will be called with the current\r\n * progress percentage (0 to 100) each time a file is downloaded.\r\n * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the modelPath.\r\n */\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n // TODO get files in parallel\r\n\r\n let [tokenizerJSON, tokenizerConfig] = await Promise.all([\r\n fetchJSON(modelPath, 'tokenizer.json', progressCallback),\r\n fetchJSON(modelPath, 'tokenizer_config.json', progressCallback),\r\n ])\r\n\r\n return new this(tokenizerJSON, tokenizerConfig);\r\n }\r\n\r\n /**\r\n * This function can be overridden by a subclass to apply additional preprocessing\r\n * to a model's input data.\r\n * @param {Object} inputs - An object containing input data as properties.\r\n * @returns {Object} The modified inputs object.\r\n */\r\n prepare_model_inputs(inputs) {\r\n return inputs;\r\n }\r\n\r\n /**\r\n * Encode/tokenize the given text(s).\r\n * @param {string|string[]} text - The text to tokenize.\r\n * @param {object} options - An optional object containing the following properties:\r\n * @param {string|string[]} [options.text_pair=null] - Optional second sequence to be encoded. If set, must be the same type as text.\r\n * @param {boolean} [options.padding=false] - Whether to pad the input sequences.\r\n * @param {boolean} [options.truncation=null] - Whether to truncate the input sequences.\r\n * @param {number} [options.max_length=null] - Maximum length of the returned list and optionally padding length.\r\n * @param {boolean} [options.return_tensor=true] - Whether to return the results as Tensors or arrays.\r\n * @returns {{ input_ids: number[]|number[][]|Tensor; attention_mask: any[]|Tensor; }} Object to be passed to the model.\r\n */\r\n _call(\r\n // Required positional arguments\r\n text,\r\n\r\n // Optional keyword arguments\r\n {\r\n text_pair = null,\r\n // add_special_tokens = true, // TODO\r\n padding = false,\r\n truncation = null,\r\n max_length = null,\r\n return_tensor = true, // Different to HF\r\n } = {},\r\n ) {\r\n /** @type {number[]|number[][]|Tensor} */\r\n let tokens;\r\n\r\n if (Array.isArray(text)) {\r\n if (text.length === 0) {\r\n throw Error('text array must be non-empty')\r\n }\r\n\r\n if (text_pair !== null) {\r\n if (!Array.isArray(text_pair)) {\r\n throw Error('text_pair must also be an array')\r\n\r\n } else if (text.length !== text_pair.length) {\r\n throw Error('text and text_pair must have the same length')\r\n }\r\n\r\n tokens = text.map(\r\n (text, i) => this.encode(text, text_pair[i])\r\n )\r\n\r\n } else {\r\n tokens = text.map(x => this.encode(x));\r\n }\r\n\r\n } else {\r\n if (text === null) {\r\n throw Error('text may not be null')\r\n }\r\n\r\n if (Array.isArray(text_pair)) {\r\n throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).')\r\n }\r\n tokens = [this.encode(text, text_pair)];\r\n }\r\n // At this point, tokens is batched: [batch_size, tokens]\r\n // However, array may be jagged. So, we pad to max_length\r\n\r\n let maxLengthOfBatch = Math.max(...tokens.map(x => x.length));\r\n\r\n // If null, we calculate max length from sequences\r\n if (max_length === null) {\r\n max_length = maxLengthOfBatch;\r\n }\r\n\r\n // Ensure it is less than model max length\r\n max_length = Math.min(max_length, this.model_max_length)\r\n\r\n /** @type {any[]|Tensor} */\r\n let attention_mask = [];\r\n if (padding || truncation) {\r\n // Perform padding and/or truncation\r\n for (let i = 0; i < tokens.length; ++i) {\r\n if (tokens[i].length === max_length) {\r\n attention_mask.push(new Array(tokens[i].length).fill(1))\r\n continue;\r\n\r\n } else if (tokens[i].length > max_length) {\r\n // possibly truncate\r\n if (truncation) {\r\n tokens[i] = tokens[i].slice(0, max_length);\r\n }\r\n attention_mask.push(new Array(tokens[i].length).fill(1))\r\n\r\n } else { // t.length < max_length\r\n if (padding) {\r\n let diff = max_length - tokens[i].length;\r\n\r\n if (this.padding_side === 'right') {\r\n attention_mask.push(\r\n (new Array(tokens[i].length).fill(1)).concat(new Array(diff).fill(0))\r\n )\r\n tokens[i].push(...new Array(diff).fill(this.pad_token_id))\r\n } else { // left\r\n attention_mask.push(\r\n (new Array(diff).fill(0)).concat(new Array(tokens[i].length).fill(1))\r\n )\r\n tokens[i].unshift(...new Array(diff).fill(this.pad_token_id))\r\n }\r\n\r\n } else {\r\n attention_mask.push(new Array(tokens[i].length).fill(1))\r\n }\r\n }\r\n }\r\n } else {\r\n attention_mask = tokens.map(x => new Array(x.length).fill(1))\r\n }\r\n\r\n if (return_tensor) {\r\n if (!(padding && truncation)) {\r\n // Not, guaranteed that all items have same length, so\r\n // we perform additional check\r\n\r\n if (tokens.some(x => x.length !== tokens[0].length)) {\r\n throw Error(\r\n \"Unable to create tensor, you should probably activate truncation and/or padding \" +\r\n \"with 'padding=true' and 'truncation=true' to have batched tensors with the same length.\"\r\n )\r\n }\r\n }\r\n\r\n // Now we actually convert to tensor\r\n let dims = [tokens.length, tokens[0].length];\r\n\r\n tokens = new Tensor('int64',\r\n BigInt64Array.from(tokens.flat().map(BigInt)),\r\n dims\r\n );\r\n\r\n attention_mask = new Tensor(\r\n 'int64',\r\n BigInt64Array.from(attention_mask.flat().map(BigInt)),\r\n dims\r\n )\r\n }\r\n\r\n\r\n // Finally, add attention mask, and possibly model-specific parameters\r\n let modelInputs = {\r\n input_ids: tokens,\r\n attention_mask: attention_mask\r\n }\r\n\r\n // Optional post-processing\r\n modelInputs = this.prepare_model_inputs(modelInputs);\r\n\r\n return modelInputs\r\n }\r\n\r\n /**\r\n * Encodes a single text using the preprocessor pipeline of the tokenizer.\r\n *\r\n * @param {string|null} text - The text to encode.\r\n * @returns {Array} The encoded tokens.\r\n */\r\n _encode_text(text) {\r\n if (text === null) return null;\r\n\r\n // Actual function which does encoding, for a single text\r\n // First, we take care of special tokens. Needed to avoid issues arising from\r\n // normalization and/or pretokenization (which may not preserve special tokens)\r\n const sections = text.split(this.special_tokens_regex).filter(x => x);\r\n\r\n let tokens = sections.map(x => {\r\n if (this.special_tokens.includes(x)) {\r\n // Ignore special tokens\r\n return x\r\n } else {\r\n if (this.remove_space === true) {\r\n // remove_space\r\n x = x.trim().split(/\\s+/).join(' ')\r\n }\r\n // Actually perform encoding\r\n if (this.normalizer !== null) {\r\n x = this.normalizer(x);\r\n }\r\n let sectionTokens = this.pre_tokenizer(x);\r\n return this.model(sectionTokens);\r\n }\r\n }).flat();\r\n\r\n return tokens;\r\n }\r\n\r\n /**\r\n * Encodes a single text or a pair of texts using the model's tokenizer.\r\n *\r\n * @param {string} text - The text to encode.\r\n * @param {string|null} text_pair - The optional second text to encode.\r\n * @returns {number[]} An array of token IDs representing the encoded text(s).\r\n */\r\n encode(text, text_pair = null) {\r\n // Function called by users to encode possibly multiple texts\r\n let tokens = this._encode_text(text);\r\n let tokens2 = this._encode_text(text_pair);\r\n\r\n let combinedTokens = this.post_processor(tokens, tokens2);\r\n let ids = this.model.convert_tokens_to_ids(combinedTokens);\r\n\r\n return ids\r\n }\r\n\r\n /**\r\n * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms\r\n * @param {string} text - The text to clean up.\r\n * @returns {string} - The cleaned up text.\r\n */\r\n clean_up_tokenization(text) {\r\n // Clean up a list of simple English tokenization artifacts\r\n // like spaces before punctuations and abbreviated forms\r\n return text.replace(/ \\./g, '.')\r\n .replace(/ \\?/g, '?')\r\n .replace(/ \\!/g, '!')\r\n .replace(/ ,/g, ',')\r\n .replace(/ \\' /g, \"'\")\r\n .replace(/ n\\'t/g, \"n't\")\r\n .replace(/ \\'m/g, \"'m\")\r\n .replace(/ \\'s/g, \"'s\")\r\n .replace(/ \\'ve/g, \"'ve\")\r\n .replace(/ \\'re/g, \"'re\");\r\n }\r\n\r\n /**\r\n * Decode a batch of tokenized sequences.\r\n * @param {number[][]} batch - List of tokenized input sequences.\r\n * @param {Object} decode_args - (Optional) Object with decoding arguments.\r\n * @returns {string[]} List of decoded sequences.\r\n */\r\n batch_decode(batch, decode_args = {}) {\r\n return batch.map(x => this.decode(x, decode_args));\r\n }\r\n\r\n /**\r\n * Decodes a sequence of token IDs back to a string.\r\n *\r\n * @param {number[]} token_ids - List of token IDs to decode.\r\n * @param {Object} [decode_args={}]\r\n * @param {boolean} [decode_args.skip_special_tokens=false] - If true, special tokens are removed from the output string.\r\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - If true, spaces before punctuations and abbreviated forms are removed.\r\n *\r\n * @returns {string} The decoded string.\r\n * @throws {Error} If `token_ids` is not a non-empty array of integers.\r\n */\r\n decode(\r\n token_ids,\r\n decode_args = {},\r\n ) {\r\n if (!Array.isArray(token_ids) || token_ids.length === 0 || !isIntegralNumber(token_ids[0])) {\r\n throw Error(\"token_ids must be a non-empty array of integers.\");\r\n }\r\n\r\n return this.decode_single(\r\n token_ids, decode_args\r\n )\r\n }\r\n\r\n /**\r\n * Decode a single list of token ids to a string.\r\n * @param {number[]} token_ids - List of token ids to decode\r\n * @param {object} decode_args - Optional arguments for decoding\r\n * @param {boolean} [decode_args.skip_special_tokens=false] - Whether to skip special tokens during decoding\r\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - Whether to clean up tokenization spaces during decoding\r\n * @returns {string} - The decoded string\r\n */\r\n decode_single(\r\n token_ids,\r\n {\r\n skip_special_tokens = false,\r\n clean_up_tokenization_spaces = true,\r\n }\r\n ) {\r\n let tokens = this.model.convert_ids_to_tokens(token_ids);\r\n if (skip_special_tokens) {\r\n tokens = tokens.filter(x => !this.special_tokens.includes(x));\r\n }\r\n\r\n let decoded = this.decoder(tokens); // tokens === filtered_tokens\r\n\r\n if ('cleanup' in this.decoder && this.decoder.cleanup !== clean_up_tokenization_spaces) {\r\n console.warn(`clean_up_tokenization_spaces disagrees with decoder's cleanup setting. Overriding to use decoder's cleanup setting (${this.decoder.cleanup})`)\r\n // @ts-ignore\r\n clean_up_tokenization_spaces = this.decoder.cleanup;\r\n }\r\n\r\n if (clean_up_tokenization_spaces) {\r\n decoded = this.clean_up_tokenization(decoded);\r\n }\r\n\r\n return decoded;\r\n }\r\n\r\n}\r\n\r\n/**\r\n* Prepare model inputs for a BERT model.\r\n* @param {Object} inputs - An object containing the input ids and attention mask.\r\n* @returns {Object} The prepared inputs object.\r\n*/\r\nfunction bert_prepare_model_inputs(inputs) {\r\n // Helper method for preparing token_type_ids for bert models\r\n inputs.token_type_ids = new Tensor(\r\n 'int64',\r\n new BigInt64Array(inputs.input_ids.data.length),\r\n inputs.input_ids.dims\r\n )\r\n return inputs;\r\n}\r\n\r\n/**\r\n * BertTokenizer is a class used to tokenize text for BERT models.\r\n * @extends PreTrainedTokenizer\r\n */\r\nclass BertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\n/**\r\n * Albert tokenizer\r\n * @extends PreTrainedTokenizer\r\n */\r\nclass AlbertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\nclass MobileBertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\nclass SqueezeBertTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * @see {@link bert_prepare_model_inputs}\r\n */\r\n prepare_model_inputs(inputs) {\r\n return bert_prepare_model_inputs(inputs);\r\n }\r\n}\r\nclass DistilBertTokenizer extends PreTrainedTokenizer { }\r\nclass T5Tokenizer extends PreTrainedTokenizer { }\r\nclass GPT2Tokenizer extends PreTrainedTokenizer { }\r\nclass BartTokenizer extends PreTrainedTokenizer { }\r\nclass RobertaTokenizer extends PreTrainedTokenizer { }\r\n\r\n\r\n/**\r\n * WhisperTokenizer tokenizer\r\n * @extends PreTrainedTokenizer\r\n */\r\nclass WhisperTokenizer extends PreTrainedTokenizer {\r\n static LANGUAGES = {\r\n \"en\": \"english\",\r\n \"zh\": \"chinese\",\r\n \"de\": \"german\",\r\n \"es\": \"spanish\",\r\n \"ru\": \"russian\",\r\n \"ko\": \"korean\",\r\n \"fr\": \"french\",\r\n \"ja\": \"japanese\",\r\n \"pt\": \"portuguese\",\r\n \"tr\": \"turkish\",\r\n \"pl\": \"polish\",\r\n \"ca\": \"catalan\",\r\n \"nl\": \"dutch\",\r\n \"ar\": \"arabic\",\r\n \"sv\": \"swedish\",\r\n \"it\": \"italian\",\r\n \"id\": \"indonesian\",\r\n \"hi\": \"hindi\",\r\n \"fi\": \"finnish\",\r\n \"vi\": \"vietnamese\",\r\n \"he\": \"hebrew\",\r\n \"uk\": \"ukrainian\",\r\n \"el\": \"greek\",\r\n \"ms\": \"malay\",\r\n \"cs\": \"czech\",\r\n \"ro\": \"romanian\",\r\n \"da\": \"danish\",\r\n \"hu\": \"hungarian\",\r\n \"ta\": \"tamil\",\r\n \"no\": \"norwegian\",\r\n \"th\": \"thai\",\r\n \"ur\": \"urdu\",\r\n \"hr\": \"croatian\",\r\n \"bg\": \"bulgarian\",\r\n \"lt\": \"lithuanian\",\r\n \"la\": \"latin\",\r\n \"mi\": \"maori\",\r\n \"ml\": \"malayalam\",\r\n \"cy\": \"welsh\",\r\n \"sk\": \"slovak\",\r\n \"te\": \"telugu\",\r\n \"fa\": \"persian\",\r\n \"lv\": \"latvian\",\r\n \"bn\": \"bengali\",\r\n \"sr\": \"serbian\",\r\n \"az\": \"azerbaijani\",\r\n \"sl\": \"slovenian\",\r\n \"kn\": \"kannada\",\r\n \"et\": \"estonian\",\r\n \"mk\": \"macedonian\",\r\n \"br\": \"breton\",\r\n \"eu\": \"basque\",\r\n \"is\": \"icelandic\",\r\n \"hy\": \"armenian\",\r\n \"ne\": \"nepali\",\r\n \"mn\": \"mongolian\",\r\n \"bs\": \"bosnian\",\r\n \"kk\": \"kazakh\",\r\n \"sq\": \"albanian\",\r\n \"sw\": \"swahili\",\r\n \"gl\": \"galician\",\r\n \"mr\": \"marathi\",\r\n \"pa\": \"punjabi\",\r\n \"si\": \"sinhala\",\r\n \"km\": \"khmer\",\r\n \"sn\": \"shona\",\r\n \"yo\": \"yoruba\",\r\n \"so\": \"somali\",\r\n \"af\": \"afrikaans\",\r\n \"oc\": \"occitan\",\r\n \"ka\": \"georgian\",\r\n \"be\": \"belarusian\",\r\n \"tg\": \"tajik\",\r\n \"sd\": \"sindhi\",\r\n \"gu\": \"gujarati\",\r\n \"am\": \"amharic\",\r\n \"yi\": \"yiddish\",\r\n \"lo\": \"lao\",\r\n \"uz\": \"uzbek\",\r\n \"fo\": \"faroese\",\r\n \"ht\": \"haitian creole\",\r\n \"ps\": \"pashto\",\r\n \"tk\": \"turkmen\",\r\n \"nn\": \"nynorsk\",\r\n \"mt\": \"maltese\",\r\n \"sa\": \"sanskrit\",\r\n \"lb\": \"luxembourgish\",\r\n \"my\": \"myanmar\",\r\n \"bo\": \"tibetan\",\r\n \"tl\": \"tagalog\",\r\n \"mg\": \"malagasy\",\r\n \"as\": \"assamese\",\r\n \"tt\": \"tatar\",\r\n \"haw\": \"hawaiian\",\r\n \"ln\": \"lingala\",\r\n \"ha\": \"hausa\",\r\n \"ba\": \"bashkir\",\r\n \"jw\": \"javanese\",\r\n \"su\": \"sundanese\",\r\n }\r\n\r\n /**\r\n * Decodes automatic speech recognition (ASR) sequences.\r\n * @param {Array.<{tokens: Array., stride: [number, number, number]}>} sequences The sequences to decode.\r\n * @param {Object} options - The options to use for decoding.\r\n * @returns {[string, {chunks?:Array.<{language: string|null, timestamp: [number|null, number|null], text: string}>}]} The decoded sequences.\r\n */\r\n _decode_asr(sequences, {\r\n return_timestamps = false,\r\n return_language = false,\r\n time_precision = null,\r\n force_full_sequences = true\r\n } = {}) {\r\n // Set force_full_sequences=false if you want streaming\r\n // TODO add support for `return_language`\r\n\r\n // Internal method meant to only be used by asr pipeline.\r\n // Handles all the little quirks specific to whisper to handle\r\n // the various options not allowed in other seq2seq models\r\n\r\n // =========== Overview ============\r\n // - iterate over all outputs\r\n // - all tokens within output\r\n // - Each token can be\r\n // - language token\r\n // - special token\r\n // - timestamp token\r\n // - text token\r\n // - We accumulate the text tokens.\r\n // - We split on end timestamps\r\n // - Lots of complexity comes from stride and timestamps\r\n\r\n if (time_precision === null) {\r\n throw Error(\"Must specify time_precision\")\r\n }\r\n let last_language = null;\r\n\r\n function new_chunk() {\r\n return { \"language\": last_language, \"timestamp\": [null, null], \"text\": \"\" };\r\n }\r\n\r\n // Welcome to the state machine!\r\n const chunks = [];\r\n let chunk = new_chunk();\r\n let time_offset = 0.0;\r\n const timestamp_begin = this.model.convert_tokens_to_ids([\"<|notimestamps|>\"])[0] + 1;\r\n\r\n let previous_tokens = [];\r\n let skip = false;\r\n let right_stride_start = null;\r\n\r\n\r\n const all_special_ids = new Set(this.all_special_ids);\r\n\r\n for (let output of sequences) {\r\n // NOTE: python version has batches, so it uses [0]\r\n const token_ids = output.tokens;\r\n\r\n // These keep track of timestamps within strides, which need\r\n // to be skipped and resolve all tokens in a single chunk.\r\n let last_timestamp = null;\r\n let first_timestamp = timestamp_begin;\r\n\r\n if (\"stride\" in output) {\r\n const [chunk_len, stride_left, stride_right] = output.stride;\r\n\r\n // Offset the timings to account for the other `model_outputs`.\r\n time_offset -= stride_left;\r\n right_stride_start = chunk_len - stride_right;\r\n\r\n // Keeping track of timestamps within strides\r\n // We're going to NOT split on those, and delay until we're\r\n // out of BOTH stride. Otherwise lots of issues occur and\r\n // corner cases\r\n if (stride_left) {\r\n first_timestamp = stride_left / time_precision + timestamp_begin;\r\n }\r\n\r\n if (stride_right) {\r\n for (let i = token_ids.length - 1; i >= 0; --i) {\r\n const token = token_ids[i];\r\n if (token >= timestamp_begin) {\r\n // There can be several token in the right stride\r\n // But the last one is ALWAYS going to be skipped\r\n if (last_timestamp !== null && (token - timestamp_begin) * time_precision < right_stride_start) {\r\n break;\r\n }\r\n last_timestamp = token;\r\n }\r\n }\r\n }\r\n }\r\n\r\n let current_tokens = [];\r\n\r\n // - all tokens within output\r\n for (const token of token_ids) {\r\n // 4 possible states for each token\r\n // - 1/ Language code\r\n // - 2/ all other special tokens (which we ignore)\r\n // - 3/ Timestamp\r\n // - 4/ Regular text\r\n\r\n if (all_special_ids.has(token)) {\r\n const text = this.decode([token]);\r\n if (text[0] === \"[\" && text[text.length - 1] === \"]\") {\r\n const language = WhisperTokenizer.LANGUAGES[text.slice(1, -1)];\r\n\r\n if (language !== undefined) {\r\n // 1/ Indeed some language\r\n // TODO Handle when language is different from the previous\r\n // one, and we cannot use timestamped tokens to create chunks\r\n if (last_language !== null && language !== last_language && !return_timestamps) {\r\n previous_tokens.push(current_tokens);\r\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens);\r\n const resolved_text = this.decode(resolved_tokens);\r\n chunk.text = resolved_text;\r\n chunks.push(chunk);\r\n\r\n // Flush all our temporary context\r\n previous_tokens = [];\r\n current_tokens = [];\r\n chunk = new_chunk();\r\n }\r\n\r\n last_language = chunk.language = language;\r\n } else {\r\n // 2/ This is a regular special token, ignoring it\r\n }\r\n }\r\n } else if (token >= timestamp_begin) {\r\n // 3/ Timestamp token\r\n const time = (token - timestamp_begin) * time_precision + time_offset;\r\n const rounded_time = Math.round(time * 100) / 100;\r\n\r\n if (last_timestamp !== null && token >= last_timestamp) {\r\n // Whisper outputted a timestamp token, but it falls within\r\n // our stride, so we're going to skip it for the time being\r\n // and resolve this later\r\n // Skip is necessary because timestamp tokens always come\r\n // by pair, so we need to skip the next one too (which would mark the start of another chunk).\r\n skip = true;\r\n } else if (skip || (previous_tokens.length > 0 && token < first_timestamp)) {\r\n skip = false;\r\n } else if (chunk.timestamp[0] === null) {\r\n chunk.timestamp[0] = rounded_time;\r\n } else {\r\n // This is the end of the timestamp chunk\r\n if (rounded_time === chunk.timestamp[0]) {\r\n // This is a bug in timestamp token output\r\n // where we're taking the duplicate token\r\n // as a stop where it should be a start.\r\n // This is an issue in the underlying model output\r\n // Let's just skip it so it becomes\r\n } else {\r\n chunk.timestamp[1] = time;\r\n\r\n // Handling merges\r\n previous_tokens.push(current_tokens)\r\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens)\r\n const resolved_text = this.decode(resolved_tokens)\r\n chunk.text = resolved_text\r\n chunks.push(chunk)\r\n\r\n // Flush all our temporary context\r\n previous_tokens = []\r\n current_tokens = []\r\n chunk = new_chunk()\r\n }\r\n }\r\n\r\n } else {\r\n // 4/ Regular token\r\n // We just append to the list of all tokens so we can handle\r\n // merges later and decode into text.\r\n current_tokens.push(token)\r\n\r\n }\r\n }\r\n\r\n if ('stride' in output) {\r\n const [chunk_len, stride_left, stride_right] = output.stride;\r\n time_offset += chunk_len - stride_right\r\n }\r\n\r\n // Leftover tokens\r\n if (current_tokens.length > 0) {\r\n previous_tokens.push(current_tokens)\r\n } else if (previous_tokens.every(p => p.length === 0)) {\r\n // Flushing previous tokens (END)\"\r\n chunk = new_chunk()\r\n previous_tokens = []\r\n current_tokens = []\r\n }\r\n\r\n }\r\n\r\n if (previous_tokens.length > 0) {\r\n if (force_full_sequences && return_timestamps) {\r\n // Last token should always be timestamps, so there shouldn't be\r\n // leftover\r\n throw new Error(\"There was an error while processing timestamps, we haven't found a timestamp as last token.\");\r\n }\r\n\r\n // Happens when we don't use timestamps\r\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens);\r\n\r\n // Flushing previous tokens (FINAL)\r\n const resolved_text = this.decode(resolved_tokens);\r\n chunk.text = resolved_text;\r\n chunks.push(chunk);\r\n }\r\n\r\n let optional = {};\r\n\r\n // Preparing and cleaning up the pipeline output\r\n const full_text = chunks.map(chunk => chunk.text).join('');\r\n if (return_timestamps || return_language) {\r\n for (let i = 0; i < chunks.length; i++) {\r\n const chunk = chunks[i];\r\n if (!return_timestamps) {\r\n delete chunk[\"timestamp\"];\r\n }\r\n\r\n if (!return_language) {\r\n delete chunk[\"language\"];\r\n }\r\n }\r\n optional = { \"chunks\": chunks };\r\n }\r\n return [full_text, optional];\r\n\r\n }\r\n\r\n /**\r\n * Finds the longest common sequence among the provided sequences.\r\n * @param {number[][]} sequences - An array of sequences of token ids to compare.\r\n * @returns {number[]} - The longest common sequence found.\r\n * @throws {Error} - If there is a bug within the function.\r\n */\r\n findLongestCommonSequence(sequences) {\r\n // It would be much harder to do O(n) because of fault tolerance.\r\n // We actually have a really good property which is that the total sequence\r\n // MUST be those subsequences in order.\r\n let leftSequence = sequences[0];\r\n let leftLength = leftSequence.length;\r\n let totalSequence = [];\r\n for (let i = 1; i < sequences.length; i++) {\r\n const rightSequence = sequences[i];\r\n let max = 0.0;\r\n let maxIndices = [leftLength, leftLength, 0, 0];\r\n // Here we're sliding matches\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n // = [c] == [d]\r\n\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n // = [c, d] == [c, d]\r\n\r\n\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n\r\n // = [b, c, d] == [c, d, f]\r\n\r\n // [a, b, c, d]\r\n // [c, d, f]\r\n\r\n // [a, b, c] == [c, d, f]\r\n\r\n // [a, b, c, d]\r\n // [d, f]\r\n\r\n // [a, b] == [d, f]\r\n\r\n // [a, b, c, d]\r\n // [f]\r\n\r\n // [a] == [f]\r\n\r\n const rightLength = rightSequence.length;\r\n for (let j = 1; j < leftLength + rightLength; j++) {\r\n const eps = j / 10000.0;\r\n const leftStart = Math.max(0, leftLength - j);\r\n const leftStop = Math.min(leftLength, leftLength + rightLength - j);\r\n const left = leftSequence.slice(leftStart, leftStop);\r\n const rightStart = Math.max(0, j - leftLength);\r\n const rightStop = Math.min(rightLength, j);\r\n const right = rightSequence.slice(rightStart, rightStop);\r\n if (left.length !== right.length) {\r\n throw new Error(\"There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.\");\r\n }\r\n const matches = left.filter((elem, idx) => elem === right[idx]).length;\r\n const matching = matches / j + eps;\r\n if (matches > 1 && matching > max) {\r\n max = matching;\r\n maxIndices = [leftStart, leftStop, rightStart, rightStop];\r\n }\r\n }\r\n const [leftStart, leftStop, rightStart, rightStop] = maxIndices;\r\n const leftMid = Math.floor((leftStop + leftStart) / 2);\r\n const rightMid = Math.floor((rightStop + rightStart) / 2);\r\n totalSequence.push(...leftSequence.slice(0, leftMid));\r\n leftSequence = rightSequence.slice(rightMid);\r\n leftLength = leftSequence.length;\r\n }\r\n totalSequence.push(...leftSequence);\r\n return totalSequence;\r\n }\r\n}\r\nclass CodeGenTokenizer extends PreTrainedTokenizer { }\r\nclass CLIPTokenizer extends PreTrainedTokenizer { }\r\nclass MarianTokenizer extends PreTrainedTokenizer {\r\n /**\r\n * Create a new MarianTokenizer instance.\r\n * @param {Object} tokenizerJSON - The JSON of the tokenizer.\r\n * @param {Object} tokenizerConfig - The config of the tokenizer.\r\n */\r\n constructor(tokenizerJSON, tokenizerConfig) {\r\n super(tokenizerJSON, tokenizerConfig);\r\n\r\n this.languageRegex = /^(>>\\w+<<)\\s*/g;\r\n\r\n this.supported_language_codes = this.model.vocab.filter(\r\n x => this.languageRegex.test(x)\r\n );\r\n }\r\n\r\n /**\r\n * Encodes a single text. Overriding this method is necessary since the language codes\r\n * must be removed before encoding with sentencepiece model.\r\n * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213\r\n *\r\n * @param {string|null} text - The text to encode.\r\n * @returns {Array} The encoded tokens.\r\n */\r\n _encode_text(text) {\r\n if (text === null) return null;\r\n\r\n // Check if text starts with language code:\r\n let [matchInfo, ...remainder] = text.trim().split(this.languageRegex);\r\n\r\n if (remainder.length === 0) {\r\n // No language code, encode normally\r\n return super._encode_text(matchInfo);\r\n\r\n } else if (remainder.length === 2) {\r\n // Text starts with language code, so we do not encode it with sentencepiece.\r\n let [language, text] = remainder;\r\n\r\n if (!this.supported_language_codes.includes(language)) {\r\n console.warn(`Unsupported language code \"${language}\" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`)\r\n }\r\n return [language, ...super._encode_text(text)]\r\n }\r\n }\r\n\r\n}\r\n\r\n/**\r\n * A trie structure to efficiently store and search for strings.\r\n */\r\nclass CharTrie {\r\n constructor() {\r\n this.root = CharTrieNode.default();\r\n }\r\n\r\n /**\r\n * Adds one or more `texts` to the trie.\r\n * @param {string[]} texts - The strings to add to the trie.\r\n */\r\n extend(texts) {\r\n for (let text of texts) {\r\n this.push(text);\r\n }\r\n }\r\n\r\n /**\r\n * Adds one or more `texts` to the trie.\r\n * @param {*} text - The strings to add to the trie.\r\n */\r\n push(text) {\r\n let node = this.root;\r\n for (let ch of text) {\r\n let child = node.children.get(ch);\r\n if (child === undefined) {\r\n child = CharTrieNode.default();\r\n node.children.set(ch, child);\r\n }\r\n node = child;\r\n }\r\n node.isLeaf = true;\r\n }\r\n\r\n /**\r\n * Searches the trie for all strings with a common prefix of `text`.\r\n * @param {string} text - The common prefix to search for.\r\n * @yields {string} - Each string in the trie that has `text` as a prefix.\r\n */\r\n *commonPrefixSearch(text) {\r\n let node = this.root;\r\n let prefix = \"\";\r\n for (let i = 0; i < text.length && node !== undefined; i++) {\r\n const ch = text[i];\r\n prefix += ch;\r\n node = node.children.get(ch);\r\n if (node !== undefined && node.isLeaf) {\r\n yield prefix;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Represents a node in a character trie.\r\n * @param {boolean} isLeaf - Whether the node is a leaf node or not.\r\n * @param {Map} children - A map containing the node's children, where the key is a character and the value is a `CharTrieNode`.\r\n */\r\nclass CharTrieNode {\r\n constructor(isLeaf, children) {\r\n this.isLeaf = isLeaf;\r\n this.children = children;\r\n }\r\n\r\n /**\r\n * Returns a new `CharTrieNode` instance with default values.\r\n * @returns {CharTrieNode} A new `CharTrieNode` instance with `isLeaf` set to `false` and an empty `children` map.\r\n */\r\n static default() {\r\n return new CharTrieNode(false, new Map());\r\n }\r\n}\r\n\r\nclass TokenLattice {\r\n /**\r\n * Creates a new TokenLattice instance.\r\n *\r\n * @param {string} sentence - The input sentence to be tokenized.\r\n * @param {number} bosTokenId - The beginning-of-sequence token ID.\r\n * @param {number} eosTokenId - The end-of-sequence token ID.\r\n */\r\n constructor(sentence, bosTokenId, eosTokenId) {\r\n this.sentence = sentence;\r\n this.len = sentence.length;\r\n this.bosTokenId = bosTokenId;\r\n this.eosTokenId = eosTokenId;\r\n this.nodes = [];\r\n this.beginNodes = new Array(this.len + 1);\r\n this.endNodes = new Array(this.len + 1);\r\n for (let i = 0; i < this.len + 1; i++) {\r\n this.beginNodes[i] = [];\r\n this.endNodes[i] = [];\r\n }\r\n const bos = new TokenLatticeNode(this.bosTokenId, 0, 0, 0, 0.0);\r\n const eos = new TokenLatticeNode(this.eosTokenId, 1, this.len, 0, 0.0);\r\n this.nodes.push(bos.clone());\r\n this.nodes.push(eos.clone());\r\n this.beginNodes[this.len].push(eos);\r\n this.endNodes[0].push(bos);\r\n }\r\n\r\n /**\r\n * Inserts a new token node into the token lattice.\r\n *\r\n * @param {number} pos - The starting position of the token.\r\n * @param {number} length - The length of the token.\r\n * @param {number} score - The score of the token.\r\n * @param {number} tokenId - The token ID of the token.\r\n */\r\n insert(pos, length, score, tokenId) {\r\n const nodeId = this.nodes.length;\r\n const node = new TokenLatticeNode(tokenId, nodeId, pos, length, score);\r\n this.beginNodes[pos].push(node);\r\n this.endNodes[pos + length].push(node);\r\n this.nodes.push(node);\r\n }\r\n\r\n /**\r\n * Implements the Viterbi algorithm to compute the most likely sequence of tokens.\r\n *\r\n * @returns {TokenLatticeNode[]} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n viterbi() {\r\n const len = this.len;\r\n let pos = 0;\r\n while (pos <= len) {\r\n if (this.beginNodes[pos].length == 0) {\r\n return [];\r\n }\r\n for (let rnode of this.beginNodes[pos]) {\r\n rnode.prev = null;\r\n let bestScore = 0.0;\r\n let bestNode = null;\r\n for (let lnode of this.endNodes[pos]) {\r\n const score = lnode.backtraceScore + rnode.score;\r\n if (bestNode === null || score > bestScore) {\r\n bestNode = lnode.clone();\r\n bestScore = score;\r\n }\r\n }\r\n if (bestNode !== null) {\r\n rnode.prev = bestNode;\r\n rnode.backtraceScore = bestScore;\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n pos++;\r\n }\r\n const results = [];\r\n const root = this.beginNodes[len][0];\r\n const prev = root.prev;\r\n if (prev === null) {\r\n return [];\r\n }\r\n let node = prev.clone();\r\n while (node.prev !== null) {\r\n results.push(node.clone());\r\n const n = node.clone();\r\n node = n.prev.clone();\r\n }\r\n results.reverse();\r\n return results;\r\n }\r\n\r\n /**\r\n * @param {any} node\r\n * @returns {string} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n piece(node) {\r\n return this.sentence.slice(node.pos, node.pos + node.length);\r\n }\r\n\r\n /**\r\n * @returns {Array} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n tokens() {\r\n const nodes = this.viterbi();\r\n return nodes.map(x => this.piece(x));\r\n }\r\n\r\n /**\r\n * @returns {Array} - The array of nodes representing the most likely sequence of tokens.\r\n */\r\n tokenIds() {\r\n const nodes = this.viterbi();\r\n return nodes.map(x => x.tokenId);\r\n }\r\n}\r\nclass TokenLatticeNode {\r\n /**\r\n * Represents a node in a token lattice for a given sentence.\r\n * @param {number} tokenId - The ID of the token associated with this node.\r\n * @param {number} nodeId - The ID of this node.\r\n * @param {number} pos - The starting position of the token in the sentence.\r\n * @param {number} length - The length of the token.\r\n * @param {number} score - The score associated with the token.\r\n */\r\n constructor(tokenId, nodeId, pos, length, score) {\r\n this.tokenId = tokenId;\r\n this.nodeId = nodeId;\r\n this.pos = pos;\r\n this.length = length;\r\n this.score = score;\r\n this.prev = null;\r\n this.backtraceScore = 0.0;\r\n }\r\n\r\n /**\r\n * Returns a clone of this node.\r\n * @returns {TokenLatticeNode} - A clone of this node.\r\n */\r\n clone() {\r\n const n = new TokenLatticeNode(this.tokenId, this.nodeId, this.pos, this.length, this.score);\r\n n.prev = this.prev;\r\n n.backtraceScore = this.backtraceScore;\r\n return n;\r\n }\r\n}\r\n\r\nclass AutoTokenizer {\r\n // Helper class to determine tokenizer type from tokenizer.json\r\n static TOKENIZER_CLASS_MAPPING = {\r\n 'T5Tokenizer': T5Tokenizer,\r\n 'DistilBertTokenizer': DistilBertTokenizer,\r\n 'BertTokenizer': BertTokenizer,\r\n 'MobileBertTokenizer': MobileBertTokenizer,\r\n 'SqueezeBertTokenizer': SqueezeBertTokenizer,\r\n 'AlbertTokenizer': AlbertTokenizer,\r\n 'GPT2Tokenizer': GPT2Tokenizer,\r\n 'BartTokenizer': BartTokenizer,\r\n 'RobertaTokenizer': RobertaTokenizer,\r\n 'WhisperTokenizer': WhisperTokenizer,\r\n 'CodeGenTokenizer': CodeGenTokenizer,\r\n 'CLIPTokenizer': CLIPTokenizer,\r\n 'MarianTokenizer': MarianTokenizer,\r\n }\r\n\r\n static async from_pretrained(modelPath, progressCallback = null) {\r\n\r\n let [tokenizerJSON, tokenizerConfig] = await Promise.all([\r\n fetchJSON(modelPath, 'tokenizer.json', progressCallback),\r\n fetchJSON(modelPath, 'tokenizer_config.json', progressCallback),\r\n ])\r\n\r\n let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerConfig.tokenizer_class];\r\n if (!cls) {\r\n console.warn(`Unknown tokenizer class \"${tokenizerConfig.tokenizer_class}\", attempting to construct from base class.`);\r\n cls = PreTrainedTokenizer;\r\n }\r\n return new cls(tokenizerJSON, tokenizerConfig);\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n AutoTokenizer,\r\n BertTokenizer,\r\n DistilBertTokenizer,\r\n T5Tokenizer,\r\n GPT2Tokenizer\r\n};\r\n","\r\nconst {\r\n AutoTokenizer,\r\n BertTokenizer,\r\n DistilBertTokenizer,\r\n T5Tokenizer,\r\n GPT2Tokenizer\r\n} = require(\"./tokenizers.js\");\r\nconst {\r\n AutoModel,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForCausalLM,\r\n AutoModelForMaskedLM,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForObjectDetection,\r\n} = require(\"./models.js\");\r\n\r\nconst {\r\n AutoProcessor\r\n} = require(\"./processors.js\");\r\nconst {\r\n pipeline\r\n} = require(\"./pipelines.js\");\r\nconst { env } = require('./env.js');\r\n\r\nconst { Tensor } = require('./tensor_utils.js');\r\n\r\nconst moduleExports = {\r\n // Tokenizers\r\n AutoTokenizer,\r\n BertTokenizer,\r\n DistilBertTokenizer,\r\n T5Tokenizer,\r\n GPT2Tokenizer,\r\n\r\n // Models\r\n AutoModel,\r\n AutoModelForSeq2SeqLM,\r\n AutoModelForSequenceClassification,\r\n AutoModelForTokenClassification,\r\n AutoModelForCausalLM,\r\n AutoModelForMaskedLM,\r\n AutoModelForQuestionAnswering,\r\n AutoModelForVision2Seq,\r\n AutoModelForImageClassification,\r\n AutoModelForObjectDetection,\r\n\r\n // Processors\r\n AutoProcessor,\r\n\r\n // other\r\n pipeline,\r\n Tensor,\r\n\r\n // environment variables\r\n env\r\n};\r\n\r\n// Allow global access to these variables\r\nif (typeof self !== 'undefined') {\r\n // Used by web workers\r\n Object.assign(self, moduleExports);\r\n}\r\n\r\n// Used by other modules\r\nmodule.exports = moduleExports\r\n","\r\nconst fs = require('fs');\r\n\r\nconst { env } = require('./env.js');\r\n\r\nif (global.ReadableStream === undefined && typeof process !== 'undefined') {\r\n try {\r\n // @ts-ignore\r\n global.ReadableStream = require('node:stream/web').ReadableStream; // ReadableStream is not a global with Node 16\r\n } catch (err) {\r\n console.warn(\"ReadableStream not defined and unable to import from node:stream/web\");\r\n }\r\n}\r\n\r\nclass FileResponse {\r\n /**\r\n * Creates a new `FileResponse` object.\r\n * @param {string|URL} filePath\r\n */\r\n constructor(filePath) {\r\n this.filePath = filePath;\r\n this.headers = {};\r\n this.headers.get = (x) => this.headers[x]\r\n\r\n this.exists = fs.existsSync(filePath);\r\n if (this.exists) {\r\n this.status = 200;\r\n this.statusText = 'OK';\r\n\r\n let stats = fs.statSync(filePath);\r\n this.headers['content-length'] = stats.size;\r\n\r\n this.updateContentType();\r\n\r\n let self = this;\r\n this.body = new ReadableStream({\r\n start(controller) {\r\n self.arrayBuffer().then(buffer => {\r\n controller.enqueue(new Uint8Array(buffer));\r\n controller.close();\r\n })\r\n }\r\n });\r\n } else {\r\n this.status = 404;\r\n this.statusText = 'Not Found';\r\n this.body = null;\r\n }\r\n }\r\n\r\n /**\r\n * Updates the 'content-type' header property of the response based on the extension of\r\n * the file specified by the filePath property of the current object.\r\n * @function\r\n * @returns {void}\r\n */\r\n updateContentType() {\r\n // Set content-type header based on file extension\r\n const extension = this.filePath.toString().split('.').pop().toLowerCase();\r\n switch (extension) {\r\n case 'txt':\r\n this.headers['content-type'] = 'text/plain';\r\n break;\r\n case 'html':\r\n this.headers['content-type'] = 'text/html';\r\n break;\r\n case 'css':\r\n this.headers['content-type'] = 'text/css';\r\n break;\r\n case 'js':\r\n this.headers['content-type'] = 'text/javascript';\r\n break;\r\n case 'json':\r\n this.headers['content-type'] = 'application/json';\r\n break;\r\n case 'png':\r\n this.headers['content-type'] = 'image/png';\r\n break;\r\n case 'jpg':\r\n case 'jpeg':\r\n this.headers['content-type'] = 'image/jpeg';\r\n break;\r\n case 'gif':\r\n this.headers['content-type'] = 'image/gif';\r\n break;\r\n default:\r\n this.headers['content-type'] = 'application/octet-stream';\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * @function\r\n * @returns {FileResponse}\r\n */\r\n clone() {\r\n let response = new FileResponse(this.filePath);\r\n response.exists = this.exists;\r\n response.status = this.status;\r\n response.statusText = this.statusText;\r\n response.headers = this.headers;\r\n return response;\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with an ArrayBuffer containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with an ArrayBuffer containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async arrayBuffer() {\r\n const data = await fs.promises.readFile(this.filePath);\r\n return data.buffer;\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with a Blob containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with a Blob containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async blob() {\r\n const data = await fs.promises.readFile(this.filePath);\r\n return new Blob([data], { type: this.headers['content-type'] });\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with a string containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with a string containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async text() {\r\n const data = await fs.promises.readFile(this.filePath, 'utf8');\r\n return data;\r\n }\r\n\r\n /**\r\n * Reads the contents of the file specified by the filePath property and returns a Promise that\r\n * resolves with a parsed JavaScript object containing the file's contents.\r\n * @async\r\n * @function\r\n * @returns {Promise} - A Promise that resolves with a parsed JavaScript object containing the file's contents.\r\n * @throws {Error} - If the file cannot be read.\r\n */\r\n async json() {\r\n return JSON.parse(await this.text());\r\n }\r\n}\r\n\r\n/**\r\n * Determines whether the given string is a valid HTTP or HTTPS URL.\r\n * @function\r\n * @param {string|URL} string - The string to test for validity as an HTTP or HTTPS URL.\r\n * @returns {boolean} - True if the string is a valid HTTP or HTTPS URL, false otherwise.\r\n */\r\nfunction isValidHttpUrl(string) {\r\n // https://stackoverflow.com/a/43467144\r\n let url;\r\n try {\r\n url = new URL(string);\r\n } catch (_) {\r\n return false;\r\n }\r\n return url.protocol === \"http:\" || url.protocol === \"https:\";\r\n}\r\n\r\n/**\r\n * Helper function to get a file, using either the Fetch API or FileSystem API.\r\n *\r\n * @async\r\n * @function getFile\r\n * @param {string|URL} url - The URL of the file to get.\r\n * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API).\r\n */\r\nasync function getFile(url) {\r\n // Helper function to get a file, using either the Fetch API or FileSystem API\r\n\r\n if (env.useFS && !isValidHttpUrl(url)) {\r\n return new FileResponse(url)\r\n\r\n } else {\r\n return fetch(url)\r\n }\r\n}\r\n\r\n/**\r\n * Helper function to dispatch progress callbacks.\r\n *\r\n * @function dispatchCallback\r\n * @param {function} progressCallback - The progress callback function to dispatch.\r\n * @param {any} data - The data to pass to the progress callback function.\r\n * @returns {void}\r\n */\r\nfunction dispatchCallback(progressCallback, data) {\r\n if (progressCallback !== null) progressCallback(data);\r\n}\r\n\r\n/**\r\n * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API.\r\n *\r\n * @async\r\n * @function getModelFile\r\n * @param {string} modelPath - The path of the model file.\r\n * @param {string} fileName - The name of the model file.\r\n * @param {function} [progressCallback=null] - A function to call when the download progress is updated.\r\n * @returns {Promise} A Promise that resolves with the file content as a buffer.\r\n * @throws Will throw an error if the file is not found.\r\n */\r\nasync function getModelFile(modelPath, fileName, progressCallback = null, fatal = true) {\r\n\r\n // Initiate session\r\n dispatchCallback(progressCallback, {\r\n status: 'initiate',\r\n name: modelPath,\r\n file: fileName\r\n })\r\n\r\n let cache;\r\n if (env.useCache) {\r\n cache = await caches.open('transformers-cache');\r\n }\r\n\r\n const request = pathJoin(modelPath, fileName);\r\n\r\n /** @type {Response | FileResponse} */\r\n let response;\r\n\r\n /** @type {Response | FileResponse} */\r\n let responseToCache;\r\n\r\n if (!env.useCache || (response = await cache.match(request)) === undefined) {\r\n // Caching not available, or model is not cached, so we perform the request\r\n response = await getFile(request);\r\n\r\n if (response.status === 404) {\r\n if (fatal) {\r\n throw Error(`File not found. Could not locate \"${request}\".`)\r\n } else {\r\n // File not found, but this file is optional.\r\n // TODO in future, cache the response\r\n return null;\r\n }\r\n }\r\n\r\n if (env.useCache) {\r\n // only clone if cache available\r\n responseToCache = response.clone();\r\n }\r\n }\r\n\r\n // Start downloading\r\n dispatchCallback(progressCallback, {\r\n status: 'download',\r\n name: modelPath,\r\n file: fileName\r\n })\r\n\r\n const buffer = await readResponse(response, data => {\r\n dispatchCallback(progressCallback, {\r\n status: 'progress',\r\n ...data,\r\n name: modelPath,\r\n file: fileName\r\n })\r\n })\r\n\r\n // Check again whether request is in cache. If not, we add the response to the cache\r\n if (responseToCache !== undefined && await cache.match(request) === undefined) {\r\n cache.put(request, /** @type {Response} */(/** @type {unknown} */ (responseToCache)));\r\n }\r\n\r\n dispatchCallback(progressCallback, {\r\n status: 'done',\r\n name: modelPath,\r\n file: fileName\r\n });\r\n\r\n return buffer;\r\n}\r\n\r\n/**\r\n * Fetches a JSON file from a given path and file name.\r\n *\r\n * @param {string} modelPath - The path to the directory containing the file.\r\n * @param {string} fileName - The name of the file to fetch.\r\n * @param {function} progressCallback - A callback function to receive progress updates. Optional.\r\n * @returns {Promise} - The JSON data parsed into a JavaScript object.\r\n */\r\nasync function fetchJSON(modelPath, fileName, progressCallback = null, fatal = true) {\r\n let buffer = await getModelFile(modelPath, fileName, progressCallback, fatal);\r\n if (buffer === null) {\r\n // Return empty object\r\n return {}\r\n }\r\n\r\n let decoder = new TextDecoder('utf-8');\r\n let jsonData = decoder.decode(buffer);\r\n\r\n return JSON.parse(jsonData);\r\n}\r\n\r\n/**\r\n * Read and track progress when reading a Response object\r\n *\r\n * @param {any} response - The Response object to read\r\n * @param {function} progressCallback - The function to call with progress updates\r\n * @returns {Promise} A Promise that resolves with the Uint8Array buffer\r\n */\r\nasync function readResponse(response, progressCallback) {\r\n // Read and track progress when reading a Response object\r\n\r\n const contentLength = response.headers.get('Content-Length');\r\n if (contentLength === null) {\r\n console.warn('Unable to determine content-length from response headers. Will expand buffer when needed.')\r\n }\r\n let total = parseInt(contentLength ?? '0');\r\n let buffer = new Uint8Array(total);\r\n let loaded = 0;\r\n\r\n const reader = response.body.getReader();\r\n async function read() {\r\n const { done, value } = await reader.read();\r\n if (done) return;\r\n\r\n let newLoaded = loaded + value.length;\r\n if (newLoaded > total) {\r\n total = newLoaded;\r\n\r\n // Adding the new data will overflow buffer.\r\n // In this case, we extend the buffer\r\n let newBuffer = new Uint8Array(total);\r\n\r\n // copy contents\r\n newBuffer.set(buffer);\r\n\r\n buffer = newBuffer;\r\n }\r\n buffer.set(value, loaded)\r\n loaded = newLoaded;\r\n\r\n const progress = (loaded / total) * 100;\r\n\r\n // Call your function here\r\n progressCallback({\r\n progress: progress,\r\n loaded: loaded,\r\n total: total,\r\n })\r\n\r\n return read();\r\n }\r\n\r\n // Actually read\r\n await read();\r\n\r\n return buffer;\r\n}\r\n\r\n/**\r\n * Joins multiple parts of a path into a single path, while handling leading and trailing slashes.\r\n *\r\n * @param {...string} parts - Multiple parts of a path.\r\n * @returns {string} A string representing the joined path.\r\n */\r\nfunction pathJoin(...parts) {\r\n // https://stackoverflow.com/a/55142565\r\n parts = parts.map((part, index) => {\r\n if (index) {\r\n part = part.replace(new RegExp('^/'), '');\r\n }\r\n if (index !== parts.length - 1) {\r\n part = part.replace(new RegExp('/$'), '');\r\n }\r\n return part;\r\n })\r\n return parts.join('/');\r\n}\r\n\r\n/**\r\n * Reverses the keys and values of an object.\r\n *\r\n * @param {object} data - The object to reverse.\r\n * @returns {object} The reversed object.\r\n * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript\r\n */\r\nfunction reverseDictionary(data) {\r\n // https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript\r\n return Object.fromEntries(Object.entries(data).map(([key, value]) => [value, key]));\r\n}\r\n\r\n/**\r\n * Returns the index of the maximum value in an array.\r\n * @param {Array} arr - The input array.\r\n * @see https://stackoverflow.com/a/11301464\r\n * @returns {number} - The index of the maximum value in the array.\r\n */\r\nfunction indexOfMax(arr) {\r\n // https://stackoverflow.com/a/11301464\r\n\r\n if (arr.length === 0) {\r\n return -1;\r\n }\r\n\r\n var max = arr[0];\r\n var maxIndex = 0;\r\n\r\n for (var i = 1; i < arr.length; ++i) {\r\n if (arr[i] > max) {\r\n maxIndex = i;\r\n max = arr[i];\r\n }\r\n }\r\n\r\n return maxIndex;\r\n}\r\n\r\n/**\r\n * Compute the softmax of an array of numbers.\r\n *\r\n * @param {number[]} arr - The array of numbers to compute the softmax of.\r\n * @returns {number[]} The softmax array.\r\n */\r\nfunction softmax(arr) {\r\n // Compute the maximum value in the array\r\n const maxVal = max(arr);\r\n\r\n // Compute the exponentials of the array values\r\n const exps = arr.map(x => Math.exp(x - maxVal));\r\n\r\n // Compute the sum of the exponentials\r\n const sumExps = exps.reduce((acc, val) => acc + val, 0);\r\n\r\n // Compute the softmax values\r\n const softmaxArr = exps.map(x => x / sumExps);\r\n\r\n return softmaxArr;\r\n}\r\n\r\n/**\r\n * Calculates the logarithm of the softmax function for the input array.\r\n * @param {number[]} arr - The input array to calculate the log_softmax function for.\r\n * @returns {any} - The resulting log_softmax array.\r\n */\r\nfunction log_softmax(arr) {\r\n // Compute the softmax values\r\n const softmaxArr = softmax(arr);\r\n\r\n // Apply log formula to each element\r\n const logSoftmaxArr = softmaxArr.map(x => Math.log(x));\r\n\r\n return logSoftmaxArr;\r\n}\r\n\r\n/**\r\n * Escapes regular expression special characters from a string by replacing them with their escaped counterparts.\r\n *\r\n * @param {string} string - The string to escape.\r\n * @returns {string} - The escaped string.\r\n */\r\nfunction escapeRegExp(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\r\n}\r\n\r\n/**\r\n * Get the top k items from an iterable, sorted by descending order\r\n *\r\n * @param {Array} items - The items to be sorted\r\n * @param {number} [top_k=0] - The number of top items to return (default: 0 = return all)\r\n * @returns {Array} - The top k items, sorted by descending order\r\n */\r\nfunction getTopItems(items, top_k = 0) {\r\n // if top == 0, return all\r\n\r\n items = Array.from(items)\r\n .map((x, i) => [i, x]) // Get indices ([index, score])\r\n .sort((a, b) => b[1] - a[1]) // Sort by log probabilities\r\n\r\n if (top_k > 0) {\r\n items = items.slice(0, top_k); // Get top k items\r\n }\r\n\r\n return items\r\n}\r\n\r\n/**\r\n * Calculates the dot product of two arrays.\r\n * @param {number[]} arr1 - The first array.\r\n * @param {number[]} arr2 - The second array.\r\n * @returns {number} - The dot product of arr1 and arr2.\r\n */\r\nfunction dot(arr1, arr2) {\r\n return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);\r\n}\r\n\r\n/**\r\n * Computes the cosine similarity between two arrays.\r\n *\r\n * @param {number[]} arr1 - The first array.\r\n * @param {number[]} arr2 - The second array.\r\n * @returns {number} The cosine similarity between the two arrays.\r\n */\r\nfunction cos_sim(arr1, arr2) {\r\n // Calculate dot product of the two arrays\r\n const dotProduct = dot(arr1, arr2);\r\n\r\n // Calculate the magnitude of the first array\r\n const magnitudeA = magnitude(arr1);\r\n\r\n // Calculate the magnitude of the second array\r\n const magnitudeB = magnitude(arr2);\r\n\r\n // Calculate the cosine similarity\r\n const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB);\r\n\r\n return cosineSimilarity;\r\n}\r\n\r\n/**\r\n * Calculates the magnitude of a given array.\r\n * @param {number[]} arr - The array to calculate the magnitude of.\r\n * @returns {number} The magnitude of the array.\r\n */\r\nfunction magnitude(arr) {\r\n return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0));\r\n}\r\n\r\n/**\r\n * A base class for creating callable objects.\r\n *\r\n * @extends Function\r\n */\r\nclass Callable extends Function {\r\n /**\r\n * Creates a new instance of the Callable class.\r\n */\r\n constructor() {\r\n super();\r\n /**\r\n * Creates a closure that delegates to a private method '_call' with the given arguments.\r\n *\r\n * @param {...any} args - Zero or more arguments to pass to the '_call' method.\r\n * @returns {*} - The result of calling the '_call' method.\r\n */\r\n let closure = function (...args) {\r\n // @ts-ignore\r\n return closure._call(...args)\r\n }\r\n return Object.setPrototypeOf(closure, new.target.prototype)\r\n }\r\n\r\n /**\r\n * This method should be implemented in subclasses to provide the\r\n * functionality of the callable object.\r\n *\r\n * @throws {Error} Must implement _call method in subclass\r\n * @param {...*} args\r\n */\r\n _call(...args) {\r\n throw Error('Must implement _call method in subclass')\r\n }\r\n}\r\n\r\n/**\r\n * Returns the minimum item.\r\n * @param {number[]} arr - array of numbers.\r\n * @returns {number} - the minimum number.\r\n * @throws {Error} If array is empty.\r\n */\r\nfunction min(arr) {\r\n if (arr.length === 0) throw Error('Array must not be empty');\r\n let min = arr[0];\r\n for (let i = 1; i < arr.length; ++i) {\r\n if (arr[i] < min) {\r\n min = arr[i];\r\n }\r\n }\r\n return min;\r\n}\r\n\r\n\r\n/**\r\n * Returns the maximum item.\r\n * @param {number[]} arr - array of numbers.\r\n * @returns {number} - the maximum number.\r\n * @throws {Error} If array is empty.\r\n */\r\nfunction max(arr) {\r\n if (arr.length === 0) throw Error('Array must not be empty');\r\n let max = arr[0];\r\n for (let i = 1; i < arr.length; ++i) {\r\n if (arr[i] > max) {\r\n max = arr[i];\r\n }\r\n }\r\n return max;\r\n}\r\n\r\n/**\r\n * Check if a value is a string.\r\n * @param {*} text - The value to check.\r\n * @returns {boolean} - True if the value is a string, false otherwise.\r\n */\r\nfunction isString(text) {\r\n return typeof text === 'string' || text instanceof String\r\n}\r\n\r\n/**\r\n * Check if a value is an integer.\r\n * @param {*} x - The value to check.\r\n * @returns {boolean} - True if the value is a string, false otherwise.\r\n */\r\nfunction isIntegralNumber(x) {\r\n return Number.isInteger(x) || typeof x === 'bigint'\r\n}\r\n\r\n/**\r\n * Check if a value is exists.\r\n * @param {*} x - The value to check.\r\n * @returns {boolean} - True if the value exists, false otherwise.\r\n */\r\nfunction exists(x) {\r\n return x !== undefined && x !== null;\r\n}\r\n\r\nmodule.exports = {\r\n Callable,\r\n getModelFile,\r\n dispatchCallback,\r\n fetchJSON,\r\n pathJoin,\r\n reverseDictionary,\r\n indexOfMax,\r\n softmax,\r\n log_softmax,\r\n escapeRegExp,\r\n getTopItems,\r\n dot,\r\n cos_sim,\r\n magnitude,\r\n getFile,\r\n isIntegralNumber,\r\n isString,\r\n exists,\r\n min,\r\n max,\r\n};\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/transformers.js\");\n"],"names":["backends","backendsSortedByPriority","registerBackend","name","backend","priority","init","createSessionHandler","TypeError","currentBackend","undefined","Error","i","indexOf","splice","length","push","resolveBackend","async","backendHints","backendNames","errors","backendName","backendInfo","initialized","aborted","isInitializing","initPromise","e","err","map","join","EnvImpl","constructor","this","wasm","webgl","logLevelInternal","logLevel","value","env","InferenceSession","handler","feeds","arg1","arg2","fetches","options","Tensor","Array","isArray","isFetchesEmpty","outputNames","RangeError","isFetches","arg1Keys","Object","getOwnPropertyNames","v","inputNames","results","run","returnValue","key","hasOwnProperty","call","type","data","dims","static","arg0","arg3","filePathOrUint8Array","Uint8Array","ArrayBuffer","SharedArrayBuffer","buffer","byteOffset","byteLength","Number","isSafeInteger","executionProviders","startProfiling","endProfiling","isBigInt64ArrayAvailable","BigInt64Array","from","isBigUint64ArrayAvailable","BigUint64Array","NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP","Map","Float32Array","Int8Array","Uint16Array","Int16Array","Int32Array","Float64Array","Uint32Array","NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP","set","typedArrayConstructor","get","firstElementType","mappedType","size","dim","calculateSize","height","width","norm","normMean","normBias","mean","bias","inputformat","bitmapFormat","outputformat","tensorFormat","offset","float32Data","step","rImagePointer","gImagePointer","bImagePointer","aImagePointer","rTensorPointer","gTensorPointer","bTensorPointer","aTensorPointer","image","isHTMLImageEle","HTMLImageElement","isImageDataEle","ImageData","isImageBitmap","ImageBitmap","isURL","String","tensorConfig","canvas","document","createElement","pixels2DContext","getContext","naturalHeight","naturalWidth","resizedHeight","resizedWidth","drawImage","getImageData","bufferToTensor","Promise","resolve","reject","context","newImage","Image","crossOrigin","src","onload","img","format","tempCanvas","putImageData","toImageData","_a","_b","channels","createImageData","reshape","self","__WEBPACK_EXTERNAL_MODULE__1670__","__webpack_modules__","t","n","_scriptDir","r","currentScript","$","C","H","F","N","L","o","R","a","j","s","u","c","ready","l","p","f","d","h","g","b","assign","m","y","_","window","importScripts","w","process","versions","node","x","ENVIRONMENT_IS_PTHREAD","T","S","locateFile","dirname","normalize","readFileSync","readFile","argv","replace","slice","on","ut","J","exitCode","P","exit","inspect","console","error","Worker","location","href","substr","lastIndexOf","XMLHttpRequest","open","send","responseText","responseType","response","status","onerror","performance","O","log","bind","A","warn","writeSync","E","I","print","printErr","thisProgram","quit","wasmBinary","D","noExitRuntime","WebAssembly","it","k","M","U","TextDecoder","V","decode","subarray","fromCharCode","B","z","charCodeAt","G","HEAP8","HEAP16","HEAP32","HEAPU8","HEAPU16","HEAPU32","HEAPF32","HEAPF64","W","INITIAL_MEMORY","wasmMemory","Memory","initial","maximum","shared","q","X","Y","K","Z","Q","preRun","shift","unshift","tt","et","nt","rt","postMessage","cmd","arg","onAbort","RuntimeError","ot","startsWith","at","st","message","ct","dt","Vb","mc","lt","Cc","ac","Ub","start_routine","Ic","zc","pthread_ptr","$b","time","now","Nc","loaded","pt","qt","oc","onExit","ft","bt","me","ht","be","re","ie","Yb","qc","fc","Ec","Pc","receiveObjectTransfer","Gc","threadInitTLS","pc","setExitStatus","nc","values","terminate","xe","forEach","Fc","onmessage","Bc","targetThread","de","Qc","transferList","Vt","queue","thread","threadId","text","alert","target","filename","lineno","urlOrBlob","mainScriptUrlOrBlob","wasmModule","yc","pop","PThread","establishStackSpace","Oe","Ee","mt","yt","invokeEntryPoint","Te","_t","vt","wt","xt","Tt","St","Zb","Sb","xc","bc","wc","Dc","rc","hc","uc","ic","kc","cc","sc","Atomics","add","Hc","sub","tc","vc","De","Ot","ge","At","Et","Oc","It","Pt","Dt","$t","kt","Ct","Ft","Nt","Lt","Rt","jt","Mt","Ut","store","we","compareExchange","Bt","zt","Gt","Ht","he","Wt","toTimeString","match","Date","getFullYear","getTimezoneOffset","Math","max","arguments","Ae","gt","Ie","ve","executeNotifiedProxyingQueue","hrtime","__performance_now_clock_drift","Xt","Yt","Kt","Zt","USER","LOGNAME","PATH","PWD","HOME","LANG","navigator","languages","Jt","Qt","te","ee","ne","oe","ae","se","ue","ce","le","toString","getMonth","getDate","getDay","Wb","Xb","getTime","setDate","setMonth","setFullYear","Lc","Kc","dc","jc","ec","Tb","Rc","Jc","Mc","RegExp","split","substring","floor","abs","includes","pe","fe","ma","Se","prototype","Pe","pa","Fa","ye","xa","Ma","ua","wa","oa","Ka","Ca","Ja","va","sa","La","ta","Ta","Ua","ya","Oa","za","setTimeout","Ea","Pa","getUTCSeconds","getUTCMinutes","getUTCHours","getUTCDate","getUTCMonth","getUTCFullYear","getUTCDay","UTC","Qa","getSeconds","getMinutes","getHours","min","Ra","setTime","Aa","Ba","Sa","Ac","ra","Ia","copyWithin","cpus","hardwareConcurrency","Da","apply","qa","grow","Na","Ga","Ha","ga","na","lc","crypto","getRandomValues","code","randomBytes","ia","ja","aa","Me","ke","Ue","ca","Re","$e","ba","je","Ce","ha","ka","fa","Fe","da","Le","ea","Ne","la","asm","exports","sb","ub","Va","monitorRunDependencies","clearInterval","instance","module","fetch","credentials","then","ok","arrayBuffer","catch","instantiate","instantiateWasm","instantiateStreaming","___wasm_call_ctors","_OrtInit","Wa","_OrtCreateSessionOptions","Xa","_OrtAppendExecutionProvider","Ya","_OrtAddSessionConfigEntry","Za","_OrtReleaseSessionOptions","_OrtCreateSession","$a","_OrtReleaseSession","ab","_OrtGetInputCount","bb","_OrtGetOutputCount","cb","_OrtGetInputName","db","_OrtGetOutputName","eb","_OrtFree","fb","_OrtCreateTensor","gb","_OrtGetTensorData","hb","_OrtReleaseTensor","ib","_OrtCreateRunOptions","jb","_OrtAddRunConfigEntry","kb","_OrtReleaseRunOptions","lb","_OrtRun","mb","_OrtEndProfiling","nb","_pthread_self","ob","_malloc","pb","_free","qb","_fflush","rb","__emscripten_tls_init","___funcs_on_exit","tb","__emscripten_thread_init","vb","__emscripten_thread_crashed","wb","_e","_emscripten_run_in_main_runtime_thread_js","xb","__emscripten_proxy_execute_task_queue","yb","__emscripten_thread_free_data","zb","__emscripten_thread_exit","Ab","_setThrew","Bb","_emscripten_stack_set_limits","Cb","stackSave","Db","stackRestore","Eb","stackAlloc","Fb","___cxa_can_catch","Gb","___cxa_is_pointer_type","Hb","dynCall_j","Ib","dynCall_iiiiij","Jb","dynCall_jii","Kb","dynCall_viiiiij","Lb","dynCall_vjji","Mb","dynCall_viiijjjii","Nb","dynCall_iij","Ob","dynCall_ji","Pb","dynCall_iiiiiij","Qb","dynCall_iiij","Rb","Ve","calledRun","onRuntimeInitialized","postRun","setStatus","UTF8ToString","stringToUTF8","lengthBytesUTF8","keepRuntimeAlive","ExitStatus","preInit","charAt","ceil","encode","test","_listeners","fn","ctx","off","emit","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","isNaN","round","LN2","pow","NaN","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","inquire","moduleName","mod","eval","keys","read","write","__esModule","EMPTY","isGuid","validator","create","gen","createEmpty","parse","raw","random","equals","isEmpty","toJSON","Guid","Instance","Module","low","high","unsigned","__isLong__","defineProperty","isLong","neg","fromInt","fromNumber","fromBits","parseInt","mul","fromString","fromValue","ZERO","UZERO","ONE","UONE","NEG_ONE","MAX_VALUE","MAX_UNSIGNED_VALUE","MIN_VALUE","toInt","toNumber","isZero","isNegative","eq","div","getHighBits","getHighBitsUnsigned","getLowBits","getLowBitsUnsigned","getNumBitsAbs","eqz","isPositive","isOdd","isEven","notEquals","neq","lessThan","comp","lessThanOrEqual","lte","greaterThan","greaterThanOrEqual","gte","compare","negate","not","subtract","multiply","get_high","divide","div_u","div_s","toUnsigned","shru","shr","shl","modulo","rem_u","rem_s","rem","and","or","xor","shiftLeft","shiftRight","shiftRightUnsigned","shr_u","toSigned","toBytes","toBytesLE","toBytesBE","fromBytes","fromBytesLE","fromBytesBE","Reader","Writer","util","roots","default","onnx","Version","AttributeProto","floats","ints","strings","tensors","graphs","refAttrName","docString","Long","newBuffer","emptyArray","uint32","string","float","int64","bytes","TensorProto","fork","ldelim","GraphProto","int32","encodeDelimited","len","pos","skipType","decodeDelimited","verify","isString","isInteger","fromObject","LongBits","base64","toObject","arrays","defaults","longs","enums","json","isFinite","AttributeType","toJSONOptions","ValueInfoProto","TypeProto","NodeProto","input","output","attribute","opType","domain","ModelProto","opsetImport","metadataProps","irVersion","producerName","producerVersion","modelVersion","graph","OperatorSetIdProto","StringStringEntryProto","TensorAnnotation","quantParameterTensorNames","tensorName","initializer","valueInfo","quantizationAnnotation","floatData","int32Data","stringData","int64Data","externalData","doubleData","uint64Data","dataType","segment","rawData","dataLocation","Segment","double","uint64","DataLocation","DataType","begin","end","TensorShapeProto","Dimension","dimValue","dimParam","denotation","oneOfGetter","oneOfSetter","oneofs","tensorType","elemType","shape","version","_configure","BufferWriter","BufferReader","build","rpc","configure","utf8","buf","Buffer","isBuffer","lo","hi","_slice","sint32","bool","fixed32","sfixed32","skip","merge","sint64","zzDecode","fixed64","sfixed64","utf8Slice","Service","EventEmitter","rpcImpl","requestDelimited","Boolean","responseDelimited","rpcCall","asPromise","finish","zero","zzEncode","zeroHash","toLong","fromHash","toHash","captureStackTrace","stack","pool","isNode","global","freeze","emptyObject","isObject","isset","isSet","utf8Write","_Buffer_from","_Buffer_allocUnsafe","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","lcFirst","toLowerCase","newError","ProtocolError","allocUnsafe","next","val","head","tail","states","alloc","_push","reset","writeBytesBuffer","copy","Session","loadModel","OnnxjsSessionHandler","c8","rX","initTimeout","simd","proxy","numThreads","initWasm","OnnxruntimeWebAssemblySessionHandler","__createBinding","getOwnPropertyDescriptor","writable","configurable","enumerable","__exportStar","createAttributeWithCacheKey","cacheKey","_cacheKey","sort","Attribute","onnxruntime","experimental","fbs","_attributes","getValue","getType","delete","getFloat","getInt","getString","getTensor","getFloats","getInts","getStrings","getTensors","FLOAT","INT","STRING","TENSOR","FLOATS","INTS","STRINGS","TENSORS","GRAPH","GRAPHS","getValueNoCheck","LongUtil","longToNumber","fromProto","fromOrtTensor","decodeUtf8String","getValueNoCheckFromOnnxFormat","getValueNoCheckFromOrtFormat","floatsArray","intsLength","stringsLength","tensorsLength","initialize","dispose","WebGLBackend","contextId","matmulMaxBatchSize","textureCacheMode","pack","glContext","createWebGLContext","Logger","setWithEnv","verbose","warning","WebGLSessionHandler","CoordsGlslLib","GlslLib","super","getFunctions","offsetToCoords","coordsToOffset","toVec","valueFrom","getCommonUtilFuncs","getInputsSamplingSnippets","getOutputSamplingSnippet","getCustomTypes","GlslLibRoutine","outputTextureLayout","isPacked","getPackedOutputSamplingSnippet","getUnpackedOutputSamplingSnippet","unpackedShape","getOutputScalarCoords","getOutputPacked1DCoords","getOutputPacked2DCoords","getOutputPacked3DCoords","getOutputPackedNDCoords","getGlsl","floatTextureSetRGBA","getOutputUnpacked1DCoords","getOutputUnpacked2DCoords","getOutputUnpacked3DCoords","getOutputUnpacked4DCoords","getOutputUnpacked5DCoords","getOutputUnpacked6DCoords","floatTextureSetR","ArrayUtil","arraysEqual","texture2D","programInfo","inputTextureLayouts","generateShaderFuncNameFromInputSamplerName","getPackedSamplerFromInput","getUnpackedSamplerFromInput","generateShaderFuncNameFromInputSamplerNameAtOutCoords","getPackedSamplerAtOutputCoords","getUnpackedSamplerAtOutputCoords","BroadcastUtil","getBroadcastDims","getCoordsDataType","getGlChannels","ShapeUtil","getPackedSamplerScalar","getPackedSampler1D","getPackedSampler2D","getPackedSampler3D","getPackedSamplerND","getUnpackedSamplerScalar","getUnpackedSampler1D","getUnpackedSampler2D","getUnpackedSampler3D","getUnpackedSampler4D","getUnpackedSampler5D","getUnpackedSampler6D","squeezeInputShape","JSON","stringify","routineBody","getSqueezedParams","dependencies","newShape","keptDims","squeezeShape","reverse","strides","getValueFromSingle","getPackedValueFrom","TopologicalSortGlslRoutines","GlslLibRoutineNode","GlslContext","FunctionType","ValueBased","Positional","addDependency","Set","createOrderedNodes","dfsTraverse","has","EncodingGlslLib","encodeFloat32","decodeFloat32","encodeUint8","isLittleEndian","decodeUint8","FragColorGlslLib","setFragColor","getColorAsFloat","replaceInlines","exec","trim","filter","params","body","GlslPreprocessor","libs","glslLibRoutineDependencyGraph","glslRegistry","preprocess","shaderSource","hasMain","getDefaultFragShaderMain","getFragShaderPreamble","getUniforms","variables","getImports","selectGlslLibRoutinesToBeIncluded","returnOrderedNodes","arrayLength","encoding","fragcolor","vec","VecGlslLib","shapeUtils","ShapeUtilsGlslLib","coordinates","bcastIndex","bcastMatmulIndex","offsetToIndices","indicesToOffset","incrementIndices","indexToOffsetSingle","offsetToIndicesSingle","getVertexShaderSource","varyingVertex","varyingFrag","outputDeclaration","binaryVecFunctions","copyVec","setVecItem","getVecItem","WebGLInferenceHandler","session","packedTextureDataCache","unpackedTextureDataCache","calculateTextureWidthAndHeight","layoutStrategy","executeProgram","inputTypes","getOrCreateTextureData","cacheHint","programManager","getArtifact","createTextureLayoutFromTextureType","textureType","createTextureData","setArtifact","runProgram","tensor","TextureType","packed","getTextureData","dataId","unpack","packedLastDimension","numberData","createTextureLayoutFromShape","reverseWH","createTextureDataFromLayoutBindTensor","textureManager","createTextureFromLayout","createTextureDataFromTexture","reshapeUnpacked","unpacked","computeStrides","texture","reshapePacked","isReshapeCheap","processDims3D","createPackedReshape3DProgramInfoLoader","cast","readTexture","readTextureAsync","setTextureData","isInitializer","isTextureLayoutCached","clearActiveTextures","releaseTexture","isFloat32DownloadSupported","readUint8TextureAsFloat","encodeAsUint8","createPackProgramInfoLoader","createUnpackProgramInfoLoader","__setModuleDefault","__importStar","WEBGL_OP_RESOLVE_RULES","acos","asin","atan","averagePool","parseAveragePoolAttributes","batchNormalization","parseBatchNormalizationAttributes","parseCastAttributes","clip","parseClipAttributes","clipV11","concat","parseConcatAttributes","conv","parseConvAttributes","convTranspose","parseConvTransposeAttributes","cos","identity","depthToSpace","parseDepthToSpaceAttributes","equal","elu","parseEluAttributes","exp","flatten","parseFlattenAttributes","gather","parseGatherAttributes","gemm","parseGemmAttributesV7","parseGemmAttributesV11","globalAveragePool","parseGlobalAveragePoolAttributes","globalMaxPool","greater","imageScaler","parseImageScalerAttributes","instanceNormalization","parseInstanceNormalizationAttributes","leakyRelu","parseLeakyReluAttributes","less","matMul","parseMatMulAttributes","maxPool","parseMaxPoolAttributes","padV2","parsePadAttributesV2","padV11","parsePadAttributesV11","pRelu","reduceLogSum","parseReduceAttributes","reduceMax","reduceMean","reduceMin","reduceProd","reduceSum","reduceLogSumSquare","relu","resize","parseResizeAttributesV10","parseResizeAttributesV11","sigmoid","sin","sliceV10","parseSliceAttributes","softmax","parseSoftmaxAttributes","softmaxV13","parseSoftmaxAttributesV13","parseSplitAttributes","sqrt","squeeze","parseSqueezeAttributes","squeezeV13","sum","tan","tanh","tile","transpose","parseTransposeAttributes","upsample","parseUpsampleAttributesV7","parseUpsampleAttributesV9","unsqueeze","parseUnsqueezeAttributes","unsqueezeV13","attributes","epsilon","momentum","spatial","glslPRelu","glslPow","glslXor","glslOr","glslAnd","glslLess","glslGreater","glslEqual","glslSub","glslMul","glslDiv","glslAdd","areEqual","calcShape","ProtoUtil","tensorDataTypeFromProto","createPackedConcatProgramInfoLoader","fill","getChannels","unpackFromChannel","axis","createUnpackedGroupedConvProgramInfoLoader","group","autoPad","dilations","kernelShape","pads","calculateOutputShape","activationFunction","applyActivation","getActivationSnippet","conv2DPacked","conv2DPackedPointwise","createPackedMatmulProgramInfoLoader","createPackedIm2ColProgramInfoLoader","outputShape","outputPadding","parseInternalActivationAttributes","createMatmulProgramInfoLoader","createIm2ColProgramInfoLoader","createDotProductProgramInfoLoader","PoolConvUtil","adjustPadsBasedOnAutoPad","blocksize","mode","perm","activationCacheKey","calculateIm2ColDims","flattenShape","activation","glslRelu","glslSigmoid","glslClip","clipMin","clipMax","MIN_CLIP","MAX_CLIP","normalizeAxis","NUMBER_TYPES","transA","transB","alpha","beta","isOptionalC","GemmUtil","getShapeOfGemmResult","scale","getBiasForMatmul","unpackedReversed","getVecChannels","integerData","padShape","ceilMode","countIncludePad","storageOrder","adjustPoolAttributes","computePoolOutputShape","reduce","axes","keepDims","normalizeAxes","calculateReshapedDims","validateInputs","parseUpsampleAttributes","every","coordinateTransformMode","scales","scalesInputIdx","sizesInputIdx","isResize","scalesValidation","starts","ends","some","sizeToDimension","sizeFromDimension","outputs","numOutputs","SplitUtil","splitShape","sortBasedOnPerm","downloadUint8AsFloat","glslTanh","glslTan","glslSqrt","glslSin","glslNot","glslNeg","glslLog","glslLeakyRelu","glslIdentity","glslFloor","glslExp","glslElu","glslCos","glslCeil","glslAtan","glslAsin","glslAcos","glslAbs","createUnpackProgramInfo","unsqueezeShape","inputs","opset","extrapolationValue","useExtrapolation","needRoiInput","nearestMode","cubicCoefficientA","excludeOutside","useNearest2xOptimization","roiInputIdx","ProgramManager","profiler","textureLayoutStrategy","repo","attributesBound","event","gl","program","useProgram","bindOutput","bindAttributes","attribLocations","bindUniforms","uniformLocations","draw","vertexShader","deleteShader","deleteProgram","compile","getUniformLocations","getAttribLocations","compileShader","VERTEX_SHADER","debug","FRAGMENT_SHADER","createProgram","attachFramebuffer","position","textureCoord","setVertexAttributes","find","bindTexture","uniform1fv","uniform1f","uniform1iv","uniform1i","bindTextureToUniform","getAttribLocation","getUniformLocation","PreferLogicalStrategy","maxTextureSize","TextureManager","reuseTextures","pack2unpackMap","unpack2packMap","createInferenceHandler","onGraphInitialized","getValues","initializers","addInitializer","resolveOperator","impl","opImpl","opInit","Uint8DataEncoder","RGBAFloatDataEncoder","RedFloat32DataEncoder","internalFormat","R32F","RED","channelSize","RGBA32F","RGBA","allocate","ALPHA","UNSIGNED_BYTE","getBatchDim","sizeToSquarishShape","getRowsCols","sizeFromShape","isInt","parseAxisParam","AlwaysKeepOriginalSizeStrategy","assert","computeTextureWH","breakAxis","computeTexture","reversedWH","config","pendingRead","inUseTextures","idleTextures","textureLookup","toEncoderType","getEncoder","updateTexture","toTextureData","allocateTexture","toTensorData","createAndWaitForFence","deleteTexture","repeatedTry","getPackedShape","toUpperCase","createNewWebGLContext","OffscreenCanvas","depth","antialias","stencil","preserveDrawingBuffer","premultipliedAlpha","failIfMajorPerformanceCaveat","WebGLContext","webgl2","isContextLost","disable","DEPTH_TEST","STENCIL_TEST","BLEND","DITHER","POLYGON_OFFSET_FILL","SAMPLE_COVERAGE","enable","SCISSOR_TEST","CULL_FACE","cullFace","BACK","linearSearchLastTrue","frameBufferBound","itemsToPoll","getExtensions","vertexbuffer","createVertexbuffer","framebuffer","createFramebuffer","queryVitalParameters","createTexture","TEXTURE_2D","texParameteri","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","texImage2D","checkError","texSubImage2D","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","viewport","scissor","readPixels","isFramebufferReady","getActiveTexture","getParameter","ACTIVE_TEXTURE","TEXTURE0","getTextureBinding","TEXTURE_BINDING_2D","getFramebufferBinding","FRAMEBUFFER_BINDING","vertexAttribPointer","enableVertexAttribArray","attachShader","linkProgram","createShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","activeTexture","drawArrays","TRIANGLE_STRIP","getError","NO_ERROR","INVALID_ENUM","INVALID_VALUE","INVALID_OPERATION","INVALID_FRAMEBUFFER_OPERATION","OUT_OF_MEMORY","CONTEXT_LOST_WEBGL","isRenderFloat32Supported","textureHalfFloatExtension","HALF_FLOAT_OES","maxTextureImageUnits","disposed","deleteFramebuffer","bindBuffer","ARRAY_BUFFER","deleteBuffer","ELEMENT_ARRAY_BUFFER","createDefaultGeometry","createBuffer","bufferData","STATIC_DRAW","isFloatTextureAttachableToFrameBuffer","checkFloatTextureAttachableToFrameBuffer","checkRenderFloat32","checkFloat32Download","isBlendSupported","checkFloat32Blend","MAX_TEXTURE_SIZE","MAX_TEXTURE_IMAGE_UNITS","colorBufferFloatExtension","getExtension","disjointTimerQueryWebgl2Extension","textureFloatExtension","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","POINTS","beginTimer","createQuery","beginQuery","TIME_ELAPSED_EXT","endTimer","endQuery","isTimerResultAvailable","getQueryParameter","QUERY_RESULT_AVAILABLE","GPU_DISJOINT_EXT","getTimerResult","QUERY_RESULT","deleteQuery","createFence","pollFence","fenceSync","SYNC_GPU_COMMANDS_COMPLETE","flush","clientWaitSync","ALREADY_SIGNALED","CONDITION_SATISFIED","query","isFencePassed","addItemToPoll","pollItems","isDoneFn","resolveFn","ExecutionPlan","op","getNodes","_ops","_starter","_values","getInputIndices","to","getOutputIndices","getData","Graph","_from","_to","tensorValueTypeFromProto","Node","tensorAttributesFromORTFormat","executeNode","buildGraph","transformGraph","checkIsAcyclic","_allInputIndices","getInputNames","_allInputNames","_allOutputIndices","getOutputNames","_allOutputNames","_allData","_nodes","buildGraphFromOnnxFormat","buildGraphFromOrtFormat","tensorDimsFromProto","inputsLength","nodeArgsLength","nodeArgs","valueType","TypeInfoValue","tensor_type","TensorTypeAndShape","dimLength","initializersLength","tensorDimsFromORTFormat","outputsLength","nodes","nodesLength","attributesLength","removeAllIdentityNodes","removeAllDropoutNodes","fuseConvActivationNodes","finalizeGraph","deleteNode","isActivation","Profiler","info","fatal","none","color","provider","minimalSeverity","logDateTime","logSourceLocation","toISOString","category","startTime","endCallback","timer","waitForQueryAndGetTime","endTime","maxNumberEvents","flushBatchSize","flushIntervalInMilliseconds","_started","_flushPointer","_maxNumberEvents","_flushBatchSize","_flushIntervalInMilliseconds","start","_timingEvents","_flushTime","stop","logOneEvent","endSync","checkTimer","toFixed","started","Model","load","loadFromOnnxFormat","loadFromOrtFormat","_opsets","_graph","flatbuffers","ByteBuffer","getRootAsInferenceSession","model","opsetImportLength","opsets","FLOAT_TYPES","INT_TYPES","endsWith","UNDEFINED","SPARSE_TENSOR","SPARSE_TENSORS","UNKNOWN","VALUE","PARAM","DimensionValueType","UINT8","INT8","UINT16","INT16","INT32","INT64","BOOL","FLOAT16","DOUBLE","UINT32","UINT64","COMPLEX64","COMPLEX128","BFLOAT16","TensorDataType","Primitive","Fused","NodeType","NONE","sequence_type","map_type","bb_pos","__init","readInt32","setPosition","SIZE_PREFIX_LENGTH","__offset","__indirect","__vector","__vector_len","startObject","addFieldOffset","startVector","addOffset","endVector","endObject","startShape","addDim","endShape","Shape","DimensionValue","__string","startDimension","addValue","addDenotation","endDimension","dimType","readInt8","readInt64","createLong","addFieldInt8","addFieldInt64","startDimensionValue","addDimType","addDimValue","addDimParam","endDimensionValue","addFieldInt32","startTensorTypeAndShape","addElemType","addShape","endTensorTypeAndShape","keyType","TypeInfo","startMapType","addKeyType","addValueType","endMapType","MapType","startSequenceType","endSequenceType","SequenceType","EdgeEnd","nodeIndex","readUint32","srcArgIndex","dstArgIndex","prep","writeInt32","inputEdges","inputEdgesLength","outputEdges","outputEdgesLength","startNodeEdge","addNodeIndex","addInputEdges","addOutputEdges","endNodeEdge","NodeEdge","sinceVersion","index","executionProviderType","inputArgCounts","inputArgCountsLength","inputArgCountsArray","implicitInputs","implicitInputsLength","addInt32","startNode","addName","addDocString","addDomain","addSinceVersion","addIndex","addOpType","addType","addExecutionProviderType","addInputs","addOutputs","addAttributes","addInputArgCounts","addImplicitInputs","endNode","startValueInfo","endValueInfo","ValueInfo","readUint8","__union","startTypeInfo","endTypeInfo","startOperatorSetId","addVersion","endOperatorSetId","OperatorSetId","dimsLength","rawDataLength","rawDataArray","stringDataLength","addInt64","addInt8","startTensor","addDims","addDataType","addRawData","addStringData","endTensor","indices","startSparseTensor","addValues","addIndices","endSparseTensor","SparseTensor","readFloat32","floatsLength","graphsLength","addFieldFloat32","addFloat32","startAttribute","addF","addI","addS","addT","addG","addFloats","addInts","addStrings","addTensors","addGraphs","endAttribute","maxNodeIndex","nodeEdges","nodeEdgesLength","sparseInitializers","sparseInitializersLength","startGraph","addInitializers","addNodeArgs","addNodes","addMaxNodeIndex","addNodeEdges","addSparseInitializers","endGraph","graphDocString","startModel","addIrVersion","addOpsetImport","addProducerName","addProducerVersion","addModelVersion","addGraph","addGraphDocString","endModel","nodeIndices","nodeIndicesLength","nodeIndicesArray","kernelDefHashes","readUint64","kernelDefHashesLength","startKernelCreateInfos","addNodeIndices","addKernelDefHashes","endKernelCreateInfos","KernelCreateInfos","graphId","sessionState","SessionState","requiredField","startSubGraphSessionState","addGraphId","addSessionState","endSubGraphSessionState","SubGraphSessionState","kernels","subGraphSessionStates","subGraphSessionStatesLength","startSessionState","addKernels","addSubGraphSessionStates","endSessionState","__has_identifier","ortVersion","startInferenceSession","addOrtVersion","addModel","endInferenceSession","_initialized","backendHint","graphInputTypes","graphInputDims","_model","sessionHandler","promisify","isView","initializeOps","_executionPlan","normalizeAndValidateInputs","execute","createOutput","validateInputTensorDims","validateInputTensorTypes","compareTensorDims","__importDefault","cache","dataProvider","asyncDataProvider","_strides","validateDimsAndCalcSize","DataView","getUint8","getInt8","getUint16","getInt16","getFloat32","getInt32","getUint32","getFloat64","ReduceUtil","MathUtil","arrayCopyHelper","MatMulUtil","checkInputsShape","calcMatMulShape","fillIndex","isValidBroadcast","getSizeFromDimensionRange","determineSplit","calcReduceShape","calcReduceByAxis","adjustPadAndReturnShape","computeShapeHelper","iterateExtraOptions","entries","releaseSession","createSession","createSessionFinalize","createSessionAllocate","initOrt","out","wasmPaths","in","initializeWebAssembly","loggingLevel","modeldata","sessionId","inputIndices","outputIndices","extractTransferableBuffers","setRunOptions","getInstance","logSeverityLevel","logVerbosityLevel","tag","allocWasmString","extra","WeakSet","setSessionOptions","use_ort_model_bytes_directly","graphOptimizationLevel","enableCpuMemArena","enableMemPattern","executionMode","logId","enableProfiling","MessageChannel","port1","validate","Blob","URL","createObjectURL","race","terminateAllThreads","BlobBuilder","WebKitBlobBuilder","MozBlobBuilder","MSBlobBuilder","append","getBlob","webkitURL","revokeObjectURL","encodeURIComponent","Offset","Table","SIZEOF_SHORT","SIZEOF_INT","FILE_IDENTIFIER_LENGTH","Encoding","UTF8_BYTES","UTF16_STRING","float32","float64","toFloat64","Builder","space","minalign","vtable","vtable_in_use","isNested","object_start","vtables","vector_num_elems","force_defaults","clear","capacity","forceDefaults","dataBuffer","asUint8Array","growByteBuffer","pad","writeInt8","writeInt16","writeInt64","writeFloat32","writeFloat64","addInt16","addFloat64","slot","addFieldInt16","addFieldFloat64","addFieldStruct","nested","notNested","readInt16","finishSizePrefixed","createString","bytes_","position_","readUint16","readFloat64","writeUint8","writeUint16","writeUint32","writeUint64","getBufferIdentifier","__webpack_module_cache__","globalThis","Function","Symbol","toStringTag","__webpack_exports__","ONNX","fs","path","onnx_env","CACHE_AVAILABLE","FS_AVAILABLE","PATH_AVAILABLE","RUNNING_LOCALLY","DEFAULT_LOCAL_PATH","localURL","remoteModels","remoteURL","useCache","useFS","obj","_csize","table","angle","PI","power","_width","_bitrev","revShift","createComplexArray","fromComplexArray","complex","storage","res","toComplexArray","completeSpectrum","spectrum","half","transform","_transform4","realTransform","_realTransform4","inverseTransform","inv","outOff","bitrev","_singleTransform2","_singleTransform4","quarterLen","limit","Ar","Ai","Br","Bi","Cr","Ci","Dr","Di","tableBr","tableBi","MBr","MBi","tableCr","tableCi","MCr","MCi","tableDr","tableDi","MDr","MDi","T0r","T0i","T1r","T1i","T2r","T2i","T3r","T3i","evenR","evenI","oddR","oddI","step2","step3","_singleRealTransform2","_singleRealTransform4","halfLen","hquarterLen","SA","SB","Callable","exists","log_softmax","LogitsProcessorList","processors","item","extend","items","_call","input_ids","batchedLogits","logits","func","iterator","LogitsProcessor","GenerationConfig","kwargs","max_length","max_new_tokens","min_length","min_new_tokens","early_stopping","max_time","do_sample","num_beams","num_beam_groups","penalty_alpha","use_cache","temperature","top_k","top_p","typical_p","epsilon_cutoff","eta_cutoff","diversity_penalty","repetition_penalty","encoder_repetition_penalty","length_penalty","no_repeat_ngram_size","bad_words_ids","force_words_ids","renormalize_logits","constraints","forced_bos_token_id","forced_eos_token_id","remove_invalid_values","exponential_decay_length_penalty","suppress_tokens","begin_suppress_tokens","forced_decoder_ids","num_return_sequences","output_attentions","output_hidden_states","output_scores","return_dict_in_generate","pad_token_id","bos_token_id","eos_token_id","encoder_no_repeat_ngram_size","decoder_start_token_id","generation_kwargs","ForcedBOSTokenLogitsProcessor","Infinity","ForcedEOSTokenLogitsProcessor","WhisperTimeStampLogitsProcessor","generate_config","no_timestamps_token_id","timestamp_begin","begin_index","max_initial_timestamp_index","seq","last_was_timestamp","penultimate_was_timestamp","last_allowed","logprobs","ForceTokensLogitsProcessor","force_token_map","fromEntries","NoRepeatNGramLogitsProcessor","getNgrams","prevInputIds","curLen","ngrams","ngram","generatedNgram","prevNgram","prevNgramKey","prevNgramValue","getGeneratedNgrams","bannedNgrams","ngramIdx","calcBannedNgramTokens","bannedTokens","generatedNgrams","token","RepetitionPenaltyLogitsProcessor","penalty","input_id","getFile","sharp","CanvasClass","ImageDataClass","loadImageFunction","createImageBitmap","toBuffer","resolveWithObject","CustomImage","Uint8ClampedArray","_update","fromURL","url","blob","fromBlob","grayscale","newData","red","green","blue","rgb","rgba","numChannels","toCanvas","convert","fit","kernel","cloned","clone","clonedCanvas","save","mime","writeFileSync","interpolate","in_channels","in_height","in_width","out_height","out_width","align_corners","x_scale","y_scale","out_img","inStride","outStride","outOffset","x1","y1","x2","y2","w1","w2","w3","w4","yStride","xStride","idx1","idx2","idx3","idx4","cOffset","array","stride","invStride","transposedData","newIndex","getModelFile","fetchJSON","dispatchCallback","isIntegralNumber","Sampler","cat","ONNXTensor","constructSession","modelPath","fileName","progressCallback","sessionRun","prop","replaceTensors","_prepare_attention_mask","tokens","is_pad_token_in_inputs","is_pad_token_not_equal_to_eos_token_id","boolTensor","seq2seqLoadModel","all","seq2seq_forward","model_inputs","encoder_input_name","add_decoder_pkv","encoderOutputs","encoder_outputs","pastKeyValues","past_key_values","encoderFeeds","attention_mask","last_hidden_state","decoderFeeds","decoder_input_ids","encoder_hidden_states","use_cache_branch","decoder_merged_session","encoder_attention_mask","addPastKeyValues","decoderResults","getPastKeyValues","Seq2SeqLMOutput","seq2seqStartBeams","inputTokenIds","numOutputTokens","requires_attention_mask","beams","beamId","output_token_ids","done","score","id","seq2seqRunBeam","beam","input_name","toI64Tensor","forward","textgen_forward","textgenStartBeams","inputs_attention_mask","attn_mask","model_input_ids","num_output_tokens","textgenRunBeam","attnMaskData","textgenUpdatebeam","newTokenId","BigInt","PreTrainedModel","promises","modelName","is_encoder_decoder","flat","_get_logits_processor","generation_config","input_ids_seq_length","logits_processor","_get_generation_config","gen_config","maxOutputTokens","sampler","getSampler","getStartBeams","newest_beams","runBeam","extractedLogits","batch","lastLogits","sampledTokens","logProb","newBeam","updateBeam","groupBeams","callback_function","groups","pkvs","newName","hasDecoder","encoder_dims","num_encoder_heads","encoder_dim_kv","num_encoder_layers","decoder_dims","num_decoder_heads","decoder_dim_kv","num_decoder_layers","num_heads","dim_kv","num_layers","ModelOutput","BertPreTrainedModel","BertModel","BertForMaskedLM","MaskedLMOutput","BertForSequenceClassification","SequenceClassifierOutput","BertForTokenClassification","TokenClassifierOutput","BertForQuestionAnswering","QuestionAnsweringModelOutput","start_logits","end_logits","DistilBertPreTrainedModel","DistilBertModel","DistilBertForSequenceClassification","DistilBertForTokenClassification","DistilBertForQuestionAnswering","DistilBertForMaskedLM","MobileBertPreTrainedModel","MobileBertModel","MobileBertForMaskedLM","MobileBertForSequenceClassification","MobileBertForQuestionAnswering","SqueezeBertPreTrainedModel","SqueezeBertModel","SqueezeBertForMaskedLM","SqueezeBertForSequenceClassification","SqueezeBertForQuestionAnswering","AlbertPreTrainedModel","AlbertModel","AlbertForSequenceClassification","AlbertForQuestionAnswering","AlbertForMaskedLM","T5PreTrainedModel","T5Model","args","T5ForConditionalGeneration","d_kv","MT5PreTrainedModel","MT5Model","MT5ForConditionalGeneration","BartPretrainedModel","BartModel","BartForConditionalGeneration","decoder_layers","decoder_attention_heads","d_model","encoder_layers","encoder_attention_heads","BartForSequenceClassification","RobertaPreTrainedModel","RobertaModel","RobertaForMaskedLM","RobertaForSequenceClassification","RobertaForQuestionAnswering","WhisperPreTrainedModel","WhisperModel","WhisperForConditionalGeneration","return_timestamps","generate","VisionEncoderDecoderModel","decoder","n_layer","n_head","n_embd","CLIPPreTrainedModel","CLIPModel","GPT2PreTrainedModel","GPT2Model","GPT2LMHeadModel","GPTNeoPreTrainedModel","GPTNeoModel","GPTNeoForCausalLM","hidden_size","CodeGenPreTrainedModel","CodeGenModel","CodeGenForCausalLM","ViTPreTrainedModel","ViTForImageClassification","DetrPreTrainedModel","DetrForObjectDetection","DetrObjectDetectionOutput","pred_boxes","DetrForSegmentation","DetrSegmentationOutput","pred_masks","MarianPreTrainedModel","MarianModel","MarianMTModel","AutoModel","cls","MODEL_CLASS_MAPPING","model_type","AutoModelForSeq2SeqLM","AutoModelForSequenceClassification","AutoModelForTokenClassification","AutoModelForCausalLM","AutoModelForMaskedLM","AutoModelForQuestionAnswering","AutoModelForVision2Seq","AutoModelForImageClassification","AutoModelForObjectDetection","AutoModelForImageSegmentation","indexOfMax","getTopItems","cos_sim","pathJoin","dot","AutoTokenizer","AutoProcessor","Processor","transpose_data","prepareImages","images","Pipeline","task","tokenizer","texts","padding","truncation","Text2TextGenerationPipeline","_key","generate_kwargs","prefix","task_specific_params","outputTokenIds","toReturn","batch_decode","skip_special_tokens","SUPPORTED_TASKS","topk","id2label","vals","label","ignore_labels","isBatched","ids","tokenData","topScoreIndex","entity","word","scores","question","text_pair","sepIndex","sep_token_id","product","answer_tokens","answer","mask_token_index","mask_token_id","mask_token","itemLogits","sequence","token_str","vocab","stringInput","padding_side","outTokens","startText","generated_text","decoded","label2id","entailment_id","contradiction_id","candidate_labels","hypothesis_template","multi_label","hypotheses","softmaxEach","premise","entails_logits","hypothesis","scores_sorted","labels","processor","audio","sampling_rate","AudioContext","audioCTX","sampleRate","decodeAudioData","SCALING_FACTOR","left","getChannelData","right","chunk_length_s","stride_length_s","chunk_callback","force_full_sequences","single","feature_extractor","time_precision","chunk_length","max_source_positions","aud","_preprocess","chunks","jump","subarr","feature","isFirst","isLast","input_features","is_last","chunk","full_text","optional","_decode_asr","pixel_values","subtasks_mapping","panoptic","semantic","threshold","mask_threshold","overlap_mask_area_threshold","label_ids_to_fuse","target_sizes","subtask","imageSizes","annotation","processed","segmentation","segments_info","maskData","mask","label_id","text_inputs","image_inputs","logits_per_image","probs","percentage","post_process_object_detection","classes","_mean_pooling","returnedData","batchSize","seqLength","embedDim","outIndex","count","attnMaskOffset","offset2","attn","avg","_normalize","arr1","arr2","is_normalised","TASK_NAME_MAPPING","TASK_PREFIX_MAPPING","TASK_ALIASES","flatMap","pipeline","progress_callback","pipelineInfo","suffix","mapping","tokenizerClass","modelClass","pipelineClass","processorClass","from_pretrained","FFT","FeatureExtractor","ImageFeatureExtractor","image_mean","image_std","do_rescale","do_normalize","do_resize","max_size","do_center_crop","crop_size","srcWidth","srcHeight","ratio","newWidth","newHeight","downscaleFactor","pixelData","imgDims","ViTFeatureExtractor","DetrFeatureExtractor","urls","result","maskSize","pixel_mask","center_to_corners_format","centerX","centerY","out_logits","out_bbox","batch_size","num_boxes","num_classes","target_size","boxes","bbox","logit","maxIndex","box","remove_low_and_no_objects","class_logits","mask_logits","object_mask_threshold","num_labels","mask_probs_item","pred_scores_item","pred_labels_item","pred_label","pred_score","check_segment_validity","mask_labels","mask_probs","mask_k","mask_k_area","original_area","mask_exists","compute_segments","pred_scores","pred_labels","segments","bestScores","current_segment_id","pred_class","post_process_panoptic_segmentation","class_queries_logits","num_queries","post_process_instance_segmentation","WhisperFeatureExtractor","calcOffset","padReflect","padded","stft","frames","fft_size","n_fft","nextP2","log2","num_fft_bins","chirp","ichirp","buffer1","buffer2","outBuffer","outBuffer2","outBuffer3","theta","baseR","baseI","result_mod","result_arg","atan2","i2","slicedChirp","frame","j2","j3","a_real","a_imag","b_real","b_imag","o1","fram_wave","waveform","center","half_window","waveformLength","hop_length","frameStart","frameEnd","frameArray","hanning","denom","cos_vals","_extract_fbank_features","n_samples","stftData","d1","d2","magnitudes","inOffset","magnitude","mel_filters","num_mel_filters","mel_spec","mIndex","mel_filter","log_spec","maxLogSpec","clipped","log10","features","WhisperProcessor","processor_class","preprocessorConfig","feature_extractor_type","sample","getLogits","vocabSize","logs","startIndex","randomSelect","probabilities","sumProbabilities","acc","curr","BeamSearchSampler","TopKSampler","GreedySampler","topLogits","sampledIndex","logProbabilities","interpolate_data","iterLength","iterDims","iterSize","_subarray","tolist","dimensions","totalElements","dimensionSize","reshapedArray","lastArray","sigmoid_","tensorShape","total","reverseDictionary","escapeRegExp","TokenizerModel","WordPieceTokenizer","Unigram","BPE","convert_tokens_to_ids","tokens_to_ids","unk_token_id","convert_ids_to_tokens","unk_token","outputTokens","chars","isUnknown","subTokens","currentSubstring","continuing_subword_prefix","moreConfig","unk_id","bosToken","bosTokenId","eosToken","eos_token","eosTokenId","unkToken","minScore","unkScore","trie","CharTrie","populateNodes","lattice","sentence","beginPos","mblen","hasSingleNode","commonPrefixSearch","tokenId","tokenScore","insert","tokenize","normalized","TokenLattice","tokenized","BYTES_TO_UNICODE","bs","cs","ccs","UNICODE_TO_BYTES","bpe_ranks","merges","end_of_word_suffix","byte_encoder","text_encoder","TextEncoder","get_pairs","pairs","prev_char","char","bpe","bigram","first","second","new_word","final_word","byte","bpe_token_list","Normalizer","BertNormalizer","Precompiled","NormalizerSequence","Replace","NFC","NFKD","StripAccents","Lowercase","pattern","Regex","content","normalizers","fromConfig","normalizer","_tokenize_chinese_chars","cp","_is_chinese_char","stripAccents","handle_chinese_chars","lowercase","strip_accents","PreTokenizer","BertPreTokenizer","PreTokenizerSequence","WhitespaceSplit","MetaspacePreTokenizer","ByteLevelPreTokenizer","SplitPreTokenizer","pre_tokenize_text","pre_tokenize","PostProcessor","TemplateProcessing","ByteLevelPostProcessor","RobertaProcessing","post_process","tokens_pair","sep","pair","SpecialToken","Sequence","Decoder","WordPieceDecoder","MetaspaceDecoder","ByteLevelDecoder","convert_tokens_to_string","convertRegex","cleanup","byte_decoder","text_decoder","ignoreBOM","trim_offsets","add_prefix_space","byteArray","decoded_text","replaceAll","sub_texts","current_sub_text","added_tokens","addPrefixSpace","replacement","strRep","str_rep","normalizedTokens","charsmap","precompiled_charsmap","tokenizers","pretokenizers","preTokenizedText","PreTrainedTokenizer","tokenizerJSON","tokenizerConfig","pre_tokenizer","post_processor","special_tokens","all_special_ids","addedToken","special","special_tokens_regex","getToken","pad_token","sep_token","model_max_length","remove_space","__type","prepare_model_inputs","return_tensor","maxLengthOfBatch","diff","modelInputs","_encode_text","sectionTokens","tokens2","combinedTokens","clean_up_tokenization","decode_args","token_ids","decode_single","clean_up_tokenization_spaces","bert_prepare_model_inputs","token_type_ids","BertTokenizer","AlbertTokenizer","MobileBertTokenizer","SqueezeBertTokenizer","DistilBertTokenizer","T5Tokenizer","GPT2Tokenizer","BartTokenizer","RobertaTokenizer","WhisperTokenizer","sequences","return_language","last_language","new_chunk","time_offset","previous_tokens","right_stride_start","last_timestamp","first_timestamp","chunk_len","stride_left","stride_right","current_tokens","language","LANGUAGES","resolved_tokens","findLongestCommonSequence","resolved_text","rounded_time","timestamp","leftSequence","leftLength","totalSequence","rightSequence","maxIndices","rightLength","eps","leftStart","leftStop","rightStart","rightStop","matches","elem","idx","matching","leftMid","rightMid","CodeGenTokenizer","CLIPTokenizer","MarianTokenizer","languageRegex","supported_language_codes","matchInfo","remainder","root","CharTrieNode","ch","child","children","isLeaf","beginNodes","endNodes","bos","TokenLatticeNode","eos","nodeId","viterbi","rnode","prev","bestScore","bestNode","lnode","backtraceScore","piece","tokenIds","TOKENIZER_CLASS_MAPPING","tokenizer_class","moduleExports","ReadableStream","FileResponse","filePath","headers","existsSync","statusText","stats","statSync","updateContentType","controller","enqueue","close","protocol","isValidHttpUrl","file","caches","request","responseToCache","contentLength","reader","getReader","newLoaded","progress","readResponse","put","parts","part","arr","maxVal","exps","sumExps","closure","setPrototypeOf","jsonData","__webpack_require__","moduleId","cachedModule","definition"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/types/backends/onnx.d.ts b/dist/types/backends/onnx.d.ts deleted file mode 100644 index 3202e21f4..000000000 --- a/dist/types/backends/onnx.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export let ONNX: any; -export const executionProviders: string[]; diff --git a/dist/types/env.d.ts b/dist/types/env.d.ts deleted file mode 100644 index fae44ed0a..000000000 --- a/dist/types/env.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export namespace env { - export { onnx_env as onnx }; - export const remoteModels: boolean; - export const remoteURL: string; - export { localURL }; - export { CACHE_AVAILABLE as useCache }; - export { FS_AVAILABLE as useFS }; -} -declare const localURL: string; -declare const CACHE_AVAILABLE: boolean; -declare const FS_AVAILABLE: boolean; -export {}; diff --git a/dist/types/fft.d.ts b/dist/types/fft.d.ts deleted file mode 100644 index ee374657e..000000000 --- a/dist/types/fft.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -export = FFT; -/** - * FFT class provides functionality for performing Fast Fourier Transform on arrays - * Code adapted from https://www.npmjs.com/package/fft.js - */ -declare class FFT { - /** - * @param {number} size - The size of the input array. Must be a power of two and bigger than 1. - * @throws {Error} FFT size must be a power of two and bigger than 1. - */ - constructor(size: number); - size: number; - _csize: number; - table: Float64Array; - _width: number; - _bitrev: Int32Array; - /** - * Create a complex number array with size `2 * size` - * - * @returns {Float64Array} - A complex number array with size `2 * size` - */ - createComplexArray(): Float64Array; - /** - * Converts a complex number representation stored in a Float64Array to an array of real numbers. - * - * @param {Float64Array} complex - The complex number representation to be converted. - * @param {number[]} [storage] - An optional array to store the result in. - * @returns {number[]} An array of real numbers representing the input complex number representation. - */ - fromComplexArray(complex: Float64Array, storage?: number[]): number[]; - /** - * Convert a real-valued input array to a complex-valued output array. - * @param {Float64Array} input - The real-valued input array. - * @param {Float64Array} [storage] - Optional buffer to store the output array. - * @returns {Float64Array} The complex-valued output array. - */ - toComplexArray(input: Float64Array, storage?: Float64Array): Float64Array; - /** - * Completes the spectrum by adding its mirrored negative frequency components. - * @param {Float64Array} spectrum - The input spectrum. - * @returns {void} - */ - completeSpectrum(spectrum: Float64Array): void; - /** - * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer. - * - * @param {Float64Array} out - The output buffer to store the result. - * @param {Float64Array} data - The input data to transform. - * - * @throws {Error} Input and output buffers must be different. - * - * @returns {void} - */ - transform(out: Float64Array, data: Float64Array): void; - /** - * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer. - * The input buffer must contain real values only, while the output buffer will contain complex values. The input and - * output buffers must be different. - * - * @param {Float64Array} out - The output buffer. - * @param {Float64Array} data - The input buffer containing real values. - * - * @throws {Error} If the input and output buffers are the same. - */ - realTransform(out: Float64Array, data: Float64Array): void; - /** - * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`. - * The `out` array must be a different buffer than the `data` array. The `out` array will contain the - * result of the transformation. The `data` array will not be modified. - * - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {Float64Array} data - The input data to transform. - * @throws {Error} If `out` and `data` refer to the same buffer. - * @returns {void} - */ - inverseTransform(out: Float64Array, data: Float64Array): void; - /** - * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data. - * - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {Float64Array} data - The input buffer of data to be transformed. - * @param {number} inv - A scaling factor to apply to the transform. - * @returns {void} - */ - _transform4(out: Float64Array, data: Float64Array, inv: number): void; - /** - * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data. - * - * @param {Float64Array} data - The input buffer of data to be transformed. - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {number} outOff - The offset at which to write the output data. - * @param {number} off - The offset at which to begin reading the input data. - * @param {number} step - The step size for indexing the input data. - * @returns {void} - */ - _singleTransform2(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number): void; - /** - * Performs radix-4 transformation on input data of length 8 - * - * @param {Float64Array} data - Input data array of length 8 - * @param {Float64Array} out - Output data array of length 8 - * @param {number} outOff - Index of output array to start writing from - * @param {number} off - Index of input array to start reading from - * @param {number} step - Step size between elements in input array - * @param {number} inv - Scaling factor for inverse transform - * - * @returns {void} - */ - _singleTransform4(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number, inv: number): void; - /** - * Real input radix-4 implementation - * @param {Float64Array} out - Output array for the transformed data - * @param {Float64Array} data - Input array of real data to be transformed - * @param {number} inv - The scale factor used to normalize the inverse transform - */ - _realTransform4(out: Float64Array, data: Float64Array, inv: number): void; - /** - * Performs a single real input radix-2 transformation on the provided data - * - * @param {Float64Array} data - The input data array - * @param {Float64Array} out - The output data array - * @param {number} outOff - The output offset - * @param {number} off - The input offset - * @param {number} step - The step - * - * @returns {void} - */ - _singleRealTransform2(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number): void; - /** - * Computes a single real-valued transform using radix-4 algorithm. - * This method is only called for len=8. - * - * @param {Float64Array} data - The input data array. - * @param {Float64Array} out - The output data array. - * @param {number} outOff - The offset into the output array. - * @param {number} off - The offset into the input array. - * @param {number} step - The step size for the input array. - * @param {number} inv - The value of inverse. - */ - _singleRealTransform4(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number, inv: number): void; -} diff --git a/dist/types/generation.d.ts b/dist/types/generation.d.ts deleted file mode 100644 index 3a7521eaa..000000000 --- a/dist/types/generation.d.ts +++ /dev/null @@ -1,282 +0,0 @@ -/** - * Base class for processing logits. - * @extends Callable - */ -export class LogitsProcessor extends Callable { - /** - * Apply the processor to the input logits. - * - * @abstract - * @param {Array} input_ids The input ids. - * @param {Tensor} logits The logits to process. - * @throws {Error} Throws an error if `_call` is not implemented in the subclass. - */ - _call(input_ids: any[], logits: Tensor): void; -} -/** - * A class representing a list of logits processors. A logits processor is a function that modifies the logits - * output of a language model. This class provides methods for adding new processors and applying all processors to a - * batch of logits. - * - * @extends Callable - */ -export class LogitsProcessorList extends Callable { - processors: any[]; - /** - * Adds a new logits processor to the list. - * - * @param {function} item - The logits processor function to add. - */ - push(item: Function): void; - /** - * Adds multiple logits processors to the list. - * - * @param {function[]} items - The logits processor functions to add. - */ - extend(items: Function[]): void; - /** - * Applies all logits processors in the list to a batch of logits, modifying them in-place. - * - * @param {number[]} input_ids - The input IDs for the language model. - * @param {number[][]} batchedLogits - A 2D array of logits, where each row corresponds to a single - * input sequence in the batch. - */ - _call(input_ids: number[], batchedLogits: number[][]): void; - [Symbol.iterator](): IterableIterator; -} -export class GenerationConfig { - constructor(kwargs?: {}); - /** - * Create a GenerationConfig object - * @constructor - * @param {Object} [kwargs={}] - The configuration parameters - * @param {number} [kwargs.max_length=20] - The maximum length of the generated text - * @param {number} [kwargs.max_new_tokens=null] - The maximum number of new tokens to generate - * @param {number} [kwargs.min_length=0] - The minimum length of the generated text - * @param {number} [kwargs.min_new_tokens=null] - The minimum number of new tokens to generate - * @param {boolean} [kwargs.early_stopping=false] - Whether to stop generation early if a stop token is encountered - * @param {number} [kwargs.max_time=null] - The maximum amount of time to spend generating text - * @param {boolean} [kwargs.do_sample=false] - Whether to use sampling when generating text - * @param {number} [kwargs.num_beams=1] - The number of beams to use when generating text - * @param {number} [kwargs.num_beam_groups=1] - The number of beam groups to use when generating text - * @param {number} [kwargs.penalty_alpha=null] - The value of the alpha penalty to use when generating text - * @param {boolean} [kwargs.use_cache=true] - Whether to use cache when generating text - * @param {number} [kwargs.temperature=1.0] - The temperature to use when generating text - * @param {number} [kwargs.top_k=50] - The value of k to use when generating text - * @param {number} [kwargs.top_p=1.0] - The value of p to use when generating text - * @param {number} [kwargs.typical_p=1.0] - The typical value of p to use when generating text - * @param {number} [kwargs.epsilon_cutoff=0.0] - The value of epsilon cutoff to use when generating text - * @param {number} [kwargs.eta_cutoff=0.0] - The value of eta cutoff to use when generating text - * @param {number} [kwargs.diversity_penalty=0.0] - The value of diversity penalty to use when generating text - * @param {number} [kwargs.repetition_penalty=1.0] - The value of repetition penalty to use when generating text - * @param {number} [kwargs.encoder_repetition_penalty=1.0] - The value of encoder repetition penalty to use when generating text - * @param {number} [kwargs.length_penalty=1.0] - The value of length - * @param {number} [kwargs.no_repeat_ngram_size=0] - The size of the n-grams to avoid repeating in the generated output. - * @param {?number[]} [kwargs.bad_words_ids=null] - An array of IDs representing tokens that should not be generated. - * @param {?number[]} [kwargs.force_words_ids=null] - An array of IDs representing tokens that must be generated. - * @param {boolean} [kwargs.renormalize_logits=false] - Whether or not to renormalize the logits before generating new tokens. - * @param {?Object[]} [kwargs.constraints=null] - An array of constraint objects to apply during generation. - */ - max_length: any; - max_new_tokens: any; - min_length: any; - min_new_tokens: any; - early_stopping: any; - max_time: any; - do_sample: any; - num_beams: any; - num_beam_groups: any; - penalty_alpha: any; - use_cache: any; - temperature: any; - top_k: any; - top_p: any; - typical_p: any; - epsilon_cutoff: any; - eta_cutoff: any; - diversity_penalty: any; - repetition_penalty: any; - encoder_repetition_penalty: any; - length_penalty: any; - no_repeat_ngram_size: any; - bad_words_ids: any; - force_words_ids: any; - renormalize_logits: any; - constraints: any; - forced_bos_token_id: any; - forced_eos_token_id: any; - remove_invalid_values: any; - exponential_decay_length_penalty: any; - suppress_tokens: any; - begin_suppress_tokens: any; - forced_decoder_ids: any; - num_return_sequences: any; - output_attentions: any; - output_hidden_states: any; - output_scores: any; - return_dict_in_generate: any; - pad_token_id: any; - bos_token_id: any; - eos_token_id: any; - encoder_no_repeat_ngram_size: any; - decoder_start_token_id: any; - generation_kwargs: any; -} -/** - * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence. - * @extends LogitsProcessor - */ -export class ForcedBOSTokenLogitsProcessor extends LogitsProcessor { - /** - * Create a ForcedBOSTokenLogitsProcessor. - * @param {number} bos_token_id - The ID of the beginning-of-sequence token to be forced. - */ - constructor(bos_token_id: number); - bos_token_id: number; - /** - * Apply the BOS token forcing to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with BOS token forcing. - */ - _call(input_ids: any[], logits: any): any; -} -/** - * A logits processor that forces end-of-sequence token probability to 1. - * - * @extends LogitsProcessor - */ -export class ForcedEOSTokenLogitsProcessor extends LogitsProcessor { - /** - * Create a ForcedEOSTokenLogitsProcessor. - * @param {number} max_length - Max length of the sequence. - * @param {number} forced_eos_token_id - The ID of the end-of-sequence token to be forced. - */ - constructor(max_length: number, forced_eos_token_id: number); - max_length: number; - forced_eos_token_id: number; - /** - * Apply the processor to input_ids and logits. - * - * @param {number[]} input_ids - The input ids. - * @param {any} logits - The logits tensor. - */ - _call(input_ids: number[], logits: any): void; -} -/** - * A LogitsProcessor that handles adding timestamps to generated text. - * @extends LogitsProcessor - */ -export class WhisperTimeStampLogitsProcessor extends LogitsProcessor { - /** - * Constructs a new WhisperTimeStampLogitsProcessor. - * @param {object} generate_config - The config object passed to the `generate()` method of a transformer model. - * @param {number} generate_config.eos_token_id - The ID of the end-of-sequence token. - * @param {number} generate_config.no_timestamps_token_id - The ID of the token used to indicate that a token should not have a timestamp. - * @param {number[][]} [generate_config.forced_decoder_ids] - An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp. - * @param {number} [generate_config.max_initial_timestamp_index] - The maximum index at which an initial timestamp can appear. - */ - constructor(generate_config: { - eos_token_id: number; - no_timestamps_token_id: number; - forced_decoder_ids?: number[][]; - max_initial_timestamp_index?: number; - }); - eos_token_id: number; - no_timestamps_token_id: number; - timestamp_begin: number; - begin_index: number; - max_initial_timestamp_index: number; - /** - * Modify the logits to handle timestamp tokens. - * @param {Array} input_ids - The input sequence of tokens. - * @param {Tensor} logits - The logits output by the model. - * @returns {Tensor} - The modified logits. - */ - _call(input_ids: any[], logits: Tensor): Tensor; -} -/** - * A logits processor that forces a specific token to be generated by the decoder. - * - * @extends LogitsProcessor - */ -export class ForceTokensLogitsProcessor extends LogitsProcessor { - /** - * Constructs a new instance of `ForceTokensLogitsProcessor`. - * - * @param {Array} forced_decoder_ids The ids of tokens that should be forced. - */ - constructor(forced_decoder_ids: any[]); - force_token_map: { - [k: string]: any; - }; - /** - * Apply the processor to the input logits. - * - * @param {Array} input_ids The input ids. - * @param {any} logits The logits to process. - * @returns {Array} The processed logits. - */ - _call(input_ids: any[], logits: any): any[]; -} -/** - * A logits processor that disallows ngrams of a certain size to be repeated. - * - * @extends LogitsProcessor - */ -export class NoRepeatNGramLogitsProcessor extends LogitsProcessor { - /** - * Create a NoRepeatNGramLogitsProcessor. - * @param {number} no_repeat_ngram_size - The no-repeat-ngram size. All ngrams of this size can only occur once. - */ - constructor(no_repeat_ngram_size: number); - no_repeat_ngram_size: number; - /** - * Generate n-grams from a sequence of token ids. - * @param {number[]} prevInputIds - List of previous input ids - * @returns {Map} - Map of generated n-grams - */ - getNgrams(prevInputIds: number[]): Map; - /** - * Generate n-grams from a sequence of token ids. - * @param {Map} bannedNgrams - Map of banned n-grams - * @param {number[]} prevInputIds - List of previous input ids - * @returns {number[]} - Map of generated n-grams - */ - getGeneratedNgrams(bannedNgrams: Map, prevInputIds: number[]): number[]; - /** - * Calculate banned n-gram tokens - * @param {number[]} prevInputIds - List of previous input ids - * @returns {number[]} - Map of generated n-grams - */ - calcBannedNgramTokens(prevInputIds: number[]): number[]; - /** - * Apply the no-repeat-ngram processor to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with no-repeat-ngram processing. - */ - _call(input_ids: any[], logits: any): any; -} -/** - * A logits processor that penalises repeated output tokens. - * - * @extends LogitsProcessor - */ -export class RepetitionPenaltyLogitsProcessor extends LogitsProcessor { - /** - * Create a RepetitionPenaltyLogitsProcessor. - * @param {number} penalty - The penalty to apply for repeated tokens. - */ - constructor(penalty: number); - penalty: number; - /** - * Apply the repetition penalty to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with repetition penalty processing. - */ - _call(input_ids: any[], logits: any): any; -} -import { Callable } from "./utils.js"; -import { Tensor } from "./tensor_utils.js"; diff --git a/dist/types/image_utils.d.ts b/dist/types/image_utils.d.ts deleted file mode 100644 index 3475e6f68..000000000 --- a/dist/types/image_utils.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -export class CustomImage { - /** - * Helper method for reading an image from a variety of input types. - * @param {CustomImage|string|URL} input - * @returns The image object. - */ - static read(input: CustomImage | string | URL): Promise; - /** - * Read an image from a URL or file path. - * @param {string|URL} url - The URL or file path to read the image from. - * @returns {Promise} - The image object. - */ - static fromURL(url: string | URL): Promise; - /** - * Helper method to create a new Image from a blob. - * @param {Blob} blob - The blob to read the image from. - * @returns {Promise} - The image object. - */ - static fromBlob(blob: Blob): Promise; - /** - * Create a new CustomImage object. - * @param {Uint8ClampedArray} data - The pixel data. - * @param {number} width - The width of the image. - * @param {number} height - The height of the image. - * @param {1|2|3|4} channels - The number of channels. - */ - constructor(data: Uint8ClampedArray, width: number, height: number, channels: 1 | 2 | 3 | 4); - /** - * Convert the image to grayscale format. - * @returns {CustomImage} - `this` to support chaining. - */ - grayscale(): CustomImage; - /** - * Convert the image to RGB format. - * @returns {CustomImage} - `this` to support chaining. - */ - rgb(): CustomImage; - /** - * Convert the image to RGBA format. - * @returns {CustomImage} - `this` to support chaining. - */ - rgba(): CustomImage; - /** - * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing. - * @param {number} width - The width of the new image. - * @param {number} height - The height of the new image. - * @returns {Promise} - `this` to support chaining. - */ - resize(width: number, height: number): Promise; - toCanvas(): any; - /** - * Helper method to update the image data. - * @param {Uint8ClampedArray} data - The new image data. - * @param {number} width - The new width of the image. - * @param {number} height - The new height of the image. - * @param {1|2|3|4} channels - The new number of channels of the image. - */ - _update(data: Uint8ClampedArray, width: number, height: number, channels?: 1 | 2 | 3 | 4): CustomImage; - data: Uint8ClampedArray; - width: number; - height: number; - channels: 2 | 1 | 3 | 4; - /** - * Clone the image - * @returns {CustomImage} - The cloned image - */ - clone(): CustomImage; - /** - * Helper method for converting image to have a certain number of channels - * @param {number} numChannels - The number of channels. Must be 1, 3, or 4. - * @returns {CustomImage} - `this` to support chaining. - */ - convert(numChannels: number): CustomImage; - /** - * Save the image to the given path. This method is only available in environments with access to the FileSystem. - * @param {string|Buffer|URL} path - The path to save the image to. - * @param {string} [mime='image/png'] - The mime type of the image. - */ - save(path: string | Buffer | URL, mime?: string): void; -} diff --git a/dist/types/math_utils.d.ts b/dist/types/math_utils.d.ts deleted file mode 100644 index d25c8d305..000000000 --- a/dist/types/math_utils.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; -export type BigTypedArray = BigInt64Array | BigUint64Array; -export type AnyTypedArray = TypedArray | BigTypedArray; -/** - * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray - * @typedef {BigInt64Array | BigUint64Array} BigTypedArray - * @typedef {TypedArray | BigTypedArray} AnyTypedArray - */ -/** - * @param {TypedArray} input - */ -export function interpolate(input: TypedArray, [in_channels, in_height, in_width]: [any, any, any], [out_height, out_width]: [any, any], mode?: string, align_corners?: boolean): any; -/** - * Helper method to transpose a AnyTypedArray directly - * @param {T} array - * @template {AnyTypedArray} T - * @param {number[]} dims - * @param {number[]} axes - * @returns {[T, number[]]} The transposed array and the new shape. - */ -declare function transpose_data(array: T, dims: number[], axes: number[]): [T, number[]]; -export { transpose_data as transpose }; diff --git a/dist/types/models.d.ts b/dist/types/models.d.ts deleted file mode 100644 index d826f45de..000000000 --- a/dist/types/models.d.ts +++ /dev/null @@ -1,1167 +0,0 @@ -/** - * Helper class to determine model type from config - */ -export class AutoModel { - static MODEL_CLASS_MAPPING: { - bert: typeof BertModel; - albert: typeof AlbertModel; - distilbert: typeof DistilBertModel; - t5: typeof T5Model; - mt5: typeof MT5Model; - gpt2: typeof GPT2Model; - gpt_neo: typeof GPTNeoModel; - codegen: typeof CodeGenModel; - bart: typeof BartModel; - roberta: typeof RobertaModel; - whisper: typeof WhisperModel; - clip: typeof CLIPModel; - mobilebert: typeof MobileBertModel; - squeezebert: typeof SqueezeBertModel; - marian: typeof MarianModel; - }; - /** - * Instantiates a pre-trained model based on the given model path and config. - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - Optional. A callback function that can be used to track loading progress. - * @returns {Promise} - A promise that resolves to an instance of a pre-trained model. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * Class representing an automatic sequence-to-sequence language model. - */ -export class AutoModelForSeq2SeqLM { - static MODEL_CLASS_MAPPING: { - t5: typeof T5ForConditionalGeneration; - mt5: typeof MT5ForConditionalGeneration; - bart: typeof BartForConditionalGeneration; - whisper: typeof WhisperForConditionalGeneration; - marian: typeof MarianMTModel; - }; - /** - * Loads a pretrained sequence-to-sequence language model from a file path. - * @param {string} modelPath - The path to the model files. - * @param {function} [progressCallback=null] - A callback function to track loading progress. - * @returns {Promise} A Promise that resolves to an instance of the appropriate model class. - * @throws {Error} If the model type is unsupported. - * @static - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * Helper class for loading sequence classification models from pretrained checkpoints - */ -export class AutoModelForSequenceClassification { - static MODEL_CLASS_MAPPING: { - bert: typeof BertForSequenceClassification; - albert: typeof AlbertForSequenceClassification; - distilbert: typeof DistilBertForSequenceClassification; - roberta: typeof RobertaForSequenceClassification; - bart: typeof BartForSequenceClassification; - mobilebert: typeof MobileBertForSequenceClassification; - squeezebert: typeof SqueezeBertForSequenceClassification; - }; - /** - * Load a sequence classification model from a pretrained checkpoint - * @param {string} modelPath - The path to the model checkpoint directory - * @param {function} [progressCallback=null] - An optional callback function to receive progress updates - * @returns {Promise} A promise that resolves to a pre-trained sequence classification model - * @throws {Error} if an unsupported model type is encountered - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * Helper class for loading token classification models from pretrained checkpoints - */ -export class AutoModelForTokenClassification { - static MODEL_CLASS_MAPPING: { - bert: typeof BertForTokenClassification; - distilbert: typeof DistilBertForTokenClassification; - }; - /** - * Load a token classification model from a pretrained checkpoint - * @param {string} modelPath - The path to the model checkpoint directory - * @param {function} [progressCallback=null] - An optional callback function to receive progress updates - * @returns {Promise} A promise that resolves to a pre-trained token classification model - * @throws {Error} if an unsupported model type is encountered - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * A class for loading pre-trained models for causal language modeling tasks. - */ -export class AutoModelForCausalLM { - static MODEL_CLASS_MAPPING: { - gpt2: typeof GPT2LMHeadModel; - gpt_neo: typeof GPTNeoForCausalLM; - codegen: typeof CodeGenForCausalLM; - }; - /** - * Loads a pre-trained model from the given path and returns an instance of the appropriate class. - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} [progressCallback=null] - An optional callback function to track the progress of the loading process. - * @returns {Promise} An instance of the appropriate class for the loaded model. - * @throws {Error} If the loaded model type is not supported. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * A class to automatically select the appropriate model for Masked Language Modeling (MLM) tasks. - */ -export class AutoModelForMaskedLM { - static MODEL_CLASS_MAPPING: { - bert: typeof BertForMaskedLM; - albert: typeof AlbertForMaskedLM; - distilbert: typeof DistilBertForMaskedLM; - roberta: typeof RobertaForMaskedLM; - mobilebert: typeof MobileBertForMaskedLM; - squeezebert: typeof SqueezeBertForMaskedLM; - }; - /** - * Loads a pre-trained model from a given directory and returns an instance of the appropriate model class. - * - * @async - * @param {string} modelPath - The path to the pre-trained model directory. - * @param {function} [progressCallback=null] - An optional callback function to track the loading progress. - * @returns {Promise} An instance of the appropriate model class for MLM tasks. - * @throws {Error} If an unsupported model type is encountered. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * Automatic model class for question answering tasks. - */ -export class AutoModelForQuestionAnswering { - static MODEL_CLASS_MAPPING: { - bert: typeof BertForQuestionAnswering; - albert: typeof AlbertForQuestionAnswering; - distilbert: typeof DistilBertForQuestionAnswering; - roberta: typeof RobertaForQuestionAnswering; - mobilebert: typeof MobileBertForQuestionAnswering; - squeezebert: typeof SqueezeBertForQuestionAnswering; - }; - /** - * Loads and returns a question answering model from a pretrained model path. - * @param {string} modelPath - The path to the pretrained model. - * @param {function} [progressCallback=null] - Optional callback function to track loading progress. - * @returns {Promise} - The loaded question answering model. - * @throws Will throw an error if an unsupported model type is encountered. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * Class representing an autoencoder-decoder model for vision-to-sequence tasks. - */ -export class AutoModelForVision2Seq { - static MODEL_CLASS_MAPPING: { - 'vision-encoder-decoder': typeof VisionEncoderDecoderModel; - }; - /** - * Loads a pretrained model from a given path. - * @param {string} modelPath - The path to the pretrained model. - * @param {function} progressCallback - Optional callback function to track progress of the model loading. - * @returns {Promise} - A Promise that resolves to a new instance of VisionEncoderDecoderModel. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * AutoModelForImageClassification is a class for loading pre-trained image classification models from ONNX format. - */ -export class AutoModelForImageClassification { - static MODEL_CLASS_MAPPING: { - vit: typeof ViTForImageClassification; - }; - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -export class AutoModelForObjectDetection { - static MODEL_CLASS_MAPPING: { - detr: typeof DetrForObjectDetection; - }; - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * AutoModelForImageSegmentation is a class for loading pre-trained image classification models from ONNX format. - */ -export class AutoModelForImageSegmentation { - static MODEL_CLASS_MAPPING: { - detr: typeof DetrForSegmentation; - }; - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -declare class BertModel extends BertPreTrainedModel { -} -declare class AlbertModel extends AlbertPreTrainedModel { -} -declare class DistilBertModel extends DistilBertPreTrainedModel { -} -declare class T5Model extends T5PreTrainedModel { - /** - * Generates text based on the provided arguments. - * @throws {Error} - Throws an error as the current model class (T5Model) is not compatible with `.generate()`. - * @returns {Promise} - * @param {any[]} args - */ - generate(...args: any[]): Promise; -} -declare class MT5Model extends MT5PreTrainedModel { - /** - * - * @param {...any} args - * @returns {Promise} - * @throws {Error} - */ - generate(...args: any[]): Promise; -} -/** - * GPT2Model is not compatible with `.generate()`, as it doesn't have a language model head. - * @extends GPT2PreTrainedModel - */ -declare class GPT2Model extends GPT2PreTrainedModel { - /** - * - * @param {...any} args - * @throws {Error} - * @returns {Promise} - */ - generate(...args: any[]): Promise; -} -declare class GPTNeoModel extends GPTNeoPreTrainedModel { - /** - * - * @param {...any} args - * @throws {Error} - * @returns {Promise} - */ - generate(...args: any[]): Promise; -} -/** - * CodeGenModel is a class representing a code generation model without a language model head. - * - * @extends CodeGenPreTrainedModel - */ -declare class CodeGenModel extends CodeGenPreTrainedModel { - /** - * Throws an error indicating that the current model class is not compatible with `.generate()`, - * as it doesn't have a language model head. - * - * @throws {Error} The current model class is not compatible with `.generate()` - * - * @param {...any} args - Arguments passed to the generate function - * @returns {Promise} - */ - generate(...args: any[]): Promise; -} -/** - * BART encoder and decoder model. - * - * @hideconstructor - * @extends BartPretrainedModel - */ -declare class BartModel extends BartPretrainedModel { - /** - * Throws an error because the current model class (BartModel) is not compatible with `.generate()`. - * - * @async - * @throws {Error} The current model class (BartModel) is not compatible with `.generate()`. - * @returns {Promise} - */ - generate(...args: any[]): Promise; -} -declare class RobertaModel extends RobertaPreTrainedModel { -} -/** - * WhisperModel class for training Whisper models without a language model head. - * @extends WhisperPreTrainedModel - */ -declare class WhisperModel extends WhisperPreTrainedModel { - /** - * Throws an error when attempting to generate output since this model doesn't have a language model head. - * @throws Error - * @returns {Promise} - * @param {any[]} args - */ - generate(...args: any[]): Promise; -} -declare class CLIPModel extends CLIPPreTrainedModel { -} -declare class MobileBertModel extends MobileBertPreTrainedModel { -} -declare class SqueezeBertModel extends SqueezeBertPreTrainedModel { -} -declare class MarianModel extends MarianPreTrainedModel { - /** - * - * @param {...any} args - * @throws {Error} - * @returns {Promise} - */ - generate(...args: any[]): Promise; -} -/** - * A base class for pre-trained models that provides the model configuration and an ONNX session. - * @extends Callable - */ -declare class PreTrainedModel extends Callable { - /** - * Loads a pre-trained model from the given modelPath. - * @static - * @async - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - A function to be called with progress updates. - * @returns {Promise} A new instance of the PreTrainedModel class. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Creates a new instance of the `PreTrainedModel` class. - * @param {object} config - The model configuration. - * @param {any} session - session for the model. - */ - constructor(config: object, session: any); - config: any; - session: any; - /** - * Disposes of all the ONNX sessions that were created during inference. - * @returns {Promise} - An array of promises, one for each ONNX session that is being disposed. - */ - dispose(): Promise; - /** - * Converts an array or Tensor of integers to an int64 Tensor. - * @param {Array|Tensor} items - The input integers to be converted. - * @returns {Tensor} The int64 Tensor with the converted values. - * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length. - */ - toI64Tensor(items: any[] | Tensor): Tensor; - /** - * Runs the model with the provided inputs - * @param {Object} model_inputs - Object containing input tensors - * @returns {Promise} - Object containing output tensors - */ - _call(model_inputs: any): Promise; - /** - * Forward method should be implemented in subclasses. - * @abstract - * @param {object} model_inputs - The input data to the model in the format specified in the ONNX model. - * @returns {Promise} - The output data from the model in the format specified in the ONNX model. - * @throws {Error} - This method must be implemented in subclasses. - */ - forward(model_inputs: object): Promise; - /** - * @param {GenerationConfig} generation_config - * @param {number} input_ids_seq_length - * @returns {LogitsProcessorList} - */ - _get_logits_processor(generation_config: GenerationConfig, input_ids_seq_length: number, logits_processor?: any): LogitsProcessorList; - /** - * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation. - * 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. - * - * @param {GenerationConfig} generation_config - A `GenerationConfig` object containing generation parameters. - * @returns {GenerationConfig} The final generation config object to be used by the model for text generation. - */ - _get_generation_config(generation_config: GenerationConfig): GenerationConfig; - /** - * Generates text based on the given inputs and generation configuration using the model. - * @param {Array} inputs - An array of input token IDs. - * @param {Object|null} generation_config - The generation configuration to use. If null, default configuration will be used. - * @param {Object|null} logits_processor - An optional logits processor to use. If null, a new LogitsProcessorList instance will be created. - * @param {Object} options - options - * @param {Object} [options.inputs_attention_mask=null] - An optional attention mask for the inputs. - * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs. - * @throws {Error} Throws an error if the inputs array is empty. - */ - generate(inputs: any[], generation_config?: any | null, logits_processor?: any | null, { inputs_attention_mask }?: { - inputs_attention_mask?: any; - }): Promise; - /** - * Groups an array of beam objects by their ids. - * - * @param {Array} beams - The array of beam objects to group. - * @returns {Array} - An array of arrays, where each inner array contains beam objects with the same id. - */ - groupBeams(beams: any[]): any[]; - /** - * Returns an object containing past key values from the given decoder results object. - * - * @param {Object} decoderResults - The decoder results object. - * @param {Object} pastKeyValues - The previous past key values. - * @returns {Object} - An object containing past key values. - */ - getPastKeyValues(decoderResults: any, pastKeyValues: any): any; - /** - * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values. - * - * @param {Object} decoderFeeds - The decoder feeds object to add past key values to. - * @param {Object} pastKeyValues - An object containing past key values. - * @param {boolean} [hasDecoder=false] - Whether the model has a decoder. - */ - addPastKeyValues(decoderFeeds: any, pastKeyValues: any, hasDecoder?: boolean): void; -} -/** - * T5Model is a class representing a T5 model for conditional generation. - * @extends T5PreTrainedModel - */ -declare class T5ForConditionalGeneration extends T5PreTrainedModel { - /** - * Loads the pre-trained model from a given path. - * @async - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - A function to call with progress updates (optional). - * @returns {Promise} The loaded model instance. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Creates a new instance of the `T5ForConditionalGeneration` class. - * @param {object} config - The model configuration. - * @param {any} session - session for the model. - * @param {any} decoder_merged_session - session for the decoder. - * @param {GenerationConfig} generation_config - The generation configuration. - */ - constructor(config: object, session: any, decoder_merged_session: any, generation_config: GenerationConfig); - decoder_merged_session: any; - generation_config: GenerationConfig; - num_decoder_layers: any; - num_decoder_heads: any; - decoder_dim_kv: any; - num_encoder_layers: any; - num_encoder_heads: any; - encoder_dim_kv: any; - /** - * Generates the start beams for a given set of inputs and output length. - * @param {number[][]} inputs - The input token IDs. - * @param {number} numOutputTokens - The desired output length. - * @returns {Array} The start beams. - */ - getStartBeams(inputs: number[][], numOutputTokens: number, ...args: any[]): any[]; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the given beam with a new token ID. - * @param {any} beam - The current beam. - * @param {number} newTokenId - The new token ID to add to the output sequence. - */ - updateBeam(beam: any, newTokenId: number): void; -} -/** - * A class representing a conditional sequence-to-sequence model based on the MT5 architecture. - * - * @extends MT5PreTrainedModel - */ -declare class MT5ForConditionalGeneration extends MT5PreTrainedModel { - /** - * Loads a pre-trained model from the given path. - * - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} [progressCallback=null] - A callback function that is called with the download progress percentage (0-100). - * @returns {Promise} - A Promise that resolves to a new `MT5ForConditionalGeneration` instance. - * @static - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Creates a new instance of the `MT5ForConditionalGeneration` class. - * @param {any} config - The model configuration. - * @param {any} session - The ONNX session containing the encoder weights. - * @param {any} decoder_merged_session - The ONNX session containing the merged decoder weights. - * @param {GenerationConfig} generation_config - The generation configuration. - */ - constructor(config: any, session: any, decoder_merged_session: any, generation_config: GenerationConfig); - decoder_merged_session: any; - generation_config: GenerationConfig; - num_decoder_layers: any; - num_decoder_heads: any; - decoder_dim_kv: any; - num_encoder_layers: any; - num_encoder_heads: any; - encoder_dim_kv: any; - /** - * Generates the start beams for the given input tokens and output sequence length. - * - * @param {any[]} inputs - The input sequence. - * @param {number} numOutputTokens - The desired length of the output sequence. - * @param {...*} args - Additional arguments to pass to the `seq2seqStartBeams` function. - * @returns {any[]} - An array of `Beam` objects representing the start beams. - */ - getStartBeams(inputs: any[], numOutputTokens: number, ...args: any[]): any[]; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the given beam with the new predicted token. - * @param {any} beam - The beam to update. - * @param {number} newTokenId - The index of the predicted token. - */ - updateBeam(beam: any, newTokenId: number): void; -} -/** - * BART model with a language model head for conditional generation. - * @extends BartPretrainedModel - */ -declare class BartForConditionalGeneration extends BartPretrainedModel { - /** - * Loads a BartForConditionalGeneration instance from a pretrained model stored on disk. - * @param {string} modelPath - The path to the directory containing the pretrained model. - * @param {function} [progressCallback=null] - An optional callback function to track the download progress. - * @returns {Promise} - The pretrained BartForConditionalGeneration instance. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Creates a new instance of the `BartForConditionalGeneration` class. - * @param {object} config - The configuration object for the Bart model. - * @param {object} session - The ONNX session used to execute the model. - * @param {object} decoder_merged_session - The ONNX session used to execute the decoder. - * @param {object} generation_config - The generation configuration object. - */ - constructor(config: object, session: object, decoder_merged_session: object, generation_config: object); - decoder_merged_session: any; - generation_config: any; - num_decoder_layers: any; - num_decoder_heads: any; - decoder_dim_kv: number; - num_encoder_layers: any; - num_encoder_heads: any; - encoder_dim_kv: number; - /** - * Returns the initial beam for generating output text. - * @param {object} inputs - The input object containing the encoded input text. - * @param {number} numOutputTokens - The maximum number of output tokens to generate. - * @param {...any} args - Additional arguments to pass to the sequence-to-sequence generation function. - * @returns {any} - The initial beam for generating output text. - */ - getStartBeams(inputs: object, numOutputTokens: number, ...args: any[]): any; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the beam by appending the newly generated token ID to the list of output token IDs. - * @param {any} beam - The current beam being generated. - * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs. - */ - updateBeam(beam: any, newTokenId: number): void; -} -/** - * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models. - * @extends WhisperPreTrainedModel - */ -declare class WhisperForConditionalGeneration extends WhisperPreTrainedModel { - /** - * Loads a pre-trained model from a saved model directory. - * @param {string} modelPath - Path to the saved model directory. - * @param {function} progressCallback - Optional function for tracking loading progress. - * @returns {Promise} Promise object represents the loaded model. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Creates a new instance of the `WhisperForConditionalGeneration` class. - * @param {Object} config - Configuration object for the model. - * @param {Object} session - ONNX Session object for the model. - * @param {Object} decoder_merged_session - ONNX Session object for the decoder. - * @param {Object} generation_config - Configuration object for the generation process. - */ - constructor(config: any, session: any, decoder_merged_session: any, generation_config: any); - decoder_merged_session: any; - generation_config: any; - num_decoder_layers: any; - num_decoder_heads: any; - decoder_dim_kv: number; - num_encoder_layers: any; - num_encoder_heads: any; - encoder_dim_kv: number; - /** - * Generates outputs based on input and generation configuration. - * @param {Object} inputs - Input data for the model. - * @param {Object} generation_config - Configuration object for the generation process. - * @param {Object} logits_processor - Optional logits processor object. - * @returns {Promise} Promise object represents the generated outputs. - */ - generate(inputs: any, generation_config?: any, logits_processor?: any): Promise; - /** - * Gets the start beams for generating outputs. - * @param {Array} inputTokenIds - Array of input token IDs. - * @param {number} numOutputTokens - Number of output tokens to generate. - * @returns {Array} Array of start beams. - */ - getStartBeams(inputTokenIds: any[], numOutputTokens: number, ...args: any[]): any[]; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the beam by appending the newly generated token ID to the list of output token IDs. - * @param {any} beam - The current beam being generated. - * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs. - */ - updateBeam(beam: any, newTokenId: number): void; -} -declare class MarianMTModel extends MarianPreTrainedModel { - /** - * @param {string} modelPath - */ - static from_pretrained(modelPath: string, progressCallback?: any): Promise; - /** - * Creates a new instance of the `MarianMTModel` class. - * @param {object} config The model configuration object. - * @param {object} session The ONNX session object. - * @param {any} decoder_merged_session - * @param {any} generation_config - */ - constructor(config: object, session: object, decoder_merged_session: any, generation_config: any); - decoder_merged_session: any; - generation_config: any; - num_decoder_layers: any; - num_decoder_heads: any; - decoder_dim_kv: number; - num_encoder_layers: any; - num_encoder_heads: any; - encoder_dim_kv: number; - /** - * Initializes and returns the beam for text generation task - * @param {any[]} inputs - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @returns {any} A Beam object representing the initialized beam. - * @param {any[]} args - */ - getStartBeams(inputs: any[], numOutputTokens: number, ...args: any[]): any; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * @param {any} beam - * @param {any} newTokenId - */ - updateBeam(beam: any, newTokenId: any): void; - /** - * @param {any} model_inputs - * @returns {Promise} - */ - forward(model_inputs: any): Promise; -} -/** - * BertForSequenceClassification is a class representing a BERT model for sequence classification. - * @extends BertPreTrainedModel - */ -declare class BertForSequenceClassification extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. - */ - _call(model_inputs: any): Promise; -} -declare class AlbertForSequenceClassification extends AlbertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification. - * @extends DistilBertPreTrainedModel - */ -declare class DistilBertForSequenceClassification extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. - */ - _call(model_inputs: any): Promise; -} -/** - * RobertaForSequenceClassification class for performing sequence classification on Roberta models. - * @extends RobertaPreTrainedModel - */ -declare class RobertaForSequenceClassification extends RobertaPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -declare class BartForSequenceClassification extends BartPretrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. - */ - _call(model_inputs: any): Promise; -} -/** - * @extends MobileBertPreTrainedModel - */ -declare class MobileBertForSequenceClassification extends MobileBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -declare class SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * BertForTokenClassification is a class representing a BERT model for token classification. - * @extends BertPreTrainedModel - */ -declare class BertForTokenClassification extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for token classification. - */ - _call(model_inputs: any): Promise; -} -/** - * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification. - * @extends DistilBertPreTrainedModel - */ -declare class DistilBertForTokenClassification extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for token classification. - */ - _call(model_inputs: any): Promise; -} -/** - * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks. - * @extends GPT2PreTrainedModel - */ -declare class GPT2LMHeadModel extends GPT2PreTrainedModel { - num_heads: any; - num_layers: any; - dim_kv: number; - /** - * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. - * @returns {any} A Beam object representing the initialized beam. - */ - getStartBeams(inputTokenIds: Tensor, numOutputTokens: number, inputs_attention_mask: Tensor): any; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. - */ - updateBeam(beam: any, newTokenId: number): void; -} -declare class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { - num_heads: any; - num_layers: any; - dim_kv: number; - /** - * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. - * @returns {any} A Beam object representing the initialized beam. - */ - getStartBeams(inputTokenIds: Tensor, numOutputTokens: number, inputs_attention_mask: Tensor): any; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. - */ - updateBeam(beam: any, newTokenId: number): void; -} -/** - * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class. - * @extends CodeGenPreTrainedModel - */ -declare class CodeGenForCausalLM extends CodeGenPreTrainedModel { - num_heads: any; - num_layers: any; - dim_kv: number; - /** - * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. - * @returns {any} A Beam object representing the initialized beam. - */ - getStartBeams(inputTokenIds: Tensor, numOutputTokens: number, inputs_attention_mask: Tensor): any; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. - */ - updateBeam(beam: any, newTokenId: number): void; -} -/** - * BertForMaskedLM is a class representing a BERT model for masked language modeling. - * @extends BertPreTrainedModel - */ -declare class BertForMaskedLM extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for masked language modeling. - */ - _call(model_inputs: any): Promise; -} -declare class AlbertForMaskedLM extends AlbertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task. - * @extends DistilBertPreTrainedModel - */ -declare class DistilBertForMaskedLM extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * RobertaForMaskedLM class for performing masked language modeling on Roberta models. - * @extends RobertaPreTrainedModel - */ -declare class RobertaForMaskedLM extends RobertaPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task. - * @extends MobileBertPreTrainedModel - */ -declare class MobileBertForMaskedLM extends MobileBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -declare class SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * BertForQuestionAnswering is a class representing a BERT model for question answering. - * @extends BertPreTrainedModel - */ -declare class BertForQuestionAnswering extends BertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for question answering. - */ - _call(model_inputs: any): Promise; -} -declare class AlbertForQuestionAnswering extends AlbertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering. - * @extends DistilBertPreTrainedModel - */ -declare class DistilBertForQuestionAnswering extends DistilBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for question answering. - */ - _call(model_inputs: any): Promise; -} -/** - * RobertaForQuestionAnswering class for performing question answering on Roberta models. - * @extends RobertaPreTrainedModel - */ -declare class RobertaForQuestionAnswering extends RobertaPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * @extends MobileBertPreTrainedModel - */ -declare class MobileBertForQuestionAnswering extends MobileBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -declare class SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel { - /** - * Calls the model on new inputs. - * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object - */ - _call(model_inputs: any): Promise; -} -/** - * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks - * @extends PreTrainedModel - */ -declare class VisionEncoderDecoderModel extends PreTrainedModel { - /** - * Loads a VisionEncoderDecoderModel from the given path. - * - * @param {string} modelPath - The path to the folder containing the saved model files. - * @param {function} [progressCallback=null] - Optional callback function to track the progress of model loading. - * @returns {Promise} A Promise that resolves with the loaded VisionEncoderDecoderModel instance. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Creates a new instance of the `VisionEncoderDecoderModel` class. - * @param {object} config - The configuration object specifying the hyperparameters and other model settings. - * @param {object} session - The ONNX session containing the encoder model. - * @param {any} decoder_merged_session - The ONNX session containing the merged decoder model. - */ - constructor(config: object, session: object, decoder_merged_session: any); - decoder_merged_session: any; - num_layers: any; - num_heads: any; - dim_kv: number; - /** - * Generate beam search outputs for the given input pixels and number of output tokens. - * - * @param {array} inputs - The input pixels as a Tensor. - * @param {number} numOutputTokens - The number of output tokens to generate. - * @param {...*} args - Optional additional arguments to pass to seq2seqStartBeams. - * @returns {any} An array of Beam objects representing the top-K output sequences. - */ - getStartBeams(inputs: any[], numOutputTokens: number, ...args: any[]): any; - /** - * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. - */ - runBeam(beam: any): Promise; - /** - * Update the given beam with the additional predicted token ID. - * - * @param {any} beam - The current beam. - * @param {number} newTokenId - The new predicted token ID to add to the beam's output sequence. - */ - updateBeam(beam: any, newTokenId: number): void; -} -declare class ViTForImageClassification extends ViTPreTrainedModel { - /** - * @param {any} model_inputs - */ - _call(model_inputs: any): Promise; -} -declare class DetrForObjectDetection extends DetrPreTrainedModel { - /** - * @param {any} model_inputs - */ - _call(model_inputs: any): Promise; -} -declare class DetrForSegmentation extends DetrPreTrainedModel { - /** - * Runs the model with the provided inputs - * @param {Object} model_inputs - Model inputs - * @returns {Promise} - Object containing segmentation outputs - */ - _call(model_inputs: any): Promise; -} -declare class BertPreTrainedModel extends PreTrainedModel { -} -declare class AlbertPreTrainedModel extends PreTrainedModel { -} -declare class DistilBertPreTrainedModel extends PreTrainedModel { -} -declare class T5PreTrainedModel extends PreTrainedModel { -} -declare class MT5PreTrainedModel extends PreTrainedModel { -} -declare class GPT2PreTrainedModel extends PreTrainedModel { -} -declare class GPTNeoPreTrainedModel extends PreTrainedModel { -} -declare class CodeGenPreTrainedModel extends PreTrainedModel { -} -declare class BartPretrainedModel extends PreTrainedModel { -} -declare class RobertaPreTrainedModel extends PreTrainedModel { -} -declare class WhisperPreTrainedModel extends PreTrainedModel { -} -declare class CLIPPreTrainedModel extends PreTrainedModel { -} -declare class MobileBertPreTrainedModel extends PreTrainedModel { -} -declare class SqueezeBertPreTrainedModel extends PreTrainedModel { -} -declare class MarianPreTrainedModel extends PreTrainedModel { -} -import { Callable } from "./utils.js"; -import { Tensor } from "./tensor_utils"; -import { GenerationConfig } from "./generation.js"; -import { LogitsProcessorList } from "./generation.js"; -declare class Seq2SeqLMOutput extends ModelOutput { - /** - * @param {Tensor} logits - The output logits of the model. - * @param {Array} past_key_values - An array of key/value pairs that represent the previous state of the model. - * @param {Tensor} encoder_outputs - The output of the encoder in a sequence-to-sequence model. - */ - constructor(logits: Tensor, past_key_values: any[], encoder_outputs: Tensor); - logits: Tensor; - past_key_values: any[]; - encoder_outputs: Tensor; -} -declare class SequenceClassifierOutput extends ModelOutput { - /** - * @param {Tensor} logits - */ - constructor(logits: Tensor); - logits: Tensor; -} -declare class TokenClassifierOutput extends ModelOutput { - /** - * @param {Tensor} logits - */ - constructor(logits: Tensor); - logits: Tensor; -} -declare class MaskedLMOutput extends ModelOutput { - /** - * @param {Tensor} logits - */ - constructor(logits: Tensor); - logits: Tensor; -} -declare class QuestionAnsweringModelOutput extends ModelOutput { - /** - * @param {Float32Array} start_logits - The logits for start positions of the answer. - * @param {Float32Array} end_logits - The logits for end positions of the answer. - */ - constructor(start_logits: Float32Array, end_logits: Float32Array); - start_logits: Float32Array; - end_logits: Float32Array; -} -declare class ViTPreTrainedModel extends PreTrainedModel { -} -declare class DetrPreTrainedModel extends PreTrainedModel { -} -declare class DetrObjectDetectionOutput extends ModelOutput { - /** - * @param {any} logits - * @param {any} pred_boxes - */ - constructor(logits: any, pred_boxes: any); - logits: any; - pred_boxes: any; -} -declare class DetrSegmentationOutput extends ModelOutput { - /** - * @param {Tensor} logits - The output logits of the model. - * @param {Tensor} pred_boxes - Predicted boxes. - * @param {Tensor} pred_masks - Predicted masks. - */ - constructor(logits: Tensor, pred_boxes: Tensor, pred_masks: Tensor); - logits: Tensor; - pred_boxes: Tensor; - pred_masks: Tensor; -} -declare class ModelOutput { -} -export {}; diff --git a/dist/types/pipelines.d.ts b/dist/types/pipelines.d.ts deleted file mode 100644 index 21ae43780..000000000 --- a/dist/types/pipelines.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Constructs a pipeline for a specified task with optional model and progress callback. - * - * @async - * @function - * @param {string} task - The task to perform, e.g. "text-generation". - * @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. - * @param {object} [options] - Optional parameters for the pipeline. - * @param {function} [options.progress_callback=null] - A function to call with progress updates. - * @returns {Promise} A Pipeline object for the specified task. - * @todo fix error below - * @throws {Error} If an unsupported pipeline is requested. - */ -export function pipeline(task: string, model?: string, { progress_callback }?: { - progress_callback?: Function; -}): Promise; -/** - * Pipeline class for executing a natural language processing task. - * @extends Callable - */ -declare class Pipeline extends Callable { - /** - * Creates a new instance of Pipeline. - * @param {string} task - The natural language processing task to be performed. - * @param {object} tokenizer - The tokenizer object to be used for tokenizing input texts. - * @param {object} model - The model object to be used for processing input texts. - */ - constructor(task: string, tokenizer: object, model: object); - task: string; - tokenizer: any; - model: any; - /** - * Disposes the model. - * @returns {Promise} - A promise that resolves when the model has been disposed. - */ - dispose(): Promise; - /** - * Executes the natural language processing task. - * @param {any} texts - The input texts to be processed. - * @returns {Promise} - A promise that resolves to an array containing the inputs and outputs of the task. - */ - _call(texts: any): Promise; -} -import { Callable } from "./utils.js"; -export {}; diff --git a/dist/types/processors.d.ts b/dist/types/processors.d.ts deleted file mode 100644 index 11216c0de..000000000 --- a/dist/types/processors.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Helper class to determine model type from config - */ -export class AutoProcessor { - /** - * Returns a new instance of a Processor with a feature extractor - * based on the configuration file located at `modelPath`. - * - * @param {string} modelPath - The path to the model directory. - * @param {function} progressCallback - A callback function to track the loading progress (optional). - * @returns {Promise} A Promise that resolves with a new instance of a Processor. - * @throws {Error} If the feature extractor type specified in the configuration file is unknown. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; -} -/** - * Represents a Processor that extracts features from an input. - * @extends Callable - */ -export class Processor extends Callable { - /** - * Creates a new Processor with the given feature extractor. - * @param {function} feature_extractor - The function used to extract features from the input. - */ - constructor(feature_extractor: Function); - feature_extractor: Function; - /** - * Calls the feature_extractor function with the given input. - * @param {any} input - The input to extract features from. - * @returns {Promise} A Promise that resolves with the extracted features. - * @async - */ - _call(input: any): Promise; -} -import { Callable } from "./utils.js"; diff --git a/dist/types/samplers.d.ts b/dist/types/samplers.d.ts deleted file mode 100644 index 6c00bd710..000000000 --- a/dist/types/samplers.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Sampler is a base class for all sampling methods used for text generation. - */ -export class Sampler extends Callable { - /** - * Returns a Sampler object based on the specified options. - * @param {object} generation_config - An object containing options for the sampler. - * @returns {Sampler} A Sampler object. - */ - static getSampler(generation_config: object): Sampler; - /** - * Creates a new Sampler object with the specified temperature. - * @param {number} temperature - The temperature to use when sampling. Higher values result in more random samples. - */ - constructor(temperature: number); - temperature: number; - /** - * Executes the sampler, using the specified logits. - * @param {any} logits - * @param {number} index - * @returns {void} - */ - _call(logits: any, index?: number): void; - /** - * Abstract method for sampling the logits. - * @param {any} logits - * @param {number} index - * @throws {Error} - */ - sample(logits: any, index: number): void; - /** - * Returns the specified logits as an array, with temperature applied. - * @param {any} logits - * @param {number} index - * @returns {Array} - */ - getLogits(logits: any, index: number): any[]; - /** - * Selects an item randomly based on the specified probabilities. - * @param {Array} probabilities - An array of probabilities to use for selection. - * @returns {number} The index of the selected item. - */ - randomSelect(probabilities: any[]): number; -} -/** - * Class representing a Greedy Sampler. - * @extends Sampler - */ -export class GreedySampler extends Sampler { - /** - * Sample the maximum probability of a given logits tensor. - * @param {any} logits - * @param {number} [index=-1] - * @returns {Array} - An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search). - */ - sample(logits: any, index?: number): any[]; -} -/** - * Class representing a TopKSampler. - * @extends Sampler - */ -export class TopKSampler extends Sampler { - /** - * Create a TopKSampler. - * @param {number} temperature - * @param {number} k - */ - constructor(temperature: number, k: number); - k: number; - /** - * Sample from the logits using the top-k sampling strategy. - * @param {any} logits - * @param {number} index - * @returns {Array} - */ - sample(logits: any, index?: number): any[]; -} -/** - * Class representing a beam search sampler for generating sequences. - * @extends Sampler - */ -export class BeamSearchSampler extends Sampler { - /** - * Create a BeamSearchSampler. - * @param {number} temperature - * @param {number} num_beams - * @param {boolean} do_sample - * @param {number} top_k - */ - constructor(temperature: number, num_beams: number, do_sample: boolean, top_k: number); - num_beams: number; - do_sample: boolean; - top_k: number; - /** - * Samples from the logits to generate a sequence using beam search. - * @param {any} logits - The logits to sample from. - * @param {number} [index=-1] - The index to sample from, if applicable. - * @returns {Array} - An array of arrays containing tokens and scores. - */ - sample(logits: any, index?: number): any[]; -} -import { Callable } from "./utils.js"; diff --git a/dist/types/tensor_utils.d.ts b/dist/types/tensor_utils.d.ts deleted file mode 100644 index ced28810d..000000000 --- a/dist/types/tensor_utils.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * This creates a nested array of a given type and depth (see examples). - */ -export type NestArray = Acc['length'] extends Depth ? T : NestArray; -export type AnyTypedArray = import('./math_utils.js').AnyTypedArray; -declare const Tensor_base: any; -export class Tensor extends Tensor_base { - [x: string]: any; - /** - * Create a new Tensor or copy an existing Tensor. - * @param {[string, Array|AnyTypedArray, number[]]|[ONNXTensor]} args - */ - constructor(...args: [string, any[] | AnyTypedArray, number[]] | [any]); - /** - * - * @param {number} index - * @returns {Tensor} - * @todo Set type based on dims - */ - get(index: number): Tensor; - /** - * @param {any} item - * @returns {number} - */ - indexOf(item: any): number; - /** - * @param {number} index - * @param {number} iterSize - * @param {any} iterDims - * @returns {Tensor} - */ - _subarray(index: number, iterSize: number, iterDims: any): Tensor; - tolist(): any; - /** - * Return a new Tensor the sigmoid function applied to each element. - * @returns {Tensor} - The tensor with the sigmoid function applied. - */ - sigmoid(): Tensor; - /** - * Applies the sigmoid function to the tensor in place. - * @returns {Tensor} - Returns `this`. - */ - sigmoid_(): Tensor; - clone(): Tensor; - /** - * Return a transposed version of this Tensor, according to the provided dimensions. - * @param {...number} dims - Dimensions to transpose. - * @returns {Tensor} - The transposed tensor. - */ - transpose(...dims: number[]): Tensor; - /** - * Returns an iterator object for iterating over the tensor data in row-major order. - * If the tensor has more than one dimension, the iterator will yield subarrays. - * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order. - */ - [Symbol.iterator](): Iterator; -} -/** - * Transposes a tensor according to the provided axes. - * @param {any} tensor - The input tensor to transpose. - * @param {Array} axes - The axes to transpose the tensor along. - * @returns {Tensor} The transposed tensor. - */ -export function transpose(tensor: any, axes: any[]): Tensor; -/** - * Concatenates an array of tensors along the 0th dimension. - * - * @param {any} tensors - The array of tensors to concatenate. - * @returns {Tensor} - The concatenated tensor. - */ -export function cat(tensors: any): Tensor; -/** - * Interpolates an Tensor to the given size. - * @param {Tensor} input - The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w]) - * @param {number[]} size - The output size of the image - * @param {string} mode - The interpolation mode - * @param {boolean} align_corners - Whether to align corners. - * @returns {Tensor} - The interpolated tensor. - */ -export function interpolate(input: Tensor, [out_height, out_width]: number[], mode?: string, align_corners?: boolean): Tensor; -import { transpose as transpose_data } from "./math_utils.js"; -export { transpose_data }; diff --git a/dist/types/tokenizers.d.ts b/dist/types/tokenizers.d.ts deleted file mode 100644 index 73c1f0b67..000000000 --- a/dist/types/tokenizers.d.ts +++ /dev/null @@ -1,515 +0,0 @@ -export class AutoTokenizer { - static TOKENIZER_CLASS_MAPPING: { - T5Tokenizer: typeof T5Tokenizer; - DistilBertTokenizer: typeof DistilBertTokenizer; - BertTokenizer: typeof BertTokenizer; - MobileBertTokenizer: typeof MobileBertTokenizer; - SqueezeBertTokenizer: typeof SqueezeBertTokenizer; - AlbertTokenizer: typeof AlbertTokenizer; - GPT2Tokenizer: typeof GPT2Tokenizer; - BartTokenizer: typeof BartTokenizer; - RobertaTokenizer: typeof RobertaTokenizer; - WhisperTokenizer: typeof WhisperTokenizer; - CodeGenTokenizer: typeof CodeGenTokenizer; - CLIPTokenizer: typeof CLIPTokenizer; - MarianTokenizer: typeof MarianTokenizer; - }; - static from_pretrained(modelPath: any, progressCallback?: any): Promise; -} -/** - * BertTokenizer is a class used to tokenize text for BERT models. - * @extends PreTrainedTokenizer - */ -export class BertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs: any): any; -} -export class DistilBertTokenizer extends PreTrainedTokenizer { -} -export class T5Tokenizer extends PreTrainedTokenizer { -} -export class GPT2Tokenizer extends PreTrainedTokenizer { -} -declare class MobileBertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs: any): any; -} -declare class SqueezeBertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs: any): any; -} -/** - * Albert tokenizer - * @extends PreTrainedTokenizer - */ -declare class AlbertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ - prepare_model_inputs(inputs: any): any; -} -declare class BartTokenizer extends PreTrainedTokenizer { -} -declare class RobertaTokenizer extends PreTrainedTokenizer { -} -/** - * WhisperTokenizer tokenizer - * @extends PreTrainedTokenizer - */ -declare class WhisperTokenizer extends PreTrainedTokenizer { - static LANGUAGES: { - en: string; - zh: string; - de: string; - es: string; - ru: string; - ko: string; - fr: string; - ja: string; - pt: string; - tr: string; - pl: string; - ca: string; - nl: string; - ar: string; - sv: string; - it: string; - id: string; - hi: string; - fi: string; - vi: string; - he: string; - uk: string; - el: string; - ms: string; - cs: string; - ro: string; - da: string; - hu: string; - ta: string; - no: string; - th: string; - ur: string; - hr: string; - bg: string; - lt: string; - la: string; - mi: string; - ml: string; - cy: string; - sk: string; - te: string; - fa: string; - lv: string; - bn: string; - sr: string; - az: string; - sl: string; - kn: string; - et: string; - mk: string; - br: string; - eu: string; - is: string; - hy: string; - ne: string; - mn: string; - bs: string; - kk: string; - sq: string; - sw: string; - gl: string; - mr: string; - pa: string; - si: string; - km: string; - sn: string; - yo: string; - so: string; - af: string; - oc: string; - ka: string; - be: string; - tg: string; - sd: string; - gu: string; - am: string; - yi: string; - lo: string; - uz: string; - fo: string; - ht: string; - ps: string; - tk: string; - nn: string; - mt: string; - sa: string; - lb: string; - my: string; - bo: string; - tl: string; - mg: string; - as: string; - tt: string; - haw: string; - ln: string; - ha: string; - ba: string; - jw: string; - su: string; - }; - /** - * Decodes automatic speech recognition (ASR) sequences. - * @param {Array.<{tokens: Array., stride: [number, number, number]}>} sequences The sequences to decode. - * @param {Object} options - The options to use for decoding. - * @returns {[string, {chunks?:Array.<{language: string|null, timestamp: [number|null, number|null], text: string}>}]} The decoded sequences. - */ - _decode_asr(sequences: Array<{ - tokens: Array; - stride: [number, number, number]; - }>, { return_timestamps, return_language, time_precision, force_full_sequences }?: any): [string, { - chunks?: Array<{ - language: string | null; - timestamp: [number | null, number | null]; - text: string; - }>; - }]; - /** - * Finds the longest common sequence among the provided sequences. - * @param {number[][]} sequences - An array of sequences of token ids to compare. - * @returns {number[]} - The longest common sequence found. - * @throws {Error} - If there is a bug within the function. - */ - findLongestCommonSequence(sequences: number[][]): number[]; -} -declare class CodeGenTokenizer extends PreTrainedTokenizer { -} -declare class CLIPTokenizer extends PreTrainedTokenizer { -} -declare class MarianTokenizer extends PreTrainedTokenizer { - languageRegex: RegExp; - supported_language_codes: any; -} -declare class PreTrainedTokenizer extends Callable { - /** - * Creates a new Tokenizer instance with the tokenizer configuration and files - * downloaded from a pretrained model located at the given model path. - * - * @param {string} modelPath - The path to the pretrained model. - * @param {function} [progressCallback=null] - Optional callback function that will be called with the current - * progress percentage (0 to 100) each time a file is downloaded. - * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the modelPath. - */ - static from_pretrained(modelPath: string, progressCallback?: Function): Promise; - /** - * Create a new PreTrainedTokenizer instance. - * @param {Object} tokenizerJSON - The JSON of the tokenizer. - * @param {Object} tokenizerConfig - The config of the tokenizer. - */ - constructor(tokenizerJSON: any, tokenizerConfig: any); - tokenizerJSON: any; - tokenizerConfig: any; - normalizer: Normalizer; - pre_tokenizer: PreTokenizer; - model: TokenizerModel; - post_processor: PostProcessor; - decoder: Decoder; - special_tokens: any[]; - all_special_ids: any[]; - special_tokens_regex: RegExp; - mask_token: string; - mask_token_id: any; - pad_token: string; - pad_token_id: any; - sep_token: string; - sep_token_id: any; - model_max_length: any; - remove_space: any; - padding_side: string; - /** - * Returns the value of the first matching key in the tokenizer config object. - * @param {...string} keys - One or more keys to search for in the tokenizer config object. - * @returns {string|null} - The value associated with the first matching key, or null if no match is found. - * @throws {Error} - If an object is found for a matching key and its __type property is not "AddedToken". - */ - getToken(...keys: string[]): string | null; - /** - * This function can be overridden by a subclass to apply additional preprocessing - * to a model's input data. - * @param {Object} inputs - An object containing input data as properties. - * @returns {Object} The modified inputs object. - */ - prepare_model_inputs(inputs: any): any; - /** - * Encode/tokenize the given text(s). - * @param {string|string[]} text - The text to tokenize. - * @param {object} options - An optional object containing the following properties: - * @param {string|string[]} [options.text_pair=null] - Optional second sequence to be encoded. If set, must be the same type as text. - * @param {boolean} [options.padding=false] - Whether to pad the input sequences. - * @param {boolean} [options.truncation=null] - Whether to truncate the input sequences. - * @param {number} [options.max_length=null] - Maximum length of the returned list and optionally padding length. - * @param {boolean} [options.return_tensor=true] - Whether to return the results as Tensors or arrays. - * @returns {{ input_ids: number[]|number[][]|Tensor; attention_mask: any[]|Tensor; }} Object to be passed to the model. - */ - _call(text: string | string[], { text_pair, padding, truncation, max_length, return_tensor, }?: { - text_pair?: string | string[]; - padding?: boolean; - truncation?: boolean; - max_length?: number; - return_tensor?: boolean; - }): { - input_ids: number[] | number[][] | Tensor; - attention_mask: any[] | Tensor; - }; - /** - * Encodes a single text using the preprocessor pipeline of the tokenizer. - * - * @param {string|null} text - The text to encode. - * @returns {Array} The encoded tokens. - */ - _encode_text(text: string | null): any[]; - /** - * Encodes a single text or a pair of texts using the model's tokenizer. - * - * @param {string} text - The text to encode. - * @param {string|null} text_pair - The optional second text to encode. - * @returns {number[]} An array of token IDs representing the encoded text(s). - */ - encode(text: string, text_pair?: string | null): number[]; - /** - * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms - * @param {string} text - The text to clean up. - * @returns {string} - The cleaned up text. - */ - clean_up_tokenization(text: string): string; - /** - * Decode a batch of tokenized sequences. - * @param {number[][]} batch - List of tokenized input sequences. - * @param {Object} decode_args - (Optional) Object with decoding arguments. - * @returns {string[]} List of decoded sequences. - */ - batch_decode(batch: number[][], decode_args?: any): string[]; - /** - * Decodes a sequence of token IDs back to a string. - * - * @param {number[]} token_ids - List of token IDs to decode. - * @param {Object} [decode_args={}] - * @param {boolean} [decode_args.skip_special_tokens=false] - If true, special tokens are removed from the output string. - * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - If true, spaces before punctuations and abbreviated forms are removed. - * - * @returns {string} The decoded string. - * @throws {Error} If `token_ids` is not a non-empty array of integers. - */ - decode(token_ids: number[], decode_args?: { - skip_special_tokens?: boolean; - clean_up_tokenization_spaces?: boolean; - }): string; - /** - * Decode a single list of token ids to a string. - * @param {number[]} token_ids - List of token ids to decode - * @param {object} decode_args - Optional arguments for decoding - * @param {boolean} [decode_args.skip_special_tokens=false] - Whether to skip special tokens during decoding - * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - Whether to clean up tokenization spaces during decoding - * @returns {string} - The decoded string - */ - decode_single(token_ids: number[], { skip_special_tokens, clean_up_tokenization_spaces, }: { - skip_special_tokens?: boolean; - clean_up_tokenization_spaces?: boolean; - }): string; -} -import { Callable } from "./utils.js"; -/** - * A base class for text normalization. - * @abstract - */ -declare class Normalizer extends Callable { - /** - * Factory method for creating normalizers from config objects. - * @static - * @param {object} config - The configuration object for the normalizer. - * @returns {Normalizer} - A Normalizer object. - * @throws {Error} - If an unknown Normalizer type is specified in the config. - */ - static fromConfig(config: object): Normalizer; - /** - * @param {object} config - The configuration object for the normalizer. - */ - constructor(config: object); - config: any; - /** - * Normalize the input text. - * @abstract - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - * @throws {Error} - If this method is not implemented in a subclass. - */ - normalize(text: string): string; - /** - * Alias for {@link Normalizer#normalize}. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - */ - _call(text: string): string; -} -/** - * A callable class representing a pre-tokenizer used in tokenization. Subclasses - * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic. - * @extends Callable - */ -declare class PreTokenizer extends Callable { - /** - * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration. - * - * @static - * @param {Object} config - A configuration object for the pre-tokenizer. - * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`. - * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer. - */ - static fromConfig(config: any): PreTokenizer; - /** - * Method that should be implemented by subclasses to define the specific pre-tokenization logic. - * - * @abstract - * @param {string} text - The text to pre-tokenize. - * @returns {string[]} The pre-tokenized text. - * @throws {Error} If the method is not implemented in the subclass. - */ - pre_tokenize_text(text: string): string[]; - /** - * Tokenizes the given text into pre-tokens. - * @param {string|string[]} text - The text or array of texts to pre-tokenize. - * @returns {string[]} An array of pre-tokens. - */ - pre_tokenize(text: string | string[]): string[]; - /** - * Alias for {@link PreTokenizer#pre_tokenize}. - * @param {string|string[]} text - The text or array of texts to pre-tokenize. - * @returns {string[]} An array of pre-tokens. - */ - _call(text: string | string[]): string[]; -} -/** - * Abstract base class for tokenizer models. - * - * @extends Callable - */ -declare class TokenizerModel extends Callable { - /** - * Instantiates a new TokenizerModel instance based on the configuration object provided. - * @param {object} config - The configuration object for the TokenizerModel. - * @param {...*} args - Optional arguments to pass to the specific TokenizerModel constructor. - * @returns {TokenizerModel} A new instance of a TokenizerModel. - * @throws Will throw an error if the TokenizerModel type in the config is not recognized. - */ - static fromConfig(config: object, ...args: any[]): TokenizerModel; - /** - * Creates a new instance of TokenizerModel. - * @param {object} config - The configuration object for the TokenizerModel. - */ - constructor(config: object); - config: any; - /** - * Internal function to call the TokenizerModel instance. - * @param {string[]} tokens - The tokens to encode. - * @returns {number[]} The encoded token IDs. - */ - _call(tokens: string[]): number[]; - /** - * Encodes a list of tokens into a list of token IDs. - * @param {string[]} tokens - The tokens to encode. - * @returns {number[]} The encoded token IDs. - * @throws Will throw an error if not implemented in a subclass. - */ - encode(tokens: string[]): number[]; - /** - * Converts a list of tokens into a list of token IDs. - * @param {string[]} tokens - The tokens to convert. - * @returns {number[]} The converted token IDs. - */ - convert_tokens_to_ids(tokens: string[]): number[]; - /** - * Converts a list of token IDs into a list of tokens. - * @param {number[]} ids - The token IDs to convert. - * @returns {string[]} The converted tokens. - */ - convert_ids_to_tokens(ids: number[]): string[]; -} -/** - * @extends Callable - */ -declare class PostProcessor extends Callable { - /** - * Factory method to create a PostProcessor object from a configuration object. - * - * @param {Object} config - Configuration object representing a PostProcessor. - * @returns {PostProcessor} A PostProcessor object created from the given configuration. - * @throws {Error} If an unknown PostProcessor type is encountered. - */ - static fromConfig(config: any): PostProcessor; - /** - * Method to be implemented in subclass to apply post-processing on the given tokens. - * - * @param {Array} tokens - The input tokens to be post-processed. - * @param {...*} args - Additional arguments required by the post-processing logic. - * @returns {Array} The post-processed tokens. - * @throws {Error} If the method is not implemented in subclass. - */ - post_process(tokens: any[], ...args: any[]): any[]; - /** - * Alias for {@link PostProcessor#post_process}. - * @param {Array} tokens - The text or array of texts to post-process. - * @param {...*} args - Additional arguments required by the post-processing logic. - * @returns {Array} An array of post-processed tokens. - */ - _call(tokens: any[], ...args: any[]): any[]; -} -/** - * The base class for token decoders. - * @extends Callable - */ -declare class Decoder extends Callable { - /** - * Creates a decoder instance based on the provided configuration. - * - * @param {Object} config - The configuration object. - * @returns {Decoder} A decoder instance. - * @throws {Error} If an unknown decoder type is provided. - */ - static fromConfig(config: any): Decoder; - /** - * Creates an instance of `Decoder`. - * - * @param {Object} config - The configuration object. - */ - constructor(config: any); - config: any; - /** - * Converts a list of tokens to a string. - * - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - */ - convert_tokens_to_string(tokens: string[]): string; - /** - * Calls the `decode` method. - * - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - */ - _call(tokens: string[]): string; - /** - * Decodes a list of tokens. - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - * @throws {Error} If the `decode` method is not implemented in the subclass. - */ - decode(tokens: string[]): string; -} -import { Tensor } from "./tensor_utils.js"; -export {}; diff --git a/dist/types/transformers.d.ts b/dist/types/transformers.d.ts deleted file mode 100644 index 45370f76a..000000000 --- a/dist/types/transformers.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AutoTokenizer } from "./tokenizers.js"; -import { BertTokenizer } from "./tokenizers.js"; -import { DistilBertTokenizer } from "./tokenizers.js"; -import { T5Tokenizer } from "./tokenizers.js"; -import { GPT2Tokenizer } from "./tokenizers.js"; -import { AutoModel } from "./models.js"; -import { AutoModelForSeq2SeqLM } from "./models.js"; -import { AutoModelForSequenceClassification } from "./models.js"; -import { AutoModelForTokenClassification } from "./models.js"; -import { AutoModelForCausalLM } from "./models.js"; -import { AutoModelForMaskedLM } from "./models.js"; -import { AutoModelForQuestionAnswering } from "./models.js"; -import { AutoModelForVision2Seq } from "./models.js"; -import { AutoModelForImageClassification } from "./models.js"; -import { AutoModelForObjectDetection } from "./models.js"; -import { AutoProcessor } from "./processors.js"; -import { pipeline } from "./pipelines.js"; -import { Tensor } from "./tensor_utils.js"; -import { env } from "./env.js"; -export { AutoTokenizer, BertTokenizer, DistilBertTokenizer, T5Tokenizer, GPT2Tokenizer, AutoModel, AutoModelForSeq2SeqLM, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoModelForCausalLM, AutoModelForMaskedLM, AutoModelForQuestionAnswering, AutoModelForVision2Seq, AutoModelForImageClassification, AutoModelForObjectDetection, AutoProcessor, pipeline, Tensor, env }; diff --git a/dist/types/utils.d.ts b/dist/types/utils.d.ts deleted file mode 100644 index a6cb14a18..000000000 --- a/dist/types/utils.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -/** - * A base class for creating callable objects. - * - * @extends Function - */ -export class Callable extends Function { - /** - * Creates a new instance of the Callable class. - */ - constructor(); - /** - * This method should be implemented in subclasses to provide the - * functionality of the callable object. - * - * @throws {Error} Must implement _call method in subclass - * @param {...*} args - */ - _call(...args: any[]): void; -} -/** - * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API. - * - * @async - * @function getModelFile - * @param {string} modelPath - The path of the model file. - * @param {string} fileName - The name of the model file. - * @param {function} [progressCallback=null] - A function to call when the download progress is updated. - * @returns {Promise} A Promise that resolves with the file content as a buffer. - * @throws Will throw an error if the file is not found. - */ -export function getModelFile(modelPath: string, fileName: string, progressCallback?: Function, fatal?: boolean): Promise; -/** - * Helper function to dispatch progress callbacks. - * - * @function dispatchCallback - * @param {function} progressCallback - The progress callback function to dispatch. - * @param {any} data - The data to pass to the progress callback function. - * @returns {void} - */ -export function dispatchCallback(progressCallback: Function, data: any): void; -/** - * Fetches a JSON file from a given path and file name. - * - * @param {string} modelPath - The path to the directory containing the file. - * @param {string} fileName - The name of the file to fetch. - * @param {function} progressCallback - A callback function to receive progress updates. Optional. - * @returns {Promise} - The JSON data parsed into a JavaScript object. - */ -export function fetchJSON(modelPath: string, fileName: string, progressCallback?: Function, fatal?: boolean): Promise; -/** - * Joins multiple parts of a path into a single path, while handling leading and trailing slashes. - * - * @param {...string} parts - Multiple parts of a path. - * @returns {string} A string representing the joined path. - */ -export function pathJoin(...parts: string[]): string; -/** - * Reverses the keys and values of an object. - * - * @param {object} data - The object to reverse. - * @returns {object} The reversed object. - * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript - */ -export function reverseDictionary(data: object): object; -/** - * Returns the index of the maximum value in an array. - * @param {Array} arr - The input array. - * @see https://stackoverflow.com/a/11301464 - * @returns {number} - The index of the maximum value in the array. - */ -export function indexOfMax(arr: any[]): number; -/** - * Compute the softmax of an array of numbers. - * - * @param {number[]} arr - The array of numbers to compute the softmax of. - * @returns {number[]} The softmax array. - */ -export function softmax(arr: number[]): number[]; -/** - * Calculates the logarithm of the softmax function for the input array. - * @param {number[]} arr - The input array to calculate the log_softmax function for. - * @returns {any} - The resulting log_softmax array. - */ -export function log_softmax(arr: number[]): any; -/** - * Escapes regular expression special characters from a string by replacing them with their escaped counterparts. - * - * @param {string} string - The string to escape. - * @returns {string} - The escaped string. - */ -export function escapeRegExp(string: string): string; -/** - * Get the top k items from an iterable, sorted by descending order - * - * @param {Array} items - The items to be sorted - * @param {number} [top_k=0] - The number of top items to return (default: 0 = return all) - * @returns {Array} - The top k items, sorted by descending order - */ -export function getTopItems(items: any[], top_k?: number): any[]; -/** - * Calculates the dot product of two arrays. - * @param {number[]} arr1 - The first array. - * @param {number[]} arr2 - The second array. - * @returns {number} - The dot product of arr1 and arr2. - */ -export function dot(arr1: number[], arr2: number[]): number; -/** - * Computes the cosine similarity between two arrays. - * - * @param {number[]} arr1 - The first array. - * @param {number[]} arr2 - The second array. - * @returns {number} The cosine similarity between the two arrays. - */ -export function cos_sim(arr1: number[], arr2: number[]): number; -/** - * Calculates the magnitude of a given array. - * @param {number[]} arr - The array to calculate the magnitude of. - * @returns {number} The magnitude of the array. - */ -export function magnitude(arr: number[]): number; -/** - * Helper function to get a file, using either the Fetch API or FileSystem API. - * - * @async - * @function getFile - * @param {string|URL} url - The URL of the file to get. - * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API). - */ -export function getFile(url: string | URL): Promise; -/** - * Check if a value is an integer. - * @param {*} x - The value to check. - * @returns {boolean} - True if the value is a string, false otherwise. - */ -export function isIntegralNumber(x: any): boolean; -/** - * Check if a value is a string. - * @param {*} text - The value to check. - * @returns {boolean} - True if the value is a string, false otherwise. - */ -export function isString(text: any): boolean; -/** - * Check if a value is exists. - * @param {*} x - The value to check. - * @returns {boolean} - True if the value exists, false otherwise. - */ -export function exists(x: any): boolean; -/** - * Returns the minimum item. - * @param {number[]} arr - array of numbers. - * @returns {number} - the minimum number. - * @throws {Error} If array is empty. - */ -export function min(arr: number[]): number; -/** - * Returns the maximum item. - * @param {number[]} arr - array of numbers. - * @returns {number} - the maximum number. - * @throws {Error} If array is empty. - */ -export function max(arr: number[]): number; -declare class FileResponse { - /** - * Creates a new `FileResponse` object. - * @param {string|URL} filePath - */ - constructor(filePath: string | URL); - filePath: string | URL; - headers: {}; - exists: boolean; - status: number; - statusText: string; - body: ReadableStream; - /** - * Updates the 'content-type' header property of the response based on the extension of - * the file specified by the filePath property of the current object. - * @function - * @returns {void} - */ - updateContentType(): void; - /** - * @function - * @returns {FileResponse} - */ - clone(): FileResponse; - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with an ArrayBuffer containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with an ArrayBuffer containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - arrayBuffer(): Promise; - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a Blob containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a Blob containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - blob(): Promise; - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a string containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a string containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - text(): Promise; - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a parsed JavaScript object containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a parsed JavaScript object containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - json(): Promise; -} -export {}; diff --git a/docs/build/.gitignore b/docs/build/.gitignore new file mode 100644 index 000000000..10b0e9eca --- /dev/null +++ b/docs/build/.gitignore @@ -0,0 +1,3 @@ +# This folder contains the build files for the documentation. Do not commit these files. +* +!.gitignore diff --git a/docs/jsdoc-conf.json b/docs/jsdoc-conf.json new file mode 100644 index 000000000..874919cbc --- /dev/null +++ b/docs/jsdoc-conf.json @@ -0,0 +1,5 @@ +{ + "source": { + "excludePattern": "" + } +} \ No newline at end of file diff --git a/docs/scripts/build_readme.py b/docs/scripts/build_readme.py new file mode 100644 index 000000000..731861f7d --- /dev/null +++ b/docs/scripts/build_readme.py @@ -0,0 +1,117 @@ + +import re +README_TEMPLATE = """ + +

+
+ + + + transformers.js javascript library logo + +
+

+ +

+ + NPM + + + Downloads + + + License + + + Documentation + +

+ +{intro} + +## Quick tour + +{quick_tour} + +## Installation + +{installation} + +## Examples + +{examples} + +## Custom usage + +{custom_usage} + +## Supported tasks/models + +Here is the list of all tasks and models currently supported by Transformers.js. +If you don't see your task/model listed here or it is not yet supported, feel free +to open up a feature request [here](https://github.com/xenova/transformers.js/issues/new/choose). + +{tasks} + +{models} +""" + + +FILES_TO_INCLUDE = dict( + intro='./docs/snippets/0_introduction.snippet', + quick_tour='./docs/snippets/1_quick-tour.snippet', + installation='./docs/snippets/2_installation.snippet', + examples='./docs/snippets/3_examples.snippet', + custom_usage='./docs/snippets/4_custom-usage.snippet', + tasks='./docs/snippets/5_supported-tasks.snippet', + models='./docs/snippets/6_supported-models.snippet', +) + +# Map of custom links to replace, typically used for links to other sections of the README. +CUSTOM_LINK_MAP = { + '/custom_usage#convert-your-models-to-onnx': '#convert-your-models-to-onnx', +} + + +def main(): + + DOCS_BASE_URL = 'https://huggingface.co/docs/transformers.js' + + file_data = {} + for key, file_path in FILES_TO_INCLUDE.items(): + with open(file_path, encoding='utf-8') as f: + file_data[key] = f.read() + + # Fix links: + # NOTE: This regex does not match all markdown links, but works for the ones we need to replace. + LINK_RE = r'(?<=\])\((.+?)\)' + + def replace_fn(match): + link = match.group(1) + + if link in CUSTOM_LINK_MAP: + link = CUSTOM_LINK_MAP[link] + + elif link.startswith('/'): + # Link to docs + link = DOCS_BASE_URL + link + + elif link.startswith('./'): + # Relative link to file + pass + + elif link.startswith('http'): + # Link to external site + pass + + return f'({link})' + + result = README_TEMPLATE.format(**file_data) + result = re.sub(LINK_RE, replace_fn, result, 0, re.MULTILINE) + + with open('README.md', 'w', encoding='utf-8') as f: + f.write(result) + + +if __name__ == '__main__': + main() diff --git a/docs/scripts/generate.js b/docs/scripts/generate.js new file mode 100644 index 000000000..93bc07ff6 --- /dev/null +++ b/docs/scripts/generate.js @@ -0,0 +1,68 @@ +// Based on [this tutorial](https://github.com/jsdoc2md/jsdoc-to-markdown/wiki/How-to-create-one-output-file-per-class). + +import fs from 'fs'; +import path from 'path'; +import url from 'url'; + +import jsdoc2md from 'jsdoc-to-markdown'; + +const docs = path.dirname(path.dirname(url.fileURLToPath(import.meta.url))); +const root = path.dirname(docs); + +// jsdoc config file +const conf = path.join(docs, 'jsdoc-conf.json'); + +// input and output paths +const inputFile = path.join(root, '/src/**/*.js'); +const outputDir = path.join(root, '/docs/source/api/'); + + +// get template data +const templateData = jsdoc2md.getTemplateDataSync({ + files: inputFile, + configure: conf +}) + +// reduce templateData to an array of module names +const moduleNames = templateData.reduce( + (moduleNames, identifier) => { + if (identifier.kind === 'module') { + moduleNames.push(identifier.name) + } + return moduleNames + }, [] +) + +// create a documentation file for each module +for (const moduleName of moduleNames) { + const template = `{{#module name="${moduleName}"}}{{>docs}}{{/module}}`; + console.log(`rendering ${moduleName}, template: ${template}`); + let output = jsdoc2md.renderSync({ + 'data': templateData, + 'template': template, + 'heading-depth': 1, + 'no-gfm': true, + 'name-format': 'backticks', + 'no-cache': true, + 'separators': true, + 'configure': conf, + }); + + // Post-processing + output = output.replace(/(^#+\s.+)/gm, '$1\n'); // Add new line after each header + + // Unescape some of the characters which jsdoc2md escapes: + // TODO: May need to extend this list + output = output.replace(/\\([|_&*])/gm, '$1'); + + output = output.replaceAll('<', '&lt;'); + output = output.replaceAll('>', '&gt;'); + + output = output.replaceAll('new exports.', 'new '); + + let outputPath = path.resolve(outputDir, `${moduleName}.md`); + + fs.mkdirSync(path.dirname(outputPath), { recursive: true }); + fs.writeFileSync(outputPath, output); + +} diff --git a/docs/snippets/0_introduction.snippet b/docs/snippets/0_introduction.snippet new file mode 100644 index 000000000..645e36412 --- /dev/null +++ b/docs/snippets/0_introduction.snippet @@ -0,0 +1,12 @@ + +State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server! + +Transformers.js is designed to be functionally equivalent to Hugging Face's [transformers](https://github.com/huggingface/transformers) python library, meaning you can run the same pretrained models using a very similar API. These models support common tasks in different modalities, such as: + - 📝 **Natural Language Processing**: text classification, named entity recognition, question answering, language modeling, summarization, translation, multiple choice, and text generation. + - 🖼️ **Computer Vision**: image classification, object detection, and segmentation. + - 🗣️ **Audio**: automatic speech recognition and audio classification. + - 🐙 **Multimodal**: zero-shot image classification. + +Transformers.js uses [ONNX Runtime](https://onnxruntime.ai/) to run models in the browser. The best part about it, is that you can easily [convert](/custom_usage#convert-your-models-to-onnx) your pretrained PyTorch, TensorFlow, or JAX models to ONNX using [🤗 Optimum](https://github.com/huggingface/optimum#onnx--onnx-runtime). + +For more information, check out the full [documentation](https://huggingface.co/docs/transformers.js). diff --git a/docs/snippets/1_quick-tour.snippet b/docs/snippets/1_quick-tour.snippet new file mode 100644 index 000000000..75493d49a --- /dev/null +++ b/docs/snippets/1_quick-tour.snippet @@ -0,0 +1,44 @@ + +It's super simple to translate from existing code! Just like the python library, we support the `pipeline` API. Pipelines group together a pretrained model with preprocessing of inputs and postprocessing of outputs, making it the easiest way to run models with the library. + + + + + + + + + + +
Python (original)Javascript (ours)
+ +```python +from transformers import pipeline + +# Allocate a pipeline for sentiment-analysis +pipe = pipeline('sentiment-analysis') + +out = pipe('I love transformers!') +# [{'label': 'POSITIVE', 'score': 0.999806941}] +``` + + + +```javascript +import { pipeline } from '@xenova/transformers'; + +// Allocate a pipeline for sentiment-analysis +let pipe = await pipeline('sentiment-analysis'); + +let out = await pipe('I love transformers!'); +// [{'label': 'POSITIVE', 'score': 0.999817686}] +``` + +
+ + +You can also use a different model by specifying the model id or path as the second argument to the `pipeline` function. For example: +```javascript +// Use a different model for sentiment-analysis +let pipe = await pipeline('sentiment-analysis', 'nlptown/bert-base-multilingual-uncased-sentiment'); +``` diff --git a/docs/snippets/2_installation.snippet b/docs/snippets/2_installation.snippet new file mode 100644 index 000000000..0127fd92d --- /dev/null +++ b/docs/snippets/2_installation.snippet @@ -0,0 +1,12 @@ + +To install via [NPM](https://www.npmjs.com/package/@xenova/transformers), run: +```bash +npm i @xenova/transformers +``` + +Alternatively, you can use it in vanilla JS, without any bundler, by using a CDN or static hosting. For example, using [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), you can import the library with: +```html + +``` diff --git a/docs/snippets/3_examples.snippet b/docs/snippets/3_examples.snippet new file mode 100644 index 000000000..21804bce0 --- /dev/null +++ b/docs/snippets/3_examples.snippet @@ -0,0 +1,9 @@ +Want to jump straight in? Get started with one of our sample applications/templates: + +| Platform | Description | Source code | +|-------------------|----------------------------------|-------------------------------| +| React | Multilingual translation website | [link](./examples/react-translator/) | +| Browser extension | Text classification extension | [link](./examples/extension/) | +| Electron | Text classification application | [link](./examples/electron/) | +| Next.js | *Coming soon* | [link](./examples/next/) | +| Node.js | *Coming soon* | [link](./examples/node/) | diff --git a/docs/snippets/4_custom-usage.snippet b/docs/snippets/4_custom-usage.snippet new file mode 100644 index 000000000..72f63b172 --- /dev/null +++ b/docs/snippets/4_custom-usage.snippet @@ -0,0 +1,46 @@ + + +By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/), which should work out-of-the-box. You can customize this as follows: + + +### Settings + +```javascript +import { env } from '@xenova/transformers'; + +// Specify a custom location for models (defaults to '/models/'). +env.localModelPath = '/path/to/models/'; + +// Disable the loading of remote models from the Hugging Face Hub: +env.allowRemoteModels = false; + +// Set location of .wasm files. Defaults to use a CDN. +env.backends.onnx.wasm.wasmPaths = '/path/to/files/'; +``` + +For a full list of available settings, check out the [API Reference](/api/env). + +### Convert your models to ONNX + +We recommend using our [conversion script](https://github.com/xenova/transformers.js/blob/main/scripts/convert.py) to convert your PyTorch, TensorFlow, or JAX models to ONNX in a single command. Behind the scenes, it uses [🤗 Optimum](https://huggingface.co/docs/optimum) to perform conversion and quantization of your model. + +```bash +python -m scripts.convert --quantize --model_id +``` + +For example, convert and quantize [bert-base-uncased](https://huggingface.co/bert-base-uncased) using: +```bash +python -m scripts.convert --quantize --model_id bert-base-uncased +``` + +This will save the following files to `./models/`: + +``` +bert-base-uncased/ +├── config.json +├── tokenizer.json +├── tokenizer_config.json +└── onnx/ + ├── model.onnx + └── model_quantized.onnx +``` diff --git a/docs/snippets/5_supported-tasks.snippet b/docs/snippets/5_supported-tasks.snippet new file mode 100644 index 000000000..8e75aa41c --- /dev/null +++ b/docs/snippets/5_supported-tasks.snippet @@ -0,0 +1,68 @@ + +### Tasks + +#### Natual Language Processing + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Conversational](https://huggingface.co/tasks/conversational) | `conversational` | Generating conversational text that is relevant, coherent and knowledgable given a prompt. | ❌ | +| [Fill-Mask](https://huggingface.co/tasks/fill-mask) | `fill-mask` | Masking some of the words in a sentence and predicting which words should replace those masks. | ✅ | +| [Question Answering](https://huggingface.co/tasks/question-answering) | `question-answering` | Retrieve the answer to a question from a given text. | ✅ | +| [Sentence Similarity](https://huggingface.co/tasks/sentence-similarity) | `sentence-similarity` | Determining how similar two texts are. | ✅ | +| [Summarization](https://huggingface.co/tasks/summarization) | `summarization` | Producing a shorter version of a document while preserving its important information. | ✅ | +| [Table Question Answering](https://huggingface.co/tasks/table-question-answering) | `table-question-answering` | Answering a question about information from a given table. | ❌ | +| [Text Classification](https://huggingface.co/tasks/text-classification) | `text-classification` or `sentiment-analysis` | Assigning a label or class to a given text. | ✅ | +| [Text Generation](https://huggingface.co/tasks/text-generation#completion-generation-models) | `text-generation` | Producing new text by predicting the next word in a sequence. | ✅ | +| [Text-to-text Generation](https://huggingface.co/tasks/text-generation#text-to-text-generation-models) | `text2text-generation` | Converting one text sequence into another text sequence. | ✅ | +| [Token Classification](https://huggingface.co/tasks/token-classification) | `token-classification` or `ner` | Assigning a label to each token in a text. | ✅ | +| [Translation](https://huggingface.co/tasks/translation) | `translation` | Converting text from one language to another. | ✅ | +| [Zero-Shot Classification](https://huggingface.co/tasks/zero-shot-classification) | `zero-shot-classification` | Classifying text into classes that are unseen during training. | ✅ | + +#### Vision + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Depth Estimation](https://huggingface.co/tasks/depth-estimation) | `depth-estimation` | Predicting the depth of objects present in an image. | ❌ | +| [Image Classification](https://huggingface.co/tasks/image-classification) | `image-classification` | Assigning a label or class to an entire image. | ✅ | +| [Image Segmentation](https://huggingface.co/tasks/image-segmentation) | `image-segmentation` | Divides an image into segments where each pixel is mapped to an object. This task has multiple variants such as instance segmentation, panoptic segmentation and semantic segmentation. | ✅ | +| [Image-to-Image](https://huggingface.co/tasks/image-to-image) | `image-to-image` | Transforming a source image to match the characteristics of a target image or a target image domain. | ❌ | +| [Mask Generation](https://huggingface.co/tasks/mask-generation) | `mask-generation` | Generate masks for the objects in an image. | ❌ | +| [Object Detection](https://huggingface.co/tasks/object-detection) | `object-detection` | Identify objects of certain defined classes within an image. | ✅ | +| [Video Classification](https://huggingface.co/tasks/video-classification) | n/a | Assigning a label or class to an entire video. | ❌ | +| [Unconditional Image Generation](https://huggingface.co/tasks/unconditional-image-generation) | n/a | Generating images with no condition in any context (like a prompt text or another image). | ❌ | + +#### Audio + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Audio Classification](https://huggingface.co/tasks/audio-classification) | `audio-classification` | Assigning a label or class to a given audio. | ❌ | +| [Audio-to-Audio](https://huggingface.co/tasks/audio-to-audio) | n/a | Generating audio from an input audio source. | ❌ | +| [Automatic Speech Recognition](https://huggingface.co/tasks/automatic-speech-recognition) | `automatic-speech-recognition` | Transcribing a given audio into text. | ✅ | +| [Text-to-Speech](https://huggingface.co/tasks/text-to-speech) | n/a | Generating natural-sounding speech given text input. | ❌ | + + +#### Tabular + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Tabular Classification](https://huggingface.co/tasks/tabular-classification) | n/a | Classifying a target category (a group) based on set of attributes. | ❌ | +| [Tabular Regression](https://huggingface.co/tasks/tabular-regression) | n/a | Predicting a numerical value given a set of attributes. | ❌ | + + +#### Multimodal + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Document Question Answering](https://huggingface.co/tasks/document-question-answering) | `document-question-answering` | Answering questions on document images. | ❌ | +| [Feature Extraction](https://huggingface.co/tasks/feature-extraction) | `feature-extraction` | Transforming raw data into numerical features that can be processed while preserving the information in the original dataset. | ✅ | +| [Image-to-Text](https://huggingface.co/tasks/image-to-text) | `image-to-text` | Output text from a given image. | ✅ | +| [Text-to-Image](https://huggingface.co/tasks/text-to-image) | `text-to-image` | Generates images from input text. | ❌ | +| [Visual Question Answering](https://huggingface.co/tasks/visual-question-answering) | `visual-question-answering` | Answering open-ended questions based on an image. | ❌ | +| [Zero-Shot Image Classification](https://huggingface.co/tasks/zero-shot-image-classification) | `zero-shot-image-classification` | Classifying images into classes that are unseen during training. | ✅ | + + +#### Reinforcement Learning + +| Task | ID | Description | Supported? | +|--------------------------|----|-------------|------------| +| [Reinforcement Learning](https://huggingface.co/tasks/reinforcement-learning) | n/a | Learning from actions by interacting with an environment through trial and error and receiving rewards (negative or positive) as feedback. | ❌ | diff --git a/docs/snippets/6_supported-models.snippet b/docs/snippets/6_supported-models.snippet new file mode 100644 index 000000000..e9e8a99ed --- /dev/null +++ b/docs/snippets/6_supported-models.snippet @@ -0,0 +1,23 @@ + +### Models + +1. **[ALBERT](https://huggingface.co/docs/transformers/model_doc/albert)** (from Google Research and the Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut. +1. **[BART](https://huggingface.co/docs/transformers/model_doc/bart)** (from Facebook) released with the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer. +1. **[BERT](https://huggingface.co/docs/transformers/model_doc/bert)** (from Google) released with the paper [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. +1. **[CLIP](https://huggingface.co/docs/transformers/model_doc/clip)** (from OpenAI) released with the paper [Learning Transferable Visual Models From Natural Language Supervision](https://arxiv.org/abs/2103.00020) by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. +1. **[CodeGen](https://huggingface.co/docs/transformers/model_doc/codegen)** (from Salesforce) released with the paper [A Conversational Paradigm for Program Synthesis](https://arxiv.org/abs/2203.13474) by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, Caiming Xiong. +1. **[DETR](https://huggingface.co/docs/transformers/model_doc/detr)** (from Facebook) released with the paper [End-to-End Object Detection with Transformers](https://arxiv.org/abs/2005.12872) by Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, Sergey Zagoruyko. +1. **[DistilBERT](https://huggingface.co/docs/transformers/model_doc/distilbert)** (from HuggingFace), released together with the paper [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter](https://arxiv.org/abs/1910.01108) by Victor Sanh, Lysandre Debut and Thomas Wolf. The same method has been applied to compress GPT2 into [DistilGPT2](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation), RoBERTa into [DistilRoBERTa](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation), Multilingual BERT into [DistilmBERT](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) and a German version of DistilBERT. +1. **[FLAN-T5](https://huggingface.co/docs/transformers/model_doc/flan-t5)** (from Google AI) released in the repository [google-research/t5x](https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints) by Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei +1. **[GPT Neo](https://huggingface.co/docs/transformers/model_doc/gpt_neo)** (from EleutherAI) released in the repository [EleutherAI/gpt-neo](https://github.com/EleutherAI/gpt-neo) by Sid Black, Stella Biderman, Leo Gao, Phil Wang and Connor Leahy. +1. **[GPT-2](https://huggingface.co/docs/transformers/model_doc/gpt2)** (from OpenAI) released with the paper [Language Models are Unsupervised Multitask Learners](https://blog.openai.com/better-language-models/) by Alec Radford*, Jeffrey Wu*, Rewon Child, David Luan, Dario Amodei** and Ilya Sutskever**. +1. **[MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)** Machine translation models trained using [OPUS](http://opus.nlpl.eu/) data by Jörg Tiedemann. The [Marian Framework](https://marian-nmt.github.io/) is being developed by the Microsoft Translator Team. +1. **[MobileBERT](https://huggingface.co/docs/transformers/model_doc/mobilebert)** (from CMU/Google Brain) released with the paper [MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices](https://arxiv.org/abs/2004.02984) by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. +1. **[MT5](https://huggingface.co/docs/transformers/model_doc/mt5)** (from Google AI) released with the paper [mT5: A massively multilingual pre-trained text-to-text transformer](https://arxiv.org/abs/2010.11934) by Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, Colin Raffel. +1. **[NLLB](https://huggingface.co/docs/transformers/model_doc/nllb)** (from Meta) released with the paper [No Language Left Behind: Scaling Human-Centered Machine Translation](https://arxiv.org/abs/2207.04672) by the NLLB team. +1. **[SqueezeBERT](https://huggingface.co/docs/transformers/model_doc/squeezebert)** (from Berkeley) released with the paper [SqueezeBERT: What can computer vision teach NLP about efficient neural networks?](https://arxiv.org/abs/2006.11316) by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W. Keutzer. +1. **[T5](https://huggingface.co/docs/transformers/model_doc/t5)** (from Google AI) released with the paper [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/abs/1910.10683) by Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu. +1. **[T5v1.1](https://huggingface.co/docs/transformers/model_doc/t5v1.1)** (from Google AI) released in the repository [google-research/text-to-text-transfer-transformer](https://github.com/google-research/text-to-text-transfer-transformer/blob/main/released_checkpoints.md#t511) by Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu. +1. **[Vision Transformer (ViT)](https://huggingface.co/docs/transformers/model_doc/vit)** (from Google AI) released with the paper [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929) by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby. +1. **[Whisper](https://huggingface.co/docs/transformers/model_doc/whisper)** (from OpenAI) released with the paper [Robust Speech Recognition via Large-Scale Weak Supervision](https://cdn.openai.com/papers/whisper.pdf) by Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, Ilya Sutskever. + diff --git a/docs/source/_toctree.yml b/docs/source/_toctree.yml new file mode 100644 index 000000000..791eb1a39 --- /dev/null +++ b/docs/source/_toctree.yml @@ -0,0 +1,54 @@ +- local: index + title: 🤗 Transformers.js +- sections: + - local: installation + title: Installation + - local: pipelines + title: The pipeline API + - local: custom_usage + title: Custom usage + title: Get started +- sections: + - local: tutorials/react + title: Building a React Application + - local: tutorials/browser-extension + title: Building a Browser Extension + - local: tutorials/electron + title: Building an Electron Application + title: Tutorials +- sections: + - local: api/transformers + title: Index + - local: api/pipelines + title: Pipelines + - local: api/models + title: Models + - local: api/tokenizers + title: Tokenizers + - local: api/processors + title: Processors + - local: api/env + title: Environment variables + - sections: + - local: api/backends/onnx + title: ONNX + title: Backends + isExpanded: false + - sections: + - local: api/utils/core + title: Core + - local: api/utils/hub + title: Hub + - local: api/utils/image + title: Image + - local: api/utils/audio + title: Audio + - local: api/utils/tensor + title: Tensor + - local: api/utils/maths + title: Maths + - local: api/utils/generation + title: Generation + title: Utilities + isExpanded: false + title: API Reference diff --git a/docs/source/api/.gitignore b/docs/source/api/.gitignore new file mode 100644 index 000000000..d4d8fcf9d --- /dev/null +++ b/docs/source/api/.gitignore @@ -0,0 +1,3 @@ +# These docs are automatically generated from the JSDoc in the source code. +* +!.gitignore diff --git a/docs/source/custom_usage.mdx b/docs/source/custom_usage.mdx new file mode 100644 index 000000000..4b7d961da --- /dev/null +++ b/docs/source/custom_usage.mdx @@ -0,0 +1,7 @@ +# Use custom models + + +{ + "path": "../snippets/4_custom-usage.snippet" +} + \ No newline at end of file diff --git a/docs/source/index.mdx b/docs/source/index.mdx new file mode 100644 index 000000000..ee60467c8 --- /dev/null +++ b/docs/source/index.mdx @@ -0,0 +1,40 @@ +# Transformers.js + + +{ + "path": "../snippets/0_introduction.snippet" +} + + +## Quick tour + + +{ + "path": "../snippets/1_quick-tour.snippet" +} + + + +## Contents + +The documentation is organized into 3 sections: +1. **GET STARTED** provides a quick tour of the library and installation instructions to get up and running. +2. **TUTORIALS** are a great place to start if you're a beginner! We also include sample applications for you to play around with! +3. **API REFERENCE** describes all classes and functions, as well as their available parameters and types. + +## Supported tasks/models + +Here is the list of all tasks and models currently supported by Transformers.js. If you don't see your task/model listed here or it is not yet supported, feel free to open up a feature request [here](https://github.com/xenova/transformers.js/issues/new/choose). + + +{ + "path": "../snippets/5_supported-tasks.snippet" +} + + + + +{ + "path": "../snippets/6_supported-models.snippet" +} + diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx new file mode 100644 index 000000000..0327f58ad --- /dev/null +++ b/docs/source/installation.mdx @@ -0,0 +1,7 @@ +# Installation + + +{ + "path": "../snippets/2_installation.snippet" +} + diff --git a/docs/source/pipelines.mdx b/docs/source/pipelines.mdx new file mode 100644 index 000000000..8d8fcde51 --- /dev/null +++ b/docs/source/pipelines.mdx @@ -0,0 +1,137 @@ +# The `pipeline` API + +Just like the [transformers Python library](https://github.com/huggingface/transformers), Transformers.js provides users with a simple way to leverage the power of transformers. The `pipeline()` function is the easiest and fastest way to use a pretrained model for inference. + + + +For the full list of available tasks/pipelines, check out [this table](#available-tasks). + + + + +## The basics + +Start by creating an instance of `pipeline()` and specifying a task you want to use it for. For example, to create a sentiment analysis pipeline, you can do: + +```javascript +import { pipeline } from '@xenova/transformers'; + +let classifier = await pipeline('sentiment-analysis'); +``` + +When running for the first time, the `pipeline` will download and cache the default pretrained model associated with the task. This can take a while, but subsequent calls will be much faster. + + + +By default, models will be downloaded from the [Hugging Face Hub](https://huggingface.co/models) and stored in [browser cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache), but there are ways to specify custom models and cache locations. For more information see [here](/custom_usage). + + + +You can now use the classifier on your target text by calling it as a function: + +```javascript +let result = await classifier('I love transformers!'); +// [{'label': 'POSITIVE', 'score': 0.9998}] +``` + +If you have multiple inputs, you can pass them as an array: + +```javascript +let result = await classifier(['I love transformers!', 'I hate transformers!']); +// [{'label': 'POSITIVE', 'score': 0.9998}, {'label': 'NEGATIVE', 'score': 0.9982}] +``` + +You can also specify a different model to use for the pipeline by passing it as the second argument to the `pipeline()` function. For example, to use a different model for sentiment analysis (like one trained to predict sentiment of a review as a number of stars between 1 and 5), you can do: + + + +```javascript +let reviewer = await pipeline('sentiment-analysis', 'Xenova/bert-base-multilingual-uncased-sentiment'); + +let result = await reviewer('The Shawshank Redemption is a true masterpiece of cinema.'); +// [{label: '5 stars', score: 0.8167929649353027}] +``` + +Transformers.js supports loading any model hosted on the Hugging Face Hub, provided it has ONNX weights (located in a subfolder called `onnx`). For more information on how to convert your PyTorch, TensorFlow, or JAX model to ONNX, see the [conversion section](/custom_usage#convert-your-models-to-onnx). + +The `pipeline()` function is a great way to quickly use a pretrained model for inference, as it takes care of all the preprocessing and postprocessing for you. For example, if you want to perform Automatic Speech Recognition (ASR) using OpenAI's Whisper model, you can do: + + +```javascript +// Allocate a pipeline for Automatic Speech Recognition +let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small.en'); + +// Transcribe an audio file, loaded from a URL. +let result = await transcriber('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac'); +// {text: ' I have a dream that one day this nation will rise up and live out the true meaning of its creed.'} +``` + +## Pipeline options + +Many pipelines have additional options that you can specify. For example, when using a model that does multilingual translation, you can specify the source and target languages like this: + + +```javascript +// Allocation a pipeline for translation +let translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M'); + +// Translate from English to Greek +let result = await translator('I like to walk my dog.', { + src_lang: 'eng_Latn', + tgt_lang: 'ell_Grek' +}); +// [ { translation_text: 'Μου αρέσει να περπατάω το σκυλί μου.' } ] + +// Translate back to English +let result2 = await translator(result[0].translation_text, { + src_lang: 'ell_Grek', + tgt_lang: 'eng_Latn' +}); +// [ { translation_text: 'I like to walk my dog.' } ] +``` + +When using models that support auto-regressive generation, you can specify generation parameters like the number of new tokens, sampling methods, temperature, repetition penalty, and much more. For a full list of available parameters, see to the [GenerationConfig](/api/utils/generation#module_utils/generation.GenerationConfig) class. + +For example, to generate a poem using `LaMini-Flan-T5-783M`, you can do: + + + +```javascript +// Allocate a pipeline for text2text-generation +let poet = await pipeline('text2text-generation', 'Xenova/LaMini-Flan-T5-783M'); +let result = await poet('Write me a love poem about cheese.', { + max_new_tokens: 200, + temperature: 0.9, + repetition_penalty: 2.0, + no_repeat_ngram_size: 3, + + // top_k: 20, + // do_sample: true, +}); +``` + +which outputs: + +``` +Cheese, oh cheese! You're the perfect comfort food. +Your texture so smooth and creamy you can never get old. +With every bite it melts in your mouth like buttery delights +that make me feel right at home with this sweet treat of mine. + +From classic to bold flavor combinations, +I love how versatile you are as an ingredient too? +Cheddar is my go-to for any occasion or mood; +It adds depth and richness without being overpowering its taste buds alone +``` + +For more information on the available options for each pipeline, refer to the [API Reference](/api/pipelines). +If you would like more control over the inference process, you can use the [`AutoModel`](/api/models), [`AutoTokenizer`](/api/tokenizers), or [`AutoProcessor`](/api/processors) classes instead. + + +## Available tasks + + +{ + "path": "../snippets/5_supported-tasks.snippet" +} + diff --git a/docs/source/tutorials/browser-extension.mdx b/docs/source/tutorials/browser-extension.mdx new file mode 100644 index 000000000..a5fd391bd --- /dev/null +++ b/docs/source/tutorials/browser-extension.mdx @@ -0,0 +1,4 @@ +# Building a browser extension + +*Full tutorial coming soon...* In the meantime, check out the example application: https://github.com/xenova/transformers.js/tree/main/examples/extension + diff --git a/docs/source/tutorials/electron.mdx b/docs/source/tutorials/electron.mdx new file mode 100644 index 000000000..6962e4b7e --- /dev/null +++ b/docs/source/tutorials/electron.mdx @@ -0,0 +1,3 @@ +# Building an Electron application + +*Full tutorial coming soon...* In the meantime, check out the example application: https://github.com/xenova/transformers.js/tree/main/examples/electron diff --git a/docs/source/tutorials/react.mdx b/docs/source/tutorials/react.mdx new file mode 100644 index 000000000..ce2f818f3 --- /dev/null +++ b/docs/source/tutorials/react.mdx @@ -0,0 +1,509 @@ + +# Building a React application + +In this tutorial, we'll be building a simple React application that performs multilingual translation using Transformers.js! The final product will look something like this: + +![Demo](https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/react-translator-demo.gif) + +Useful links: +- [Demo site](https://huggingface.co/spaces/Xenova/react-translator) +- [Source code](https://github.com/xenova/transformers.js/tree/main/examples/react-translator) + + +## Prerequisites + +- [Node.js](https://nodejs.org/en/) version 14.18+ or 16+ +- [npm](https://www.npmjs.com/) version 7+ + + +## Step 1: Initialise the project + +For this tutorial, we will use [Vite](https://vitejs.dev/) to initialise our project. Vite is a build tool that allows us to quickly set up a React application with minimal configuration. Run the following command in your terminal: + +```bash +npm create vite@latest react-translator -- --template react +``` + +If prompted to install `create-vite`, type y and press Enter. + +Next, enter the project directory and install the necessary development dependencies: + +```bash +cd react-translator +npm install +``` + +To test that our application is working, we can run the following command: + +```bash +npm run dev +``` + +Visiting the URL shown in the terminal (e.g., [http://localhost:5173/](http://localhost:5173/)) should show the default "React + Vite" landing page. +You can stop the development server by pressing Ctrl + C in the terminal. + +## Step 2: Install and configure Transformers.js + +Now we get to the fun part: adding machine learning to our application! First, install Transformers.js from [NPM](https://www.npmjs.com/package/@xenova/transformers) with the following command: + +```bash +npm install @xenova/transformers +``` + +For this application, we will use the [Xenova/nllb-200-distilled-600M](https://huggingface.co/Xenova/nllb-200-distilled-600M) model, which can perform multilingual translation among 200 languages. Before we start, there are 2 things we need to take note of: +1. ML inference can be quite computationally intensive, so it's better to load and run the models in a separate thread from the main (UI) thread. +2. Since the model is quite large (>1 GB), we don't want to download it until the user clicks the "Translate" button. + +We can achieve both of these goals by using a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) and some [React hooks](https://react.dev/reference/react). + +1. Create a file called `worker.js` in the `src` directory. This script will do all the heavy-lifing for us, including loading and running of the translation pipeline. To ensure the model is only loaded once, we will create the `MyTranslationPipeline` class which use the [singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern) to lazily create a single instance of the pipeline when `getInstance` is first called, and use this pipeline for all subsequent calls: + ```javascript + import { pipeline } from '@xenova/transformers'; + + class MyTranslationPipeline { + static task = 'translation'; + static model = 'Xenova/nllb-200-distilled-600M'; + static instance = null; + + static async getInstance(progress_callback = null) { + if (this.instance === null) { + this.instance = pipeline(this.task, this.model, { progress_callback }); + } + + return this.instance; + } + } + ``` + +2. Modify `App.jsx` in the `src` directory. This file is automatically created when initializing our React project, and will contain some boilerplate code. Inside the `App` function, let's create the web worker and store a reference to it using the `useRef` hook: + ```jsx + // Remember to import the relevant hooks + import { useEffect, useRef, useState } from 'react' + + function App() { + // Create a reference to the worker object. + const worker = useRef(null); + + // We use the `useEffect` hook to setup the worker as soon as the `App` component is mounted. + useEffect(() => { + if (!worker.current) { + // Create the worker if it does not yet exist. + worker.current = new Worker(new URL('./worker.js', import.meta.url), { + type: 'module' + }); + } + + // Create a callback function for messages from the worker thread. + const onMessageReceived = (e) => { + // TODO: Will fill in later + }; + + // Attach the callback function as an event listener. + worker.current.addEventListener('message', onMessageReceived); + + // Define a cleanup function for when the component is unmounted. + return () => worker.current.removeEventListener('message', onMessageReceived); + }); + + return ( + // TODO: Rest of our app goes here... + ) + } + + export default App + + ``` + + +## Step 3: Design the user interface + + + +We recommend starting the development server again with `npm run dev` +(if not already running) so that you can see your changes in real-time. + + + + + +First, let's define our components. Create a folder called `components` in the `src` directory, and create the following files: +1. `LanguageSelector.jsx`: This component will allow the user to select the input and output languages. Check out the full list of languages [here](https://github.com/xenova/transformers.js/blob/main/examples/react-translator/src/components/LanguageSelector.jsx). + ```jsx + const LANGUAGES = { + "Acehnese (Arabic script)": "ace_Arab", + "Acehnese (Latin script)": "ace_Latn", + "Afrikaans": "afr_Latn", + ... + "Zulu": "zul_Latn", + } + + export default function LanguageSelector({ type, onChange, defaultLanguage }) { + return ( +
+ + +
+ ) + } + ``` + + +1. `Progress.jsx`: This component will display the progress for downloading each model file. + ```jsx + export default function Progress({ text, percentage }) { + percentage = percentage ?? 0; + return ( +
+
+ {text} ({`${percentage.toFixed(2)}%`}) +
+
+ ); + } + ``` + +We can now use these components in `App.jsx` by adding these imports to the top of the file: +```jsx +import LanguageSelector from './components/LanguageSelector'; +import Progress from './components/Progress'; +``` + +Let's also add some state variables to keep track of a few things in our application, like model loading, languages, input text, and output text. Add the following code to the beginning of the `App` function in `src/App.jsx`: +```jsx +function App() { + + // Model loading + const [ready, setReady] = useState(null); + const [disabled, setDisabled] = useState(false); + const [progressItems, setProgressItems] = useState([]); + + // Inputs and outputs + const [input, setInput] = useState('I love walking my dog.'); + const [sourceLanguage, setSourceLanguage] = useState('eng_Latn'); + const [targetLanguage, setTargetLanguage] = useState('fra_Latn'); + const [output, setOutput] = useState(''); + + // rest of the code... +} +``` + + +Next, we can add our custom components to the main `App` component. We will also add two `textarea` elements for input and output text, and a `button` to trigger the translation. Modify the `return` statement to look like this: + +```jsx +return ( + <> +

Transformers.js

+

ML-powered multilingual translation in React!

+ +
+
+ setSourceLanguage(x.target.value)} /> + setTargetLanguage(x.target.value)} /> +
+ +
+ + +
+
+ + + +
+ {ready === false && ( + + )} + {progressItems.map(data => ( +
+ +
+ ))} +
+ +) +``` + +Don't worry about the `translate` function for now. We will define it in the next section. + +Finally, we can add some CSS to make our app look a little nicer. Modify the following files in the `src` directory: +1. `index.css`: +
+ View code + + ```css + :root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + color: #213547; + background-color: #ffffff; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; + } + + body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; + } + + h1 { + font-size: 3.2em; + line-height: 1; + } + + h1, + h2 { + margin: 8px; + } + + select { + padding: 0.3em; + cursor: pointer; + } + + textarea { + padding: 0.6em; + } + + button { + padding: 0.6em 1.2em; + cursor: pointer; + font-weight: 500; + } + + button[disabled] { + cursor: not-allowed; + } + + select, + textarea, + button { + border-radius: 8px; + border: 1px solid transparent; + font-size: 1em; + font-family: inherit; + background-color: #f9f9f9; + transition: border-color 0.25s; + } + + select:hover, + textarea:hover, + button:not([disabled]):hover { + border-color: #646cff; + } + + select:focus, + select:focus-visible, + textarea:focus, + textarea:focus-visible, + button:focus, + button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; + } + ``` +
+ +1. `App.css` +
+ View code + + ```css + #root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; + } + + .language-container { + display: flex; + gap: 20px; + } + + .textbox-container { + display: flex; + justify-content: center; + gap: 20px; + width: 800px; + } + + .textbox-container>textarea, .language-selector { + width: 50%; + } + + .language-selector>select { + width: 150px; + } + + .progress-container { + position: relative; + font-size: 14px; + color: white; + background-color: #e9ecef; + border: solid 1px; + border-radius: 8px; + text-align: left; + overflow: hidden; + } + + .progress-bar { + padding: 0 4px; + z-index: 0; + top: 0; + width: 1%; + height: 100%; + overflow: hidden; + background-color: #007bff; + white-space: nowrap; + } + + .progress-text { + z-index: 2; + } + + .selector-container { + display: flex; + gap: 20px; + } + + .progress-bars-container { + padding: 8px; + height: 140px; + } + + .container { + margin: 25px; + display: flex; + flex-direction: column; + gap: 10px; + } + ``` +
+ +## Step 4: Connecting everything together + + +Now that we have a basic user interface set up, we can finally connect everything together. + +First, let's define the `translate` function, which will be called when the user clicks the `Translate` button. This sends a message (containing the input text, source language, and target language) to the worker thread for processing. We will also disable the button so the user doesn't click it multiple times. Add the following code just before the `return` statement in the `App` function: + +```jsx +const translate = () => { + setDisabled(true); + worker.current.postMessage({ + text: input, + src_lang: sourceLanguage, + tgt_lang: targetLanguage, + }); +} +``` + +Now, let's add an event listener in `src/worker.js` to listen for messages from the main thread. We will send back messages (e.g., for model loading progress and text streaming) to the main thread with `self.postMessage`. + +```javascript +// Listen for messages from the main thread +self.addEventListener('message', async (event) => { + // Retrieve the translation pipeline. When called for the first time, + // this will load the pipeline and save it for future use. + let translator = await MyTranslationPipeline.getInstance(x => { + // We also add a progress callback to the pipeline so that we can + // track model loading. + self.postMessage(x); + }); + + // Actually perform the translation + let output = await translator(event.data.text, { + tgt_lang: event.data.tgt_lang, + src_lang: event.data.src_lang, + + // Allows for partial output + callback_function: x => { + self.postMessage({ + status: 'update', + output: translator.tokenizer.decode(x[0].output_token_ids, { skip_special_tokens: true }) + }); + } + }); + + // Send the output back to the main thread + self.postMessage({ + status: 'complete', + output: output, + }); +}); +``` + +Finally, let's fill in our `onMessageReceived` function, which will update the application state in response to messages from the worker thread. Add the following code inside the `useEffect` hook we defined earlier: + +```jsx +const onMessageReceived = (e) => { + switch (e.data.status) { + case 'initiate': + // Model file start load: add a new progress item to the list. + setReady(false); + setProgressItems(prev => [...prev, e.data]); + break; + + case 'progress': + // Model file progress: update one of the progress items. + setProgressItems( + prev => prev.map(item => { + if (item.file === e.data.file) { + return { ...item, progress: e.data.progress } + } + return item; + }) + ); + break; + + case 'done': + // Model file loaded: remove the progress item from the list. + setProgressItems( + prev => prev.filter(item => item.file !== e.data.file) + ); + break; + + case 'ready': + // Pipeline ready: the worker is ready to accept messages. + setReady(true); + break; + + case 'update': + // Generation update: update the output text. + setOutput(e.data.output); + break; + + case 'complete': + // Generation complete: re-enable the "Translate" button + setDisabled(false); + break; + } +}; +``` + +You can now run the application with `npm run dev` and perform multilingual translation directly in your browser! + + + +## (Optional) Step 5: Build and deploy + +To build your application, simply run `npm run build`. This will bundle your application and output the static files to the `dist` folder. + +For this demo, we will deploy our application as a static [Hugging Face Space](https://huggingface.co/docs/hub/spaces), but you can deploy it anywhere you like! If you haven't already, you can create a free Hugging Face account [here](https://huggingface.co/join). + +1. Visit [https://huggingface.co/new-space](https://huggingface.co/new-space) and fill in the form. Remember to select "Static" as the space type. +2. Go to "Files" → "Add file" → "Upload files". Drag the `index.html` file and `public/` folder from the `dist` folder into the upload box and click "Upload". After they have uploaded, scroll down to the button and click "Commit changes to main". + +**That's it!** Your application should now be live at `https://huggingface.co/spaces//`! diff --git a/assets/audio/jfk.wav b/examples/demo-site/assets/audio/jfk.wav similarity index 100% rename from assets/audio/jfk.wav rename to examples/demo-site/assets/audio/jfk.wav diff --git a/assets/audio/ted.wav b/examples/demo-site/assets/audio/ted.wav similarity index 100% rename from assets/audio/ted.wav rename to examples/demo-site/assets/audio/ted.wav diff --git a/assets/audio/ted_60.wav b/examples/demo-site/assets/audio/ted_60.wav similarity index 100% rename from assets/audio/ted_60.wav rename to examples/demo-site/assets/audio/ted_60.wav diff --git a/assets/css/bootstrap-icons.css b/examples/demo-site/assets/css/bootstrap-icons.css similarity index 100% rename from assets/css/bootstrap-icons.css rename to examples/demo-site/assets/css/bootstrap-icons.css diff --git a/assets/css/bootstrap-icons.woff b/examples/demo-site/assets/css/bootstrap-icons.woff similarity index 100% rename from assets/css/bootstrap-icons.woff rename to examples/demo-site/assets/css/bootstrap-icons.woff diff --git a/assets/css/bootstrap-icons.woff2 b/examples/demo-site/assets/css/bootstrap-icons.woff2 similarity index 100% rename from assets/css/bootstrap-icons.woff2 rename to examples/demo-site/assets/css/bootstrap-icons.woff2 diff --git a/assets/css/prism.css b/examples/demo-site/assets/css/prism.css similarity index 100% rename from assets/css/prism.css rename to examples/demo-site/assets/css/prism.css diff --git a/assets/css/style.css b/examples/demo-site/assets/css/style.css similarity index 100% rename from assets/css/style.css rename to examples/demo-site/assets/css/style.css diff --git a/assets/css/theme.css b/examples/demo-site/assets/css/theme.css similarity index 100% rename from assets/css/theme.css rename to examples/demo-site/assets/css/theme.css diff --git a/assets/icons/favicon.ico b/examples/demo-site/assets/icons/favicon.ico similarity index 100% rename from assets/icons/favicon.ico rename to examples/demo-site/assets/icons/favicon.ico diff --git a/assets/icons/favicon.png b/examples/demo-site/assets/icons/favicon.png similarity index 100% rename from assets/icons/favicon.png rename to examples/demo-site/assets/icons/favicon.png diff --git a/assets/images/airport.jpg b/examples/demo-site/assets/images/airport.jpg similarity index 100% rename from assets/images/airport.jpg rename to examples/demo-site/assets/images/airport.jpg diff --git a/assets/images/cats.jpg b/examples/demo-site/assets/images/cats.jpg similarity index 100% rename from assets/images/cats.jpg rename to examples/demo-site/assets/images/cats.jpg diff --git a/assets/images/football-match.jpg b/examples/demo-site/assets/images/football-match.jpg similarity index 100% rename from assets/images/football-match.jpg rename to examples/demo-site/assets/images/football-match.jpg diff --git a/assets/images/palace.jpg b/examples/demo-site/assets/images/palace.jpg similarity index 100% rename from assets/images/palace.jpg rename to examples/demo-site/assets/images/palace.jpg diff --git a/assets/images/savanna.jpg b/examples/demo-site/assets/images/savanna.jpg similarity index 100% rename from assets/images/savanna.jpg rename to examples/demo-site/assets/images/savanna.jpg diff --git a/assets/images/teapot.jpg b/examples/demo-site/assets/images/teapot.jpg similarity index 100% rename from assets/images/teapot.jpg rename to examples/demo-site/assets/images/teapot.jpg diff --git a/assets/images/tiger.jpg b/examples/demo-site/assets/images/tiger.jpg similarity index 100% rename from assets/images/tiger.jpg rename to examples/demo-site/assets/images/tiger.jpg diff --git a/assets/js/bootstrap.bundle.min.js b/examples/demo-site/assets/js/bootstrap.bundle.min.js similarity index 100% rename from assets/js/bootstrap.bundle.min.js rename to examples/demo-site/assets/js/bootstrap.bundle.min.js diff --git a/assets/js/bootstrap.bundle.min.js.map b/examples/demo-site/assets/js/bootstrap.bundle.min.js.map similarity index 100% rename from assets/js/bootstrap.bundle.min.js.map rename to examples/demo-site/assets/js/bootstrap.bundle.min.js.map diff --git a/assets/js/chart.js b/examples/demo-site/assets/js/chart.js similarity index 100% rename from assets/js/chart.js rename to examples/demo-site/assets/js/chart.js diff --git a/assets/js/prism.js b/examples/demo-site/assets/js/prism.js similarity index 100% rename from assets/js/prism.js rename to examples/demo-site/assets/js/prism.js diff --git a/assets/js/scripts.js b/examples/demo-site/assets/js/scripts.js similarity index 97% rename from assets/js/scripts.js rename to examples/demo-site/assets/js/scripts.js index 4d4cc0596..2d8f5c0ef 100644 --- a/assets/js/scripts.js +++ b/examples/demo-site/assets/js/scripts.js @@ -2,7 +2,9 @@ // Scripts.js - handles link between DOM and worker // Initialise worker -const worker = new Worker('./assets/js/worker.js'); +const worker = new Worker('./assets/js/worker.js', { + type: 'module', +}); // Define elements const TASK_SELECTOR = document.getElementById('task'); @@ -570,13 +572,13 @@ worker.addEventListener('message', (event) => { // create progress bar PROGRESS_BARS.appendChild(htmlToElement(` -
+
`)); } else { - let bar = PROGRESS_BARS.querySelector(`.progress[model="${message.data.path}"][file="${message.data.file}"]> .progress-bar`) + let bar = PROGRESS_BARS.querySelector(`.progress[model="${message.data.name}"][file="${message.data.file}"]> .progress-bar`) switch (message.data.status) { case 'progress': @@ -585,14 +587,18 @@ worker.addEventListener('message', (event) => { bar.textContent = `${message.data.file} (${formatBytes(message.data.loaded)} / ${formatBytes(message.data.total)})`; break; - case 'loaded': - // hide container - PROGRESS.style.display = 'none'; - PROGRESS_BARS.innerHTML = ''; - + case 'done': + // Remove the progress bar + bar.parentElement.remove(); break; } + if (PROGRESS_BARS.children.length === 0) { + // hide container + PROGRESS.style.display = 'none'; + PROGRESS_BARS.innerHTML = ''; + } + } break; diff --git a/assets/js/worker.js b/examples/demo-site/assets/js/worker.js similarity index 96% rename from assets/js/worker.js rename to examples/demo-site/assets/js/worker.js index d21d3866c..0ca08bb2c 100644 --- a/assets/js/worker.js +++ b/examples/demo-site/assets/js/worker.js @@ -1,20 +1,23 @@ + /////////////////////////////////////////////////////////////// // Worker.js file for doing all transformer-based computations // Needed to ensure the UI thread is not blocked when running /////////////////////////////////////////////////////////////// -// -// Get dist directory relative to location of worker script. -const DIST_DIR = location.pathname.split('/').slice(0, -1 - 2).join('/') + '/dist/'; // Import transformers.js library -importScripts(DIST_DIR + 'transformers.min.js'); +import { pipeline, env } from '/dist/transformers.js'; + +// Detect whether running locally or remotely (e.g., GitHub pages) +const RUNNING_LOCALLY = location.hostname === '127.0.0.1' || location.hostname === 'localhost'; -// Set paths to wasm files. In this case, we use the .wasm files present in `DIST_DIR`. -env.onnx.wasm.wasmPaths = DIST_DIR; +// To speed up development when running locally, we should: +// 1. use the local model files (instead of remote files) +// 2. load the wasm files from the local dist folder (instead of wasm files from CDN) +env.remoteModels = !RUNNING_LOCALLY; -// If we are running locally, we should use the local model files (speeds up development) -// Otherwise, we should use the remote files -env.remoteModels = location.hostname !== '127.0.0.1' && location.hostname !== 'localhost'; +if (RUNNING_LOCALLY) { + env.backends.onnx.wasm.wasmPaths = '/dist/'; +} // Define task function mapping const TASK_FUNCTION_MAPPING = { diff --git a/index.html b/examples/demo-site/index.html similarity index 100% rename from index.html rename to examples/demo-site/index.html diff --git a/examples/electron/.gitignore b/examples/electron/.gitignore new file mode 100644 index 000000000..8296128de --- /dev/null +++ b/examples/electron/.gitignore @@ -0,0 +1,92 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock +.DS_Store + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# Webpack +.webpack/ + +# Vite +.vite/ + +# Electron-Forge +out/ diff --git a/examples/electron/README.md b/examples/electron/README.md new file mode 100644 index 000000000..4f77c2a96 --- /dev/null +++ b/examples/electron/README.md @@ -0,0 +1,45 @@ + +# Transformers.js - Sample Electron application + +An example project to show how to run 🤗 Transformers in an [Electron](https://www.electronjs.org/) application. + +## Getting Started +1. Clone the repo and enter the project directory: + ```bash + git clone https://github.com/xenova/transformers.js.git + cd transformers.js/examples/electron/ + ``` +1. Install the necessary dependencies: + ```bash + npm install + ``` + +1. Add your model files to `./models/`. For this demo, we use [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/tree/main) from the Hugging Face Hub. It should look something like this: + ``` + distilbert-base-uncased-finetuned-sst-2-english/ + ├── config.json + ├── tokenizer.json + ├── tokenizer_config.json + └── onnx/ + ├── model.onnx + └── model_quantized.onnx + ``` + +1. Run the application: + ```bash + npm run start + ``` + + After a few seconds, a new window should pop up on your screen! + + +## Editing the template + + +All source code can be found in `./src/`: +- `index.js` - Serves as the entry point for the application's main process. When an Electron app is launched, this is the first file that gets executed, and it is responsible for setting up the main process of the application. You will need to restart the application after editing this file for your changes to take effect. +- `preload.js` - Used to preload scripts and modules in a renderer process before any other scripts run. In our case, we use the `contextBridge` API to expose the `run` function to the renderer, which runs the model in the background. You will need to restart the application after editing this file for your changes to take effect. +- `model.js` - Contains all the logic for loading the model and running predictions. You will need to restart the application after editing this file for your changes to take effect. + +- `client.js` - Handles interaction with the interface, as well as communication between the renderer thread (UI) and the worker thread (processing). To see changes made to this file made while editing, simply refresh the window (Ctrl + R or "View" → "Reload"). +- `index.html`, `index.css` - The user interface which is displayed to the user. To see changes made to this file made while editing, simply refresh the window (Ctrl + R or "View" → "Reload"). diff --git a/examples/electron/forge.config.js b/examples/electron/forge.config.js new file mode 100644 index 000000000..9a4060f97 --- /dev/null +++ b/examples/electron/forge.config.js @@ -0,0 +1,22 @@ +module.exports = { + packagerConfig: {}, + rebuildConfig: {}, + makers: [ + { + name: '@electron-forge/maker-squirrel', + config: {}, + }, + { + name: '@electron-forge/maker-zip', + platforms: ['darwin'], + }, + { + name: '@electron-forge/maker-deb', + config: {}, + }, + { + name: '@electron-forge/maker-rpm', + config: {}, + }, + ], +}; diff --git a/examples/electron/models/.gitignore b/examples/electron/models/.gitignore new file mode 100644 index 000000000..e32cdcab6 --- /dev/null +++ b/examples/electron/models/.gitignore @@ -0,0 +1,15 @@ +# Place your model files here. We recommend downloading them from the Hugging Face Hub: https://huggingface.co/ +# For example, https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/tree/main +# +# The directory should look something like this: +# distilbert-base-uncased-finetuned-sst-2-english/ +# - config.json +# - tokenizer.json +# - tokenizer_config.json +# - onnx/ +# - model.onnx +# - model_quantized.onnx +# +# NOTE: Depending on your task, you may only need to include the quantized model weights. +* +!.gitignore diff --git a/examples/electron/package.json b/examples/electron/package.json new file mode 100644 index 000000000..f75dac91d --- /dev/null +++ b/examples/electron/package.json @@ -0,0 +1,29 @@ +{ + "name": "electron", + "productName": "electron", + "version": "1.0.0", + "description": "Transformers.js sample Electron application", + "main": "src/index.js", + "scripts": { + "start": "electron-forge start", + "package": "electron-forge package", + "make": "electron-forge make", + "publish": "electron-forge publish", + "lint": "echo \"No linting configured\"" + }, + "keywords": [], + "author": "Xenova", + "license": "MIT", + "dependencies": { + "@xenova/transformers": "^2.0.0", + "electron-squirrel-startup": "^1.0.0" + }, + "devDependencies": { + "@electron-forge/cli": "^6.1.1", + "@electron-forge/maker-deb": "^6.1.1", + "@electron-forge/maker-rpm": "^6.1.1", + "@electron-forge/maker-squirrel": "^6.1.1", + "@electron-forge/maker-zip": "^6.1.1", + "electron": "^24.1.1" + } +} diff --git a/examples/electron/src/client.js b/examples/electron/src/client.js new file mode 100644 index 000000000..466eb562b --- /dev/null +++ b/examples/electron/src/client.js @@ -0,0 +1,14 @@ +// This script handles interaction with the user interface, as well as communication +// between the renderer thread (UI) and the worker thread (processing). + +const inputElement = document.getElementById('text'); +const outputElement = document.getElementById('output'); + +// 1. Send input data to the worker thread when it changes. +inputElement.addEventListener('input', async (event) => { + // 2. Await the result from the worker thread. + const result = await window.electronAPI.run(event.target.value); + + // 3. Update the UI. + outputElement.innerText = JSON.stringify(result, null, 2); +}); diff --git a/examples/electron/src/index.css b/examples/electron/src/index.css new file mode 100644 index 000000000..2938ca87e --- /dev/null +++ b/examples/electron/src/index.css @@ -0,0 +1,49 @@ +/* Styles go here */ + +* { + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Roboto', sans-serif; +} + +h1 { + font-size: 54px; + text-align: center; + font-weight: 500; +} + +h2 { + font-size: 24px; + text-align: center; + font-weight: 400; + margin-bottom: 16px; +} + +.container { + width: 400px; +} + +html, +body { + height: 100%; +} + +body { + display: flex; + justify-content: center; + align-items: center; +} + +#text { + width: 100%; + padding: 8px; + font-size: 20px; + margin-bottom: 8px; +} + +#output { + font-size: 20px; + font-family: 'Roboto Mono', monospace; + height: 100px; +} \ No newline at end of file diff --git a/examples/electron/src/index.html b/examples/electron/src/index.html new file mode 100644 index 000000000..098ac1303 --- /dev/null +++ b/examples/electron/src/index.html @@ -0,0 +1,24 @@ + + + + + + Transformers.js | Sample Electron application + + + + + + + + + +
+

Transformers.js

+

Run 🤗 Transformers in Electron!

+ +

+    
+ + + \ No newline at end of file diff --git a/examples/electron/src/index.js b/examples/electron/src/index.js new file mode 100644 index 000000000..3100c333a --- /dev/null +++ b/examples/electron/src/index.js @@ -0,0 +1,72 @@ +const { app, BrowserWindow, ipcMain } = require('electron'); +const path = require('path'); +const { session } = require('electron'); +const { run } = require('./model.js'); + + +// Handle creating/removing shortcuts on Windows when installing/uninstalling. +if (require('electron-squirrel-startup')) { + app.quit(); +} + +const createWindow = () => { + // Create the browser window. + const mainWindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + preload: path.join(__dirname, 'preload.js'), + }, + }); + + // and load the index.html of the app. + mainWindow.loadFile(path.join(__dirname, 'index.html')); + + // Open the DevTools. + mainWindow.webContents.openDevTools(); +}; + + +// This method will be called when Electron has finished +// initialization and is ready to create browser windows. +// Some APIs can only be used after this event occurs. +app.on('ready', () => { + + // Add a handler for the `transformers:run` event. This enables 2-way communication + // between the renderer process (UI) and the main process (processing). + // https://www.electronjs.org/docs/latest/tutorial/ipc#pattern-2-renderer-to-main-two-way + ipcMain.handle('transformers:run', run) + + createWindow(); + + // Define a custom Content Security Policy to only allow loading resources from the app's origin. + session.defaultSession.webRequest.onHeadersReceived((details, callback) => { + callback({ + responseHeaders: { + ...details.responseHeaders, + 'Content-Security-Policy': ["default-src 'self'"] + } + }) + }) +}); + +// Quit when all windows are closed, except on macOS. There, it's common +// for applications and their menu bar to stay active until the user quits +// explicitly with Cmd + Q. +app.on('window-all-closed', () => { + if (process.platform !== 'darwin') { + app.quit(); + } +}); + +app.on('activate', () => { + // On OS X it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (BrowserWindow.getAllWindows().length === 0) { + createWindow(); + } +}); + + +// In this file you can include the rest of your app's specific main process +// code. You can also put them in separate files and import them here. diff --git a/examples/electron/src/model.js b/examples/electron/src/model.js new file mode 100644 index 000000000..25747d50d --- /dev/null +++ b/examples/electron/src/model.js @@ -0,0 +1,32 @@ +// This file (model.js) contains all the logic for loading the model and running predictions. + +// NOTE: Replace this with your own task and model +const task = 'text-classification'; +const model = 'distilbert-base-uncased-finetuned-sst-2-english'; + +// We can't use `require` syntax since @xenova/transformers is an ES module. So, we use +// dynamic imports to load the Transformers.js package asynchronously. Then, we create a +// pipeline with the specified task and model, and return a promise that resolves to the +// pipeline. Later on, we will await this pipeline and use it to run predictions. +const modelPromise = new Promise(async (resolve, reject) => { + try { + let { pipeline, env } = await import('@xenova/transformers'); + + // Only use local models + env.allowRemoteModels = false; + + resolve(await pipeline(task, model)); + } catch (err) { + reject(err); + } +}); + +// The run function is used by the `transformers:run` event handler. +async function run(event, text) { + let model = await modelPromise; + return await model(text); +} + +module.exports = { + run +} diff --git a/examples/electron/src/preload.js b/examples/electron/src/preload.js new file mode 100644 index 000000000..cf824722a --- /dev/null +++ b/examples/electron/src/preload.js @@ -0,0 +1,10 @@ +// See the Electron documentation for details on how to use preload scripts: +// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts + +const { contextBridge, ipcRenderer } = require('electron'); + +// Here, we use the `contextBridge` API to expose a custom API to the renderer process. +// This API allows the renderer process to invoke the `transformers:run` event in the main process. +contextBridge.exposeInMainWorld('electronAPI', { + run: (text) => ipcRenderer.invoke('transformers:run', text) +}); diff --git a/examples/extension/.gitignore b/examples/extension/.gitignore new file mode 100644 index 000000000..c2658d7d1 --- /dev/null +++ b/examples/extension/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/examples/extension/README.md b/examples/extension/README.md new file mode 100644 index 000000000..31dab37de --- /dev/null +++ b/examples/extension/README.md @@ -0,0 +1,49 @@ + +# Transformers.js - Sample browser extension + +An example project to show how to run 🤗 Transformers in a browser extension. Although we only provide instructions for running in Chrome, it should be similar for other browsers. + +## Getting Started +1. Clone the repo and enter the project directory: + ```bash + git clone https://github.com/xenova/transformers.js.git + cd transformers.js/examples/extension/ + ``` +1. Install the necessary dependencies: + ```bash + npm install + ``` + +1. Add your model files to `./public/models/`. For this demo, we use [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/tree/main) from the Hugging Face Hub. It should look something like this: + ``` + distilbert-base-uncased-finetuned-sst-2-english/ + ├── config.json + ├── tokenizer.json + ├── tokenizer_config.json + └── onnx/ + ├── model.onnx + └── model_quantized.onnx + ``` + +1. Add the WASM files to `./public/wasm/`. You can download them from the jsDelivr CDN [here](https://www.jsdelivr.com/package/npm/@xenova/transformers?tab=files&path=dist): + ``` + ort-wasm.wasm + ort-wasm-simd.wasm + ort-wasm-simd-threaded.wasm + ort-wasm-threaded.wasm + ``` +1. Build the project: + ```bash + npm run build + ``` +1. Add the extension to your browser. To do this, go to `chrome://extensions/`, enable developer mode (top right), and click "Load unpacked". Select the `build` directory from the dialog which appears and click "Select Folder". + +1. That's it! You should now be able to open the extenion's popup and use the model in your browser! + +## Editing the template + +We recommend running `npm run dev` while editing the template as it will rebuild the project when changes are made. + +All source code can be found in the `./src/` directory: +- `background.js` - contains the service worker code which runs in the background. It handles all the requests from the UI, does processing on a separate thread, then returns the result. You will need to reload the extension (by visiting `chrome://extensions/` and clicking the refresh button) after editing this file for changes to be visible in the extension. +- `popup.html`, `popup.css`, `popup.js` - contains the code for the popup which is visible to the user when they click the extension's icon from the extensions bar. For development, we recommend opening the `popup.html` file in its own tab by visiting `chrome-extension:///popup.html` (remember to replace `` with the extension's ID). You will need to refresh the page while you develop to see the changes you make. diff --git a/examples/extension/build/.gitignore b/examples/extension/build/.gitignore new file mode 100644 index 000000000..ce5e83aca --- /dev/null +++ b/examples/extension/build/.gitignore @@ -0,0 +1,3 @@ +# Running `npm run build` will build the project and output the files here. +* +!.gitignore diff --git a/examples/extension/package.json b/examples/extension/package.json new file mode 100644 index 000000000..676533e07 --- /dev/null +++ b/examples/extension/package.json @@ -0,0 +1,19 @@ +{ + "name": "extension", + "version": "0.0.1", + "description": "Transformers.js | Sample browser extension", + "scripts": { + "build": "webpack", + "dev": "webpack --watch" + }, + "author": "Xenova", + "license": "MIT", + "devDependencies": { + "copy-webpack-plugin": "^11.0.0", + "html-webpack-plugin": "^5.5.1", + "webpack": "^5.79.0" + }, + "dependencies": { + "@xenova/transformers": "^2.0.0" + } +} diff --git a/examples/extension/public/icons/icon.png b/examples/extension/public/icons/icon.png new file mode 100644 index 000000000..e04507e93 Binary files /dev/null and b/examples/extension/public/icons/icon.png differ diff --git a/examples/extension/public/manifest.json b/examples/extension/public/manifest.json new file mode 100644 index 000000000..eb44ee788 --- /dev/null +++ b/examples/extension/public/manifest.json @@ -0,0 +1,19 @@ +{ + "manifest_version": 3, + "name": "extension", + "description": "Transformers.js | Sample browser extension", + "version": "0.0.1", + "permissions": [], + "background": { + "service_worker": "background.js" + }, + "minimum_chrome_version": "92", + "action": { + "default_icon": "icons/icon.png", + "default_title": "extension", + "default_popup": "popup.html" + }, + "content_security_policy": { + "extension_pages": "script-src 'self' 'wasm-unsafe-eval'" + } +} \ No newline at end of file diff --git a/examples/extension/public/models/.gitignore b/examples/extension/public/models/.gitignore new file mode 100644 index 000000000..e32cdcab6 --- /dev/null +++ b/examples/extension/public/models/.gitignore @@ -0,0 +1,15 @@ +# Place your model files here. We recommend downloading them from the Hugging Face Hub: https://huggingface.co/ +# For example, https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/tree/main +# +# The directory should look something like this: +# distilbert-base-uncased-finetuned-sst-2-english/ +# - config.json +# - tokenizer.json +# - tokenizer_config.json +# - onnx/ +# - model.onnx +# - model_quantized.onnx +# +# NOTE: Depending on your task, you may only need to include the quantized model weights. +* +!.gitignore diff --git a/examples/extension/public/wasm/.gitignore b/examples/extension/public/wasm/.gitignore new file mode 100644 index 000000000..d74996133 --- /dev/null +++ b/examples/extension/public/wasm/.gitignore @@ -0,0 +1,11 @@ +# Place your WASM files here. +# You can download them from: https://www.jsdelivr.com/package/npm/@xenova/transformers?tab=files&path=dist +# Copy the following files to this directory: +# - ort-wasm.wasm +# - ort-wasm-simd.wasm +# - ort-wasm-simd-threaded.wasm +# - ort-wasm-threaded.wasm +# +# Depending on your application, you may not need all of them. +* +!.gitignore diff --git a/examples/extension/src/background.js b/examples/extension/src/background.js new file mode 100644 index 000000000..0cf86cdca --- /dev/null +++ b/examples/extension/src/background.js @@ -0,0 +1,44 @@ +// background.js - Handles requests from the frontend, runs the model, then sends back a response +// TODO - make persistent (i.e., do not close after inactivity) + +if (typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope) { + // Load the library + const { pipeline, env } = require('@xenova/transformers'); + + // Set environment variables to only use local models. + env.useBrowserCache = false; + env.remoteModels = false; + env.localModelPath = chrome.runtime.getURL('models/') + env.backends.onnx.wasm.wasmPaths = chrome.runtime.getURL('wasm/') + env.backends.onnx.wasm.numThreads = 1; + + // TODO: Replace this with your own task and model + const task = 'text-classification'; + const model = 'distilbert-base-uncased-finetuned-sst-2-english'; + + // Load model, storing the promise that is returned from the pipeline function. + // Doing it this way will load the model in the background as soon as the worker is created. + // To actually use the model, you must call `await modelPromise` to get the actual classifier. + const modelPromise = pipeline(task, model, { + progress_callback: (data) => { + // If you would like to add a progress bar for model loading, + // you can send `data` back to the UI. + } + }); + + + // Listen for messages from the UI, process it, and send the result back. + chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { + + // Run model prediction asynchronously + (async function () { + let model = await modelPromise; // 1. Load model if not already loaded + let result = await model(message); // 2. Run model prediction + sendResponse(result); // 3. Send response back to UI + })(); + + // return true to indicate we will send a response asynchronously + // see https://stackoverflow.com/a/46628145 for more information + return true; + }); +} diff --git a/examples/extension/src/popup.css b/examples/extension/src/popup.css new file mode 100644 index 000000000..5a7a8e10e --- /dev/null +++ b/examples/extension/src/popup.css @@ -0,0 +1,50 @@ +/* Styles go here */ + +* { + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Roboto', sans-serif; +} + +h1 { + font-size: 40px; + text-align: center; + font-weight: 500; +} + +h2 { + font-size: 20px; + text-align: center; + font-weight: 400; + margin-bottom: 16px; +} + +.container { + width: 360px; +} + +html, +body { + min-width: 400px; + min-height: 500px; +} + +body { + display: flex; + justify-content: center; + align-items: center; +} + +#text { + width: 100%; + padding: 8px; + font-size: 20px; + margin-bottom: 8px; +} + +#output { + font-size: 20px; + font-family: 'Roboto Mono', monospace; + height: 100px; +} \ No newline at end of file diff --git a/examples/extension/src/popup.html b/examples/extension/src/popup.html new file mode 100644 index 000000000..a4a817d2a --- /dev/null +++ b/examples/extension/src/popup.html @@ -0,0 +1,23 @@ + + + + + + + + Transformers.js | Sample Browser Extension + + + + + + +
+

Transformers.js

+

Run 🤗 Transformers in a Browser Extension!

+ +

+    
+ + + \ No newline at end of file diff --git a/examples/extension/src/popup.js b/examples/extension/src/popup.js new file mode 100644 index 000000000..f2f446cde --- /dev/null +++ b/examples/extension/src/popup.js @@ -0,0 +1,13 @@ +// This script handles interaction with the user interface, as well as handling +// the communication between the main thread (UI) and the background thread (processing). + +const inputElement = document.getElementById('text'); +const outputElement = document.getElementById('output'); + +// 1. Send input data to the worker thread when it changes. +inputElement.addEventListener('input', (event) => { + chrome.runtime.sendMessage(event.target.value, (response) => { + // 2. Handle results returned by the service worker (`background.js`) and update the UI. + outputElement.innerText = JSON.stringify(response, null, 2); + }); +}); diff --git a/examples/extension/webpack.config.js b/examples/extension/webpack.config.js new file mode 100644 index 000000000..c41d17aba --- /dev/null +++ b/examples/extension/webpack.config.js @@ -0,0 +1,34 @@ +const path = require('path'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const CopyPlugin = require("copy-webpack-plugin"); + +module.exports = { + mode: 'development', + devtool: 'inline-source-map', + entry: { + background: './src/background.js', + popup: './src/popup.js', + }, + output: { + path: path.resolve(__dirname, 'build'), + filename: '[name].js', + }, + plugins: [ + new HtmlWebpackPlugin({ + template: './src/popup.html', + filename: 'popup.html', + }), + new CopyPlugin({ + patterns: [ + { + from: "public", + to: "." // Copies to build folder + }, + { + from: "src/popup.css", + to: "popup.css" + } + ], + }) + ], +}; diff --git a/examples/react-translator/.eslintrc.cjs b/examples/react-translator/.eslintrc.cjs new file mode 100644 index 000000000..c12e55cec --- /dev/null +++ b/examples/react-translator/.eslintrc.cjs @@ -0,0 +1,16 @@ +module.exports = { + env: { browser: true, es2020: true, 'node': true }, + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:react/jsx-runtime', + 'plugin:react-hooks/recommended', + ], + parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, + settings: { react: { version: '18.2' } }, + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': 'warn', + 'react/prop-types': 'off', + }, +} diff --git a/examples/react-translator/.gitignore b/examples/react-translator/.gitignore new file mode 100644 index 000000000..a547bf36d --- /dev/null +++ b/examples/react-translator/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/examples/react-translator/index.html b/examples/react-translator/index.html new file mode 100644 index 000000000..e5609ec99 --- /dev/null +++ b/examples/react-translator/index.html @@ -0,0 +1,12 @@ + + + + + + Transformers.js - Sample react application + + +
+ + + diff --git a/examples/react-translator/package.json b/examples/react-translator/package.json new file mode 100644 index 000000000..9d54f93d9 --- /dev/null +++ b/examples/react-translator/package.json @@ -0,0 +1,27 @@ +{ + "name": "react-translator", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "dependencies": { + "@xenova/transformers": "^2.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.0.28", + "@types/react-dom": "^18.0.11", + "@vitejs/plugin-react": "^4.0.0", + "eslint": "^8.38.0", + "eslint-plugin-react": "^7.32.2", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.3.4", + "vite": "^4.3.2" + } +} diff --git a/examples/react-translator/src/App.css b/examples/react-translator/src/App.css new file mode 100644 index 000000000..46f43f91b --- /dev/null +++ b/examples/react-translator/src/App.css @@ -0,0 +1,69 @@ +#root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.language-container { + display: flex; + gap: 20px; +} + +.textbox-container { + display: flex; + justify-content: center; + gap: 20px; + width: 800px; +} + +.textbox-container>textarea, .language-selector { + width: 50%; +} + +.language-selector>select { + width: 150px; +} + +.progress-container { + position: relative; + font-size: 14px; + color: white; + background-color: #e9ecef; + border: solid 1px; + border-radius: 8px; + text-align: left; + overflow: hidden; +} + +.progress-bar { + padding: 0 4px; + z-index: 0; + top: 0; + width: 1%; + height: 100%; + overflow: hidden; + background-color: #007bff; + white-space: nowrap; +} + +.progress-text { + z-index: 2; +} + +.selector-container { + display: flex; + gap: 20px; +} + +.progress-bars-container { + padding: 8px; + height: 140px; +} + +.container { + margin: 25px; + display: flex; + flex-direction: column; + gap: 10px; +} \ No newline at end of file diff --git a/examples/react-translator/src/App.jsx b/examples/react-translator/src/App.jsx new file mode 100644 index 000000000..6c2043619 --- /dev/null +++ b/examples/react-translator/src/App.jsx @@ -0,0 +1,126 @@ +import { useEffect, useRef, useState } from 'react' +import LanguageSelector from './components/LanguageSelector'; +import Progress from './components/Progress'; + +import './App.css' + +function App() { + + // Model loading + const [ready, setReady] = useState(null); + const [disabled, setDisabled] = useState(false); + const [progressItems, setProgressItems] = useState([]); + + // Inputs and outputs + const [input, setInput] = useState('I love walking my dog.'); + const [sourceLanguage, setSourceLanguage] = useState('eng_Latn'); + const [targetLanguage, setTargetLanguage] = useState('fra_Latn'); + const [output, setOutput] = useState(''); + + // Create a reference to the worker object. + const worker = useRef(null); + + // We use the `useEffect` hook to setup the worker as soon as the `App` component is mounted. + useEffect(() => { + if (!worker.current) { + // Create the worker if it does not yet exist. + worker.current = new Worker(new URL('./worker.js', import.meta.url), { + type: 'module' + }); + } + + // Create a callback function for messages from the worker thread. + const onMessageReceived = (e) => { + switch (e.data.status) { + case 'initiate': + // Model file start load: add a new progress item to the list. + setReady(false); + setProgressItems(prev => [...prev, e.data]); + break; + + case 'progress': + // Model file progress: update one of the progress items. + setProgressItems( + prev => prev.map(item => { + if (item.file === e.data.file) { + return { ...item, progress: e.data.progress } + } + return item; + }) + ); + break; + + case 'done': + // Model file loaded: remove the progress item from the list. + setProgressItems( + prev => prev.filter(item => item.file !== e.data.file) + ); + break; + + case 'ready': + // Pipeline ready: the worker is ready to accept messages. + setReady(true); + break; + + case 'update': + // Generation update: update the output text. + setOutput(e.data.output); + break; + + case 'complete': + // Generation complete: re-enable the "Translate" button + setDisabled(false); + break; + } + }; + + // Attach the callback function as an event listener. + worker.current.addEventListener('message', onMessageReceived); + + // Define a cleanup function for when the component is unmounted. + return () => worker.current.removeEventListener('message', onMessageReceived); + }); + + const translate = () => { + setDisabled(true); + worker.current.postMessage({ + text: input, + src_lang: sourceLanguage, + tgt_lang: targetLanguage, + }); + } + + return ( + <> +

Transformers.js

+

ML-powered multilingual translation in React!

+ +
+
+ setSourceLanguage(x.target.value)} /> + setTargetLanguage(x.target.value)} /> +
+ +
+ + +
+
+ + + +
+ {ready === false && ( + + )} + {progressItems.map(data => ( +
+ +
+ ))} +
+ + ) +} + +export default App diff --git a/examples/react-translator/src/components/LanguageSelector.jsx b/examples/react-translator/src/components/LanguageSelector.jsx new file mode 100644 index 000000000..1224367cc --- /dev/null +++ b/examples/react-translator/src/components/LanguageSelector.jsx @@ -0,0 +1,223 @@ + +// The full list of languages in FLORES-200 is available here: +// https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200 + +const LANGUAGES = { + "Acehnese (Arabic script)": "ace_Arab", + "Acehnese (Latin script)": "ace_Latn", + "Afrikaans": "afr_Latn", + "Akan": "aka_Latn", + "Amharic": "amh_Ethi", + "Armenian": "hye_Armn", + "Assamese": "asm_Beng", + "Asturian": "ast_Latn", + "Awadhi": "awa_Deva", + "Ayacucho Quechua": "quy_Latn", + "Balinese": "ban_Latn", + "Bambara": "bam_Latn", + "Banjar (Arabic script)": "bjn_Arab", + "Banjar (Latin script)": "bjn_Latn", + "Bashkir": "bak_Cyrl", + "Basque": "eus_Latn", + "Belarusian": "bel_Cyrl", + "Bemba": "bem_Latn", + "Bengali": "ben_Beng", + "Bhojpuri": "bho_Deva", + "Bosnian": "bos_Latn", + "Buginese": "bug_Latn", + "Bulgarian": "bul_Cyrl", + "Burmese": "mya_Mymr", + "Catalan": "cat_Latn", + "Cebuano": "ceb_Latn", + "Central Atlas Tamazight": "tzm_Tfng", + "Central Aymara": "ayr_Latn", + "Central Kanuri (Arabic script)": "knc_Arab", + "Central Kanuri (Latin script)": "knc_Latn", + "Central Kurdish": "ckb_Arab", + "Chhattisgarhi": "hne_Deva", + "Chinese (Simplified)": "zho_Hans", + "Chinese (Traditional)": "zho_Hant", + "Chokwe": "cjk_Latn", + "Crimean Tatar": "crh_Latn", + "Croatian": "hrv_Latn", + "Czech": "ces_Latn", + "Danish": "dan_Latn", + "Dari": "prs_Arab", + "Dutch": "nld_Latn", + "Dyula": "dyu_Latn", + "Dzongkha": "dzo_Tibt", + "Eastern Panjabi": "pan_Guru", + "Eastern Yiddish": "ydd_Hebr", + "Egyptian Arabic": "arz_Arab", + "English": "eng_Latn", + "Esperanto": "epo_Latn", + "Estonian": "est_Latn", + "Ewe": "ewe_Latn", + "Faroese": "fao_Latn", + "Fijian": "fij_Latn", + "Finnish": "fin_Latn", + "Fon": "fon_Latn", + "French": "fra_Latn", + "Friulian": "fur_Latn", + "Galician": "glg_Latn", + "Ganda": "lug_Latn", + "Georgian": "kat_Geor", + "German": "deu_Latn", + "Greek": "ell_Grek", + "Guarani": "grn_Latn", + "Gujarati": "guj_Gujr", + "Haitian Creole": "hat_Latn", + "Halh Mongolian": "khk_Cyrl", + "Hausa": "hau_Latn", + "Hebrew": "heb_Hebr", + "Hindi": "hin_Deva", + "Hungarian": "hun_Latn", + "Icelandic": "isl_Latn", + "Igbo": "ibo_Latn", + "Ilocano": "ilo_Latn", + "Indonesian": "ind_Latn", + "Irish": "gle_Latn", + "Italian": "ita_Latn", + "Japanese": "jpn_Jpan", + "Javanese": "jav_Latn", + "Jingpho": "kac_Latn", + "Kabiyè": "kbp_Latn", + "Kabuverdianu": "kea_Latn", + "Kabyle": "kab_Latn", + "Kamba": "kam_Latn", + "Kannada": "kan_Knda", + "Kashmiri (Arabic script)": "kas_Arab", + "Kashmiri (Devanagari script)": "kas_Deva", + "Kazakh": "kaz_Cyrl", + "Khmer": "khm_Khmr", + "Kikongo": "kon_Latn", + "Kikuyu": "kik_Latn", + "Kimbundu": "kmb_Latn", + "Kinyarwanda": "kin_Latn", + "Korean": "kor_Hang", + "Kyrgyz": "kir_Cyrl", + "Lao": "lao_Laoo", + "Latgalian": "ltg_Latn", + "Ligurian": "lij_Latn", + "Limburgish": "lim_Latn", + "Lingala": "lin_Latn", + "Lithuanian": "lit_Latn", + "Lombard": "lmo_Latn", + "Luba-Kasai": "lua_Latn", + "Luo": "luo_Latn", + "Luxembourgish": "ltz_Latn", + "Macedonian": "mkd_Cyrl", + "Magahi": "mag_Deva", + "Maithili": "mai_Deva", + "Malayalam": "mal_Mlym", + "Maltese": "mlt_Latn", + "Maori": "mri_Latn", + "Marathi": "mar_Deva", + "Meitei (Bengali script)": "mni_Beng", + "Mesopotamian Arabic": "acm_Arab", + "Minangkabau (Arabic script)": "min_Arab", + "Minangkabau (Latin script)": "min_Latn", + "Mizo": "lus_Latn", + "Modern Standard Arabic (Romanized)": "arb_Latn", + "Modern Standard Arabic": "arb_Arab", + "Moroccan Arabic": "ary_Arab", + "Mossi": "mos_Latn", + "Najdi Arabic": "ars_Arab", + "Nepali": "npi_Deva", + "Nigerian Fulfulde": "fuv_Latn", + "North Azerbaijani": "azj_Latn", + "North Levantine Arabic": "apc_Arab", + "Northern Kurdish": "kmr_Latn", + "Northern Sotho": "nso_Latn", + "Northern Uzbek": "uzn_Latn", + "Norwegian Bokmål": "nob_Latn", + "Norwegian Nynorsk": "nno_Latn", + "Nuer": "nus_Latn", + "Nyanja": "nya_Latn", + "Occitan": "oci_Latn", + "Odia": "ory_Orya", + "Pangasinan": "pag_Latn", + "Papiamento": "pap_Latn", + "Plateau Malagasy": "plt_Latn", + "Polish": "pol_Latn", + "Portuguese": "por_Latn", + "Romanian": "ron_Latn", + "Rundi": "run_Latn", + "Russian": "rus_Cyrl", + "Samoan": "smo_Latn", + "Sango": "sag_Latn", + "Sanskrit": "san_Deva", + "Santali": "sat_Olck", + "Sardinian": "srd_Latn", + "Scottish Gaelic": "gla_Latn", + "Serbian": "srp_Cyrl", + "Shan": "shn_Mymr", + "Shona": "sna_Latn", + "Sicilian": "scn_Latn", + "Silesian": "szl_Latn", + "Sindhi": "snd_Arab", + "Sinhala": "sin_Sinh", + "Slovak": "slk_Latn", + "Slovenian": "slv_Latn", + "Somali": "som_Latn", + "South Azerbaijani": "azb_Arab", + "South Levantine Arabic": "ajp_Arab", + "Southern Pashto": "pbt_Arab", + "Southern Sotho": "sot_Latn", + "Southwestern Dinka": "dik_Latn", + "Spanish": "spa_Latn", + "Standard Latvian": "lvs_Latn", + "Standard Malay": "zsm_Latn", + "Standard Tibetan": "bod_Tibt", + "Sundanese": "sun_Latn", + "Swahili": "swh_Latn", + "Swati": "ssw_Latn", + "Swedish": "swe_Latn", + "Tagalog": "tgl_Latn", + "Tajik": "tgk_Cyrl", + "Tamasheq (Latin script)": "taq_Latn", + "Tamasheq (Tifinagh script)": "taq_Tfng", + "Tamil": "tam_Taml", + "Tatar": "tat_Cyrl", + "Ta’izzi-Adeni Arabic": "acq_Arab", + "Telugu": "tel_Telu", + "Thai": "tha_Thai", + "Tigrinya": "tir_Ethi", + "Tok Pisin": "tpi_Latn", + "Tosk Albanian": "als_Latn", + "Tsonga": "tso_Latn", + "Tswana": "tsn_Latn", + "Tumbuka": "tum_Latn", + "Tunisian Arabic": "aeb_Arab", + "Turkish": "tur_Latn", + "Turkmen": "tuk_Latn", + "Twi": "twi_Latn", + "Ukrainian": "ukr_Cyrl", + "Umbundu": "umb_Latn", + "Urdu": "urd_Arab", + "Uyghur": "uig_Arab", + "Venetian": "vec_Latn", + "Vietnamese": "vie_Latn", + "Waray": "war_Latn", + "Welsh": "cym_Latn", + "West Central Oromo": "gaz_Latn", + "Western Persian": "pes_Arab", + "Wolof": "wol_Latn", + "Xhosa": "xho_Latn", + "Yoruba": "yor_Latn", + "Yue Chinese": "yue_Hant", + "Zulu": "zul_Latn", +} + +export default function LanguageSelector({ type, onChange, defaultLanguage }) { + return ( +
+ + +
+ ) +} \ No newline at end of file diff --git a/examples/react-translator/src/components/Progress.jsx b/examples/react-translator/src/components/Progress.jsx new file mode 100644 index 000000000..58bccf18c --- /dev/null +++ b/examples/react-translator/src/components/Progress.jsx @@ -0,0 +1,9 @@ + +export default function Progress({ text, percentage }) { + percentage = percentage ?? 0; + return ( +
+
{text} ({`${percentage.toFixed(2)}%`})
+
+ ); +} diff --git a/examples/react-translator/src/index.css b/examples/react-translator/src/index.css new file mode 100644 index 000000000..7ed73431a --- /dev/null +++ b/examples/react-translator/src/index.css @@ -0,0 +1,76 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + color: #213547; + background-color: #ffffff; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1; +} + +h1, +h2 { + margin: 8px; +} + +select { + padding: 0.3em; + cursor: pointer; +} + +textarea { + padding: 0.6em; +} + +button { + padding: 0.6em 1.2em; + cursor: pointer; + font-weight: 500; +} + +button[disabled] { + cursor: not-allowed; +} + +select, +textarea, +button { + border-radius: 8px; + border: 1px solid transparent; + font-size: 1em; + font-family: inherit; + background-color: #f9f9f9; + transition: border-color 0.25s; +} + +select:hover, +textarea:hover, +button:not([disabled]):hover { + border-color: #646cff; +} + +select:focus, +select:focus-visible, +textarea:focus, +textarea:focus-visible, +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} \ No newline at end of file diff --git a/examples/react-translator/src/main.jsx b/examples/react-translator/src/main.jsx new file mode 100644 index 000000000..54b39dd1d --- /dev/null +++ b/examples/react-translator/src/main.jsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App.jsx' +import './index.css' + +ReactDOM.createRoot(document.getElementById('root')).render( + + + , +) diff --git a/examples/react-translator/src/worker.js b/examples/react-translator/src/worker.js new file mode 100644 index 000000000..a921cdc6a --- /dev/null +++ b/examples/react-translator/src/worker.js @@ -0,0 +1,52 @@ + +import { pipeline } from '@xenova/transformers'; + +/** + * This class uses the Singleton pattern to ensure that only one instance of the + * pipeline is loaded. This is because loading the pipeline is an expensive + * operation and we don't want to do it every time we want to translate a sentence. + */ +class MyTranslationPipeline { + static task = 'translation'; + static model = 'Xenova/nllb-200-distilled-600M'; + static instance = null; + + static async getInstance(progress_callback = null) { + if (this.instance === null) { + this.instance = pipeline(this.task, this.model, { progress_callback }); + } + + return this.instance; + } +} + +// Listen for messages from the main thread +self.addEventListener('message', async (event) => { + // Retrieve the translation pipeline. When called for the first time, + // this will load the pipeline and save it for future use. + let translator = await MyTranslationPipeline.getInstance(x => { + // We also add a progress callback to the pipeline so that we can + // track model loading. + self.postMessage(x); + }); + + // Actually perform the translation + let output = await translator(event.data.text, { + tgt_lang: event.data.tgt_lang, + src_lang: event.data.src_lang, + + // Allows for partial output + callback_function: x => { + self.postMessage({ + status: 'update', + output: translator.tokenizer.decode(x[0].output_token_ids, { skip_special_tokens: true }) + }); + } + }); + + // Send the output back to the main thread + self.postMessage({ + status: 'complete', + output: output, + }); +}); diff --git a/examples/react-translator/vite.config.js b/examples/react-translator/vite.config.js new file mode 100644 index 000000000..5a33944a9 --- /dev/null +++ b/examples/react-translator/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], +}) diff --git a/jest.config.mjs b/jest.config.mjs new file mode 100644 index 000000000..b6a5fdb3d --- /dev/null +++ b/jest.config.mjs @@ -0,0 +1,192 @@ +/* + * For a detailed explanation regarding each configuration property, visit: + * https://jestjs.io/docs/configuration + */ + +export default { + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // Automatically clear mock calls, instances, contexts and results before every test + clearMocks: true, + + // Indicates whether the coverage information should be collected while executing the test + collectCoverage: true, + + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + coverageDirectory: "coverage", + + // An array of regexp pattern strings used to skip coverage collection + // coveragePathIgnorePatterns: [ + // "\\\\node_modules\\\\" + // ], + + // Indicates which provider should be used to instrument code for coverage + coverageProvider: "v8", + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage results + // coverageThreshold: undefined, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // The default configuration for fake timers + // fakeTimers: { + // "enableGlobally": false + // }, + + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "mjs", + // "cjs", + // "jsx", + // "ts", + // "tsx", + // "json", + // "node" + // ], + + // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module + // moduleNameMapper: {}, + + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + // modulePathIgnorePatterns: [], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + // preset: undefined, + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state before every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state and implementation before every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + roots: [ + "./tests/" + ], + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + // testEnvironment: "jest-environment-node", + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + // testMatch: [ + // "**/__tests__/**/*.[jt]s?(x)", + // "**/?(*.)+(spec|test).[tj]s?(x)" + // ], + + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + // testPathIgnorePatterns: [ + // "\\\\node_modules\\\\" + // ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jest-circus/runner", + + // A map from regular expressions to paths to transformers + transform: {} + + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "\\\\node_modules\\\\", + // "\\.pnp\\.[^\\\\]+$" + // ], + + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; diff --git a/jsconfig.json b/jsconfig.json index 21d7a1d22..5430d98f2 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,5 +1,18 @@ { + // Only include files in the src directory + "include": [ + "src/**/*" + ], "compilerOptions": { - "checkJs": true + // Tells the compiler to check JS files + "checkJs": true, + "target": "esnext", + "module": "esnext", + "moduleResolution": "nodenext", + }, + "typeAcquisition": { + "include": [ + "jest" + ] } -} +} \ No newline at end of file diff --git a/models/.gitignore b/models/.gitignore deleted file mode 100644 index 5e7d2734c..000000000 --- a/models/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/package-lock.json b/package-lock.json index 64e16cdf2..a042946f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,2222 +1,5123 @@ { "name": "@xenova/transformers", - "version": "1.4.2", + "version": "1.5.0.dev", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@xenova/transformers", - "version": "1.4.2", + "version": "1.5.0.dev", "license": "MIT", "dependencies": { "onnxruntime-web": "^1.14.0", "sharp": "^0.32.0" }, "devDependencies": { + "@types/jest": "^29.5.1", + "catharsis": "github:xenova/catharsis", "copy-webpack-plugin": "^11.0.0", + "jest": "^29.5.0", + "jest-environment-node": "^29.5.0", + "jsdoc-to-markdown": "^8.0.0", "typescript": "^5.0.2", - "webpack": "^5.76.0", - "webpack-cli": "^5.0.1", - "webpack-dev-server": "^4.11.1" + "webpack": "^5.80.0", + "webpack-cli": "^5.0.2", + "webpack-dev-server": "^4.13.3" }, "optionalDependencies": { "onnxruntime-node": "^1.14.0" } }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "node_modules/@babel/code-frame": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", + "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", "dev": true, + "dependencies": { + "@babel/highlight": "^7.18.6" + }, "engines": { - "node": ">=6.0.0" + "node": ">=6.9.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "node_modules/@babel/compat-data": { + "version": "7.21.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.7.tgz", + "integrity": "sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=6.9.0" } }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "node_modules/@babel/core": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.5.tgz", + "integrity": "sha512-9M398B/QH5DlfCOTKDZT1ozXr0x8uBEeFd+dJraGUZGiaNpGCDVGCc14hZexsMblw3XxltJ+6kSvogp9J+5a9g==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.21.4", + "@babel/generator": "^7.21.5", + "@babel/helper-compilation-targets": "^7.21.5", + "@babel/helper-module-transforms": "^7.21.5", + "@babel/helpers": "^7.21.5", + "@babel/parser": "^7.21.5", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "node_modules/@babel/core/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@babel/generator": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.5.tgz", + "integrity": "sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==", "dev": true, + "dependencies": { + "@babel/types": "^7.21.5", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, "engines": { - "node": ">= 8" + "node": ">=6.9.0" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz", + "integrity": "sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@babel/compat-data": "^7.21.5", + "@babel/helper-validator-option": "^7.21.0", + "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", + "semver": "^6.3.0" }, "engines": { - "node": ">= 8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "node_modules/@babel/helper-environment-visitor": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz", + "integrity": "sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "node_modules/@babel/helper-function-name": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", + "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "dev": true, "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" + "@babel/template": "^7.20.7", + "@babel/types": "^7.21.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "node_modules/@babel/helper-hoist-variables": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "dev": true, + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "node_modules/@babel/helper-module-imports": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", + "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.21.4" + }, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "node_modules/@babel/helper-module-transforms": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz", + "integrity": "sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-module-imports": "^7.21.4", + "@babel/helper-simple-access": "^7.21.5", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "node_modules/@babel/helper-plugin-utils": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz", + "integrity": "sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "node_modules/@babel/helper-simple-access": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz", + "integrity": "sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==", "dev": true, "dependencies": { - "@types/connect": "*", - "@types/node": "*" + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@types/bonjour": { - "version": "3.5.10", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz", - "integrity": "sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==", + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "dependencies": { - "@types/node": "*" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "node_modules/@babel/helper-string-parser": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz", + "integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==", "dev": true, - "dependencies": { - "@types/node": "*" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@types/connect-history-api-fallback": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz", - "integrity": "sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==", + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, - "dependencies": { - "@types/express-serve-static-core": "*", - "@types/node": "*" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@types/eslint": { - "version": "8.21.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.1.tgz", - "integrity": "sha512-rc9K8ZpVjNcLs8Fp0dkozd5Pt2Apk1glO4Vgz8ix1u6yFByxfqo5Yavpy65o+93TAe24jr7v+eSBtFLvOQtCRQ==", + "node_modules/@babel/helper-validator-option": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", + "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "node_modules/@babel/helpers": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.5.tgz", + "integrity": "sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA==", "dev": true, "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@types/express": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", - "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.33", - "@types/qs": "*", - "@types/serve-static": "*" + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/express-serve-static-core": { - "version": "4.17.33", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", - "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/http-proxy": { - "version": "1.17.10", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.10.tgz", - "integrity": "sha512-Qs5aULi+zV1bwKAg5z1PWnDXWmsn+LxIvUGv6E2+OOMYhclZMO+OXd9pYVf2gLykf2I7IV2u7oTHwChPNsvJ7g==", + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { - "@types/node": "*" + "color-name": "1.1.3" } }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, - "node_modules/@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "18.14.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.4.tgz", - "integrity": "sha512-VhCw7I7qO2X49+jaKcAUwi3rR+hbxT5VcYF493+Z5kMLI0DL568b7JI4IDJaxWFH0D/xwmGJNoXisyX+w7GH/g==" - }, - "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true - }, - "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } }, - "node_modules/@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", - "dev": true + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "node_modules/@types/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "@types/express": "*" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/serve-static": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", - "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", + "node_modules/@babel/parser": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.5.tgz", + "integrity": "sha512-J+IxH2IsxV4HbnTrSWgMAQj0UEo61hDA4Ny8h8PCX0MLXiibqHbqIOVneqdocemSBc22VpBKxt4J6FQzy9HarQ==", "dev": true, - "dependencies": { - "@types/mime": "*", - "@types/node": "*" + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@types/sockjs": { - "version": "0.3.33", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", - "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "dependencies": { - "@types/node": "*" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, "dependencies": { - "@types/node": "*" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@xtuc/long": "4.2.2" + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz", + "integrity": "sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==", "dev": true, "dependencies": { - "@xtuc/ieee754": "^1.2.0" + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "dependencies": { - "@xtuc/long": "4.2.2" + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@xtuc/long": "4.2.2" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webpack-cli/configtest": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.1.tgz", - "integrity": "sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==", + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, "engines": { - "node": ">=14.15.0" + "node": ">=6.9.0" }, "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webpack-cli/info": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.1.tgz", - "integrity": "sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==", + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz", + "integrity": "sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, "engines": { - "node": ">=14.15.0" + "node": ">=6.9.0" }, "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@webpack-cli/serve": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.1.tgz", - "integrity": "sha512-0G7tNyS+yW8TdgHwZKlDWYXFA6OJQnoLCQvYKkQP0Q2X205PSQ6RNUj0M+1OB/9gRQaUZ/ccYfaxd0nhaWKfjw==", + "node_modules/@babel/template": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" + }, "engines": { - "node": ">=14.15.0" + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.5.tgz", + "integrity": "sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.21.4", + "@babel/generator": "^7.21.5", + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-function-name": "^7.21.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.21.5", + "@babel/types": "^7.21.5", + "debug": "^4.1.0", + "globals": "^11.1.0" }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" }, "peerDependenciesMeta": { - "webpack-dev-server": { + "supports-color": { "optional": true } } }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "node_modules/@babel/types": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz", + "integrity": "sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==", "dev": true, "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" + "@babel/helper-string-parser": "^7.21.5", + "@babel/helper-validator-identifier": "^7.19.1", + "to-fast-properties": "^2.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">=6.9.0" } }, - "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, "engines": { - "node": ">=0.4.0" + "node": ">=8" } }, - "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, - "peerDependencies": { - "acorn": "^8" + "engines": { + "node": ">=8" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/@jest/console": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.5.0.tgz", + "integrity": "sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "@jest/types": "^29.5.0", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.5.0", + "jest-util": "^29.5.0", + "slash": "^3.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "node_modules/@jest/console/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.5.0.tgz", + "integrity": "sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==", "dev": true, "dependencies": { - "ajv": "^8.0.0" + "@jest/console": "^29.5.0", + "@jest/reporters": "^29.5.0", + "@jest/test-result": "^29.5.0", + "@jest/transform": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.5.0", + "jest-config": "^29.5.0", + "jest-haste-map": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-regex-util": "^29.4.3", + "jest-resolve": "^29.5.0", + "jest-resolve-dependencies": "^29.5.0", + "jest-runner": "^29.5.0", + "jest-runtime": "^29.5.0", + "jest-snapshot": "^29.5.0", + "jest-util": "^29.5.0", + "jest-validate": "^29.5.0", + "jest-watcher": "^29.5.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.5.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { - "ajv": "^8.0.0" + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "peerDependenciesMeta": { - "ajv": { + "node-notifier": { "optional": true } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/@jest/core/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/environment": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz", + "integrity": "sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "@jest/fake-timers": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "jest-mock": "^29.5.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "node_modules/@jest/expect": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz", + "integrity": "sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==", "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" + "dependencies": { + "expect": "^29.5.0", + "jest-snapshot": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/ansi-html-community": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", - "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", + "node_modules/@jest/expect-utils": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz", + "integrity": "sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==", "dev": true, - "engines": [ - "node >= 0.8.0" - ], - "bin": { - "ansi-html": "bin/ansi-html" + "dependencies": { + "jest-get-type": "^29.4.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "node_modules/@jest/fake-timers": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz", + "integrity": "sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==", "dev": true, "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "@jest/types": "^29.5.0", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.5.0", + "jest-mock": "^29.5.0", + "jest-util": "^29.5.0" }, "engines": { - "node": ">= 8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "node_modules/@jest/globals": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz", + "integrity": "sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==", "dev": true, + "dependencies": { + "@jest/environment": "^29.5.0", + "@jest/expect": "^29.5.0", + "@jest/types": "^29.5.0", + "jest-mock": "^29.5.0" + }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "node_modules/@jest/reporters": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.5.0.tgz", + "integrity": "sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==", + "dev": true, "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.5.0", + "@jest/test-result": "^29.5.0", + "@jest/transform": "^29.5.0", + "@jest/types": "^29.5.0", + "@jridgewell/trace-mapping": "^0.3.15", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.5.0", + "jest-util": "^29.5.0", + "jest-worker": "^29.5.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "node_modules/@jest/reporters/node_modules/jest-worker": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", + "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", "dev": true, "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "@types/node": "*", + "jest-util": "^29.5.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "node_modules/@jest/reporters/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/bonjour-service": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.0.tgz", - "integrity": "sha512-LVRinRB3k1/K0XzZ2p58COnWvkQknIY6sf0zF2rpErvcJXpMBttEPQSxK+HEXSS9VmpZlDoDnQWv8ftJT20B0Q==", + "node_modules/@jest/schemas": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.3.tgz", + "integrity": "sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==", "dev": true, "dependencies": { - "array-flatten": "^2.1.2", - "dns-equal": "^1.0.0", - "fast-deep-equal": "^3.1.3", - "multicast-dns": "^7.2.5" + "@sinclair/typebox": "^0.25.16" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@jest/source-map": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.3.tgz", + "integrity": "sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@jridgewell/trace-mapping": "^0.3.15", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "node_modules/@jest/test-result": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.5.0.tgz", + "integrity": "sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "@jest/console": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "node_modules/@jest/test-sequencer": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz", + "integrity": "sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - } - ], "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" - }, - "bin": { - "browserslist": "cli.js" + "@jest/test-result": "^29.5.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.5.0", + "slash": "^3.0.0" }, "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/bytes": { + "node_modules/@jest/test-sequencer/node_modules/slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/@jest/transform": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz", + "integrity": "sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "@babel/core": "^7.11.6", + "@jest/types": "^29.5.0", + "@jridgewell/trace-mapping": "^0.3.15", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.5.0", + "jest-regex-util": "^29.4.3", + "jest-util": "^29.5.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001458", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001458.tgz", - "integrity": "sha512-lQ1VlUUq5q9ro9X+5gOEyH7i3vm+AYVT1WDCVB69XOZ17KZRhnZ9J0Sqz7wTHQaLBJccNCHq8/Ww5LlOIZbB0w==", + "node_modules/@jest/transform/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - } - ] + "engines": { + "node": ">=8" + } }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "node_modules/@jest/types": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz", + "integrity": "sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "@jest/schemas": "^29.4.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" }, "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jsdoc/salty": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.5.tgz", + "integrity": "sha512-TfRP53RqunNe2HBobVBJ0VLhK1HbfvBYeTC1ahnN64PWvyYyGebmMiPkuwvD9fpw2ZbkoPb8Q7mwy0aR8Z9rvw==", + "dev": true, + "dependencies": { + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=v12.0.0" + } + }, + "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", + "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@sinclair/typebox": { + "version": "0.25.24", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", + "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", + "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^2.0.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", + "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.18.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.5.tgz", + "integrity": "sha512-enCvTL8m/EHS/zIvJno9nE+ndYPh1/oNFzRYRmtUqJICG2VnCSBzMLW5VN2KCQU91f23tsNKR8v7VJJQMatl7Q==", + "dev": true, + "dependencies": { + "@babel/types": "^7.3.0" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/bonjour": { + "version": "3.5.10", + "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz", + "integrity": "sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect-history-api-fallback": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz", + "integrity": "sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==", + "dev": true, + "dependencies": { + "@types/express-serve-static-core": "*", + "@types/node": "*" + } + }, + "node_modules/@types/eslint": { + "version": "8.37.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", + "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "dev": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "dev": true + }, + "node_modules/@types/express": { + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.33", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", + "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/http-proxy": { + "version": "1.17.10", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.10.tgz", + "integrity": "sha512-Qs5aULi+zV1bwKAg5z1PWnDXWmsn+LxIvUGv6E2+OOMYhclZMO+OXd9pYVf2gLykf2I7IV2u7oTHwChPNsvJ7g==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.1", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz", + "integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, + "node_modules/@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "dev": true + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, + "node_modules/@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dev": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "node_modules/@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "18.14.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.4.tgz", + "integrity": "sha512-VhCw7I7qO2X49+jaKcAUwi3rR+hbxT5VcYF493+Z5kMLI0DL568b7JI4IDJaxWFH0D/xwmGJNoXisyX+w7GH/g==" + }, + "node_modules/@types/prettier": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", + "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", + "dev": true + }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true + }, + "node_modules/@types/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", + "dev": true + }, + "node_modules/@types/serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", + "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", + "dev": true, + "dependencies": { + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/@types/sockjs": { + "version": "0.3.33", + "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", + "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/ws": { + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.5.tgz", + "integrity": "sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.5", + "@webassemblyjs/helper-wasm-bytecode": "1.11.5" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.5.tgz", + "integrity": "sha512-1j1zTIC5EZOtCplMBG/IEwLtUojtwFVwdyVMbL/hwWqbzlQoJsWCOavrdnLkemwNoC/EOwtUFch3fuo+cbcXYQ==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.5.tgz", + "integrity": "sha512-L65bDPmfpY0+yFrsgz8b6LhXmbbs38OnwDCf6NpnMUYqa+ENfE5Dq9E42ny0qz/PdR0LJyq/T5YijPnU8AXEpA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.5.tgz", + "integrity": "sha512-fDKo1gstwFFSfacIeH5KfwzjykIE6ldh1iH9Y/8YkAZrhmu4TctqYjSh7t0K2VyDSXOZJ1MLhht/k9IvYGcIxg==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.5.tgz", + "integrity": "sha512-DhykHXM0ZABqfIGYNv93A5KKDw/+ywBFnuWybZZWcuzWHfbp21wUfRkbtz7dMGwGgT4iXjWuhRMA2Mzod6W4WA==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.5", + "@webassemblyjs/helper-api-error": "1.11.5", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.5.tgz", + "integrity": "sha512-oC4Qa0bNcqnjAowFn7MPCETQgDYytpsfvz4ujZz63Zu/a/v71HeCAAmZsgZ3YVKec3zSPYytG3/PrRCqbtcAvA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.5.tgz", + "integrity": "sha512-uEoThA1LN2NA+K3B9wDo3yKlBfVtC6rh0i4/6hvbz071E8gTNZD/pT0MsBf7MeD6KbApMSkaAK0XeKyOZC7CIA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.5", + "@webassemblyjs/helper-buffer": "1.11.5", + "@webassemblyjs/helper-wasm-bytecode": "1.11.5", + "@webassemblyjs/wasm-gen": "1.11.5" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.5.tgz", + "integrity": "sha512-37aGq6qVL8A8oPbPrSGMBcp38YZFXcHfiROflJn9jxSdSMMM5dS5P/9e2/TpaJuhE+wFrbukN2WI6Hw9MH5acg==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.5.tgz", + "integrity": "sha512-ajqrRSXaTJoPW+xmkfYN6l8VIeNnR4vBOTQO9HzR7IygoCcKWkICbKFbVTNMjMgMREqXEr0+2M6zukzM47ZUfQ==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.5.tgz", + "integrity": "sha512-WiOhulHKTZU5UPlRl53gHR8OxdGsSOxqfpqWeA2FmcwBMaoEdz6b2x2si3IwC9/fSPLfe8pBMRTHVMk5nlwnFQ==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.5.tgz", + "integrity": "sha512-C0p9D2fAu3Twwqvygvf42iGCQ4av8MFBLiTb+08SZ4cEdwzWx9QeAHDo1E2k+9s/0w1DM40oflJOpkZ8jW4HCQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.5", + "@webassemblyjs/helper-buffer": "1.11.5", + "@webassemblyjs/helper-wasm-bytecode": "1.11.5", + "@webassemblyjs/helper-wasm-section": "1.11.5", + "@webassemblyjs/wasm-gen": "1.11.5", + "@webassemblyjs/wasm-opt": "1.11.5", + "@webassemblyjs/wasm-parser": "1.11.5", + "@webassemblyjs/wast-printer": "1.11.5" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.5.tgz", + "integrity": "sha512-14vteRlRjxLK9eSyYFvw1K8Vv+iPdZU0Aebk3j6oB8TQiQYuO6hj9s4d7qf6f2HJr2khzvNldAFG13CgdkAIfA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.5", + "@webassemblyjs/helper-wasm-bytecode": "1.11.5", + "@webassemblyjs/ieee754": "1.11.5", + "@webassemblyjs/leb128": "1.11.5", + "@webassemblyjs/utf8": "1.11.5" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.5.tgz", + "integrity": "sha512-tcKwlIXstBQgbKy1MlbDMlXaxpucn42eb17H29rawYLxm5+MsEmgPzeCP8B1Cl69hCice8LeKgZpRUAPtqYPgw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.5", + "@webassemblyjs/helper-buffer": "1.11.5", + "@webassemblyjs/wasm-gen": "1.11.5", + "@webassemblyjs/wasm-parser": "1.11.5" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.5.tgz", + "integrity": "sha512-SVXUIwsLQlc8srSD7jejsfTU83g7pIGr2YYNb9oHdtldSxaOhvA5xwvIiWIfcX8PlSakgqMXsLpLfbbJ4cBYew==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.5", + "@webassemblyjs/helper-api-error": "1.11.5", + "@webassemblyjs/helper-wasm-bytecode": "1.11.5", + "@webassemblyjs/ieee754": "1.11.5", + "@webassemblyjs/leb128": "1.11.5", + "@webassemblyjs/utf8": "1.11.5" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.5.tgz", + "integrity": "sha512-f7Pq3wvg3GSPUPzR0F6bmI89Hdb+u9WXrSKc4v+N0aV0q6r42WoF92Jp2jEorBEBRoRNXgjp53nBniDXcqZYPA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.5", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.1.tgz", + "integrity": "sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.1.tgz", + "integrity": "sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz", + "integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-escape-sequences": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz", + "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", + "dev": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/ansi-escape-sequences/node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-html-community": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", + "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "bin": { + "ansi-html": "bin/ansi-html" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "dev": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true + }, + "node_modules/babel-jest": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", + "integrity": "sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.5.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.5.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-jest/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz", + "integrity": "sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz", + "integrity": "sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.5.0", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/bonjour-service": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.1.tgz", + "integrity": "sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg==", + "dev": true, + "dependencies": { + "array-flatten": "^2.1.2", + "dns-equal": "^1.0.0", + "fast-deep-equal": "^3.1.3", + "multicast-dns": "^7.2.5" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cache-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", + "integrity": "sha512-4gkeHlFpSKgm3vm2gJN5sPqfmijYRFYCQ6tv5cLw0xVmT6r1z1vd4FNnpuOREco3cBs1G709sZ72LdgddKvL5w==", + "dev": true, + "dependencies": { + "array-back": "^4.0.1", + "fs-then-native": "^2.0.0", + "mkdirp2": "^1.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cache-point/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001481", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz", + "integrity": "sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/catharsis": { + "version": "0.9.0", + "resolved": "git+ssh://git@github.com/xenova/catharsis.git#dda824bd3b6c08d418e8c8a03f20446cfb25aa1e", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + }, + "engines": { + "node": ">= v18.16.0" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, - "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", + "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-all": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/collect-all/-/collect-all-1.0.4.tgz", + "integrity": "sha512-RKZhRwJtJEP5FWul+gkSMEnaK6H3AGPTTWOiRimCcs+rc/OmQE3Yhy1Q7A7KsdkG3ZXVdZq68Y6ONSdvkeEcKA==", + "dev": true, + "dependencies": { + "stream-connect": "^1.0.2", + "stream-via": "^1.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-args/node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/command-line-args/node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-tool": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/command-line-tool/-/command-line-tool-0.8.0.tgz", + "integrity": "sha512-Xw18HVx/QzQV3Sc5k1vy3kgtOeGmsKIqwtFFoyjI4bbcpSgnw2CWVULvtakyw4s6fhyAdI6soQQhXc2OzJy62g==", + "dev": true, + "dependencies": { + "ansi-escape-sequences": "^4.0.0", + "array-back": "^2.0.0", + "command-line-args": "^5.0.0", + "command-line-usage": "^4.1.0", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-tool/node_modules/array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-4.1.0.tgz", + "integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==", + "dev": true, + "dependencies": { + "ansi-escape-sequences": "^4.0.0", + "array-back": "^2.0.0", + "table-layout": "^0.4.2", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/common-sequence": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz", + "integrity": "sha512-jAg09gkdkrDO9EWTdXfv80WWH3yeZl5oT69fGfedBNS9pXUKYInVJ1bJ+/ht2+Moeei48TmSbQDYMc8EOx9G0g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dev": true, + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/config-master": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", + "integrity": "sha512-n7LBL1zBzYdTpF1mx5DNcZnZn05CWIdsdvtPL4MosvqbBUK3Rq6VWEtGUuF3Y0s9/CIhMejezqlSkP6TnCJ/9g==", + "dev": true, + "dependencies": { + "walk-back": "^2.0.1" + } + }, + "node_modules/config-master/node_modules/walk-back": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", + "integrity": "sha512-Nb6GvBR8UWX1D+Le+xUq0+Q1kFmRBIWVrfLnQAOmcpEzA9oAxwJ9gIr36t9TWYfzvWRvuMtjHiVsJYEkXWaTAQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/connect-history-api-fallback": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", + "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, + "node_modules/copy-webpack-plugin": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", + "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", + "dev": true, + "dependencies": { + "fast-glob": "^3.2.11", + "glob-parent": "^6.0.1", + "globby": "^13.1.1", + "normalize-path": "^3.0.0", + "schema-utils": "^4.0.0", + "serialize-javascript": "^6.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/copy-webpack-plugin/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/copy-webpack-plugin/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/copy-webpack-plugin/node_modules/schema-utils": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.1.tgz", + "integrity": "sha512-lELhBAAly9NowEsX0yZBlw9ahZG+sK/1RJ21EpzdYHKEs13Vku3LJ+MIPhh4sMs0oCCeufZQEQbMekiA4vuVIQ==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-gateway": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", + "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true + }, + "node_modules/diff-sequences": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", + "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dmd": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/dmd/-/dmd-6.2.0.tgz", + "integrity": "sha512-uXWxLF1H7TkUAuoHK59/h/ts5cKavm2LnhrIgJWisip4BVzPoXavlwyoprFFn2CzcahKYgvkfaebS6oxzgflkg==", + "dev": true, + "dependencies": { + "array-back": "^6.2.2", + "cache-point": "^2.0.0", + "common-sequence": "^2.0.2", + "file-set": "^4.0.2", + "handlebars": "^4.7.7", + "marked": "^4.2.3", + "object-get": "^2.1.1", + "reduce-flatten": "^3.0.1", + "reduce-unique": "^2.0.1", + "reduce-without": "^1.0.1", + "test-value": "^3.0.0", + "walk-back": "^5.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", + "dev": true + }, + "node_modules/dns-packet": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.0.tgz", + "integrity": "sha512-rza3UH1LwdHh9qyPXp8lkwpjSNk/AMD3dPytUoRoqnypDUhY0xvbdmVhWOfxO68frEfV9BU8V12Ez7ZsHGZpCQ==", + "dev": true, + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, + "node_modules/electron-to-chromium": { + "version": "1.4.369", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.369.tgz", + "integrity": "sha512-LfxbHXdA/S+qyoTEA4EbhxGjrxx7WK2h6yb5K2v0UCOufUKX+VZaHbl3svlzZfv9sGseym/g3Ne4DpsgRULmqg==", + "dev": true + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz", + "integrity": "sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-ex/node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/es-module-lexer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", + "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/expect": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz", + "integrity": "sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.5.0", + "jest-get-type": "^29.4.3", + "jest-matcher-utils": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-util": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "dev": true, + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-set": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/file-set/-/file-set-4.0.2.tgz", + "integrity": "sha512-fuxEgzk4L8waGXaAkd8cMr73Pm0FxOVkn8hztzUW7BAHhOGH90viQNXbiOsnecCWmfInqU6YmAMwxRMdKETceQ==", "dev": true, + "dependencies": { + "array-back": "^5.0.0", + "glob": "^7.1.6" + }, "engines": { - "node": ">=6.0" + "node": ">=10" } }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "node_modules/file-set/node_modules/array-back": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", + "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dev": true, "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" }, "engines": { - "node": ">=12.5.0" + "node": ">= 0.8" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, "dependencies": { - "color-name": "~1.1.4" + "array-back": "^3.0.1" }, "engines": { - "node": ">=7.0.0" + "node": ">=4.0.0" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "node_modules/find-replace/node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/colorette": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", - "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "node_modules/flatbuffers": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz", + "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==" + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "node_modules/fs-monkey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", + "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", "dev": true }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "node_modules/fs-then-native": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz", + "integrity": "sha512-X712jAOaWXkemQCAmWeg5rOT2i+KOpWz1Z/txk/cW0qlOu2oQ9H61vc5w3X/iyuUEfq/OyaFJ78/cZAQD1/bgA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", "dev": true, "dependencies": { - "mime-db": ">= 1.43.0 < 2" + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">= 0.6" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" } }, - "node_modules/compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "node_modules/globby": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", + "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", "dev": true, "dependencies": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" }, "engines": { - "node": ">= 0.8.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/compression/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "node_modules/guid-typescript": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", + "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==" + }, + "node_modules/handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", "dev": true }, - "node_modules/connect-history-api-fallback": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", - "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, "engines": { - "node": ">=0.8" + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" } }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { - "safe-buffer": "5.2.1" + "function-bind": "^1.1.1" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.4.0" } }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "dev": true - }, - "node_modules/copy-webpack-plugin": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", - "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", + "node_modules/hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", "dev": true, "dependencies": { - "fast-glob": "^3.2.11", - "glob-parent": "^6.0.1", - "globby": "^13.1.1", - "normalize-path": "^3.0.0", - "schema-utils": "^4.0.0", - "serialize-javascript": "^6.0.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" } }, - "node_modules/copy-webpack-plugin/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/hpack.js/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/copy-webpack-plugin/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "node_modules/hpack.js/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/hpack.js/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" + "safe-buffer": "~5.1.0" } }, - "node_modules/copy-webpack-plugin/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "node_modules/html-entities": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", + "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", + "dev": true + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "dependencies": { - "is-glob": "^4.0.3" + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" }, "engines": { - "node": ">=10.13.0" + "node": ">= 0.8" } }, - "node_modules/copy-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "node_modules/http-parser-js": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", "dev": true }, - "node_modules/copy-webpack-plugin/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" }, "engines": { - "node": ">= 12.13.0" + "node": ">=8.0.0" + } + }, + "node_modules/http-proxy-middleware": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "dev": true, + "dependencies": { + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/express": "^4.17.13" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "safer-buffer": ">= 2.1.2 < 3" }, "engines": { - "node": ">= 8" + "node": ">=0.10.0" } }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, - "dependencies": { - "ms": "2.0.0" + "engines": { + "node": ">= 4" } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, "dependencies": { - "mimic-response": "^3.1.0" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" }, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, "engines": { - "node": ">=4.0.0" + "node": ">=0.8.19" } }, - "node_modules/default-gateway": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { - "execa": "^5.0.0" - }, - "engines": { - "node": ">= 10" + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true, "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" + "node": ">=10.13.0" } }, - "node_modules/detect-libc": { + "node_modules/ipaddr.js": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", + "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", + "dev": true, "engines": { - "node": ">=8" + "node": ">= 10" } }, - "node_modules/detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "dependencies": { - "path-type": "^4.0.0" + "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/dns-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", - "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", - "dev": true - }, - "node_modules/dns-packet": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.4.0.tgz", - "integrity": "sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g==", + "node_modules/is-core-module": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", + "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", "dev": true, "dependencies": { - "@leichtgewicht/ip-codec": "^2.0.1" + "has": "^1.0.3" }, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/electron-to-chromium": { - "version": "1.4.315", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.315.tgz", - "integrity": "sha512-ndBQYz3Eyy3rASjjQ9poMJGoAlsZ/aZnq6GBsGL4w/4sWIAwiUHVSsMuADbxa8WJw7pZ0oxLpGbtoDt4vRTdCg==", - "dev": true + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" } }, - "node_modules/enhanced-resolve": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", - "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=10.13.0" + "node": ">=0.10.0" } }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, "engines": { - "node": ">=4" + "node": ">=0.12.0" } }, - "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "node_modules/is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "isobject": "^3.0.1" }, "engines": { - "node": ">=8.0.0" + "node": ">=0.10.0" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "dependencies": { - "estraverse": "^5.2.0" + "is-docker": "^2.0.0" }, "engines": { - "node": ">=4.0" + "node": ">=8" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, "engines": { - "node": ">=4.0" + "node": ">=0.10.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, "engines": { - "node": ">=4.0" + "node": ">=8" } }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "engines": { - "node": ">=0.8.x" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "node": ">=8" } }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" }, "engines": { - "node": ">= 0.10.0" + "node": ">=10" } }, - "node_modules/express/node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "dev": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "ms": "2.1.2" }, "engines": { - "node": ">=8.6.0" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "node_modules/istanbul-reports": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", + "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, "engines": { - "node": ">= 4.9.1" + "node": ">=8" } }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "node_modules/jest": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.5.0.tgz", + "integrity": "sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==", "dev": true, "dependencies": { - "reusify": "^1.0.4" + "@jest/core": "^29.5.0", + "@jest/types": "^29.5.0", + "import-local": "^3.0.2", + "jest-cli": "^29.5.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "node_modules/jest-changed-files": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz", + "integrity": "sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==", "dev": true, "dependencies": { - "websocket-driver": ">=0.5.1" + "execa": "^5.0.0", + "p-limit": "^3.1.0" }, "engines": { - "node": ">=0.8.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/jest-changed-files/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "node_modules/jest-circus": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.5.0.tgz", + "integrity": "sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==", "dev": true, "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" + "@jest/environment": "^29.5.0", + "@jest/expect": "^29.5.0", + "@jest/test-result": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.5.0", + "jest-matcher-utils": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-runtime": "^29.5.0", + "jest-snapshot": "^29.5.0", + "jest-util": "^29.5.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.5.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">= 0.8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/jest-circus/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, "engines": { "node": ">=8" } }, - "node_modules/flatbuffers": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz", - "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==" - }, - "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "node_modules/jest-cli": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.5.0.tgz", + "integrity": "sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], + "dependencies": { + "@jest/core": "^29.5.0", + "@jest/test-result": "^29.5.0", + "@jest/types": "^29.5.0", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.5.0", + "jest-util": "^29.5.0", + "jest-validate": "^29.5.0", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, "engines": { - "node": ">=4.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "peerDependenciesMeta": { - "debug": { + "node-notifier": { "optional": true } } }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "node_modules/jest-config": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.5.0.tgz", + "integrity": "sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==", "dev": true, - "engines": { - "node": ">= 0.6" + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.5.0", + "@jest/types": "^29.5.0", + "babel-jest": "^29.5.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.5.0", + "jest-environment-node": "^29.5.0", + "jest-get-type": "^29.4.3", + "jest-regex-util": "^29.4.3", + "jest-resolve": "^29.5.0", + "jest-runner": "^29.5.0", + "jest-util": "^29.5.0", + "jest-validate": "^29.5.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.5.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } } }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "node_modules/jest-config/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "node_modules/fs-monkey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", - "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/jest-config/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/jest-diff": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", + "integrity": "sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "chalk": "^4.0.0", + "diff-sequences": "^29.4.3", + "jest-get-type": "^29.4.3", + "pretty-format": "^29.5.0" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/jest-docblock": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", + "integrity": "sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "detect-newline": "^3.0.0" }, "engines": { - "node": ">= 6" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "node_modules/globby": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", - "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "node_modules/jest-each": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.5.0.tgz", + "integrity": "sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==", "dev": true, "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "@jest/types": "^29.5.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.4.3", + "jest-util": "^29.5.0", + "pretty-format": "^29.5.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/guid-typescript": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", - "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==" - }, - "node_modules/handle-thing": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", - "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/jest-environment-node": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz", + "integrity": "sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1" + "@jest/environment": "^29.5.0", + "@jest/fake-timers": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "jest-mock": "^29.5.0", + "jest-util": "^29.5.0" }, "engines": { - "node": ">= 0.4.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/jest-get-type": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", + "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", "dev": true, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/jest-haste-map": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.5.0.tgz", + "integrity": "sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==", "dev": true, + "dependencies": { + "@jest/types": "^29.5.0", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.4.3", + "jest-util": "^29.5.0", + "jest-worker": "^29.5.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "optionalDependencies": { + "fsevents": "^2.3.2" } }, - "node_modules/hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", + "node_modules/jest-haste-map/node_modules/jest-worker": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", + "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", "dev": true, "dependencies": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" + "@types/node": "*", + "jest-util": "^29.5.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/hpack.js/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/jest-leak-detector": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz", + "integrity": "sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==", "dev": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "jest-get-type": "^29.4.3", + "pretty-format": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/hpack.js/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/hpack.js/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/jest-matcher-utils": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz", + "integrity": "sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.0" + "chalk": "^4.0.0", + "jest-diff": "^29.5.0", + "jest-get-type": "^29.4.3", + "pretty-format": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/html-entities": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", - "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", - "dev": true - }, - "node_modules/http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", - "dev": true - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "node_modules/jest-message-util": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz", + "integrity": "sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==", "dev": true, "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.5.0", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.5.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, "engines": { - "node": ">= 0.8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/http-parser-js": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", - "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", - "dev": true + "node_modules/jest-message-util/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "node_modules/jest-mock": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz", + "integrity": "sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==", "dev": true, "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" + "@jest/types": "^29.5.0", + "@types/node": "*", + "jest-util": "^29.5.0" }, "engines": { - "node": ">=8.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/http-proxy-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", - "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "dependencies": { - "@types/http-proxy": "^1.17.8", - "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.2" - }, "engines": { - "node": ">=12.0.0" + "node": ">=6" }, "peerDependencies": { - "@types/express": "^4.17.13" + "jest-resolve": "*" }, "peerDependenciesMeta": { - "@types/express": { + "jest-resolve": { "optional": true } } }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "node_modules/jest-regex-util": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", + "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", "dev": true, "engines": { - "node": ">=10.17.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/jest-resolve": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.5.0.tgz", + "integrity": "sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==", "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.5.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.5.0", + "jest-validate": "^29.5.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/jest-resolve-dependencies": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz", + "integrity": "sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.4.3", + "jest-snapshot": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "node_modules/jest-resolve/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { - "node": ">= 4" + "node": ">=8" } }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "node_modules/jest-runner": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.5.0.tgz", + "integrity": "sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==", "dev": true, "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" + "@jest/console": "^29.5.0", + "@jest/environment": "^29.5.0", + "@jest/test-result": "^29.5.0", + "@jest/transform": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.4.3", + "jest-environment-node": "^29.5.0", + "jest-haste-map": "^29.5.0", + "jest-leak-detector": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-resolve": "^29.5.0", + "jest-runtime": "^29.5.0", + "jest-util": "^29.5.0", + "jest-watcher": "^29.5.0", + "jest-worker": "^29.5.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, - "bin": { - "import-local-fixture": "fixtures/cli.js" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/jest-worker": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", + "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.5.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/interpret": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "node_modules/jest-runtime": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz", + "integrity": "sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==", "dev": true, + "dependencies": { + "@jest/environment": "^29.5.0", + "@jest/fake-timers": "^29.5.0", + "@jest/globals": "^29.5.0", + "@jest/source-map": "^29.4.3", + "@jest/test-result": "^29.5.0", + "@jest/transform": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-mock": "^29.5.0", + "jest-regex-util": "^29.4.3", + "jest-resolve": "^29.5.0", + "jest-snapshot": "^29.5.0", + "jest-util": "^29.5.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, "engines": { - "node": ">=10.13.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/ipaddr.js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", - "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", + "node_modules/jest-runtime/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { - "node": ">= 10" + "node": ">=8" } }, - "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + "node_modules/jest-snapshot": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz", + "integrity": "sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.5.0", + "@jest/transform": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/babel__traverse": "^7.0.6", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.5.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.5.0", + "jest-get-type": "^29.4.3", + "jest-matcher-utils": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-util": "^29.5.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.5.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/jest-util": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz", + "integrity": "sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==", "dev": true, "dependencies": { - "binary-extensions": "^2.0.0" + "@jest/types": "^29.5.0", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "node_modules/jest-validate": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.5.0.tgz", + "integrity": "sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==", "dev": true, "dependencies": { - "has": "^1.0.3" + "@jest/types": "^29.5.0", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.4.3", + "leven": "^3.1.0", + "pretty-format": "^29.5.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "bin": { - "is-docker": "cli.js" - }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/jest-watcher": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.5.0.tgz", + "integrity": "sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==", "dev": true, + "dependencies": { + "@jest/test-result": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.5.0", + "string-length": "^4.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, - "engines": { - "node": ">=0.12.0" + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "node_modules/js-yaml/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "sprintf-js": "~1.0.2" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "node_modules/js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "xmlcreate": "^2.0.4" + } + }, + "node_modules/jsdoc": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.2.tgz", + "integrity": "sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.15", + "@jsdoc/salty": "^0.2.1", + "@types/markdown-it": "^12.2.3", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^3.0.0", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "underscore": "~1.13.2" + }, + "bin": { + "jsdoc": "jsdoc.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=12.0.0" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/jsdoc-api": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-8.0.0.tgz", + "integrity": "sha512-Rnhor0suB1Ds1abjmFkFfKeD+kSMRN9oHMTMZoJVUrmtCGDwXty+sWMA9sa4xbe4UyxuPjhC7tavZ40mDKK6QQ==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "array-back": "^6.2.2", + "cache-point": "^2.0.0", + "collect-all": "^1.0.4", + "file-set": "^4.0.2", + "fs-then-native": "^2.0.0", + "jsdoc": "^4.0.0", + "object-to-spawn-args": "^2.0.1", + "temp-path": "^1.0.0", + "walk-back": "^5.1.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=12.17" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/jsdoc-parse": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.0.tgz", + "integrity": "sha512-Afu1fQBEb7QHt6QWX/6eUWvYHJofB90Fjx7FuJYF7mnG9z5BkAIpms1wsnvYLytfmqpEENHs/fax9p8gvMj7dw==", "dev": true, "dependencies": { - "is-docker": "^2.0.0" + "array-back": "^6.2.2", + "lodash.omit": "^4.5.0", + "lodash.pick": "^4.4.0", + "reduce-extract": "^1.0.0", + "sort-array": "^4.1.5", + "test-value": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "node_modules/jsdoc-to-markdown": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-8.0.0.tgz", + "integrity": "sha512-2FQvYkg491+FP6s15eFlgSSWs69CvQrpbABGYBtvAvGWy/lWo8IKKToarT283w59rQFrpcjHl3YdhHCa3l7gXg==", + "dev": true, + "dependencies": { + "array-back": "^6.2.2", + "command-line-tool": "^0.8.0", + "config-master": "^3.1.0", + "dmd": "^6.2.0", + "jsdoc-api": "^8.0.0", + "jsdoc-parse": "^6.2.0", + "walk-back": "^5.1.0" + }, + "bin": { + "jsdoc2md": "bin/cli.js" + }, + "engines": { + "node": ">=12.17" + } }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "node_modules/jsdoc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "bin": { + "jsesc": "bin/jsesc" }, "engines": { - "node": ">= 10.13.0" + "node": ">=4" } }, "node_modules/json-parse-even-better-errors": { @@ -2231,6 +5132,18 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -2240,6 +5153,58 @@ "node": ">=0.10.0" } }, + "node_modules/klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.9" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/launch-editor": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.0.tgz", + "integrity": "sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "shell-quote": "^1.7.3" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "dependencies": { + "uc.micro": "^1.0.1" + } + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -2261,6 +5226,36 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, + "node_modules/lodash.omit": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", + "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", + "dev": true + }, + "node_modules/lodash.padend": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw==", + "dev": true + }, + "node_modules/lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", + "dev": true + }, "node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -2277,6 +5272,83 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it-anchor": { + "version": "8.6.7", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", + "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", + "dev": true, + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "dev": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -2287,9 +5359,9 @@ } }, "node_modules/memfs": { - "version": "3.4.13", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.13.tgz", - "integrity": "sha512-omTM41g3Skpvx5dSYeZIbXKcXoAVc/AoMNwn9TKx++L/gaen/+4TTttmu8ZSch5vfVJ8uJvGbroTsIlslRg6lg==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.1.tgz", + "integrity": "sha512-UWbFJKvj5k+nETdteFndTpYxdeTMox/ULeqX5k/dpaQJCCFmj5EeKv3dBcyO2xmkRAx2vppRu5dVG7SOtsGOzA==", "dev": true, "dependencies": { "fs-monkey": "^1.0.3" @@ -2420,11 +5492,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" }, + "node_modules/mkdirp2": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/mkdirp2/-/mkdirp2-1.0.5.tgz", + "integrity": "sha512-xOE9xbICroUDmG1ye2h4bZ8WBie9EGmACaco8K8cx6RlkJJrxGIqjGqztAI+NMhexXBcdGbSEzI6N3EJPevxZw==", + "dev": true + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -2449,6 +5539,12 @@ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -2489,6 +5585,12 @@ "node": ">= 6.13.0" } }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, "node_modules/node-releases": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", @@ -2516,6 +5618,12 @@ "node": ">=8" } }, + "node_modules/object-get": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", + "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", + "dev": true + }, "node_modules/object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", @@ -2525,6 +5633,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-to-spawn-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", + "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -2681,6 +5798,24 @@ "node": ">=6" } }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -2756,6 +5891,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pirates": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", + "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -2798,12 +5942,51 @@ "node": ">=10" } }, + "node_modules/pretty-format": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.5.0.tgz", + "integrity": "sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.4.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/protobufjs": { "version": "6.11.3", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", @@ -2869,6 +6052,22 @@ "node": ">=6" } }, + "node_modules/pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -2960,6 +6159,12 @@ "rc": "cli.js" } }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "node_modules/readable-stream": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.1.tgz", @@ -2997,6 +6202,107 @@ "node": ">= 10.13.0" } }, + "node_modules/reduce-extract": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/reduce-extract/-/reduce-extract-1.0.0.tgz", + "integrity": "sha512-QF8vjWx3wnRSL5uFMyCjDeDc5EBMiryoT9tz94VvgjKfzecHAVnqmXAwQDcr7X4JmLc2cjkjFGCVzhMqDjgR9g==", + "dev": true, + "dependencies": { + "test-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reduce-extract/node_modules/array-back": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", + "dev": true, + "dependencies": { + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/reduce-extract/node_modules/test-value": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/test-value/-/test-value-1.1.0.tgz", + "integrity": "sha512-wrsbRo7qP+2Je8x8DsK8ovCGyxe3sYfQwOraIY/09A2gFXU9DYKiTF14W4ki/01AEh56kMzAmlj9CaHGDDUBJA==", + "dev": true, + "dependencies": { + "array-back": "^1.0.2", + "typical": "^2.4.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reduce-flatten": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.1.tgz", + "integrity": "sha512-bYo+97BmUUOzg09XwfkwALt4PQH1M5L0wzKerBt6WLm3Fhdd43mMS89HiT1B9pJIqko/6lWx3OnV4J9f2Kqp5Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/reduce-unique": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-2.0.1.tgz", + "integrity": "sha512-x4jH/8L1eyZGR785WY+ePtyMNhycl1N2XOLxhCbzZFaqF4AXjLzqSxa2UHgJ2ZVR/HHyPOvl1L7xRnW8ye5MdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/reduce-without": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/reduce-without/-/reduce-without-1.0.1.tgz", + "integrity": "sha512-zQv5y/cf85sxvdrKPlfcRzlDn/OqKFThNimYmsS3flmkioKvkUGn2Qg9cJVoQiEvdxFGLE0MQER/9fZ9sUqdxg==", + "dev": true, + "dependencies": { + "test-value": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reduce-without/node_modules/array-back": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", + "dev": true, + "dependencies": { + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/reduce-without/node_modules/test-value": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", + "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", + "dev": true, + "dependencies": { + "array-back": "^1.0.3", + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3012,13 +6318,22 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, + "node_modules/requizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", + "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", + "dev": true, + "dependencies": { + "lodash": "^4.17.21" + } + }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -3050,6 +6365,15 @@ "node": ">=8" } }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", @@ -3133,9 +6457,9 @@ "dev": true }, "node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.2.tgz", + "integrity": "sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", @@ -3360,6 +6684,15 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -3431,6 +6764,12 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, "node_modules/slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -3454,6 +6793,37 @@ "websocket-driver": "^0.7.4" } }, + "node_modules/sort-array": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-4.1.5.tgz", + "integrity": "sha512-Ya4peoS1fgFN42RN1REk2FgdNOeLIEMKFGJvs7VTP3OklF8+kl2SkpVliZ4tk/PurWsrWRsdNdU+tgyOBkB9sA==", + "dev": true, + "dependencies": { + "array-back": "^5.0.0", + "typical": "^6.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sort-array/node_modules/array-back": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", + "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/sort-array/node_modules/typical": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", + "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3549,6 +6919,24 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -3558,6 +6946,39 @@ "node": ">= 0.8" } }, + "node_modules/stream-connect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-connect/-/stream-connect-1.0.2.tgz", + "integrity": "sha512-68Kl+79cE0RGKemKkhxTSg8+6AGrqBt+cbZAXevg2iJ6Y3zX4JhA/sZeGzLpxW9cXhmqAcE7KnJCisUmIUfnFQ==", + "dev": true, + "dependencies": { + "array-back": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stream-connect/node_modules/array-back": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", + "dev": true, + "dependencies": { + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/stream-via": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", + "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -3566,6 +6987,54 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -3610,6 +7079,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/table-layout": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz", + "integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==", + "dev": true, + "dependencies": { + "array-back": "^2.0.0", + "deep-extend": "~0.6.0", + "lodash.padend": "^4.6.1", + "typical": "^2.6.1", + "wordwrapjs": "^3.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -3645,10 +7142,16 @@ "node": ">=6" } }, + "node_modules/temp-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-path/-/temp-path-1.0.0.tgz", + "integrity": "sha512-TvmyH7kC6ZVTYkqCODjJIbgvu0FKiwQpZ4D1aknE7xpcDf/qEOB8KZEK5ef2pfbVoiBhNWs3yx4y+ESMtNYmlg==", + "dev": true + }, "node_modules/terser": { - "version": "5.16.5", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.5.tgz", - "integrity": "sha512-qcwfg4+RZa3YvlFh0qjifnzBHjKGNbtDo9yivMqMFDy9Q6FSaQWSB/j1xKhsoUFJIqDOM3TsN6D5xbrMrFcHbg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz", + "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.2", @@ -3664,16 +7167,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz", - "integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==", + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz", + "integrity": "sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.16.5" }, "engines": { "node": ">= 10.13.0" @@ -3697,12 +7200,66 @@ } } }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-value": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/test-value/-/test-value-3.0.0.tgz", + "integrity": "sha512-sVACdAWcZkSU9x7AOmJo5TqE+GyNJknHaHsMrR6ZnhjVlVN9Yx6FjHrsKZ3BjIpPCT68zYesPWkakrNupwfOTQ==", + "dev": true, + "dependencies": { + "array-back": "^2.0.0", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/test-value/node_modules/array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3735,6 +7292,27 @@ "node": "*" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -3761,6 +7339,37 @@ "node": ">=12.20" } }, + "node_modules/typical": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", + "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==", + "dev": true + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", + "dev": true + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -3771,9 +7380,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "funding": [ { @@ -3783,6 +7392,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -3790,7 +7403,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -3828,6 +7441,26 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -3837,6 +7470,24 @@ "node": ">= 0.8" } }, + "node_modules/walk-back": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.0.tgz", + "integrity": "sha512-Uhxps5yZcVNbLEAnb+xaEEMdgTXl9qAQDzKYejG2AZ7qPwRQ81lozY9ECDbjLPNWm7YsO1IK5rsP1KoQzXAcGA==", + "dev": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -3860,22 +7511,22 @@ } }, "node_modules/webpack": { - "version": "5.76.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz", - "integrity": "sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==", + "version": "5.80.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.80.0.tgz", + "integrity": "sha512-OIMiq37XK1rWO8mH9ssfFKZsXg4n6klTEDL7S8/HqbAOBBaiy8ABvXvz0dDCXeEF9gqwxSvVk611zFPjS8hJxA==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.13.0", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", @@ -3884,9 +7535,9 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.1.2", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", + "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, @@ -3907,17 +7558,17 @@ } }, "node_modules/webpack-cli": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.1.tgz", - "integrity": "sha512-S3KVAyfwUqr0Mo/ur3NzIp6jnerNpo7GUO6so51mxLi1spqsA17YcMXy0WOIJtBSnj748lthxC6XLbNKh/ZC+A==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz", + "integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^2.0.1", "@webpack-cli/info": "^2.0.1", - "@webpack-cli/serve": "^2.0.1", + "@webpack-cli/serve": "^2.0.2", "colorette": "^2.0.14", - "commander": "^9.4.1", + "commander": "^10.0.1", "cross-spawn": "^7.0.3", "envinfo": "^7.7.3", "fastest-levenshtein": "^1.0.12", @@ -3952,12 +7603,12 @@ } }, "node_modules/webpack-cli/node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "engines": { - "node": "^12.20.0 || >=14" + "node": ">=14" } }, "node_modules/webpack-dev-middleware": { @@ -4018,15 +7669,15 @@ "dev": true }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.1.tgz", + "integrity": "sha512-lELhBAAly9NowEsX0yZBlw9ahZG+sK/1RJ21EpzdYHKEs13Vku3LJ+MIPhh4sMs0oCCeufZQEQbMekiA4vuVIQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -4037,9 +7688,9 @@ } }, "node_modules/webpack-dev-server": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.11.1.tgz", - "integrity": "sha512-lILVz9tAUy1zGFwieuaQtYiadImb5M3d+H+L1zDYalYoDl0cksAB1UNyuE5MMWJrG6zR1tXkCP2fitl7yoUJiw==", + "version": "4.13.3", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz", + "integrity": "sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug==", "dev": true, "dependencies": { "@types/bonjour": "^3.5.9", @@ -4061,6 +7712,7 @@ "html-entities": "^2.3.2", "http-proxy-middleware": "^2.0.3", "ipaddr.js": "^2.0.1", + "launch-editor": "^2.6.0", "open": "^8.0.9", "p-retry": "^4.5.0", "rimraf": "^3.0.2", @@ -4070,7 +7722,7 @@ "sockjs": "^0.3.24", "spdy": "^4.0.2", "webpack-dev-middleware": "^5.3.1", - "ws": "^8.4.2" + "ws": "^8.13.0" }, "bin": { "webpack-dev-server": "bin/webpack-dev-server.js" @@ -4086,6 +7738,9 @@ "webpack": "^4.37.0 || ^5.0.0" }, "peerDependenciesMeta": { + "webpack": { + "optional": true + }, "webpack-cli": { "optional": true } @@ -4126,15 +7781,15 @@ "dev": true }, "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.1.tgz", + "integrity": "sha512-lELhBAAly9NowEsX0yZBlw9ahZG+sK/1RJ21EpzdYHKEs13Vku3LJ+MIPhh4sMs0oCCeufZQEQbMekiA4vuVIQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -4210,15 +7865,73 @@ "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", "dev": true }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, + "node_modules/wordwrapjs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz", + "integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==", + "dev": true, + "dependencies": { + "reduce-flatten": "^1.0.1", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/wordwrapjs/node_modules/reduce-flatten": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz", + "integrity": "sha512-j5WfFJfc9CoXv/WbwVLHq74i/hdTUpy+iNC534LxczMRP67vJeK3V9JOdnL0N1cIRbn9mYhE2yVjvvKXDxvNXQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/ws": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.1.tgz", - "integrity": "sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, "engines": { "node": ">=10.0.0" @@ -4236,10 +7949,64 @@ } } }, + "node_modules/xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 6a8cc68eb..99abe2245 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,20 @@ { "name": "@xenova/transformers", - "version": "1.4.3", - "description": "Run 🤗 Transformers in your browser! We currently support BERT, ALBERT, DistilBERT, MobileBERT, SqueezeBERT, T5, T5v1.1, FLAN-T5, mT5, BART, MarianMT, GPT2, GPT Neo, CodeGen, Whisper, CLIP, Vision Transformer, VisionEncoderDecoder, and DETR models, for a variety of tasks including: masked language modelling, text classification, token classification, zero-shot classification, text-to-text generation, translation, summarization, question answering, text generation, automatic speech recognition, image classification, zero-shot image classification, image-to-text, image segmentation, and object detection.", + "version": "2.0.0-alpha.0", + "description": "State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!", "main": "./src/transformers.js", - "directories": { - "test": "tests" - }, + "types": "./types/transformers.d.ts", + "type": "module", "scripts": { - "webpack": "webpack", - "typegen": "tsc ./src/transformers.js --outDir dist/types --allowJs --declaration --emitDeclarationOnly", + "typegen": "tsc ./src/transformers.js --allowJs --declaration --emitDeclarationOnly --declarationMap --outDir types", "dev": "webpack serve --no-client-overlay", - "test": "node tests/index.js", - "build": "npm run webpack && npm run typegen" + "build": "webpack && npm run typegen", + "generate-tests": "python tests/generate_tests.py", + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --verbose", + "readme": "python ./docs/scripts/build_readme.py", + "docs-api": "node ./docs/scripts/generate.js", + "docs-preview": "doc-builder preview transformers.js ./docs/source/ --not_python_module", + "docs-build": "doc-builder build transformers.js ./docs/source/ --not_python_module --build_dir ./docs/build/ --repo_owner xenova" }, "repository": { "type": "git", @@ -37,22 +40,33 @@ "onnxruntime-node": "^1.14.0" }, "devDependencies": { + "@types/jest": "^29.5.1", + "catharsis": "github:xenova/catharsis", "copy-webpack-plugin": "^11.0.0", + "jest": "^29.5.0", + "jest-environment-node": "^29.5.0", + "jsdoc-to-markdown": "^8.0.0", "typescript": "^5.0.2", - "webpack": "^5.76.0", - "webpack-cli": "^5.0.1", - "webpack-dev-server": "^4.11.1" + "webpack": "^5.80.0", + "webpack-cli": "^5.0.2", + "webpack-dev-server": "^4.13.3" }, "files": [ "src", "dist", - "tests", + "types", "README.md", "LICENSE" ], "browser": { "fs": false, "path": false, - "sharp": false + "url": false, + "sharp": false, + "onnxruntime-node": false, + "stream/web": false + }, + "publishConfig": { + "access": "public" } -} +} \ No newline at end of file diff --git a/scripts/convert.py b/scripts/convert.py index 9ef0a08ef..a41006899 100644 --- a/scripts/convert.py +++ b/scripts/convert.py @@ -3,26 +3,18 @@ import shutil from dataclasses import dataclass, field from typing import Optional +from tqdm import tqdm -from transformers import AutoTokenizer, HfArgumentParser +from transformers import ( + AutoConfig, + AutoTokenizer, + HfArgumentParser +) from transformers.utils import cached_file -from tqdm import tqdm -from optimum.utils import DEFAULT_DUMMY_SHAPES +import onnx +from optimum.exporters.onnx import main_export from optimum.exporters.tasks import TasksManager -from optimum.exporters.onnx.utils import ( - get_decoder_models_for_export, - get_encoder_decoder_models_for_export -) -from optimum.exporters.onnx.convert import export_models -from optimum.onnx.graph_transformations import merge_decoders -from optimum.onnxruntime.utils import ( - ONNX_WEIGHTS_NAME, - ONNX_ENCODER_NAME, - ONNX_DECODER_NAME, - ONNX_DECODER_WITH_PAST_NAME, - ONNX_DECODER_MERGED_NAME -) from onnxruntime.quantization import ( quantize_dynamic, QuantType @@ -46,21 +38,15 @@ class ConversionArguments: "help": "Whether to quantize the model." } ) - input_parent_dir: str = field( - default='./models/pytorch/', - metadata={ - "help": "Path where the original model will be loaded from." - } - ) output_parent_dir: str = field( - default='./models/onnx/', + default='./models/', metadata={ "help": "Path where the converted model will be saved to." } ) task: Optional[str] = field( - default='default', + default='auto', metadata={ "help": ( "The task to export the model for. If not specified, the task will be auto-inferred based on the model. Available tasks depend on the model, but are among:" @@ -84,12 +70,6 @@ class ConversionArguments: "help": 'The device to use to do the export.' } ) - from_hub: bool = field( - default=False, - metadata={ - "help": "Whether to use local files, or from the HuggingFace Hub." - } - ) merge_decoders: bool = field( default=True, metadata={ @@ -104,17 +84,7 @@ class ConversionArguments: ) -UNSIGNED_MODEL_TYPES = [ - 'whisper', - 'vision-encoder-decoder', - 'vit', - 'clip', - 'detr', - 'squeezebert', -] - - -def quantize(models_name_or_path, model_type): +def quantize(model_names_or_paths): """ Quantize the weights of the model from float32 to int8 to allow very efficient inference on modern CPU @@ -126,28 +96,40 @@ def quantize(models_name_or_path, model_type): Returns: The Path generated for the quantized """ - # As per docs, signed weight type (QInt8) is faster on most CPUs - # However, for some model types (e.g., whisper), we have to use - # unsigned weight type (QUInt8). For more info: - # https://github.com/microsoft/onnxruntime/issues/3130#issuecomment-1105200621 + for model in tqdm(model_names_or_paths, desc='Quantizing'): + directory_path = os.path.dirname(model) + file_name_without_extension = os.path.splitext( + os.path.basename(model))[0] + + # NOTE: + # As of 2023/04/20, the current latest version of onnxruntime-web is 1.14.0, and does not support INT8 weights for Conv layers. + # For this reason, we choose model weight types to ensure compatibility with onnxruntime-web. + # + # As per docs, signed weight type (QInt8) is faster on most CPUs, so, we use that unless the model contains a Conv layer. + # For more information, see: + # - https://github.com/microsoft/onnxruntime/issues/3130#issuecomment-1105200621 + # - https://github.com/microsoft/onnxruntime/issues/2339 - if model_type in UNSIGNED_MODEL_TYPES: - weight_type = QuantType.QUInt8 - else: - # Default - weight_type = QuantType.QInt8 + model_nodes = onnx.load_model(model).graph.node + op_types = set([node.op_type for node in model_nodes]) + weight_type = QuantType.QUInt8 if 'Conv' in op_types else QuantType.QInt8 - for model in tqdm(models_name_or_path, desc='Quantizing'): - # model_name = os.path.splitext(os.path.basename(model))[0] quantize_dynamic( model_input=model, - model_output=model, - per_channel=True, - reduce_range=True, # should be the same as per_channel + model_output=os.path.join( + directory_path, f'{file_name_without_extension}_quantized.onnx'), + per_channel=False, + reduce_range=False, weight_type=weight_type, optimize_model=False, - ) # op_types_to_quantize=['MatMul', 'Relu', 'Add', 'Mul' ], + + # TODO allow user to specify these + # op_types_to_quantize=['MatMul', 'Add', 'Conv'], + extra_options=dict( + EnableSubgraph=True + ) + ) def copy_if_exists(model_path, file_name, destination): @@ -164,146 +146,61 @@ def main(): ) conv_args, = parser.parse_args_into_dataclasses() - input_model_path = os.path.join( - conv_args.input_parent_dir, - conv_args.model_id - ) - if conv_args.from_hub: - model_path = conv_args.model_id - else: - model_path = input_model_path - - # Infer the task - task = conv_args.task - if task == "auto": - try: - task = TasksManager.infer_task_from_model(model_path) - except KeyError as e: - raise KeyError( - f"The task could not be automatically inferred. Please provide the argument --task with the task from {', '.join(TasksManager.get_all_tasks())}. Detailed error: {e}" - ) - - output_model_folder = os.path.join( - conv_args.output_parent_dir, - 'quantized' if conv_args.quantize else 'unquantized', - conv_args.model_id, - task - ) - - # get the shapes to be used to generate dummy inputs - input_shapes = DEFAULT_DUMMY_SHAPES.copy() - - model = TasksManager.get_model_from_task( - task, model_path, - framework='pt', - ) + model_id = conv_args.model_id - onnx_config_constructor = TasksManager.get_exporter_config_constructor( - model=model, exporter='onnx', task=task) - onnx_config = onnx_config_constructor(model.config) - - # Ensure the requested opset is sufficient - if conv_args.opset is None: - conv_args.opset = onnx_config.DEFAULT_ONNX_OPSET - elif conv_args.opset < onnx_config.DEFAULT_ONNX_OPSET: - raise ValueError( - f"Opset {conv_args.opset} is not sufficient to export {model.config.model_type}. " - f"At least {onnx_config.DEFAULT_ONNX_OPSET} is required." - ) + output_model_folder = os.path.join(conv_args.output_parent_dir, model_id) # Create output folder os.makedirs(output_model_folder, exist_ok=True) # Copy certain JSON files, which save_pretrained doesn't handle - copy_if_exists(model_path, 'tokenizer.json', output_model_folder) - copy_if_exists(model_path, 'preprocessor_config.json', output_model_folder) + # copy_if_exists(model_id, 'tokenizer.json', output_model_folder) - if model.can_generate(): - copy_if_exists(model_path, 'generation_config.json', - output_model_folder) + # copy_if_exists(model_id, 'preprocessor_config.json', output_model_folder) + # copy_if_exists(model_id, 'generation_config.json', output_model_folder) - # Saving the model config - model.config.save_pretrained(output_model_folder) + # # Saving the model config + config = AutoConfig.from_pretrained(model_id) + # config.save_pretrained(output_model_folder) try: # Save tokenizer - tokenizer = AutoTokenizer.from_pretrained(model_path) - tokenizer.save_pretrained(output_model_folder) + tokenizer = AutoTokenizer.from_pretrained(model_id) + # tokenizer.save_pretrained(output_model_folder) # Handle special cases - if model.config.model_type == 'marian': + if config.model_type == 'marian': import json from .extra.marian import generate_tokenizer_json - tokenizer_json = generate_tokenizer_json(model_path, tokenizer) + tokenizer_json = generate_tokenizer_json(model_id, tokenizer) with open(os.path.join(output_model_folder, 'tokenizer.json'), 'w', encoding='utf-8') as fp: json.dump(tokenizer_json, fp) + except KeyError: pass # No Tokenizer - # Specify output paths - OUTPUT_WEIGHTS_PATH = os.path.join(output_model_folder, ONNX_WEIGHTS_NAME) - OUTPUT_ENCODER_PATH = os.path.join(output_model_folder, ONNX_ENCODER_NAME) - OUTPUT_DECODER_PATH = os.path.join(output_model_folder, ONNX_DECODER_NAME) - OUTPUT_DECODER_WITH_PAST_PATH = os.path.join( - output_model_folder, ONNX_DECODER_WITH_PAST_NAME) - OUTPUT_DECODER_MERGED_PATH = os.path.join( - output_model_folder, ONNX_DECODER_MERGED_NAME) - # Step 1. convert huggingface model to onnx - if model.config.is_encoder_decoder and task.startswith("causal-lm"): - raise ValueError( - f"model.config.is_encoder_decoder is True and task is `{task}`, which are incompatible. If the task was auto-inferred, please fill a bug report" - f"at https://github.com/huggingface/optimum, if --task was explicitely passed, make sure you selected the right task for the model," - f" referring to `optimum.exporters.tasks.TaskManager`'s `_TASKS_TO_AUTOMODELS`." - ) - - if ( - model.config.is_encoder_decoder - and task.startswith(("seq2seq-lm", "speech2seq-lm", "vision2seq-lm", "default-with-past")) - ): - models_and_onnx_configs = get_encoder_decoder_models_for_export( - model, onnx_config) - elif task.startswith("causal-lm"): - models_and_onnx_configs = get_decoder_models_for_export( - model, onnx_config) - else: - models_and_onnx_configs = {"model": (model, onnx_config)} - - onnx_model_paths = [ - os.path.join(output_model_folder, f'{x}.onnx') - for x in models_and_onnx_configs - ] - - # Check if at least one model doesn't exist, or user requests to overwrite - if any( - not os.path.exists(x) for x in onnx_model_paths - ) or conv_args.overwrite: - _, onnx_outputs = export_models( - models_and_onnx_configs=models_and_onnx_configs, - opset=conv_args.opset, - output_dir=output_model_folder, - input_shapes=input_shapes, - device=conv_args.device, - # dtype="fp16" if fp16 is True else None, # TODO - ) + main_export( + model_name_or_path=model_id, + output=output_model_folder, + task=conv_args.task, + ) # Step 2. (optional, recommended) quantize the converted model for fast inference and to reduce model size. if conv_args.quantize: - quantize(onnx_model_paths, model.config.model_type) - - # Step 3. merge decoders. - if conv_args.merge_decoders and ( - os.path.exists(OUTPUT_DECODER_PATH) and - os.path.exists(OUTPUT_DECODER_WITH_PAST_PATH) - ) and (not os.path.exists(OUTPUT_DECODER_MERGED_PATH) or conv_args.overwrite): - print('Merging decoders') - merge_decoders( - OUTPUT_DECODER_PATH, - OUTPUT_DECODER_WITH_PAST_PATH, - save_path=OUTPUT_DECODER_MERGED_PATH, - strict=False - ) + quantize([ + os.path.join(output_model_folder, x) + for x in os.listdir(output_model_folder) + if x.endswith('.onnx') and not x.endswith('_quantized.onnx') + ]) + + # Step 3. Move .onnx files to the 'onnx' subfolder + os.makedirs(os.path.join(output_model_folder, 'onnx'), exist_ok=True) + for file in os.listdir(output_model_folder): + if file.endswith('.onnx') or file.endswith('.onnx_data'): + shutil.move(os.path.join(output_model_folder, file), + os.path.join(output_model_folder, 'onnx', file)) if __name__ == '__main__': diff --git a/scripts/tasks.py b/scripts/tasks.py index 4bbbf8d4b..dd257d236 100644 --- a/scripts/tasks.py +++ b/scripts/tasks.py @@ -12,7 +12,7 @@ 'object-detection': 'AutoModelForObjectDetection', 'question-answering': 'AutoModelForQuestionAnswering', 'image-classification': 'AutoModelForImageClassification', - # 'image-segmentation': 'AutoModelForImageSegmentation', + 'image-segmentation': 'AutoModelForImageSegmentation', # 'masked-im': 'AutoModelForMaskedImageModeling', # 'semantic-segmentation': 'AutoModelForSemanticSegmentation', 'speech2seq-lm': 'AutoModelForSpeechSeq2Seq', @@ -28,299 +28,134 @@ SUPPORTED_MODELS = { 'albert': { - 'albert-base-v2': [ - 'default', - 'masked-lm', - ], - 'albert-large-v2': [ - 'default', - 'masked-lm', - ], - 'sentence-transformers/paraphrase-albert-small-v2': [ - 'default', - ], - 'sentence-transformers/paraphrase-albert-base-v2': [ - 'default', - ], + 'albert-base-v2', + 'albert-large-v2', + 'sentence-transformers/paraphrase-albert-small-v2', + 'sentence-transformers/paraphrase-albert-base-v2', }, + 'bart': { - 'sshleifer/distilbart-cnn-6-6': [ - 'seq2seq-lm-with-past' - ], - 'facebook/bart-large-cnn': [ - 'seq2seq-lm-with-past' - ], - 'facebook/bart-large-mnli': [ - 'default', - 'sequence-classification', - ], + 'sshleifer/distilbart-cnn-6-6', + 'facebook/bart-large-cnn', + 'facebook/bart-large-mnli', }, 'bert': { - 'bert-base-uncased': [ - 'default', - 'masked-lm', - ], - 'bert-base-cased': [ - 'default', - 'masked-lm', - ], - 'bert-base-multilingual-uncased': [ - 'default', - 'masked-lm', - ], - 'bert-base-multilingual-cased': [ - 'default', - 'masked-lm', - ], - 'nlptown/bert-base-multilingual-uncased-sentiment': [ - 'sequence-classification', - ], - 'sentence-transformers/all-MiniLM-L6-v2': [ - 'default', - ], - 'sentence-transformers/all-MiniLM-L12-v2': [ - 'default', - ], + 'bert-base-uncased', + 'bert-base-cased', + 'bert-base-multilingual-uncased', + 'bert-base-multilingual-cased', + 'nlptown/bert-base-multilingual-uncased-sentiment', + 'Davlan/bert-base-multilingual-cased-ner-hrl', + 'sentence-transformers/all-MiniLM-L6-v2', + 'sentence-transformers/all-MiniLM-L12-v2', - 'Davlan/bert-base-multilingual-cased-ner-hrl': [ - # 'default', - 'token-classification', - ], - 'ckiplab/bert-base-chinese-ner': [ - # 'default', - 'token-classification', - ], - 'ckiplab/bert-base-chinese-ws': [ - # 'default', - 'token-classification', - ], - 'ckiplab/bert-base-chinese-pos': [ - # 'default', - 'token-classification', - ], - 'dslim/bert-base-NER': [ - # 'default', - 'token-classification', - ], - 'dslim/bert-base-NER-uncased': [ - # 'default', - 'token-classification', - ], - }, - 'blenderbot-small': { - 'facebook/blenderbot_small-90M': [ - 'default', - 'causal-lm-with-past', - 'seq2seq-lm-with-past', - ] - }, + 'ckiplab/bert-base-chinese-ner', + 'ckiplab/bert-base-chinese-ws', + 'ckiplab/bert-base-chinese-pos', + 'dslim/bert-base-NER', + 'dslim/bert-base-NER-uncased', + }, + # TODO: + # 'blenderbot-small': { + # 'facebook/blenderbot_small-90M', + # }, 'clip': { - 'openai/clip-vit-base-patch16': [ - 'default' - ], - 'openai/clip-vit-base-patch32': [ - 'default' - ], + 'openai/clip-vit-base-patch16', + 'openai/clip-vit-base-patch32', }, 'codegen': { - 'Salesforce/codegen-350M-mono': [ - 'default', - 'causal-lm-with-past', - ], - 'Salesforce/codegen-350M-multi': [ - 'default', - 'causal-lm-with-past', - ], - 'Salesforce/codegen-350M-nl': [ - 'default', - 'causal-lm-with-past', - ], + 'Salesforce/codegen-350M-mono', + 'Salesforce/codegen-350M-multi', + 'Salesforce/codegen-350M-nl', }, 'detr': { - 'facebook/detr-resnet-50': [ - 'default', - 'object-detection', - # 'image-segmentation', - ], - 'facebook/detr-resnet-101': [ - 'default', - 'object-detection', - # 'image-segmentation', - ], - - 'facebook/detr-resnet-50-panoptic': [ - 'image-segmentation', - ], - + 'facebook/detr-resnet-50', + 'facebook/detr-resnet-101', + 'facebook/detr-resnet-50-panoptic', }, 'distilbert': { - 'distilbert-base-uncased': [ - 'default', - 'masked-lm', - ], - 'distilbert-base-cased': [ - 'default', - 'masked-lm', - ], - 'distilbert-base-uncased-distilled-squad': [ - 'default', - 'question-answering' - ], - 'distilbert-base-cased-distilled-squad': [ - 'default', - 'question-answering' - ], - 'distilbert-base-uncased-finetuned-sst-2-english': [ - 'sequence-classification', - ], - 'typeform/distilbert-base-uncased-mnli': [ - 'default', - 'sequence-classification', - ], - - 'Davlan/distilbert-base-multilingual-cased-ner-hrl': [ - # 'default', - 'token-classification', - ], + 'distilbert-base-uncased', + 'distilbert-base-cased', + 'distilbert-base-uncased-distilled-squad', + 'distilbert-base-cased-distilled-squad', + 'distilbert-base-uncased-finetuned-sst-2-english', + 'typeform/distilbert-base-uncased-mnli', + 'Davlan/distilbert-base-multilingual-cased-ner-hrl', }, 'gpt-neo': { - 'EleutherAI/gpt-neo-125M': [ - 'default', - 'causal-lm-with-past', - ], + 'EleutherAI/gpt-neo-125M', + 'MBZUAI/LaMini-Neo-125M', }, 'gpt2': { - 'gpt2': [ - 'default', - 'causal-lm-with-past', - ], - 'distilgpt2': [ - 'default', - 'causal-lm-with-past', - 'sequence-classification', - 'token-classification', - ] - }, - 'marian': { - f'Helsinki-NLP/opus-mt-{x}': [ - 'default', - 'seq2seq-lm-with-past', - ] - for x in SUPPORTED_HELSINKI_NLP_MODELS - }, + 'gpt2', + 'distilgpt2', + 'MBZUAI/LaMini-Cerebras-256M', + 'MBZUAI/LaMini-Cerebras-590M', + }, + # TODO: + # 'marian': { + # f'Helsinki-NLP/opus-mt-{x}' + # for x in SUPPORTED_HELSINKI_NLP_MODELS + # }, 'mobilebert': { - 'google/mobilebert-uncased': [ - 'default', - 'masked-lm', - ], - 'typeform/mobilebert-uncased-mnli': [ - 'default', - 'sequence-classification', - ], + 'typeform/mobilebert-uncased-mnli', + + # TODO: + # https://github.com/huggingface/optimum/issues/1027 + # 'google/mobilebert-uncased', }, 'mt5': { - 'google/mt5-small': [ - 'default', - # 'seq2seq-lm-with-past', - ] + 'google/mt5-small', + 'google/mt5-base', }, 'roberta': { - 'xlm-roberta-base': [ - 'default', - 'masked-lm', - ], 'roberta-base': [ - 'default', - 'masked-lm', - ], - 'distilroberta-base': [ - 'default', - 'masked-lm', - ], - 'sentence-transformers/all-distilroberta-v1': [ - 'default' - ], - 'roberta-large-mnli': [ - 'default', - 'sequence-classification', - ] + 'xlm-roberta-base', + 'roberta-base', + 'distilroberta-base', + 'roberta-large-mnli', + + 'sentence-transformers/all-distilroberta-v1', + }, + 'sam': { + 'facebook/sam-vit-base', + 'facebook/sam-vit-large', + 'facebook/sam-vit-huge', }, 'squeezebert': { - 'squeezebert/squeezebert-uncased': [ - 'default', - 'masked-lm', - ], - 'squeezebert/squeezebert-mnli': [ - 'default', - 'sequence-classification', - ] + 'squeezebert/squeezebert-uncased', + 'squeezebert/squeezebert-mnli', }, 't5': { - 't5-small': [ - 'default', - 'seq2seq-lm-with-past', - ], - 't5-base': [ - 'default', - 'seq2seq-lm-with-past', - ], - 'google/t5-v1_1-small': [ - 'default', - 'seq2seq-lm-with-past', - ], - 'google/t5-v1_1-base': [ - 'default', - 'seq2seq-lm-with-past', - ], - 'google/flan-t5-small': [ - 'default', - 'seq2seq-lm-with-past', - ], - 'google/flan-t5-base': [ - 'default', - 'seq2seq-lm-with-past', - ] + 't5-small', + 't5-base', + 'google/t5-v1_1-small', + 'google/t5-v1_1-base', + 'google/flan-t5-small', + 'google/flan-t5-base', + + 'MBZUAI/LaMini-Flan-T5-77M', + 'MBZUAI/LaMini-Flan-T5-248M', + 'MBZUAI/LaMini-Flan-T5-783M', + + 'MBZUAI/LaMini-T5-61M', + 'MBZUAI/LaMini-T5-223M', + 'MBZUAI/LaMini-T5-738M', }, 'vision-encoder-decoder': { - 'nlpconnect/vit-gpt2-image-captioning': [ - # 'vision2seq-lm', - 'vision2seq-lm-with-past', - ] + 'nlpconnect/vit-gpt2-image-captioning', }, 'vit': { - 'google/vit-base-patch16-224-in21k': [ - 'default' - ], - 'google/vit-base-patch16-224': [ - 'default', - 'image-classification' - ] + 'google/vit-base-patch16-224-in21k', + 'google/vit-base-patch16-224', }, 'whisper': { - 'openai/whisper-tiny': [ - 'default', - 'speech2seq-lm-with-past' - ], - 'openai/whisper-tiny.en': [ - 'default', - 'speech2seq-lm-with-past' - ], - 'openai/whisper-base': [ - 'default', - 'speech2seq-lm-with-past' - ], - 'openai/whisper-base.en': [ - 'default', - 'speech2seq-lm-with-past' - ], - 'openai/whisper-small': [ - 'default', - 'speech2seq-lm-with-past' - ], - 'openai/whisper-small.en': [ - 'default', - 'speech2seq-lm-with-past' - ], + 'openai/whisper-tiny', + 'openai/whisper-tiny.en', + 'openai/whisper-base', + 'openai/whisper-base.en', + 'openai/whisper-small', + 'openai/whisper-small.en', }, } @@ -328,10 +163,9 @@ def main(): for model_type, model_ids in SUPPORTED_MODELS.items(): print(f'# {model_type:=^80}') - for model_id, tasks in model_ids.items(): - for task in tasks: - print( - f'python -m scripts.convert --model_id {model_id} --from_hub --quantize --task {task}') + for model_id in model_ids: + print( + f'python -m scripts.convert --quantize --model_id {model_id}') print() diff --git a/src/backends/onnx.js b/src/backends/onnx.js index 88a95b24e..5d27271ca 100644 --- a/src/backends/onnx.js +++ b/src/backends/onnx.js @@ -1,42 +1,52 @@ -let ONNX; - -// TODO support more execution providers (e.g., webgpu) -const executionProviders = ['wasm']; - -if (typeof process !== 'undefined') { +/** + * @file Handler file for choosing the correct version of ONNX Runtime, based on the environment. + * Ideally, we could import the `onnxruntime-web` and `onnxruntime-node` packages only when needed, + * but dynamic imports don't seem to work with the current webpack version and/or configuration. + * This is possibly due to the experimental nature of top-level await statements. + * So, we just import both packages, and use the appropriate one based on the environment: + * - When running in node, we use `onnxruntime-node`. + * - When running in the browser, we use `onnxruntime-web` (`onnxruntime-node` is not bundled). + * + * This module is not directly exported, but can be accessed through the environment variables: + * ```javascript + * import { env } from '@xenova/transformers'; + * console.log(env.backends.onnx); + * ``` + * + * @module backends/onnx + */ + +// NOTE: Import order matters here. We need to import `onnxruntime-node` before `onnxruntime-web`. +import * as ONNX_NODE from 'onnxruntime-node'; +import * as ONNX_WEB from 'onnxruntime-web'; + +export let ONNX; + +export const executionProviders = [ + // 'webgpu', + 'wasm' +]; + +if (typeof process !== 'undefined' && process?.release?.name === 'node') { // Running in a node-like environment. - // Try to import onnxruntime-node, using onnxruntime-web as a fallback - try { - ONNX = require('onnxruntime-node'); - } catch (err) { - console.warn( - "Node.js environment detected, but `onnxruntime-node` was not found. " + - "Using `onnxruntime-web` as a fallback. We recommend installing `onnxruntime-node` " + - "as it generally improves performance (up to 5X)." - ) - - // Fix "ReferenceError: self is not defined" bug when running directly with node - // https://github.com/microsoft/onnxruntime/issues/13072 - // @ts-ignore - global.self = global; - - ONNX = require('onnxruntime-web'); - - // Disable spawning worker threads for testing. - // This is done by setting numThreads to 1 - // https://github.com/microsoft/onnxruntime/issues/10311 - ONNX.env.wasm.numThreads = 1; - } + ONNX = ONNX_NODE; // Add `cpu` execution provider, with higher precedence that `wasm`. executionProviders.unshift('cpu'); } else { - // Running in a browser-environment, so we just import `onnxruntime-web` - ONNX = require('onnxruntime-web'); + // Running in a browser-environment + ONNX = ONNX_WEB; + + // SIMD for WebAssembly does not operate correctly in recent versions of iOS (>= 16.4). + // As a temporary fix, we disable it for now. + // For more information, see: https://github.com/microsoft/onnxruntime/issues/15644 + const isIOS = typeof navigator !== 'undefined' && /iP(hone|od|ad)/.test(navigator.userAgent); + if (isIOS) { + ONNX.env.wasm.simd = false; + } } -module.exports = { - ONNX, - executionProviders, -} +// We select the default export if it exists, otherwise we use the named export. +// This allows us to run in both node and browser environments. +ONNX = ONNX.default ?? ONNX; diff --git a/src/env.js b/src/env.js index 2a3fc98be..5edf906ef 100644 --- a/src/env.js +++ b/src/env.js @@ -1,59 +1,114 @@ -const fs = require('fs'); -const path = require('path'); +/** + * @file Module used to configure Transformers.js. + * + * **Example:** Disable remote models. + * ```javascript + * import { env } from '@xenova/transformers'; + * env.allowRemoteModels = false; + * ``` + * + * **Example:** Set local model path. + * ```javascript + * import { env } from '@xenova/transformers'; + * env.localModelPath = '/path/to/local/models/'; + * ``` + * + * **Example:** Set cache directory. + * ```javascript + * import { env } from '@xenova/transformers'; + * env.cacheDir = '/path/to/cache/directory/'; + * ``` + * + * @module env + */ + +import fs from 'fs'; +import path from 'path'; +import url from 'url'; -const { env: onnx_env } = require('./backends/onnx.js').ONNX; +import { ONNX } from './backends/onnx.js'; +const { env: onnx_env } = ONNX; -// check if various APIs are available (depends on environment) -const CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self; + +// Check if various APIs are available (depends on environment) +const WEB_CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self; const FS_AVAILABLE = !isEmpty(fs); // check if file system is available const PATH_AVAILABLE = !isEmpty(path); // check if path is available const RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE; -// set local model path, based on available APIs -const DEFAULT_LOCAL_PATH = '/models/onnx/quantized/'; -const localURL = RUNNING_LOCALLY - ? path.join(path.dirname(__dirname), DEFAULT_LOCAL_PATH) - : DEFAULT_LOCAL_PATH; +const __dirname = RUNNING_LOCALLY + ? path.dirname(path.dirname(url.fileURLToPath(import.meta.url))) + : './'; + +// Only used for environments with access to file system +const DEFAULT_CACHE_DIR = RUNNING_LOCALLY + ? path.join(__dirname, '/.cache/') + : null; -// First, set path to wasm files. This is needed when running in a web worker. +// Set local model path, based on available APIs +const DEFAULT_LOCAL_MODEL_PATH = '/models/'; +const localModelPath = RUNNING_LOCALLY + ? path.join(__dirname, DEFAULT_LOCAL_MODEL_PATH) + : DEFAULT_LOCAL_MODEL_PATH; + +// Set path to wasm files. This is needed when running in a web worker. // https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths // We use remote wasm files by default to make it easier for newer users. // In practice, users should probably self-host the necessary .wasm files. onnx_env.wasm.wasmPaths = RUNNING_LOCALLY - ? path.join(path.dirname(__dirname), '/dist/') + ? path.join(__dirname, '/dist/') : 'https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/'; -// Global variable used to control exection, with suitable defaults -const env = { - // access onnxruntime-web's environment variables - onnx: onnx_env, +/** + * Global variable used to control exection. This provides users a simple way to configure Transformers.js. + * @property {Object} backends Expose environment variables of different backends, + * allowing users to set these variables if they want to. + * @property {string} remoteHost Host URL to load models from. Defaults to the Hugging Face Hub. + * @property {string} remotePathTemplate Path template to fill in and append to `remoteHost` when loading models. + * @property {boolean} allowRemoteModels Whether to allow loading of remote files, defaults to `true`. + * If set to `false`, it will have the same effect as setting `local_files_only=true` when loading pipelines, models, tokenizers, processors, etc. + * @property {string} localModelPath Path to load local models from. Defaults to `/models/`. + * @property {boolean} useFS Whether to use the file system to load files. By default, it is `true` if available. + * @property {string} __dirname Directory name of module. Useful for resolving local paths. + * @property {boolean} useBrowserCache Whether to use Cache API to cache models. By default, it is `true` if available. + * @property {boolean} useFSCache Whether to use the file system to cache files. By default, it is `true` if available. + * @property {string} cacheDir The directory to use for caching files with the file system. By default, it is `./.cache`. +*/ +export const env = { + /////////////////// Backends settings /////////////////// + backends: { + // onnxruntime-web/onnxruntime-node + onnx: onnx_env, - // whether to support loading models from the HuggingFace hub - remoteModels: true, + // TensorFlow.js + tfjs: {}, + }, - // URL to load models from - remoteURL: 'https://huggingface.co/Xenova/transformers.js/resolve/main/quantized/', + __dirname, - // Local URL to load models from. - localURL: localURL, + /////////////////// Model settings /////////////////// + remoteHost: 'https://huggingface.co/', + remotePathTemplate: '{model}/resolve/{revision}/', + allowRemoteModels: true, + localModelPath: localModelPath, + useFS: FS_AVAILABLE, - // Whether to use Cache API to cache models. By default, it is true if available. - useCache: CACHE_AVAILABLE, + /////////////////// Cache settings /////////////////// + useBrowserCache: WEB_CACHE_AVAILABLE, + useFSCache: FS_AVAILABLE, + cacheDir: DEFAULT_CACHE_DIR, - // Whether to use the file system to load files. By default, it is true available. - useFS: FS_AVAILABLE, + ////////////////////////////////////////////////////// } /** - * @param {object} obj + * @param {Object} obj + * @private */ function isEmpty(obj) { return Object.keys(obj).length === 0; } -module.exports = { - env -} diff --git a/src/generation.js b/src/generation.js deleted file mode 100644 index 29c835b3d..000000000 --- a/src/generation.js +++ /dev/null @@ -1,479 +0,0 @@ -const { Tensor } = require("./tensor_utils.js"); -const { - Callable, - exists, - log_softmax -} = require("./utils.js"); - -/** - * A class representing a list of logits processors. A logits processor is a function that modifies the logits - * output of a language model. This class provides methods for adding new processors and applying all processors to a - * batch of logits. - * - * @extends Callable - */ -class LogitsProcessorList extends Callable { - /** - * Constructs a new instance of `LogitsProcessorList`. - */ - constructor() { - super(); - this.processors = []; - } - - /** - * Adds a new logits processor to the list. - * - * @param {function} item - The logits processor function to add. - */ - push(item) { - this.processors.push(item); - } - - /** - * Adds multiple logits processors to the list. - * - * @param {function[]} items - The logits processor functions to add. - */ - extend(items) { - this.processors.push(...items); - } - - /** - * Applies all logits processors in the list to a batch of logits, modifying them in-place. - * - * @param {number[]} input_ids - The input IDs for the language model. - * @param {number[][]} batchedLogits - A 2D array of logits, where each row corresponds to a single - * input sequence in the batch. - */ - _call(input_ids, batchedLogits) { - // NOTE: This is different from the Python code, since vanilla JS does not support vectorized operations. - // As a result, we apply each processor to each item in the batch. - for (let logits of batchedLogits) { - // Modifies logits inplace - this.processors.forEach( - func => func(input_ids, logits) - ) - } - } - - [Symbol.iterator]() { - return this.processors.values(); - } -} - -/** - * Base class for processing logits. - * @extends Callable - */ -class LogitsProcessor extends Callable { - /** - * Apply the processor to the input logits. - * - * @abstract - * @param {Array} input_ids The input ids. - * @param {Tensor} logits The logits to process. - * @throws {Error} Throws an error if `_call` is not implemented in the subclass. - */ - _call(input_ids, logits) { - throw Error("`_call` should be implemented in a subclass") - } -} - -/** - * A logits processor that forces a specific token to be generated by the decoder. - * - * @extends LogitsProcessor - */ -class ForceTokensLogitsProcessor extends LogitsProcessor { - /** - * Constructs a new instance of `ForceTokensLogitsProcessor`. - * - * @param {Array} forced_decoder_ids The ids of tokens that should be forced. - */ - constructor(forced_decoder_ids) { - super(); - this.force_token_map = Object.fromEntries(forced_decoder_ids ?? []); - } - - /** - * Apply the processor to the input logits. - * - * @param {Array} input_ids The input ids. - * @param {any} logits The logits to process. - * @returns {Array} The processed logits. - */ - _call(input_ids, logits) { - let map = this.force_token_map[input_ids.length]; - if (exists(map)) { // There exists a mapping - logits.data.fill(-Infinity) - logits.data[map] = 0; - } - return logits; - } -} - -/** - * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence. - * @extends LogitsProcessor - */ -class ForcedBOSTokenLogitsProcessor extends LogitsProcessor { - /** - * Create a ForcedBOSTokenLogitsProcessor. - * @param {number} bos_token_id - The ID of the beginning-of-sequence token to be forced. - */ - constructor(bos_token_id) { - super(); - this.bos_token_id = bos_token_id; - } - - /** - * Apply the BOS token forcing to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with BOS token forcing. - */ - _call(input_ids, logits) { - if (input_ids.length === 1) { - logits.data.fill(-Infinity) - logits.data[this.bos_token_id] = 0; - } - } -} - -/** - * A logits processor that forces end-of-sequence token probability to 1. - * - * @extends LogitsProcessor - */ -class ForcedEOSTokenLogitsProcessor extends LogitsProcessor { - /** - * Create a ForcedEOSTokenLogitsProcessor. - * @param {number} max_length - Max length of the sequence. - * @param {number} forced_eos_token_id - The ID of the end-of-sequence token to be forced. - */ - constructor(max_length, forced_eos_token_id) { - super(); - this.max_length = max_length; - this.forced_eos_token_id = forced_eos_token_id; - } - - /** - * Apply the processor to input_ids and logits. - * - * @param {number[]} input_ids - The input ids. - * @param {any} logits - The logits tensor. - */ - _call(input_ids, logits) { - // console.log('call ForcedEOSTokenLogitsProcessor') - // TODO - } -} - -/** - * A LogitsProcessor that handles adding timestamps to generated text. - * @extends LogitsProcessor - */ -class WhisperTimeStampLogitsProcessor extends LogitsProcessor { - /** - * Constructs a new WhisperTimeStampLogitsProcessor. - * @param {object} generate_config - The config object passed to the `generate()` method of a transformer model. - * @param {number} generate_config.eos_token_id - The ID of the end-of-sequence token. - * @param {number} generate_config.no_timestamps_token_id - The ID of the token used to indicate that a token should not have a timestamp. - * @param {number[][]} [generate_config.forced_decoder_ids] - An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp. - * @param {number} [generate_config.max_initial_timestamp_index] - The maximum index at which an initial timestamp can appear. - */ - constructor(generate_config) { - super(); - this.eos_token_id = generate_config.eos_token_id; - this.no_timestamps_token_id = generate_config.no_timestamps_token_id; - this.timestamp_begin = this.no_timestamps_token_id + 1; - - this.begin_index = (generate_config.forced_decoder_ids || []).length + 2; - if (generate_config.forced_decoder_ids.slice(-1)[0][1] === this.no_timestamps_token_id) { - this.begin_index -= 1; - } - this.max_initial_timestamp_index = generate_config.max_initial_timestamp_index; - - } - - /** - * Modify the logits to handle timestamp tokens. - * @param {Array} input_ids - The input sequence of tokens. - * @param {Tensor} logits - The logits output by the model. - * @returns {Tensor} - The modified logits. - */ - _call(input_ids, logits) { - // suppress <|notimestamps|> which is handled by without_timestamps - logits.data[this.no_timestamps_token_id] = -Infinity; - - if (input_ids.length === this.begin_index - 1) { - logits.data.fill(-Infinity); - logits.data[this.timestamp_begin] = 0; - return logits; - } - - // timestamps have to appear in pairs, except directly before eos_token; mask logits accordingly - const seq = input_ids.slice(this.begin_index); - const last_was_timestamp = seq.length >= 1 && seq[seq.length - 1] >= this.timestamp_begin; - const penultimate_was_timestamp = seq.length < 2 || seq[seq.length - 2] >= this.timestamp_begin; - - if (last_was_timestamp) { - if (penultimate_was_timestamp) { // has to be non-timestamp - logits.data.subarray(this.timestamp_begin).fill(-Infinity); - } else { // cannot be normal text tokens - logits.data.subarray(0, this.eos_token_id).fill(-Infinity); - } - } - - // apply the `max_initial_timestamp` option - if (input_ids.length === this.begin_index && this.max_initial_timestamp_index !== null) { - const last_allowed = this.timestamp_begin + this.max_initial_timestamp_index; - logits.data.subarray(last_allowed + 1).fill(-Infinity); - } - - // if sum of probability over timestamps is above any other token, sample timestamp - const logprobs = log_softmax(logits.data); - const timestamp_logprob = Math.log(logprobs.subarray(this.timestamp_begin).map(Math.exp).reduce((a, b) => a + b)); - const max_text_token_logprob = Math.max(...logprobs.subarray(0, this.timestamp_begin)); - if (timestamp_logprob > max_text_token_logprob) { - logits.data.subarray(0, this.timestamp_begin).fill(-Infinity); - } - - return logits; - } -} - -/** - * A logits processor that disallows ngrams of a certain size to be repeated. - * - * @extends LogitsProcessor - */ -class NoRepeatNGramLogitsProcessor extends LogitsProcessor { - /** - * Create a NoRepeatNGramLogitsProcessor. - * @param {number} no_repeat_ngram_size - The no-repeat-ngram size. All ngrams of this size can only occur once. - */ - constructor(no_repeat_ngram_size) { - super(); - this.no_repeat_ngram_size = no_repeat_ngram_size; - } - - /** - * Generate n-grams from a sequence of token ids. - * @param {number[]} prevInputIds - List of previous input ids - * @returns {Map} - Map of generated n-grams - */ - getNgrams(prevInputIds) { - const curLen = prevInputIds.length; - - /**@type {number[][]} */ - const ngrams = []; - for (let j = 0; j < curLen + 1 - this.no_repeat_ngram_size; ++j) { - const ngram = []; - for (let k = 0; k < this.no_repeat_ngram_size; ++k) { - ngram.push(prevInputIds[j + k]); - } - ngrams.push(ngram); - } - - /** @type {Map} */ - const generatedNgram = new Map(); - for (const ngram of ngrams) { - const prevNgram = ngram.slice(0, ngram.length - 1); - const prevNgramKey = JSON.stringify(prevNgram); - const prevNgramValue = generatedNgram.get(prevNgramKey) ?? []; - prevNgramValue.push(ngram[ngram.length - 1]); - generatedNgram.set(prevNgramKey, prevNgramValue); - } - return generatedNgram; - } - - /** - * Generate n-grams from a sequence of token ids. - * @param {Map} bannedNgrams - Map of banned n-grams - * @param {number[]} prevInputIds - List of previous input ids - * @returns {number[]} - Map of generated n-grams - */ - getGeneratedNgrams(bannedNgrams, prevInputIds) { - const ngramIdx = prevInputIds.slice(prevInputIds.length + 1 - this.no_repeat_ngram_size, prevInputIds.length); - const banned = bannedNgrams.get(JSON.stringify(ngramIdx)) ?? []; - return banned; - } - - /** - * Calculate banned n-gram tokens - * @param {number[]} prevInputIds - List of previous input ids - * @returns {number[]} - Map of generated n-grams - */ - calcBannedNgramTokens(prevInputIds) { - const bannedTokens = []; - if (prevInputIds.length + 1 < this.no_repeat_ngram_size) { - // return no banned tokens if we haven't generated no_repeat_ngram_size tokens yet - return bannedTokens; - - } else { - const generatedNgrams = this.getNgrams(prevInputIds); - const bannedTokens = this.getGeneratedNgrams(generatedNgrams, prevInputIds); - return bannedTokens; - } - } - - /** - * Apply the no-repeat-ngram processor to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with no-repeat-ngram processing. - */ - _call(input_ids, logits) { - const bannedTokens = this.calcBannedNgramTokens(input_ids); - - for (const token of bannedTokens) { - logits.data[token] = -Infinity; - } - return logits; - } -} - -/** - * A logits processor that penalises repeated output tokens. - * - * @extends LogitsProcessor - */ -class RepetitionPenaltyLogitsProcessor extends LogitsProcessor { - /** - * Create a RepetitionPenaltyLogitsProcessor. - * @param {number} penalty - The penalty to apply for repeated tokens. - */ - constructor(penalty) { - super(); - this.penalty = penalty; - } - - /** - * Apply the repetition penalty to the logits. - * @param {Array} input_ids - The input IDs. - * @param {Object} logits - The logits. - * @returns {Object} The logits with repetition penalty processing. - */ - _call(input_ids, logits) { - // Modify the logits corresponding to each element in `input_ids`. - // As a consequence, the logits corresponding to tokens that appear - // many times in the output will be penalised more. - for (const input_id of input_ids) { - if (logits.data[input_id] < 0) { - logits.data[input_id] *= this.penalty; - } else { - logits.data[input_id] /= this.penalty; - } - } - return logits - } -} - - -class GenerationConfig { - constructor(kwargs = {}) { - // Parameters that control the length of the output - // TODO: extend the configuration with correct types - /** - * Create a GenerationConfig object - * @constructor - * @param {Object} [kwargs={}] - The configuration parameters - * @param {number} [kwargs.max_length=20] - The maximum length of the generated text - * @param {number} [kwargs.max_new_tokens=null] - The maximum number of new tokens to generate - * @param {number} [kwargs.min_length=0] - The minimum length of the generated text - * @param {number} [kwargs.min_new_tokens=null] - The minimum number of new tokens to generate - * @param {boolean} [kwargs.early_stopping=false] - Whether to stop generation early if a stop token is encountered - * @param {number} [kwargs.max_time=null] - The maximum amount of time to spend generating text - * @param {boolean} [kwargs.do_sample=false] - Whether to use sampling when generating text - * @param {number} [kwargs.num_beams=1] - The number of beams to use when generating text - * @param {number} [kwargs.num_beam_groups=1] - The number of beam groups to use when generating text - * @param {number} [kwargs.penalty_alpha=null] - The value of the alpha penalty to use when generating text - * @param {boolean} [kwargs.use_cache=true] - Whether to use cache when generating text - * @param {number} [kwargs.temperature=1.0] - The temperature to use when generating text - * @param {number} [kwargs.top_k=50] - The value of k to use when generating text - * @param {number} [kwargs.top_p=1.0] - The value of p to use when generating text - * @param {number} [kwargs.typical_p=1.0] - The typical value of p to use when generating text - * @param {number} [kwargs.epsilon_cutoff=0.0] - The value of epsilon cutoff to use when generating text - * @param {number} [kwargs.eta_cutoff=0.0] - The value of eta cutoff to use when generating text - * @param {number} [kwargs.diversity_penalty=0.0] - The value of diversity penalty to use when generating text - * @param {number} [kwargs.repetition_penalty=1.0] - The value of repetition penalty to use when generating text - * @param {number} [kwargs.encoder_repetition_penalty=1.0] - The value of encoder repetition penalty to use when generating text - * @param {number} [kwargs.length_penalty=1.0] - The value of length - * @param {number} [kwargs.no_repeat_ngram_size=0] - The size of the n-grams to avoid repeating in the generated output. - * @param {?number[]} [kwargs.bad_words_ids=null] - An array of IDs representing tokens that should not be generated. - * @param {?number[]} [kwargs.force_words_ids=null] - An array of IDs representing tokens that must be generated. - * @param {boolean} [kwargs.renormalize_logits=false] - Whether or not to renormalize the logits before generating new tokens. - * @param {?Object[]} [kwargs.constraints=null] - An array of constraint objects to apply during generation. - */ - this.max_length = kwargs.max_length ?? 20; - this.max_new_tokens = kwargs.max_new_tokens ?? null; - this.min_length = kwargs.min_length ?? 0; - this.min_new_tokens = kwargs.min_new_tokens ?? null; - this.early_stopping = kwargs.early_stopping ?? false; - this.max_time = kwargs.max_time ?? null; - - // Parameters that control the generation strategy used - this.do_sample = kwargs.do_sample ?? false; - this.num_beams = kwargs.num_beams ?? 1; - this.num_beam_groups = kwargs.num_beam_groups ?? 1; - this.penalty_alpha = kwargs.penalty_alpha ?? null; - this.use_cache = kwargs.use_cache ?? true; - - // Parameters for manipulation of the model output logits - this.temperature = kwargs.temperature ?? 1.0; - this.top_k = kwargs.top_k ?? 50; - this.top_p = kwargs.top_p ?? 1.0; - this.typical_p = kwargs.typical_p ?? 1.0; - this.epsilon_cutoff = kwargs.epsilon_cutoff ?? 0.0; - this.eta_cutoff = kwargs.eta_cutoff ?? 0.0; - this.diversity_penalty = kwargs.diversity_penalty ?? 0.0; - this.repetition_penalty = kwargs.repetition_penalty ?? 1.0; - this.encoder_repetition_penalty = kwargs.encoder_repetition_penalty ?? 1.0; - this.length_penalty = kwargs.length_penalty ?? 1.0; - this.no_repeat_ngram_size = kwargs.no_repeat_ngram_size ?? 0; - this.bad_words_ids = kwargs.bad_words_ids ?? null; - this.force_words_ids = kwargs.force_words_ids ?? null; - this.renormalize_logits = kwargs.renormalize_logits ?? false; - this.constraints = kwargs.constraints ?? null; - this.forced_bos_token_id = kwargs.forced_bos_token_id ?? null; - this.forced_eos_token_id = kwargs.forced_eos_token_id ?? null; - this.remove_invalid_values = kwargs.remove_invalid_values ?? false; - this.exponential_decay_length_penalty = kwargs.exponential_decay_length_penalty ?? null; - this.suppress_tokens = kwargs.suppress_tokens ?? null; - this.begin_suppress_tokens = kwargs.begin_suppress_tokens ?? null; - this.forced_decoder_ids = kwargs.forced_decoder_ids ?? null; - - // Parameters that define the output variables of `generate` - this.num_return_sequences = kwargs.num_return_sequences ?? 1; - this.output_attentions = kwargs.output_attentions ?? false; - this.output_hidden_states = kwargs.output_hidden_states ?? false; - this.output_scores = kwargs.output_scores ?? false; - this.return_dict_in_generate = kwargs.return_dict_in_generate ?? false; - - // Special tokens that can be used at generation time - this.pad_token_id = kwargs.pad_token_id ?? null; - this.bos_token_id = kwargs.bos_token_id ?? null; - this.eos_token_id = kwargs.eos_token_id ?? null; - - // Generation parameters exclusive to encoder-decoder models - this.encoder_no_repeat_ngram_size = kwargs.encoder_no_repeat_ngram_size ?? 0; - this.decoder_start_token_id = kwargs.decoder_start_token_id ?? null; - - // Wild card - this.generation_kwargs = kwargs.generation_kwargs ?? {}; - } -} - -module.exports = { - LogitsProcessor, - LogitsProcessorList, - GenerationConfig, - ForcedBOSTokenLogitsProcessor, - ForcedEOSTokenLogitsProcessor, - WhisperTimeStampLogitsProcessor, - ForceTokensLogitsProcessor, - NoRepeatNGramLogitsProcessor, - RepetitionPenaltyLogitsProcessor -}; diff --git a/src/image_utils.js b/src/image_utils.js deleted file mode 100644 index 4cd78fa0f..000000000 --- a/src/image_utils.js +++ /dev/null @@ -1,318 +0,0 @@ - -const fs = require('fs'); -const { getFile, isString } = require('./utils.js'); -const { env } = require('./env.js'); - -// Will be empty (or not used) if running in browser or web-worker -const sharp = require('sharp'); - -let CanvasClass; -let ImageDataClass; -let loadImageFunction; -if (typeof self !== 'undefined') { - // Running in browser or web-worker - CanvasClass = OffscreenCanvas; - loadImageFunction = self.createImageBitmap; - ImageDataClass = ImageData; - -} else if (sharp) { - // Running in Node.js, electron, or other non-browser environment - - loadImageFunction = async (/**@type {sharp.Sharp}*/img) => { - let { data, info } = await img.raw().toBuffer({ resolveWithObject: true }); - return new CustomImage(new Uint8ClampedArray(data), info.width, info.height, info.channels); - } - -} else { - throw new Error('Unable to load image processing library.'); -} - - -class CustomImage { - - /** - * Create a new CustomImage object. - * @param {Uint8ClampedArray} data - The pixel data. - * @param {number} width - The width of the image. - * @param {number} height - The height of the image. - * @param {1|2|3|4} channels - The number of channels. - */ - constructor(data, width, height, channels) { - this._update(data, width, height, channels); - } - - /** - * Helper method for reading an image from a variety of input types. - * @param {CustomImage|string|URL} input - * @returns The image object. - */ - static async read(input) { - if (input instanceof CustomImage) { - return input; - } else if (isString(input) || input instanceof URL) { - return await this.fromURL(input); - } else { - throw new Error(`Unsupported input type: ${typeof input}`); - } - } - - - /** - * Read an image from a URL or file path. - * @param {string|URL} url - The URL or file path to read the image from. - * @returns {Promise} - The image object. - */ - static async fromURL(url) { - let response = await getFile(url); - let blob = await response.blob(); - return this.fromBlob(blob); - } - - /** - * Helper method to create a new Image from a blob. - * @param {Blob} blob - The blob to read the image from. - * @returns {Promise} - The image object. - */ - static async fromBlob(blob) { - if (CanvasClass) { - // Running in environment with canvas - let img = await loadImageFunction(blob); - - const ctx = new CanvasClass(img.width, img.height).getContext('2d'); - - // Draw image to context - ctx.drawImage(img, 0, 0); - - return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4); - - } else { - // Use sharp.js to read (and possible resize) the image. - let img = sharp(await blob.arrayBuffer()); - - return await loadImageFunction(img); - } - } - - /** - * Convert the image to grayscale format. - * @returns {CustomImage} - `this` to support chaining. - */ - grayscale() { - if (this.channels === 1) { - return this; - } - - let newData = new Uint8ClampedArray(this.width * this.height * 3); - switch (this.channels) { - case 3: // rgb to grayscale - case 4: // rgba to grayscale - for (let i = 0, offset = 0; i < this.data.length; i += this.channels) { - const red = this.data[i]; - const green = this.data[i + 1]; - const blue = this.data[i + 2]; - - newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue); - } - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - return this._update(newData, this.width, this.height, 1); - } - - /** - * Convert the image to RGB format. - * @returns {CustomImage} - `this` to support chaining. - */ - rgb() { - if (this.channels === 3) { - return this; - } - - let newData = new Uint8ClampedArray(this.width * this.height * 3); - - switch (this.channels) { - case 1: // grayscale to rgb - for (let i = 0, offset = 0; i < this.data.length; ++i) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - } - break; - case 4: // rgba to rgb - for (let i = 0, offset = 0; i < this.data.length; i += 4) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i + 1]; - newData[offset++] = this.data[i + 2]; - } - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - return this._update(newData, this.width, this.height, 3); - - } - - /** - * Convert the image to RGBA format. - * @returns {CustomImage} - `this` to support chaining. - */ - rgba() { - if (this.channels === 4) { - return this; - } - - let newData = new Uint8ClampedArray(this.width * this.height * 4); - - switch (this.channels) { - case 1: // grayscale to rgba - for (let i = 0, offset = 0; i < this.data.length; ++i) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i]; - newData[offset++] = 255; - } - break; - case 3: // rgb to rgba - for (let i = 0, offset = 0; i < this.data.length; i += 3) { - newData[offset++] = this.data[i]; - newData[offset++] = this.data[i + 1]; - newData[offset++] = this.data[i + 2]; - newData[offset++] = 255; - } - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - - return this._update(newData, this.width, this.height, 4); - } - - /** - * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing. - * @param {number} width - The width of the new image. - * @param {number} height - The height of the new image. - * @returns {Promise} - `this` to support chaining. - */ - async resize(width, height) { - if (CanvasClass) { - // Store number of channels before resizing - let numChannels = this.channels; - - // Create canvas object for this image - let canvas = this.toCanvas(); - - // Actually perform resizing using the canvas API - const ctx = new CanvasClass(width, height).getContext('2d'); - - // Draw image to context, resizing in the process - ctx.drawImage(canvas, 0, 0, width, height); - - // Create image from the resized data - let resizedImage = new CustomImage(ctx.getImageData(0, 0, width, height).data, width, height, 4); - - // Convert back so that image has the same number of channels as before - return resizedImage.convert(numChannels); - - } else { - // Create sharp image from raw data, and resize - let img = sharp(this.data, { - raw: { - width: this.width, - height: this.height, - channels: this.channels - } - }).resize({ - // https://github.com/lovell/sharp/blob/main/docs/api-resize.md - width, height, - fit: 'fill', - kernel: 'cubic' - }); - return await loadImageFunction(img); - } - - } - - toCanvas() { - // Clone, and convert data to RGBA before drawing to canvas. - // This is because the canvas API only supports RGBA - let cloned = this.clone().rgba(); - - // Create canvas object for the cloned image - let clonedCanvas = new CanvasClass(cloned.width, cloned.height); - - // Draw image to context - let data = new ImageDataClass(cloned.data, cloned.width, cloned.height); - clonedCanvas.getContext('2d').putImageData(data, 0, 0); - - return clonedCanvas; - } - - /** - * Helper method to update the image data. - * @param {Uint8ClampedArray} data - The new image data. - * @param {number} width - The new width of the image. - * @param {number} height - The new height of the image. - * @param {1|2|3|4} channels - The new number of channels of the image. - */ - _update(data, width, height, channels = null) { - this.data = data; - this.width = width; - this.height = height; - if (channels !== null) { - this.channels = channels; - } - return this; - } - - /** - * Clone the image - * @returns {CustomImage} - The cloned image - */ - clone() { - return new CustomImage(this.data.slice(), this.width, this.height, this.channels); - } - - /** - * Helper method for converting image to have a certain number of channels - * @param {number} numChannels - The number of channels. Must be 1, 3, or 4. - * @returns {CustomImage} - `this` to support chaining. - */ - convert(numChannels) { - if (this.channels === numChannels) return this; // Already correct number of channels - - switch (numChannels) { - case 1: - this.grayscale(); - break; - case 3: - this.rgb(); - break; - case 4: - this.rgba(); - break; - default: - throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); - } - return this; - } - - /** - * Save the image to the given path. This method is only available in environments with access to the FileSystem. - * @param {string|Buffer|URL} path - The path to save the image to. - * @param {string} [mime='image/png'] - The mime type of the image. - */ - save(path, mime = 'image/png') { - if (!env.useFS) { - throw new Error('Unable to save the image because filesystem is disabled in this environment.') - } - - let canvas = this.toCanvas(); - const buffer = canvas.toBuffer(mime); - fs.writeFileSync(path, buffer); - } -} - -module.exports = { - CustomImage, -}; diff --git a/src/math_utils.js b/src/math_utils.js deleted file mode 100644 index 570e22f3d..000000000 --- a/src/math_utils.js +++ /dev/null @@ -1,124 +0,0 @@ - -/** - * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray - * @typedef {BigInt64Array | BigUint64Array} BigTypedArray - * @typedef {TypedArray | BigTypedArray} AnyTypedArray - */ - -/** - * @param {TypedArray} input - */ -function interpolate(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) { - // TODO use mode and align_corners - - // Output image dimensions - const x_scale = out_width / in_width; - const y_scale = out_height / in_height; - - // Output image - // @ts-ignore - const out_img = new input.constructor(out_height * out_width * in_channels); - - // Pre-calculate strides - const inStride = in_height * in_width; - const outStride = out_height * out_width; - - for (let i = 0; i < out_height; ++i) { - for (let j = 0; j < out_width; ++j) { - // Calculate output offset - const outOffset = i * out_width + j; - - // Calculate input pixel coordinates - const x = (j + 0.5) / x_scale - 0.5; - const y = (i + 0.5) / y_scale - 0.5; - - // Calculate the four nearest input pixels - // We also check if the input pixel coordinates are within the image bounds - let x1 = Math.floor(x); - let y1 = Math.floor(y); - const x2 = Math.min(x1 + 1, in_width - 1); - const y2 = Math.min(y1 + 1, in_height - 1); - - x1 = Math.max(x1, 0); - y1 = Math.max(y1, 0); - - - // Calculate the fractional distances between the input pixel and the four nearest pixels - const s = x - x1; - const t = y - y1; - - // Perform bilinear interpolation - const w1 = (1 - s) * (1 - t); - const w2 = s * (1 - t); - const w3 = (1 - s) * t; - const w4 = s * t; - - // Calculate the four nearest input pixel indices - const yStride = y1 * in_width; - const xStride = y2 * in_width; - const idx1 = yStride + x1; - const idx2 = yStride + x2; - const idx3 = xStride + x1; - const idx4 = xStride + x2; - - for (let k = 0; k < in_channels; ++k) { - // Calculate channel offset - const cOffset = k * inStride; - - out_img[k * outStride + outOffset] = - w1 * input[cOffset + idx1] + - w2 * input[cOffset + idx2] + - w3 * input[cOffset + idx3] + - w4 * input[cOffset + idx4]; - } - } - } - - return out_img; -} - - -/** - * Helper method to transpose a AnyTypedArray directly - * @param {T} array - * @template {AnyTypedArray} T - * @param {number[]} dims - * @param {number[]} axes - * @returns {[T, number[]]} The transposed array and the new shape. - */ -function transpose_data(array, dims, axes) { - // Calculate the new shape of the transposed array - // and the stride of the original array - const shape = new Array(axes.length); - const stride = new Array(axes.length); - - for (let i = axes.length - 1, s = 1; i >= 0; --i) { - stride[i] = s; - shape[i] = dims[axes[i]]; - s *= shape[i]; - } - - // Precompute inverse mapping of stride - const invStride = axes.map((_, i) => stride[axes.indexOf(i)]); - - // Create the transposed array with the new shape - // @ts-ignore - const transposedData = new array.constructor(array.length); - - // Transpose the original array to the new array - for (let i = 0; i < array.length; ++i) { - let newIndex = 0; - for (let j = dims.length - 1, k = i; j >= 0; --j) { - newIndex += (k % dims[j]) * invStride[j]; - k = Math.floor(k / dims[j]); - } - transposedData[newIndex] = array[i]; - } - - return [transposedData, shape]; -} - -module.exports = { - interpolate, - transpose: transpose_data, -} diff --git a/src/models.js b/src/models.js index 9a27f77ed..6eaf44992 100644 --- a/src/models.js +++ b/src/models.js @@ -1,17 +1,55 @@ -const { + +/** + * @file Definitions of all models available in Transformers.js. + * + * **Example:** Load and run an `AutoModel`. + * + * ```javascript + * import { AutoModel, AutoTokenizer } from '@xenova/transformers'; + * + * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased'); + * let model = await AutoModel.from_pretrained('Xenova/bert-base-uncased'); + * + * let inputs = await tokenizer('I love transformers!'); + * let { logits } = await model(inputs); + * // Tensor { + * // data: Float32Array(183132) [-7.117443084716797, -7.107812881469727, -7.092104911804199, ...] + * // dims: (3) [1, 6, 30522], + * // type: "float32", + * // size: 183132, + * // } + * ``` + * + * We also provide other `AutoModel`s (listed below), which you can use in the same way as the Python library. For example: + * + * **Example:** Load and run a `AutoModelForSeq2SeqLM`. + * ```javascript + * import { AutoModelForSeq2SeqLM, AutoTokenizer } from '@xenova/transformers'; + * + * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/t5-small'); + * let model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small'); + * + * let { input_ids } = await tokenizer('translate English to German: I love transformers!'); + * let outputs = await model.generate(input_ids); + * let decoded = await tokenizer.decode(outputs[0][0], { skip_special_tokens: true }); + * // 'Ich liebe Transformatoren!' + * ``` + * + * @module models + */ + +import { Callable, - getModelFile, - fetchJSON, - dispatchCallback, isIntegralNumber, -} = require("./utils.js"); - -const { - Sampler, -} = require("./samplers.js"); + isTypedArray, +} from './utils/core.js'; +import { + getModelFile, + getModelJSON, +} from './utils/hub.js'; -const { +import { LogitsProcessorList, GenerationConfig, ForceTokensLogitsProcessor, @@ -19,34 +57,46 @@ const { ForcedEOSTokenLogitsProcessor, WhisperTimeStampLogitsProcessor, NoRepeatNGramLogitsProcessor, - RepetitionPenaltyLogitsProcessor -} = require("./generation.js"); + RepetitionPenaltyLogitsProcessor, + + Sampler, +} from './utils/generation.js'; -const { executionProviders, ONNX } = require('./backends/onnx.js'); -const { +import { Tensor, - cat -} = require('./tensor_utils'); +} from './utils/tensor.js'; + +import { executionProviders, ONNX } from './backends/onnx.js'; const { InferenceSession, Tensor: ONNXTensor } = ONNX; +/** + * @typedef {import('./utils/hub.js').PretrainedOptions} PretrainedOptions + */ + ////////////////////////////////////////////////// // Helper functions /** * Constructs an InferenceSession using a model file located at the specified path. - * @param {string} modelPath - The path to the directory containing the model file. - * @param {string} fileName - The name of the model file. - * @param {function} [progressCallback=null] - An optional function to track progress during the creation of the session. - * @returns {Promise} - A Promise that resolves to an InferenceSession object. + * @param {string} pretrained_model_name_or_path The path to the directory containing the model file. + * @param {string} fileName The name of the model file. + * @param {PretrainedOptions} options Additional options for loading the model. + * @returns {Promise} A Promise that resolves to an InferenceSession object. */ -async function constructSession(modelPath, fileName, progressCallback = null) { - let buffer = await getModelFile(modelPath, fileName, progressCallback); - +async function constructSession(pretrained_model_name_or_path, fileName, options) { // TODO add option for user to force specify their desired execution provider + let modelFileName = `onnx/${fileName}${options.quantized ? '_quantized' : ''}.onnx`; + let buffer = await getModelFile(pretrained_model_name_or_path, modelFileName, true, options); + try { return await InferenceSession.create(buffer, { executionProviders, }); } catch (err) { + // If the execution provided was only wasm, throw the error + if (executionProviders.length === 1 && executionProviders[0] === 'wasm') { + throw err; + } + console.warn(err); console.warn( 'Something went wrong during model construction (most likely a missing operation). ' + @@ -60,9 +110,9 @@ async function constructSession(modelPath, fileName, progressCallback = null) { /** * Executes an InferenceSession using the specified inputs. - * @param {InferenceSession} session - The InferenceSession object to run. - * @param {Object} inputs - An object that maps input names to input tensors. - * @returns {Promise} - A Promise that resolves to an object that maps output names to output tensors. + * @param {InferenceSession} session The InferenceSession object to run. + * @param {Object} inputs An object that maps input names to input tensors. + * @returns {Promise} A Promise that resolves to an object that maps output names to output tensors. */ async function sessionRun(session, inputs) { try { @@ -78,8 +128,8 @@ async function sessionRun(session, inputs) { /** * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions. - * @param {Object} obj - The object to replace tensor objects in. - * @returns {Object} - The object with tensor objects replaced by custom Tensor objects. + * @param {Object} obj The object to replace tensor objects in. + * @returns {Object} The object with tensor objects replaced by custom Tensor objects. */ function replaceTensors(obj) { // Convert ONNX Tensors with our custom Tensor class @@ -92,11 +142,47 @@ function replaceTensors(obj) { return obj; } + +/** + * Converts an array or Tensor of integers to an int64 Tensor. + * @param {Array|Tensor} items The input integers to be converted. + * @returns {Tensor} The int64 Tensor with the converted values. + * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length. + * @private + */ +function toI64Tensor(items) { + if (items instanceof Tensor) { + return items; + } + // items is an array + if (items.length === 0) { + throw Error("items must be non-empty"); + } + + if (Array.isArray(items[0])) { + // batched + if (items.some(x => x.length !== items[0].length)) { + 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.") + } + + return new Tensor('int64', + BigInt64Array.from(items.flat().map(x => BigInt(x))), + [items.length, items[0].length] + ); + } else { + //flat + return new Tensor('int64', + BigInt64Array.from(items.map(x => BigInt(x))), + [1, items.length] + ); + } +} + /** * Prepares an attention mask for a sequence of tokens based on configuration options. - * @param {Object} self - The calling object instance. - * @param {Tensor} tokens - The input tokens. - * @returns {Tensor} - The attention mask tensor. + * @param {Object} self The calling object instance. + * @param {Tensor} tokens The input tokens. + * @returns {Tensor} The attention mask tensor. */ function _prepare_attention_mask(self, tokens) { @@ -127,48 +213,101 @@ function _prepare_attention_mask(self, tokens) { /** * Creates a boolean tensor with a single value. - * @param {boolean} value - The value of the tensor. - * @returns {Tensor} - The boolean tensor. + * @param {boolean} value The value of the tensor. + * @returns {Tensor} The boolean tensor. */ function boolTensor(value) { // Create boolean tensor return new Tensor('bool', [value], [1]); } -// JS doesn't support mixins, so we define some reused functions here, and allow "this" to be passed in + +/** + * Loads a model from the specified path. + * @param {string} pretrained_model_name_or_path The path to the model directory. + * @param {PretrainedOptions} options Additional options for loading the model. + * @returns {Promise} A promise that resolves with information about the loaded model. + */ +async function loadAutoModel(pretrained_model_name_or_path, options) { + // Only get config.json if not already specified + let config = options.config ?? await getModelJSON(pretrained_model_name_or_path, 'config.json', true, options); + + let modelName = config.is_encoder_decoder ? 'encoder_model' : 'model'; + + let session = await constructSession(pretrained_model_name_or_path, modelName, options); + + return [config, session]; +} + +/** + * Loads a model from the specified path. + * @param {string} pretrained_model_name_or_path The path to the model directory. + * @param {PretrainedOptions} options Additional options for loading the model. + * @returns {Promise} A promise that resolves with information about the loaded model. + */ +async function loadModel(pretrained_model_name_or_path, options) { + let info = await Promise.all([ + options.config ?? getModelJSON(pretrained_model_name_or_path, 'config.json', true, options), + constructSession(pretrained_model_name_or_path, 'model', options) + ]); + return info; +} + /** * Loads a sequence-to-sequence model from the specified path. - * @param {string} modelPath - The path to the model directory. - * @param {function} progressCallback - The optional progress callback function. - * @returns {Promise<[any, any, any, any]>} - A promise that resolves with information about the loaded model. + * @param {string} pretrained_model_name_or_path The path to the model directory. + * @param {PretrainedOptions} options Additional options for loading the model. + * @returns {Promise} A promise that resolves with information about the loaded model. + */ +async function seq2seqLoadModel(pretrained_model_name_or_path, options) { + let info = await Promise.all([ + options.config ?? getModelJSON(pretrained_model_name_or_path, 'config.json', true, options), + constructSession(pretrained_model_name_or_path, 'encoder_model', options), + constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options), + getModelJSON(pretrained_model_name_or_path, 'generation_config.json', false, options), + ]); + return info; +} + +/** + * Loads an encoder-decoder model from the specified path. + * @param {string} pretrained_model_name_or_path The path to the model directory. + * @param {PretrainedOptions} options Additional options for loading the model. + * @returns {Promise} A promise that resolves with information about the loaded model. */ -async function seq2seqLoadModel(modelPath, progressCallback) { +async function encoderDecoderLoadModel(pretrained_model_name_or_path, options) { let info = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'encoder_model.onnx', progressCallback), - constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback), - fetchJSON(modelPath, 'generation_config.json', progressCallback, false), + options.config ?? getModelJSON(pretrained_model_name_or_path, 'config.json', true, options), + constructSession(pretrained_model_name_or_path, 'encoder_model', options), + constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options), ]) + return info; +} - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); +/** + * Loads a decoder model from the specified path. + * @param {string} pretrained_model_name_or_path The path to the model directory. + * @param {PretrainedOptions} options Additional options for loading the model. + * @returns {Promise} A promise that resolves with information about the loaded model. + */ +async function decoderLoadModel(pretrained_model_name_or_path, options) { + let info = await Promise.all([ + options.config ?? getModelJSON(pretrained_model_name_or_path, 'config.json', true, options), + constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options), + ]) return info; } +// JS doesn't support mixins, so we define some reused functions here, and allow "this" to be passed in /** * Perform forward pass on the seq2seq model. - * @async - * @function - * @param {Object} self - The seq2seq model object. - * @param {Object} model_inputs - The input object for the model containing encoder and decoder inputs. - * @param {Object} options - The options - * @param {string} [options.encoder_input_name='input_ids'] - The name of the input tensor for the encoder. - * @param {boolean} [options.add_decoder_pkv=true] - Flag to add the decoder past key values. - * @returns {Promise} - Promise that resolves with the output of the seq2seq model. + * @param {Object} self The seq2seq model object. + * @param {Object} model_inputs The input object for the model containing encoder and decoder inputs. + * @param {Object} options The options + * @param {string} [options.encoder_input_name='input_ids'] The name of the input tensor for the encoder. + * @param {boolean} [options.add_decoder_pkv=true] Flag to add the decoder past key values. + * @returns {Promise} Promise that resolves with the output of the seq2seq model. */ async function seq2seq_forward(self, model_inputs, { encoder_input_name = 'input_ids', @@ -207,12 +346,11 @@ async function seq2seq_forward(self, model_inputs, { /** * Start the beam search process for the seq2seq model. - * @function - * @param {Object} self - The seq2seq model object. - * @param {Object[]} inputTokenIds - Array of input token ids for each input sequence. - * @param {number} numOutputTokens - The maximum number of output tokens for the model. - * @param {boolean} [requires_attention_mask=true] - Flag to indicate if the model requires an attention mask. - * @returns {Object[]} - Array of beam search objects. + * @param {Object} self The seq2seq model object. + * @param {Object[]} inputTokenIds Array of input token ids for each input sequence. + * @param {number} numOutputTokens The maximum number of output tokens for the model. + * @param {boolean} [requires_attention_mask=true] Flag to indicate if the model requires an attention mask. + * @returns {Object[]} Array of beam search objects. */ function seq2seqStartBeams(self, inputTokenIds, numOutputTokens, requires_attention_mask = true) { let beams = []; @@ -248,13 +386,11 @@ function seq2seqStartBeams(self, inputTokenIds, numOutputTokens, requires_attent /** * Run beam search on the seq2seq model for a single beam. - * @async - * @function - * @param {Object} self - The seq2seq model object. - * @param {Object} beam - The beam search object for which to run the model. - * @param {Object} options - options - * @param {string} [options.input_name='input_ids'] - The name of the input tensor for the encoder. - * @returns {Promise} - Promise that resolves with the output of the seq2seq model for the given beam. + * @param {Object} self The seq2seq model object. + * @param {Object} beam The beam search object for which to run the model. + * @param {Object} options options + * @param {string} [options.input_name='input_ids'] The name of the input tensor for the encoder. + * @returns {Promise} Promise that resolves with the output of the seq2seq model for the given beam. */ async function seq2seqRunBeam(self, beam, { input_name = 'input_ids', @@ -263,7 +399,7 @@ async function seq2seqRunBeam(self, beam, { // 1. Prepare let model_inputs = { [input_name]: beam.inputs, - decoder_input_ids: self.toI64Tensor(beam.output_token_ids.slice(-1)), + decoder_input_ids: toI64Tensor(beam.output_token_ids.slice(-1)), encoder_outputs: beam.encoder_outputs, past_key_values: beam.past_key_values, } @@ -283,11 +419,9 @@ async function seq2seqRunBeam(self, beam, { /** * Forward pass of the text generation model. - * @async - * @function - * @param {Object} self - The text generation model object. - * @param {Object} model_inputs - The input data to be used for the forward pass. - * @returns {Promise} - Promise that resolves with an object containing the logits and past key values. + * @param {Object} self The text generation model object. + * @param {Object} model_inputs The input data to be used for the forward pass. + * @returns {Promise} Promise that resolves with an object containing the logits and past key values. */ async function textgen_forward(self, model_inputs) { let past_key_values = model_inputs.past_key_values; @@ -307,10 +441,10 @@ async function textgen_forward(self, model_inputs) { /** * Starts the generation of text by initializing the beams for the given input token IDs. - * @param {Object} self - The text generation model object. - * @param {any} inputTokenIds - An array of input token IDs to generate text from. - * @param {number} numOutputTokens - The maximum number of tokens to generate for each beam. - * @param {Tensor} [inputs_attention_mask] - The attention mask tensor for the input token IDs. + * @param {Object} self The text generation model object. + * @param {any} inputTokenIds An array of input token IDs to generate text from. + * @param {number} numOutputTokens The maximum number of tokens to generate for each beam. + * @param {Tensor} [inputs_attention_mask] The attention mask tensor for the input token IDs. * @returns {Object[]} An array of beams initialized with the given inputs and parameters. */ function textgenStartBeams(self, inputTokenIds, numOutputTokens, inputs_attention_mask) { @@ -325,7 +459,7 @@ function textgenStartBeams(self, inputTokenIds, numOutputTokens, inputs_attentio let attn_mask; if (inputs_attention_mask) { - attn_mask = inputs_attention_mask.get(beamId) + attn_mask = inputs_attention_mask[beamId]; attn_mask.dims = [1, ...attn_mask.dims] } else { @@ -354,15 +488,13 @@ function textgenStartBeams(self, inputTokenIds, numOutputTokens, inputs_attentio /** * Runs a single step of the text generation process for a given beam. * - * @async - * @function textgenRunBeam - * @param {Object} self - The textgen object. - * @param {Object} beam - The beam to run. - * @param {Tensor} beam.input - The input tensor. - * @param {Tensor} beam.model_input_ids - The input ids to the model. - * @param {Tensor} beam.attention_mask - The attention mask. - * @param {Object} beam.past_key_values - The past key values. - * @param {number[]} beam.output_token_ids - The output token ids. + * @param {Object} self The textgen object. + * @param {Object} beam The beam to run. + * @param {Tensor} beam.input The input tensor. + * @param {Tensor} beam.model_input_ids The input ids to the model. + * @param {Tensor} beam.attention_mask The attention mask. + * @param {Object} beam.past_key_values The past key values. + * @param {number[]} beam.output_token_ids The output token ids. * @returns {Promise} The output of the generation step. */ async function textgenRunBeam(self, beam) { @@ -390,8 +522,8 @@ async function textgenRunBeam(self, beam) { /** * Update a beam with a new token ID. - * @param {object} beam - The beam to update. - * @param {number} newTokenId - The new token ID to add to the beam's output. + * @param {Object} beam The beam to update. + * @param {number} newTokenId The new token ID to add to the beam's output. */ function textgenUpdatebeam(beam, newTokenId) { beam.output_token_ids = [...beam.output_token_ids, newTokenId]; @@ -400,16 +532,15 @@ function textgenUpdatebeam(beam, newTokenId) { ////////////////////////////////////////////////// ////////////////////////////////////////////////// -// Base class /** * A base class for pre-trained models that provides the model configuration and an ONNX session. * @extends Callable */ -class PreTrainedModel extends Callable { +export class PreTrainedModel extends Callable { /** * Creates a new instance of the `PreTrainedModel` class. - * @param {object} config - The model configuration. - * @param {any} session - session for the model. + * @param {Object} config The model configuration. + * @param {any} session session for the model. */ constructor(config, session) { super(); @@ -420,7 +551,7 @@ class PreTrainedModel extends Callable { /** * Disposes of all the ONNX sessions that were created during inference. - * @returns {Promise} - An array of promises, one for each ONNX session that is being disposed. + * @returns {Promise} An array of promises, one for each ONNX session that is being disposed. */ async dispose() { // Dispose of all ONNX sessions sessions @@ -437,68 +568,38 @@ class PreTrainedModel extends Callable { } /** - * Loads a pre-trained model from the given modelPath. - * @static - * @async - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - A function to be called with progress updates. - * @returns {Promise} A new instance of the PreTrainedModel class. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let config = await fetchJSON(modelPath, 'config.json', progressCallback); - let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx'; - - // Load model - let session = await constructSession(modelPath, modelName, progressCallback); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `PreTrainedModel` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await loadAutoModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, }); - return new this(config, session); - } - - /** - * Converts an array or Tensor of integers to an int64 Tensor. - * @param {Array|Tensor} items - The input integers to be converted. - * @returns {Tensor} The int64 Tensor with the converted values. - * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length. - */ - toI64Tensor(items) { - if (items instanceof Tensor) { - return items; - } - // items is an array - if (items.length === 0) { - throw Error("items must be non-empty"); - } - - if (Array.isArray(items[0])) { - // batched - if (items.some(x => x.length !== items[0].length)) { - 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.") - } - - return new Tensor('int64', - BigInt64Array.from(items.flat().map(x => BigInt(x))), - [items.length, items[0].length] - ); - } else { - //flat - return new Tensor('int64', - BigInt64Array.from(items.map(x => BigInt(x))), - [1, items.length] - ); - } + // @ts-ignore + return new this(...info); } /** * Runs the model with the provided inputs - * @param {Object} model_inputs - Object containing input tensors - * @returns {Promise} - Object containing output tensors + * @param {Object} model_inputs Object containing input tensors + * @returns {Promise} Object containing output tensors */ async _call(model_inputs) { return await sessionRun(this.session, model_inputs); @@ -507,9 +608,9 @@ class PreTrainedModel extends Callable { /** * Forward method should be implemented in subclasses. * @abstract - * @param {object} model_inputs - The input data to the model in the format specified in the ONNX model. - * @returns {Promise} - The output data from the model in the format specified in the ONNX model. - * @throws {Error} - This method must be implemented in subclasses. + * @param {Object} model_inputs The input data to the model in the format specified in the ONNX model. + * @returns {Promise} The output data from the model in the format specified in the ONNX model. + * @throws {Error} This method must be implemented in subclasses. */ async forward(model_inputs) { throw Error("forward should be implemented in subclasses.") @@ -643,7 +744,7 @@ class PreTrainedModel extends Callable { * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation. * 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. * - * @param {GenerationConfig} generation_config - A `GenerationConfig` object containing generation parameters. + * @param {GenerationConfig} generation_config A `GenerationConfig` object containing generation parameters. * @returns {GenerationConfig} The final generation config object to be used by the model for text generation. */ _get_generation_config(generation_config) { @@ -664,15 +765,19 @@ class PreTrainedModel extends Callable { } /** - * Generates text based on the given inputs and generation configuration using the model. - * @param {Array} inputs - An array of input token IDs. - * @param {Object|null} generation_config - The generation configuration to use. If null, default configuration will be used. - * @param {Object|null} logits_processor - An optional logits processor to use. If null, a new LogitsProcessorList instance will be created. - * @param {Object} options - options - * @param {Object} [options.inputs_attention_mask=null] - An optional attention mask for the inputs. - * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs. - * @throws {Error} Throws an error if the inputs array is empty. - */ + * @typedef {import('./utils/maths.js').TypedArray} TypedArray + */ + + /** + * Generates text based on the given inputs and generation configuration using the model. + * @param {Tensor|Array|TypedArray} inputs An array of input token IDs. + * @param {Object|null} generation_config The generation configuration to use. If null, default configuration will be used. + * @param {Object|null} logits_processor An optional logits processor to use. If null, a new LogitsProcessorList instance will be created. + * @param {Object} options options + * @param {Object} [options.inputs_attention_mask=null] An optional attention mask for the inputs. + * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs. + * @throws {Error} Throws an error if the inputs array is empty. + */ async generate( inputs, generation_config = null, @@ -682,6 +787,10 @@ class PreTrainedModel extends Callable { } = {}, ) { + if (!(inputs instanceof Tensor) && !isTypedArray(inputs) && !Array.isArray(inputs)) { + throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${inputs.constructor.name}".`); + } + if (inputs.length === 0) { throw Error("Must supply a non-empty array of input token ids.") } @@ -709,6 +818,7 @@ class PreTrainedModel extends Callable { let sampler = Sampler.getSampler(generation_config); + // @ts-ignore let beams = this.getStartBeams(inputs, numOutputTokens, inputs_attention_mask); while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) { @@ -721,23 +831,17 @@ class PreTrainedModel extends Callable { continue } + // @ts-ignore let output = await this.runBeam(beam); // Logits are of the form [batch_size, out_seq_length, vocab_size] // In most cases, this will be [batch_size, 1, vocab_size] // So, we select the last token's logits: // (equivalent to `logits = outputs.logits[:, -1, :]`) - let extractedLogits = []; - for (const batch of output.logits) { - // Extract logits corresponding to the last token - let lastLogits = batch.get(batch.dims[0] - 1); - - // Add back batch dimension (needed for `cat`) - lastLogits.dims = [1, ...lastLogits.dims]; - extractedLogits.push(lastLogits) - } - let logits = cat(extractedLogits); - logits_processor(beam.output_token_ids, logits) + let logits = output.logits.slice(null, -1, null); + + // Apply logits processor + logits_processor(beam.output_token_ids, logits); let sampledTokens = sampler(logits); for (let [newTokenId, logProb] of sampledTokens) { @@ -745,6 +849,7 @@ class PreTrainedModel extends Callable { let newBeam = { ...beam }; // update new beam + // @ts-ignore this.updateBeam(newBeam, newTokenId); newBeam.score += logProb; @@ -760,8 +865,8 @@ class PreTrainedModel extends Callable { // Next, we get the best beams, per ID newest_beams = this.groupBeams(newest_beams).map( group => group - .sort((a, b) => b.score - a.score) // sort based on score - .slice(0, generation_config.num_beams) // remove outside beam width + .sort((a, b) => b.score - a.score) // sort based on score + .slice(0, generation_config.num_beams) // remove outside beam width ); // Flatten beams @@ -773,6 +878,8 @@ class PreTrainedModel extends Callable { } } + // TODO: Ensure that we can return non-batched outputs + return this.groupBeams(beams).map( batch => { if (generation_config.num_return_sequences > 1) { @@ -787,12 +894,12 @@ class PreTrainedModel extends Callable { /** * Groups an array of beam objects by their ids. * - * @param {Array} beams - The array of beam objects to group. - * @returns {Array} - An array of arrays, where each inner array contains beam objects with the same id. + * @param {Array} beams The array of beam objects to group. + * @returns {Array} An array of arrays, where each inner array contains beam objects with the same id. */ groupBeams(beams) { // Group beams by their ids - const groups = {}; + const groups = Object.create(null); for (const obj of beams) { if (groups[obj.id] === undefined) { groups[obj.id] = [obj]; @@ -807,13 +914,13 @@ class PreTrainedModel extends Callable { /** * Returns an object containing past key values from the given decoder results object. * - * @param {Object} decoderResults - The decoder results object. - * @param {Object} pastKeyValues - The previous past key values. - * @returns {Object} - An object containing past key values. + * @param {Object} decoderResults The decoder results object. + * @param {Object} pastKeyValues The previous past key values. + * @returns {Object} An object containing past key values. */ getPastKeyValues(decoderResults, pastKeyValues) { - const pkvs = {}; + const pkvs = Object.create(null); for (const name in decoderResults) { if (name.startsWith('present')) { @@ -835,28 +942,34 @@ class PreTrainedModel extends Callable { /** * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values. * - * @param {Object} decoderFeeds - The decoder feeds object to add past key values to. - * @param {Object} pastKeyValues - An object containing past key values. - * @param {boolean} [hasDecoder=false] - Whether the model has a decoder. + * @param {Object} decoderFeeds The decoder feeds object to add past key values to. + * @param {Object} pastKeyValues An object containing past key values. + * @param {boolean} [hasDecoder=false] Whether the model has a decoder. */ addPastKeyValues(decoderFeeds, pastKeyValues, hasDecoder = false) { if (pastKeyValues === null) { // TODO support batches (i.e., batch_size > 1) if (hasDecoder) { + // @ts-ignore let encoder_dims = [1, this.num_encoder_heads, 0, this.encoder_dim_kv]; + // @ts-ignore for (let i = 0; i < this.num_encoder_layers; ++i) { decoderFeeds[`past_key_values.${i}.encoder.key`] = new Tensor('float32', [], encoder_dims) decoderFeeds[`past_key_values.${i}.encoder.value`] = new Tensor('float32', [], encoder_dims) } + // @ts-ignore let decoder_dims = [1, this.num_decoder_heads, 0, this.decoder_dim_kv]; + // @ts-ignore for (let i = 0; i < this.num_decoder_layers; ++i) { decoderFeeds[`past_key_values.${i}.decoder.key`] = new Tensor('float32', [], decoder_dims) decoderFeeds[`past_key_values.${i}.decoder.value`] = new Tensor('float32', [], decoder_dims) } } else { + // @ts-ignore let dims = [1, this.num_heads, 0, this.dim_kv] + // @ts-ignore for (let i = 0; i < this.num_layers; ++i) { decoderFeeds[`past_key_values.${i}.key`] = new Tensor('float32', [], dims) decoderFeeds[`past_key_values.${i}.value`] = new Tensor('float32', [], dims) @@ -870,24 +983,24 @@ class PreTrainedModel extends Callable { } ////////////////////////////////////////////////// // Base model output class -class ModelOutput { } +export class ModelOutput { } ////////////////////////////////////////////////// // Bert models -class BertPreTrainedModel extends PreTrainedModel { } -class BertModel extends BertPreTrainedModel { } +export class BertPreTrainedModel extends PreTrainedModel { } +export class BertModel extends BertPreTrainedModel { } /** * BertForMaskedLM is a class representing a BERT model for masked language modeling. * @extends BertPreTrainedModel */ -class BertForMaskedLM extends BertPreTrainedModel { +export class BertForMaskedLM extends BertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for masked language modeling. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for masked language modeling. */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -899,12 +1012,12 @@ class BertForMaskedLM extends BertPreTrainedModel { * BertForSequenceClassification is a class representing a BERT model for sequence classification. * @extends BertPreTrainedModel */ -class BertForSequenceClassification extends BertPreTrainedModel { +export class BertForSequenceClassification extends BertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for sequence classification. */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -916,12 +1029,12 @@ class BertForSequenceClassification extends BertPreTrainedModel { * BertForTokenClassification is a class representing a BERT model for token classification. * @extends BertPreTrainedModel */ -class BertForTokenClassification extends BertPreTrainedModel { +export class BertForTokenClassification extends BertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for token classification. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for token classification. */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -933,12 +1046,12 @@ class BertForTokenClassification extends BertPreTrainedModel { * BertForQuestionAnswering is a class representing a BERT model for question answering. * @extends BertPreTrainedModel */ -class BertForQuestionAnswering extends BertPreTrainedModel { +export class BertForQuestionAnswering extends BertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for question answering. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for question answering. */ async _call(model_inputs) { let outputs = await super._call(model_inputs); @@ -949,19 +1062,19 @@ class BertForQuestionAnswering extends BertPreTrainedModel { ////////////////////////////////////////////////// // DistilBert models -class DistilBertPreTrainedModel extends PreTrainedModel { } -class DistilBertModel extends DistilBertPreTrainedModel { } +export class DistilBertPreTrainedModel extends PreTrainedModel { } +export class DistilBertModel extends DistilBertPreTrainedModel { } /** * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification. * @extends DistilBertPreTrainedModel */ -class DistilBertForSequenceClassification extends DistilBertPreTrainedModel { +export class DistilBertForSequenceClassification extends DistilBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for sequence classification. */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -973,12 +1086,12 @@ class DistilBertForSequenceClassification extends DistilBertPreTrainedModel { * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification. * @extends DistilBertPreTrainedModel */ -class DistilBertForTokenClassification extends DistilBertPreTrainedModel { +export class DistilBertForTokenClassification extends DistilBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for token classification. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for token classification. */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -991,12 +1104,12 @@ class DistilBertForTokenClassification extends DistilBertPreTrainedModel { * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering. * @extends DistilBertPreTrainedModel */ -class DistilBertForQuestionAnswering extends DistilBertPreTrainedModel { +export class DistilBertForQuestionAnswering extends DistilBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for question answering. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for question answering. */ async _call(model_inputs) { let outputs = await super._call(model_inputs); @@ -1008,12 +1121,12 @@ class DistilBertForQuestionAnswering extends DistilBertPreTrainedModel { * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task. * @extends DistilBertPreTrainedModel */ -class DistilBertForMaskedLM extends DistilBertPreTrainedModel { +export class DistilBertForMaskedLM extends DistilBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1025,19 +1138,19 @@ class DistilBertForMaskedLM extends DistilBertPreTrainedModel { ////////////////////////////////////////////////// // MobileBert models -class MobileBertPreTrainedModel extends PreTrainedModel { } -class MobileBertModel extends MobileBertPreTrainedModel { } +export class MobileBertPreTrainedModel extends PreTrainedModel { } +export class MobileBertModel extends MobileBertPreTrainedModel { } /** * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task. * @extends MobileBertPreTrainedModel */ -class MobileBertForMaskedLM extends MobileBertPreTrainedModel { +export class MobileBertForMaskedLM extends MobileBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1048,12 +1161,12 @@ class MobileBertForMaskedLM extends MobileBertPreTrainedModel { /** * @extends MobileBertPreTrainedModel */ -class MobileBertForSequenceClassification extends MobileBertPreTrainedModel { +export class MobileBertForSequenceClassification extends MobileBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1064,12 +1177,12 @@ class MobileBertForSequenceClassification extends MobileBertPreTrainedModel { /** * @extends MobileBertPreTrainedModel */ -class MobileBertForQuestionAnswering extends MobileBertPreTrainedModel { +export class MobileBertForQuestionAnswering extends MobileBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let outputs = await super._call(model_inputs); @@ -1081,38 +1194,38 @@ class MobileBertForQuestionAnswering extends MobileBertPreTrainedModel { ////////////////////////////////////////////////// // SqueezeBert models -class SqueezeBertPreTrainedModel extends PreTrainedModel { } -class SqueezeBertModel extends SqueezeBertPreTrainedModel { } -class SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel { +export class SqueezeBertPreTrainedModel extends PreTrainedModel { } +export class SqueezeBertModel extends SqueezeBertPreTrainedModel { } +export class SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; return new MaskedLMOutput(logits) } } -class SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel { +export class SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; return new SequenceClassifierOutput(logits) } } -class SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel { +export class SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let outputs = await super._call(model_inputs); @@ -1124,38 +1237,38 @@ class SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel { ////////////////////////////////////////////////// // Albert models -class AlbertPreTrainedModel extends PreTrainedModel { } -class AlbertModel extends AlbertPreTrainedModel { } -class AlbertForSequenceClassification extends AlbertPreTrainedModel { +export class AlbertPreTrainedModel extends PreTrainedModel { } +export class AlbertModel extends AlbertPreTrainedModel { } +export class AlbertForSequenceClassification extends AlbertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; return new SequenceClassifierOutput(logits) } } -class AlbertForQuestionAnswering extends AlbertPreTrainedModel { +export class AlbertForQuestionAnswering extends AlbertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let outputs = await super._call(model_inputs); return new QuestionAnsweringModelOutput(outputs.start_logits, outputs.end_logits); } } -class AlbertForMaskedLM extends AlbertPreTrainedModel { +export class AlbertForMaskedLM extends AlbertPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1167,12 +1280,12 @@ class AlbertForMaskedLM extends AlbertPreTrainedModel { ////////////////////////////////////////////////// // T5 models -class T5PreTrainedModel extends PreTrainedModel { }; +export class T5PreTrainedModel extends PreTrainedModel { }; -class T5Model extends T5PreTrainedModel { +export class T5Model extends T5PreTrainedModel { /** * Generates text based on the provided arguments. - * @throws {Error} - Throws an error as the current model class (T5Model) is not compatible with `.generate()`. + * @throws {Error} Throws an error as the current model class (T5Model) is not compatible with `.generate()`. * @returns {Promise} * @param {any[]} args */ @@ -1187,13 +1300,13 @@ class T5Model extends T5PreTrainedModel { * T5Model is a class representing a T5 model for conditional generation. * @extends T5PreTrainedModel */ -class T5ForConditionalGeneration extends T5PreTrainedModel { +export class T5ForConditionalGeneration extends T5PreTrainedModel { /** * Creates a new instance of the `T5ForConditionalGeneration` class. - * @param {object} config - The model configuration. - * @param {any} session - session for the model. - * @param {any} decoder_merged_session - session for the decoder. - * @param {GenerationConfig} generation_config - The generation configuration. + * @param {Object} config The model configuration. + * @param {any} session session for the model. + * @param {any} decoder_merged_session session for the decoder. + * @param {GenerationConfig} generation_config The generation configuration. */ constructor(config, session, decoder_merged_session, generation_config) { super(config, session); @@ -1210,21 +1323,37 @@ class T5ForConditionalGeneration extends T5PreTrainedModel { } /** - * Loads the pre-trained model from a given path. - * @async - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - A function to call with progress updates (optional). - * @returns {Promise} The loaded model instance. - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `T5ForConditionalGeneration` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await seq2seqLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + // @ts-ignore return new this(...info); } /** * Generates the start beams for a given set of inputs and output length. - * @param {number[][]} inputs - The input token IDs. - * @param {number} numOutputTokens - The desired output length. + * @param {number[][]} inputs The input token IDs. + * @param {number} numOutputTokens The desired output length. * @returns {Array} The start beams. */ getStartBeams(inputs, numOutputTokens, ...args) { @@ -1233,8 +1362,8 @@ class T5ForConditionalGeneration extends T5PreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await seq2seqRunBeam(this, beam); @@ -1242,8 +1371,8 @@ class T5ForConditionalGeneration extends T5PreTrainedModel { /** * Updates the given beam with a new token ID. - * @param {any} beam - The current beam. - * @param {number} newTokenId - The new token ID to add to the output sequence. + * @param {any} beam The current beam. + * @param {number} newTokenId The new token ID to add to the output sequence. */ updateBeam(beam, newTokenId) { beam.output_token_ids = [...beam.output_token_ids, newTokenId]; @@ -1251,8 +1380,7 @@ class T5ForConditionalGeneration extends T5PreTrainedModel { /** * Runs the forward pass of the model for a given set of inputs. - * @async - * @param {Object} model_inputs - The model inputs. + * @param {Object} model_inputs The model inputs. * @returns {Promise} The model output. */ async forward(model_inputs) { @@ -1263,9 +1391,9 @@ class T5ForConditionalGeneration extends T5PreTrainedModel { ////////////////////////////////////////////////// // MT5 models -class MT5PreTrainedModel extends PreTrainedModel { }; +export class MT5PreTrainedModel extends PreTrainedModel { }; -class MT5Model extends MT5PreTrainedModel { +export class MT5Model extends MT5PreTrainedModel { /** * * @param {...any} args @@ -1284,13 +1412,13 @@ class MT5Model extends MT5PreTrainedModel { * * @extends MT5PreTrainedModel */ -class MT5ForConditionalGeneration extends MT5PreTrainedModel { +export class MT5ForConditionalGeneration extends MT5PreTrainedModel { /** * Creates a new instance of the `MT5ForConditionalGeneration` class. - * @param {any} config - The model configuration. - * @param {any} session - The ONNX session containing the encoder weights. - * @param {any} decoder_merged_session - The ONNX session containing the merged decoder weights. - * @param {GenerationConfig} generation_config - The generation configuration. + * @param {any} config The model configuration. + * @param {any} session The ONNX session containing the encoder weights. + * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights. + * @param {GenerationConfig} generation_config The generation configuration. */ constructor(config, session, decoder_merged_session, generation_config) { super(config, session); @@ -1307,25 +1435,40 @@ class MT5ForConditionalGeneration extends MT5PreTrainedModel { } /** - * Loads a pre-trained model from the given path. - * - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} [progressCallback=null] - A callback function that is called with the download progress percentage (0-100). - * @returns {Promise} - A Promise that resolves to a new `MT5ForConditionalGeneration` instance. - * @static - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `MT5ForConditionalGeneration` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await seq2seqLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + // @ts-ignore return new this(...info); } /** * Generates the start beams for the given input tokens and output sequence length. * - * @param {any[]} inputs - The input sequence. - * @param {number} numOutputTokens - The desired length of the output sequence. - * @param {...*} args - Additional arguments to pass to the `seq2seqStartBeams` function. - * @returns {any[]} - An array of `Beam` objects representing the start beams. + * @param {any[]} inputs The input sequence. + * @param {number} numOutputTokens The desired length of the output sequence. + * @param {...*} args Additional arguments to pass to the `seq2seqStartBeams` function. + * @returns {any[]} An array of `Beam` objects representing the start beams. */ getStartBeams(inputs, numOutputTokens, ...args) { return seq2seqStartBeams(this, inputs, numOutputTokens); @@ -1333,8 +1476,8 @@ class MT5ForConditionalGeneration extends MT5PreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await seq2seqRunBeam(this, beam); @@ -1342,8 +1485,8 @@ class MT5ForConditionalGeneration extends MT5PreTrainedModel { /** * Updates the given beam with the new predicted token. - * @param {any} beam - The beam to update. - * @param {number} newTokenId - The index of the predicted token. + * @param {any} beam The beam to update. + * @param {number} newTokenId The index of the predicted token. */ updateBeam(beam, newTokenId) { beam.output_token_ids = [...beam.output_token_ids, newTokenId]; @@ -1351,8 +1494,8 @@ class MT5ForConditionalGeneration extends MT5PreTrainedModel { /** * Runs the forward pass of the model on the given inputs. - * @param {any} model_inputs - The model inputs. - * @returns {Promise} - A Promise that resolves to the model outputs. + * @param {any} model_inputs The model inputs. + * @returns {Promise} A Promise that resolves to the model outputs. */ async forward(model_inputs) { return await seq2seq_forward(this, model_inputs); @@ -1362,7 +1505,7 @@ class MT5ForConditionalGeneration extends MT5PreTrainedModel { ////////////////////////////////////////////////// // Bart models -class BartPretrainedModel extends PreTrainedModel { }; +export class BartPretrainedModel extends PreTrainedModel { }; /** * BART encoder and decoder model. @@ -1370,11 +1513,10 @@ class BartPretrainedModel extends PreTrainedModel { }; * @hideconstructor * @extends BartPretrainedModel */ -class BartModel extends BartPretrainedModel { +export class BartModel extends BartPretrainedModel { /** * Throws an error because the current model class (BartModel) is not compatible with `.generate()`. * - * @async * @throws {Error} The current model class (BartModel) is not compatible with `.generate()`. * @returns {Promise} */ @@ -1389,13 +1531,13 @@ class BartModel extends BartPretrainedModel { * BART model with a language model head for conditional generation. * @extends BartPretrainedModel */ -class BartForConditionalGeneration extends BartPretrainedModel { +export class BartForConditionalGeneration extends BartPretrainedModel { /** * Creates a new instance of the `BartForConditionalGeneration` class. - * @param {object} config - The configuration object for the Bart model. - * @param {object} session - The ONNX session used to execute the model. - * @param {object} decoder_merged_session - The ONNX session used to execute the decoder. - * @param {object} generation_config - The generation configuration object. + * @param {Object} config The configuration object for the Bart model. + * @param {Object} session The ONNX session used to execute the model. + * @param {Object} decoder_merged_session The ONNX session used to execute the decoder. + * @param {Object} generation_config The generation configuration object. */ constructor(config, session, decoder_merged_session, generation_config) { super(config, session); @@ -1410,24 +1552,40 @@ class BartForConditionalGeneration extends BartPretrainedModel { this.num_encoder_heads = this.config.encoder_attention_heads; this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads; } - /** - * Loads a BartForConditionalGeneration instance from a pretrained model stored on disk. - * @param {string} modelPath - The path to the directory containing the pretrained model. - * @param {function} [progressCallback=null] - An optional callback function to track the download progress. - * @returns {Promise} - The pretrained BartForConditionalGeneration instance. - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `BartForConditionalGeneration` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await seq2seqLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + // @ts-ignore return new this(...info); } /** * Returns the initial beam for generating output text. - * @param {object} inputs - The input object containing the encoded input text. - * @param {number} numOutputTokens - The maximum number of output tokens to generate. - * @param {...any} args - Additional arguments to pass to the sequence-to-sequence generation function. - * @returns {any} - The initial beam for generating output text. + * @param {Object} inputs The input object containing the encoded input text. + * @param {number} numOutputTokens The maximum number of output tokens to generate. + * @param {...any} args Additional arguments to pass to the sequence-to-sequence generation function. + * @returns {any} The initial beam for generating output text. */ getStartBeams(inputs, numOutputTokens, ...args) { return seq2seqStartBeams(this, inputs, numOutputTokens); @@ -1435,8 +1593,8 @@ class BartForConditionalGeneration extends BartPretrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await seq2seqRunBeam(this, beam); @@ -1444,8 +1602,8 @@ class BartForConditionalGeneration extends BartPretrainedModel { /** * Updates the beam by appending the newly generated token ID to the list of output token IDs. - * @param {any} beam - The current beam being generated. - * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs. + * @param {any} beam The current beam being generated. + * @param {number} newTokenId The ID of the newly generated token to append to the list of output token IDs. */ updateBeam(beam, newTokenId) { beam.output_token_ids = [...beam.output_token_ids, newTokenId]; @@ -1453,8 +1611,7 @@ class BartForConditionalGeneration extends BartPretrainedModel { /** * Runs the forward pass of the model for a given set of inputs. - * @async - * @param {Object} model_inputs - The model inputs. + * @param {Object} model_inputs The model inputs. * @returns {Promise} The model output. */ async forward(model_inputs) { @@ -1462,12 +1619,12 @@ class BartForConditionalGeneration extends BartPretrainedModel { } } -class BartForSequenceClassification extends BartPretrainedModel { +export class BartForSequenceClassification extends BartPretrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - An object containing the model's output logits for sequence classification. + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} An object containing the model's output logits for sequence classification. */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1479,19 +1636,19 @@ class BartForSequenceClassification extends BartPretrainedModel { ////////////////////////////////////////////////// // Roberta models -class RobertaPreTrainedModel extends PreTrainedModel { } -class RobertaModel extends RobertaPreTrainedModel { } +export class RobertaPreTrainedModel extends PreTrainedModel { } +export class RobertaModel extends RobertaPreTrainedModel { } /** * RobertaForMaskedLM class for performing masked language modeling on Roberta models. * @extends RobertaPreTrainedModel */ -class RobertaForMaskedLM extends RobertaPreTrainedModel { +export class RobertaForMaskedLM extends RobertaPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1503,12 +1660,12 @@ class RobertaForMaskedLM extends RobertaPreTrainedModel { * RobertaForSequenceClassification class for performing sequence classification on Roberta models. * @extends RobertaPreTrainedModel */ -class RobertaForSequenceClassification extends RobertaPreTrainedModel { +export class RobertaForSequenceClassification extends RobertaPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let logits = (await super._call(model_inputs)).logits; @@ -1520,12 +1677,12 @@ class RobertaForSequenceClassification extends RobertaPreTrainedModel { * RobertaForQuestionAnswering class for performing question answering on Roberta models. * @extends RobertaPreTrainedModel */ -class RobertaForQuestionAnswering extends RobertaPreTrainedModel { +export class RobertaForQuestionAnswering extends RobertaPreTrainedModel { /** * Calls the model on new inputs. * - * @param {Object} model_inputs - The inputs to the model. - * @returns {Promise} - returned object + * @param {Object} model_inputs The inputs to the model. + * @returns {Promise} returned object */ async _call(model_inputs) { let outputs = await super._call(model_inputs); @@ -1536,13 +1693,13 @@ class RobertaForQuestionAnswering extends RobertaPreTrainedModel { ////////////////////////////////////////////////// // T5 models -class WhisperPreTrainedModel extends PreTrainedModel { }; +export class WhisperPreTrainedModel extends PreTrainedModel { }; /** * WhisperModel class for training Whisper models without a language model head. * @extends WhisperPreTrainedModel */ -class WhisperModel extends WhisperPreTrainedModel { +export class WhisperModel extends WhisperPreTrainedModel { /** * Throws an error when attempting to generate output since this model doesn't have a language model head. * @throws Error @@ -1560,13 +1717,13 @@ class WhisperModel extends WhisperPreTrainedModel { * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models. * @extends WhisperPreTrainedModel */ -class WhisperForConditionalGeneration extends WhisperPreTrainedModel { +export class WhisperForConditionalGeneration extends WhisperPreTrainedModel { /** * Creates a new instance of the `WhisperForConditionalGeneration` class. - * @param {Object} config - Configuration object for the model. - * @param {Object} session - ONNX Session object for the model. - * @param {Object} decoder_merged_session - ONNX Session object for the decoder. - * @param {Object} generation_config - Configuration object for the generation process. + * @param {Object} config Configuration object for the model. + * @param {Object} session ONNX Session object for the model. + * @param {Object} decoder_merged_session ONNX Session object for the decoder. + * @param {Object} generation_config Configuration object for the generation process. */ constructor(config, session, decoder_merged_session, generation_config) { super(config, session); @@ -1586,9 +1743,9 @@ class WhisperForConditionalGeneration extends WhisperPreTrainedModel { /** * Generates outputs based on input and generation configuration. - * @param {Object} inputs - Input data for the model. - * @param {Object} generation_config - Configuration object for the generation process. - * @param {Object} logits_processor - Optional logits processor object. + * @param {Object} inputs Input data for the model. + * @param {Object} generation_config Configuration object for the generation process. + * @param {Object} logits_processor Optional logits processor object. * @returns {Promise} Promise object represents the generated outputs. */ async generate( @@ -1613,20 +1770,37 @@ class WhisperForConditionalGeneration extends WhisperPreTrainedModel { } /** - * Loads a pre-trained model from a saved model directory. - * @param {string} modelPath - Path to the saved model directory. - * @param {function} progressCallback - Optional function for tracking loading progress. - * @returns {Promise} Promise object represents the loaded model. - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `WhisperForConditionalGeneration` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await seq2seqLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + // @ts-ignore return new this(...info); } /** * Gets the start beams for generating outputs. - * @param {Array} inputTokenIds - Array of input token IDs. - * @param {number} numOutputTokens - Number of output tokens to generate. + * @param {Array} inputTokenIds Array of input token IDs. + * @param {number} numOutputTokens Number of output tokens to generate. * @returns {Array} Array of start beams. */ getStartBeams(inputTokenIds, numOutputTokens, ...args) { @@ -1636,8 +1810,8 @@ class WhisperForConditionalGeneration extends WhisperPreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await seq2seqRunBeam(this, beam, { @@ -1647,8 +1821,8 @@ class WhisperForConditionalGeneration extends WhisperPreTrainedModel { /** * Updates the beam by appending the newly generated token ID to the list of output token IDs. - * @param {any} beam - The current beam being generated. - * @param {number} newTokenId - The ID of the newly generated token to append to the list of output token IDs. + * @param {any} beam The current beam being generated. + * @param {number} newTokenId The ID of the newly generated token to append to the list of output token IDs. */ updateBeam(beam, newTokenId) { beam.output_token_ids = [...beam.output_token_ids, newTokenId]; @@ -1656,8 +1830,7 @@ class WhisperForConditionalGeneration extends WhisperPreTrainedModel { /** * Runs the forward pass of the model for a given set of inputs. - * @async - * @param {Object} model_inputs - The model inputs. + * @param {Object} model_inputs The model inputs. * @returns {Promise} The model output. */ async forward(model_inputs) { @@ -1673,12 +1846,12 @@ class WhisperForConditionalGeneration extends WhisperPreTrainedModel { * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks * @extends PreTrainedModel */ -class VisionEncoderDecoderModel extends PreTrainedModel { +export class VisionEncoderDecoderModel extends PreTrainedModel { /** * Creates a new instance of the `VisionEncoderDecoderModel` class. - * @param {object} config - The configuration object specifying the hyperparameters and other model settings. - * @param {object} session - The ONNX session containing the encoder model. - * @param {any} decoder_merged_session - The ONNX session containing the merged decoder model. + * @param {Object} config The configuration object specifying the hyperparameters and other model settings. + * @param {Object} session The ONNX session containing the encoder model. + * @param {any} decoder_merged_session The ONNX session containing the merged decoder model. */ constructor(config, session, decoder_merged_session) { super(config, session); @@ -1690,35 +1863,39 @@ class VisionEncoderDecoderModel extends PreTrainedModel { } /** - * Loads a VisionEncoderDecoderModel from the given path. - * - * @param {string} modelPath - The path to the folder containing the saved model files. - * @param {function} [progressCallback=null] - Optional callback function to track the progress of model loading. - * @returns {Promise} A Promise that resolves with the loaded VisionEncoderDecoderModel instance. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session, decoder_merged_session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'encoder_model.onnx', progressCallback), - constructSession(modelPath, 'decoder_merged_session.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `VisionEncoderDecoderModel` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await encoderDecoderLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, }); - - return new this(config, session, decoder_merged_session); + // @ts-ignore + return new this(...info); } /** * Generate beam search outputs for the given input pixels and number of output tokens. * - * @param {array} inputs - The input pixels as a Tensor. - * @param {number} numOutputTokens - The number of output tokens to generate. - * @param {...*} args - Optional additional arguments to pass to seq2seqStartBeams. + * @param {array} inputs The input pixels as a Tensor. + * @param {number} numOutputTokens The number of output tokens to generate. + * @param {...*} args Optional additional arguments to pass to seq2seqStartBeams. * @returns {any} An array of Beam objects representing the top-K output sequences. */ getStartBeams(inputs, numOutputTokens, ...args) { @@ -1727,8 +1904,8 @@ class VisionEncoderDecoderModel extends PreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return seq2seqRunBeam(this, beam, { @@ -1739,8 +1916,8 @@ class VisionEncoderDecoderModel extends PreTrainedModel { /** * Update the given beam with the additional predicted token ID. * - * @param {any} beam - The current beam. - * @param {number} newTokenId - The new predicted token ID to add to the beam's output sequence. + * @param {any} beam The current beam. + * @param {number} newTokenId The new predicted token ID to add to the beam's output sequence. */ updateBeam(beam, newTokenId) { beam.output_token_ids = [...beam.output_token_ids, newTokenId]; @@ -1749,7 +1926,7 @@ class VisionEncoderDecoderModel extends PreTrainedModel { /** * Compute the forward pass of the model on the given input tensors. * - * @param {object} model_inputs - The input tensors as an object with keys 'pixel_values' and 'decoder_input_ids'. + * @param {Object} model_inputs The input tensors as an object with keys 'pixel_values' and 'decoder_input_ids'. * @returns {Promise} The output tensor of the model. */ async forward(model_inputs) { @@ -1763,8 +1940,8 @@ class VisionEncoderDecoderModel extends PreTrainedModel { ////////////////////////////////////////////////// // CLIP models -class CLIPPreTrainedModel extends PreTrainedModel { } -class CLIPModel extends CLIPPreTrainedModel { +export class CLIPPreTrainedModel extends PreTrainedModel { } +export class CLIPModel extends CLIPPreTrainedModel { } @@ -1772,12 +1949,12 @@ class CLIPModel extends CLIPPreTrainedModel { ////////////////////////////////////////////////// // GPT2 models -class GPT2PreTrainedModel extends PreTrainedModel { } +export class GPT2PreTrainedModel extends PreTrainedModel { } /** * GPT2Model is not compatible with `.generate()`, as it doesn't have a language model head. * @extends GPT2PreTrainedModel */ -class GPT2Model extends GPT2PreTrainedModel { +export class GPT2Model extends GPT2PreTrainedModel { /** * * @param {...any} args @@ -1795,11 +1972,11 @@ class GPT2Model extends GPT2PreTrainedModel { * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks. * @extends GPT2PreTrainedModel */ -class GPT2LMHeadModel extends GPT2PreTrainedModel { +export class GPT2LMHeadModel extends GPT2PreTrainedModel { /** * Creates a new instance of the `GPT2LMHeadModel` class. - * @param {object} config - The configuration of the model. - * @param {any} session - The ONNX session containing the model weights. + * @param {Object} config The configuration of the model. + * @param {any} session The ONNX session containing the model weights. */ constructor(config, session) { super(config, session); @@ -1814,9 +1991,9 @@ class GPT2LMHeadModel extends GPT2PreTrainedModel { /** * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. + * @param {Tensor} inputTokenIds The input token ids. + * @param {number} numOutputTokens The number of tokens to be generated. + * @param {Tensor} inputs_attention_mask Optional input attention mask. * @returns {any} A Beam object representing the initialized beam. */ getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) { @@ -1825,8 +2002,8 @@ class GPT2LMHeadModel extends GPT2PreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await textgenRunBeam(this, beam); @@ -1834,8 +2011,8 @@ class GPT2LMHeadModel extends GPT2PreTrainedModel { /** * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. + * @param {any} beam The Beam object representing the beam. + * @param {number} newTokenId The new generated token id to be added to the beam. */ updateBeam(beam, newTokenId) { return textgenUpdatebeam(beam, newTokenId); @@ -1843,7 +2020,7 @@ class GPT2LMHeadModel extends GPT2PreTrainedModel { /** * Forward pass for the model. - * @param {object} model_inputs - The inputs for the model. + * @param {Object} model_inputs The inputs for the model. * @returns {Promise} The output tensor of the model. */ async forward(model_inputs) { @@ -1851,12 +2028,12 @@ class GPT2LMHeadModel extends GPT2PreTrainedModel { } } -// class GPT2ForSequenceClassification extends GPT2PreTrainedModel { +// export class GPT2ForSequenceClassification extends GPT2PreTrainedModel { // TODO // } ////////////////////////////////////////////////// -class GPTNeoPreTrainedModel extends PreTrainedModel { } -class GPTNeoModel extends GPTNeoPreTrainedModel { +export class GPTNeoPreTrainedModel extends PreTrainedModel { } +export class GPTNeoModel extends GPTNeoPreTrainedModel { /** * * @param {...any} args @@ -1870,11 +2047,11 @@ class GPTNeoModel extends GPTNeoPreTrainedModel { } } -class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { +export class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { /** * Creates a new instance of the `GPTNeoForCausalLM` class. - * @param {object} config - The configuration of the model. - * @param {any} session - The ONNX session containing the model weights. + * @param {Object} config The configuration of the model. + * @param {any} session The ONNX session containing the model weights. */ constructor(config, session) { super(config, session); @@ -1889,9 +2066,9 @@ class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { /** * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. + * @param {Tensor} inputTokenIds The input token ids. + * @param {number} numOutputTokens The number of tokens to be generated. + * @param {Tensor} inputs_attention_mask Optional input attention mask. * @returns {any} A Beam object representing the initialized beam. */ getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) { @@ -1900,8 +2077,8 @@ class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await textgenRunBeam(this, beam); @@ -1909,8 +2086,8 @@ class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { /** * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. + * @param {any} beam The Beam object representing the beam. + * @param {number} newTokenId The new generated token id to be added to the beam. */ updateBeam(beam, newTokenId) { return textgenUpdatebeam(beam, newTokenId); @@ -1918,7 +2095,7 @@ class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { /** * Forward pass for the model. - * @param {object} model_inputs - The inputs for the model. + * @param {Object} model_inputs The inputs for the model. * @returns {Promise} The output tensor of the model. */ async forward(model_inputs) { @@ -1928,20 +2105,20 @@ class GPTNeoForCausalLM extends GPTNeoPreTrainedModel { ////////////////////////////////////////////////// // CodeGen models -class CodeGenPreTrainedModel extends PreTrainedModel { } +export class CodeGenPreTrainedModel extends PreTrainedModel { } /** * CodeGenModel is a class representing a code generation model without a language model head. * * @extends CodeGenPreTrainedModel */ -class CodeGenModel extends CodeGenPreTrainedModel { +export class CodeGenModel extends CodeGenPreTrainedModel { /** * Throws an error indicating that the current model class is not compatible with `.generate()`, * as it doesn't have a language model head. * * @throws {Error} The current model class is not compatible with `.generate()` * - * @param {...any} args - Arguments passed to the generate function + * @param {...any} args Arguments passed to the generate function * @returns {Promise} */ async generate(...args) { @@ -1955,11 +2132,11 @@ class CodeGenModel extends CodeGenPreTrainedModel { * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class. * @extends CodeGenPreTrainedModel */ -class CodeGenForCausalLM extends CodeGenPreTrainedModel { +export class CodeGenForCausalLM extends CodeGenPreTrainedModel { /** * Creates a new instance of the `CodeGenForCausalLM` class. - * @param {object} config The model configuration object. - * @param {object} session The ONNX session object. + * @param {Object} config The model configuration object. + * @param {Object} session The ONNX session object. */ constructor(config, session) { super(config, session); @@ -1974,9 +2151,9 @@ class CodeGenForCausalLM extends CodeGenPreTrainedModel { /** * Initializes and returns the beam for text generation task - * @param {Tensor} inputTokenIds - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. - * @param {Tensor} inputs_attention_mask - Optional input attention mask. + * @param {Tensor} inputTokenIds The input token ids. + * @param {number} numOutputTokens The number of tokens to be generated. + * @param {Tensor} inputs_attention_mask Optional input attention mask. * @returns {any} A Beam object representing the initialized beam. */ getStartBeams(inputTokenIds, numOutputTokens, inputs_attention_mask) { @@ -1985,8 +2162,8 @@ class CodeGenForCausalLM extends CodeGenPreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await textgenRunBeam(this, beam); @@ -1994,8 +2171,8 @@ class CodeGenForCausalLM extends CodeGenPreTrainedModel { /** * Updates the given beam with the new generated token id. - * @param {any} beam - The Beam object representing the beam. - * @param {number} newTokenId - The new generated token id to be added to the beam. + * @param {any} beam The Beam object representing the beam. + * @param {number} newTokenId The new generated token id to be added to the beam. */ updateBeam(beam, newTokenId) { return textgenUpdatebeam(beam, newTokenId); @@ -2003,7 +2180,7 @@ class CodeGenForCausalLM extends CodeGenPreTrainedModel { /** * Forward pass for the model. - * @param {object} model_inputs - The inputs for the model. + * @param {Object} model_inputs The inputs for the model. * @returns {Promise} The output tensor of the model. */ async forward(model_inputs) { @@ -2014,8 +2191,8 @@ class CodeGenForCausalLM extends CodeGenPreTrainedModel { ////////////////////////////////////////////////// ////////////////////////////////////////////////// -class ViTPreTrainedModel extends PreTrainedModel { } -class ViTForImageClassification extends ViTPreTrainedModel { +export class ViTPreTrainedModel extends PreTrainedModel { } +export class ViTForImageClassification extends ViTPreTrainedModel { /** * @param {any} model_inputs */ @@ -2027,8 +2204,8 @@ class ViTForImageClassification extends ViTPreTrainedModel { ////////////////////////////////////////////////// ////////////////////////////////////////////////// -class DetrPreTrainedModel extends PreTrainedModel { } -class DetrForObjectDetection extends DetrPreTrainedModel { +export class DetrPreTrainedModel extends PreTrainedModel { } +export class DetrForObjectDetection extends DetrPreTrainedModel { /** * @param {any} model_inputs */ @@ -2038,11 +2215,11 @@ class DetrForObjectDetection extends DetrPreTrainedModel { } } -class DetrForSegmentation extends DetrPreTrainedModel { +export class DetrForSegmentation extends DetrPreTrainedModel { /** * Runs the model with the provided inputs - * @param {Object} model_inputs - Model inputs - * @returns {Promise} - Object containing segmentation outputs + * @param {Object} model_inputs Model inputs + * @returns {Promise} Object containing segmentation outputs */ async _call(model_inputs) { let output = (await super._call(model_inputs)); @@ -2050,10 +2227,10 @@ class DetrForSegmentation extends DetrPreTrainedModel { } } -class DetrObjectDetectionOutput extends ModelOutput { +export class DetrObjectDetectionOutput extends ModelOutput { /** - * @param {any} logits - * @param {any} pred_boxes + * @param {Tensor} logits + * @param {Tensor} pred_boxes */ constructor(logits, pred_boxes) { super(); @@ -2062,12 +2239,12 @@ class DetrObjectDetectionOutput extends ModelOutput { } } -class DetrSegmentationOutput extends ModelOutput { +export class DetrSegmentationOutput extends ModelOutput { /** - * @param {Tensor} logits - The output logits of the model. - * @param {Tensor} pred_boxes - Predicted boxes. - * @param {Tensor} pred_masks - Predicted masks. + * @param {Tensor} logits The output logits of the model. + * @param {Tensor} pred_boxes Predicted boxes. + * @param {Tensor} pred_masks Predicted masks. */ constructor(logits, pred_boxes, pred_masks) { super(); @@ -2079,11 +2256,47 @@ class DetrSegmentationOutput extends ModelOutput { ////////////////////////////////////////////////// +////////////////////////////////////////////////// +export class SamPreTrainedModel extends PreTrainedModel { } +export class SamModel extends SamPreTrainedModel { + /** + * @param {Object} model_inputs + * @param {Tensor} model_inputs.pixel_values Pixel values as a Tensor with shape `(batch_size, num_channels, height, width)`. + * @param {Tensor} model_inputs.input_points Input 2D spatial points with shape `(batch_size, num_points, 2)`. This is used by the prompt encoder to encode the prompt. + * @todo Add support for `input_labels`, `input_boxes`, `input_masks`, and `image_embeddings`. + */ + async _call(model_inputs) { + // TODO split into encoder and decoder + let output = (await super._call(model_inputs)); + return new SamImageSegmentationOutput(output.iou_scores, output.pred_masks); + } +} + + +/** + * Base class for Segment-Anything model's output. + * + * @extends ModelOutput + */ +export class SamImageSegmentationOutput extends ModelOutput { + /** + * @param {Tensor} iou_scores The output logits of the model. + * @param {Tensor} pred_masks Predicted boxes. + */ + constructor(iou_scores, pred_masks) { + super(); + this.iou_scores = iou_scores; + this.pred_masks = pred_masks; + } +} +////////////////////////////////////////////////// + + ////////////////////////////////////////////////// // MarianMT models -class MarianPreTrainedModel extends PreTrainedModel { }; +export class MarianPreTrainedModel extends PreTrainedModel { }; -class MarianModel extends MarianPreTrainedModel { +export class MarianModel extends MarianPreTrainedModel { /** * * @param {...any} args @@ -2092,16 +2305,16 @@ class MarianModel extends MarianPreTrainedModel { */ async generate(...args) { throw Error( - "The current model class (T5Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'T5ForConditionalGeneration'}" + "The current model class (MarianModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'MarianMTModel'}" ) } } -class MarianMTModel extends MarianPreTrainedModel { +export class MarianMTModel extends MarianPreTrainedModel { /** * Creates a new instance of the `MarianMTModel` class. - * @param {object} config The model configuration object. - * @param {object} session The ONNX session object. + * @param {Object} config The model configuration object. + * @param {Object} session The ONNX session object. * @param {any} decoder_merged_session * @param {any} generation_config */ @@ -2120,17 +2333,143 @@ class MarianMTModel extends MarianPreTrainedModel { } /** - * @param {string} modelPath + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `MarianMTModel` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await seq2seqLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + // @ts-ignore + return new this(...info); + } + + /** + * Initializes and returns the beam for text generation task + * @param {any[]} inputs The input token ids. + * @param {number} numOutputTokens The number of tokens to be generated. + * @returns {any} A Beam object representing the initialized beam. + * @param {any[]} args + */ + getStartBeams(inputs, numOutputTokens, ...args) { + return seq2seqStartBeams(this, inputs, numOutputTokens); + } + + /** + * Runs a single step of the beam search generation algorithm. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. + */ + async runBeam(beam) { + return await seq2seqRunBeam(this, beam); + } + + /** + * @param {any} beam + * @param {any} newTokenId + */ + updateBeam(beam, newTokenId) { + beam.output_token_ids = [...beam.output_token_ids, newTokenId]; + } + + /** + * @param {any} model_inputs + * @returns {Promise} + */ + async forward(model_inputs) { + return await seq2seq_forward(this, model_inputs); + } +} +////////////////////////////////////////////////// + +////////////////////////////////////////////////// +// M2M100 models +export class M2M100PreTrainedModel extends PreTrainedModel { }; + +export class M2M100Model extends M2M100PreTrainedModel { + /** + * + * @param {...any} args + * @throws {Error} + * @returns {Promise} */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); + async generate(...args) { + throw Error( + "The current model class (M2M100Model) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'M2M100ForConditionalGeneration'}" + ) + } +} + +export class M2M100ForConditionalGeneration extends M2M100PreTrainedModel { + /** + * Creates a new instance of the `M2M100ForConditionalGeneration` class. + * @param {Object} config The model configuration object. + * @param {Object} session The ONNX session object. + * @param {any} decoder_merged_session + * @param {any} generation_config + */ + constructor(config, session, decoder_merged_session, generation_config) { + super(config, session); + this.decoder_merged_session = decoder_merged_session; + this.generation_config = generation_config; + + this.num_decoder_layers = this.config.decoder_layers; + this.num_decoder_heads = this.config.decoder_attention_heads; + this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads; + + this.num_encoder_layers = this.config.encoder_layers; + this.num_encoder_heads = this.config.encoder_attention_heads; + this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads; + } + + /** + * Loads a pre-trained model from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained model. + * @param {PretrainedOptions} options Additional options for loading the model. For more information, @see {@link PreTrainedModel.from_pretrained}. + * + * @returns {Promise} A new instance of the `M2M100ForConditionalGeneration` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + let info = await seq2seqLoadModel(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + // @ts-ignore return new this(...info); } /** * Initializes and returns the beam for text generation task - * @param {any[]} inputs - The input token ids. - * @param {number} numOutputTokens - The number of tokens to be generated. + * @param {any[]} inputs The input token ids. + * @param {number} numOutputTokens The number of tokens to be generated. * @returns {any} A Beam object representing the initialized beam. * @param {any[]} args */ @@ -2140,8 +2479,8 @@ class MarianMTModel extends MarianPreTrainedModel { /** * Runs a single step of the beam search generation algorithm. - * @param {any} beam - The current beam being generated. - * @returns {Promise} - The updated beam after a single generation step. + * @param {any} beam The current beam being generated. + * @returns {Promise} The updated beam after a single generation step. */ async runBeam(beam) { return await seq2seqRunBeam(this, beam); @@ -2169,11 +2508,87 @@ class MarianMTModel extends MarianPreTrainedModel { ////////////////////////////////////////////////// // AutoModels, used to simplify construction of PreTrainedModels // (uses config to instantiate correct class) + +/** + * Base class of all AutoModels. Contains the `from_pretrained` function + * which is used to instantiate pretrained models. + */ +export class PretrainedMixin { + /** + * Mapping from model type to model class. + */ + static MODEL_CLASS_MAPPING = Object.create(null); + + /** + * Whether to attempt to instantiate the base class (`PretrainedModel`) if + * the model type is not found in the mapping. + */ + static BASE_IF_FAIL = false; + + /** + * The function to use to load the pretrained model. + */ + static LOAD_FUNCTION = null; + + /** + * Instantiate one of the model classes of the library from a pretrained model. + * + * The model class to instantiate is selected based on the `model_type` property of the config object + * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible) + * + * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either: + * - A string, the *model id* of a pretrained model hosted inside a model repo on huggingface.co. + * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a + * user or organization name, like `dbmdz/bert-base-german-cased`. + * - A path to a *directory* containing model weights, e.g., `./my_model_directory/`. + * @param {PretrainedOptions} options Additional options for loading the model. + * + * @returns {Promise} A new instance of the PreTrainedModel class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + if (this.LOAD_FUNCTION === null) { + throw new Error("`LOAD_FUNCTION` not implemented for this model"); + } + + let info = await this.LOAD_FUNCTION(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }); + + let cls = this.MODEL_CLASS_MAPPING[info[0].model_type]; + if (!cls) { + if (this.BASE_IF_FAIL) { + console.warn(`Unknown model class "${info[0].model_type}", attempting to construct from base class.`); + cls = PreTrainedModel; + } else { + throw Error(`Unsupported model type: ${info[0].model_type}`) + } + } + return new cls(...info); + } +} + /** - * Helper class to determine model type from config + * Helper class which is used to instantiate pretrained models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModel.from_pretrained('bert-base-uncased'); */ -class AutoModel { - // Helper class to determine model type from config +export class AutoModel extends PretrainedMixin { + static LOAD_FUNCTION = loadAutoModel; + static BASE_IF_FAIL = true; static MODEL_CLASS_MAPPING = { 'bert': BertModel, 'albert': AlbertModel, @@ -2190,41 +2605,20 @@ class AutoModel { 'mobilebert': MobileBertModel, 'squeezebert': SqueezeBertModel, 'marian': MarianModel, - } - - /** - * Instantiates a pre-trained model based on the given model path and config. - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} progressCallback - Optional. A callback function that can be used to track loading progress. - * @returns {Promise} - A promise that resolves to an instance of a pre-trained model. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let config = await fetchJSON(modelPath, 'config.json', progressCallback); - let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx'; - - let session = await constructSession(modelPath, modelName, progressCallback); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - console.warn(`Unknown model class "${config.model_type}", attempting to construct from base class.`); - cls = PreTrainedModel; - } - return new cls(config, session) + 'm2m_100': M2M100Model, + 'sam': SamModel, } } /** - * Helper class for loading sequence classification models from pretrained checkpoints + * Helper class which is used to instantiate pretrained sequence classification models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForSequenceClassification.from_pretrained('distilbert-base-uncased-finetuned-sst-2-english'); */ -class AutoModelForSequenceClassification { - +export class AutoModelForSequenceClassification extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; static MODEL_CLASS_MAPPING = { 'bert': BertForSequenceClassification, 'albert': AlbertForSequenceClassification, @@ -2234,149 +2628,68 @@ class AutoModelForSequenceClassification { 'mobilebert': MobileBertForSequenceClassification, 'squeezebert': SqueezeBertForSequenceClassification, } - - /** - * Load a sequence classification model from a pretrained checkpoint - * @param {string} modelPath - The path to the model checkpoint directory - * @param {function} [progressCallback=null] - An optional callback function to receive progress updates - * @returns {Promise} A promise that resolves to a pre-trained sequence classification model - * @throws {Error} if an unsupported model type is encountered - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback) - ]); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } } - /** - * Helper class for loading token classification models from pretrained checkpoints + * Helper class which is used to instantiate pretrained token classification models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForTokenClassification.from_pretrained('Davlan/distilbert-base-multilingual-cased-ner-hrl'); */ -class AutoModelForTokenClassification { - +export class AutoModelForTokenClassification extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; static MODEL_CLASS_MAPPING = { 'bert': BertForTokenClassification, 'distilbert': DistilBertForTokenClassification, } - - /** - * Load a token classification model from a pretrained checkpoint - * @param {string} modelPath - The path to the model checkpoint directory - * @param {function} [progressCallback=null] - An optional callback function to receive progress updates - * @returns {Promise} A promise that resolves to a pre-trained token classification model - * @throws {Error} if an unsupported model type is encountered - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback) - ]); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } } /** - * Class representing an automatic sequence-to-sequence language model. + * Helper class which is used to instantiate pretrained sequence-to-sequence models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForSeq2SeqLM.from_pretrained('t5-small'); */ -class AutoModelForSeq2SeqLM { +export class AutoModelForSeq2SeqLM extends PretrainedMixin { + static LOAD_FUNCTION = seq2seqLoadModel; static MODEL_CLASS_MAPPING = { 't5': T5ForConditionalGeneration, 'mt5': MT5ForConditionalGeneration, 'bart': BartForConditionalGeneration, 'whisper': WhisperForConditionalGeneration, 'marian': MarianMTModel, - } - - /** - * Loads a pretrained sequence-to-sequence language model from a file path. - * @param {string} modelPath - The path to the model files. - * @param {function} [progressCallback=null] - A callback function to track loading progress. - * @returns {Promise} A Promise that resolves to an instance of the appropriate model class. - * @throws {Error} If the model type is unsupported. - * @static - */ - static async from_pretrained(modelPath, progressCallback = null) { - let info = await seq2seqLoadModel(modelPath, progressCallback); - let config = info[0]; - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(...info) + 'm2m_100': M2M100ForConditionalGeneration, } } /** - * A class for loading pre-trained models for causal language modeling tasks. + * Helper class which is used to instantiate pretrained causal language models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForCausalLM.from_pretrained('gpt2'); */ -class AutoModelForCausalLM { +export class AutoModelForCausalLM extends PretrainedMixin { + static LOAD_FUNCTION = decoderLoadModel; static MODEL_CLASS_MAPPING = { 'gpt2': GPT2LMHeadModel, 'gpt_neo': GPTNeoForCausalLM, 'codegen': CodeGenForCausalLM, } - - /** - * Loads a pre-trained model from the given path and returns an instance of the appropriate class. - * @param {string} modelPath - The path to the pre-trained model. - * @param {function} [progressCallback=null] - An optional callback function to track the progress of the loading process. - * @returns {Promise} An instance of the appropriate class for the loaded model. - * @throws {Error} If the loaded model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback) - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - - } } /** - * A class to automatically select the appropriate model for Masked Language Modeling (MLM) tasks. + * Helper class which is used to instantiate pretrained masked language models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForMaskedLM.from_pretrained('bert-base-uncased'); */ -class AutoModelForMaskedLM { +export class AutoModelForMaskedLM extends PretrainedMixin { + static LOAD_FUNCTION = loadAutoModel; static MODEL_CLASS_MAPPING = { 'bert': BertForMaskedLM, 'albert': AlbertForMaskedLM, @@ -2385,41 +2698,17 @@ class AutoModelForMaskedLM { 'mobilebert': MobileBertForMaskedLM, 'squeezebert': SqueezeBertForMaskedLM, } - - /** - * Loads a pre-trained model from a given directory and returns an instance of the appropriate model class. - * - * @async - * @param {string} modelPath - The path to the pre-trained model directory. - * @param {function} [progressCallback=null] - An optional callback function to track the loading progress. - * @returns {Promise} An instance of the appropriate model class for MLM tasks. - * @throws {Error} If an unsupported model type is encountered. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let config = await fetchJSON(modelPath, 'config.json', progressCallback); - let modelName = config.is_encoder_decoder ? 'encoder_model.onnx' : 'model.onnx'; - - let session = await constructSession(modelPath, modelName, progressCallback); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } } /** - * Automatic model class for question answering tasks. + * Helper class which is used to instantiate pretrained question answering models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForQuestionAnswering.from_pretrained('distilbert-base-cased-distilled-squad'); */ -class AutoModelForQuestionAnswering { +export class AutoModelForQuestionAnswering extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; static MODEL_CLASS_MAPPING = { 'bert': BertForQuestionAnswering, 'albert': AlbertForQuestionAnswering, @@ -2428,191 +2717,85 @@ class AutoModelForQuestionAnswering { 'mobilebert': MobileBertForQuestionAnswering, 'squeezebert': SqueezeBertForQuestionAnswering, } - - /** - * Loads and returns a question answering model from a pretrained model path. - * @param {string} modelPath - The path to the pretrained model. - * @param {function} [progressCallback=null] - Optional callback function to track loading progress. - * @returns {Promise} - The loaded question answering model. - * @throws Will throw an error if an unsupported model type is encountered. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback) - ]); - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } } /** - * Class representing an autoencoder-decoder model for vision-to-sequence tasks. + * Helper class which is used to instantiate pretrained vision-to-sequence models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForVision2Seq.from_pretrained('nlpconnect/vit-gpt2-image-captioning'); */ -class AutoModelForVision2Seq { +export class AutoModelForVision2Seq extends PretrainedMixin { + static LOAD_FUNCTION = encoderDecoderLoadModel; static MODEL_CLASS_MAPPING = { 'vision-encoder-decoder': VisionEncoderDecoderModel } - - /** - * Loads a pretrained model from a given path. - * @param {string} modelPath - The path to the pretrained model. - * @param {function} progressCallback - Optional callback function to track progress of the model loading. - * @returns {Promise} - A Promise that resolves to a new instance of VisionEncoderDecoderModel. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session, decoder_merged_session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'encoder_model.onnx', progressCallback), - constructSession(modelPath, 'decoder_model_merged.onnx', progressCallback) - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session, decoder_merged_session); - - } } -////////////////////////////////////////////////// /** - * AutoModelForImageClassification is a class for loading pre-trained image classification models from ONNX format. + * Helper class which is used to instantiate pretrained image classification models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForImageClassification.from_pretrained('google/vit-base-patch16-224'); */ -class AutoModelForImageClassification { +export class AutoModelForImageClassification extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; static MODEL_CLASS_MAPPING = { 'vit': ViTForImageClassification, } - - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } } -////////////////////////////////////////////////// - -////////////////////////////////////////////////// /** - * AutoModelForImageSegmentation is a class for loading pre-trained image classification models from ONNX format. + * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForImageSegmentation.from_pretrained('facebook/detr-resnet-50-panoptic'); */ -class AutoModelForImageSegmentation { +export class AutoModelForImageSegmentation extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; static MODEL_CLASS_MAPPING = { 'detr': DetrForSegmentation, } - - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); - } } -////////////////////////////////////////////////// - -////////////////////////////////////////////////// -class AutoModelForObjectDetection { +/** + * Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForObjectDetection.from_pretrained('facebook/detr-resnet-50'); + */ +export class AutoModelForObjectDetection extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; static MODEL_CLASS_MAPPING = { 'detr': DetrForObjectDetection, } +} - /** - * Loads a pre-trained image classification model from a given directory path. - * @param {string} modelPath - The path to the directory containing the pre-trained model. - * @param {function} [progressCallback=null] - A callback function to monitor the loading progress. - * @returns {Promise} A Promise that resolves with the model. - * @throws {Error} If the specified model type is not supported. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let [config, session] = await Promise.all([ - fetchJSON(modelPath, 'config.json', progressCallback), - constructSession(modelPath, 'model.onnx', progressCallback), - ]) - - // Called when all parts are loaded - dispatchCallback(progressCallback, { - status: 'loaded', - name: modelPath - }); - - let cls = this.MODEL_CLASS_MAPPING[config.model_type]; - if (!cls) { - throw Error(`Unsupported model type: ${config.model_type}`) - } - return new cls(config, session); +/** + * Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function. + * The chosen model class is determined by the type specified in the model config. + * + * @example + * let model = await AutoModelForMaskGeneration.from_pretrained('Xenova/sam-vit-base'); + */ +export class AutoModelForMaskGeneration extends PretrainedMixin { + static LOAD_FUNCTION = loadModel; + static MODEL_CLASS_MAPPING = { + 'sam': SamModel, } } ////////////////////////////////////////////////// ////////////////////////////////////////////////// -class Seq2SeqLMOutput extends ModelOutput { +export class Seq2SeqLMOutput extends ModelOutput { /** - * @param {Tensor} logits - The output logits of the model. - * @param {Array} past_key_values - An array of key/value pairs that represent the previous state of the model. - * @param {Tensor} encoder_outputs - The output of the encoder in a sequence-to-sequence model. + * @param {Tensor} logits The output logits of the model. + * @param {Tensor} past_key_values An tensor of key/value pairs that represent the previous state of the model. + * @param {Tensor} encoder_outputs The output of the encoder in a sequence-to-sequence model. */ constructor(logits, past_key_values, encoder_outputs) { super(); @@ -2622,7 +2805,7 @@ class Seq2SeqLMOutput extends ModelOutput { } } -class SequenceClassifierOutput extends ModelOutput { +export class SequenceClassifierOutput extends ModelOutput { /** * @param {Tensor} logits */ @@ -2632,7 +2815,7 @@ class SequenceClassifierOutput extends ModelOutput { } } -class TokenClassifierOutput extends ModelOutput { +export class TokenClassifierOutput extends ModelOutput { /** * @param {Tensor} logits */ @@ -2643,7 +2826,7 @@ class TokenClassifierOutput extends ModelOutput { } -class MaskedLMOutput extends ModelOutput { +export class MaskedLMOutput extends ModelOutput { /** * @param {Tensor} logits */ @@ -2653,10 +2836,10 @@ class MaskedLMOutput extends ModelOutput { } } -class QuestionAnsweringModelOutput extends ModelOutput { +export class QuestionAnsweringModelOutput extends ModelOutput { /** - * @param {Float32Array} start_logits - The logits for start positions of the answer. - * @param {Float32Array} end_logits - The logits for end positions of the answer. + * @param {Tensor} start_logits The logits for start positions of the answer. + * @param {Tensor} end_logits The logits for end positions of the answer. */ constructor(start_logits, end_logits) { super(); @@ -2664,17 +2847,3 @@ class QuestionAnsweringModelOutput extends ModelOutput { this.end_logits = end_logits; } } - -module.exports = { - AutoModel, - AutoModelForSeq2SeqLM, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForCausalLM, - AutoModelForMaskedLM, - AutoModelForQuestionAnswering, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForObjectDetection, - AutoModelForImageSegmentation, -}; diff --git a/src/pipelines.js b/src/pipelines.js index b90484b96..121d6b14c 100644 --- a/src/pipelines.js +++ b/src/pipelines.js @@ -1,19 +1,23 @@ -const { - Callable, - softmax, - indexOfMax, - getTopItems, - cos_sim, - pathJoin, - isString, - getFile, - dot -} = require("./utils.js"); +/** + * @file Pipelines provide a high-level, easy to use, API for running machine learning models. + * + * **Example:** Instantiate pipeline using the `pipeline` function. + * ```javascript + * import { pipeline } from '@xenova/transformers'; + * + * let pipeline = await pipeline('sentiment-analysis'); + * let result = await pipeline('I love transformers!'); + * // [{'label': 'POSITIVE', 'score': 0.999817686}] + * ``` + * + * @module pipelines + */ -const { - AutoTokenizer -} = require("./tokenizers.js"); -const { +import { + AutoTokenizer, + PreTrainedTokenizer, +} from './tokenizers.js'; +import { AutoModel, AutoModelForSequenceClassification, AutoModelForTokenClassification, @@ -24,26 +28,38 @@ const { AutoModelForVision2Seq, AutoModelForImageClassification, AutoModelForImageSegmentation, - AutoModelForObjectDetection -} = require("./models.js"); -const { + AutoModelForObjectDetection, + PreTrainedModel, +} from './models.js'; +import { AutoProcessor, Processor -} = require("./processors.js"); - +} from './processors.js'; -const { - env -} = require('./env.js'); -const { Tensor, transpose_data } = require("./tensor_utils.js"); -const { CustomImage } = require("./image_utils.js"); +import { + Callable, + isString, + dispatchCallback, +} from './utils/core.js'; +import { + softmax, + max, + getTopItems, + cos_sim, + dot +} from './utils/maths.js'; +import { + read_audio +} from './utils/audio.js'; +import { Tensor } from './utils/tensor.js'; +import { CustomImage } from './utils/image.js'; /** * Prepare images for further tasks. - * @param {any[]} images - images to prepare. - * @returns {Promise} - returns processed images. - * @async + * @param {any[]} images images to prepare. + * @returns {Promise} returns processed images. + * @private */ async function prepareImages(images) { if (!Array.isArray(images)) { @@ -56,15 +72,16 @@ async function prepareImages(images) { } /** - * Pipeline class for executing a natural language processing task. + * The Pipeline class is the class from which all pipelines inherit. + * Refer to this class for methods shared across different pipelines. * @extends Callable */ -class Pipeline extends Callable { +export class Pipeline extends Callable { /** - * Creates a new instance of Pipeline. - * @param {string} task - The natural language processing task to be performed. - * @param {object} tokenizer - The tokenizer object to be used for tokenizing input texts. - * @param {object} model - The model object to be used for processing input texts. + * Create a new Pipeline. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedTokenizer} tokenizer The tokenizer to use. + * @param {PreTrainedModel} model The model to use. */ constructor(task, tokenizer, model) { super(); @@ -75,16 +92,16 @@ class Pipeline extends Callable { /** * Disposes the model. - * @returns {Promise} - A promise that resolves when the model has been disposed. + * @returns {Promise} A promise that resolves when the model has been disposed. */ async dispose() { - return await this.model.dispose(); + await this.model.dispose(); } /** - * Executes the natural language processing task. - * @param {any} texts - The input texts to be processed. - * @returns {Promise} - A promise that resolves to an array containing the inputs and outputs of the task. + * Executes the task associated with the pipeline. + * @param {any} texts The input texts to be processed. + * @returns {Promise} A promise that resolves to an array containing the inputs and outputs of the task. */ async _call(texts) { // Run tokenization @@ -101,16 +118,16 @@ class Pipeline extends Callable { } /** - * TextClassificationPipeline class for executing a text classification task. + * Text classification pipeline using any `ModelForSequenceClassification`. * @extends Pipeline */ -class TextClassificationPipeline extends Pipeline { +export class TextClassificationPipeline extends Pipeline { /** * Executes the text classification task. - * @param {any} texts - The input texts to be classified. - * @param {object} options - An optional object containing the following properties: - * @param {number} [options.topk=1] - The number of top predictions to be returned. - * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores. + * @param {any} texts The input texts to be classified. + * @param {Object} options An optional object containing the following properties: + * @param {number} [options.topk=1] The number of top predictions to be returned. + * @returns {Promise} A promise that resolves to an array or object containing the predicted labels and scores. */ async _call(texts, { topk = 1 @@ -142,15 +159,15 @@ class TextClassificationPipeline extends Pipeline { /** - * TokenClassificationPipeline class for executing a token classification task. + * Named Entity Recognition pipeline using any `ModelForTokenClassification`. * @extends Pipeline */ -class TokenClassificationPipeline extends Pipeline { +export class TokenClassificationPipeline extends Pipeline { /** * Executes the token classification task. - * @param {any} texts - The input texts to be classified. - * @param {object} options - An optional object containing the following properties: - * @returns {Promise} - A promise that resolves to an array or object containing the predicted labels and scores. + * @param {any} texts The input texts to be classified. + * @param {Object} options An optional object containing the following properties: + * @returns {Promise} A promise that resolves to an array or object containing the predicted labels and scores. */ async _call(texts, { ignore_labels = ['O'], // TODO init param? @@ -170,14 +187,14 @@ class TokenClassificationPipeline extends Pipeline { let toReturn = []; for (let i = 0; i < logits.dims[0]; ++i) { - let ids = inputs.input_ids.get(i); - let batch = logits.get(i); + let ids = inputs.input_ids[i]; + let batch = logits[i]; // List of tokens that aren't ignored let tokens = []; for (let j = 0; j < batch.dims[0]; ++j) { - let tokenData = batch.get(j); - let topScoreIndex = indexOfMax(tokenData.data); + let tokenData = batch[j]; + let topScoreIndex = max(tokenData.data)[1]; let entity = id2label[topScoreIndex]; if (ignore_labels.includes(entity)) { @@ -186,7 +203,7 @@ class TokenClassificationPipeline extends Pipeline { } // TODO add option to keep special tokens? - let word = tokenizer.decode([ids.get(j)], { skip_special_tokens: true }); + let word = tokenizer.decode([ids[j].item()], { skip_special_tokens: true }); if (word === '') { // Was a special token. So, we skip it. continue; @@ -211,19 +228,19 @@ class TokenClassificationPipeline extends Pipeline { } } /** - * QuestionAnsweringPipeline class for executing a question answering task. + * Question Answering pipeline using any `ModelForQuestionAnswering`. * @extends Pipeline */ -class QuestionAnsweringPipeline extends Pipeline { +export class QuestionAnsweringPipeline extends Pipeline { /** * Executes the question answering task. - * @param {string|string[]} question - The question(s) to be answered. - * @param {string|string[]} context - The context(s) where the answer(s) can be found. - * @param {object} options - An optional object containing the following properties: - * @param {number} [options.topk=1] - The number of top answer predictions to be returned. - * @todo fix error below - * @returns {Promise} - A promise that resolves to an array or object containing the predicted answers and scores. + * @param {string|string[]} question The question(s) to be answered. + * @param {string|string[]} context The context(s) where the answer(s) can be found. + * @param {Object} options An optional object containing the following properties: + * @param {number} [options.topk=1] The number of top answer predictions to be returned. + * @returns {Promise} A promise that resolves to an array or object containing the predicted answers and scores. */ + // @ts-ignore async _call(question, context, { topk = 1 } = {}) { @@ -236,13 +253,13 @@ class QuestionAnsweringPipeline extends Pipeline { let toReturn = []; for (let j = 0; j < output.start_logits.dims[0]; ++j) { - let ids = inputs.input_ids.get(j); + let ids = inputs.input_ids[j]; let sepIndex = ids.indexOf(this.tokenizer.sep_token_id); - let s1 = Array.from(softmax(output.start_logits.get(j).data)) + let s1 = Array.from(softmax(output.start_logits[j].data)) .map((x, i) => [x, i]) .filter(x => x[1] > sepIndex); - let e1 = Array.from(softmax(output.end_logits.get(j).data)) + let e1 = Array.from(softmax(output.end_logits[j].data)) .map((x, i) => [x, i]) .filter(x => x[1] > sepIndex); @@ -275,18 +292,20 @@ class QuestionAnsweringPipeline extends Pipeline { } /** - * Class representing a fill-mask pipeline for natural language processing. + * Masked language modeling prediction pipeline using any `ModelWithLMHead`. * @extends Pipeline */ -class FillMaskPipeline extends Pipeline { +export class FillMaskPipeline extends Pipeline { /** - * @param {any} texts + * Fill the masked token in the text(s) given as inputs. + * @param {any} texts The masked input texts. + * @param {Object} options An optional object containing the following properties: + * @param {number} [options.topk=5] The number of top predictions to be returned. + * @returns {Promise} A promise that resolves to an array or object containing the predicted tokens and scores. */ async _call(texts, { topk = 5 } = {}) { - // Fill the masked token in the text(s) given as inputs. - // Run tokenization let [inputs, outputs] = await super._call(texts); @@ -300,14 +319,14 @@ class FillMaskPipeline extends Pipeline { let toReturn = []; for (let i = 0; i < inputs.input_ids.dims[0]; ++i) { - let ids = inputs.input_ids.get(i); + let ids = inputs.input_ids[i]; let mask_token_index = ids.indexOf(this.tokenizer.mask_token_id) if (mask_token_index === -1) { throw Error(`Mask token (${tokenizer.mask_token}) not found in text.`) } - let logits = outputs.logits.get(i); - let itemLogits = logits.get(mask_token_index); + let logits = outputs.logits[i]; + let itemLogits = logits[mask_token_index]; let scores = getTopItems(softmax(itemLogits.data), topk); @@ -331,15 +350,14 @@ class FillMaskPipeline extends Pipeline { * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks. * @extends Pipeline */ -class Text2TextGenerationPipeline extends Pipeline { +export class Text2TextGenerationPipeline extends Pipeline { _key = null; /** * Fill the masked token in the text(s) given as inputs. - * @async - * @param {string|string[]} texts - The text or array of texts to be processed. - * @param {Object} [options={}] - Options for the fill-mask pipeline. - * @param {number} [options.topk=5] - The number of top-k predictions to return. + * @param {string|string[]} texts The text or array of texts to be processed. + * @param {Object} [options={}] Options for the fill-mask pipeline. + * @param {number} [options.topk=5] The number of top-k predictions to return. * @returns {Promise} An array of objects containing the score, predicted token, predicted token string, * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text). * If only one input text is given, the output will be an array of objects. @@ -366,10 +384,20 @@ class Text2TextGenerationPipeline extends Pipeline { // TODO update generation config } - let input_ids = this.tokenizer(texts, { + let tokenizer_options = { padding: true, - truncation: true - }).input_ids + truncation: true, + } + let input_ids; + if (this instanceof TranslationPipeline && '_build_translation_inputs' in this.tokenizer) { + // TODO: move to Translation pipeline? + // Currently put here to avoid code duplication + // @ts-ignore + input_ids = this.tokenizer._build_translation_inputs(texts, tokenizer_options, generate_kwargs).input_ids; + + } else { + input_ids = this.tokenizer(texts, tokenizer_options).input_ids; + } let outputTokenIds = (await this.model.generate(input_ids, generate_kwargs)).flat(); @@ -393,7 +421,7 @@ class Text2TextGenerationPipeline extends Pipeline { * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline. * @extends Text2TextGenerationPipeline */ -class SummarizationPipeline extends Text2TextGenerationPipeline { +export class SummarizationPipeline extends Text2TextGenerationPipeline { _key = 'summary_text'; } @@ -401,21 +429,21 @@ class SummarizationPipeline extends Text2TextGenerationPipeline { * TranslationPipeline class to translate text from one language to another using the provided model and tokenizer. * @extends Text2TextGenerationPipeline */ -class TranslationPipeline extends Text2TextGenerationPipeline { +export class TranslationPipeline extends Text2TextGenerationPipeline { _key = 'translation_text'; } /** - * A pipeline for generating text based on an input prompt. + * Language generation pipeline using any `ModelWithLMHead`. + * This pipeline predicts the words that will follow a specified text prompt. * @extends Pipeline */ -class TextGenerationPipeline extends Pipeline { +export class TextGenerationPipeline extends Pipeline { /** * Generates text based on an input prompt. - * @async - * @param {any} texts - The input prompt or prompts to generate text from. - * @param {object} [generate_kwargs={}] - Additional arguments for text generation. - * @returns {Promise} - The generated text or texts. + * @param {any} texts The input prompt or prompts to generate text from. + * @param {Object} [generate_kwargs={}] Additional arguments for text generation. + * @returns {Promise} The generated text or texts. */ async _call(texts, generate_kwargs = {}) { let stringInput = typeof texts === 'string' || texts instanceof String; @@ -457,15 +485,19 @@ class TextGenerationPipeline extends Pipeline { } /** - * Class representing an Zero Shot Classification Pipeline that should only be used with zero shot classification tasks. + * NLI-based zero-shot classification pipeline using a `ModelForSequenceClassification` + * trained on NLI (natural language inference) tasks. Equivalent of `text-classification` + * pipelines, but these models don't require a hardcoded number of potential classes, they + * can be chosen at runtime. It usually means it's slower but it is **much** more flexible. * @extends Pipeline */ -class ZeroShotClassificationPipeline extends Pipeline { +export class ZeroShotClassificationPipeline extends Pipeline { /** - * @param {string} task - * @param {any} tokenizer - * @param {any} model + * Create a new ZeroShotClassificationPipeline. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedTokenizer} tokenizer The tokenizer to use. + * @param {PreTrainedModel} model The model to use. */ constructor(task, tokenizer, model) { super(task, tokenizer, model); @@ -492,9 +524,16 @@ class ZeroShotClassificationPipeline extends Pipeline { /** * @param {any[]} texts * @param {string[]} candidate_labels - * @todo fix error below - * @return {Promise<*>} + * @param {Object} options Additional options: + * @param {string} [options.hypothesis_template="This example is {}."] The template used to turn each + * candidate label into an NLI-style hypothesis. The candidate label will replace the {} placeholder. + * @param {boolean} [options.multi_label=false] Whether or not multiple candidate labels can be true. + * If `false`, the scores are normalized such that the sum of the label likelihoods for each sequence + * is 1. If `true`, the labels are considered independent and probabilities are normalized for each + * candidate by doing a softmax of the entailment score vs. the contradiction score. + * @return {Promise} The prediction(s), as a map (or list of maps) from label to score. */ + // @ts-ignore async _call(texts, candidate_labels, { hypothesis_template = "This example is {}.", multi_label = false, @@ -565,18 +604,20 @@ class ZeroShotClassificationPipeline extends Pipeline { /** - * Class representing an Embeddings Pipeline that should only be used with sentence-transformers. - * If you want to get the raw outputs from the model, use `AutoModel.from_pretrained(...)`. + * Feature extraction pipeline using no model head. This pipeline extracts the hidden + * states from the base transformer, which can be used as features in downstream tasks. + * + * This can be used with `sentence-transformers`. If you want to get the raw outputs + * from the model, use `AutoModel.from_pretrained(...)`. * @extends Pipeline + * + * @todo Make sure this works for other models than `sentence-transformers`. */ -class EmbeddingsPipeline extends Pipeline { - // Should only be used with sentence-transformers - // If you want to get the raw outputs from the model, - // use `AutoModel.from_pretrained(...)` +export class FeatureExtractionPipeline extends Pipeline { /** * Private method to perform mean pooling of the last hidden state followed by a normalization step. - * @param {Tensor} last_hidden_state - Tensor of shape [batchSize, seqLength, embedDim] - * @param {Tensor} attention_mask - Tensor of shape [batchSize, seqLength] + * @param {Tensor} last_hidden_state Tensor of shape [batchSize, seqLength, embedDim] + * @param {Tensor} attention_mask Tensor of shape [batchSize, seqLength] * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim]. * @private */ @@ -622,7 +663,7 @@ class EmbeddingsPipeline extends Pipeline { /** * Private method to normalize the input tensor along dim=1. * NOTE: only works for tensors of shape [batchSize, embedDim]. Operates in-place. - * @param {any} tensor - Tensor of shape [batchSize, embedDim] + * @param {any} tensor Tensor of shape [batchSize, embedDim] * @returns {any} Returns the same Tensor object after performing normalization. * @private */ @@ -639,7 +680,7 @@ class EmbeddingsPipeline extends Pipeline { /** * Method to perform mean pooling and normalization of the input texts. - * @param {string[]} texts - An array of texts to embed. + * @param {string[]} texts An array of texts to embed. * @returns {Promise} Returns a new Tensor of shape [batchSize, embedDim]. */ async _call(texts) { @@ -661,17 +702,17 @@ class EmbeddingsPipeline extends Pipeline { } /** - * A class representing an automatic speech recognition pipeline. + * Pipeline that aims at extracting spoken text contained within some audio. * @extends Pipeline */ -class AutomaticSpeechRecognitionPipeline extends Pipeline { +export class AutomaticSpeechRecognitionPipeline extends Pipeline { /** - * Creates an instance of AutomaticSpeechRecognitionPipeline. - * @param {string} task - The type of the task for this pipeline. Currently only "asr" is supported. - * @param {object} tokenizer - The tokenizer to be used for pre-processing inputs. - * @param {object} model - The model to be used for the task. - * @param {object} processor - The processor to be used for pre-processing audio inputs. + * Create a new AutomaticSpeechRecognitionPipeline. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedTokenizer} tokenizer The tokenizer to use. + * @param {PreTrainedModel} model The model to use. + * @param {Processor} processor The processor to use. */ constructor(task, tokenizer, model, processor) { super(task, tokenizer, model); @@ -680,53 +721,14 @@ class AutomaticSpeechRecognitionPipeline extends Pipeline { /** * Preprocesses the input audio for the AutomaticSpeechRecognitionPipeline. - * @param {any} audio - The audio to be preprocessed. - * @param {number} sampling_rate - The sampling rate of the audio. - * @returns {Promise} - A promise that resolves to the preprocessed audio data. + * @param {any} audio The audio to be preprocessed. + * @param {number} sampling_rate The sampling rate of the audio. + * @returns {Promise} A promise that resolves to the preprocessed audio data. * @private */ async _preprocess(audio, sampling_rate) { if (isString(audio)) { - // Attempting to load from path - - if (typeof AudioContext === 'undefined') { - // Running in node or an environment without AudioContext - throw Error( - "Unable to load audio from path/URL since `AudioContext` is not available in your environment. " + - "As a result, audio data must be passed directly to the processor. " + - "If you are running in node.js, you can use an external library (e.g., https://github.com/audiojs/web-audio-api) to do this." - ) - } - const response = await (await getFile(audio)).arrayBuffer(); - const audioCTX = new AudioContext({ sampleRate: sampling_rate }); - const decoded = await audioCTX.decodeAudioData(response); - - // We now replicate HuggingFace's `ffmpeg_read` method: - // - // When downmixing a stereo audio file to mono using the -ac 1 option in FFmpeg, - // the audio signal is summed across both channels to create a single mono channel. - // However, if the audio is at full scale (i.e. the highest possible volume level), - // the summing of the two channels can cause the audio signal to clip or distort. - - // To prevent this clipping, FFmpeg applies a scaling factor of 1/sqrt(2) (~ 0.707) - // to the audio signal before summing the two channels. This scaling factor ensures - // that the combined audio signal will not exceed the maximum possible level, even - // if both channels are at full scale. - - // After applying this scaling factor, the audio signal from both channels is summed - // to create a single mono channel. It's worth noting that this scaling factor is - // only applied when downmixing stereo audio to mono using the -ac 1 option in FFmpeg. - // If you're using a different downmixing method, or if you're not downmixing the - // audio at all, this scaling factor may not be needed. - const SCALING_FACTOR = Math.sqrt(2); - - let left = decoded.getChannelData(0); - let right = decoded.getChannelData(1); - - audio = new Float32Array(left.length); - for (let i = 0; i < decoded.length; i++) { - audio[i] = SCALING_FACTOR * (left[i] + right[i]) / 2; - } + audio = await read_audio(audio, sampling_rate); } return audio; @@ -734,13 +736,13 @@ class AutomaticSpeechRecognitionPipeline extends Pipeline { /** * Asynchronously processes audio and generates text transcription using the model. - * @param {Array} audio - The audio to be transcribed. Can be a single Float32Array or an array of Float32Arrays. - * @param {Object} [kwargs={}] - Optional arguments. - * @param {boolean} [kwargs.return_timestamps] - Whether to return timestamps or not. Default is false. - * @param {number} [kwargs.chunk_length_s] - The length of audio chunks to process in seconds. Default is 0 (no chunking). - * @param {number} [kwargs.stride_length_s] - The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to chunk_length_s / 6. - * @param {function} [kwargs.chunk_callback] - Callback function to be called with each chunk processed. - * @param {boolean} [kwargs.force_full_sequences] - Whether to force outputting full sequences or not. Default is false. + * @param {Array} audio The audio to be transcribed. Can be a single Float32Array or an array of Float32Arrays. + * @param {Object} [kwargs={}] Optional arguments. + * @param {boolean} [kwargs.return_timestamps] Whether to return timestamps or not. Default is false. + * @param {number} [kwargs.chunk_length_s] The length of audio chunks to process in seconds. Default is 0 (no chunking). + * @param {number} [kwargs.stride_length_s] The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to chunk_length_s / 6. + * @param {function} [kwargs.chunk_callback] Callback function to be called with each chunk processed. + * @param {boolean} [kwargs.force_full_sequences] Whether to force outputting full sequences or not. Default is false. * @returns {Promise} A Promise that resolves to an object containing the transcription text and optionally timestamps if return_timestamps is true. */ async _call(audio, kwargs = {}) { @@ -827,6 +829,7 @@ class AutomaticSpeechRecognitionPipeline extends Pipeline { } // Merge text chunks + // @ts-ignore let [full_text, optional] = this.tokenizer._decode_asr(chunks, { time_precision: time_precision, return_timestamps: return_timestamps, @@ -840,16 +843,16 @@ class AutomaticSpeechRecognitionPipeline extends Pipeline { } /** - * A pipeline for performing image-to-text tasks. + * Image To Text pipeline using a `AutoModelForVision2Seq`. This pipeline predicts a caption for a given image. * @extends Pipeline */ -class ImageToTextPipeline extends Pipeline { +export class ImageToTextPipeline extends Pipeline { /** - * Create an instance of ImageToTextPipeline. - * @param {string} task - The task name. - * @param {object} tokenizer - The tokenizer to use. - * @param {object} model - The generator model to use. - * @param {object} processor - The image processor to use. + * Create a new ImageToTextPipeline. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedTokenizer} tokenizer The tokenizer to use. + * @param {PreTrainedModel} model The model to use. + * @param {Processor} processor The processor to use. */ constructor(task, tokenizer, model, processor) { super(task, tokenizer, model); @@ -857,7 +860,10 @@ class ImageToTextPipeline extends Pipeline { } /** - * @param {any[]} images + * Assign labels to the image(s) passed as inputs. + * @param {any[]} images The images to be captioned. + * @param {Object} [generate_kwargs={}] Optional generation arguments. + * @returns {Promise} A Promise that resolves to an object (or array of objects) containing the generated text(s). */ async _call(images, generate_kwargs = {}) { let isBatched = Array.isArray(images); @@ -883,15 +889,16 @@ class ImageToTextPipeline extends Pipeline { } /** - * A class representing an image classification pipeline. + * Image classification pipeline using any `AutoModelForImageClassification`. + * This pipeline predicts the class of an image. * @extends Pipeline */ -class ImageClassificationPipeline extends Pipeline { +export class ImageClassificationPipeline extends Pipeline { /** * Create a new ImageClassificationPipeline. - * @param {string} task - The task of the pipeline. - * @param {Object} model - The model to use for classification. - * @param {Function} processor - The function to preprocess images. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedModel} model The model to use. + * @param {Processor} processor The processor to use. */ constructor(task, model, processor) { super(task, null, model); // TODO tokenizer @@ -900,11 +907,10 @@ class ImageClassificationPipeline extends Pipeline { /** * Classify the given images. - * @async - * @param {any} images - The images to classify. - * @param {Object} options - The options to use for classification. - * @param {number} [options.topk=1] - The number of top results to return. - * @returns {Promise} - The top classification results for the images. + * @param {any} images The images to classify. + * @param {Object} options The options to use for classification. + * @param {number} [options.topk=1] The number of top results to return. + * @returns {Promise} The top classification results for the images. */ async _call(images, { topk = 1 @@ -939,15 +945,16 @@ class ImageClassificationPipeline extends Pipeline { } /** - * ImageSegmentationPipeline class for executing an image-segmentation task. + * Image segmentation pipeline using any `AutoModelForXXXSegmentation`. + * This pipeline predicts masks of objects and their classes. * @extends Pipeline */ -class ImageSegmentationPipeline extends Pipeline { +export class ImageSegmentationPipeline extends Pipeline { /** * Create a new ImageSegmentationPipeline. - * @param {string} task - The task of the pipeline. - * @param {Object} model - The model to use for classification. - * @param {Processor} processor - The function to preprocess images. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedModel} model The model to use. + * @param {Processor} processor The processor to use. */ constructor(task, model, processor) { super(task, null, model); // TODO tokenizer @@ -963,15 +970,15 @@ class ImageSegmentationPipeline extends Pipeline { /** * Segment the input images. - * @param {Array} images - The input images. - * @param {Object} options - The options to use for segmentation. - * @param {number} [options.threshold=0.5] - Probability threshold to filter out predicted masks. - * @param {number} [options.mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values. - * @param {number} [options.overlap_mask_area_threshold=0.8] - Mask overlap threshold to eliminate small, disconnected segments. - * @param {null|string} [options.subtask=null] - Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`], depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order). - * @param {Array} [options.label_ids_to_fuse=null] - List of label ids to fuse. If not set, do not fuse any labels. - * @param {Array} [options.target_sizes=null] - List of target sizes for the input images. If not set, use the original image sizes. - * @returns {Promise} - The annotated segments. + * @param {Array} images The input images. + * @param {Object} options The options to use for segmentation. + * @param {number} [options.threshold=0.5] Probability threshold to filter out predicted masks. + * @param {number} [options.mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values. + * @param {number} [options.overlap_mask_area_threshold=0.8] Mask overlap threshold to eliminate small, disconnected segments. + * @param {null|string} [options.subtask=null] Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`], depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order). + * @param {Array} [options.label_ids_to_fuse=null] List of label ids to fuse. If not set, do not fuse any labels. + * @param {Array} [options.target_sizes=null] List of target sizes for the input images. If not set, use the original image sizes. + * @returns {Promise} The annotated segments. */ async _call(images, { threshold = 0.5, @@ -1053,17 +1060,18 @@ class ImageSegmentationPipeline extends Pipeline { /** - * Class representing a zero-shot image classification pipeline. + * Zero shot image classification pipeline. This pipeline predicts the class of + * an image when you provide an image and a set of `candidate_labels`. * @extends Pipeline */ -class ZeroShotImageClassificationPipeline extends Pipeline { +export class ZeroShotImageClassificationPipeline extends Pipeline { /** - * Create a zero-shot image classification pipeline. - * @param {string} task - The task of the pipeline. - * @param {Object} tokenizer - The tokenizer to use. - * @param {Object} model - The model to use. - * @param {Function} processor - The image processing function. + * Create a new ZeroShotImageClassificationPipeline. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedTokenizer} tokenizer The tokenizer to use. + * @param {PreTrainedModel} model The model to use. + * @param {Processor} processor The processor to use. */ constructor(task, tokenizer, model, processor) { super(task, tokenizer, model); @@ -1072,13 +1080,13 @@ class ZeroShotImageClassificationPipeline extends Pipeline { /** * Classify the input images with candidate labels using a zero-shot approach. - * @param {Array} images - The input images. - * @param {Array} candidate_labels - The candidate labels. - * @param {Object} options - The options for the classification. - * @param {string} [options.hypothesis_template] - The hypothesis template to use for zero-shot classification. Default: "This is a photo of {}". - * @todo fix error below + * @param {Array} images The input images. + * @param {Array} candidate_labels The candidate labels. + * @param {Object} options The options for the classification. + * @param {string} [options.hypothesis_template] The hypothesis template to use for zero-shot classification. Default: "This is a photo of {}". * @returns {Promise} An array of classifications for each input image or a single classification object if only one input image is provided. */ + // @ts-ignore async _call(images, candidate_labels, { hypothesis_template = "This is a photo of {}" } = {}) { @@ -1117,12 +1125,17 @@ class ZeroShotImageClassificationPipeline extends Pipeline { } } - -class ObjectDetectionPipeline extends Pipeline { +/** + * Object detection pipeline using any `AutoModelForObjectDetection`. + * This pipeline predicts bounding boxes of objects and their classes. + * @extends Pipeline + */ +export class ObjectDetectionPipeline extends Pipeline { /** - * @param {string} task - * @param {any} model - * @param {any} processor + * Create a new ObjectDetectionPipeline. + * @param {string} task The task of the pipeline. Useful for specifying subtasks. + * @param {PreTrainedModel} model The model to use. + * @param {Processor} processor The processor to use. */ constructor(task, model, processor) { super(task, null, model); // TODO tokenizer @@ -1130,11 +1143,15 @@ class ObjectDetectionPipeline extends Pipeline { } /** - * @param {any[]} images + * Detect objects (bounding boxes & classes) in the image(s) passed as inputs. + * @param {any[]} images The input images. + * @param {Object} options The options for the object detection. + * @param {number} [options.threshold=0.9] The threshold used to filter boxes by score. + * @param {boolean} [options.percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false). */ async _call(images, { - threshold = 0.5, - percentage = false, // get in percentage (true) or in pixels (false) + threshold = 0.9, + percentage = false, } = {}) { let isBatched = Array.isArray(images); @@ -1148,6 +1165,7 @@ class ObjectDetectionPipeline extends Pipeline { let inputs = await this.processor(images); let output = await this.model(inputs); + // @ts-ignore let processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes); // Add labels @@ -1164,7 +1182,9 @@ const SUPPORTED_TASKS = { "pipeline": TextClassificationPipeline, "model": AutoModelForSequenceClassification, "default": { - "model": "distilbert-base-uncased-finetuned-sst-2-english", + // TODO: replace with original + // "model": "distilbert-base-uncased-finetuned-sst-2-english", + "model": "Xenova/distilbert-base-uncased-finetuned-sst-2-english", }, "type": "text", }, @@ -1173,7 +1193,9 @@ const SUPPORTED_TASKS = { "pipeline": TokenClassificationPipeline, "model": AutoModelForTokenClassification, "default": { - "model": "Davlan/bert-base-multilingual-cased-ner-hrl", + // TODO: replace with original + // "model": "Davlan/bert-base-multilingual-cased-ner-hrl", + "model": "Xenova/bert-base-multilingual-cased-ner-hrl", }, "type": "text", }, @@ -1182,7 +1204,9 @@ const SUPPORTED_TASKS = { "pipeline": QuestionAnsweringPipeline, "model": AutoModelForQuestionAnswering, "default": { - "model": "distilbert-base-cased-distilled-squad" + // TODO: replace with original + // "model": "distilbert-base-cased-distilled-squad", + "model": "Xenova/distilbert-base-cased-distilled-squad", }, "type": "text", }, @@ -1192,7 +1216,9 @@ const SUPPORTED_TASKS = { "pipeline": FillMaskPipeline, "model": AutoModelForMaskedLM, "default": { - "model": "bert-base-uncased" + // TODO: replace with original + // "model": "bert-base-uncased", + "model": "Xenova/bert-base-uncased", }, "type": "text", }, @@ -1201,7 +1227,9 @@ const SUPPORTED_TASKS = { "pipeline": SummarizationPipeline, "model": AutoModelForSeq2SeqLM, "default": { - "model": "sshleifer/distilbart-cnn-6-6" + // TODO: replace with original + // "model": "sshleifer/distilbart-cnn-6-6", + "model": "Xenova/distilbart-cnn-6-6", }, "type": "text", }, @@ -1210,7 +1238,9 @@ const SUPPORTED_TASKS = { "pipeline": TranslationPipeline, "model": AutoModelForSeq2SeqLM, "default": { - "model": "t5-small" + // TODO: replace with original + // "model": "t5-small", + "model": "Xenova/t5-small", }, "type": "text", }, @@ -1219,7 +1249,9 @@ const SUPPORTED_TASKS = { "pipeline": Text2TextGenerationPipeline, "model": AutoModelForSeq2SeqLM, "default": { - "model": "google/flan-t5-small" + // TODO: replace with original + // "model": "google/flan-t5-small", + "model": "Xenova/flan-t5-small", }, "type": "text", }, @@ -1228,7 +1260,9 @@ const SUPPORTED_TASKS = { "pipeline": TextGenerationPipeline, "model": AutoModelForCausalLM, "default": { - "model": "gpt2" + // TODO: replace with original + // "model": "gpt2", + "model": "Xenova/gpt2", }, "type": "text", }, @@ -1237,7 +1271,9 @@ const SUPPORTED_TASKS = { "pipeline": ZeroShotClassificationPipeline, "model": AutoModelForSequenceClassification, "default": { - "model": "typeform/distilbert-base-uncased-mnli", + // TODO: replace with original + // "model": "typeform/distilbert-base-uncased-mnli", + "model": "Xenova/distilbert-base-uncased-mnli", }, "type": "text", }, @@ -1248,7 +1284,9 @@ const SUPPORTED_TASKS = { "model": AutoModelForSeq2SeqLM, "processor": AutoProcessor, "default": { - "model": "openai/whisper-tiny.en" + // TODO: replace with original + // "model": "openai/whisper-tiny.en", + "model": "Xenova/whisper-tiny.en", }, "type": "multimodal", }, @@ -1259,7 +1297,9 @@ const SUPPORTED_TASKS = { "model": AutoModelForVision2Seq, "processor": AutoProcessor, "default": { - "model": "nlpconnect/vit-gpt2-image-captioning" + // TODO: replace with original + // "model": "nlpconnect/vit-gpt2-image-captioning", + "model": "Xenova/vit-gpt2-image-captioning", }, "type": "multimodal", }, @@ -1270,7 +1310,9 @@ const SUPPORTED_TASKS = { "model": AutoModelForImageClassification, "processor": AutoProcessor, "default": { - "model": "google/vit-base-patch16-224" + // TODO: replace with original + // "model": "google/vit-base-patch16-224", + "model": "Xenova/vit-base-patch16-224", }, "type": "multimodal", }, @@ -1281,7 +1323,9 @@ const SUPPORTED_TASKS = { "model": AutoModelForImageSegmentation, "processor": AutoProcessor, "default": { - "model": "facebook/detr-resnet-50-panoptic" + // TODO: replace with original + // "model": "facebook/detr-resnet-50-panoptic", + "model": "Xenova/detr-resnet-50-panoptic", }, "type": "multimodal", }, @@ -1293,7 +1337,9 @@ const SUPPORTED_TASKS = { "model": AutoModel, "processor": AutoProcessor, "default": { - "model": "openai/clip-vit-base-patch32" + // TODO: replace with original + // "model": "openai/clip-vit-base-patch32", + "model": "Xenova/clip-vit-base-patch32", }, "type": "multimodal", }, @@ -1304,71 +1350,60 @@ const SUPPORTED_TASKS = { "model": AutoModelForObjectDetection, "processor": AutoProcessor, "default": { - "model": "facebook/detr-resnet-50" + // TODO: replace with original + // "model": "facebook/detr-resnet-50", + "model": "Xenova/detr-resnet-50", }, "type": "multimodal", }, - // This task is not supported in HuggingFace transformers, but serves as a useful interface - // for dealing with sentence-transformers (https://huggingface.co/sentence-transformers) - "embeddings": { + // This task serves as a useful interface for dealing with sentence-transformers (https://huggingface.co/sentence-transformers). + "feature-extraction": { "tokenizer": AutoTokenizer, - "pipeline": EmbeddingsPipeline, + "pipeline": FeatureExtractionPipeline, "model": AutoModel, "default": { - "model": "sentence-transformers/all-MiniLM-L6-v2" + // TODO: replace with original + // "model": "sentence-transformers/all-MiniLM-L6-v2", + "model": "Xenova/all-MiniLM-L6-v2", }, "type": "text", }, } -const TASK_NAME_MAPPING = { - // Fix mismatch between pipeline's task name and exports (folder name) - 'text-classification': 'sequence-classification', - 'embeddings': 'default', - 'fill-mask': 'masked-lm', - - 'text2text-generation': 'seq2seq-lm-with-past', - 'summarization': 'seq2seq-lm-with-past', - 'text-generation': 'causal-lm-with-past', - - 'automatic-speech-recognition': 'speech2seq-lm-with-past', - 'image-to-text': 'vision2seq-lm-with-past', - - 'zero-shot-image-classification': 'default', - 'zero-shot-classification': 'sequence-classification' -} - -const TASK_PREFIX_MAPPING = { - // if task starts with one of these, set the corresponding folder name - 'translation': 'seq2seq-lm-with-past', -} - const TASK_ALIASES = { "sentiment-analysis": "text-classification", "ner": "token-classification", "vqa": "visual-question-answering", + + // Add for backwards compatibility + "embeddings": "feature-extraction", } /** - * Constructs a pipeline for a specified task with optional model and progress callback. + * @typedef {import('./utils/hub.js').PretrainedOptions} PretrainedOptions + */ + +/** + * Utility factory method to build a [`Pipeline`] object. * - * @async - * @function - * @param {string} task - The task to perform, e.g. "text-generation". - * @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. - * @param {object} [options] - Optional parameters for the pipeline. - * @param {function} [options.progress_callback=null] - A function to call with progress updates. + * @param {string} task The task of the pipeline. + * @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. + * @param {PretrainedOptions} [options] Optional parameters for the pipeline. * @returns {Promise} A Pipeline object for the specified task. - * @todo fix error below * @throws {Error} If an unsupported pipeline is requested. */ -async function pipeline( +export async function pipeline( task, model = null, { - progress_callback = null + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', } = {} ) { // Helper method to construct pipeline @@ -1382,37 +1417,12 @@ async function pipeline( throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`) } - // Use model if specified, otherwise, use default if (!model) { model = pipelineInfo.default.model console.log(`No model specified. Using default model: "${model}".`); } - // determine suffix - let suffix = TASK_NAME_MAPPING[task]; - if (!suffix) { - // try get from suffix - for (const [prefix, mapping] of Object.entries(TASK_PREFIX_MAPPING)) { - if (task.startsWith(prefix)) { - suffix = mapping; - break; - } - } - } - - if (!suffix) { - // Still not set... so, we default to the name given - suffix = task; - } - - // Construct model path - model = pathJoin( - (env.remoteModels) ? env.remoteURL : env.localURL, // host prefix - model, // model name - suffix, // task suffix - ) - let tokenizerClass = pipelineInfo.tokenizer; let modelClass = pipelineInfo.model; let pipelineClass = pipelineInfo.pipeline; @@ -1420,41 +1430,53 @@ async function pipeline( let promises = []; + let pretrainedOptions = { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + } if (tokenizerClass) { promises.push( - AutoTokenizer.from_pretrained(model, progress_callback), + tokenizerClass.from_pretrained(model, pretrainedOptions), ) } if (modelClass) { promises.push( - modelClass.from_pretrained(model, progress_callback) + modelClass.from_pretrained(model, pretrainedOptions) ) } if (processorClass) { promises.push( - processorClass.from_pretrained(model, progress_callback) + processorClass.from_pretrained(model, pretrainedOptions) ) } // Load tokenizer and model let items = await Promise.all(promises) // TODO: fix error below + + dispatchCallback(progress_callback, { + 'status': 'ready', + 'task': task, + 'model': model, + }); + return new pipelineClass(task, ...items); } /** * Compute the Cartesian product of given arrays - * @param {...Array} a - Arrays to compute the product - * @returns {Array} - Returns the computed Cartesian product as an array + * @param {...Array} a Arrays to compute the product + * @returns {Array} Returns the computed Cartesian product as an array + * @private */ function product(...a) { // Cartesian product of items // Adapted from https://stackoverflow.com/a/43053803 return a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e]))); } - -module.exports = { - pipeline -}; diff --git a/src/processors.js b/src/processors.js index 2cb856ce1..f2225c3a6 100644 --- a/src/processors.js +++ b/src/processors.js @@ -1,81 +1,55 @@ -const { +/** + * @file Processors are used to prepare non-textual inputs (e.g., image or audio) for a model. + * + * **Example:** Using a `WhisperProcessor` to prepare an audio input for a model. + * ```javascript + * import { AutoProcessor, read_audio } from '@xenova/transformers'; + * + * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en'); + * let audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac'); + * let { input_features } = await processor(audio); + * // Tensor { + * // data: Float32Array(240000) [0.4752984642982483, 0.5597258806228638, 0.56434166431427, ...], + * // dims: [1, 80, 3000], + * // type: 'float32', + * // size: 240000, + * // } + * ``` + * + * @module processors + */ +import { Callable, - fetchJSON, - indexOfMax, - softmax, -} = require("./utils.js"); + calculateDimensions, +} from './utils/core.js'; +import { + getModelJSON, +} from './utils/hub.js'; -const FFT = require('./fft.js'); -const { Tensor, transpose, cat, interpolate } = require("./tensor_utils.js"); - -const { CustomImage } = require('./image_utils.js'); -/** - * Helper class to determine model type from config - */ -class AutoProcessor { - /** - * Returns a new instance of a Processor with a feature extractor - * based on the configuration file located at `modelPath`. - * - * @param {string} modelPath - The path to the model directory. - * @param {function} progressCallback - A callback function to track the loading progress (optional). - * @returns {Promise} A Promise that resolves with a new instance of a Processor. - * @throws {Error} If the feature extractor type specified in the configuration file is unknown. - */ - static async from_pretrained(modelPath, progressCallback = null) { - - let preprocessorConfig = await fetchJSON(modelPath, 'preprocessor_config.json', progressCallback) - - let processor_class; - let feature_extractor; - - switch (preprocessorConfig.feature_extractor_type) { - case 'WhisperFeatureExtractor': - feature_extractor = new WhisperFeatureExtractor(preprocessorConfig) - break; - case 'ViTFeatureExtractor': - feature_extractor = new ViTFeatureExtractor(preprocessorConfig) - break; - case 'DetrFeatureExtractor': - feature_extractor = new DetrFeatureExtractor(preprocessorConfig) - break; - default: - if (preprocessorConfig.size !== undefined) { - // Assume ImageFeatureExtractor - console.warn('Feature extractor type not specified, assuming ImageFeatureExtractor due to size parameter in config.') - feature_extractor = new ImageFeatureExtractor(preprocessorConfig) +import { + max, + softmax, + FFT +} from './utils/maths.js'; - } else { - throw new Error(`Unknown Feature Extractor type: ${preprocessorConfig.feature_extractor_type}`); - } - } +import { Tensor, transpose, cat, interpolate } from './utils/tensor.js'; - switch (preprocessorConfig.processor_class) { - case 'WhisperProcessor': - processor_class = WhisperProcessor; - break; - default: - // No associated processor class, use default - processor_class = Processor; - } +import { CustomImage } from './utils/image.js'; - return new processor_class(feature_extractor); - } -} /** * Base class for feature extractors. * * @extends Callable */ -class FeatureExtractor extends Callable { +export class FeatureExtractor extends Callable { /** * Constructs a new FeatureExtractor instance. * - * @param {object} config - The configuration for the feature extractor. + * @param {Object} config The configuration for the feature extractor. */ constructor(config) { super(); @@ -88,142 +62,230 @@ class FeatureExtractor extends Callable { * * @extends FeatureExtractor */ -class ImageFeatureExtractor extends FeatureExtractor { +export class ImageFeatureExtractor extends FeatureExtractor { /** * Constructs a new ViTFeatureExtractor instance. * - * @param {object} config - The configuration for the feature extractor. - * @param {number[]} config.image_mean - The mean values for image normalization. - * @param {number[]} config.image_std - The standard deviation values for image normalization. - * @param {boolean} config.do_rescale - Whether to rescale the image pixel values to the [0,1] range. - * @param {boolean} config.do_normalize - Whether to normalize the image pixel values. - * @param {boolean} config.do_resize - Whether to resize the image. - * @param {number} config.size - The size to resize the image to. + * @param {Object} config The configuration for the feature extractor. + * @param {number[]} config.image_mean The mean values for image normalization. + * @param {number[]} config.image_std The standard deviation values for image normalization. + * @param {boolean} config.do_rescale Whether to rescale the image pixel values to the [0,1] range. + * @param {number} config.rescale_factor The factor to use for rescaling the image pixel values. + * @param {boolean} config.do_normalize Whether to normalize the image pixel values. + * @param {boolean} config.do_resize Whether to resize the image. + * @param {number} config.resample What method to use for resampling. + * @param {number} config.size The size to resize the image to. */ constructor(config) { super(config); this.image_mean = this.config.image_mean; - if (!Array.isArray(this.image_mean)) { - this.image_mean = new Array(3).fill(this.image_mean); - } - this.image_std = this.config.image_std; - if (!Array.isArray(this.image_std)) { - this.image_std = new Array(3).fill(this.image_std); - } + this.resample = this.config.resample ?? 2; // 2 => bilinear this.do_rescale = this.config.do_rescale ?? true; + this.rescale_factor = this.config.rescale_factor ?? (1 / 255); this.do_normalize = this.config.do_normalize; this.do_resize = this.config.do_resize; this.size = this.config.size; - this.max_size = this.config.max_size; - - // TODO use these this.do_center_crop = this.config.do_center_crop; this.crop_size = this.config.crop_size; + this.do_convert_rgb = this.config.do_convert_rgb ?? true; + + this.pad_size = this.config.pad_size; + this.do_pad = (this.config.do_pad ?? false) && this.pad_size; } /** * Preprocesses the given image. * - * @param {CustomImage} image - The image to preprocess. + * @param {CustomImage} image The image to preprocess. * @returns {Promise} The preprocessed image as a Tensor. */ async preprocess(image) { + // First, convert image to RGB if specified in config. + if (this.do_convert_rgb) { + image = image.rgb(); + } + const srcWidth = image.width; // original width const srcHeight = image.height; // original height - // First, resize all images + // Next, resize all images if (this.do_resize) { - // If `max_size` is set, maintain aspect ratio and resize to `size` - // while keeping the largest dimension <= `max_size` - if (this.max_size !== undefined) { + // TODO: + // For efficiency reasons, it might be best to merge the resize and center crop operations into one. + + // `this.size` comes in many forms, so we need to handle them all here: + // 1. `this.size` is an integer, in which case we resize the image to be a square + + let shortest_edge; + let longest_edge; + + // Support both formats for backwards compatibility + if (Number.isInteger(this.size)) { + shortest_edge = this.size; + longest_edge = this.config.max_size ?? shortest_edge; + + } else { + // Extract known properties from `this.size` + shortest_edge = this.size.shortest_edge; + longest_edge = this.size.longest_edge; + } + + // If `longest_edge` and `shortest_edge` are set, maintain aspect ratio and resize to `shortest_edge` + // while keeping the largest dimension <= `longest_edge` + if (shortest_edge !== undefined || longest_edge !== undefined) { // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/ - // Try resize so that shortest edge is `this.size` (target) - const ratio = Math.max(this.size / srcWidth, this.size / srcHeight); - const newWidth = srcWidth * ratio; - const newHeight = srcHeight * ratio; + // Try resize so that shortest edge is `this.shortest_edge` (target) + const shortResizeFactor = shortest_edge === undefined + ? 1 // If `shortest_edge` is not set, don't upscale + : Math.max(shortest_edge / srcWidth, shortest_edge / srcHeight); - // The new width and height might be greater than `this.max_size`, so - // we downscale again to ensure the largest dimension is `this.max_size` - const downscaleFactor = Math.min(this.max_size / newWidth, this.max_size / newHeight, 1); + const newWidth = srcWidth * shortResizeFactor; + const newHeight = srcHeight * shortResizeFactor; + + // The new width and height might be greater than `this.longest_edge`, so + // we downscale again to ensure the largest dimension is `this.longest_edge` + const longResizeFactor = longest_edge === undefined + ? 1 // If `longest_edge` is not set, don't downscale + : Math.min(longest_edge / newWidth, longest_edge / newHeight); // Perform resize - image = await image.resize(Math.floor(newWidth * downscaleFactor), Math.floor(newHeight * downscaleFactor)); + image = await image.resize(Math.floor(newWidth * longResizeFactor), Math.floor(newHeight * longResizeFactor), { + resample: this.resample, + }); + + } else if (this.size.width !== undefined && this.size.height !== undefined) { + // If `width` and `height` are set, resize to those dimensions + image = await image.resize(this.size.width, this.size.height, { + resample: this.resample, + }); + } else { + throw new Error(`Could not resize image due to unsupported \`this.size\` option in config: ${JSON.stringify(this.size)}`); + } + } + + if (this.do_center_crop) { + let crop_width; + let crop_height; + if (Number.isInteger(this.crop_size)) { + crop_width = this.crop_size; + crop_height = this.crop_size; } else { - image = await image.resize(this.size, this.size); + crop_width = this.crop_size.width; + crop_height = this.crop_size.height; } + + image = await image.center_crop(crop_width, crop_height); } - // Convert image to RGB - image = image.rgb(); + let reshaped_input_size = [image.height, image.width]; + + // TODO is it okay to pad before rescaling/normalizing? + if (this.do_pad) { + let left = 0; + let right = this.pad_size.width - image.width; + let top = 0; + let bottom = this.pad_size.height - image.height; + + image = await image.pad([left, right, top, bottom]); + } const pixelData = Float32Array.from(image.data); if (this.do_rescale) { for (let i = 0; i < pixelData.length; ++i) { - pixelData[i] = pixelData[i] / 255; + pixelData[i] = this.rescale_factor * pixelData[i]; } } if (this.do_normalize) { - for (let i = 0; i < pixelData.length; i += 3) { - for (let j = 0; j < 3; ++j) { + let image_mean = this.image_mean; + if (!Array.isArray(this.image_mean)) { + image_mean = new Array(image.channels).fill(image_mean); + } + + let image_std = this.image_std; + if (!Array.isArray(this.image_std)) { + image_std = new Array(image.channels).fill(image_mean); + } + + if (image_mean.length !== image.channels || image_std.length !== image.channels) { + 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}).`); + } + + for (let i = 0; i < pixelData.length; i += image.channels) { + for (let j = 0; j < image.channels; ++j) { pixelData[i + j] = (pixelData[i + j] - this.image_mean[j]) / this.image_std[j]; } } } - let imgDims = [image.height, image.width, 3]; + // convert to channel dimension format: + let imgDims = [image.height, image.width, image.channels]; let img = new Tensor('float32', pixelData, imgDims); let transposed = transpose(img, [2, 0, 1]); // hwc -> chw - return transposed; + return { + original_size: [srcHeight, srcWidth], + reshaped_input_size: reshaped_input_size, + pixel_values: transposed, + } } /** * Calls the feature extraction process on an array of image * URLs, preprocesses each image, and concatenates the resulting * features into a single Tensor. - * @param {any} images - The URL(s) of the image(s) to extract features from. - * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images. + * @param {any} images The URL(s) of the image(s) to extract features from. + * @returns {Promise} An object containing the concatenated pixel values (and other metadata) of the preprocessed images. */ async _call(images) { if (!Array.isArray(images)) { images = [images]; } - images = await Promise.all(images.map(x => this.preprocess(x))); - images.forEach(x => x.dims = [1, ...x.dims]); // add batch dimension + let imageData = await Promise.all(images.map(x => this.preprocess(x))); + + // TODO: + + // Concatenate pixel values + // TEMP: Add batch dimension so that concat works + imageData.forEach(x => x.pixel_values.dims = [1, ...x.pixel_values.dims]); + let pixel_values = cat(imageData.map(x => x.pixel_values)); - images = cat(images); - // TODO concatenate on dim=0 return { - pixel_values: images + pixel_values: pixel_values, + + // Original sizes of images + original_sizes: imageData.map(x => x.original_size), + + // Reshaped sizes of images, before padding or cropping + reshaped_input_sizes: imageData.map(x => x.reshaped_input_size), } } } -class ViTFeatureExtractor extends ImageFeatureExtractor { } +export class ViTFeatureExtractor extends ImageFeatureExtractor { } /** * Detr Feature Extractor. * * @extends ImageFeatureExtractor */ -class DetrFeatureExtractor extends ImageFeatureExtractor { +export class DetrFeatureExtractor extends ImageFeatureExtractor { /** * Calls the feature extraction process on an array of image * URLs, preprocesses each image, and concatenates the resulting * features into a single Tensor. - * @param {any} urls - The URL(s) of the image(s) to extract features from. + * @param {any} urls The URL(s) of the image(s) to extract features from. * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images. */ async _call(urls) { @@ -244,7 +306,7 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { } /** - * @param {number[]} arr - The URL(s) of the image(s) to extract features from. + * @param {number[]} arr The URL(s) of the image(s) to extract features from. * @returns {number[]} An object containing the concatenated pixel values of the preprocessed images. */ center_to_corners_format([centerX, centerY, width, height]) { @@ -257,8 +319,11 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { } /** - * @param {{ logits: any; pred_boxes: any; }} outputs - * @return {any} + * Post-processes the outputs of the model (for object detection). + * @param {Object} outputs The outputs of the model that must be post-processed + * @param {Tensor} outputs.logits The logits + * @param {Tensor} outputs.pred_boxes The predicted boxes. + * @return {Object[]} An array of objects containing the post-processed outputs. */ post_process_object_detection(outputs, threshold = 0.5, target_sizes = null) { const out_logits = outputs.logits; @@ -276,14 +341,14 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { classes: [], scores: [] } - let logits = out_logits.get(i); - let bbox = out_bbox.get(i); + let logits = out_logits[i]; + let bbox = out_bbox[i]; for (let j = 0; j < num_boxes; ++j) { - let logit = logits.get(j); + let logit = logits[j]; // Get most probable class - let maxIndex = indexOfMax(logit.data); + let maxIndex = max(logit.data)[1]; if (maxIndex === num_classes - 1) { // This is the background class, skip it @@ -297,7 +362,7 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { if (score > threshold) { // Some class has a high enough probability /** @type {number[]} */ - let box = bbox.get(j); + let box = bbox[j].data; // convert to [x0, y0, x1, y1] format box = this.center_to_corners_format(box) @@ -317,11 +382,11 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { /** * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`. - * @param {Tensor} class_logits - The class logits. - * @param {Tensor} mask_logits - The mask logits. - * @param {number} object_mask_threshold - A number between 0 and 1 used to binarize the masks. - * @param {number} num_labels - The number of labels. - * @returns {[Tensor[], number[], number[]]} - The binarized masks, the scores, and the labels. + * @param {Tensor} class_logits The class logits. + * @param {Tensor} mask_logits The mask logits. + * @param {number} object_mask_threshold A number between 0 and 1 used to binarize the masks. + * @param {number} num_labels The number of labels. + * @returns {[Tensor[], number[], number[]]} The binarized masks, the scores, and the labels. */ remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) { @@ -330,10 +395,10 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { let pred_labels_item = []; for (let j = 0; j < class_logits.dims[0]; ++j) { - let cls = class_logits.get(j); - let mask = mask_logits.get(j); + let cls = class_logits[j]; + let mask = mask_logits[j]; - let pred_label = indexOfMax(cls.data); + let pred_label = max(cls.data)[1]; if (pred_label === num_labels) { // Is the background, so we ignore it continue; @@ -354,12 +419,12 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { /** * Checks whether the segment is valid or not. - * @param {Int32Array} mask_labels - Labels for each pixel in the mask. - * @param {Tensor[]} mask_probs - Probabilities for each pixel in the masks. - * @param {number} k - The class id of the segment. - * @param {number} mask_threshold - The mask threshold. - * @param {number} overlap_mask_area_threshold - The overlap mask area threshold. - * @returns {[boolean, number[]]} - Whether the segment is valid or not, and the indices of the valid labels. + * @param {Int32Array} mask_labels Labels for each pixel in the mask. + * @param {Tensor[]} mask_probs Probabilities for each pixel in the masks. + * @param {number} k The class id of the segment. + * @param {number} mask_threshold The mask threshold. + * @param {number} overlap_mask_area_threshold The overlap mask area threshold. + * @returns {[boolean, number[]]} Whether the segment is valid or not, and the indices of the valid labels. */ check_segment_validity( mask_labels, @@ -398,14 +463,14 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { /** * Computes the segments. - * @param {Tensor[]} mask_probs - The mask probabilities. - * @param {number[]} pred_scores - The predicted scores. - * @param {number[]} pred_labels - The predicted labels. - * @param {number} mask_threshold - The mask threshold. - * @param {number} overlap_mask_area_threshold - The overlap mask area threshold. - * @param {Set} label_ids_to_fuse - The label ids to fuse. - * @param {number[]} target_size - The target size of the image. - * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} - The computed segments. + * @param {Tensor[]} mask_probs The mask probabilities. + * @param {number[]} pred_scores The predicted scores. + * @param {number[]} pred_labels The predicted labels. + * @param {number} mask_threshold The mask threshold. + * @param {number} overlap_mask_area_threshold The overlap mask area threshold. + * @param {Set} label_ids_to_fuse The label ids to fuse. + * @param {number[]} target_size The target size of the image. + * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} The computed segments. */ compute_segments( mask_probs, @@ -507,12 +572,12 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { /** * Post-process the model output to generate the final panoptic segmentation. - * @param {*} outputs - The model output to post process - * @param {number} [threshold=0.5] - The probability score threshold to keep predicted instance masks. - * @param {number} [mask_threshold=0.5] - Threshold to use when turning the predicted masks into binary values. - * @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. - * @param {Set} [label_ids_to_fuse=null] - The labels in this state will have all their instances be fused together. - * @param {number[][]} [target_sizes=null] - The target sizes to resize the masks to. + * @param {*} outputs The model output to post process + * @param {number} [threshold=0.5] The probability score threshold to keep predicted instance masks. + * @param {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values. + * @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. + * @param {Set} [label_ids_to_fuse=null] The labels in this state will have all their instances be fused together. + * @param {number[][]} [target_sizes=null] The target sizes to resize the masks to. * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>} */ post_process_panoptic_segmentation( @@ -544,8 +609,8 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { for (let i = 0; i < batch_size; ++i) { let target_size = target_sizes !== null ? target_sizes[i] : null; - let class_logits = class_queries_logits.get(i); - let mask_logits = mask_probs.get(i); + let class_logits = class_queries_logits[i]; + let mask_logits = mask_probs[i]; let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels); @@ -592,13 +657,141 @@ class DetrFeatureExtractor extends ImageFeatureExtractor { } } +export class SamImageProcessor extends ImageFeatureExtractor { + async _call(images, input_points) { + let { + pixel_values, + original_sizes, + reshaped_input_sizes, + } = await super._call(images); + + let shape = calculateDimensions(input_points); + + if (shape.length === 3) { + // Correct user's input + shape = [1, ...shape]; + input_points = [input_points]; + } else if (shape.length !== 4) { + throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.") + } + + // Reshape input points + for (let i = 0; i < input_points.length; ++i) { // batch_size + let originalImageSize = original_sizes[i]; + let reshapedImageSize = reshaped_input_sizes[i]; -class WhisperFeatureExtractor extends FeatureExtractor { + let resizeFactors = [ + reshapedImageSize[0] / originalImageSize[0], + reshapedImageSize[1] / originalImageSize[1] + ] + + for (let j = 0; j < input_points[i].length; ++j) { // point_batch_size + for (let k = 0; k < input_points[i][j].length; ++k) { // nb_points_per_image + for (let w = 0; w < input_points[i][j][k].length; ++w) { // 2 + input_points[i][j][k][w] *= resizeFactors[w]; + } + } + } + } + + let input_points_tensor = new Tensor( + 'int64', + BigInt64Array.from(input_points.flat(Infinity) + .map(x => BigInt(Math.round(x)))), + shape + ) + + // TODO: allowed to be floats? + // let input_points_tensor = new Tensor( + // 'float32', + // Float32Array.from(input_points.flat(Infinity)), + // shape + // ) + + return { + pixel_values, + original_sizes: original_sizes, + reshaped_input_sizes: reshaped_input_sizes, + input_points: input_points_tensor + } + } + + /** + * Remove padding and upscale masks to the original image size. + * @param {Tensor} masks Batched masks from the mask_decoder in (batch_size, num_channels, height, width) format. + * @param {number[][]} original_sizes The original sizes of each image before it was resized to the model's expected input shape, in (height, width) format. + * @param {number[][]} reshaped_input_sizes The size of each image as it is fed to the model, in (height, width) format. Used to remove padding. + * @param {Object} options Optional parameters for post-processing. + * @param {number} [options.mask_threshold] The threshold to use for binarizing the masks. + * @param {boolean} [options.binarize] Whether to binarize the masks. + * @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`. + * @param {number} [options.pad_size.height] The height the images were padded to. + * @param {number} [options.pad_size.width] The width the images were padded to. + * @returns {Tensor[]} Batched masks in batch_size, num_channels, height, width) format, where (height, width) is given by original_size. + */ + post_process_masks(masks, original_sizes, reshaped_input_sizes, { + mask_threshold = 0.0, + binarize = true, + pad_size = null, + } = {}) { + // masks: [1, 1, 3, 256, 256] + + let output_masks = []; + + pad_size = pad_size ?? this.pad_size; + + let target_image_size = [pad_size.height, pad_size.width]; + + for (let i = 0; i < original_sizes.length; ++i) { + let original_size = original_sizes[i]; + let reshaped_input_size = reshaped_input_sizes[i]; + + let mask = masks[i]; // [b, c, h, w] + + // TODO: improve + let interpolated_masks = []; + for (let j = 0; j < mask.dims[0]; ++j) { + let m = mask[j]; // 3d tensor + + // Upscale mask to padded size + let interpolated_mask = interpolate(m, target_image_size, 'bilinear', false); + + // Crop mask + interpolated_mask = interpolated_mask.slice(null, [0, reshaped_input_size[0]], [0, reshaped_input_size[1]]); + + // Downscale mask + interpolated_mask = interpolate(mask, original_size, 'bilinear', false); + + if (binarize) { + interpolated_mask = new Tensor( + 'bool', + Array.from(interpolated_mask.data).map(x => x > mask_threshold), + interpolated_mask.dims + ) + } + + // add back batch dim for concat + interpolated_mask.dims = [1, ...interpolated_mask.dims]; + + interpolated_masks.push(interpolated_mask); + } + + let concatenated = cat(interpolated_masks); + output_masks.push(concatenated); + } + + return output_masks; + + } +} + + +export class WhisperFeatureExtractor extends FeatureExtractor { /** * Calculates the index offset for a given index and window size. - * @param {number} i - The index. - * @param {number} w - The window size. + * @param {number} i The index. + * @param {number} w The window size. * @returns {number} The index offset. */ calcOffset(i, w) { @@ -607,9 +800,9 @@ class WhisperFeatureExtractor extends FeatureExtractor { /** * Pads an array with a reflected version of itself on both ends. - * @param {Float32Array} array - The array to pad. - * @param {number} left - The amount of padding to add to the left. - * @param {number} right - The amount of padding to add to the right. + * @param {Float32Array} array The array to pad. + * @param {number} left The amount of padding to add to the left. + * @param {number} right The amount of padding to add to the right. * @returns {Float32Array} The padded array. */ padReflect(array, left, right) { @@ -634,8 +827,8 @@ class WhisperFeatureExtractor extends FeatureExtractor { /** * Calculates the complex Short-Time Fourier Transform (STFT) of the given framed signal. * - * @param {number[][]} frames - A 2D array representing the signal frames. - * @param {number[]} window - A 1D array representing the window to be applied to the frames. + * @param {number[][]} frames A 2D array representing the signal frames. + * @param {number[]} window A 1D array representing the window to be applied to the frames. * @returns {Object} An object with the following properties: * - data: A 1D array representing the complex STFT of the signal. * - dims: An array representing the dimensions of the STFT data, i.e. [num_frames, num_fft_bins]. @@ -746,8 +939,8 @@ class WhisperFeatureExtractor extends FeatureExtractor { /** * Creates an array of frames from a given waveform. * - * @param {Float32Array} waveform - The waveform to create frames from. - * @param {boolean} [center=true] - Whether to center the frames on their corresponding positions in the waveform. Defaults to true. + * @param {Float32Array} waveform The waveform to create frames from. + * @param {boolean} [center=true] Whether to center the frames on their corresponding positions in the waveform. Defaults to true. * @returns {Array} An array of frames. */ fram_wave(waveform, center = true) { @@ -804,8 +997,8 @@ class WhisperFeatureExtractor extends FeatureExtractor { /** * Generates a Hanning window of length M. * - * @param {number} M - The length of the Hanning window to generate. - * @returns {*} - The generated Hanning window. + * @param {number} M The length of the Hanning window to generate. + * @returns {*} The generated Hanning window. */ hanning(M) { if (M < 1) { @@ -825,7 +1018,7 @@ class WhisperFeatureExtractor extends FeatureExtractor { /** * Computes the log-Mel spectrogram of the provided audio waveform. - * @param {Float32Array} waveform - The audio waveform to process. + * @param {Float32Array} waveform The audio waveform to process. * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers. */ _extract_fbank_features(waveform) { @@ -907,9 +1100,8 @@ class WhisperFeatureExtractor extends FeatureExtractor { /** * Asynchronously extracts features from a given audio using the provided configuration. - * @param {Float32Array} audio - The audio data as a Float32Array. - * @returns {Promise<{ input_features: Tensor }>} - A Promise resolving to an object containing the extracted input features as a Tensor. - * @async + * @param {Float32Array} audio The audio data as a Float32Array. + * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor. */ async _call(audio) { // audio is a float32array @@ -921,7 +1113,7 @@ class WhisperFeatureExtractor extends FeatureExtractor { "remember to specify `chunk_length_s` and/or `stride_length_s`." ); } - let waveform = audio.slice(0, this.config.n_samples) + let waveform = audio.slice(0, this.config.n_samples); let features = this._extract_fbank_features(waveform); @@ -938,10 +1130,10 @@ class WhisperFeatureExtractor extends FeatureExtractor { * Represents a Processor that extracts features from an input. * @extends Callable */ -class Processor extends Callable { +export class Processor extends Callable { /** * Creates a new Processor with the given feature extractor. - * @param {function} feature_extractor - The function used to extract features from the input. + * @param {FeatureExtractor} feature_extractor The function used to extract features from the input. */ constructor(feature_extractor) { super(); @@ -951,33 +1143,122 @@ class Processor extends Callable { /** * Calls the feature_extractor function with the given input. - * @param {any} input - The input to extract features from. + * @param {any} input The input to extract features from. * @returns {Promise} A Promise that resolves with the extracted features. - * @async */ async _call(input) { return await this.feature_extractor(input); } } +export class SamProcessor extends Processor { + + async _call(images, input_points) { + return await this.feature_extractor(images, input_points); + } + + /** + * @borrows SamImageProcessor#post_process_masks as post_process_masks + */ + post_process_masks(...args) { + // @ts-ignore + return this.feature_extractor.post_process_masks(...args); + } +} + /** * Represents a WhisperProcessor that extracts features from an audio input. * @extends Processor */ -class WhisperProcessor extends Processor { +export class WhisperProcessor extends Processor { /** * Calls the feature_extractor function with the given audio input. - * @param {any} audio - The audio input to extract features from. + * @param {any} audio The audio input to extract features from. * @returns {Promise} A Promise that resolves with the extracted features. - * @async */ async _call(audio) { return await this.feature_extractor(audio) } } +////////////////////////////////////////////////// +/** + * @typedef {import('./utils/hub.js').PretrainedOptions} PretrainedOptions + */ +/** + * Helper class which is used to instantiate pretrained processors with the `from_pretrained` function. + * The chosen processor class is determined by the type specified in the processor config. + * + * @example + * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en'); + */ +export class AutoProcessor { + static FEATURE_EXTRACTOR_CLASS_MAPPING = { + 'WhisperFeatureExtractor': WhisperFeatureExtractor, + 'ViTFeatureExtractor': ViTFeatureExtractor, + 'DetrFeatureExtractor': DetrFeatureExtractor, + + 'SamImageProcessor': SamImageProcessor, + } -module.exports = { - AutoProcessor, - Processor, + static PROCESSOR_CLASS_MAPPING = { + 'WhisperProcessor': WhisperProcessor, + 'SamProcessor': SamProcessor, + } + + /** + * Instantiate one of the processor classes of the library from a pretrained model. + * + * The processor class to instantiate is selected based on the `feature_extractor_type` property of the config object + * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible) + * + * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either: + * - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co. + * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a + * user or organization name, like `dbmdz/bert-base-german-cased`. + * - A path to a *directory* containing processor files, e.g., `./my_model_directory/`. + * @param {PretrainedOptions} options Additional options for loading the processor. + * + * @returns {Promise} A new instance of the Processor class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + + let preprocessorConfig = config ?? await getModelJSON(pretrained_model_name_or_path, 'preprocessor_config.json', true, { + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }) + + // Determine feature extractor class + // TODO: Ensure backwards compatibility with old configs + let key = preprocessorConfig.feature_extractor_type ?? preprocessorConfig.image_processor_type; + let feature_extractor_class = this.FEATURE_EXTRACTOR_CLASS_MAPPING[key]; + + if (!feature_extractor_class) { + if (preprocessorConfig.size !== undefined) { + // Assume ImageFeatureExtractor + console.warn('Feature extractor type not specified, assuming ImageFeatureExtractor due to size parameter in config.'); + feature_extractor_class = ImageFeatureExtractor; + } else { + throw new Error(`Unknown Feature Extractor type: ${preprocessorConfig.feature_extractor_type}`); + } + } + + // If no associated processor class, use default + let processor_class = this.PROCESSOR_CLASS_MAPPING[preprocessorConfig.processor_class] ?? Processor; + + // Instantiate processor and feature extractor + let feature_extractor = new feature_extractor_class(preprocessorConfig); + return new processor_class(feature_extractor); + } } +////////////////////////////////////////////////// + diff --git a/src/samplers.js b/src/samplers.js deleted file mode 100644 index 0ca7e3442..000000000 --- a/src/samplers.js +++ /dev/null @@ -1,249 +0,0 @@ -const { - Callable, - indexOfMax, - softmax, - log_softmax, - getTopItems -} = require("./utils.js"); - -/** - * Sampler is a base class for all sampling methods used for text generation. - */ -class Sampler extends Callable { - /** - * Creates a new Sampler object with the specified temperature. - * @param {number} temperature - The temperature to use when sampling. Higher values result in more random samples. - */ - constructor(temperature) { - super(); - this.temperature = temperature; - } - - /** - * Executes the sampler, using the specified logits. - * @param {any} logits - * @param {number} index - * @returns {void} - */ - _call(logits, index = -1) { - // Sample from logits, of dims [batch, sequence_length, vocab_size]. - // If index is specified, sample from [batch, index, vocab_size]. - return this.sample(logits, index); - } - - /** - * Abstract method for sampling the logits. - * @param {any} logits - * @param {number} index - * @throws {Error} - */ - sample(logits, index) { - throw Error("sample should be implemented in subclasses.") - } - - /** - * Returns the specified logits as an array, with temperature applied. - * @param {any} logits - * @param {number} index - * @returns {Array} - */ - getLogits(logits, index) { - let vocabSize = logits.dims[2]; - - let logs = logits.data; - - if (index === -1) { - logs = logs.slice(-vocabSize); - } else { - let startIndex = index * vocabSize; - logs = logs.slice(startIndex, startIndex + vocabSize); - } - - // add temperature - if (this.temperature > 0) { - logs = logs.map(x => x / this.temperature) - } - return logs; - } - - /** - * Selects an item randomly based on the specified probabilities. - * @param {Array} probabilities - An array of probabilities to use for selection. - * @returns {number} The index of the selected item. - */ - randomSelect(probabilities) { - // Return index of chosen item - let sumProbabilities = probabilities.reduce((acc, curr) => acc + curr, 0); - - let r = Math.random() * sumProbabilities; - for (let i = 0; i < probabilities.length; ++i) { - r -= probabilities[i]; - if (r <= 0) { - return i; - } - } - return 0; // return first (most probable) as a fallback - } - - /** - * Returns a Sampler object based on the specified options. - * @param {object} generation_config - An object containing options for the sampler. - * @returns {Sampler} A Sampler object. - */ - static getSampler(generation_config) { - if (generation_config.num_beams > 1) { - return new BeamSearchSampler( - generation_config.temperature, - generation_config.num_beams, - generation_config.do_sample, - generation_config.top_k, - ); - - } else if (generation_config.do_sample) { - return new TopKSampler( - generation_config.temperature, - generation_config.top_k, - ); - - } else { - if (generation_config.num_return_sequences > 1) { - throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${generation_config.num_return_sequences}.`) - } - return new GreedySampler(generation_config.temperature); - } - } -} - -/** - * Class representing a Greedy Sampler. - * @extends Sampler - */ -class GreedySampler extends Sampler { - /** - * Sample the maximum probability of a given logits tensor. - * @param {any} logits - * @param {number} [index=-1] - * @returns {Array} - An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search). - */ - sample(logits, index = -1) { - // NOTE: no need to do log_softmax here since we only take the maximum - let logs = this.getLogits(logits, index); - let argmax = indexOfMax(logs); - - // Note: score is meaningless in this context, since we are performing - // greedy search (p = 1 => log(p) = 0) - return [ - [argmax, 0] - ]; - } -} - -/** - * Class representing a TopKSampler. - * @extends Sampler - */ -class TopKSampler extends Sampler { - /** - * Create a TopKSampler. - * @param {number} temperature - * @param {number} k - */ - constructor(temperature, k) { - super(temperature); - this.k = k; - } - - /** - * Sample from the logits using the top-k sampling strategy. - * @param {any} logits - * @param {number} index - * @returns {Array} - */ - sample(logits, index = -1) { - let [batchSize, seqLength, vocabSize] = logits.dims; - let k = vocabSize; - if (this.k > 0) { - k = Math.min(this.k, k); - } - - let logs = this.getLogits(logits, index); - - // Get top k tokens - let topLogits = getTopItems(logs, k); - - // Compute softmax over logits - let probabilities = softmax(topLogits.map(x => x[1])); - - let sampledIndex = this.randomSelect(probabilities); - - let tokenId = topLogits[sampledIndex][0]; - let score = Math.log(probabilities[sampledIndex]); - return [ - [tokenId, score] - ]; - } -} - -/** - * Class representing a beam search sampler for generating sequences. - * @extends Sampler - */ -class BeamSearchSampler extends Sampler { - /** - * Create a BeamSearchSampler. - * @param {number} temperature - * @param {number} num_beams - * @param {boolean} do_sample - * @param {number} top_k - */ - constructor(temperature, num_beams, do_sample, top_k) { - super(temperature); - this.num_beams = num_beams; // maximum number of beams - this.do_sample = do_sample; // if true, perform multinomial sampling - - this.top_k = top_k; // if do_sample, sample from top k items - } - - /** - * Samples from the logits to generate a sequence using beam search. - * @param {any} logits - The logits to sample from. - * @param {number} [index=-1] - The index to sample from, if applicable. - * @returns {Array} - An array of arrays containing tokens and scores. - */ - sample(logits, index = -1) { - - let logs = this.getLogits(logits, index); - - if (this.do_sample || this.top_k > 0) { - const [batchSize, seqLength, vocabSize] = logits.dims; - - let k = vocabSize; - if (this.top_k > 0) { - k = Math.min(this.top_k, k); - } - const topLogits = getTopItems(logs, k); - - // Compute softmax over top k logits - const probabilities = softmax(topLogits.map(x => x[1])); - - return Array.from({ length: this.num_beams }, () => { - const sampledIndex = this.randomSelect(probabilities); - const tokenId = topLogits[sampledIndex][0]; - return [tokenId, Math.log(probabilities[sampledIndex])]; - }); - - } else { - // first perform log softmax to get scores over whole distribution - const logProbabilities = log_softmax(logs); - const topLogits = getTopItems(logProbabilities, this.num_beams); - return topLogits; - } - } -} - -module.exports = { - Sampler, - GreedySampler, - TopKSampler, - BeamSearchSampler -} diff --git a/src/tensor_utils.js b/src/tensor_utils.js deleted file mode 100644 index 788b1a830..000000000 --- a/src/tensor_utils.js +++ /dev/null @@ -1,267 +0,0 @@ -const { ONNX } = require('./backends/onnx.js'); - -const { interpolate: interpolate_data, transpose: transpose_data } = require('./math_utils.js'); - - -/** - * @typedef {import('./math_utils.js').AnyTypedArray} AnyTypedArray - */ - -const ONNXTensor = ONNX.Tensor; - -// TODO: fix error below -class Tensor extends ONNXTensor { - /** - * Create a new Tensor or copy an existing Tensor. - * @param {[string, Array|AnyTypedArray, number[]]|[ONNXTensor]} args - */ - constructor(...args) { - if (args[0] instanceof ONNX.Tensor) { - // Create shallow copy - super(args[0].type, args[0].data, args[0].dims); - - } else { - // Create new - super(...args) - } - } - - /** - * Returns an iterator object for iterating over the tensor data in row-major order. - * If the tensor has more than one dimension, the iterator will yield subarrays. - * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order. - */ - *[Symbol.iterator]() { - const [iterLength, ...iterDims] = this.dims; - - if (iterDims.length > 0) { - const iterSize = iterDims.reduce((a, b) => a * b); - for (let i = 0; i < iterLength; ++i) { - yield this._subarray(i, iterSize, iterDims); - } - } else { - yield* this.data - } - - } - - /** - * - * @param {number} index - * @returns {Tensor} - * @todo Set type based on dims - */ - get(index) { - const iterDims = this.dims.slice(1); - if (iterDims.length > 0) { - const iterSize = iterDims.reduce((a, b) => a * b); - return this._subarray(index, iterSize, iterDims); - } else { - return this.data[index]; - } - } - - /** - * @param {any} item - * @returns {number} - */ - indexOf(item) { - for (let index = 0; index < this.data.length; ++index) { - // Note: == instead of === so we can match Ints with BigInts - if (this.data[index] == item) { - return index; - } - } - return -1; - } - - /** - * @param {number} index - * @param {number} iterSize - * @param {any} iterDims - * @returns {Tensor} - */ - _subarray(index, iterSize, iterDims) { - let data = this.data.subarray(index * iterSize, (index + 1) * iterSize); - return new Tensor(this.type, data, iterDims); - } - - tolist() { - // Convert tensor data to a n-dimensional JS list - return reshape(this.data, this.dims) - } - - /** - * Return a new Tensor the sigmoid function applied to each element. - * @returns {Tensor} - The tensor with the sigmoid function applied. - */ - sigmoid() { - return this.clone().sigmoid_(); - } - - /** - * Applies the sigmoid function to the tensor in place. - * @returns {Tensor} - Returns `this`. - */ - sigmoid_() { - for (let i = 0; i < this.data.length; ++i) { - this.data[i] = 1 / (1 + Math.exp(-this.data[i])); - } - return this; - } - - clone() { - return new Tensor(this.type, this.data.slice(), this.dims.slice()); - } - - // TODO add .slice() - - /** - * Return a transposed version of this Tensor, according to the provided dimensions. - * @param {...number} dims - Dimensions to transpose. - * @returns {Tensor} - The transposed tensor. - */ - transpose(...dims) { - return transpose(this, dims); - } -} - -/** - * This creates a nested array of a given type and depth (see examples). - * - * @example - * NestArray; // string[] - * @example - * NestArray; // number[][] - * @example - * NestArray; // string[][][] etc. - * @template T - * @template {number} Depth - * @template {never[]} [Acc=[]] - * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray - */ - -/** - * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions. - * - * @example - * reshape([10 ], [1 ]); // Type: number[] Value: [10] - * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]] - * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] - * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]] - * @param {T[]} data - The input array to reshape. - * @param {DIM} dimensions - The target shape/dimensions. - * @template T - * @template {[number]|[number, number]|[number, number, number]|[number, number, number, number]} DIM - * @returns {NestArray} The reshaped array. - */ -function reshape(data, dimensions) { - - const totalElements = data.length; - const dimensionSize = dimensions.reduce((a, b) => a * b); - - if (totalElements !== dimensionSize) { - throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`); - } - - /** @type {any} */ - let reshapedArray = data; - - for (let i = dimensions.length - 1; i >= 0; i--) { - reshapedArray = reshapedArray.reduce((acc, val) => { - let lastArray = acc[acc.length - 1]; - - if (lastArray.length < dimensions[i]) { - lastArray.push(val); - } else { - acc.push([val]); - } - - return acc; - }, [[]]); - } - - return reshapedArray[0]; -} - -/** - * Transposes a tensor according to the provided axes. - * @param {any} tensor - The input tensor to transpose. - * @param {Array} axes - The axes to transpose the tensor along. - * @returns {Tensor} The transposed tensor. - */ -function transpose(tensor, axes) { - const [transposedData, shape] = transpose_data(tensor.data, tensor.dims, axes); - return new Tensor(tensor.type, transposedData, shape); -} - - -/** - * Concatenates an array of tensors along the 0th dimension. - * - * @param {any} tensors - The array of tensors to concatenate. - * @returns {Tensor} - The concatenated tensor. - */ -function cat(tensors) { - if (tensors.length === 0) { - return tensors[0]; - } - // NOTE: tensors must be batched - // NOTE: currently only supports dim=0 - // TODO: add support for dim != 0 - - - let tensorType = tensors[0].type; - let tensorShape = [...tensors[0].dims]; - tensorShape[0] = tensors.length; - - // Calculate total size to allocate - let total = 0; - for (let t of tensors) { - total += t.data.length; - } - - // Create output tensor of same type as first - let data = new tensors[0].data.constructor(total); - - let offset = 0; - for (let t of tensors) { - data.set(t.data, offset); - offset += t.data.length; - } - - return new Tensor(tensorType, data, tensorShape) -} - -/** - * Interpolates an Tensor to the given size. - * @param {Tensor} input - The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w]) - * @param {number[]} size - The output size of the image - * @param {string} mode - The interpolation mode - * @param {boolean} align_corners - Whether to align corners. - * @returns {Tensor} - The interpolated tensor. - */ -function interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) { - - // Input image dimensions - const in_channels = input.dims.at(-3) ?? 1; - const in_height = input.dims.at(-2); - const in_width = input.dims.at(-1); - - let output = interpolate_data( - input.data, - [in_channels, in_height, in_width], - [out_height, out_width], - mode, - align_corners - ); - return new Tensor(input.type, output, [in_channels, out_height, out_width]); -} - -module.exports = { - Tensor, - transpose, - cat, - interpolate, - transpose_data, -} diff --git a/src/tokenizers.js b/src/tokenizers.js index a6708372e..f04bda5ce 100644 --- a/src/tokenizers.js +++ b/src/tokenizers.js @@ -1,32 +1,163 @@ -const { + +/** + * @file Tokenizers are used to prepare textual inputs for a model. + * + * **Example:** Create an `AutoTokenizer` and use it to tokenize a sentence. + * This will automatically detect the tokenizer type based on the tokenizer class defined in `tokenizer.json`. + * ```javascript + * import { AutoTokenizer } from '@xenova/transformers'; + * + * let tokenizer = await AutoTokenizer.from_pretrained('bert-base-uncased'); + * let { input_ids } = await tokenizer('I love transformers!'); + * // Tensor { + * // data: BigInt64Array(6) [101n, 1045n, 2293n, 19081n, 999n, 102n], + * // dims: [1, 6], + * // type: 'int64', + * // size: 6, + * // } + * ``` + * + * @module tokenizers + */ + +import { Callable, - fetchJSON, reverseDictionary, escapeRegExp, isIntegralNumber, - min, -} = require('./utils.js'); +} from './utils/core.js'; + +import { + getModelJSON, +} from './utils/hub.js'; + +import { min } from './utils/maths.js'; +import { Tensor } from './utils/tensor.js'; + +/** + * @typedef {import('./utils/hub.js').PretrainedOptions} PretrainedOptions + */ + +/** + * Loads a tokenizer from the specified path. + * @param {string} pretrained_model_name_or_path The path to the tokenizer directory. + * @param {PretrainedOptions} options Additional options for loading the tokenizer. + * @returns {Promise} A promise that resolves with information about the loaded tokenizer. + */ +async function loadTokenizer(pretrained_model_name_or_path, options) { + + let info = await Promise.all([ + getModelJSON(pretrained_model_name_or_path, 'tokenizer.json', true, options), + getModelJSON(pretrained_model_name_or_path, 'tokenizer_config.json', true, options), + ]) + return info; +} + +/** + * Helper method to construct a pattern from a config object. + * @param {Object} pattern The pattern object. + * @returns {RegExp|string|null} The compiled pattern. + */ +function createPattern(pattern) { + if (pattern.Regex) { + return new RegExp(pattern.Regex, 'gu'); + + } else if (pattern.String) { + return pattern.String; + + } else { + console.warn('Unknown pattern type:', pattern) + return null; + } +} + +/** + * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms + * @param {string} text The text to clean up. + * @returns {string} The cleaned up text. + */ +function clean_up_tokenization(text) { + // Clean up a list of simple English tokenization artifacts + // like spaces before punctuations and abbreviated forms + return text.replace(/ \./g, '.') + .replace(/ \?/g, '?') + .replace(/ \!/g, '!') + .replace(/ ,/g, ',') + .replace(/ \' /g, "'") + .replace(/ n\'t/g, "n't") + .replace(/ \'m/g, "'m") + .replace(/ \'s/g, "'s") + .replace(/ \'ve/g, "'ve") + .replace(/ \'re/g, "'re"); +} + +/** + * Helper function to fuse consecutive values in an array equal to the specified value. + * @param {Array} arr The input array + * @param {any} value The value to fuse on. + */ +function fuse(arr, value) { + let fused = []; + let i = 0; + while (i < arr.length) { + fused.push(arr[i]) + if (arr[i] !== value) { + ++i; + continue; + } -const { Tensor } = require('./tensor_utils.js') + while (i < arr.length && arr[i] === value) { + ++i; + } + } + + return fused; +} + +/** + * Split a string on whitespace. + * @param {string} text The text to split. + * @returns {string[]} The split string. + */ +function whitespace_split(text) { + return text.match(/\S+/g) || []; +} /** * Abstract base class for tokenizer models. * * @extends Callable */ -class TokenizerModel extends Callable { +export class TokenizerModel extends Callable { /** * Creates a new instance of TokenizerModel. - * @param {object} config - The configuration object for the TokenizerModel. + * @param {Object} config The configuration object for the TokenizerModel. */ constructor(config) { super(); this.config = config; + + /** @type {string[]} */ + this.vocab = []; + + /** + * A mapping of tokens to ids. + * @type {Map} + */ + this.tokens_to_ids = new Map(); + + this.unk_token_id = undefined; + this.unk_token = undefined; + this.end_of_word_suffix = undefined; + + /** @type {boolean} Whether to fuse unknown tokens when encoding. Defaults to false. */ + this.fuse_unk = false; } + /** * Instantiates a new TokenizerModel instance based on the configuration object provided. - * @param {object} config - The configuration object for the TokenizerModel. - * @param {...*} args - Optional arguments to pass to the specific TokenizerModel constructor. + * @param {Object} config The configuration object for the TokenizerModel. + * @param {...*} args Optional arguments to pass to the specific TokenizerModel constructor. * @returns {TokenizerModel} A new instance of a TokenizerModel. * @throws Will throw an error if the TokenizerModel type in the config is not recognized. */ @@ -35,11 +166,11 @@ class TokenizerModel extends Callable { case 'WordPiece': return new WordPieceTokenizer(config); case 'Unigram': - // TODO: fix error below + // @ts-ignore return new Unigram(config, ...args); case 'BPE': - // TODO: fix error below + // @ts-ignore return new BPE(config, ...args); default: throw new Error(`Unknown TokenizerModel type: ${config.type}`); @@ -48,7 +179,7 @@ class TokenizerModel extends Callable { /** * Internal function to call the TokenizerModel instance. - * @param {string[]} tokens - The tokens to encode. + * @param {string[]} tokens The tokens to encode. * @returns {number[]} The encoded token IDs. */ _call(tokens) { @@ -57,7 +188,7 @@ class TokenizerModel extends Callable { /** * Encodes a list of tokens into a list of token IDs. - * @param {string[]} tokens - The tokens to encode. + * @param {string[]} tokens The tokens to encode. * @returns {number[]} The encoded token IDs. * @throws Will throw an error if not implemented in a subclass. */ @@ -67,16 +198,22 @@ class TokenizerModel extends Callable { /** * Converts a list of tokens into a list of token IDs. - * @param {string[]} tokens - The tokens to convert. + * @param {string[]} tokens The tokens to convert. * @returns {number[]} The converted token IDs. */ convert_tokens_to_ids(tokens) { - return tokens.map(t => this.tokens_to_ids[t] ?? this.unk_token_id); + let ids = tokens.map(t => this.tokens_to_ids.get(t) ?? this.unk_token_id); + + if (this.fuse_unk) { + // Fuse unknown tokens + ids = fuse(ids, this.unk_token_id); + } + return ids; } /** * Converts a list of token IDs into a list of tokens. - * @param {number[]} ids - The token IDs to convert. + * @param {number[]} ids The token IDs to convert. * @returns {string[]} The converted tokens. */ convert_ids_to_tokens(ids) { @@ -90,16 +227,16 @@ class TokenizerModel extends Callable { */ class WordPieceTokenizer extends TokenizerModel { /** - * @param {Object} config - The configuration object. - * @param {Object.} config.vocab - A mapping of tokens to ids. - * @param {string} config.unk_token - The unknown token string. - * @param {string} config.continuing_subword_prefix - The prefix to use for continuing subwords. + * @param {Object} config The configuration object. + * @param {Map} config.vocab A mapping of tokens to ids. + * @param {string} config.unk_token The unknown token string. + * @param {string} config.continuing_subword_prefix The prefix to use for continuing subwords. */ constructor(config) { super(config); /** * A mapping of tokens to ids. - * @type {Object.} + * @type {Map} */ this.tokens_to_ids = config.vocab; @@ -107,7 +244,7 @@ class WordPieceTokenizer extends TokenizerModel { * The id of the unknown token. * @type {number} */ - this.unk_token_id = this.tokens_to_ids[config.unk_token]; + this.unk_token_id = this.tokens_to_ids.get(config.unk_token); /** * The unknown token string. @@ -115,22 +252,20 @@ class WordPieceTokenizer extends TokenizerModel { */ this.unk_token = config.unk_token; - let e = Object.entries(this.tokens_to_ids); - /** * An array of tokens. * @type {string[]} */ - this.vocab = Array(e.length); + this.vocab = new Array(this.tokens_to_ids.size); - for (const [key, value] of e) { + for (const [key, value] of this.tokens_to_ids) { this.vocab[value] = key; } } /** * Encodes an array of tokens using WordPiece encoding. - * @param {Array} tokens - The tokens to encode. + * @param {Array} tokens The tokens to encode. * @returns {Array} An array of encoded tokens. */ encode(tokens) { @@ -155,14 +290,14 @@ class WordPieceTokenizer extends TokenizerModel { if (start > 0) { substr = this.config.continuing_subword_prefix + substr; } - if (this.vocab.includes(substr)) { + if (this.tokens_to_ids.has(substr)) { currentSubstring = substr; break; } --end; } - if (currentSubstring == null) { + if (currentSubstring === null) { isUnknown = true; break; } @@ -188,39 +323,51 @@ class WordPieceTokenizer extends TokenizerModel { class Unigram extends TokenizerModel { /** * Create a new Unigram tokenizer model. - * @param {object} config - The configuration object for the Unigram model. - * @param {object} moreConfig - Additional configuration object for the Unigram model. + * @param {Object} config The configuration object for the Unigram model. + * @param {number} config.unk_id The ID of the unknown token + * @param {Map} config.vocab A mapping of tokens to scores. + * @param {Object} moreConfig Additional configuration object for the Unigram model. */ constructor(config, moreConfig) { super(config); - this.vocab = config.vocab.map(x => x[0]); - this.scores = config.vocab.map(x => x[1]); + this.vocab = new Array(config.vocab.size); + this.scores = new Array(config.vocab.size); + let count = 0; + config.vocab.forEach((value, key) => { + this.vocab[count] = key; + this.scores[count] = value; + ++count; + }); this.unk_token_id = config.unk_id; this.unk_token = this.vocab[config.unk_id]; - this.tokens_to_ids = Object.fromEntries(this.vocab.map((x, i) => [x, i])); + this.tokens_to_ids = new Map(this.vocab.map((x, i) => [x, i])); this.bosToken = ' '; // beginning of a sentence token - this.bosTokenId = this.tokens_to_ids[this.bosToken]; + this.bosTokenId = this.tokens_to_ids.get(this.bosToken); // NOTE: may be undefined this.eosToken = moreConfig.eos_token; - this.eosTokenId = this.tokens_to_ids[this.eosToken]; + this.eosTokenId = this.tokens_to_ids.get(this.eosToken); this.unkToken = this.vocab[this.unk_token_id]; - this.minScore = min(this.scores); + this.minScore = min(this.scores)[0]; this.unkScore = this.minScore - 10.0; this.scores[this.unk_token_id] = this.unkScore; this.trie = new CharTrie(); - this.trie.extend(this.vocab) + this.trie.extend(this.vocab); + + // NOTE: `fuse_unk` is hardcoded to true for Unigram models + // See: https://github.com/huggingface/tokenizers/blob/b58227c7f1ccf8b73ee2268354336da56d91e492/tokenizers/src/models/unigram/model.rs#L119 + this.fuse_unk = true; } /** * Populates lattice nodes. - * @param {TokenLattice} lattice - The token lattice to populate with nodes. + * @param {TokenLattice} lattice The token lattice to populate with nodes. */ populateNodes(lattice) { const sentence = lattice.sentence; @@ -230,14 +377,14 @@ class Unigram extends TokenizerModel { const mblen = 1; let hasSingleNode = false; const tokens = []; - // TODO: fix error below + for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) { tokens.push(token); - const tokenId = this.tokens_to_ids[token]; + const tokenId = this.tokens_to_ids.get(token); const tokenScore = this.scores[tokenId]; const n = token.length; lattice.insert(beginPos, n, tokenScore, tokenId); - if (!hasSingleNode && n == mblen) { + if (!hasSingleNode && n === mblen) { hasSingleNode = true; } } @@ -251,7 +398,7 @@ class Unigram extends TokenizerModel { /** * Encodes an array of tokens into an array of subtokens using the unigram model. * - * @param {string} normalized - The normalized string. + * @param {string} normalized The normalized string. * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model. */ tokenize(normalized) { @@ -262,7 +409,7 @@ class Unigram extends TokenizerModel { /** * Encodes an array of tokens using WordPiece encoding. - * @param {Array} tokens - The tokens to encode. + * @param {Array} tokens The tokens to encode. * @returns {Array} An array of encoded tokens. */ encode(tokens) { @@ -293,7 +440,7 @@ const BYTES_TO_UNICODE = (() => { ]; let cs = bs.slice(); let n = 0; - for (let b = 0; b < 256; b++) { + for (let b = 0; b < 256; ++b) { if (!bs.includes(b)) { bs.push(b); cs.push(256 + n); @@ -313,23 +460,22 @@ const UNICODE_TO_BYTES = reverseDictionary(BYTES_TO_UNICODE); class BPE extends TokenizerModel { /** * Create a BPE instance. - * @param {Object} config - The configuration object for BPE. - * @param {Object} config.vocab - A dictionary containing the vocabulary with tokens as keys and their corresponding indices as values. - * @param {string} config.unk_token - The unknown token used for out of vocabulary words. - * @param {Array} config.merges - An array of BPE merges as strings. + * @param {Object} config The configuration object for BPE. + * @param {Map} config.vocab A mapping of tokens to ids. + * @param {string} config.unk_token The unknown token used for out of vocabulary words. + * @param {string} config.end_of_word_suffix The suffix to place at the end of each word. + * @param {Array} config.merges An array of BPE merges as strings. */ constructor(config) { super(config); this.tokens_to_ids = config.vocab; - this.unk_token_id = this.tokens_to_ids[config.unk_token]; + this.unk_token_id = this.tokens_to_ids.get(config.unk_token); this.unk_token = config.unk_token; - let e = Object.entries(this.tokens_to_ids); - this.vocab = Array(e.length); - - for (const [key, value] of e) { + this.vocab = new Array(this.tokens_to_ids.size); + for (const [key, value] of this.tokens_to_ids) { this.vocab[value] = key; } @@ -338,33 +484,37 @@ class BPE extends TokenizerModel { this.end_of_word_suffix = config.end_of_word_suffix; - this.byte_encoder = BYTES_TO_UNICODE; - this.text_encoder = new TextEncoder(); + this.byte_fallback = this.config.byte_fallback ?? false; - this.cache = {} + if (this.byte_fallback) { + this.text_encoder = new TextEncoder(); + } + + this.cache = Object.create(null); + + this.fuse_unk ??= this.config.fuse_unk; } /** * Get all the possible pairs of characters in a word. - * @param {string[]} word - The word to get pairs from. - * @returns {Array} - An array of pairs. + * @param {string[]} word The word to get pairs from. + * @returns {Array} An array of pairs. */ get_pairs(word) { let pairs = new Set(); let prev_char = word[0]; - for (let i = 1; i < word.length; i++) { + for (let i = 1; i < word.length; ++i) { let char = word[i]; pairs.add(`${prev_char} ${char}`); prev_char = char; } - // TODO: fix error below - return [...pairs]; + return Array.from(pairs); } /** * Apply Byte-Pair-Encoding (BPE) to a given token. - * @param {string} token - The token to encode. - * @returns {string} - The BPE encoded token. + * @param {string} token The token to encode. + * @returns {string} The BPE encoded token. */ bpe(token) { if (token in this.cache) { @@ -430,16 +580,29 @@ class BPE extends TokenizerModel { /** * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens. - * @param {Array} tokens - The input sequence of tokens to encode. - * @returns {Array} - The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens. + * @param {Array} tokens The input sequence of tokens to encode. + * @returns {Array} The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens. */ encode(tokens) { let outputTokens = []; for (let token of tokens) { - token = Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join(''); let bpe_token_list = this.bpe(token).split(' '); - outputTokens.push(...bpe_token_list); + + for (let t of bpe_token_list) { + if (this.tokens_to_ids.has(t)) { + outputTokens.push(t); + } else { + if (this.byte_fallback) { + outputTokens.push( + ...Array.from(this.text_encoder.encode(t)) + .map(x => `<0x${x.toString(16).toUpperCase().padStart(2, '0')}>`) + ); + } else { + outputTokens.push(this.unk_token); + } + } + } } return outputTokens; @@ -453,7 +616,7 @@ class BPE extends TokenizerModel { */ class Normalizer extends Callable { /** - * @param {object} config - The configuration object for the normalizer. + * @param {Object} config The configuration object for the normalizer. */ constructor(config) { super(); @@ -463,9 +626,9 @@ class Normalizer extends Callable { /** * Factory method for creating normalizers from config objects. * @static - * @param {object} config - The configuration object for the normalizer. - * @returns {Normalizer} - A Normalizer object. - * @throws {Error} - If an unknown Normalizer type is specified in the config. + * @param {Object} config The configuration object for the normalizer. + * @returns {Normalizer} A Normalizer object. + * @throws {Error} If an unknown Normalizer type is specified in the config. */ static fromConfig(config) { if (config === null) return null; @@ -486,6 +649,8 @@ class Normalizer extends Callable { return new StripAccents(config); case 'Lowercase': return new Lowercase(config); + case 'Prepend': + return new Prepend(config); default: throw new Error(`Unknown Normalizer type: ${config.type}`); } @@ -494,9 +659,9 @@ class Normalizer extends Callable { /** * Normalize the input text. * @abstract - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. - * @throws {Error} - If this method is not implemented in a subclass. + * @param {string} text The text to normalize. + * @returns {string} The normalized text. + * @throws {Error} If this method is not implemented in a subclass. */ normalize(text) { throw Error("normalize should be implemented in subclass.") @@ -504,8 +669,8 @@ class Normalizer extends Callable { /** * Alias for {@link Normalizer#normalize}. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. + * @param {string} text The text to normalize. + * @returns {string} The normalized text. */ _call(text) { return this.normalize(text); @@ -520,20 +685,17 @@ class Normalizer extends Callable { class Replace extends Normalizer { /** * Normalize the input text by replacing the pattern with the content. - * @param {string} text - The input text to be normalized. + * @param {string} text The input text to be normalized. * @returns {string} The normalized text after replacing the pattern with the content. */ normalize(text) { - if (this.config.pattern.Regex) { - text = text.replace(new RegExp(this.config.pattern.Regex, 'g'), this.config.content) - - } else if (this.config.pattern.String) { - text = text.replace(this.config.pattern.String, this.config.content) - - } else { - console.warn('Unknown pattern type:', this.config.pattern) + let pattern = createPattern(this.config.pattern); + if (pattern === null) { + return text; } + text = text.replaceAll(pattern, this.config.content) + return text; } } @@ -545,7 +707,7 @@ class Replace extends Normalizer { class NFC extends Normalizer { /** * Normalize the input text by applying Unicode normalization form C (NFC). - * @param {string} text - The input text to be normalized. + * @param {string} text The input text to be normalized. * @returns {string} The normalized text. */ normalize(text) { @@ -561,7 +723,7 @@ class NFC extends Normalizer { class NFKD extends Normalizer { /** * Normalize text using NFKD normalization. - * @param {string} text - The text to be normalized. + * @param {string} text The text to be normalized. * @returns {string} The normalized text. */ normalize(text) { @@ -577,7 +739,7 @@ class NFKD extends Normalizer { class StripAccents extends Normalizer { /** * Remove all accents from the text. - * @param {string} text - The input text. + * @param {string} text The input text. * @returns {string} The normalized text without accents. */ normalize(text) { @@ -593,7 +755,7 @@ class StripAccents extends Normalizer { class Lowercase extends Normalizer { /** * Lowercases the input string. - * @param {string} text - The text to normalize. + * @param {string} text The text to normalize. * @returns {string} The normalized text. */ normalize(text) { @@ -602,6 +764,22 @@ class Lowercase extends Normalizer { } } +/** + * A Normalizer that prepends a string to the input string. + * @extends Normalizer + */ +class Prepend extends Normalizer { + /** + * Prepends the input string. + * @param {string} text The text to normalize. + * @returns {string} The normalized text. + */ + normalize(text) { + text = this.config.prepend + text; + return text; + } +} + /** * A Normalizer that applies a sequence of Normalizers. * @extends Normalizer @@ -609,8 +787,8 @@ class Lowercase extends Normalizer { class NormalizerSequence extends Normalizer { /** * Create a new instance of NormalizerSequence. - * @param {object} config - The configuration object. - * @param {object[]} config.normalizers - An array of Normalizer configuration objects. + * @param {Object} config The configuration object. + * @param {Object[]} config.normalizers An array of Normalizer configuration objects. */ constructor(config) { super(config); @@ -618,15 +796,13 @@ class NormalizerSequence extends Normalizer { } /** * Apply a sequence of Normalizers to the input text. - * @param {string} text - The text to normalize. + * @param {string} text The text to normalize. * @returns {string} The normalized text. */ normalize(text) { - // TODO use reduce? - for (let normalizer of this.normalizers) { - text = normalizer.normalize(text); - } - return text; + return this.normalizers.reduce((t, normalizer) => { + return normalizer.normalize(t); + }, text); } } @@ -638,8 +814,8 @@ class BertNormalizer extends Normalizer { /** * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text. * - * @param {string} text - The input text to tokenize. - * @returns {string} - The tokenized text with whitespace added around CJK characters. + * @param {string} text The input text to tokenize. + * @returns {string} The tokenized text with whitespace added around CJK characters. */ _tokenize_chinese_chars(text) { /* Adds whitespace around any CJK character. */ @@ -669,8 +845,8 @@ class BertNormalizer extends Normalizer { * Those alphabets are used to write space-separated words, so they are not treated specially * and are handled like all other languages. * - * @param {number} cp - The Unicode codepoint to check. - * @returns {boolean} - True if the codepoint represents a CJK character, false otherwise. + * @param {number} cp The Unicode codepoint to check. + * @returns {boolean} True if the codepoint represents a CJK character, false otherwise. */ _is_chinese_char(cp) { return ( @@ -686,8 +862,8 @@ class BertNormalizer extends Normalizer { } /** * Strips accents from the given text. - * @param {string} text - The text to strip accents from. - * @returns {string} - The text with accents removed. + * @param {string} text The text to strip accents from. + * @returns {string} The text with accents removed. */ stripAccents(text) { return text.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); @@ -695,8 +871,8 @@ class BertNormalizer extends Normalizer { /** * Normalizes the given text based on the configuration. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. + * @param {string} text The text to normalize. + * @returns {string} The normalized text. */ normalize(text) { // TODO use rest of config @@ -733,11 +909,13 @@ class PreTokenizer extends Callable { * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration. * * @static - * @param {Object} config - A configuration object for the pre-tokenizer. + * @param {Object} config A configuration object for the pre-tokenizer. * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`. * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer. */ static fromConfig(config) { + if (config === null) return null; + switch (config.type) { case 'BertPreTokenizer': return new BertPreTokenizer(config); @@ -762,7 +940,7 @@ class PreTokenizer extends Callable { * Method that should be implemented by subclasses to define the specific pre-tokenization logic. * * @abstract - * @param {string} text - The text to pre-tokenize. + * @param {string} text The text to pre-tokenize. * @returns {string[]} The pre-tokenized text. * @throws {Error} If the method is not implemented in the subclass. */ @@ -772,7 +950,7 @@ class PreTokenizer extends Callable { /** * Tokenizes the given text into pre-tokens. - * @param {string|string[]} text - The text or array of texts to pre-tokenize. + * @param {string|string[]} text The text or array of texts to pre-tokenize. * @returns {string[]} An array of pre-tokens. */ pre_tokenize(text) { @@ -787,7 +965,7 @@ class PreTokenizer extends Callable { /** * Alias for {@link PreTokenizer#pre_tokenize}. - * @param {string|string[]} text - The text or array of texts to pre-tokenize. + * @param {string|string[]} text The text or array of texts to pre-tokenize. * @returns {string[]} An array of pre-tokens. */ _call(text) { @@ -803,18 +981,18 @@ class BertPreTokenizer extends PreTokenizer { * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme * similar to that used in the original implementation of BERT. * - * @param {object} config - The configuration object. + * @param {Object} config The configuration object. */ constructor(config) { super(); // TODO use config - this.pattern = /\b\p{L}+\b|[^\s\p{L}]+/gu + this.pattern = /\p{L}+|[^\s\p{L}]/gu; } /** * Tokenizes a single text using the BERT pre-tokenization scheme. * - * @param {string} text - The text to tokenize. - * @returns {Array.} - An array of tokens. + * @param {string} text The text to tokenize. + * @returns {Array} An array of tokens. */ pre_tokenize_text(text) { // Split on whitespace and punctuation @@ -829,22 +1007,55 @@ class BertPreTokenizer extends PreTokenizer { class ByteLevelPreTokenizer extends PreTokenizer { /** * Creates a new instance of the `ByteLevelPreTokenizer` class. - * @param {Object} config - The configuration object. + * @param {Object} config The configuration object. */ constructor(config) { super(); - // TODO use config + this.config = config; + + /** + * @type {boolean} Whether to add a leading space to the first word. + * This allows to treat the leading word just as any other word. + */ + this.add_prefix_space = this.config.add_prefix_space; + + /** + * @type {boolean} Whether the post processing step should trim offsets + * to avoid including whitespaces. + * @todo Use this in the pretokenization step. + */ + this.trim_offsets = this.config.trim_offsets; + + /** + * @type {boolean} Whether to use the standard GPT2 regex for whitespace splitting. + * Set it to False if you want to use your own splitting. Defaults to true. + */ + this.use_regex = this.config.use_regex ?? true; this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu; + + this.byte_encoder = BYTES_TO_UNICODE; + this.text_encoder = new TextEncoder(); } /** * Tokenizes a single piece of text using byte-level tokenization. - * @param {string} text - The text to tokenize. - * @returns {string[]} - An array of tokens. + * @param {string} text The text to tokenize. + * @returns {string[]} An array of tokens. */ pre_tokenize_text(text) { // Split on whitespace and punctuation - return text.match(this.pattern) || []; + let tokens = this.use_regex ? (text.match(this.pattern) || []) : [text]; + + return tokens.map(token => { + if (this.add_prefix_space && !token.startsWith(' ')) { + token = ' ' + token; + } + + // Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case) + token = Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join(''); + + return token; + }); } } @@ -854,8 +1065,11 @@ class ByteLevelPreTokenizer extends PreTokenizer { */ class SplitPreTokenizer extends PreTokenizer { /** - * @param {Object} config - The configuration options for the pre-tokenizer. - * @param {Object} config.pattern - The pattern used to split the text. Can be a string or a regex object. + * @param {Object} config The configuration options for the pre-tokenizer. + * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object. + * @param {string|undefined} config.pattern.String The string to use for splitting. Only defined if the pattern is a string. + * @param {string|undefined} config.pattern.Regex The regex to use for splitting. Only defined if the pattern is a regex. + * @param {'isolated'|'removed'} config.behavior The behavior to use when splitting. */ constructor(config) { super(); @@ -864,23 +1078,26 @@ class SplitPreTokenizer extends PreTokenizer { /** * Tokenizes text by splitting it using the given pattern. - * @param {string} text - The text to tokenize. + * @param {string} text The text to tokenize. * @returns {string[]} An array of tokens. */ pre_tokenize_text(text) { - if (this.config.pattern.Regex) { - return text.match(new RegExp(this.config.pattern.Regex, 'gu')) || []; - - } else if (this.config.pattern.String) { - return text.match(this.config.pattern.String) || []; - - } else { - console.warn('Unknown pattern type:', this.config.pattern) + let pattern = createPattern(this.config.pattern); + if (pattern === null) { + return []; } - return []; + switch (this.config.behavior.toLowerCase()) { + // TODO add merged_with_previous, merged_with_next, contiguous + // TODO these should act slightly differently. Currently, we haven't found a tokenizer which produces different results. + case 'isolated': + case 'removed': + return text.match(pattern) || []; + default: + console.warn(`Unknown split behavior: "${this.config.behavior}"`) + return []; + } } - } /** @@ -888,10 +1105,18 @@ class SplitPreTokenizer extends PreTokenizer { */ class PostProcessor extends Callable { + /** + * @param {Object} config The configuration for the post-processor. + */ + constructor(config) { + super(); + this.config = config; + } + /** * Factory method to create a PostProcessor object from a configuration object. * - * @param {Object} config - Configuration object representing a PostProcessor. + * @param {Object} config Configuration object representing a PostProcessor. * @returns {PostProcessor} A PostProcessor object created from the given configuration. * @throws {Error} If an unknown PostProcessor type is encountered. */ @@ -914,8 +1139,8 @@ class PostProcessor extends Callable { /** * Method to be implemented in subclass to apply post-processing on the given tokens. * - * @param {Array} tokens - The input tokens to be post-processed. - * @param {...*} args - Additional arguments required by the post-processing logic. + * @param {Array} tokens The input tokens to be post-processed. + * @param {...*} args Additional arguments required by the post-processing logic. * @returns {Array} The post-processed tokens. * @throws {Error} If the method is not implemented in subclass. */ @@ -925,8 +1150,8 @@ class PostProcessor extends Callable { /** * Alias for {@link PostProcessor#post_process}. - * @param {Array} tokens - The text or array of texts to post-process. - * @param {...*} args - Additional arguments required by the post-processing logic. + * @param {Array} tokens The text or array of texts to post-process. + * @param {...*} args Additional arguments required by the post-processing logic. * @returns {Array} An array of post-processed tokens. */ _call(tokens, ...args) { @@ -940,32 +1165,31 @@ class PostProcessor extends Callable { */ class RobertaProcessing extends PostProcessor { /** - * @param {Object} config - The configuration for the post-processor. - * @param {string[]} config.cls - The special tokens to add to the beginning of the input. - * @param {string[]} config.sep - The special tokens to add to the end of the input. + * @param {Object} config The configuration for the post-processor. + * @param {string[]} config.cls The special tokens to add to the beginning of the input. + * @param {string[]} config.sep The special tokens to add to the end of the input. */ constructor(config) { - super(); - this.config = config; - - // TODO use all of config: - // add_prefix_space, cls, sep, trim_offsets + super(config); + // TODO use all of config: add_prefix_space, trim_offsets + this.cls = config.cls[0]; + this.sep = config.sep[0]; } /** * Adds the special tokens to the beginning and end of the input. - * @param {string[]} tokens - The input tokens. - * @param {string[]|null} tokens_pair - An optional second set of input tokens. + * @param {string[]} tokens The input tokens. + * @param {string[]|null} tokens_pair An optional second set of input tokens. * @returns {string[]} The input tokens with the special tokens added to the beginning and end. */ post_process(tokens, tokens_pair = null) { - tokens = [this.config.cls[0], ...tokens, this.config.sep[0]] + tokens = [this.cls, ...tokens, this.sep] // NOTE: It is intended to add 2 EOS tokens after the first set of tokens // https://github.com/huggingface/tokenizers/issues/983 if (tokens_pair !== null) { - tokens = [...tokens, this.config.sep[0], ...tokens_pair, this.config.sep[0]] + tokens = [...tokens, this.sep, ...tokens_pair, this.sep] } return tokens; } @@ -978,23 +1202,25 @@ class RobertaProcessing extends PostProcessor { class TemplateProcessing extends PostProcessor { /** * Creates a new instance of `TemplateProcessing`. - * @param {Object} config - The configuration options for the post processor. - * @param {Array} config.single - The template for a single sequence of tokens. - * @param {Array} config.pair - The template for a pair of sequences of tokens. + * @param {Object} config The configuration options for the post processor. + * @param {Array} config.single The template for a single sequence of tokens. + * @param {Array} config.pair The template for a pair of sequences of tokens. */ constructor(config) { - super(); - this.config = config; + super(config); + + this.single = config.single; + this.pair = config.pair; } /** * Replaces special tokens in the template with actual tokens. - * @param {Array} tokens - The list of tokens for the first sequence. - * @param {Array} [tokens_pair=null] - The list of tokens for the second sequence (optional). - * @returns {Array} - The list of tokens with the special tokens replaced with actual tokens. + * @param {Array} tokens The list of tokens for the first sequence. + * @param {Array} [tokens_pair=null] The list of tokens for the second sequence (optional). + * @returns {Array} The list of tokens with the special tokens replaced with actual tokens. */ post_process(tokens, tokens_pair = null) { - let type = tokens_pair === null ? this.config.single : this.config.pair + let type = tokens_pair === null ? this.single : this.pair let toReturn = []; for (let item of type) { @@ -1019,18 +1245,9 @@ class TemplateProcessing extends PostProcessor { * @extends PostProcessor */ class ByteLevelPostProcessor extends PostProcessor { - /** - * Create a new instance of ByteLevelPostProcessor. - * @param {object} config - Configuration object. - */ - constructor(config) { - super(); - this.config = config; - } - /** * Post process the given tokens. - * @param {string[]} tokens - The tokens to be post processed. + * @param {string[]} tokens The tokens to be post processed. * @returns {string[]} The post processed tokens. */ post_process(tokens) { @@ -1047,17 +1264,21 @@ class Decoder extends Callable { /** * Creates an instance of `Decoder`. * - * @param {Object} config - The configuration object. + * @param {Object} config The configuration object. */ constructor(config) { super(); this.config = config; + + this.added_tokens = []; + this.end_of_word_suffix = null; + this.trim_offsets = config.trim_offsets; } /** * Creates a decoder instance based on the provided configuration. * - * @param {Object} config - The configuration object. + * @param {Object} config The configuration object. * @returns {Decoder} A decoder instance. * @throws {Error} If an unknown decoder type is provided. */ @@ -1069,25 +1290,28 @@ class Decoder extends Callable { return new MetaspaceDecoder(config); case 'ByteLevel': return new ByteLevelDecoder(config); + + case 'Replace': + return new ReplaceDecoder(config); + case 'ByteFallback': + return new ByteFallback(config); + case 'Fuse': + return new FuseDecoder(config); + case 'Strip': + return new StripDecoder(config); + + case 'Sequence': + return new DecoderSequence(config); + default: throw new Error(`Unknown Decoder type: ${config.type}`); } } - /** - * Converts a list of tokens to a string. - * - * @param {string[]} tokens - The list of tokens. - * @returns {string} The decoded string. - */ - convert_tokens_to_string(tokens) { - return tokens.join('').trim(); - } - /** * Calls the `decode` method. * - * @param {string[]} tokens - The list of tokens. + * @param {string[]} tokens The list of tokens. * @returns {string} The decoded string. */ _call(tokens) { @@ -1096,15 +1320,137 @@ class Decoder extends Callable { /** * Decodes a list of tokens. - * @param {string[]} tokens - The list of tokens. + * @param {string[]} tokens The list of tokens. * @returns {string} The decoded string. - * @throws {Error} If the `decode` method is not implemented in the subclass. */ decode(tokens) { - throw Error("decode should be implemented in subclass.") + return this.decode_chain(tokens).join(''); + } + + /** + * Apply the decoder to a list of tokens. + * + * @param {string[]} tokens The list of tokens. + * @returns {string[]} The decoded list of tokens. + * @throws {Error} If the `decode_chain` method is not implemented in the subclass. + */ + decode_chain(tokens) { + throw Error("`decode_chain` should be implemented in subclass.") + } + +} + +class ReplaceDecoder extends Decoder { + constructor(config) { + super(config); + } + + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { + let pattern = createPattern(this.config.pattern); + if (pattern === null) { + return tokens; + } + + return tokens.map(token => token.replaceAll(pattern, this.config.content)) + } +} + + +class ByteFallback extends Decoder { + constructor(config) { + super(config); + + this.text_decoder = new TextDecoder(); + } + + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { + + let new_tokens = []; + let previous_byte_tokens = []; + + for (let token of tokens) { + let bytes = null; + if (token.length === 6 && token.startsWith('<0x') && token.endsWith('>')) { + let byte = parseInt(token.slice(3, 5), 16); + if (!isNaN(byte)) { + bytes = byte; + } + } + if (bytes !== null) { + previous_byte_tokens.push(bytes); + } else { + if (previous_byte_tokens.length > 0) { + let string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens)); + new_tokens.push(string); + previous_byte_tokens = []; + } + new_tokens.push(token); + } + } + if (previous_byte_tokens.length > 0) { + let string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens)); + new_tokens.push(string); + previous_byte_tokens = []; + } + + return new_tokens; + } +} + +/** + * Fuse simply fuses all tokens into one big string. + * It's usually the last decoding step anyway, but this decoder + * exists incase some decoders need to happen after that step + */ +class FuseDecoder extends Decoder { + constructor(config) { + super(config); + } + + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { + return [tokens.join('')]; + } +} + +class StripDecoder extends Decoder { + constructor(config) { + super(config); + + this.content = this.config.content; + this.start = this.config.start; + this.stop = this.config.stop; } + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { + return tokens.map(token => { + let start_cut = 0; + for (let i = 0; i < this.start; ++i) { + if (token[i] === this.content) { + start_cut = i + 1; + continue; + } else { + break; + } + } + let stop_cut = token.length; + for (let i = 0; i < this.stop; ++i) { + const index = token.length - i - 1; + if (token[index] === this.content) { + stop_cut = index; + continue; + } else { + break; + } + } + + return token.slice(start_cut, stop_cut) + }); + } } /** @@ -1115,32 +1461,32 @@ class WordPieceDecoder extends Decoder { /** * Creates a new instance of WordPieceDecoder. - * @param {Object} config - The configuration object. - * @param {string} config.prefix - The prefix used for WordPiece encoding. - * @param {boolean} config.cleanup - Whether to cleanup the decoded string. + * @param {Object} config The configuration object. + * @param {string} config.prefix The prefix used for WordPiece encoding. + * @param {boolean} config.cleanup Whether to cleanup the decoded string. */ constructor(config) { super(config); - this.convertRegex = new RegExp(` ${config.prefix}`, 'g'); this.cleanup = config.cleanup; } - /** - * Converts a list of WordPiece tokens to a single string. - * @param {Array} tokens - The list of WordPiece tokens. - * @returns {string} The decoded string. - */ - convert_tokens_to_string(tokens) { - return tokens.join(' ').replace(this.convertRegex, '').trim(); - } + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { + return tokens.map((token, i) => { + if (i !== 0) { + if (token.startsWith(this.config.prefix)) { + // NOTE: .replace() is intended; only replace first occurrence + token = token.replace(this.config.prefix, ''); + } else { + token = ' ' + token; + } + } + if (this.cleanup) { + token = clean_up_tokenization(token) + } - /** - * Decodes a list of WordPiece tokens into a single string. - * @param {Array} tokens - The list of WordPiece tokens. - * @returns {string} The decoded string. - */ - decode(tokens) { - return this.convert_tokens_to_string(tokens); + return token; + }); } } @@ -1152,7 +1498,7 @@ class ByteLevelDecoder extends Decoder { /** * Create a `ByteLevelDecoder` object. - * @param {object} config - Configuration object. + * @param {Object} config Configuration object. */ constructor(config) { super(config); @@ -1168,34 +1514,19 @@ class ByteLevelDecoder extends Decoder { /** * Convert an array of tokens to string by decoding each byte. - * @param {string[]} tokens - Array of tokens to be decoded. - * @returns {string} - The decoded string. + * @param {string[]} tokens Array of tokens to be decoded. + * @returns {string} The decoded string. */ convert_tokens_to_string(tokens) { let text = tokens.join(''); - if (this.config.trim_offsets) { - text = text.trim(); - } else if (this.config.add_prefix_space) { - text = ' ' + text; - } - - // @ts-ignore let byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c])); let decoded_text = this.text_decoder.decode(byteArray); - - if (this.end_of_word_suffix) { - decoded_text = decoded_text.replaceAll(this.end_of_word_suffix, ' ').trim(); - } return decoded_text; } - /** - * Decode an array of tokens to string. - * @param {string[]} tokens - Array of tokens to be decoded. - * @returns {string} - The decoded string. - */ - decode(tokens) { + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { // TODO move to base class (like HF) // tokens === filtered_tokens @@ -1225,12 +1556,38 @@ class ByteLevelDecoder extends Decoder { } // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options - let text = sub_texts.join(''); - return text; + return sub_texts; } } + +/** + * Apply a sequence of decoders. + * @extends Decoder + */ +class DecoderSequence extends Decoder { + + /** + * Creates a new instance of DecoderSequence. + * @param {Object} config The configuration object. + * @param {Decoder[]} config.decoders The list of decoders to apply. + */ + constructor(config) { + super(config); + this.decoders = config.decoders.map(x => Decoder.fromConfig(x)); + } + + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { + // Use reduce to apply each decoder to the tokens + return this.decoders.reduce((toks, decoder) => { + return decoder.decode_chain(toks); + }, tokens); + } + +} + /** * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested, * and returns a list of tokens. @@ -1238,10 +1595,10 @@ class ByteLevelDecoder extends Decoder { */ class MetaspacePreTokenizer extends PreTokenizer { /** - * @param {Object} config - The configuration object for the MetaspacePreTokenizer. - * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the first token. - * @param {string} config.replacement - The character to replace spaces with. - * @param {string} [config.str_rep=config.replacement] - An optional string representation of the replacement character. + * @param {Object} config The configuration object for the MetaspacePreTokenizer. + * @param {boolean} config.add_prefix_space Whether to add a prefix space to the first token. + * @param {string} config.replacement The character to replace spaces with. + * @param {string} [config.str_rep=config.replacement] An optional string representation of the replacement character. */ constructor(config) { super(); @@ -1254,18 +1611,20 @@ class MetaspacePreTokenizer extends PreTokenizer { /** * This method takes a list of normalized tokens, replaces spaces with the replacement character, * adds a prefix space if requested, and returns a new list of tokens. - * @param {string[]|string} normalizedTokens - The list of normalized tokens to pre-tokenize. + * @param {string[]|string} normalizedTokens The list of normalized tokens to pre-tokenize. * @returns {string[]} A new list of pre-tokenized tokens. */ pre_tokenize(normalizedTokens) { - if (typeof normalizedTokens === 'string' || normalizedTokens instanceof String) { + if (typeof normalizedTokens === 'string') { // Metaspace acts on a list of tokens. If passing in a string, first split on whitespace - normalizedTokens = normalizedTokens.split(/\s+/); + // NOTE: For some reason, metaspace includes trailing whitespace, so we only trim leading whitespace. + // See: https://github.com/huggingface/tokenizers/issues/1250 + normalizedTokens = normalizedTokens.trimStart().split(/\s+/); } const result = []; for (let token of normalizedTokens) { - let normalized = token.replace(' ', this.strRep); + let normalized = token.replaceAll(' ', this.strRep); if (this.addPrefixSpace && !normalized.startsWith(this.replacement)) { normalized = this.strRep + normalized; } @@ -1282,9 +1641,9 @@ class MetaspacePreTokenizer extends PreTokenizer { class MetaspaceDecoder extends Decoder { /** * Constructs a new MetaspaceDecoder object. - * @param {Object} config - The configuration object for the MetaspaceDecoder. - * @param {boolean} config.add_prefix_space - Whether to add a prefix space to the decoded string. - * @param {string} config.replacement - The string to replace spaces with. + * @param {Object} config The configuration object for the MetaspaceDecoder. + * @param {boolean} config.add_prefix_space Whether to add a prefix space to the decoded string. + * @param {string} config.replacement The string to replace spaces with. */ constructor(config) { super(config); @@ -1293,24 +1652,17 @@ class MetaspaceDecoder extends Decoder { this.replacement = config.replacement; } - /** - * Decodes the given tokens back into a string. - * @param {Array} tokens - The tokens to decode. - * @returns {string} - The decoded string. - */ - decode(tokens) { + /** @type {Decoder['decode_chain']} */ + decode_chain(tokens) { let result = []; - let i = 0; - for (let token of tokens) { - let normalized = token.replace(this.replacement, ' '); + for (let i = 0; i < tokens.length; ++i) { + let normalized = tokens[i].replaceAll(this.replacement, ' '); if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) { normalized = normalized.substring(1); } result.push(normalized); - ++i; } - - return this.convert_tokens_to_string(result); + return result; } } @@ -1318,14 +1670,14 @@ class MetaspaceDecoder extends Decoder { * A normalizer that applies a precompiled charsmap. * This is useful for applying complex normalizations in C++ and exposing them to JavaScript. * @extends Normalizer - * @param {Object} config - The configuration object for the Precompiled normalizer. - * @param {Object} config.precompiled_charsmap - The precompiled charsmap object. + * @param {Object} config The configuration object for the Precompiled normalizer. + * @param {Object} config.precompiled_charsmap The precompiled charsmap object. */ class Precompiled extends Normalizer { /** * Create a new instance of Precompiled normalizer. - * @param {object} config - The configuration object. - * @param {any} config.precompiled_charsmap - Precompiled chars mapping. + * @param {Object} config The configuration object. + * @param {any} config.precompiled_charsmap Precompiled chars mapping. */ constructor(config) { super(config); @@ -1334,8 +1686,8 @@ class Precompiled extends Normalizer { /** * Normalizes the given text by applying the precompiled charsmap. - * @param {string} text - The text to normalize. - * @returns {string} - The normalized text. + * @param {string} text The text to normalize. + * @returns {string} The normalized text. */ normalize(text) { // TODO use this.charsmap @@ -1350,8 +1702,8 @@ class Precompiled extends Normalizer { class PreTokenizerSequence extends PreTokenizer { /** * Creates an instance of PreTokenizerSequence. - * @param {object} config - The configuration object for the pre-tokenizer sequence. - * @param {object[]} config.pretokenizers - An array of pre-tokenizer configurations. + * @param {Object} config The configuration object for the pre-tokenizer sequence. + * @param {Object[]} config.pretokenizers An array of pre-tokenizer configurations. */ constructor(config) { super(); @@ -1360,7 +1712,7 @@ class PreTokenizerSequence extends PreTokenizer { /** * Applies each pre-tokenizer in the sequence to the input text in turn. - * @param {string|string[]} text - The text(s) to pre-tokenize. + * @param {string|string[]} text The text(s) to pre-tokenize. * @returns {string[]} The pre-tokenized text. */ pre_tokenize_text(text) { @@ -1381,60 +1733,65 @@ class PreTokenizerSequence extends PreTokenizer { class WhitespaceSplit extends PreTokenizer { /** * Creates an instance of WhitespaceSplit. - * @param {object} config - The configuration object for the pre-tokenizer sequence. + * @param {Object} config The configuration object for the pre-tokenizer sequence. */ constructor(config) { super(); } /** * Pre-tokenizes the input text by splitting it on whitespace characters. - * @param {string} text - The text to be pre-tokenized. + * @param {string} text The text to be pre-tokenized. * @returns {string[]} An array of tokens produced by splitting the input text on whitespace. */ pre_tokenize_text(text) { - return text.split(/\s+/); + return whitespace_split(text); } } -class PreTrainedTokenizer extends Callable { +export class PreTrainedTokenizer extends Callable { /** * Create a new PreTrainedTokenizer instance. - * @param {Object} tokenizerJSON - The JSON of the tokenizer. - * @param {Object} tokenizerConfig - The config of the tokenizer. + * @param {Object} tokenizerJSON The JSON of the tokenizer. + * @param {Object} tokenizerConfig The config of the tokenizer. */ constructor(tokenizerJSON, tokenizerConfig) { super(); - this.tokenizerJSON = tokenizerJSON; - this.tokenizerConfig = tokenizerConfig; - + // Construct parts of the tokenizer from the JSON this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer); this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer); + + // Convert the vocabulary to a map, if it exists + if (tokenizerJSON.model.vocab) { + if (!Array.isArray(tokenizerJSON.model.vocab)) { + tokenizerJSON.model.vocab = Object.entries(tokenizerJSON.model.vocab); + } + tokenizerJSON.model.vocab = new Map(tokenizerJSON.model.vocab); + } this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig); this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor); - // TODO - maybe, allow this to be null; in which case, we use model as decoder too? + // TODO: maybe, allow this to be null; in which case, we use model as decoder too? this.decoder = Decoder.fromConfig(tokenizerJSON.decoder); - // Slight hack, but it prevents code duplication: - // Add added_tokens to this.decoder - this.decoder.added_tokens = []; // Another slight hack to add `end_of_word_suffix` (if present) to the decoder // This is needed for cases where BPE model and ByteLevel decoder are used // For more information, see https://github.com/xenova/transformers.js/issues/74 - // TODO - save this to the decoder when exporting? + // TODO: save this to the decoder when exporting? this.decoder.end_of_word_suffix = this.model.end_of_word_suffix; // Add added_tokens to model this.special_tokens = []; this.all_special_ids = []; + this.added_tokens = []; for (let addedToken of tokenizerJSON.added_tokens) { let id = addedToken.id; let content = addedToken.content; - this.decoder.added_tokens.push(content); - this.model.tokens_to_ids[content] = id; + this.added_tokens.push(content); + + this.model.tokens_to_ids.set(content, id); this.model.vocab[id] = content; if (addedToken.special) { @@ -1442,24 +1799,30 @@ class PreTrainedTokenizer extends Callable { this.all_special_ids.push(id); } } - this.special_tokens_regex = new RegExp( - '(' + this.special_tokens.map(escapeRegExp).join('|') + ')' - ); + // Slight hack, but it prevents code duplication: + this.decoder.added_tokens = this.added_tokens; + + this.added_tokens_regex = new RegExp( + '(' + this.added_tokens.map(escapeRegExp).join('|') + ')' + ); // Set mask token if present (otherwise will be undefined, which is fine) - this.mask_token = this.getToken('mask_token'); - this.mask_token_id = this.model.tokens_to_ids[this.mask_token]; + this.mask_token = this.getToken(tokenizerConfig, 'mask_token'); + this.mask_token_id = this.model.tokens_to_ids.get(this.mask_token); - this.pad_token = this.getToken('pad_token', 'eos_token'); - this.pad_token_id = this.model.tokens_to_ids[this.pad_token]; + this.pad_token = this.getToken(tokenizerConfig, 'pad_token', 'eos_token'); + this.pad_token_id = this.model.tokens_to_ids.get(this.pad_token); - this.sep_token = this.getToken('sep_token'); - this.sep_token_id = this.model.tokens_to_ids[this.sep_token]; + this.sep_token = this.getToken(tokenizerConfig, 'sep_token'); + this.sep_token_id = this.model.tokens_to_ids.get(this.sep_token); - this.model_max_length = this.tokenizerConfig.model_max_length; + this.model_max_length = tokenizerConfig.model_max_length; - this.remove_space = this.tokenizerConfig.remove_space; + /** @type {boolean} Whether or not to strip the text when tokenizing (removing excess spaces before and after the string). */ + this.remove_space = tokenizerConfig.remove_space; + + this.clean_up_tokenization_spaces = tokenizerConfig.clean_up_tokenization_spaces ?? true; // TODO allow user to change this this.padding_side = 'right'; @@ -1467,13 +1830,13 @@ class PreTrainedTokenizer extends Callable { /** * Returns the value of the first matching key in the tokenizer config object. - * @param {...string} keys - One or more keys to search for in the tokenizer config object. - * @returns {string|null} - The value associated with the first matching key, or null if no match is found. - * @throws {Error} - If an object is found for a matching key and its __type property is not "AddedToken". + * @param {...string} keys One or more keys to search for in the tokenizer config object. + * @returns {string|null} The value associated with the first matching key, or null if no match is found. + * @throws {Error} If an object is found for a matching key and its __type property is not "AddedToken". */ - getToken(...keys) { + getToken(tokenizerConfig, ...keys) { for (let key of keys) { - let item = this.tokenizerConfig[key]; + let item = tokenizerConfig[key]; if (!item) continue; @@ -1491,29 +1854,38 @@ class PreTrainedTokenizer extends Callable { } /** - * Creates a new Tokenizer instance with the tokenizer configuration and files - * downloaded from a pretrained model located at the given model path. - * - * @param {string} modelPath - The path to the pretrained model. - * @param {function} [progressCallback=null] - Optional callback function that will be called with the current - * progress percentage (0 to 100) each time a file is downloaded. - * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the modelPath. - */ - static async from_pretrained(modelPath, progressCallback = null) { - // TODO get files in parallel + * Loads a pre-trained tokenizer from the given `pretrained_model_name_or_path`. + * + * @param {string} pretrained_model_name_or_path The path to the pre-trained tokenizer. + * @param {PretrainedOptions} options Additional options for loading the tokenizer. For more information, @see {@link PreTrainedTokenizer.from_pretrained}. + * + * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the `pretrained_model_name_or_path`. + * @returns {Promise} A new instance of the `PreTrainedTokenizer` class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { - let [tokenizerJSON, tokenizerConfig] = await Promise.all([ - fetchJSON(modelPath, 'tokenizer.json', progressCallback), - fetchJSON(modelPath, 'tokenizer_config.json', progressCallback), - ]) + let info = await loadTokenizer(pretrained_model_name_or_path, { + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }) - return new this(tokenizerJSON, tokenizerConfig); + // @ts-ignore + return new this(...info); } /** * This function can be overridden by a subclass to apply additional preprocessing * to a model's input data. - * @param {Object} inputs - An object containing input data as properties. + * @param {Object} inputs An object containing input data as properties. * @returns {Object} The modified inputs object. */ prepare_model_inputs(inputs) { @@ -1522,14 +1894,14 @@ class PreTrainedTokenizer extends Callable { /** * Encode/tokenize the given text(s). - * @param {string|string[]} text - The text to tokenize. - * @param {object} options - An optional object containing the following properties: - * @param {string|string[]} [options.text_pair=null] - Optional second sequence to be encoded. If set, must be the same type as text. - * @param {boolean} [options.padding=false] - Whether to pad the input sequences. - * @param {boolean} [options.truncation=null] - Whether to truncate the input sequences. - * @param {number} [options.max_length=null] - Maximum length of the returned list and optionally padding length. - * @param {boolean} [options.return_tensor=true] - Whether to return the results as Tensors or arrays. - * @returns {{ input_ids: number[]|number[][]|Tensor; attention_mask: any[]|Tensor; }} Object to be passed to the model. + * @param {string|string[]} text The text to tokenize. + * @param {Object} options An optional object containing the following properties: + * @param {string|string[]} [options.text_pair=null] Optional second sequence to be encoded. If set, must be the same type as text. + * @param {boolean} [options.padding=false] Whether to pad the input sequences. + * @param {boolean} [options.truncation=null] Whether to truncate the input sequences. + * @param {number} [options.max_length=null] Maximum length of the returned list and optionally padding length. + * @param {boolean} [options.return_tensor=true] Whether to return the results as Tensors or arrays. + * @returns {{ input_ids: number[]|number[][]|Tensor, attention_mask: any[]|Tensor }} Object to be passed to the model. */ _call( // Required positional arguments @@ -1545,6 +1917,7 @@ class PreTrainedTokenizer extends Callable { return_tensor = true, // Different to HF } = {}, ) { + /** @type {number[]|number[][]|Tensor} */ let tokens; @@ -1562,7 +1935,7 @@ class PreTrainedTokenizer extends Callable { } tokens = text.map( - (text, i) => this.encode(text, text_pair[i]) + (t, i) => this.encode(t, text_pair[i]) ) } else { @@ -1577,6 +1950,8 @@ class PreTrainedTokenizer extends Callable { if (Array.isArray(text_pair)) { throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).') } + + // For single input, we just wrap in an array, and then unwrap later. tokens = [this.encode(text, text_pair)]; } // At this point, tokens is batched: [batch_size, tokens] @@ -1647,6 +2022,8 @@ class PreTrainedTokenizer extends Callable { } // Now we actually convert to tensor + // NOTE: In the same way as the python library, we return a batched tensor, regardless of + // whether we have a single input or multiple inputs. let dims = [tokens.length, tokens[0].length]; tokens = new Tensor('int64', @@ -1659,6 +2036,13 @@ class PreTrainedTokenizer extends Callable { BigInt64Array.from(attention_mask.flat().map(BigInt)), dims ) + } else { + // If not returning a tensor, we match the input type + if (!Array.isArray(text)) { + // Input was not batched, so we unwrap + tokens = tokens[0]; + attention_mask = attention_mask[0]; + } } @@ -1677,7 +2061,7 @@ class PreTrainedTokenizer extends Callable { /** * Encodes a single text using the preprocessor pipeline of the tokenizer. * - * @param {string|null} text - The text to encode. + * @param {string|null} text The text to encode. * @returns {Array} The encoded tokens. */ _encode_text(text) { @@ -1686,23 +2070,26 @@ class PreTrainedTokenizer extends Callable { // Actual function which does encoding, for a single text // First, we take care of special tokens. Needed to avoid issues arising from // normalization and/or pretokenization (which may not preserve special tokens) - const sections = text.split(this.special_tokens_regex).filter(x => x); + const sections = text.split(this.added_tokens_regex).filter(x => x); let tokens = sections.map(x => { - if (this.special_tokens.includes(x)) { - // Ignore special tokens + if (this.added_tokens.includes(x)) { + // Ignore added tokens return x } else { if (this.remove_space === true) { - // remove_space - x = x.trim().split(/\s+/).join(' ') + x = x.trim().split(/\s+/).join(' '); } - // Actually perform encoding + if (this.normalizer !== null) { x = this.normalizer(x); } - let sectionTokens = this.pre_tokenizer(x); - return this.model(sectionTokens); + + let sectionTokens = (this.pre_tokenizer !== null) ? this.pre_tokenizer(x) : [x]; + + let tokens = this.model(sectionTokens); + + return tokens; } }).flat(); @@ -1712,8 +2099,8 @@ class PreTrainedTokenizer extends Callable { /** * Encodes a single text or a pair of texts using the model's tokenizer. * - * @param {string} text - The text to encode. - * @param {string|null} text_pair - The optional second text to encode. + * @param {string} text The text to encode. + * @param {string|null} text_pair The optional second text to encode. * @returns {number[]} An array of token IDs representing the encoded text(s). */ encode(text, text_pair = null) { @@ -1727,30 +2114,10 @@ class PreTrainedTokenizer extends Callable { return ids } - /** - * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms - * @param {string} text - The text to clean up. - * @returns {string} - The cleaned up text. - */ - clean_up_tokenization(text) { - // Clean up a list of simple English tokenization artifacts - // like spaces before punctuations and abbreviated forms - return text.replace(/ \./g, '.') - .replace(/ \?/g, '?') - .replace(/ \!/g, '!') - .replace(/ ,/g, ',') - .replace(/ \' /g, "'") - .replace(/ n\'t/g, "n't") - .replace(/ \'m/g, "'m") - .replace(/ \'s/g, "'s") - .replace(/ \'ve/g, "'ve") - .replace(/ \'re/g, "'re"); - } - /** * Decode a batch of tokenized sequences. - * @param {number[][]} batch - List of tokenized input sequences. - * @param {Object} decode_args - (Optional) Object with decoding arguments. + * @param {number[][]} batch List of tokenized input sequences. + * @param {Object} decode_args (Optional) Object with decoding arguments. * @returns {string[]} List of decoded sequences. */ batch_decode(batch, decode_args = {}) { @@ -1760,10 +2127,10 @@ class PreTrainedTokenizer extends Callable { /** * Decodes a sequence of token IDs back to a string. * - * @param {number[]} token_ids - List of token IDs to decode. + * @param {number[]} token_ids List of token IDs to decode. * @param {Object} [decode_args={}] - * @param {boolean} [decode_args.skip_special_tokens=false] - If true, special tokens are removed from the output string. - * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - If true, spaces before punctuations and abbreviated forms are removed. + * @param {boolean} [decode_args.skip_special_tokens=false] If true, special tokens are removed from the output string. + * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] If true, spaces before punctuations and abbreviated forms are removed. * * @returns {string} The decoded string. * @throws {Error} If `token_ids` is not a non-empty array of integers. @@ -1776,24 +2143,23 @@ class PreTrainedTokenizer extends Callable { throw Error("token_ids must be a non-empty array of integers."); } - return this.decode_single( - token_ids, decode_args - ) + return this.decode_single(token_ids, decode_args) } /** * Decode a single list of token ids to a string. - * @param {number[]} token_ids - List of token ids to decode - * @param {object} decode_args - Optional arguments for decoding - * @param {boolean} [decode_args.skip_special_tokens=false] - Whether to skip special tokens during decoding - * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] - Whether to clean up tokenization spaces during decoding - * @returns {string} - The decoded string + * @param {number[]} token_ids List of token ids to decode + * @param {Object} decode_args Optional arguments for decoding + * @param {boolean} [decode_args.skip_special_tokens=false] Whether to skip special tokens during decoding + * @param {boolean} [decode_args.clean_up_tokenization_spaces=null] Whether to clean up tokenization spaces during decoding. + * 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`. + * @returns {string} The decoded string */ decode_single( token_ids, { skip_special_tokens = false, - clean_up_tokenization_spaces = true, + clean_up_tokenization_spaces = null, } ) { let tokens = this.model.convert_ids_to_tokens(token_ids); @@ -1801,16 +2167,21 @@ class PreTrainedTokenizer extends Callable { tokens = tokens.filter(x => !this.special_tokens.includes(x)); } - let decoded = this.decoder(tokens); // tokens === filtered_tokens + /** @type {string} */ + let decoded = this.decoder(tokens); - if ('cleanup' in this.decoder && this.decoder.cleanup !== clean_up_tokenization_spaces) { - console.warn(`clean_up_tokenization_spaces disagrees with decoder's cleanup setting. Overriding to use decoder's cleanup setting (${this.decoder.cleanup})`) - // @ts-ignore - clean_up_tokenization_spaces = this.decoder.cleanup; + + // Slight hack, but prevents having to pass `skip_special_tokens` to + // each call to `decode`, which would lead to code duplication. + if (this.decoder.end_of_word_suffix) { + decoded = decoded.replaceAll(this.decoder.end_of_word_suffix, ' '); + if (skip_special_tokens) { + decoded = decoded.trim(); + } } - if (clean_up_tokenization_spaces) { - decoded = this.clean_up_tokenization(decoded); + if (clean_up_tokenization_spaces ?? this.clean_up_tokenization_spaces) { + decoded = clean_up_tokenization(decoded); } return decoded; @@ -1819,17 +2190,31 @@ class PreTrainedTokenizer extends Callable { } /** -* Prepare model inputs for a BERT model. -* @param {Object} inputs - An object containing the input ids and attention mask. +* Helper method for added `token_type_ids` to model inputs +* @param {Object} inputs An object containing the input ids and attention mask. * @returns {Object} The prepared inputs object. */ -function bert_prepare_model_inputs(inputs) { - // Helper method for preparing token_type_ids for bert models - inputs.token_type_ids = new Tensor( - 'int64', - new BigInt64Array(inputs.input_ids.data.length), - inputs.input_ids.dims - ) +function add_token_types(inputs) { + if (inputs.input_ids instanceof Tensor) { + inputs.token_type_ids = new Tensor( + 'int64', + new BigInt64Array(inputs.input_ids.data.length), + inputs.input_ids.dims + ) + } else if (Array.isArray(inputs.input_ids)) { + + if (Array.isArray(inputs.input_ids[0])) { + // This means input is batched, so we need to batch the token_type_ids as well + inputs.token_type_ids = inputs.input_ids.map( + x => new Array(x.length).fill(0) + ) + } else { + inputs.token_type_ids = new Array(inputs.input_ids.length).fill(0); + } + } else { + throw new Error('Input ids must be a Tensor or an Array') + } + return inputs; } @@ -1837,54 +2222,114 @@ function bert_prepare_model_inputs(inputs) { * BertTokenizer is a class used to tokenize text for BERT models. * @extends PreTrainedTokenizer */ -class BertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ +export class BertTokenizer extends PreTrainedTokenizer { + /** @see {@link add_token_types} */ prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); + return add_token_types(inputs); } } /** * Albert tokenizer * @extends PreTrainedTokenizer */ -class AlbertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ +export class AlbertTokenizer extends PreTrainedTokenizer { + /** @see {@link add_token_types} */ prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); + return add_token_types(inputs); } } -class MobileBertTokenizer extends PreTrainedTokenizer { - /** - * @see {@link bert_prepare_model_inputs} - */ +export class MobileBertTokenizer extends PreTrainedTokenizer { + /** @see {@link add_token_types} */ + prepare_model_inputs(inputs) { + return add_token_types(inputs); + } +} +export class SqueezeBertTokenizer extends PreTrainedTokenizer { + /** @see {@link add_token_types} */ + prepare_model_inputs(inputs) { + return add_token_types(inputs); + } +} +export class DistilBertTokenizer extends PreTrainedTokenizer { } +export class T5Tokenizer extends PreTrainedTokenizer { } +export class GPT2Tokenizer extends PreTrainedTokenizer { } +export class BartTokenizer extends PreTrainedTokenizer { } +export class RobertaTokenizer extends PreTrainedTokenizer { } + +export class BloomTokenizer extends PreTrainedTokenizer { } +export class LlamaTokenizer extends PreTrainedTokenizer { + /** @see {@link add_token_types} */ prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); + return add_token_types(inputs); } } -class SqueezeBertTokenizer extends PreTrainedTokenizer { +/** + * The NllbTokenizer class is used to tokenize text for NLLB ("No Language Left Behind") models. + * + * No Language Left Behind (NLLB) is a first-of-its-kind, AI breakthrough project + * that open-sources models capable of delivering high-quality translations directly + * between any pair of 200+ languages — including low-resource languages like Asturian, + * Luganda, Urdu and more. It aims to help people communicate with anyone, anywhere, + * regardless of their language preferences. For more information, check out their + * [paper](https://arxiv.org/abs/2207.04672). + * + * For a list of supported languages (along with their language codes), + * @see {@link https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200} + */ +export class NllbTokenizer extends PreTrainedTokenizer { + + constructor(tokenizerJSON, tokenizerConfig) { + super(tokenizerJSON, tokenizerConfig); + + this.languageRegex = /^[a-z]{3}_[A-Z][a-z]{3}$/; + this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x)); + } + /** - * @see {@link bert_prepare_model_inputs} + * Helper function to build translation inputs for an `NllbTokenizer`. + * @param {string|string[]} raw_inputs The text to tokenize. + * @param {Object} tokenizer_options Options to be sent to the tokenizer + * @param {Object} generate_kwargs Generation options. + * @returns {Object} Object to be passed to the model. */ - prepare_model_inputs(inputs) { - return bert_prepare_model_inputs(inputs); + _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) { + + + // Check that the target language is valid: + if (!this.language_codes.includes(generate_kwargs.tgt_lang)) { + throw new Error(`Target language code "${generate_kwargs.tgt_lang}" is not valid. Must be one of: {${this.language_codes.join(', ')}}`); + } + + // Allow `src_lang` to be optional. If not set, we'll use the tokenizer's default. + if (generate_kwargs.src_lang !== undefined) { + // Check that the source language is valid: + if (!this.language_codes.includes(generate_kwargs.src_lang)) { + throw new Error(`Source language code "${generate_kwargs.src_lang}" is not valid. Must be one of: {${this.language_codes.join(', ')}}`); + } + + // In the same way as the Python library, we override the post-processor + // to force the source language to be first: + for (let item of this.post_processor.config.single) { + if ('SpecialToken' in item && this.languageRegex.test(item.SpecialToken.id)) { + item.SpecialToken.id = generate_kwargs.src_lang; + break; + } + } + } + + // Override the `forced_bos_token_id` to force the correct language + generate_kwargs.forced_bos_token_id = this.model.convert_tokens_to_ids([generate_kwargs.tgt_lang])[0]; + + return this._call(raw_inputs, tokenizer_options); } } -class DistilBertTokenizer extends PreTrainedTokenizer { } -class T5Tokenizer extends PreTrainedTokenizer { } -class GPT2Tokenizer extends PreTrainedTokenizer { } -class BartTokenizer extends PreTrainedTokenizer { } -class RobertaTokenizer extends PreTrainedTokenizer { } /** * WhisperTokenizer tokenizer * @extends PreTrainedTokenizer */ -class WhisperTokenizer extends PreTrainedTokenizer { +export class WhisperTokenizer extends PreTrainedTokenizer { static LANGUAGES = { "en": "english", "zh": "chinese", @@ -1989,9 +2434,9 @@ class WhisperTokenizer extends PreTrainedTokenizer { /** * Decodes automatic speech recognition (ASR) sequences. - * @param {Array.<{tokens: Array., stride: [number, number, number]}>} sequences The sequences to decode. - * @param {Object} options - The options to use for decoding. - * @returns {[string, {chunks?:Array.<{language: string|null, timestamp: [number|null, number|null], text: string}>}]} The decoded sequences. + * @param {Array<{tokens: number[], stride: number[]}>} sequences The sequences to decode. + * @param {Object} options The options to use for decoding. + * @returns {Array, text: string}>}>} The decoded sequences. */ _decode_asr(sequences, { return_timestamps = false, @@ -2199,12 +2644,12 @@ class WhisperTokenizer extends PreTrainedTokenizer { chunks.push(chunk); } - let optional = {}; + let optional = Object.create(null); // Preparing and cleaning up the pipeline output const full_text = chunks.map(chunk => chunk.text).join(''); if (return_timestamps || return_language) { - for (let i = 0; i < chunks.length; i++) { + for (let i = 0; i < chunks.length; ++i) { const chunk = chunks[i]; if (!return_timestamps) { delete chunk["timestamp"]; @@ -2222,9 +2667,9 @@ class WhisperTokenizer extends PreTrainedTokenizer { /** * Finds the longest common sequence among the provided sequences. - * @param {number[][]} sequences - An array of sequences of token ids to compare. - * @returns {number[]} - The longest common sequence found. - * @throws {Error} - If there is a bug within the function. + * @param {number[][]} sequences An array of sequences of token ids to compare. + * @returns {number[]} The longest common sequence found. + * @throws {Error} If there is a bug within the function. */ findLongestCommonSequence(sequences) { // It would be much harder to do O(n) because of fault tolerance. @@ -2233,7 +2678,7 @@ class WhisperTokenizer extends PreTrainedTokenizer { let leftSequence = sequences[0]; let leftLength = leftSequence.length; let totalSequence = []; - for (let i = 1; i < sequences.length; i++) { + for (let i = 1; i < sequences.length; ++i) { const rightSequence = sequences[i]; let max = 0.0; let maxIndices = [leftLength, leftLength, 0, 0]; @@ -2268,7 +2713,7 @@ class WhisperTokenizer extends PreTrainedTokenizer { // [a] == [f] const rightLength = rightSequence.length; - for (let j = 1; j < leftLength + rightLength; j++) { + for (let j = 1; j < leftLength + rightLength; ++j) { const eps = j / 10000.0; const leftStart = Math.max(0, leftLength - j); const leftStop = Math.min(leftLength, leftLength + rightLength - j); @@ -2297,13 +2742,19 @@ class WhisperTokenizer extends PreTrainedTokenizer { return totalSequence; } } -class CodeGenTokenizer extends PreTrainedTokenizer { } -class CLIPTokenizer extends PreTrainedTokenizer { } -class MarianTokenizer extends PreTrainedTokenizer { +export class CodeGenTokenizer extends PreTrainedTokenizer { } +export class CLIPTokenizer extends PreTrainedTokenizer { } + + +/** + * @todo This model is not yet supported by Hugging Face's "fast" tokenizers library (https://github.com/huggingface/tokenizers). + * Therefore, this implementation (which is based on fast tokenizers) may produce slightly inaccurate results. + */ +export class MarianTokenizer extends PreTrainedTokenizer { /** * Create a new MarianTokenizer instance. - * @param {Object} tokenizerJSON - The JSON of the tokenizer. - * @param {Object} tokenizerConfig - The config of the tokenizer. + * @param {Object} tokenizerJSON The JSON of the tokenizer. + * @param {Object} tokenizerConfig The config of the tokenizer. */ constructor(tokenizerJSON, tokenizerConfig) { super(tokenizerJSON, tokenizerConfig); @@ -2313,6 +2764,8 @@ class MarianTokenizer extends PreTrainedTokenizer { this.supported_language_codes = this.model.vocab.filter( x => this.languageRegex.test(x) ); + + console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.') } /** @@ -2320,7 +2773,7 @@ class MarianTokenizer extends PreTrainedTokenizer { * must be removed before encoding with sentencepiece model. * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213 * - * @param {string|null} text - The text to encode. + * @param {string|null} text The text to encode. * @returns {Array} The encoded tokens. */ _encode_text(text) { @@ -2356,7 +2809,7 @@ class CharTrie { /** * Adds one or more `texts` to the trie. - * @param {string[]} texts - The strings to add to the trie. + * @param {string[]} texts The strings to add to the trie. */ extend(texts) { for (let text of texts) { @@ -2366,7 +2819,7 @@ class CharTrie { /** * Adds one or more `texts` to the trie. - * @param {*} text - The strings to add to the trie. + * @param {*} text The strings to add to the trie. */ push(text) { let node = this.root; @@ -2383,13 +2836,13 @@ class CharTrie { /** * Searches the trie for all strings with a common prefix of `text`. - * @param {string} text - The common prefix to search for. - * @yields {string} - Each string in the trie that has `text` as a prefix. + * @param {string} text The common prefix to search for. + * @yields {string} Each string in the trie that has `text` as a prefix. */ *commonPrefixSearch(text) { let node = this.root; let prefix = ""; - for (let i = 0; i < text.length && node !== undefined; i++) { + for (let i = 0; i < text.length && node !== undefined; ++i) { const ch = text[i]; prefix += ch; node = node.children.get(ch); @@ -2402,8 +2855,8 @@ class CharTrie { /** * Represents a node in a character trie. - * @param {boolean} isLeaf - Whether the node is a leaf node or not. - * @param {Map} children - A map containing the node's children, where the key is a character and the value is a `CharTrieNode`. + * @param {boolean} isLeaf Whether the node is a leaf node or not. + * @param {Map} children A map containing the node's children, where the key is a character and the value is a `CharTrieNode`. */ class CharTrieNode { constructor(isLeaf, children) { @@ -2424,9 +2877,9 @@ class TokenLattice { /** * Creates a new TokenLattice instance. * - * @param {string} sentence - The input sentence to be tokenized. - * @param {number} bosTokenId - The beginning-of-sequence token ID. - * @param {number} eosTokenId - The end-of-sequence token ID. + * @param {string} sentence The input sentence to be tokenized. + * @param {number} bosTokenId The beginning-of-sequence token ID. + * @param {number} eosTokenId The end-of-sequence token ID. */ constructor(sentence, bosTokenId, eosTokenId) { this.sentence = sentence; @@ -2436,7 +2889,7 @@ class TokenLattice { this.nodes = []; this.beginNodes = new Array(this.len + 1); this.endNodes = new Array(this.len + 1); - for (let i = 0; i < this.len + 1; i++) { + for (let i = 0; i < this.len + 1; ++i) { this.beginNodes[i] = []; this.endNodes[i] = []; } @@ -2451,10 +2904,10 @@ class TokenLattice { /** * Inserts a new token node into the token lattice. * - * @param {number} pos - The starting position of the token. - * @param {number} length - The length of the token. - * @param {number} score - The score of the token. - * @param {number} tokenId - The token ID of the token. + * @param {number} pos The starting position of the token. + * @param {number} length The length of the token. + * @param {number} score The score of the token. + * @param {number} tokenId The token ID of the token. */ insert(pos, length, score, tokenId) { const nodeId = this.nodes.length; @@ -2467,7 +2920,7 @@ class TokenLattice { /** * Implements the Viterbi algorithm to compute the most likely sequence of tokens. * - * @returns {TokenLatticeNode[]} - The array of nodes representing the most likely sequence of tokens. + * @returns {TokenLatticeNode[]} The array of nodes representing the most likely sequence of tokens. */ viterbi() { const len = this.len; @@ -2487,42 +2940,45 @@ class TokenLattice { bestScore = score; } } + if (bestNode !== null) { rnode.prev = bestNode; rnode.backtraceScore = bestScore; - } - else { + } else { return []; } } - pos++; + ++pos; } + const results = []; const root = this.beginNodes[len][0]; const prev = root.prev; if (prev === null) { return []; } + let node = prev.clone(); while (node.prev !== null) { results.push(node.clone()); const n = node.clone(); node = n.prev.clone(); } + results.reverse(); return results; } /** - * @param {any} node - * @returns {string} - The array of nodes representing the most likely sequence of tokens. + * @param {TokenLatticeNode} node + * @returns {string} The array of nodes representing the most likely sequence of tokens. */ piece(node) { return this.sentence.slice(node.pos, node.pos + node.length); } /** - * @returns {Array} - The array of nodes representing the most likely sequence of tokens. + * @returns {Array} The array of nodes representing the most likely sequence of tokens. */ tokens() { const nodes = this.viterbi(); @@ -2530,7 +2986,7 @@ class TokenLattice { } /** - * @returns {Array} - The array of nodes representing the most likely sequence of tokens. + * @returns {Array} The array of nodes representing the most likely sequence of tokens. */ tokenIds() { const nodes = this.viterbi(); @@ -2540,11 +2996,11 @@ class TokenLattice { class TokenLatticeNode { /** * Represents a node in a token lattice for a given sentence. - * @param {number} tokenId - The ID of the token associated with this node. - * @param {number} nodeId - The ID of this node. - * @param {number} pos - The starting position of the token in the sentence. - * @param {number} length - The length of the token. - * @param {number} score - The score associated with the token. + * @param {number} tokenId The ID of the token associated with this node. + * @param {number} nodeId The ID of this node. + * @param {number} pos The starting position of the token in the sentence. + * @param {number} length The length of the token. + * @param {number} score The score associated with the token. */ constructor(tokenId, nodeId, pos, length, score) { this.tokenId = tokenId; @@ -2558,7 +3014,7 @@ class TokenLatticeNode { /** * Returns a clone of this node. - * @returns {TokenLatticeNode} - A clone of this node. + * @returns {TokenLatticeNode} A clone of this node. */ clone() { const n = new TokenLatticeNode(this.tokenId, this.nodeId, this.pos, this.length, this.score); @@ -2568,8 +3024,14 @@ class TokenLatticeNode { } } -class AutoTokenizer { - // Helper class to determine tokenizer type from tokenizer.json +/** + * Helper class which is used to instantiate pretrained tokenizers with the `from_pretrained` function. + * The chosen tokenizer class is determined by the type specified in the tokenizer config. + * + * @example + * let tokenizer = await AutoTokenizer.from_pretrained('bert-base-uncased'); + */ +export class AutoTokenizer { static TOKENIZER_CLASS_MAPPING = { 'T5Tokenizer': T5Tokenizer, 'DistilBertTokenizer': DistilBertTokenizer, @@ -2584,28 +3046,54 @@ class AutoTokenizer { 'CodeGenTokenizer': CodeGenTokenizer, 'CLIPTokenizer': CLIPTokenizer, 'MarianTokenizer': MarianTokenizer, + + 'BloomTokenizer': BloomTokenizer, + 'NllbTokenizer': NllbTokenizer, + 'LlamaTokenizer': LlamaTokenizer, } - static async from_pretrained(modelPath, progressCallback = null) { - let [tokenizerJSON, tokenizerConfig] = await Promise.all([ - fetchJSON(modelPath, 'tokenizer.json', progressCallback), - fetchJSON(modelPath, 'tokenizer_config.json', progressCallback), - ]) + /** + * Instantiate one of the tokenizer classes of the library from a pretrained model. + * + * The tokenizer class to instantiate is selected based on the `tokenizer_class` property of the config object + * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible) + * + * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either: + * - A string, the *model id* of a pretrained tokenizer hosted inside a model repo on huggingface.co. + * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a + * user or organization name, like `dbmdz/bert-base-german-cased`. + * - A path to a *directory* containing tokenizer files, e.g., `./my_model_directory/`. + * @param {PretrainedOptions} options Additional options for loading the tokenizer. + * + * @returns {Promise} A new instance of the PreTrainedTokenizer class. + */ + static async from_pretrained(pretrained_model_name_or_path, { + quantized = true, + progress_callback = null, + config = null, + cache_dir = null, + local_files_only = false, + revision = 'main', + } = {}) { + + let [tokenizerJSON, tokenizerConfig] = await loadTokenizer(pretrained_model_name_or_path, { + quantized, + progress_callback, + config, + cache_dir, + local_files_only, + revision, + }) - let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerConfig.tokenizer_class]; + // Some tokenizers are saved with the "Fast" suffix, so we remove that if present. + let tokenizerName = tokenizerConfig.tokenizer_class.replace(/Fast$/, ''); + + let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerName]; if (!cls) { - console.warn(`Unknown tokenizer class "${tokenizerConfig.tokenizer_class}", attempting to construct from base class.`); + console.warn(`Unknown tokenizer class "${tokenizerName}", attempting to construct from base class.`); cls = PreTrainedTokenizer; } return new cls(tokenizerJSON, tokenizerConfig); } } - -module.exports = { - AutoTokenizer, - BertTokenizer, - DistilBertTokenizer, - T5Tokenizer, - GPT2Tokenizer -}; diff --git a/src/transformers.js b/src/transformers.js index e9952b3ce..52a7e1125 100644 --- a/src/transformers.js +++ b/src/transformers.js @@ -1,70 +1,25 @@ - -const { - AutoTokenizer, - BertTokenizer, - DistilBertTokenizer, - T5Tokenizer, - GPT2Tokenizer -} = require("./tokenizers.js"); -const { - AutoModel, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForSeq2SeqLM, - AutoModelForCausalLM, - AutoModelForMaskedLM, - AutoModelForQuestionAnswering, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForObjectDetection, -} = require("./models.js"); - -const { - AutoProcessor -} = require("./processors.js"); -const { - pipeline -} = require("./pipelines.js"); -const { env } = require('./env.js'); - -const { Tensor } = require('./tensor_utils.js'); - -const moduleExports = { - // Tokenizers - AutoTokenizer, - BertTokenizer, - DistilBertTokenizer, - T5Tokenizer, - GPT2Tokenizer, - - // Models - AutoModel, - AutoModelForSeq2SeqLM, - AutoModelForSequenceClassification, - AutoModelForTokenClassification, - AutoModelForCausalLM, - AutoModelForMaskedLM, - AutoModelForQuestionAnswering, - AutoModelForVision2Seq, - AutoModelForImageClassification, - AutoModelForObjectDetection, - - // Processors - AutoProcessor, - - // other - pipeline, - Tensor, - - // environment variables - env -}; - -// Allow global access to these variables -if (typeof self !== 'undefined') { - // Used by web workers - Object.assign(self, moduleExports); -} - -// Used by other modules -module.exports = moduleExports +// @ts-nocheck + +/** + * @file Entry point for the Transformers.js library. Only the exports from this file + * are available to the end user, and are grouped as follows: + * + * 1. [Pipelines](./pipelines) + * 2. [Environment variables](./env) + * 3. [Models](./models) + * 4. [Tokenizers](./tokenizers) + * 5. [Processors](./processors) + * + * @module transformers + */ + +export * from './pipelines.js'; +export * from './env.js'; +export * from './models.js'; +export * from './tokenizers.js'; +export * from './processors.js'; + +export * from './utils/audio.js'; +export * from './utils/image.js'; +export * from './utils/tensor.js'; +export * from './utils/maths.js'; diff --git a/src/utils.js b/src/utils.js deleted file mode 100644 index 3d8ef651a..000000000 --- a/src/utils.js +++ /dev/null @@ -1,653 +0,0 @@ - -const fs = require('fs'); - -const { env } = require('./env.js'); - -if (global.ReadableStream === undefined && typeof process !== 'undefined') { - try { - // @ts-ignore - global.ReadableStream = require('node:stream/web').ReadableStream; // ReadableStream is not a global with Node 16 - } catch (err) { - console.warn("ReadableStream not defined and unable to import from node:stream/web"); - } -} - -class FileResponse { - /** - * Creates a new `FileResponse` object. - * @param {string|URL} filePath - */ - constructor(filePath) { - this.filePath = filePath; - this.headers = {}; - this.headers.get = (x) => this.headers[x] - - this.exists = fs.existsSync(filePath); - if (this.exists) { - this.status = 200; - this.statusText = 'OK'; - - let stats = fs.statSync(filePath); - this.headers['content-length'] = stats.size; - - this.updateContentType(); - - let self = this; - this.body = new ReadableStream({ - start(controller) { - self.arrayBuffer().then(buffer => { - controller.enqueue(new Uint8Array(buffer)); - controller.close(); - }) - } - }); - } else { - this.status = 404; - this.statusText = 'Not Found'; - this.body = null; - } - } - - /** - * Updates the 'content-type' header property of the response based on the extension of - * the file specified by the filePath property of the current object. - * @function - * @returns {void} - */ - updateContentType() { - // Set content-type header based on file extension - const extension = this.filePath.toString().split('.').pop().toLowerCase(); - switch (extension) { - case 'txt': - this.headers['content-type'] = 'text/plain'; - break; - case 'html': - this.headers['content-type'] = 'text/html'; - break; - case 'css': - this.headers['content-type'] = 'text/css'; - break; - case 'js': - this.headers['content-type'] = 'text/javascript'; - break; - case 'json': - this.headers['content-type'] = 'application/json'; - break; - case 'png': - this.headers['content-type'] = 'image/png'; - break; - case 'jpg': - case 'jpeg': - this.headers['content-type'] = 'image/jpeg'; - break; - case 'gif': - this.headers['content-type'] = 'image/gif'; - break; - default: - this.headers['content-type'] = 'application/octet-stream'; - break; - } - } - - /** - * @function - * @returns {FileResponse} - */ - clone() { - let response = new FileResponse(this.filePath); - response.exists = this.exists; - response.status = this.status; - response.statusText = this.statusText; - response.headers = this.headers; - return response; - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with an ArrayBuffer containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with an ArrayBuffer containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async arrayBuffer() { - const data = await fs.promises.readFile(this.filePath); - return data.buffer; - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a Blob containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a Blob containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async blob() { - const data = await fs.promises.readFile(this.filePath); - return new Blob([data], { type: this.headers['content-type'] }); - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a string containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a string containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async text() { - const data = await fs.promises.readFile(this.filePath, 'utf8'); - return data; - } - - /** - * Reads the contents of the file specified by the filePath property and returns a Promise that - * resolves with a parsed JavaScript object containing the file's contents. - * @async - * @function - * @returns {Promise} - A Promise that resolves with a parsed JavaScript object containing the file's contents. - * @throws {Error} - If the file cannot be read. - */ - async json() { - return JSON.parse(await this.text()); - } -} - -/** - * Determines whether the given string is a valid HTTP or HTTPS URL. - * @function - * @param {string|URL} string - The string to test for validity as an HTTP or HTTPS URL. - * @returns {boolean} - True if the string is a valid HTTP or HTTPS URL, false otherwise. - */ -function isValidHttpUrl(string) { - // https://stackoverflow.com/a/43467144 - let url; - try { - url = new URL(string); - } catch (_) { - return false; - } - return url.protocol === "http:" || url.protocol === "https:"; -} - -/** - * Helper function to get a file, using either the Fetch API or FileSystem API. - * - * @async - * @function getFile - * @param {string|URL} url - The URL of the file to get. - * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API). - */ -async function getFile(url) { - // Helper function to get a file, using either the Fetch API or FileSystem API - - if (env.useFS && !isValidHttpUrl(url)) { - return new FileResponse(url) - - } else { - return fetch(url) - } -} - -/** - * Helper function to dispatch progress callbacks. - * - * @function dispatchCallback - * @param {function} progressCallback - The progress callback function to dispatch. - * @param {any} data - The data to pass to the progress callback function. - * @returns {void} - */ -function dispatchCallback(progressCallback, data) { - if (progressCallback !== null) progressCallback(data); -} - -/** - * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API. - * - * @async - * @function getModelFile - * @param {string} modelPath - The path of the model file. - * @param {string} fileName - The name of the model file. - * @param {function} [progressCallback=null] - A function to call when the download progress is updated. - * @returns {Promise} A Promise that resolves with the file content as a buffer. - * @throws Will throw an error if the file is not found. - */ -async function getModelFile(modelPath, fileName, progressCallback = null, fatal = true) { - - // Initiate session - dispatchCallback(progressCallback, { - status: 'initiate', - name: modelPath, - file: fileName - }) - - let cache; - if (env.useCache) { - cache = await caches.open('transformers-cache'); - } - - const request = pathJoin(modelPath, fileName); - - /** @type {Response | FileResponse} */ - let response; - - /** @type {Response | FileResponse} */ - let responseToCache; - - if (!env.useCache || (response = await cache.match(request)) === undefined) { - // Caching not available, or model is not cached, so we perform the request - response = await getFile(request); - - if (response.status === 404) { - if (fatal) { - throw Error(`File not found. Could not locate "${request}".`) - } else { - // File not found, but this file is optional. - // TODO in future, cache the response - return null; - } - } - - if (env.useCache) { - // only clone if cache available - responseToCache = response.clone(); - } - } - - // Start downloading - dispatchCallback(progressCallback, { - status: 'download', - name: modelPath, - file: fileName - }) - - const buffer = await readResponse(response, data => { - dispatchCallback(progressCallback, { - status: 'progress', - ...data, - name: modelPath, - file: fileName - }) - }) - - // Check again whether request is in cache. If not, we add the response to the cache - if (responseToCache !== undefined && await cache.match(request) === undefined) { - cache.put(request, /** @type {Response} */(/** @type {unknown} */ (responseToCache))); - } - - dispatchCallback(progressCallback, { - status: 'done', - name: modelPath, - file: fileName - }); - - return buffer; -} - -/** - * Fetches a JSON file from a given path and file name. - * - * @param {string} modelPath - The path to the directory containing the file. - * @param {string} fileName - The name of the file to fetch. - * @param {function} progressCallback - A callback function to receive progress updates. Optional. - * @returns {Promise} - The JSON data parsed into a JavaScript object. - */ -async function fetchJSON(modelPath, fileName, progressCallback = null, fatal = true) { - let buffer = await getModelFile(modelPath, fileName, progressCallback, fatal); - if (buffer === null) { - // Return empty object - return {} - } - - let decoder = new TextDecoder('utf-8'); - let jsonData = decoder.decode(buffer); - - return JSON.parse(jsonData); -} - -/** - * Read and track progress when reading a Response object - * - * @param {any} response - The Response object to read - * @param {function} progressCallback - The function to call with progress updates - * @returns {Promise} A Promise that resolves with the Uint8Array buffer - */ -async function readResponse(response, progressCallback) { - // Read and track progress when reading a Response object - - const contentLength = response.headers.get('Content-Length'); - if (contentLength === null) { - console.warn('Unable to determine content-length from response headers. Will expand buffer when needed.') - } - let total = parseInt(contentLength ?? '0'); - let buffer = new Uint8Array(total); - let loaded = 0; - - const reader = response.body.getReader(); - async function read() { - const { done, value } = await reader.read(); - if (done) return; - - let newLoaded = loaded + value.length; - if (newLoaded > total) { - total = newLoaded; - - // Adding the new data will overflow buffer. - // In this case, we extend the buffer - let newBuffer = new Uint8Array(total); - - // copy contents - newBuffer.set(buffer); - - buffer = newBuffer; - } - buffer.set(value, loaded) - loaded = newLoaded; - - const progress = (loaded / total) * 100; - - // Call your function here - progressCallback({ - progress: progress, - loaded: loaded, - total: total, - }) - - return read(); - } - - // Actually read - await read(); - - return buffer; -} - -/** - * Joins multiple parts of a path into a single path, while handling leading and trailing slashes. - * - * @param {...string} parts - Multiple parts of a path. - * @returns {string} A string representing the joined path. - */ -function pathJoin(...parts) { - // https://stackoverflow.com/a/55142565 - parts = parts.map((part, index) => { - if (index) { - part = part.replace(new RegExp('^/'), ''); - } - if (index !== parts.length - 1) { - part = part.replace(new RegExp('/$'), ''); - } - return part; - }) - return parts.join('/'); -} - -/** - * Reverses the keys and values of an object. - * - * @param {object} data - The object to reverse. - * @returns {object} The reversed object. - * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript - */ -function reverseDictionary(data) { - // https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript - return Object.fromEntries(Object.entries(data).map(([key, value]) => [value, key])); -} - -/** - * Returns the index of the maximum value in an array. - * @param {Array} arr - The input array. - * @see https://stackoverflow.com/a/11301464 - * @returns {number} - The index of the maximum value in the array. - */ -function indexOfMax(arr) { - // https://stackoverflow.com/a/11301464 - - if (arr.length === 0) { - return -1; - } - - var max = arr[0]; - var maxIndex = 0; - - for (var i = 1; i < arr.length; ++i) { - if (arr[i] > max) { - maxIndex = i; - max = arr[i]; - } - } - - return maxIndex; -} - -/** - * Compute the softmax of an array of numbers. - * - * @param {number[]} arr - The array of numbers to compute the softmax of. - * @returns {number[]} The softmax array. - */ -function softmax(arr) { - // Compute the maximum value in the array - const maxVal = max(arr); - - // Compute the exponentials of the array values - const exps = arr.map(x => Math.exp(x - maxVal)); - - // Compute the sum of the exponentials - const sumExps = exps.reduce((acc, val) => acc + val, 0); - - // Compute the softmax values - const softmaxArr = exps.map(x => x / sumExps); - - return softmaxArr; -} - -/** - * Calculates the logarithm of the softmax function for the input array. - * @param {number[]} arr - The input array to calculate the log_softmax function for. - * @returns {any} - The resulting log_softmax array. - */ -function log_softmax(arr) { - // Compute the softmax values - const softmaxArr = softmax(arr); - - // Apply log formula to each element - const logSoftmaxArr = softmaxArr.map(x => Math.log(x)); - - return logSoftmaxArr; -} - -/** - * Escapes regular expression special characters from a string by replacing them with their escaped counterparts. - * - * @param {string} string - The string to escape. - * @returns {string} - The escaped string. - */ -function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string -} - -/** - * Get the top k items from an iterable, sorted by descending order - * - * @param {Array} items - The items to be sorted - * @param {number} [top_k=0] - The number of top items to return (default: 0 = return all) - * @returns {Array} - The top k items, sorted by descending order - */ -function getTopItems(items, top_k = 0) { - // if top == 0, return all - - items = Array.from(items) - .map((x, i) => [i, x]) // Get indices ([index, score]) - .sort((a, b) => b[1] - a[1]) // Sort by log probabilities - - if (top_k > 0) { - items = items.slice(0, top_k); // Get top k items - } - - return items -} - -/** - * Calculates the dot product of two arrays. - * @param {number[]} arr1 - The first array. - * @param {number[]} arr2 - The second array. - * @returns {number} - The dot product of arr1 and arr2. - */ -function dot(arr1, arr2) { - return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0); -} - -/** - * Computes the cosine similarity between two arrays. - * - * @param {number[]} arr1 - The first array. - * @param {number[]} arr2 - The second array. - * @returns {number} The cosine similarity between the two arrays. - */ -function cos_sim(arr1, arr2) { - // Calculate dot product of the two arrays - const dotProduct = dot(arr1, arr2); - - // Calculate the magnitude of the first array - const magnitudeA = magnitude(arr1); - - // Calculate the magnitude of the second array - const magnitudeB = magnitude(arr2); - - // Calculate the cosine similarity - const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB); - - return cosineSimilarity; -} - -/** - * Calculates the magnitude of a given array. - * @param {number[]} arr - The array to calculate the magnitude of. - * @returns {number} The magnitude of the array. - */ -function magnitude(arr) { - return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0)); -} - -/** - * A base class for creating callable objects. - * - * @extends Function - */ -class Callable extends Function { - /** - * Creates a new instance of the Callable class. - */ - constructor() { - super(); - /** - * Creates a closure that delegates to a private method '_call' with the given arguments. - * - * @param {...any} args - Zero or more arguments to pass to the '_call' method. - * @returns {*} - The result of calling the '_call' method. - */ - let closure = function (...args) { - // @ts-ignore - return closure._call(...args) - } - return Object.setPrototypeOf(closure, new.target.prototype) - } - - /** - * This method should be implemented in subclasses to provide the - * functionality of the callable object. - * - * @throws {Error} Must implement _call method in subclass - * @param {...*} args - */ - _call(...args) { - throw Error('Must implement _call method in subclass') - } -} - -/** - * Returns the minimum item. - * @param {number[]} arr - array of numbers. - * @returns {number} - the minimum number. - * @throws {Error} If array is empty. - */ -function min(arr) { - if (arr.length === 0) throw Error('Array must not be empty'); - let min = arr[0]; - for (let i = 1; i < arr.length; ++i) { - if (arr[i] < min) { - min = arr[i]; - } - } - return min; -} - - -/** - * Returns the maximum item. - * @param {number[]} arr - array of numbers. - * @returns {number} - the maximum number. - * @throws {Error} If array is empty. - */ -function max(arr) { - if (arr.length === 0) throw Error('Array must not be empty'); - let max = arr[0]; - for (let i = 1; i < arr.length; ++i) { - if (arr[i] > max) { - max = arr[i]; - } - } - return max; -} - -/** - * Check if a value is a string. - * @param {*} text - The value to check. - * @returns {boolean} - True if the value is a string, false otherwise. - */ -function isString(text) { - return typeof text === 'string' || text instanceof String -} - -/** - * Check if a value is an integer. - * @param {*} x - The value to check. - * @returns {boolean} - True if the value is a string, false otherwise. - */ -function isIntegralNumber(x) { - return Number.isInteger(x) || typeof x === 'bigint' -} - -/** - * Check if a value is exists. - * @param {*} x - The value to check. - * @returns {boolean} - True if the value exists, false otherwise. - */ -function exists(x) { - return x !== undefined && x !== null; -} - -module.exports = { - Callable, - getModelFile, - dispatchCallback, - fetchJSON, - pathJoin, - reverseDictionary, - indexOfMax, - softmax, - log_softmax, - escapeRegExp, - getTopItems, - dot, - cos_sim, - magnitude, - getFile, - isIntegralNumber, - isString, - exists, - min, - max, -}; diff --git a/src/utils/audio.js b/src/utils/audio.js new file mode 100644 index 000000000..5b273ae38 --- /dev/null +++ b/src/utils/audio.js @@ -0,0 +1,63 @@ +/** + * @file Helper module for audio processing. + * + * These functions and classes are only used internally, + * meaning an end-user shouldn't need to access anything here. + * + * @module utils/audio + */ + +import { + getFile, +} from './hub.js'; + +export async function read_audio(url, sampling_rate) { + // Attempting to load from path/url + + if (typeof AudioContext === 'undefined') { + // Running in node or an environment without AudioContext + throw Error( + "Unable to load audio from path/URL since `AudioContext` is not available in your environment. " + + "As a result, audio data must be passed directly to the processor. " + + "If you are running in node.js, you can use an external library (e.g., https://github.com/audiojs/web-audio-api) to do this." + ) + } + const response = await (await getFile(url)).arrayBuffer(); + const audioCTX = new AudioContext({ sampleRate: sampling_rate }); + const decoded = await audioCTX.decodeAudioData(response); + let audio; + + // We now replicate HuggingFace's `ffmpeg_read` method: + if (decoded.numberOfChannels === 2) { + // When downmixing a stereo audio file to mono using the -ac 1 option in FFmpeg, + // the audio signal is summed across both channels to create a single mono channel. + // However, if the audio is at full scale (i.e. the highest possible volume level), + // the summing of the two channels can cause the audio signal to clip or distort. + + // To prevent this clipping, FFmpeg applies a scaling factor of 1/sqrt(2) (~ 0.707) + // to the audio signal before summing the two channels. This scaling factor ensures + // that the combined audio signal will not exceed the maximum possible level, even + // if both channels are at full scale. + + // After applying this scaling factor, the audio signal from both channels is summed + // to create a single mono channel. It's worth noting that this scaling factor is + // only applied when downmixing stereo audio to mono using the -ac 1 option in FFmpeg. + // If you're using a different downmixing method, or if you're not downmixing the + // audio at all, this scaling factor may not be needed. + const SCALING_FACTOR = Math.sqrt(2); + + let left = decoded.getChannelData(0); + let right = decoded.getChannelData(1); + + audio = new Float32Array(left.length); + for (let i = 0; i < decoded.length; ++i) { + audio[i] = SCALING_FACTOR * (left[i] + right[i]) / 2; + } + + } else { + // If the audio is not stereo, we can just use the first channel: + audio = decoded.getChannelData(0); + } + + return audio; +} \ No newline at end of file diff --git a/src/utils/core.js b/src/utils/core.js new file mode 100644 index 000000000..062a0fe0c --- /dev/null +++ b/src/utils/core.js @@ -0,0 +1,134 @@ + +/** + * @file Core utility functions/classes for Transformers.js. + * + * These are only used internally, meaning an end-user shouldn't + * need to access anything here. + * + * @module utils/core + */ + +/** + * Helper function to dispatch progress callbacks. + * + * @param {function} progress_callback The progress callback function to dispatch. + * @param {any} data The data to pass to the progress callback function. + * @returns {void} + * @private + */ +export function dispatchCallback(progress_callback, data) { + if (progress_callback !== null) progress_callback(data); +} + +/** + * Reverses the keys and values of an object. + * + * @param {Object} data The object to reverse. + * @returns {Object} The reversed object. + * @see https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript + */ +export function reverseDictionary(data) { + // https://ultimatecourses.com/blog/reverse-object-keys-and-values-in-javascript + return Object.fromEntries(Object.entries(data).map(([key, value]) => [value, key])); +} + +/** + * Escapes regular expression special characters from a string by replacing them with their escaped counterparts. + * + * @param {string} string The string to escape. + * @returns {string} The escaped string. + */ +export function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} + +/** + * A base class for creating callable objects. + * + * @type {new () => {(...args: any[]): any, _call(...args: any[]): any}} + */ +export const Callable = /** @type {any} */ (class { + /** + * Creates a new instance of the Callable class. + */ + constructor() { + /** + * Creates a closure that delegates to a private method '_call' with the given arguments. + * @type {any} + * @param {...any} args Zero or more arguments to pass to the '_call' method. + * @returns {*} The result of calling the '_call' method. + */ + let closure = function (...args) { + return closure._call(...args) + } + return Object.setPrototypeOf(closure, new.target.prototype) + } + + /** + * This method should be implemented in subclasses to provide the + * functionality of the callable object. + * + * @param {any[]} args + * @throws {Error} If the subclass does not implement the `_call` method. + */ + _call(...args) { + throw Error('Must implement _call method in subclass') + } +}); + + +/** + * Check if a value is a string. + * @param {*} text The value to check. + * @returns {boolean} True if the value is a string, false otherwise. + */ +export function isString(text) { + return typeof text === 'string' || text instanceof String +} + + +/** + * Check if a value is a typed array. + * @param {*} val The value to check. + * @returns {boolean} True if the value is a `TypedArray`, false otherwise. + * + * Adapted from https://stackoverflow.com/a/71091338/13989043 + */ +export function isTypedArray(val) { + return val?.prototype?.__proto__?.constructor?.name === 'TypedArray'; +} + + +/** + * Check if a value is an integer. + * @param {*} x The value to check. + * @returns {boolean} True if the value is a string, false otherwise. + */ +export function isIntegralNumber(x) { + return Number.isInteger(x) || typeof x === 'bigint' +} + +/** + * Check if a value is exists. + * @param {*} x The value to check. + * @returns {boolean} True if the value exists, false otherwise. + */ +export function exists(x) { + return x !== undefined && x !== null; +} + +/** + * Calculates the dimensions of a nested array. + * + * @param {Array} arr The nested array to calculate dimensions for. + * @returns {Array} An array containing the dimensions of the input array. + */ +export function calculateDimensions(arr) { + const dimensions = []; + let current = arr; + while (Array.isArray(current)) { + dimensions.push(current.length); + current = current[0]; + } + return dimensions; +} diff --git a/src/utils/generation.js b/src/utils/generation.js new file mode 100644 index 000000000..68c604b6f --- /dev/null +++ b/src/utils/generation.js @@ -0,0 +1,744 @@ + +/** + * @file Classes, functions, and utilities for generation. + * + * @todo Describe how to create a custom `GenerationConfig`. + * + * @module utils/generation + */ +import { Tensor } from './tensor.js'; +import { + Callable, + exists, +} from './core.js'; +import { + max, + softmax, + log_softmax, + getTopItems, +} from './maths.js'; + +/** + * A class representing a list of logits processors. A logits processor is a function that modifies the logits + * output of a language model. This class provides methods for adding new processors and applying all processors to a + * batch of logits. + * + * @extends Callable + */ +export class LogitsProcessorList extends Callable { + /** + * Constructs a new instance of `LogitsProcessorList`. + */ + constructor() { + super(); + this.processors = []; + } + + /** + * Adds a new logits processor to the list. + * + * @param {LogitsProcessor} item The logits processor function to add. + */ + push(item) { + this.processors.push(item); + } + + /** + * Adds multiple logits processors to the list. + * + * @param {LogitsProcessor[]} items The logits processor functions to add. + */ + extend(items) { + this.processors.push(...items); + } + + /** + * Applies all logits processors in the list to a batch of logits, modifying them in-place. + * + * @param {number[]} input_ids The input IDs for the language model. + * @param {number[][]} batchedLogits A 2D array of logits, where each row corresponds to a single + * input sequence in the batch. + */ + _call(input_ids, batchedLogits) { + // NOTE: This is different from the Python code, since vanilla JS does not support vectorized operations. + // As a result, we apply each processor to each item in the batch. + for (let logits of batchedLogits) { + // Modifies logits inplace + this.processors.forEach( + func => func(input_ids, logits) + ) + } + } + + [Symbol.iterator]() { + return this.processors.values(); + } +} + +/** + * Base class for processing logits. + * @extends Callable + */ +export class LogitsProcessor extends Callable { + /** + * Apply the processor to the input logits. + * + * @abstract + * @param {Array} input_ids The input ids. + * @param {Tensor} logits The logits to process. + * @throws {Error} Throws an error if `_call` is not implemented in the subclass. + */ + _call(input_ids, logits) { + throw Error("`_call` should be implemented in a subclass") + } +} + +/** + * A logits processor that forces a specific token to be generated by the decoder. + * + * @extends LogitsProcessor + */ +export class ForceTokensLogitsProcessor extends LogitsProcessor { + /** + * Constructs a new instance of `ForceTokensLogitsProcessor`. + * + * @param {Array} forced_decoder_ids The ids of tokens that should be forced. + */ + constructor(forced_decoder_ids) { + super(); + this.force_token_map = Object.fromEntries(forced_decoder_ids ?? []); + } + + /** + * Apply the processor to the input logits. + * + * @param {Array} input_ids The input ids. + * @param {any} logits The logits to process. + * @returns {Array} The processed logits. + */ + _call(input_ids, logits) { + let map = this.force_token_map[input_ids.length]; + if (exists(map)) { // There exists a mapping + logits.data.fill(-Infinity) + logits.data[map] = 0; + } + return logits; + } +} + +/** + * A LogitsProcessor that forces a BOS token at the beginning of the generated sequence. + * @extends LogitsProcessor + */ +export class ForcedBOSTokenLogitsProcessor extends LogitsProcessor { + /** + * Create a ForcedBOSTokenLogitsProcessor. + * @param {number} bos_token_id The ID of the beginning-of-sequence token to be forced. + */ + constructor(bos_token_id) { + super(); + this.bos_token_id = bos_token_id; + } + + /** + * Apply the BOS token forcing to the logits. + * @param {Array} input_ids The input IDs. + * @param {Object} logits The logits. + * @returns {Object} The logits with BOS token forcing. + */ + _call(input_ids, logits) { + if (input_ids.length === 1) { + logits.data.fill(-Infinity) + logits.data[this.bos_token_id] = 0; + } + } +} + +/** + * A logits processor that forces end-of-sequence token probability to 1. + * + * @extends LogitsProcessor + */ +export class ForcedEOSTokenLogitsProcessor extends LogitsProcessor { + /** + * Create a ForcedEOSTokenLogitsProcessor. + * @param {number} max_length Max length of the sequence. + * @param {number|number[]} forced_eos_token_id The ID of the end-of-sequence token to be forced. + */ + constructor(max_length, forced_eos_token_id) { + super(); + this.max_length = max_length; + this.forced_eos_token_id = forced_eos_token_id; + } + + /** + * Apply the processor to input_ids and logits. + * + * @param {number[]} input_ids The input ids. + * @param {any} logits The logits tensor. + */ + _call(input_ids, logits) { + // console.log('call ForcedEOSTokenLogitsProcessor') + // TODO + } +} + +/** + * A LogitsProcessor that handles adding timestamps to generated text. + * @extends LogitsProcessor + */ +export class WhisperTimeStampLogitsProcessor extends LogitsProcessor { + /** + * Constructs a new WhisperTimeStampLogitsProcessor. + * @param {Object} generate_config The config object passed to the `generate()` method of a transformer model. + * @param {number} generate_config.eos_token_id The ID of the end-of-sequence token. + * @param {number} generate_config.no_timestamps_token_id The ID of the token used to indicate that a token should not have a timestamp. + * @param {number[][]} [generate_config.forced_decoder_ids] An array of two-element arrays representing decoder IDs that are forced to appear in the output. The second element of each array indicates whether the token is a timestamp. + * @param {number} [generate_config.max_initial_timestamp_index] The maximum index at which an initial timestamp can appear. + */ + constructor(generate_config) { + super(); + this.eos_token_id = generate_config.eos_token_id; + this.no_timestamps_token_id = generate_config.no_timestamps_token_id; + this.timestamp_begin = this.no_timestamps_token_id + 1; + + this.begin_index = (generate_config.forced_decoder_ids || []).length + 2; + if (generate_config.forced_decoder_ids.slice(-1)[0][1] === this.no_timestamps_token_id) { + this.begin_index -= 1; + } + this.max_initial_timestamp_index = generate_config.max_initial_timestamp_index; + + } + + /** + * Modify the logits to handle timestamp tokens. + * @param {Array} input_ids The input sequence of tokens. + * @param {Tensor} logits The logits output by the model. + * @returns {Tensor} The modified logits. + */ + _call(input_ids, logits) { + // suppress <|notimestamps|> which is handled by without_timestamps + logits.data[this.no_timestamps_token_id] = -Infinity; + + if (input_ids.length === this.begin_index - 1) { + logits.data.fill(-Infinity); + logits.data[this.timestamp_begin] = 0; + return logits; + } + + // timestamps have to appear in pairs, except directly before eos_token; mask logits accordingly + const seq = input_ids.slice(this.begin_index); + const last_was_timestamp = seq.length >= 1 && seq[seq.length - 1] >= this.timestamp_begin; + const penultimate_was_timestamp = seq.length < 2 || seq[seq.length - 2] >= this.timestamp_begin; + + if (last_was_timestamp) { + if (penultimate_was_timestamp) { // has to be non-timestamp + logits.data.subarray(this.timestamp_begin).fill(-Infinity); + } else { // cannot be normal text tokens + logits.data.subarray(0, this.eos_token_id).fill(-Infinity); + } + } + + // apply the `max_initial_timestamp` option + if (input_ids.length === this.begin_index && this.max_initial_timestamp_index !== null) { + const last_allowed = this.timestamp_begin + this.max_initial_timestamp_index; + logits.data.subarray(last_allowed + 1).fill(-Infinity); + } + + // if sum of probability over timestamps is above any other token, sample timestamp + const logprobs = log_softmax(logits.data); + const timestamp_logprob = Math.log(logprobs.subarray(this.timestamp_begin).map(Math.exp).reduce((a, b) => a + b)); + const max_text_token_logprob = Math.max(...logprobs.subarray(0, this.timestamp_begin)); + if (timestamp_logprob > max_text_token_logprob) { + logits.data.subarray(0, this.timestamp_begin).fill(-Infinity); + } + + return logits; + } +} + +/** + * A logits processor that disallows ngrams of a certain size to be repeated. + * + * @extends LogitsProcessor + */ +export class NoRepeatNGramLogitsProcessor extends LogitsProcessor { + /** + * Create a NoRepeatNGramLogitsProcessor. + * @param {number} no_repeat_ngram_size The no-repeat-ngram size. All ngrams of this size can only occur once. + */ + constructor(no_repeat_ngram_size) { + super(); + this.no_repeat_ngram_size = no_repeat_ngram_size; + } + + /** + * Generate n-grams from a sequence of token ids. + * @param {number[]} prevInputIds List of previous input ids + * @returns {Map} Map of generated n-grams + */ + getNgrams(prevInputIds) { + const curLen = prevInputIds.length; + + /**@type {number[][]} */ + const ngrams = []; + for (let j = 0; j < curLen + 1 - this.no_repeat_ngram_size; ++j) { + const ngram = []; + for (let k = 0; k < this.no_repeat_ngram_size; ++k) { + ngram.push(prevInputIds[j + k]); + } + ngrams.push(ngram); + } + + /** @type {Map} */ + const generatedNgram = new Map(); + for (const ngram of ngrams) { + const prevNgram = ngram.slice(0, ngram.length - 1); + const prevNgramKey = JSON.stringify(prevNgram); + const prevNgramValue = generatedNgram.get(prevNgramKey) ?? []; + prevNgramValue.push(ngram[ngram.length - 1]); + generatedNgram.set(prevNgramKey, prevNgramValue); + } + return generatedNgram; + } + + /** + * Generate n-grams from a sequence of token ids. + * @param {Map} bannedNgrams Map of banned n-grams + * @param {number[]} prevInputIds List of previous input ids + * @returns {number[]} Map of generated n-grams + */ + getGeneratedNgrams(bannedNgrams, prevInputIds) { + const ngramIdx = prevInputIds.slice(prevInputIds.length + 1 - this.no_repeat_ngram_size, prevInputIds.length); + const banned = bannedNgrams.get(JSON.stringify(ngramIdx)) ?? []; + return banned; + } + + /** + * Calculate banned n-gram tokens + * @param {number[]} prevInputIds List of previous input ids + * @returns {number[]} Map of generated n-grams + */ + calcBannedNgramTokens(prevInputIds) { + const bannedTokens = []; + if (prevInputIds.length + 1 < this.no_repeat_ngram_size) { + // return no banned tokens if we haven't generated no_repeat_ngram_size tokens yet + return bannedTokens; + + } else { + const generatedNgrams = this.getNgrams(prevInputIds); + const bannedTokens = this.getGeneratedNgrams(generatedNgrams, prevInputIds); + return bannedTokens; + } + } + + /** + * Apply the no-repeat-ngram processor to the logits. + * @param {Array} input_ids The input IDs. + * @param {Object} logits The logits. + * @returns {Object} The logits with no-repeat-ngram processing. + */ + _call(input_ids, logits) { + const bannedTokens = this.calcBannedNgramTokens(input_ids); + + for (const token of bannedTokens) { + logits.data[token] = -Infinity; + } + return logits; + } +} + +/** + * A logits processor that penalises repeated output tokens. + * + * @extends LogitsProcessor + */ +export class RepetitionPenaltyLogitsProcessor extends LogitsProcessor { + /** + * Create a RepetitionPenaltyLogitsProcessor. + * @param {number} penalty The penalty to apply for repeated tokens. + */ + constructor(penalty) { + super(); + this.penalty = penalty; + } + + /** + * Apply the repetition penalty to the logits. + * @param {Array} input_ids The input IDs. + * @param {Object} logits The logits. + * @returns {Object} The logits with repetition penalty processing. + */ + _call(input_ids, logits) { + // Modify the logits corresponding to each element in `input_ids`. + // As a consequence, the logits corresponding to tokens that appear + // many times in the output will be penalised more. + for (const input_id of input_ids) { + if (logits.data[input_id] < 0) { + logits.data[input_id] *= this.penalty; + } else { + logits.data[input_id] /= this.penalty; + } + } + return logits + } +} + +/** + * Class that holds a configuration for a generation task. + */ +export class GenerationConfig { + /** + * Create a GenerationConfig object + * @param {Object} [kwargs={}] The configuration parameters. If not set, the default values are used. + * @param {number} [kwargs.max_length=20] The maximum length the generated tokens can have. Corresponds to the length of the input prompt + `max_new_tokens`. Its effect is overridden by `max_new_tokens`, if also set. + * @param {number} [kwargs.max_new_tokens=null] The maximum numbers of tokens to generate, ignoring the number of tokens in the prompt. + * @param {number} [kwargs.min_length=0] The minimum length of the sequence to be generated. Corresponds to the length of the input prompt + `min_new_tokens`. Its effect is overridden by `min_new_tokens`, if also set. + * @param {number} [kwargs.min_new_tokens=null] The minimum numbers of tokens to generate, ignoring the number of tokens in the prompt. + * @param {boolean|"never"} [kwargs.early_stopping=false] Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values: + * - `true`, where the generation stops as soon as there are `num_beams` complete candidates; + * - `false`, where an heuristic is applied and the generation stops when is it very unlikely to find better candidates; + * - `"never"`, where the beam search procedure only stops when there cannot be better candidates (canonical beam search algorithm). + * @param {number} [kwargs.max_time=null] The maximum amount of time you allow the computation to run for in seconds. Generation will still finish the current pass after allocated time has been passed. + * + * @param {boolean} [kwargs.do_sample=false] Whether or not to use sampling; use greedy decoding otherwise. + * @param {number} [kwargs.num_beams=1] Number of beams for beam search. 1 means no beam search. + * @param {number} [kwargs.num_beam_groups=1] Number of groups to divide `num_beams` into in order to ensure diversity among different groups of beams. See [this paper](https://arxiv.org/pdf/1610.02424.pdf) for more details. + * @param {number} [kwargs.penalty_alpha=null] The values balance the model confidence and the degeneration penalty in contrastive search decoding. + * @param {boolean} [kwargs.use_cache=true] Whether or not the model should use the past last key/values attentions (if applicable to the model) to speed up decoding. + * + * @param {number} [kwargs.temperature=1.0] The value used to modulate the next token probabilities. + * @param {number} [kwargs.top_k=50] The number of highest probability vocabulary tokens to keep for top-k-filtering. + * @param {number} [kwargs.top_p=1.0] 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. + * @param {number} [kwargs.typical_p=1.0] 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. 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. See [this paper](https://arxiv.org/pdf/2202.00666.pdf) for more details. + * @param {number} [kwargs.epsilon_cutoff=0.0] If set to float strictly between 0 and 1, only tokens with a conditional probability greater than `epsilon_cutoff` will be sampled. In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://arxiv.org/abs/2210.15191) for more details. + * @param {number} [kwargs.eta_cutoff=0.0] Eta sampling is a hybrid of locally typical sampling and epsilon sampling. 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)))`. 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. See [Truncation Sampling as Language Model Desmoothing](https://arxiv.org/abs/2210.15191) for more details. + * @param {number} [kwargs.diversity_penalty=0.0] 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. Note that `diversity_penalty` is only effective if `group beam search` is enabled. + * @param {number} [kwargs.repetition_penalty=1.0] The parameter for repetition penalty. 1.0 means no penalty. See [this paper](https://arxiv.org/pdf/1909.05858.pdf) for more details. + * @param {number} [kwargs.encoder_repetition_penalty=1.0] The paramater for encoder_repetition_penalty. An exponential penalty on sequences that are not in the original input. 1.0 means no penalty. + * @param {number} [kwargs.length_penalty=1.0] Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to the sequence length, which in turn is used to divide the score of the sequence. 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. + * @param {number} [kwargs.no_repeat_ngram_size=0] If set to int > 0, all ngrams of that size can only occur once. + * @param {number[][]} [kwargs.bad_words_ids=null] List of token ids that are not allowed to be generated. In order to get the token ids of the words that should not appear in the generated text, use `(await tokenizer(bad_words, {add_prefix_space: true, add_special_tokens: false})).input_ids`. + * @param {number[][]|number[][][]} [kwargs.force_words_ids=null] List of token ids that must be generated. If given a `number[][]`, this is treated as a simple list of words that must be included, the opposite to `bad_words_ids`. If given `number[][][]`, this triggers a [disjunctive constraint](https://github.com/huggingface/transformers/issues/14081), where one can allow different forms of each word. + * @param {boolean} [kwargs.renormalize_logits=false] Whether to renormalize the logits after applying all the logits processors or warpers (including the custom ones). 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. + * @param {Object[]} [kwargs.constraints=null] 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. + * + * @param {number} [kwargs.forced_bos_token_id=null] The id of the token to force as the first generated token after the `decoder_start_token_id`. Useful for multilingual models like mBART where the first generated token needs to be the target language token. + * @param {number|number[]} [kwargs.forced_eos_token_id=null] The id of the token to force as the last generated token when `max_length` is reached. Optionally, use a list to set multiple *end-of-sequence* tokens. + * @param {boolean} [kwargs.remove_invalid_values=false] 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. + * @param {number[]} [kwargs.exponential_decay_length_penalty=null] This Tuple adds an exponentially increasing length penalty, after a certain amount of tokens have been generated. 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. + * @param {number[]} [kwargs.suppress_tokens=null] A list of tokens that will be suppressed at generation. The `SupressTokens` logit processor will set their log probs to `-inf` so that they are not sampled. + * @param {number[]} [kwargs.begin_suppress_tokens=null] A list of tokens that will be suppressed at the beginning of the generation. The `SupressBeginTokens` logit processor will set their log probs to `-inf` so that they are not sampled. + * @param {number[][]} [kwargs.forced_decoder_ids=null] A list of pairs of integers which indicates a mapping from generation indices to token indices that will be forced before sampling. For example, `[[1, 123]]` means the second generated token will always be a token of index 123. + * + * @param {number} [kwargs.num_return_sequences=1] The number of independently computed returned sequences for each element in the batch. + * @param {boolean} [kwargs.output_attentions=false] Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned tensors for more details. + * @param {boolean} [kwargs.output_hidden_states=false] Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for more details. + * @param {boolean} [kwargs.output_scores=false] Whether or not to return the prediction scores. See `scores` under returned tensors for more details. + * @param {boolean} [kwargs.return_dict_in_generate=false] Whether or not to return a `ModelOutput` instead of a plain tuple. + * + * @param {number} [kwargs.pad_token_id=null] The id of the *padding* token. + * @param {number} [kwargs.bos_token_id=null] The id of the *beginning-of-sequence* token. + * @param {number|number[]} [kwargs.eos_token_id=null] The id of the *end-of-sequence* token. Optionally, use a list to set multiple *end-of-sequence* tokens. + * + * @param {number} [kwargs.encoder_no_repeat_ngram_size=0] If set to int > 0, all ngrams of that size that occur in the `encoder_input_ids` cannot occur in the `decoder_input_ids`. + * @param {number} [kwargs.decoder_start_token_id=null] If an encoder-decoder model starts decoding with a different token than *bos*, the id of that token. + * + * @param {Object} [kwargs.generation_kwargs={}] Additional generation kwargs will be forwarded to the `generate` function of the model. Kwargs that are not present in `generate`'s signature will be used in the model forward pass. + */ + constructor(kwargs = {}) { + // Parameters that control the length of the output + this.max_length = kwargs.max_length ?? 20; + this.max_new_tokens = kwargs.max_new_tokens ?? null; + this.min_length = kwargs.min_length ?? 0; + this.min_new_tokens = kwargs.min_new_tokens ?? null; + this.early_stopping = kwargs.early_stopping ?? false; + this.max_time = kwargs.max_time ?? null; + + // Parameters that control the generation strategy used + this.do_sample = kwargs.do_sample ?? false; + this.num_beams = kwargs.num_beams ?? 1; + this.num_beam_groups = kwargs.num_beam_groups ?? 1; + this.penalty_alpha = kwargs.penalty_alpha ?? null; + this.use_cache = kwargs.use_cache ?? true; + + // Parameters for manipulation of the model output logits + this.temperature = kwargs.temperature ?? 1.0; + this.top_k = kwargs.top_k ?? 50; + this.top_p = kwargs.top_p ?? 1.0; + this.typical_p = kwargs.typical_p ?? 1.0; + this.epsilon_cutoff = kwargs.epsilon_cutoff ?? 0.0; + this.eta_cutoff = kwargs.eta_cutoff ?? 0.0; + this.diversity_penalty = kwargs.diversity_penalty ?? 0.0; + this.repetition_penalty = kwargs.repetition_penalty ?? 1.0; + this.encoder_repetition_penalty = kwargs.encoder_repetition_penalty ?? 1.0; + this.length_penalty = kwargs.length_penalty ?? 1.0; + this.no_repeat_ngram_size = kwargs.no_repeat_ngram_size ?? 0; + this.bad_words_ids = kwargs.bad_words_ids ?? null; + this.force_words_ids = kwargs.force_words_ids ?? null; + this.renormalize_logits = kwargs.renormalize_logits ?? false; + this.constraints = kwargs.constraints ?? null; + this.forced_bos_token_id = kwargs.forced_bos_token_id ?? null; + this.forced_eos_token_id = kwargs.forced_eos_token_id ?? null; + this.remove_invalid_values = kwargs.remove_invalid_values ?? false; + this.exponential_decay_length_penalty = kwargs.exponential_decay_length_penalty ?? null; + this.suppress_tokens = kwargs.suppress_tokens ?? null; + this.begin_suppress_tokens = kwargs.begin_suppress_tokens ?? null; + this.forced_decoder_ids = kwargs.forced_decoder_ids ?? null; + + // Parameters that define the output variables of `generate` + this.num_return_sequences = kwargs.num_return_sequences ?? 1; + this.output_attentions = kwargs.output_attentions ?? false; + this.output_hidden_states = kwargs.output_hidden_states ?? false; + this.output_scores = kwargs.output_scores ?? false; + this.return_dict_in_generate = kwargs.return_dict_in_generate ?? false; + + // Special tokens that can be used at generation time + this.pad_token_id = kwargs.pad_token_id ?? null; + this.bos_token_id = kwargs.bos_token_id ?? null; + this.eos_token_id = kwargs.eos_token_id ?? null; + + // Generation parameters exclusive to encoder-decoder models + this.encoder_no_repeat_ngram_size = kwargs.encoder_no_repeat_ngram_size ?? 0; + this.decoder_start_token_id = kwargs.decoder_start_token_id ?? null; + + // Wild card + this.generation_kwargs = kwargs.generation_kwargs ?? {}; + } +} + + +/** + * Sampler is a base class for all sampling methods used for text generation. + */ +export class Sampler extends Callable { + /** + * Creates a new Sampler object with the specified temperature. + * @param {number} temperature The temperature to use when sampling. Higher values result in more random samples. + */ + constructor(temperature) { + super(); + this.temperature = temperature; + } + + /** + * Executes the sampler, using the specified logits. + * @param {any} logits + * @param {number} index + * @returns {void} + */ + _call(logits, index = -1) { + // Sample from logits, of dims [batch, sequence_length, vocab_size]. + // If index is specified, sample from [batch, index, vocab_size]. + return this.sample(logits, index); + } + + /** + * Abstract method for sampling the logits. + * @param {any} logits + * @param {number} index + * @throws {Error} + */ + sample(logits, index) { + throw Error("sample should be implemented in subclasses.") + } + + /** + * Returns the specified logits as an array, with temperature applied. + * @param {any} logits + * @param {number} index + * @returns {Array} + */ + getLogits(logits, index) { + let vocabSize = logits.dims[2]; + + let logs = logits.data; + + if (index === -1) { + logs = logs.slice(-vocabSize); + } else { + let startIndex = index * vocabSize; + logs = logs.slice(startIndex, startIndex + vocabSize); + } + + // add temperature + if (this.temperature > 0) { + logs = logs.map(x => x / this.temperature) + } + return logs; + } + + /** + * Selects an item randomly based on the specified probabilities. + * @param {Array} probabilities An array of probabilities to use for selection. + * @returns {number} The index of the selected item. + */ + randomSelect(probabilities) { + // Return index of chosen item + let sumProbabilities = probabilities.reduce((acc, curr) => acc + curr, 0); + + let r = Math.random() * sumProbabilities; + for (let i = 0; i < probabilities.length; ++i) { + r -= probabilities[i]; + if (r <= 0) { + return i; + } + } + return 0; // return first (most probable) as a fallback + } + + /** + * Returns a Sampler object based on the specified options. + * @param {Object} generation_config An object containing options for the sampler. + * @returns {Sampler} A Sampler object. + */ + static getSampler(generation_config) { + if (generation_config.num_beams > 1) { + return new BeamSearchSampler( + generation_config.temperature, + generation_config.num_beams, + generation_config.do_sample, + generation_config.top_k, + ); + + } else if (generation_config.do_sample) { + return new TopKSampler( + generation_config.temperature, + generation_config.top_k, + ); + + } else { + if (generation_config.num_return_sequences > 1) { + throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${generation_config.num_return_sequences}.`) + } + return new GreedySampler(generation_config.temperature); + } + } +} + +/** + * Class representing a Greedy Sampler. + * @extends Sampler + */ +class GreedySampler extends Sampler { + /** + * Sample the maximum probability of a given logits tensor. + * @param {any} logits + * @param {number} [index=-1] + * @returns {Array} An array with a single tuple, containing the index of the maximum value and a meaningless score (since this is a greedy search). + */ + sample(logits, index = -1) { + // NOTE: no need to do log_softmax here since we only take the maximum + let logs = this.getLogits(logits, index); + let argmax = max(logs)[1]; + + // Note: score is meaningless in this context, since we are performing + // greedy search (p = 1 => log(p) = 0) + return [ + [argmax, 0] + ]; + } +} + +/** + * Class representing a TopKSampler. + * @extends Sampler + */ +class TopKSampler extends Sampler { + /** + * Create a TopKSampler. + * @param {number} temperature + * @param {number} k + */ + constructor(temperature, k) { + super(temperature); + this.k = k; + } + + /** + * Sample from the logits using the top-k sampling strategy. + * @param {any} logits + * @param {number} index + * @returns {Array} + */ + sample(logits, index = -1) { + let [batchSize, seqLength, vocabSize] = logits.dims; + let k = vocabSize; + if (this.k > 0) { + k = Math.min(this.k, k); + } + + let logs = this.getLogits(logits, index); + + // Get top k tokens + let topLogits = getTopItems(logs, k); + + // Compute softmax over logits + let probabilities = softmax(topLogits.map(x => x[1])); + + let sampledIndex = this.randomSelect(probabilities); + + let tokenId = topLogits[sampledIndex][0]; + let score = Math.log(probabilities[sampledIndex]); + return [ + [tokenId, score] + ]; + } +} + +/** + * Class representing a beam search sampler for generating sequences. + * @extends Sampler + */ +class BeamSearchSampler extends Sampler { + /** + * Create a BeamSearchSampler. + * @param {number} temperature + * @param {number} num_beams + * @param {boolean} do_sample + * @param {number} top_k + */ + constructor(temperature, num_beams, do_sample, top_k) { + super(temperature); + this.num_beams = num_beams; // maximum number of beams + this.do_sample = do_sample; // if true, perform multinomial sampling + + this.top_k = top_k; // if do_sample, sample from top k items + } + + /** + * Samples from the logits to generate a sequence using beam search. + * @param {any} logits The logits to sample from. + * @param {number} [index=-1] The index to sample from, if applicable. + * @returns {Array} An array of arrays containing tokens and scores. + */ + sample(logits, index = -1) { + + let logs = this.getLogits(logits, index); + + if (this.do_sample || this.top_k > 0) { + const [batchSize, seqLength, vocabSize] = logits.dims; + + let k = vocabSize; + if (this.top_k > 0) { + k = Math.min(this.top_k, k); + } + const topLogits = getTopItems(logs, k); + + // Compute softmax over top k logits + const probabilities = softmax(topLogits.map(x => x[1])); + + return Array.from({ length: this.num_beams }, () => { + const sampledIndex = this.randomSelect(probabilities); + const tokenId = topLogits[sampledIndex][0]; + return [tokenId, Math.log(probabilities[sampledIndex])]; + }); + + } else { + // first perform log softmax to get scores over whole distribution + const logProbabilities = log_softmax(logs); + const topLogits = getTopItems(logProbabilities, this.num_beams); + return topLogits; + } + } +} diff --git a/src/utils/hub.js b/src/utils/hub.js new file mode 100644 index 000000000..65ee66b47 --- /dev/null +++ b/src/utils/hub.js @@ -0,0 +1,543 @@ + +/** + * @file Utility functions to interact with the Hugging Face Hub (https://huggingface.co/models) + * + * @module utils/hub + */ + +import fs from 'fs'; +import path from 'path'; +import stream from 'stream/web'; + +import { env } from '../env.js'; +import { dispatchCallback } from './core.js'; + +if (!globalThis.ReadableStream) { + // @ts-ignore + globalThis.ReadableStream = stream.ReadableStream; // ReadableStream is not a global with Node 16 +} + +/** + * @typedef {Object} PretrainedOptions Options for loading a pretrained model. + * @property {boolean?} [options.quantized=true] Whether to load the 8-bit quantized version of the model (only applicable when loading model files). + * @property {function} [options.progress_callback=null] If specified, this function will be called during model construction, to provide the user with progress updates. + * @property {Object} [options.config=null] Configuration for the model to use instead of an automatically loaded configuration. Configuration can be automatically loaded when: + * - The model is a model provided by the library (loaded with the *model id* string of a pretrained model). + * - 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. + * @property {string} [options.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. + * @property {boolean} [options.local_files_only=false] Whether or not to only look at local files (e.g., not try downloading the model). + * @property {string} [options.revision='main'] The specific model version to use. It can be a branch name, a tag name, or a commit id, + * 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. + */ + +class Headers extends Object { + constructor(...args) { + super(); + Object.assign(this, args); + } + + get(key) { + return this[key]; + } + + clone() { + return new Headers(this); + } +} + +class FileResponse { + /** + * Mapping from file extensions to MIME types. + */ + _CONTENT_TYPE_MAP = { + 'txt': 'text/plain', + 'html': 'text/html', + 'css': 'text/css', + 'js': 'text/javascript', + 'json': 'application/json', + 'png': 'image/png', + 'jpg': 'image/jpeg', + 'jpeg': 'image/jpeg', + 'gif': 'image/gif', + } + /** + * Creates a new `FileResponse` object. + * @param {string|URL} filePath + */ + constructor(filePath) { + this.filePath = filePath; + this.headers = new Headers(); + + this.exists = fs.existsSync(filePath); + if (this.exists) { + this.status = 200; + this.statusText = 'OK'; + + let stats = fs.statSync(filePath); + this.headers['content-length'] = stats.size; + + this.updateContentType(); + + let self = this; + this.body = new ReadableStream({ + start(controller) { + self.arrayBuffer().then(buffer => { + controller.enqueue(new Uint8Array(buffer)); + controller.close(); + }) + } + }); + } else { + this.status = 404; + this.statusText = 'Not Found'; + this.body = null; + } + } + + /** + * Updates the 'content-type' header property of the response based on the extension of + * the file specified by the filePath property of the current object. + * @returns {void} + */ + updateContentType() { + // Set content-type header based on file extension + const extension = this.filePath.toString().split('.').pop().toLowerCase(); + this.headers['content-type'] = this._CONTENT_TYPE_MAP[extension] ?? 'application/octet-stream'; + } + + /** + * Clone the current FileResponse object. + * @returns {FileResponse} A new FileResponse object with the same properties as the current object. + */ + clone() { + let response = new FileResponse(this.filePath); + response.exists = this.exists; + response.status = this.status; + response.statusText = this.statusText; + response.headers = this.headers.clone(); + return response; + } + + /** + * Reads the contents of the file specified by the filePath property and returns a Promise that + * resolves with an ArrayBuffer containing the file's contents. + * @returns {Promise} A Promise that resolves with an ArrayBuffer containing the file's contents. + * @throws {Error} If the file cannot be read. + */ + async arrayBuffer() { + const data = await fs.promises.readFile(this.filePath); + return data.buffer; + } + + /** + * Reads the contents of the file specified by the filePath property and returns a Promise that + * resolves with a Blob containing the file's contents. + * @returns {Promise} A Promise that resolves with a Blob containing the file's contents. + * @throws {Error} If the file cannot be read. + */ + async blob() { + const data = await fs.promises.readFile(this.filePath); + return new Blob([data], { type: this.headers['content-type'] }); + } + + /** + * Reads the contents of the file specified by the filePath property and returns a Promise that + * resolves with a string containing the file's contents. + * @returns {Promise} A Promise that resolves with a string containing the file's contents. + * @throws {Error} If the file cannot be read. + */ + async text() { + const data = await fs.promises.readFile(this.filePath, 'utf8'); + return data; + } + + /** + * Reads the contents of the file specified by the filePath property and returns a Promise that + * resolves with a parsed JavaScript object containing the file's contents. + * + * @returns {Promise} A Promise that resolves with a parsed JavaScript object containing the file's contents. + * @throws {Error} If the file cannot be read. + */ + async json() { + return JSON.parse(await this.text()); + } +} + +/** + * Determines whether the given string is a valid HTTP or HTTPS URL. + * @param {string|URL} string The string to test for validity as an HTTP or HTTPS URL. + * @returns {boolean} True if the string is a valid HTTP or HTTPS URL, false otherwise. + */ +function isValidHttpUrl(string) { + // https://stackoverflow.com/a/43467144 + let url; + try { + url = new URL(string); + } catch (_) { + return false; + } + return url.protocol === "http:" || url.protocol === "https:"; +} + +/** + * Helper function to get a file, using either the Fetch API or FileSystem API. + * + * @param {URL|string} urlOrPath The URL/path of the file to get. + * @returns {Promise} A promise that resolves to a FileResponse object (if the file is retrieved using the FileSystem API), or a Response object (if the file is retrieved using the Fetch API). + */ +export async function getFile(urlOrPath) { + // Helper function to get a file, using either the Fetch API or FileSystem API + + if (env.useFS && !isValidHttpUrl(urlOrPath)) { + return new FileResponse(urlOrPath); + + } else { + return fetch(urlOrPath); + } +} + +/** + * Helper method to handle fatal errors that occur while trying to load a file from the Hugging Face Hub. + * @param {number} status The HTTP status code of the error. + * @param {string} remoteURL The URL of the file that could not be loaded. + * @param {boolean} fatal Whether to raise an error if the file could not be loaded. + * @returns {null} Returns `null` if `fatal = true`. + * @throws {Error} If `fatal = false`. + */ +function handleError(status, remoteURL, fatal) { + if (!fatal) { + // File was not loaded correctly, but it is optional. + // TODO in future, cache the response? + return null; + } + + switch (status) { + // 4xx errors (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses) + case 400: + throw Error(`Bad request error occurred while trying to load file: "${remoteURL}".`) + case 401: + throw Error(`Unauthorized access to file: "${remoteURL}".`) + case 403: + throw Error(`Forbidden access to file: "${remoteURL}".`) + case 404: + throw Error(`Could not locate file: "${remoteURL}".`) + case 408: + throw Error(`Request timeout error occurred while trying to load file: "${remoteURL}".`) + + // 5xx errors (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) + case 500: + throw Error(`Internal server error error occurred while trying to load file: "${remoteURL}".`) + case 502: + throw Error(`Bad gateway error occurred while trying to load file: "${remoteURL}".`) + case 503: + throw Error(`Service unavailable error occurred while trying to load file: "${remoteURL}".`) + case 504: + throw Error(`Gateway timeout error occurred while trying to load file: "${remoteURL}".`) + + // Other: + default: + throw Error(`Error (${status}) occurred while trying to load file: "${remoteURL}".`) + } +} + +class FileCache { + /** + * Instantiate a `FileCache` object. + * @param {string} path + */ + constructor(path) { + this.path = path; + } + + /** + * Checks whether the given request is in the cache. + * @param {string} request + * @returns {Promise} + */ + async match(request) { + + let filePath = path.join(this.path, request); + let file = new FileResponse(filePath); + + if (file.exists) { + return file; + } else { + return undefined; + } + } + + /** + * Adds the given response to the cache. + * @param {string} request + * @param {Response|FileResponse} response + * @returns {Promise} + */ + async put(request, response) { + const buffer = Buffer.from(await response.arrayBuffer()); + + let outputPath = path.join(this.path, request); + + try { + await fs.promises.mkdir(path.dirname(outputPath), { recursive: true }); + await fs.promises.writeFile(outputPath, buffer); + + } catch (err) { + console.warn('An error occurred while writing the file to cache:', err) + } + } + + // TODO add the rest? + // addAll(requests: RequestInfo[]): Promise; + // delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + // keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + // match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + // matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; +} +/** + * + * Retrieves a file from either a remote URL using the Fetch API or from the local file system using the FileSystem API. + * If the filesystem is available and `env.useCache = true`, the file will be downloaded and cached. + * + * @param {string} path_or_repo_id This can be either: + * - a string, the *model id* of a model repo on huggingface.co. + * - a path to a *directory* potentially containing the file. + * @param {string} filename The name of the file to locate in `path_or_repo`. + * @param {boolean} [fatal=true] Whether to throw an error if the file is not found. + * @param {PretrainedOptions} [options] An object containing optional parameters. + * + * @throws Will throw an error if the file is not found and `fatal` is true. + * @returns {Promise} A Promise that resolves with the file content as a buffer. + */ +export async function getModelFile(path_or_repo_id, filename, fatal = true, options = {}) { + + // Initiate file retrieval + dispatchCallback(options.progress_callback, { + status: 'initiate', + name: path_or_repo_id, + file: filename + }) + + // First, check if the a caching backend is available + // If no caching mechanism available, will download the file every time + let cache; + if (!cache && env.useBrowserCache) { + if (typeof caches === 'undefined') { + throw Error('Browser cache is not available in this environment.') + } + cache = await caches.open('transformers-cache'); + } + + if (!cache && env.useFSCache) { + // TODO throw error if not available + + // If `cache_dir` is not specified, use the default cache directory + cache = new FileCache(options.cache_dir ?? env.cacheDir); + } + + const request = pathJoin(path_or_repo_id, filename); + + /** @type {Response} */ + let responseToCache; + + /** @type {Response | FileResponse} */ + let response; + + if (cache) { + // Cache available, so we try to get the file from the cache. + response = await cache.match(request); + } + + if (response === undefined) { + // Caching not available, or file is not cached, so we perform the request + + let isURL = isValidHttpUrl(request); + let localPath = pathJoin(env.localModelPath, request); + // If request is a valid HTTP URL, we skip the local file check. Otherwise, we + // try to get the file locally. + if (!isURL) { + response = await getFile(localPath); + } else if (options.local_files_only) { + throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${request}.`); + } else if (!env.allowRemoteModels) { + throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${request}.`); + } + + if (response === undefined || response.status === 404) { + // File not found locally. This means either: + // - the path is a valid HTTP url (`response === undefined`) + // - the path is not a valid HTTP url and the file is not present locally on the file system/server (`response.status === 404`) + if (options.local_files_only || !env.allowRemoteModels) { + // User requested local files only, but the file is not found locally. + if (fatal) { + throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${localPath}".`); + } else { + // File not found, but this file is optional. + // TODO in future, cache the response? + return null; + } + } + + // File not found locally, so we try to download it from the remote server + let remoteURL = pathJoin( + env.remoteHost, + env.remotePathTemplate + .replace('{model}', path_or_repo_id) + .replace('{revision}', options.revision ?? 'main'), + filename + ); + response = await getFile(remoteURL); + + if (response.status !== 200) { + return handleError(response.status, remoteURL, fatal); + } + } + + + if (cache && response instanceof Response && response.status === 200) { + // only clone if cache available, and response is valid + responseToCache = response.clone(); + } + } + + + // Start downloading + dispatchCallback(options.progress_callback, { + status: 'download', + name: path_or_repo_id, + file: filename + }) + + const buffer = await readResponse(response, data => { + dispatchCallback(options.progress_callback, { + status: 'progress', + ...data, + name: path_or_repo_id, + file: filename + }) + }) + + + if ( + // Only cache web responses + // i.e., do not cache FileResponses (prevents duplication) + responseToCache + && + // Check again whether request is in cache. If not, we add the response to the cache + (await cache.match(request) === undefined) + ) { + await cache.put(request, responseToCache) + .catch(err => { + // Do not crash if unable to add to cache (e.g., QuotaExceededError). + // Rather, log a warning and proceed with execution. + console.warn(`Unable to add ${request} to browser cache: ${err}.`); + }); + } + + dispatchCallback(options.progress_callback, { + status: 'done', + name: path_or_repo_id, + file: filename + }); + + return buffer; +} + +/** + * Fetches a JSON file from a given path and file name. + * + * @param {string} modelPath The path to the directory containing the file. + * @param {string} fileName The name of the file to fetch. + * @param {boolean} [fatal=true] Whether to throw an error if the file is not found. + * @param {PretrainedOptions} [options] An object containing optional parameters. + * @returns {Promise} The JSON data parsed into a JavaScript object. + * @throws Will throw an error if the file is not found and `fatal` is true. + */ +export async function getModelJSON(modelPath, fileName, fatal = true, options = {}) { + let buffer = await getModelFile(modelPath, fileName, fatal, options); + if (buffer === null) { + // Return empty object + return {} + } + + let decoder = new TextDecoder('utf-8'); + let jsonData = decoder.decode(buffer); + + return JSON.parse(jsonData); +} + +/** + * Read and track progress when reading a Response object + * + * @param {any} response The Response object to read + * @param {function} progress_callback The function to call with progress updates + * @returns {Promise} A Promise that resolves with the Uint8Array buffer + */ +async function readResponse(response, progress_callback) { + // Read and track progress when reading a Response object + + const contentLength = response.headers.get('Content-Length'); + if (contentLength === null) { + console.warn('Unable to determine content-length from response headers. Will expand buffer when needed.') + } + let total = parseInt(contentLength ?? '0'); + let buffer = new Uint8Array(total); + let loaded = 0; + + const reader = response.body.getReader(); + async function read() { + const { done, value } = await reader.read(); + if (done) return; + + let newLoaded = loaded + value.length; + if (newLoaded > total) { + total = newLoaded; + + // Adding the new data will overflow buffer. + // In this case, we extend the buffer + let newBuffer = new Uint8Array(total); + + // copy contents + newBuffer.set(buffer); + + buffer = newBuffer; + } + buffer.set(value, loaded) + loaded = newLoaded; + + const progress = (loaded / total) * 100; + + // Call your function here + progress_callback({ + progress: progress, + loaded: loaded, + total: total, + }) + + return read(); + } + + // Actually read + await read(); + + return buffer; +} + +/** + * Joins multiple parts of a path into a single path, while handling leading and trailing slashes. + * + * @param {...string} parts Multiple parts of a path. + * @returns {string} A string representing the joined path. + */ +function pathJoin(...parts) { + // https://stackoverflow.com/a/55142565 + parts = parts.map((part, index) => { + if (index) { + part = part.replace(new RegExp('^/'), ''); + } + if (index !== parts.length - 1) { + part = part.replace(new RegExp('/$'), ''); + } + return part; + }) + return parts.join('/'); +} diff --git a/src/utils/image.js b/src/utils/image.js new file mode 100644 index 000000000..55d453c29 --- /dev/null +++ b/src/utils/image.js @@ -0,0 +1,550 @@ + +/** + * @file Helper module for image processing. + * + * These functions and classes are only used internally, + * meaning an end-user shouldn't need to access anything here. + * + * @module utils/image + */ + +import fs from 'fs'; +import { isString } from './core.js'; +import { getFile } from './hub.js'; +import { env } from '../env.js'; + +// Will be empty (or not used) if running in browser or web-worker +import sharp from 'sharp'; + +const BROWSER_ENV = typeof self !== 'undefined'; + +let createCanvasFunction; +let ImageDataClass; +let loadImageFunction; +if (BROWSER_ENV) { + // Running in browser or web-worker + createCanvasFunction = (/** @type {number} */ width, /** @type {number} */ height) => { + if (!self.OffscreenCanvas) { + throw new Error('OffscreenCanvas not supported by this browser.'); + } + return new self.OffscreenCanvas(width, height) + }; + loadImageFunction = self.createImageBitmap; + ImageDataClass = self.ImageData; + +} else if (sharp) { + // Running in Node.js, electron, or other non-browser environment + + loadImageFunction = async (/**@type {sharp.Sharp}*/img) => { + let { data, info } = await img.raw().toBuffer({ resolveWithObject: true }); + return new CustomImage(new Uint8ClampedArray(data), info.width, info.height, info.channels); + } + +} else { + throw new Error('Unable to load image processing library.'); +} + + +// Defined here: https://github.com/python-pillow/Pillow/blob/a405e8406b83f8bfb8916e93971edc7407b8b1ff/src/libImaging/Imaging.h#L262-L268 +const RESAMPLING_MAPPING = { + 0: 'nearest', + 1: 'lanczos', + 2: 'bilinear', + 3: 'bicubic', + 4: 'box', + 5: 'hamming', +} + +export class CustomImage { + + /** + * Create a new CustomImage object. + * @param {Uint8ClampedArray} data The pixel data. + * @param {number} width The width of the image. + * @param {number} height The height of the image. + * @param {1|2|3|4} channels The number of channels. + */ + constructor(data, width, height, channels) { + this._update(data, width, height, channels); + } + + /** + * Helper method for reading an image from a variety of input types. + * @param {CustomImage|string|URL} input + * @returns The image object. + */ + static async read(input) { + if (input instanceof CustomImage) { + return input; + } else if (isString(input) || input instanceof URL) { + return await this.fromURL(input); + } else { + throw new Error(`Unsupported input type: ${typeof input}`); + } + } + + + /** + * Read an image from a URL or file path. + * @param {string|URL} url The URL or file path to read the image from. + * @returns {Promise} The image object. + */ + static async fromURL(url) { + let response = await getFile(url); + let blob = await response.blob(); + return this.fromBlob(blob); + } + + /** + * Helper method to create a new Image from a blob. + * @param {Blob} blob The blob to read the image from. + * @returns {Promise} The image object. + */ + static async fromBlob(blob) { + if (BROWSER_ENV) { + // Running in environment with canvas + let img = await loadImageFunction(blob); + + const ctx = createCanvasFunction(img.width, img.height).getContext('2d'); + + // Draw image to context + ctx.drawImage(img, 0, 0); + + return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4); + + } else { + // Use sharp.js to read (and possible resize) the image. + let img = sharp(await blob.arrayBuffer()); + + return await loadImageFunction(img); + } + } + + /** + * Convert the image to grayscale format. + * @returns {CustomImage} `this` to support chaining. + */ + grayscale() { + if (this.channels === 1) { + return this; + } + + let newData = new Uint8ClampedArray(this.width * this.height * 3); + switch (this.channels) { + case 3: // rgb to grayscale + case 4: // rgba to grayscale + for (let i = 0, offset = 0; i < this.data.length; i += this.channels) { + const red = this.data[i]; + const green = this.data[i + 1]; + const blue = this.data[i + 2]; + + newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue); + } + break; + default: + throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); + } + return this._update(newData, this.width, this.height, 1); + } + + /** + * Convert the image to RGB format. + * @returns {CustomImage} `this` to support chaining. + */ + rgb() { + if (this.channels === 3) { + return this; + } + + let newData = new Uint8ClampedArray(this.width * this.height * 3); + + switch (this.channels) { + case 1: // grayscale to rgb + for (let i = 0, offset = 0; i < this.data.length; ++i) { + newData[offset++] = this.data[i]; + newData[offset++] = this.data[i]; + newData[offset++] = this.data[i]; + } + break; + case 4: // rgba to rgb + for (let i = 0, offset = 0; i < this.data.length; i += 4) { + newData[offset++] = this.data[i]; + newData[offset++] = this.data[i + 1]; + newData[offset++] = this.data[i + 2]; + } + break; + default: + throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); + } + return this._update(newData, this.width, this.height, 3); + + } + + /** + * Convert the image to RGBA format. + * @returns {CustomImage} `this` to support chaining. + */ + rgba() { + if (this.channels === 4) { + return this; + } + + let newData = new Uint8ClampedArray(this.width * this.height * 4); + + switch (this.channels) { + case 1: // grayscale to rgba + for (let i = 0, offset = 0; i < this.data.length; ++i) { + newData[offset++] = this.data[i]; + newData[offset++] = this.data[i]; + newData[offset++] = this.data[i]; + newData[offset++] = 255; + } + break; + case 3: // rgb to rgba + for (let i = 0, offset = 0; i < this.data.length; i += 3) { + newData[offset++] = this.data[i]; + newData[offset++] = this.data[i + 1]; + newData[offset++] = this.data[i + 2]; + newData[offset++] = 255; + } + break; + default: + throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); + } + + return this._update(newData, this.width, this.height, 4); + } + + /** + * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing. + * @param {number} width The width of the new image. + * @param {number} height The height of the new image. + * @param {Object} options Additional options for resizing. + * @param {0|1|2|3|4|5|string} [options.resample] The resampling method to use. + * @returns {Promise} `this` to support chaining. + */ + async resize(width, height, { + resample = 2, + } = {}) { + + // Ensure resample method is a string + let resampleMethod = RESAMPLING_MAPPING[resample] ?? resample; + + if (BROWSER_ENV) { + // TODO use `resample` in browser environment + + // Store number of channels before resizing + let numChannels = this.channels; + + // Create canvas object for this image + let canvas = this.toCanvas(); + + // Actually perform resizing using the canvas API + const ctx = createCanvasFunction(width, height).getContext('2d'); + + // Draw image to context, resizing in the process + ctx.drawImage(canvas, 0, 0, width, height); + + // Create image from the resized data + let resizedImage = new CustomImage(ctx.getImageData(0, 0, width, height).data, width, height, 4); + + // Convert back so that image has the same number of channels as before + return resizedImage.convert(numChannels); + + } else { + // Create sharp image from raw data, and resize + let img = sharp(this.data, { + raw: { + width: this.width, + height: this.height, + channels: this.channels + } + }); + + switch (resampleMethod) { + case 'box': + case 'hamming': + if (resampleMethod === 'box' || resampleMethod === 'hamming') { + console.warn(`Resampling method ${resampleMethod} is not yet supported. Using bilinear instead.`); + resampleMethod = 'bilinear'; + } + + case 'nearest': + case 'bilinear': + case 'bicubic': + // Perform resizing using affine transform. + // This matches how the python Pillow library does it. + img = img.affine([width / this.width, 0, 0, height / this.height], { + interpolator: resampleMethod + }); + break; + + case 'lanczos': + // https://github.com/python-pillow/Pillow/discussions/5519 + // https://github.com/lovell/sharp/blob/main/docs/api-resize.md + img = img.resize({ + width, height, + fit: 'fill', + kernel: 'lanczos3', // PIL Lanczos uses a kernel size of 3 + }); + break; + + default: + throw new Error(`Resampling method ${resampleMethod} is not supported.`); + } + + return await loadImageFunction(img); + } + + } + + async pad([left, right, top, bottom]) { + left = Math.max(left, 0); + right = Math.max(right, 0); + top = Math.max(top, 0); + bottom = Math.max(bottom, 0); + + if (left === 0 && right === 0 && top === 0 && bottom === 0) { + // No padding needed + return this; + } + + if (BROWSER_ENV) { + // Store number of channels before padding + let numChannels = this.channels; + + // Create canvas object for this image + let canvas = this.toCanvas(); + + let newWidth = this.width + left + right; + let newHeight = this.height + top + bottom; + + // Create a new canvas of the desired size. + const ctx = createCanvasFunction(newWidth, newHeight).getContext('2d'); + + // Draw image to context, padding in the process + ctx.drawImage(canvas, + 0, 0, this.width, this.height, + left, top, newWidth, newHeight + ); + + // Create image from the padded data + let paddedImage = new CustomImage( + ctx.getImageData(0, 0, newWidth, newHeight).data, + newWidth, newHeight, 4); + + // Convert back so that image has the same number of channels as before + return paddedImage.convert(numChannels); + + } else { + let img = sharp(this.data, { + raw: { + width: this.width, + height: this.height, + channels: this.channels + } + }).extend({ left, right, top, bottom }); + return await loadImageFunction(img); + } + } + + async center_crop(crop_width, crop_height) { + // If the image is already the desired size, return it + if (this.width === crop_width && this.height === crop_height) { + return this; + } + + // Determine bounds of the image in the new canvas + let width_offset = (this.width - crop_width) / 2; + let height_offset = (this.height - crop_height) / 2; + + + if (BROWSER_ENV) { + // Store number of channels before resizing + let numChannels = this.channels; + + // Create canvas object for this image + let canvas = this.toCanvas(); + + // Create a new canvas of the desired size. This is needed since if the + // image is too small, we need to pad it with black pixels. + const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d'); + + let sourceX = 0; + let sourceY = 0; + let destX = 0; + let destY = 0; + + if (width_offset >= 0) { + sourceX = width_offset; + } else { + destX = -width_offset; + } + + if (height_offset >= 0) { + sourceY = height_offset; + } else { + destY = -height_offset; + } + + // Draw image to context, cropping in the process + ctx.drawImage(canvas, + sourceX, sourceY, crop_width, crop_height, + destX, destY, crop_width, crop_height + ); + + // Create image from the resized data + let resizedImage = new CustomImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4); + + // Convert back so that image has the same number of channels as before + return resizedImage.convert(numChannels); + + } else { + // Create sharp image from raw data + let img = sharp(this.data, { + raw: { + width: this.width, + height: this.height, + channels: this.channels + } + }); + + if (width_offset >= 0 && height_offset >= 0) { + // Cropped image lies entirely within the original image + img = img.extract({ + left: Math.floor(width_offset), + top: Math.floor(height_offset), + width: crop_width, + height: crop_height, + }) + } else if (width_offset <= 0 && height_offset <= 0) { + // Cropped image lies entirely outside the original image, + // so we add padding + let top = Math.floor(-height_offset); + let left = Math.floor(-width_offset); + img = img.extend({ + top: top, + left: left, + + // Ensures the resulting image has the desired dimensions + right: crop_width - this.width - left, + bottom: crop_height - this.height - top, + }); + } else { + // Cropped image lies partially outside the original image. + // We first pad, then crop. + + let y_padding = [0, 0]; + let y_extract = 0; + if (height_offset < 0) { + y_padding[0] = Math.floor(-height_offset); + y_padding[1] = crop_height - this.height - y_padding[0]; + } else { + y_extract = Math.floor(height_offset); + } + + let x_padding = [0, 0]; + let x_extract = 0; + if (width_offset < 0) { + x_padding[0] = Math.floor(-width_offset); + x_padding[1] = crop_width - this.width - x_padding[0]; + } else { + x_extract = Math.floor(width_offset); + } + + img = img.extend({ + top: y_padding[0], + bottom: y_padding[1], + left: x_padding[0], + right: x_padding[1], + }).extract({ + left: x_extract, + top: y_extract, + width: crop_width, + height: crop_height, + }) + } + + return await loadImageFunction(img); + } + } + + toCanvas() { + // Clone, and convert data to RGBA before drawing to canvas. + // This is because the canvas API only supports RGBA + let cloned = this.clone().rgba(); + + // Create canvas object for the cloned image + let clonedCanvas = createCanvasFunction(cloned.width, cloned.height); + + // Draw image to context + let data = new ImageDataClass(cloned.data, cloned.width, cloned.height); + clonedCanvas.getContext('2d').putImageData(data, 0, 0); + + return clonedCanvas; + } + + /** + * Helper method to update the image data. + * @param {Uint8ClampedArray} data The new image data. + * @param {number} width The new width of the image. + * @param {number} height The new height of the image. + * @param {1|2|3|4} channels The new number of channels of the image. + */ + _update(data, width, height, channels = null) { + this.data = data; + this.width = width; + this.height = height; + if (channels !== null) { + this.channels = channels; + } + return this; + } + + /** + * Clone the image + * @returns {CustomImage} The cloned image + */ + clone() { + return new CustomImage(this.data.slice(), this.width, this.height, this.channels); + } + + /** + * Helper method for converting image to have a certain number of channels + * @param {number} numChannels The number of channels. Must be 1, 3, or 4. + * @returns {CustomImage} `this` to support chaining. + */ + convert(numChannels) { + if (this.channels === numChannels) return this; // Already correct number of channels + + switch (numChannels) { + case 1: + this.grayscale(); + break; + case 3: + this.rgb(); + break; + case 4: + this.rgba(); + break; + default: + throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`); + } + return this; + } + + /** + * Save the image to the given path. This method is only available in environments with access to the FileSystem. + * @param {string|Buffer|URL} path The path to save the image to. + * @param {string} [mime='image/png'] The mime type of the image. + */ + save(path, mime = 'image/png') { + if (!env.useFS) { + throw new Error('Unable to save the image because filesystem is disabled in this environment.') + } + + let canvas = this.toCanvas(); + const buffer = canvas.toBuffer(mime); + fs.writeFileSync(path, buffer); + } +} diff --git a/src/fft.js b/src/utils/maths.js similarity index 57% rename from src/fft.js rename to src/utils/maths.js index 69da997b9..1c32575bd 100644 --- a/src/fft.js +++ b/src/utils/maths.js @@ -1,11 +1,282 @@ +/** + * @file Helper module for mathematical processing. + * + * These functions and classes are only used internally, + * meaning an end-user shouldn't need to access anything here. + * + * @module utils/maths + */ + +/** + * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray + * @typedef {BigInt64Array | BigUint64Array} BigTypedArray + * @typedef {TypedArray | BigTypedArray} AnyTypedArray + */ + +/** + * @param {TypedArray} input + */ +export function interpolate_data(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) { + // TODO use mode and align_corners + + // Output image dimensions + const x_scale = out_width / in_width; + const y_scale = out_height / in_height; + + // Output image + // @ts-ignore + const out_img = new input.constructor(out_height * out_width * in_channels); + + // Pre-calculate strides + const inStride = in_height * in_width; + const outStride = out_height * out_width; + + for (let i = 0; i < out_height; ++i) { + for (let j = 0; j < out_width; ++j) { + // Calculate output offset + const outOffset = i * out_width + j; + + // Calculate input pixel coordinates + const x = (j + 0.5) / x_scale - 0.5; + const y = (i + 0.5) / y_scale - 0.5; + + // Calculate the four nearest input pixels + // We also check if the input pixel coordinates are within the image bounds + let x1 = Math.floor(x); + let y1 = Math.floor(y); + const x2 = Math.min(x1 + 1, in_width - 1); + const y2 = Math.min(y1 + 1, in_height - 1); + + x1 = Math.max(x1, 0); + y1 = Math.max(y1, 0); + + + // Calculate the fractional distances between the input pixel and the four nearest pixels + const s = x - x1; + const t = y - y1; + + // Perform bilinear interpolation + const w1 = (1 - s) * (1 - t); + const w2 = s * (1 - t); + const w3 = (1 - s) * t; + const w4 = s * t; + + // Calculate the four nearest input pixel indices + const yStride = y1 * in_width; + const xStride = y2 * in_width; + const idx1 = yStride + x1; + const idx2 = yStride + x2; + const idx3 = xStride + x1; + const idx4 = xStride + x2; + + for (let k = 0; k < in_channels; ++k) { + // Calculate channel offset + const cOffset = k * inStride; + + out_img[k * outStride + outOffset] = + w1 * input[cOffset + idx1] + + w2 * input[cOffset + idx2] + + w3 * input[cOffset + idx3] + + w4 * input[cOffset + idx4]; + } + } + } + + return out_img; +} + + +/** + * Helper method to transpose a `AnyTypedArray` directly + * @param {T} array + * @template {AnyTypedArray} T + * @param {number[]} dims + * @param {number[]} axes + * @returns {[T, number[]]} The transposed array and the new shape. + */ +export function transpose_data(array, dims, axes) { + // Calculate the new shape of the transposed array + // and the stride of the original array + const shape = new Array(axes.length); + const stride = new Array(axes.length); + + for (let i = axes.length - 1, s = 1; i >= 0; --i) { + stride[i] = s; + shape[i] = dims[axes[i]]; + s *= shape[i]; + } + + // Precompute inverse mapping of stride + const invStride = axes.map((_, i) => stride[axes.indexOf(i)]); + + // Create the transposed array with the new shape + // @ts-ignore + const transposedData = new array.constructor(array.length); + + // Transpose the original array to the new array + for (let i = 0; i < array.length; ++i) { + let newIndex = 0; + for (let j = dims.length - 1, k = i; j >= 0; --j) { + newIndex += (k % dims[j]) * invStride[j]; + k = Math.floor(k / dims[j]); + } + transposedData[newIndex] = array[i]; + } + + return [transposedData, shape]; +} + + +/** + * Compute the softmax of an array of numbers. + * + * @param {number[]} arr The array of numbers to compute the softmax of. + * @returns {number[]} The softmax array. + */ +export function softmax(arr) { + // Compute the maximum value in the array + const maxVal = max(arr)[0]; + + // Compute the exponentials of the array values + const exps = arr.map(x => Math.exp(x - maxVal)); + + // Compute the sum of the exponentials + const sumExps = exps.reduce((acc, val) => acc + val, 0); + + // Compute the softmax values + const softmaxArr = exps.map(x => x / sumExps); + + return softmaxArr; +} + +/** + * Calculates the logarithm of the softmax function for the input array. + * @param {number[]} arr The input array to calculate the log_softmax function for. + * @returns {any} The resulting log_softmax array. + */ +export function log_softmax(arr) { + // Compute the softmax values + const softmaxArr = softmax(arr); + + // Apply log formula to each element + const logSoftmaxArr = softmaxArr.map(x => Math.log(x)); + + return logSoftmaxArr; +} + +/** + * Calculates the dot product of two arrays. + * @param {number[]} arr1 The first array. + * @param {number[]} arr2 The second array. + * @returns {number} The dot product of arr1 and arr2. + */ +export function dot(arr1, arr2) { + return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0); +} + + +/** + * Get the top k items from an iterable, sorted by descending order + * + * @param {Array} items The items to be sorted + * @param {number} [top_k=0] The number of top items to return (default: 0 = return all) + * @returns {Array} The top k items, sorted by descending order + */ +export function getTopItems(items, top_k = 0) { + // if top == 0, return all + + items = Array.from(items) + .map((x, i) => [i, x]) // Get indices ([index, score]) + .sort((a, b) => b[1] - a[1]) // Sort by log probabilities + + if (top_k > 0) { + items = items.slice(0, top_k); // Get top k items + } + + return items +} + +/** + * Computes the cosine similarity between two arrays. + * + * @param {number[]} arr1 The first array. + * @param {number[]} arr2 The second array. + * @returns {number} The cosine similarity between the two arrays. + */ +export function cos_sim(arr1, arr2) { + // Calculate dot product of the two arrays + const dotProduct = dot(arr1, arr2); + + // Calculate the magnitude of the first array + const magnitudeA = magnitude(arr1); + + // Calculate the magnitude of the second array + const magnitudeB = magnitude(arr2); + + // Calculate the cosine similarity + const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB); + + return cosineSimilarity; +} + +/** + * Calculates the magnitude of a given array. + * @param {number[]} arr The array to calculate the magnitude of. + * @returns {number} The magnitude of the array. + */ +export function magnitude(arr) { + return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0)); +} + + +/** + * Returns the value and index of the minimum element in an array. + * @param {number[]} arr array of numbers. + * @returns {number[]} the value and index of the minimum element, of the form: [valueOfMin, indexOfMin] + * @throws {Error} If array is empty. + */ +export function min(arr) { + if (arr.length === 0) throw Error('Array must not be empty'); + let min = arr[0]; + let indexOfMin = 0; + for (let i = 1; i < arr.length; ++i) { + if (arr[i] < min) { + min = arr[i]; + indexOfMin = i; + } + } + return [min, indexOfMin]; +} + + +/** + * Returns the value and index of the maximum element in an array. + * @param {number[]} arr array of numbers. + * @returns {number[]} the value and index of the maximum element, of the form: [valueOfMax, indexOfMax] + * @throws {Error} If array is empty. + */ +export function max(arr) { + if (arr.length === 0) throw Error('Array must not be empty'); + let max = arr[0]; + let indexOfMax = 0; + for (let i = 1; i < arr.length; ++i) { + if (arr[i] > max) { + max = arr[i]; + indexOfMax = i; + } + } + return [max, indexOfMax]; +} + + /** * FFT class provides functionality for performing Fast Fourier Transform on arrays * Code adapted from https://www.npmjs.com/package/fft.js */ -class FFT { +export class FFT { /** - * @param {number} size - The size of the input array. Must be a power of two and bigger than 1. + * @param {number} size The size of the input array. Must be a power of two and bigger than 1. * @throws {Error} FFT size must be a power of two and bigger than 1. */ constructor(size) { @@ -15,7 +286,7 @@ class FFT { this._csize = size << 1; - this.table = new Float64Array(this.size * 2); + this.table = new Float32Array(this.size * 2); for (let i = 0; i < this.table.length; i += 2) { const angle = Math.PI * i / this.size; this.table[i] = Math.cos(angle); @@ -28,7 +299,7 @@ class FFT { ++power; // Calculate initial step's width: - // * If we are full radix-4 - it is 2x smaller to give inital len=8 + // * If we are full radix-4, it is 2x smaller to give inital len=8 // * Otherwise it is the same as `power` to give len=4 this._width = power % 2 === 0 ? power - 1 : power; @@ -46,17 +317,17 @@ class FFT { /** * Create a complex number array with size `2 * size` * - * @returns {Float64Array} - A complex number array with size `2 * size` + * @returns {Float32Array} A complex number array with size `2 * size` */ createComplexArray() { - return new Float64Array(this._csize); + return new Float32Array(this._csize); } /** - * Converts a complex number representation stored in a Float64Array to an array of real numbers. + * Converts a complex number representation stored in a Float32Array to an array of real numbers. * - * @param {Float64Array} complex - The complex number representation to be converted. - * @param {number[]} [storage] - An optional array to store the result in. + * @param {Float32Array} complex The complex number representation to be converted. + * @param {number[]} [storage] An optional array to store the result in. * @returns {number[]} An array of real numbers representing the input complex number representation. */ fromComplexArray(complex, storage) { @@ -68,9 +339,9 @@ class FFT { /** * Convert a real-valued input array to a complex-valued output array. - * @param {Float64Array} input - The real-valued input array. - * @param {Float64Array} [storage] - Optional buffer to store the output array. - * @returns {Float64Array} The complex-valued output array. + * @param {Float32Array} input The real-valued input array. + * @param {Float32Array} [storage] Optional buffer to store the output array. + * @returns {Float32Array} The complex-valued output array. */ toComplexArray(input, storage) { const res = storage || this.createComplexArray(); @@ -83,7 +354,7 @@ class FFT { /** * Completes the spectrum by adding its mirrored negative frequency components. - * @param {Float64Array} spectrum - The input spectrum. + * @param {Float32Array} spectrum The input spectrum. * @returns {void} */ completeSpectrum(spectrum) { @@ -98,8 +369,8 @@ class FFT { /** * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer. * - * @param {Float64Array} out - The output buffer to store the result. - * @param {Float64Array} data - The input data to transform. + * @param {Float32Array} out The output buffer to store the result. + * @param {Float32Array} data The input data to transform. * * @throws {Error} Input and output buffers must be different. * @@ -117,8 +388,8 @@ class FFT { * The input buffer must contain real values only, while the output buffer will contain complex values. The input and * output buffers must be different. * - * @param {Float64Array} out - The output buffer. - * @param {Float64Array} data - The input buffer containing real values. + * @param {Float32Array} out The output buffer. + * @param {Float32Array} data The input buffer containing real values. * * @throws {Error} If the input and output buffers are the same. */ @@ -134,8 +405,8 @@ class FFT { * The `out` array must be a different buffer than the `data` array. The `out` array will contain the * result of the transformation. The `data` array will not be modified. * - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {Float64Array} data - The input data to transform. + * @param {Float32Array} out The output buffer for the transformed data. + * @param {Float32Array} data The input data to transform. * @throws {Error} If `out` and `data` refer to the same buffer. * @returns {void} */ @@ -151,9 +422,9 @@ class FFT { /** * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data. * - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {Float64Array} data - The input buffer of data to be transformed. - * @param {number} inv - A scaling factor to apply to the transform. + * @param {Float32Array} out The output buffer for the transformed data. + * @param {Float32Array} data The input buffer of data to be transformed. + * @param {number} inv A scaling factor to apply to the transform. * @returns {void} */ _transform4(out, data, inv) { @@ -249,11 +520,11 @@ class FFT { /** * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data. * - * @param {Float64Array} data - The input buffer of data to be transformed. - * @param {Float64Array} out - The output buffer for the transformed data. - * @param {number} outOff - The offset at which to write the output data. - * @param {number} off - The offset at which to begin reading the input data. - * @param {number} step - The step size for indexing the input data. + * @param {Float32Array} data The input buffer of data to be transformed. + * @param {Float32Array} out The output buffer for the transformed data. + * @param {number} outOff The offset at which to write the output data. + * @param {number} off The offset at which to begin reading the input data. + * @param {number} step The step size for indexing the input data. * @returns {void} */ _singleTransform2(data, out, outOff, off, step) { @@ -274,12 +545,12 @@ class FFT { /** * Performs radix-4 transformation on input data of length 8 * - * @param {Float64Array} data - Input data array of length 8 - * @param {Float64Array} out - Output data array of length 8 - * @param {number} outOff - Index of output array to start writing from - * @param {number} off - Index of input array to start reading from - * @param {number} step - Step size between elements in input array - * @param {number} inv - Scaling factor for inverse transform + * @param {Float32Array} data Input data array of length 8 + * @param {Float32Array} out Output data array of length 8 + * @param {number} outOff Index of output array to start writing from + * @param {number} off Index of input array to start reading from + * @param {number} step Step size between elements in input array + * @param {number} inv Scaling factor for inverse transform * * @returns {void} */ @@ -322,9 +593,9 @@ class FFT { /** * Real input radix-4 implementation - * @param {Float64Array} out - Output array for the transformed data - * @param {Float64Array} data - Input array of real data to be transformed - * @param {number} inv - The scale factor used to normalize the inverse transform + * @param {Float32Array} out Output array for the transformed data + * @param {Float32Array} data Input array of real data to be transformed + * @param {number} inv The scale factor used to normalize the inverse transform */ _realTransform4(out, data, inv) { // Real input radix-4 implementation @@ -433,11 +704,11 @@ class FFT { /** * Performs a single real input radix-2 transformation on the provided data * - * @param {Float64Array} data - The input data array - * @param {Float64Array} out - The output data array - * @param {number} outOff - The output offset - * @param {number} off - The input offset - * @param {number} step - The step + * @param {Float32Array} data The input data array + * @param {Float32Array} out The output data array + * @param {number} outOff The output offset + * @param {number} off The input offset + * @param {number} step The step * * @returns {void} */ @@ -458,12 +729,12 @@ class FFT { * Computes a single real-valued transform using radix-4 algorithm. * This method is only called for len=8. * - * @param {Float64Array} data - The input data array. - * @param {Float64Array} out - The output data array. - * @param {number} outOff - The offset into the output array. - * @param {number} off - The offset into the input array. - * @param {number} step - The step size for the input array. - * @param {number} inv - The value of inverse. + * @param {Float32Array} data The input data array. + * @param {Float32Array} out The output data array. + * @param {number} outOff The offset into the output array. + * @param {number} off The offset into the input array. + * @param {number} step The step size for the input array. + * @param {number} inv The value of inverse. */ _singleRealTransform4(data, out, outOff, off, step, inv) { // radix-4 @@ -495,4 +766,3 @@ class FFT { } } -module.exports = FFT diff --git a/src/utils/tensor.js b/src/utils/tensor.js new file mode 100644 index 000000000..35e3d03b4 --- /dev/null +++ b/src/utils/tensor.js @@ -0,0 +1,386 @@ +/** + * @file Helper module for `Tensor` processing. + * + * These functions and classes are only used internally, + * meaning an end-user shouldn't need to access anything here. + * + * @module utils/tensor + */ + +import { ONNX } from '../backends/onnx.js'; + +import { + interpolate_data, + transpose_data +} from './maths.js'; + + +/** + * @typedef {import('./maths.js').AnyTypedArray} AnyTypedArray + */ + +const ONNXTensor = ONNX.Tensor; + +export class Tensor extends ONNXTensor { + /** + * Create a new Tensor or copy an existing Tensor. + * @param {[string, Array|AnyTypedArray, number[]]|[ONNXTensor]} args + */ + constructor(...args) { + if (args[0] instanceof ONNX.Tensor) { + // Create shallow copy + super(args[0].type, args[0].data, args[0].dims); + + } else { + // Create new + super(...args); + } + + return new Proxy(this, { + get: (obj, key) => { + if (typeof key === 'string') { + let index = Number(key); + if (Number.isInteger(index)) { + // key is an integer (i.e., index) + return obj._getitem(index); + } + } + // @ts-ignore + return obj[key]; + }, + set: (obj, key, value) => { + // TODO allow setting of data + + // @ts-ignore + return obj[key] = value; + } + }); + } + + /** + * Returns an iterator object for iterating over the tensor data in row-major order. + * If the tensor has more than one dimension, the iterator will yield subarrays. + * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order. + */ + *[Symbol.iterator]() { + const [iterLength, ...iterDims] = this.dims; + + if (iterDims.length > 0) { + const iterSize = iterDims.reduce((a, b) => a * b); + for (let i = 0; i < iterLength; ++i) { + yield this._subarray(i, iterSize, iterDims); + } + } else { + yield* this.data + } + + } + + /** + * Index into a Tensor object. + * @param {number} index The index to access. + * @returns {Tensor} The data at the specified index. + */ + _getitem(index) { + const [iterLength, ...iterDims] = this.dims; + + if (index >= iterLength || index < -iterLength) { + throw new Error(`Index ${index} is out of bounds for dimension 0 with size ${iterLength}`); + } + if (index < 0) { + // Negative indexing + index += iterLength; + } + + if (iterDims.length > 0) { + const iterSize = iterDims.reduce((a, b) => a * b); + return this._subarray(index, iterSize, iterDims); + } else { + return new Tensor(this.type, [this.data[index]], iterDims); + } + } + + /** + * @param {number|bigint} item The item to search for in the tensor + * @returns {number} The index of the first occurrence of item in the tensor data. + */ + indexOf(item) { + for (let index = 0; index < this.data.length; ++index) { + // Note: == instead of === so we can match Ints with BigInts + if (this.data[index] == item) { + return index; + } + } + return -1; + } + + /** + * @param {number} index + * @param {number} iterSize + * @param {any} iterDims + * @returns {Tensor} + */ + _subarray(index, iterSize, iterDims) { + let data = this.data.subarray(index * iterSize, (index + 1) * iterSize); + return new Tensor(this.type, data, iterDims); + } + + /** + * Returns the value of this tensor as a standard JavaScript Number. This only works + * for tensors with one element. For other cases, see `Tensor.tolist()`. + * @returns {number} The value of this tensor as a standard JavaScript Number. + * @throws {Error} If the tensor has more than one element. + */ + item() { + if (this.data.length !== 1) { + throw new Error(`a Tensor with ${this.data.length} elements cannot be converted to Scalar`); + } + return this.data[0]; + } + + /** + * Convert tensor data to a n-dimensional JS list + * @returns {Array} + */ + tolist() { + return reshape(this.data, this.dims) + } + + /** + * Return a new Tensor the sigmoid function applied to each element. + * @returns {Tensor} The tensor with the sigmoid function applied. + */ + sigmoid() { + return this.clone().sigmoid_(); + } + + /** + * Applies the sigmoid function to the tensor in place. + * @returns {Tensor} Returns `this`. + */ + sigmoid_() { + for (let i = 0; i < this.data.length; ++i) { + this.data[i] = 1 / (1 + Math.exp(-this.data[i])); + } + return this; + } + + clone() { + return new Tensor(this.type, this.data.slice(), this.dims.slice()); + } + + slice(...slices) { + // This allows for slicing with ranges and numbers + let newTensorDims = []; + let newOffsets = []; + + // slices is an array of numbers or arrays of numbers + // e.g., slices = [0, [1, 3], null, [0, 3]] + for (let sliceIndex = 0; sliceIndex < this.dims.length; ++sliceIndex) { + let slice = slices[sliceIndex]; + + if (slice === null || slice === undefined) { + // null or undefined means take the whole dimension + newOffsets.push([0, this.dims[sliceIndex]]); + newTensorDims.push(this.dims[sliceIndex]); + + } else if (typeof slice === 'number') { + if (slice < -this.dims[sliceIndex] || slice >= this.dims[sliceIndex]) { + throw new Error(`IndexError: index ${slice} is out of bounds for dimension ${sliceIndex} with size ${this.dims[sliceIndex]}`); + } + if (slice < 0) { + slice += this.dims[sliceIndex]; + } + + // A number means take a single element + newOffsets.push([slice, slice + 1]); + + } else if (Array.isArray(slice) && slice.length === 2) { + // An array of length 2 means take a range of elements + + if (slice[0] > slice[1]) { + throw new Error(`Invalid slice: ${slice}`); + } + + let offsets = [ + Math.max(slice[0], 0), + Math.min(slice[1], this.dims[sliceIndex]) + ]; + + newOffsets.push(offsets); + newTensorDims.push(offsets[1] - offsets[0]); + + } else { + throw new Error(`Invalid slice: ${slice}`); + } + } + + let newDims = newOffsets.map(([start, end]) => end - start); + let newBufferSize = newDims.reduce((a, b) => a * b); + + // Allocate memory + let data = new this.data.constructor(newBufferSize); + + // Precompute strides + const stride = new Array(this.dims.length); + for (let i = newDims.length - 1, s2 = 1; i >= 0; --i) { + stride[i] = s2; + s2 *= this.dims[i]; + } + + for (let i = 0; i < newBufferSize; ++i) { + let originalIndex = 0; + for (let j = newDims.length - 1, num = i; j >= 0; --j) { + const size = newDims[j]; + originalIndex += ((num % size) + newOffsets[j][0]) * stride[j]; + num = Math.floor(num / size); + } + data[i] = this.data[originalIndex]; + } + return new Tensor(this.type, data, newTensorDims); + + } + + /** + * Return a transposed version of this Tensor, according to the provided dimensions. + * @param {...number} dims Dimensions to transpose. + * @returns {Tensor} The transposed tensor. + */ + transpose(...dims) { + return transpose(this, dims); + } + + // TODO add .max() and .min() methods +} + +/** + * This creates a nested array of a given type and depth (see examples). + * + * @example + * NestArray; // string[] + * @example + * NestArray; // number[][] + * @example + * NestArray; // string[][][] etc. + * @template T + * @template {number} Depth + * @template {never[]} [Acc=[]] + * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray + */ + +/** + * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions. + * + * @example + * reshape([10 ], [1 ]); // Type: number[] Value: [10] + * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]] + * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] + * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]] + * @param {T[]} data The input array to reshape. + * @param {DIM} dimensions The target shape/dimensions. + * @template T + * @template {[number]|[number, number]|[number, number, number]|[number, number, number, number]} DIM + * @returns {NestArray} The reshaped array. + */ +function reshape(data, dimensions) { + + const totalElements = data.length; + const dimensionSize = dimensions.reduce((a, b) => a * b); + + if (totalElements !== dimensionSize) { + throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`); + } + + /** @type {any} */ + let reshapedArray = data; + + for (let i = dimensions.length - 1; i >= 0; i--) { + reshapedArray = reshapedArray.reduce((acc, val) => { + let lastArray = acc[acc.length - 1]; + + if (lastArray.length < dimensions[i]) { + lastArray.push(val); + } else { + acc.push([val]); + } + + return acc; + }, [[]]); + } + + return reshapedArray[0]; +} + +/** + * Transposes a tensor according to the provided axes. + * @param {any} tensor The input tensor to transpose. + * @param {Array} axes The axes to transpose the tensor along. + * @returns {Tensor} The transposed tensor. + */ +export function transpose(tensor, axes) { + const [transposedData, shape] = transpose_data(tensor.data, tensor.dims, axes); + return new Tensor(tensor.type, transposedData, shape); +} + + +/** + * Concatenates an array of tensors along the 0th dimension. + * + * @param {any} tensors The array of tensors to concatenate. + * @returns {Tensor} The concatenated tensor. + */ +export function cat(tensors) { + if (tensors.length === 0) { + return tensors[0]; + } + // NOTE: tensors must be batched + // NOTE: currently only supports dim=0 + // TODO: add support for dim != 0 + + + let tensorType = tensors[0].type; + let tensorShape = [...tensors[0].dims]; + tensorShape[0] = tensors.length; + + // Calculate total size to allocate + let total = 0; + for (let t of tensors) { + total += t.data.length; + } + + // Create output tensor of same type as first + let data = new tensors[0].data.constructor(total); + + let offset = 0; + for (let t of tensors) { + data.set(t.data, offset); + offset += t.data.length; + } + + return new Tensor(tensorType, data, tensorShape) +} + +/** + * Interpolates an Tensor to the given size. + * @param {Tensor} input The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w]) + * @param {number[]} size The output size of the image + * @param {string} mode The interpolation mode + * @param {boolean} align_corners Whether to align corners. + * @returns {Tensor} The interpolated tensor. + */ +export function interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) { + + // Input image dimensions + const in_channels = input.dims.at(-3) ?? 1; + const in_height = input.dims.at(-2); + const in_width = input.dims.at(-1); + + let output = interpolate_data( + input.data, + [in_channels, in_height, in_width], + [out_height, out_width], + mode, + align_corners + ); + return new Tensor(input.type, output, [in_channels, out_height, out_width]); +} diff --git a/tests/data/.gitignore b/tests/data/.gitignore new file mode 100644 index 000000000..5b8e8d398 --- /dev/null +++ b/tests/data/.gitignore @@ -0,0 +1,3 @@ +# Folder to store generated test data +# Do not commit these files to the repository +*.json diff --git a/tests/generate_tests.py b/tests/generate_tests.py new file mode 100644 index 000000000..975e48006 --- /dev/null +++ b/tests/generate_tests.py @@ -0,0 +1,158 @@ +# Helper file to dynamically generate unit tests +# This is done by running the python Transformers library and comparing its outputs with ours. + +import json +import os + +from transformers import AutoTokenizer + +MODELS_TO_TEST = { + "albert": [ + "albert-base-v2", + # "sentence-transformers/paraphrase-albert-small-v2", + ], + "bart": [ + "sshleifer/distilbart-cnn-6-6", + "facebook/bart-large-cnn", + ], + "bert": [ + "bert-base-uncased", + "bert-base-cased", + "bert-base-multilingual-uncased", + "bert-base-multilingual-cased", + "sentence-transformers/all-MiniLM-L6-v2", + "ckiplab/bert-base-chinese-ner", + ], + "clip": [ + "openai/clip-vit-base-patch16", + ], + "codegen": [ + "Salesforce/codegen-350M-mono", + "Salesforce/codegen-350M-multi", + "Salesforce/codegen-350M-nl", + ], + "distilbert": [ + "distilbert-base-uncased", + "distilbert-base-cased", + "Davlan/distilbert-base-multilingual-cased-ner-hrl", + ], + "gpt-neo": [ + "EleutherAI/gpt-neo-125M", + ], + "gpt2": [ + "gpt2", + "distilgpt2", + ], + "llama": [ + "hf-internal-testing/llama-tokenizer", + ], + "m2m_100": [ + "facebook/nllb-200-distilled-600M", + ], + # TODO add back + # "mobilebert": [ + # "google/mobilebert-uncased", + # ], + "mt5": [ + "google/mt5-small", + ], + "roberta": [ + "roberta-base", + "distilroberta-base", + "roberta-large-mnli", + + "sentence-transformers/all-distilroberta-v1", + ], + "squeezebert": [ + "squeezebert/squeezebert-uncased", + "squeezebert/squeezebert-mnli", + ], + "t5": [ + "t5-small", + "t5-base", + "google/t5-v1_1-small", + "google/t5-v1_1-base", + "google/flan-t5-small", + "google/flan-t5-base", + ], + "vision-encoder-decoder": [ + "nlpconnect/vit-gpt2-image-captioning", + ], + "whisper": [ + "openai/whisper-tiny", + "openai/whisper-tiny.en", + ], +} + +TOKENIZER_TEST_DATA = { + "shared": [ + "hello world", + "Hello World", + "How are you doing?", + "You should've done this", + "A\n'll !!to?'d''d of, can't.", + "def main():\n\tpass", + "This\n\nis\na\ntest.", + "let a = obj.toString();\ntoString();", + 'Hi Hello', + "trailing space ", + " leading space", + "生活的真谛是", + ], + "custom": {}, +} + + +def generate_tokenizer_tests(): + + results = {} + + for model_type, tokenizer_names in MODELS_TO_TEST.items(): + + for tokenizer_name in tokenizer_names: + # Load tokenizer + tokenizer = AutoTokenizer.from_pretrained(tokenizer_name) + + tokenizer_results = [] + + shared_texts = TOKENIZER_TEST_DATA["shared"] + custom_texts = TOKENIZER_TEST_DATA["custom"].get( + tokenizer_name, []) + + # Run tokenizer on test cases + for text in shared_texts + custom_texts: + # TODO: add with_pair option + + encoded = tokenizer(text).data + decoded_with_special = tokenizer.decode( + encoded["input_ids"], skip_special_tokens=False) + decoded_without_special = tokenizer.decode( + encoded["input_ids"], skip_special_tokens=True) + + tokenizer_results.append(dict( + input=text, + encoded=encoded, + decoded_with_special=decoded_with_special, + decoded_without_special=decoded_without_special, + )) + + results[tokenizer_name] = tokenizer_results + + return results + + +def main(): + # TODO add option to cache generated data + force build tests + + data_dir = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "data", + ) + + tokenizer_tests = generate_tokenizer_tests() + + with open(os.path.join(data_dir, "tokenizer_tests.json"), "w", encoding="utf-8") as fp: + json.dump(tokenizer_tests, fp) + + +if __name__ == "__main__": + main() diff --git a/tests/hub.test.js b/tests/hub.test.js new file mode 100644 index 000000000..76c0ad143 --- /dev/null +++ b/tests/hub.test.js @@ -0,0 +1,35 @@ + + +import { AutoModel, PreTrainedModel } from '../src/transformers.js'; +import { MAX_TEST_EXECUTION_TIME } from './init.js'; + +// TODO: Set cache folder to a temp directory + +describe('Hub', () => { + + describe('Loading models', () => { + + it('should load a model from the local cache', async () => { + // 1. Local model exists (doesn't matter about status of remote file since local is tried first) + let model = await AutoModel.from_pretrained('t5-small'); + expect(model).toBeInstanceOf(PreTrainedModel); + }, MAX_TEST_EXECUTION_TIME); + + it('should load a model from the remote cache', async () => { + // 2. Local model doesn't exist, remote file exists + // This tests that fallback functionality is working + let model = await AutoModel.from_pretrained('Xenova/t5-small'); + expect(model).toBeInstanceOf(PreTrainedModel); + }, MAX_TEST_EXECUTION_TIME); + + it('should fail to load a model', async () => { + // 3. Local model doesn't exist, remote file doesn't exist + // This tests that error handling is working. + await expect( + AutoModel.from_pretrained('Xenova/this-model-does-not-exist') + ).rejects + .toBeInstanceOf(Error); + }, MAX_TEST_EXECUTION_TIME); + }); + +}); diff --git a/tests/index.js b/tests/index.js deleted file mode 100644 index fed1c872c..000000000 --- a/tests/index.js +++ /dev/null @@ -1,936 +0,0 @@ - -const path = require('path'); -const { pipeline, env } = require('..'); - -// Only use local models -env.remoteModels = false; -// env.remoteModels = true; // Uncomment to test online - -function isDeepEqual(obj1, obj2, { - tol = 1e-3 -} = {}) { - // Get the keys of both objects - const obj1Keys = Object.keys(obj1); - const obj2Keys = Object.keys(obj2); - - // If the objects have different number of keys, they're not equal - if (obj1Keys.length !== obj2Keys.length) { - return false; - } - - // Compare each key-value pair recursively - for (const key of obj1Keys) { - const val1 = obj1[key]; - const val2 = obj2[key]; - - // If the values are objects, compare them recursively - if (typeof val1 === 'object' && typeof val2 === 'object') { - if (!isDeepEqual(val1, val2)) { - return false; - } - } else if (typeof val1 !== typeof val2) { - // Types are not the same - return false; - } else if (typeof val1 === 'number') { - return Math.abs(val1 - val2) <= tol; - } else if (val1 !== val2) { - // If the values are not objects, compare them directly - return false; - } - } - - // If all key-value pairs are equal, the objects are deep equal - return true; -} - -async function embeddings() { - - // Load embeddings pipeline (uses by default) - let embedder = await pipeline('embeddings', 'sentence-transformers/all-MiniLM-L6-v2') - - - // Provide sentences - let sentences = [ - 'This framework generates embeddings for each input sentence', - 'Sentences are passed as a list of string.', - 'The quick brown fox jumps over the lazy dog.' - ] - - let start = performance.now(); - - // Run sentences through embedder - let output = await embedder(sentences) - - - let duration = performance.now() - start; - - // Convert Tensor to JS list - output = output.tolist(); - - // Compute pairwise cosine similarity - // for (let i = 0; i < sentences.length; ++i) { - // for (let j = i + 1; j < sentences.length; ++j) { - // console.log(`(${i},${j}):`, embedder.cos_sim(output[i], output[j])) - // } - // } - - let pairwiseScores = [[output[0], output[1]], [output[0], output[2]], [output[1], output[2]]].map(x => embedder.cos_sim(...x)) - - - // Dispose pipeline - await embedder.dispose() - - return [isDeepEqual( - pairwiseScores, - [0.502872309810269, 0.11088411026413121, 0.09602621986931259] - ), duration]; -} - - -async function text_classification() { - let classifier = await pipeline('text-classification', 'distilbert-base-uncased-finetuned-sst-2-english'); - - let texts = [ - "This was a masterpiece. Not completely faithful to the books, but enthralling from beginning to end. Might be my favorite of the three.", - "I hated the movie" - ]; - - let start = performance.now(); - - let outputs1 = await classifier("I hated the movie"); - let outputs2 = await classifier("I hated the movie", { - topk: 2 - }); - let outputs3 = await classifier(texts); - let outputs4 = await classifier(texts, { - topk: 2 - }); - - let duration = performance.now() - start; - - // Dispose pipeline - await classifier.dispose() - - return [isDeepEqual( - outputs1, - [ - { "label": "NEGATIVE", "score": 0.9997429847717285 } - ] - ) && isDeepEqual( - outputs2, - [ - { "label": "NEGATIVE", "score": 0.9997429847717285 }, - { "label": "POSITIVE", "score": 0.0002570444776210934 } - ] - ) && isDeepEqual( - outputs3, - [ - { "label": "POSITIVE", "score": 0.9994572997093201 }, - { "label": "NEGATIVE", "score": 0.9997275471687317 } - ] - ) && isDeepEqual( - outputs4, - [[ - { "label": "POSITIVE", "score": 0.9994572997093201 }, - { "label": "NEGATIVE", "score": 0.0005426819552667439 } - ], [ - { "label": "NEGATIVE", "score": 0.9997275471687317 }, - { "label": "POSITIVE", "score": 0.00027245949604548514 } - ]] - ), duration]; -} - - -async function token_classification() { - let classifier = await pipeline('token-classification', 'Davlan/bert-base-multilingual-cased-ner-hrl'); - - let texts = [ - "The Golden State Warriors are an American professional basketball team based in San Francisco.", - "My name is Sarah and I live in London." - ]; - - let start = performance.now(); - - let outputs1 = await classifier(texts[0]); - let outputs2 = await classifier(texts); - - let duration = performance.now() - start; - - // Dispose pipeline - await classifier.dispose() - - return [isDeepEqual( - outputs1, - [ - { entity: "B-ORG", score: 0.9998535513877869, index: 2, word: "Golden", start: null, end: null }, - { entity: "I-ORG", score: 0.9998612999916077, index: 3, word: "State", start: null, end: null }, - { entity: "I-ORG", score: 0.999866247177124, index: 4, word: "Warriors", start: null, end: null }, - { entity: "B-LOC", score: 0.9997050166130066, index: 13, word: "San", start: null, end: null }, - { entity: "I-LOC", score: 0.9987282156944275, index: 14, word: "Francisco", start: null, end: null } - ] - ) && isDeepEqual( - outputs2, - [ - [ - { entity: "B-ORG", score: 0.9998375773429871, index: 2, word: "Golden", start: null, end: null }, - { entity: "I-ORG", score: 0.9998642206192017, index: 3, word: "State", start: null, end: null }, - { entity: "I-ORG", score: 0.9998642802238464, index: 4, word: "Warriors", start: null, end: null }, - { entity: "B-LOC", score: 0.9996914863586426, index: 13, word: "San", start: null, end: null }, - { entity: "I-LOC", score: 0.9989780783653259, index: 14, word: "Francisco", start: null, end: null } - ], [ - { entity: "B-PER", score: 0.997977614402771, index: 4, word: "Sarah", start: null, end: null }, - { entity: "B-LOC", score: 0.9996902346611023, index: 9, word: "London", start: null, end: null } - ] - ] - ), duration]; -} - - -async function zero_shot_classification() { - let classifier = await pipeline('zero-shot-classification', 'facebook/bart-large-mnli'); - - - let sequences_to_classify = ['one day I will see the world', 'I love making pizza']; - let candidate_labels = ['travel', 'cooking', 'dancing']; - - let start = performance.now(); - - let outputs1 = await classifier(sequences_to_classify[0], candidate_labels); - let outputs2 = await classifier(sequences_to_classify, candidate_labels); - let outputs3 = await classifier(sequences_to_classify, candidate_labels, { - multi_label: true - }) - - let duration = performance.now() - start; - - // Dispose pipeline - await classifier.dispose() - - return [isDeepEqual( - outputs1, - { - sequence: "one day I will see the world", - labels: ["travel", "dancing", "cooking"], - scores: [0.4261703487477968, 0.2903585771517135, 0.28347107410048983] - } - ) && isDeepEqual( - outputs2, - [{ - sequence: "one day I will see the world", - labels: ["travel", "dancing", "cooking"], - scores: [0.4261703487477968, 0.2903585771517135, 0.28347107410048983] - }, { - sequence: "I love making pizza", - labels: ["cooking", "travel", "dancing"], - scores: [0.4660367922118968, 0.2756005926506238, 0.2583626151374795] - }] - ) && isDeepEqual( - outputs3, - [{ - sequence: "one day I will see the world", - labels: ["travel", "dancing", "cooking"], - scores: [0.7108286792234982, 0.5763787804099745, 0.44303326070949994] - }, { - sequence: "I love making pizza", - labels: ["cooking", "travel", "dancing"], - scores: [0.8527619536354446, 0.7899589317978243, 0.5838912691496106] - }] - ), duration]; - -} - -async function masked_language_modelling() { - - let unmasker = await pipeline('fill-mask', 'bert-base-uncased'); - - let start = performance.now(); - - let outputs1 = await unmasker("Once upon a [MASK]."); - let outputs2 = await unmasker([ - "Once upon a [MASK].", - "[MASK] is the capital of England." - ]); - - let duration = performance.now() - start; - - // Dispose pipeline - await unmasker.dispose() - - return [isDeepEqual( - outputs1, - [ - { - "score": 0.9318257570266724, - "token": 2051, - "token_str": "time", - "sequence": "once upon a time." - }, - { - "score": 0.009929785504937172, - "token": 13342, - "token_str": "mattress", - "sequence": "once upon a mattress." - }, - { - "score": 0.0021786263678222895, - "token": 3959, - "token_str": "dream", - "sequence": "once upon a dream." - }, - { - "score": 0.001881834352388978, - "token": 2940, - "token_str": "hill", - "sequence": "once upon a hill." - }, - { - "score": 0.0017424898687750101, - "token": 2154, - "token_str": "day", - "sequence": "once upon a day." - } - ] - ) && isDeepEqual( - outputs2, - [[ - { - "score": 0.9828392863273621, - "token": 2051, - "token_str": "time", - "sequence": "once upon a time." - }, - { - "score": 0.0027356224600225687, - "token": 13342, - "token_str": "mattress", - "sequence": "once upon a mattress." - }, - { - "score": 0.00038447941187769175, - "token": 2504, - "token_str": "level", - "sequence": "once upon a level." - }, - { - "score": 0.0003801222483161837, - "token": 2940, - "token_str": "hill", - "sequence": "once upon a hill." - }, - { - "score": 0.0003801104612648487, - "token": 6480, - "token_str": "lifetime", - "sequence": "once upon a lifetime." - } - ], [ - { - "score": 0.3269098699092865, - "token": 2414, - "token_str": "london", - "sequence": "london is the capital of england." - }, - { - "score": 0.06448942422866821, - "token": 2009, - "token_str": "it", - "sequence": "it is the capital of england." - }, - { - "score": 0.03533688560128212, - "token": 7067, - "token_str": "bristol", - "sequence": "bristol is the capital of england." - }, - { - "score": 0.025355694815516472, - "token": 5087, - "token_str": "manchester", - "sequence": "manchester is the capital of england." - }, - { - "score": 0.023570900782942772, - "token": 6484, - "token_str": "birmingham", - "sequence": "birmingham is the capital of england." - } - ]] - ), duration]; -} - -async function question_answering() { - - let question = 'Who was Jim Henson?' - let context = 'Jim Henson was a nice puppet.' - - let answerer = await pipeline('question-answering', 'distilbert-base-uncased-distilled-squad'); - - let start = performance.now(); - - let outputs = await answerer(question, context); - let outputs2 = await answerer(question, context, { - topk: 3, - }); - - let duration = performance.now() - start; - - // Dispose pipeline - await answerer.dispose() - - return [isDeepEqual( - outputs, - { answer: 'a nice puppet', score: 0.5664517526948352 } - ) && isDeepEqual( - outputs2, - [ - { answer: 'a nice puppet', score: 0.5664517526948352 }, - { answer: 'nice puppet', score: 0.1698902336448853 }, - { answer: 'puppet', score: 0.14046057793125577 } - ] - ), duration]; -} - -async function summarization() { - - let summarizer = await pipeline('summarization', 'sshleifer/distilbart-cnn-6-6') - - let texts = [ - `The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.`, - `The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species.` - ] - - let start1 = performance.now(); - - let summary = await summarizer(texts, { - top_k: 0, - do_sample: false, - }); - - let duration1 = performance.now() - start1; - - // Dispose pipeline - await summarizer.dispose() - - - // This case also tests `forced_bos_token_id` - let summarizer2 = await pipeline('summarization', 'facebook/bart-large-cnn'); - - - let start2 = performance.now(); - - let summary2 = await summarizer2(texts[0], { - top_k: 0, - do_sample: false, - }); - - let duration2 = performance.now() - start2; - - // Dispose pipeline - await summarizer2.dispose() - - return [isDeepEqual( - summary, - [{ - "summary_text": " The Eiffel Tower is 324 metres tall, and the tallest structure in Paris. It is the second tallest free-standing structure in France after the Millau Viaduct." - }, - { - "summary_text": " The Amazon is a moist broadleaf forest that covers most of the Amazon basin of South America. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%. The Amazon represents over half the planet's remaining rainfore" - }] - ) && isDeepEqual( - summary2, - [ - { summary_text: "During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world. The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building." } - ] - ), duration1 + duration2]; -} - -async function translation() { - - let translator = await pipeline('translation_en_to_de', 't5-small') - - let texts = [ - 'Hello, how are you?', - 'My name is Maria.', - ] - - let start = performance.now(); - - let translation1 = await translator('Hello, how are you?', { - top_k: 0, - do_sample: false - }) - let translation2 = await translator(texts, { - top_k: 0, - do_sample: false - }) - - let duration = performance.now() - start; - - // Dispose pipeline - await translator.dispose() - - return [isDeepEqual( - translation1, - [{ "translation_text": "Hallo, wie sind Sie?" }] - - ) && isDeepEqual( - translation2, - [ - { 'translation_text': 'Hallo, wie sind Sie?' }, - { 'translation_text': 'Mein Name ist Maria.' } - ] - ), duration]; -} - -async function text_generation() { - - let generator = await pipeline('text-generation', 'distilgpt2') - - let start = performance.now(); - - let output1 = await generator('Once upon a time, there was a', { - max_new_tokens: 10, - top_k: 0, - do_sample: false - }) - - let output2 = await generator('Once upon a time, there was a', { - max_new_tokens: 10, - num_beams: 2, - num_return_sequences: 2, - top_k: 0, - do_sample: false - }) - - let output3 = await generator([ - 'Once upon a time, there was a', - 'I enjoy walking with my cute dog', - ], { - max_new_tokens: 10, - num_beams: 2, - num_return_sequences: 2, - top_k: 0, - do_sample: false - }) - - let duration = performance.now() - start; - - // Dispose pipeline - await generator.dispose() - - return [isDeepEqual( - output1, - [ - { "generated_text": "Once upon a time, there was a time when the world was not the same.\n" } - ] - ) && isDeepEqual( - output2, - [ - { "generated_text": "Once upon a time, there was a lot of discussion about the need for a new," }, - { "generated_text": "Once upon a time, there was a lot of discussion about the need for a new and" } - ] - ) && isDeepEqual( - output3, - [[ - { "generated_text": "Once upon a time, there was a lot of discussion about the need for a new," }, - { "generated_text": "Once upon a time, there was a lot of discussion about the need for a new and" } - ], [ - { "generated_text": "I enjoy walking with my cute dog and I love to play with him. I love" }, - { "generated_text": "I enjoy walking with my cute dog and I love to play with her. I love" } - ]] - ), duration]; -} - - -async function text2text_generation() { - let generator1 = await pipeline('text2text-generation', 'google/flan-t5-small'); - - let start1 = performance.now(); - - let output1 = await generator1( - "Premise: At my age you will probably have learnt one lesson. " + - "Hypothesis: It's not certain how many lessons you'll learn by your thirties. " + - "Does the premise entail the hypothesis?", - { - top_k: 0, - do_sample: false - } - ) - - let duration1 = performance.now() - start1; - - - let generator2 = await pipeline('text2text-generation', 'google/flan-t5-base'); - - let start2 = performance.now(); - let output2 = await generator2(` - Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can - has 3 tennis balls. How many tennis balls does he have now? - A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. - 5 + 6 = 11. The answer is 11. - - Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half - of the golf balls are blue. How many blue golf balls are there? - `, { - top_k: 0, - do_sample: false - }); - - let duration2 = performance.now() - start2; - - // Dispose pipelines - await Promise.all([generator1.dispose(), generator2.dispose()]) - - return [isDeepEqual( - output1, - ['it is not possible to tell'] - ) && isDeepEqual( - output2, - ['There are 16 / 2 = 8 golf balls. There are 8 / 2 = 4 blue golf balls. The answer is 4.'] - ), duration1 + duration2]; -} - -async function code_generation() { - // Specifically test that `added_tokens` are added correctly - - let generator = await pipeline('text-generation', 'Salesforce/codegen-350M-mono') - - let start = performance.now(); - - let output1 = await generator('def fib(n):', { - max_new_tokens: 45, - top_k: 0, - do_sample: false - }); - - let duration = performance.now() - start; - - // Dispose pipeline - await generator.dispose() - - return [isDeepEqual( - output1, - [ - { "generated_text": "def fib(n):\n if n == 0:\n return 0\n elif n == 1:\n return 1\n else:\n return fib(n-1) + fib(n-2)\n\n" } - ] - ), duration]; -} - - -async function speech2text_generation() { - // TODO add test case - // let audio = './tests/assets/jfk.wav'; - // let transcriber = await pipeline('automatic-speech-recognition') - // let output = await transcriber(audio); - // console.log(output); - - return [true, 0]; -} - - -async function image_to_text() { - let captioner = await pipeline('image-to-text', 'nlpconnect/vit-gpt2-image-captioning') - - - let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg'; - let urls = [ - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg', - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg' - ] - - let start = performance.now(); - - let output1 = await captioner(url, { - top_k: 0, - do_sample: false - }) - - let output2 = await captioner(url, { - max_new_tokens: 20, - num_beams: 2, - num_return_sequences: 2, - top_k: 0, - do_sample: false - }) - - let output3 = await captioner(urls, { - top_k: 0, - do_sample: false - }) - - let output4 = await captioner(urls, { - max_new_tokens: 20, - num_beams: 2, - num_return_sequences: 2, - top_k: 0, - do_sample: false - }) - - let duration = performance.now() - start; - - // Dispose pipeline - await captioner.dispose() - - return [isDeepEqual( - output1, - [{ - "generated_text": "a herd of giraffes and zebras are grazing in a field" - }] - ) && isDeepEqual( - output2, - [{ - "generated_text": "a herd of giraffes and zebras grazing in a field" - }, { - "generated_text": "a herd of giraffes and zebras are grazing in a field" - }] - ) && isDeepEqual( - output3, - [ - [{ "generated_text": "a soccer player kicking a soccer ball during a game" }], - [{ "generated_text": "a plane is parked at an airport with a lot of people" }] - ] - ) && isDeepEqual( - output4, - [[ - { "generated_text": "a soccer player kicking a soccer ball during a game" }, - { "generated_text": "a soccer player kicking a soccer ball during a match" } - ], [ - { "generated_text": "airplanes parked at an airport" }, - { "generated_text": "airplanes are parked at an airport" } - ]] - ), duration]; - -} - - -async function image_classification() { - let classifier = await pipeline('image-classification', 'google/vit-base-patch16-224'); - - - let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg'; - let urls = [ - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg', - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg' - ] - - let start = performance.now(); - let output1 = await classifier(url) - let output2 = await classifier(url, { - topk: 2 - }); - let output3 = await classifier(urls) - let output4 = await classifier(urls, { - topk: 2 - }); - let duration = performance.now() - start; - - // Dispose pipeline - await classifier.dispose() - - return [isDeepEqual( - output1, - [{ "label": "tiger, Panthera tigris", "score": 0.7911674380302429 }] - ) && isDeepEqual( - output2, - [{ "label": "tiger, Panthera tigris", "score": 0.7911674380302429 }, { "label": "tiger cat", "score": 0.20425112545490265 }] - ) && isDeepEqual( - output3, - [{ "label": "palace", "score": 0.9975974559783936 }, { "label": "teapot", "score": 0.9849203824996948 }] - ) && isDeepEqual( - output4, - [ - [{ "label": "palace", "score": 0.9975974559783936 }, { "label": "monastery", "score": 0.0007480724016204476 }], - [{ "label": "teapot", "score": 0.9849203824996948 }, { "label": "coffeepot", "score": 0.008069870993494987 }] - ] - ), duration]; - -} - - -async function image_segmentation() { - let segmenter = await pipeline('image-segmentation', 'facebook/detr-resnet-50-panoptic') - - let img = path.join(__dirname, '../assets/images/cats.jpg') - - let start = performance.now(); - let outputs = await segmenter(img); - - // Just calculate sum of mask (to avoid having to check the whole mask) - outputs.forEach(x => x.mask = x.mask.data.reduce((acc, curr) => { - if (curr > 0) { - acc += 1; - } - return acc; - }, 0)); - - let duration = performance.now() - start; - - // Dispose pipeline - await segmenter.dispose() - - return [isDeepEqual( - outputs, - [ - { score: 0.9967514276504517, label: 'cat', mask: 58924 }, - { score: 0.998571515083313, label: 'remote', mask: 4241 }, - { score: 0.999416172504425, label: 'remote', mask: 2280 }, - { score: 0.9635734558105469, label: 'couch', mask: 172312 }, - { score: 0.999547004699707, label: 'cat', mask: 52395 } - ] - ), duration]; - -} - -async function zero_shot_image_classification() { - - let classifier = await pipeline('zero-shot-image-classification', 'openai/clip-vit-base-patch16'); - - let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg'; - let urls = [ - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg', - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg', - 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg', - ] - - let classes = ['football', 'airport', 'animals']; - - let start = performance.now(); - - let output1 = await classifier(url, classes); - let output2 = await classifier(urls, classes); - - let duration = performance.now() - start; - - // Dispose pipeline - await classifier.dispose() - - return [isDeepEqual( - output1, - [ - { "score": 0.9934590458869934, "label": "football" }, - { "score": 0.0007887096726335585, "label": "airport" }, - { "score": 0.005752227734774351, "label": "animals" } - ] - ) && isDeepEqual( - output2, - [ - [ - { "score": 0.9938763976097107, "label": "football" }, - { "score": 0.0007706438773311675, "label": "airport" }, - { "score": 0.005352961830794811, "label": "animals" } - ], [ - { "score": 0.00042657132144086063, "label": "football" }, - { "score": 0.997478187084198, "label": "airport" }, - { "score": 0.0020952688064426184, "label": "animals" } - ], [ - { "score": 0.014750242233276367, "label": "football" }, - { "score": 0.021008191630244255, "label": "airport" }, - { "score": 0.9642415642738342, "label": "animals" } - ] - ] - ), duration]; -} - - -async function object_detection() { - let detector = await pipeline('object-detection', 'facebook/detr-resnet-50') - - let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg'; - let urls = ['https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg'] - - // TODO add batched test cases when supported - - let start = performance.now(); - - let output1 = await detector(url, { - threshold: 0.9, - }); - - let output2 = await detector(urls, { - threshold: 0.9, - percentage: true - }); - - let duration = performance.now() - start; - - // Dispose pipeline - await detector.dispose() - - return [isDeepEqual( - output1, - { - "boxes": [ - [358.7606209516525, 247.36226856708527, 402.14368879795074, 315.4741019010544], - [110.0420343875885, 237.36174881458282, 233.3449423313141, 323.1463783979416], - [6.167297065258026, 147.96502590179443, 221.5736523270607, 260.91010093688965], - [186.66354596614838, 231.2074738740921, 321.6980177164078, 305.78231513500214], - [349.1101884841919, 95.70672154426575, 547.1087765693665, 310.6894862651825] - ], - "classes": [24, 24, 25, 24, 25], - "scores": [0.9990543723106384, 0.9987652897834778, 0.9860252737998962, 0.997667133808136, 0.9986326694488525], - "labels": ["zebra", "zebra", "giraffe", "zebra", "giraffe"] - }, - ) && isDeepEqual( - output2, - [{ - "boxes": [ - [0.4284285604953766, 0.5051715075969696, 0.4905807673931122, 0.5450733006000519], - [0.6921858489513397, 0.33420196175575256, 1.016784816980362, 0.9818757474422455], - [0.7528624832630157, 0.5306279957294464, 0.8514151275157928, 0.6537223756313324], - [0.5119757056236267, 0.5140881687402725, 0.5615171790122986, 0.5465199798345566], - [0.33254460990428925, 0.5169002115726471, 0.35381682217121124, 0.6282477080821991], - [0.42312371730804443, 0.4445413798093796, 0.5735017657279968, 0.5278995186090469], - [0.18738143146038055, 0.40505293011665344, 0.4653054028749466, 0.5265144407749176], - [0.5737103521823883, 0.4582572281360626, 0.7308457791805267, 0.6411504447460175], - [0.5117709636688232, 0.5142771750688553, 0.5613124370574951, 0.5452155321836472], - [0.5707400292158127, 0.46061643958091736, 0.7277757674455643, 0.6379677355289459] - ], - "classes": [8, 6, 1, 8, 1, 5, 5, 8, 3, 6], - "scores": [0.911045253276825, 0.9961543679237366, 0.9976616501808167, 0.9338068962097168, 0.9982594847679138, 0.9954741597175598, 0.9979778528213501, 0.9158956408500671, 0.9502778649330139, 0.994942843914032], - "labels": ["truck", "bus", "person", "truck", "person", "airplane", "airplane", "truck", "car", "bus"] - }] - ), duration]; - -} - - -// hide unused initializer and node arguments warnings -console._warn = console.warn; -console.warn = (...data) => { - if (!data[0].includes('CleanUnusedInitializersAndNodeArgs')) { - console._warn(...data); - } -}; - -// Define tests -let tests = { - 'Text classification:': text_classification, - 'Token classification:': token_classification, - 'Zero-shot classification': zero_shot_classification, - 'Masked language modelling:': masked_language_modelling, - 'Question answering:': question_answering, - 'Summarization:': summarization, - 'Translation:': translation, - 'Text-to-text generation:': text2text_generation, - 'Text generation:': text_generation, - 'Code generation:': code_generation, - 'Embeddings:': embeddings, - 'Speech-to-text generation:': speech2text_generation, - 'Image-to-text:': image_to_text, - 'Image classification:': image_classification, - 'Image segmentation:': image_segmentation, - 'Zero-shot image classification:': zero_shot_image_classification, - 'Object detection:': object_detection, -}; - -// run tests -(async () => { - let results = {}; - for (const [name, fn] of Object.entries(tests)) { - results[name] = await fn(); - console.log(name, results[name]); - } - - // Display final results in a table - console.table(results); -})(); diff --git a/tests/init.js b/tests/init.js new file mode 100644 index 000000000..647ef6be7 --- /dev/null +++ b/tests/init.js @@ -0,0 +1,92 @@ +// Helper functions used when initialising the testing environment. + + +// Import Node typing utilities +import * as types from "node:util/types"; + +// Import onnxruntime-node's default backend +import { onnxruntimeBackend } from "onnxruntime-node/dist/backend"; +import ONNX_COMMON from "onnxruntime-common"; + +export function init() { + // A workaround to define a new backend for onnxruntime, which + // will not throw an error when running tests with jest. + // For more information, see: https://github.com/jestjs/jest/issues/11864#issuecomment-1261468011 + + let registerBackend = ONNX_COMMON.registerBackend; + + // Define the constructors to monkey-patch + const TYPED_ARRAYS_CONSTRUCTOR_NAMES = [ + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "Float32Array", + "Float64Array", + ]; + + // Keep a reference to the original initialization method + const originalMethod = onnxruntimeBackend.init; + + // Monkey-patch the initialization function + onnxruntimeBackend.init = function (...args) { + // There is probably a better way to do this + Array.isArray = x => + typeof x === "object" && + x !== null && + typeof x.length === "number" && + x?.constructor.toString() === Array.toString(); + + // For each typed array constructor + for (const ctorName of TYPED_ARRAYS_CONSTRUCTOR_NAMES) { + // Get the constructor from the current context + const ctor = global[ctorName]; + + // Get the corresponding test function from the `util` module + const value = types[`is${ctorName}`].bind(types); + + // Monkey-patch the constructor so "x instanceof ctor" returns "types[`is${ctorName}`](x)" + Object.defineProperty(ctor, Symbol.hasInstance, { + value, + writable: false, + configurable: false, + enumerable: false, + }); + } + + // Call the original method + return originalMethod.apply(this, args); + }; + + // Register the backend with the highest priority, so it is used instead of the default one + registerBackend("test", onnxruntimeBackend, Number.POSITIVE_INFINITY); + +} + + +export let m = x => x; +if (process.env.TESTING_REMOTELY) { + // Running in a remote environment where models are not present locally (e.g., GitHub actions). + + // In this case, we use the "test" models, under the following org/username: + const TEST_USERNAME = 'Xenova'; + + m = (name) => { + // Split into parts: [username, model] + let parts = name.split(/\/+/, 2); + if (parts.length === 2) { + // Replace username + parts[0] = TEST_USERNAME; + } else { + // Add username + parts.unshift(TEST_USERNAME); + } + + return parts.join('/'); + } +} + +export const MAX_TEST_EXECUTION_TIME = 60_000; // 60 seconds diff --git a/tests/pipelines.test.js b/tests/pipelines.test.js new file mode 100644 index 000000000..9d80c764d --- /dev/null +++ b/tests/pipelines.test.js @@ -0,0 +1,1118 @@ + +import { pipeline } from '../src/transformers.js'; +import { init, m, MAX_TEST_EXECUTION_TIME } from './init.js'; + + +// Initialise the testing environment +init(); + + +function compare(val1, val2, tol = 0.1) { + if ( + (val1 !== null && val2 !== null) && + (typeof val1 === 'object' && typeof val2 === 'object') + ) { + // Both are non-null objects + + if (Array.isArray(val1) && Array.isArray(val2)) { + expect(val1).toHaveLength(val2.length); + + for (let i = 0; i < val1.length; ++i) { + compare(val1[i], val2[i], tol); + } + + } else { + expect(Object.keys(val1)).toHaveLength(Object.keys(val2).length); + + for (let key in val1) { + compare(val1[key], val2[key]); + } + } + + } else { + // At least one of them is not an object + // First check that both have the same type + expect(typeof val1).toEqual(typeof val2); + + if (typeof val1 === 'number' && (!Number.isInteger(val1) || !Number.isInteger(val2))) { + // If both are numbers and at least one of them is not an integer + expect(val1).toBeCloseTo(val2, tol); + } else { + // Perform equality test + expect(val1).toEqual(val2); + } + } +} + + +// NOTE: +// Due to a memory leak in Jest, we cannot have multiple tests for a single model. +// This is due to how model construction and destruction occurs, in `beforeAll` and `afterAll`, respectively. +// As a result, each test is responsible for exactly one model, but we run multiple inputs through it. +// By encapsulating model construction and destruction in a single `it` block, we avoid these memory issues. +describe('Pipelines', () => { + + describe('Text classification', () => { + + // List all models which will be tested + const models = [ + 'distilbert-base-uncased-finetuned-sst-2-english', + ]; + + it(models[0], async () => { + let classifier = await pipeline('text-classification', m(models[0])); + let texts = [ + "This was a masterpiece. Not completely faithful to the books, but enthralling from beginning to end. Might be my favorite of the three.", + "I hated the movie" + ]; + + // single + { + let outputs = await classifier("I hated the movie"); + let expected = [ + { "label": "NEGATIVE", "score": 0.9996212720870972 } + ]; + compare(outputs, expected); + } + + // single + topk + { + let outputs = await classifier("I hated the movie", { + topk: 2 + }); + let expected = [ + { "label": "NEGATIVE", "score": 0.9996212720870972 }, + { "label": "POSITIVE", "score": 0.0003787268069572747 } + ]; + compare(outputs, expected); + } + + // batched + { + let outputs = await classifier(texts); + + let expected = [ + { "label": "POSITIVE", "score": 0.9993746876716614 }, + { "label": "NEGATIVE", "score": 0.9996694326400757 } + ]; + + compare(outputs, expected); + } + + + // batched + topk + { + let outputs = await classifier(texts, { + topk: 2 + }); + + let expected = [[ + { "label": "POSITIVE", "score": 0.9993746876716614 }, + { "label": "NEGATIVE", "score": 0.0006253048195503652 } + ], [ + { "label": "NEGATIVE", "score": 0.9996694326400757 }, + { "label": "POSITIVE", "score": 0.00033057318069040775 } + ]]; + + compare(outputs, expected); + } + + + await classifier.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Token classification', () => { + + // List all models which will be tested + const models = [ + 'Davlan/bert-base-multilingual-cased-ner-hrl', + ]; + + it(models[0], async () => { + let classifier = await pipeline('token-classification', m(models[0])); + let texts = [ + "The Golden State Warriors are an American professional basketball team based in San Francisco.", + "My name is Sarah and I live in London." + ]; + + // single + { + let outputs = await classifier(texts[0]); + + let expected = [ + { entity: "B-ORG", score: 0.9998535513877869, index: 2, word: "Golden", start: null, end: null }, + { entity: "I-ORG", score: 0.9998612999916077, index: 3, word: "State", start: null, end: null }, + { entity: "I-ORG", score: 0.999866247177124, index: 4, word: "Warriors", start: null, end: null }, + { entity: "B-LOC", score: 0.9997050166130066, index: 13, word: "San", start: null, end: null }, + { entity: "I-LOC", score: 0.9987282156944275, index: 14, word: "Francisco", start: null, end: null } + ]; + + compare(outputs, expected, 0.05); + + } + + // batched + { + let outputs = await classifier(texts); + + let expected = [ + [ + { entity: "B-ORG", score: 0.9998375773429871, index: 2, word: "Golden", start: null, end: null }, + { entity: "I-ORG", score: 0.9998642206192017, index: 3, word: "State", start: null, end: null }, + { entity: "I-ORG", score: 0.9998642802238464, index: 4, word: "Warriors", start: null, end: null }, + { entity: "B-LOC", score: 0.9996914863586426, index: 13, word: "San", start: null, end: null }, + { entity: "I-LOC", score: 0.9989780783653259, index: 14, word: "Francisco", start: null, end: null } + ], [ + { entity: "B-PER", score: 0.997977614402771, index: 4, word: "Sarah", start: null, end: null }, + { entity: "B-LOC", score: 0.9996902346611023, index: 9, word: "London", start: null, end: null } + ] + ]; + + compare(outputs, expected, 0.05); + } + + await classifier.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Zero-shot classification', () => { + + // List all models which will be tested + const models = [ + 'facebook/bart-large-mnli', + ]; + + it(models[0], async () => { + let classifier = await pipeline('zero-shot-classification', m(models[0])); + + let sequences_to_classify = ['one day I will see the world', 'I love making pizza']; + let candidate_labels = ['travel', 'cooking', 'dancing']; + + // single + { + let outputs = await classifier(sequences_to_classify[0], candidate_labels); + let expected = { + sequence: "one day I will see the world", + labels: ["travel", "dancing", "cooking"], + scores: [0.4261703487477968, 0.2903585771517135, 0.28347107410048983] + } + + compare(outputs, expected, 0.2); + + } + + // batched + { + let outputs = await classifier(sequences_to_classify, candidate_labels); + let expected = [{ + sequence: "one day I will see the world", + labels: ["travel", "dancing", "cooking"], + scores: [0.4261703487477968, 0.2903585771517135, 0.28347107410048983] + }, { + sequence: "I love making pizza", + labels: ["cooking", "travel", "dancing"], + scores: [0.4660367922118968, 0.2756005926506238, 0.2583626151374795] + }]; + + compare(outputs, expected, 0.2); + + } + + + // batched + multilabel + { + let outputs = await classifier(sequences_to_classify, candidate_labels, { + multi_label: true + }) + let expected = [{ + sequence: "one day I will see the world", + labels: ["travel", "dancing", "cooking"], + scores: [0.7108286792234982, 0.5763787804099745, 0.44303326070949994] + }, { + sequence: "I love making pizza", + labels: ["cooking", "travel", "dancing"], + scores: [0.8527619536354446, 0.7899589317978243, 0.5838912691496106] + }]; + + compare(outputs, expected); + + } + + await classifier.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Masked language modelling', () => { + + // List all models which will be tested + const models = [ + 'bert-base-uncased', + ]; + + it(models[0], async () => { + let unmasker = await pipeline('fill-mask', m(models[0])); + let texts = [ + "Once upon a [MASK].", + "[MASK] is the capital of England." + ]; + + // single + { + let outputs = await unmasker(texts[0]); + let expected = [ + { + "score": 0.9318257570266724, + "token": 2051, + "token_str": "time", + "sequence": "once upon a time." + }, + { + "score": 0.009929785504937172, + "token": 13342, + "token_str": "mattress", + "sequence": "once upon a mattress." + }, + { + "score": 0.0021786263678222895, + "token": 3959, + "token_str": "dream", + "sequence": "once upon a dream." + }, + { + "score": 0.001881834352388978, + "token": 2940, + "token_str": "hill", + "sequence": "once upon a hill." + }, + { + "score": 0.0017424898687750101, + "token": 2154, + "token_str": "day", + "sequence": "once upon a day." + } + ]; + compare(outputs, expected); + + } + + + // batched + { + let outputs = await unmasker(texts); + + let expected = [[ + { + "score": 0.9828392863273621, + "token": 2051, + "token_str": "time", + "sequence": "once upon a time." + }, + { + "score": 0.0027356224600225687, + "token": 13342, + "token_str": "mattress", + "sequence": "once upon a mattress." + }, + { + "score": 0.00038447941187769175, + "token": 2504, + "token_str": "level", + "sequence": "once upon a level." + }, + { + "score": 0.0003801222483161837, + "token": 2940, + "token_str": "hill", + "sequence": "once upon a hill." + }, + { + "score": 0.0003801104612648487, + "token": 6480, + "token_str": "lifetime", + "sequence": "once upon a lifetime." + } + ], [ + { + "score": 0.3269098699092865, + "token": 2414, + "token_str": "london", + "sequence": "london is the capital of england." + }, + { + "score": 0.06448942422866821, + "token": 2009, + "token_str": "it", + "sequence": "it is the capital of england." + }, + { + "score": 0.03533688560128212, + "token": 7067, + "token_str": "bristol", + "sequence": "bristol is the capital of england." + }, + { + "score": 0.025355694815516472, + "token": 5087, + "token_str": "manchester", + "sequence": "manchester is the capital of england." + }, + { + "score": 0.023570900782942772, + "token": 6484, + "token_str": "birmingham", + "sequence": "birmingham is the capital of england." + } + ]]; + + compare(outputs, expected); + + } + + await unmasker.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Question answering', () => { + let question = 'Who was Jim Henson?' + let context = 'Jim Henson was a nice puppet.' + + + // List all models which will be tested + const models = [ + 'distilbert-base-uncased-distilled-squad', + ]; + + it(models[0], async () => { + let answerer = await pipeline('question-answering', m(models[0])); + + // single + { + let outputs = await answerer(question, context); + let expected = { answer: 'a nice puppet', score: 0.5664517526948352 }; + + compare(outputs, expected, 0.2); + } + + // single + topk + { + let outputs = await answerer(question, context, { + topk: 3, + }); + let expected = [ + { answer: 'a nice puppet', score: 0.5664517526948352 }, + { answer: 'nice puppet', score: 0.1698902336448853 }, + { answer: 'puppet', score: 0.14046057793125577 } + ]; + + compare(outputs, expected, 0.2); + + } + await answerer.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Summarization', () => { + + // List all models which will be tested + const models = [ + 'sshleifer/distilbart-cnn-6-6', + 'facebook/bart-large-cnn', + ]; + + let texts = [ + `The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.`, + `The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species.` + ]; + + it(models[0], async () => { + let summarizer = await pipeline('summarization', m(models[0])); + + // batched + { + let summary = await summarizer(texts, { + top_k: 0, + do_sample: false, + }); + expect(summary).toHaveLength(2); + expect(summary[0].summary_text.length).toBeGreaterThan(50); + expect(summary[1].summary_text.length).toBeGreaterThan(50); + } + await summarizer.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + + + it(models[1], async () => { + let summarizer = await pipeline('summarization', m(models[1])); + + // batched + `forced_bos_token_id` + { + let summary = await summarizer(texts[0], { + top_k: 0, + do_sample: false, + }); + expect(summary).toHaveLength(1); + expect(summary[0].summary_text.length).toBeGreaterThan(50); + } + + await summarizer.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Translation', () => { + + // List all models which will be tested + const models = [ + 't5-small', + + // Multilingual model + 'facebook/nllb-200-distilled-600M', + ]; + + it(models[0], async () => { + let translator = await pipeline('translation_en_to_de', m(models[0])); + let texts = [ + 'Hello, how are you?', + 'My name is Maria.', + ] + + // single + { + let translation = await translator(texts[0], { + top_k: 0, + do_sample: false + }); + + let expected = [ + { "translation_text": "Hallo, wie sind Sie?" } + ]; + + compare(translation, expected); + } + + // batched + { + let output = await translator(texts, { + top_k: 0, + do_sample: false + }); + + let expected = [ + { 'translation_text': 'Hallo, wie sind Sie?' }, + { 'translation_text': 'Mein Name ist Maria.' } + ]; + + compare(output, expected); + + } + + await translator.dispose(); + }, MAX_TEST_EXECUTION_TIME); + + + it(models[1], async () => { + let translator = await pipeline('translation', m(models[1])); + let texts = [ + 'Hello world!', + 'I like to walk my dog.', + ] + + // single + { + let translation = await translator(texts[0], { + src_lang: 'eng_Latn', + tgt_lang: 'arb_Arab' + }); + + let expected = [ + { 'translation_text': 'مرحباً عالمياً' } + ]; + + compare(translation, expected); + }; + + // single + back-translation + { + let translation1 = await translator(texts[1], { + // src_lang: 'eng_Latn', + tgt_lang: 'ell_Grek' + }); + let translation2 = await translator(translation1[0].translation_text, { + src_lang: 'ell_Grek', + tgt_lang: 'eng_Latn' + }); + + let expected = [ + { translation_text: 'Μου αρέσει να περπατάω το σκυλί μου.' } + ] + + compare(translation1, expected); + + let expectedBack = [ + { translation_text: texts[1] } + ] + compare(translation2, expectedBack); + + } + + await translator.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Text-to-text generation', () => { + + // List all models which will be tested + const models = [ + 'google/flan-t5-small', + 'google/flan-t5-base', + ]; + + it(models[0], async () => { + let generator = await pipeline('text2text-generation', m(models[0])); + let text = "Premise: At my age you will probably have learnt one lesson. " + + "Hypothesis: It's not certain how many lessons you'll learn by your thirties. " + + "Does the premise entail the hypothesis?"; + + { + let outputs = await generator(text, { + top_k: 0, + do_sample: false + }); + expect(outputs).toHaveLength(1); + expect(outputs[0].length).toBeGreaterThan(10); + } + + await generator.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + + it(models[1], async () => { + let generator = await pipeline('text2text-generation', m(models[1])); + let text = ` + Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can + has 3 tennis balls. How many tennis balls does he have now? + A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. + 5 + 6 = 11. The answer is 11. + + Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half + of the golf balls are blue. How many blue golf balls are there?`; + + // single + { + let outputs = await generator(text, { + top_k: 0, + do_sample: false + }); + expect(outputs).toHaveLength(1); + expect(outputs[0].length).toBeGreaterThan(10); + } + await generator.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Text generation', () => { + + // List all models which will be tested + const models = [ + 'distilgpt2', + + 'Salesforce/codegen-350M-mono', + ]; + + it(models[0], async () => { + let generator = await pipeline('text-generation', m(models[0])); + let texts = [ + 'Once upon a time, there was a', + 'I enjoy walking with my cute dog', + ]; + + // single + { + let output = await generator(texts[0], { + max_new_tokens: 10, + top_k: 0, + do_sample: false + }) + expect(output).toHaveLength(1); + expect(output[0].generated_text.length).toBeGreaterThan(texts[0].length); + } + + // single + `num_beams` + `num_return_sequences` + { + let output = await generator(texts[0], { + max_new_tokens: 10, + num_beams: 2, + num_return_sequences: 2, + top_k: 0, + do_sample: false + }) + expect(output).toHaveLength(2); + expect(output[0].generated_text.length).toBeGreaterThan(texts[0].length); + expect(output[1].generated_text.length).toBeGreaterThan(texts[0].length); + + } + + // batched + `num_beams` + `num_return_sequences` + { + let output = await generator(texts, { + max_new_tokens: 10, + num_beams: 2, + num_return_sequences: 2, + top_k: 0, + do_sample: false + }); + expect(output).toHaveLength(2); + expect(output[0]).toHaveLength(2); + expect(output[0][0].generated_text.length).toBeGreaterThan(texts[0].length); + expect(output[0][1].generated_text.length).toBeGreaterThan(texts[0].length); + expect(output[1]).toHaveLength(2); + expect(output[1][0].generated_text.length).toBeGreaterThan(texts[1].length); + expect(output[1][1].generated_text.length).toBeGreaterThan(texts[1].length); + + } + + await generator.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + + + it(models[1], async () => { + let generator = await pipeline('text-generation', m(models[1])); + let code = 'def fib(n):'; + + // single + `added_tokens` + { + let output = await generator(code, { + max_new_tokens: 45, + top_k: 0, + do_sample: false + }) + expect(output).toHaveLength(1); + expect(output[0].generated_text.length).toBeGreaterThan(code.length); + } + await generator.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Feature extraction', () => { + + // List all models which will be tested + const models = [ + 'sentence-transformers/all-MiniLM-L6-v2', + + ]; + + it(models[0], async () => { + let extractor = await pipeline('feature-extraction', m(models[0])); + + // Provide sentences + let sentences = [ + 'This framework generates embeddings for each input sentence', + 'Sentences are passed as a list of string.', + 'The quick brown fox jumps over the lazy dog.' + ] + + // compare features + { + let output = await extractor(sentences); + + // Convert Tensor to JS list + output = output.tolist(); + + // Compute pairwise cosine similarity + // for (let i = 0; i < sentences.length; ++i) { + // for (let j = i + 1; j < sentences.length; ++j) { + // console.log(`(${i},${j}):`, extractor.cos_sim(output[i], output[j])) + // } + // } + + let pairwiseScores = [[output[0], output[1]], [output[0], output[2]], [output[1], output[2]]].map(x => extractor.cos_sim(...x)) + + let expected = [0.502872309810269, 0.11088411026413121, 0.09602621986931259] + compare(pairwiseScores, expected); + } + await extractor.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + }); + + // TODO + // describe('Speech-to-text generation', () => { + + // // List all models which will be tested + // const models = [ + // 'openai/whisper-tiny.en', + // ]; + + // it(models[0], async () => { + // let transcriber = await pipeline('automatic-speech-recognition', m(models[0])); + // let audio = './tests/assets/jfk.wav'; + + // { + // let output = await transcriber(audio); + // expect(output); + // } + // await transcriber.dispose(); + + // }, MAX_TEST_EXECUTION_TIME); + // }); + + describe('Image-to-text', () => { + + // List all models which will be tested + const models = [ + 'nlpconnect/vit-gpt2-image-captioning', + ]; + + it(models[0], async () => { + let captioner = await pipeline('image-to-text', m(models[0])); + + let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg'; + let urls = [ + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg', + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg' + ] + + // single + { + let output = await captioner(url, { + top_k: 0, + do_sample: false + }) + // let expected = [ + // { "generated_text": "a herd of giraffes and zebras grazing in a field" } + // ] + + expect(output).toHaveLength(1); + expect(output[0].generated_text.length).toBeGreaterThan(10); + } + + // single + generation options + { + let output = await captioner(url, { + max_new_tokens: 20, + num_beams: 2, + num_return_sequences: 2, + top_k: 0, + do_sample: false + }) + // let expected = [ + // { "generated_text": "a herd of giraffes and zebras grazing in a field" }, + // { "generated_text": "a herd of giraffes and zebras in a grassy field" } + // ] + + expect(output).toHaveLength(2); + expect(output[0].generated_text.length).toBeGreaterThan(10); + expect(output[1].generated_text.length).toBeGreaterThan(10); + + } + + // batched + { + let output = await captioner(urls, { + top_k: 0, + do_sample: false + }) + // let expected = [ + // [{ "generated_text": "two men are kicking a soccer ball in a soccer game" }], + // [{ "generated_text": "a plane on the tarmac with a passenger bus" }] + // ] + + expect(output).toHaveLength(2); + expect(output[0]).toHaveLength(1); + expect(output[0][0].generated_text.length).toBeGreaterThan(10); + expect(output[1]).toHaveLength(1); + expect(output[1][0].generated_text.length).toBeGreaterThan(10); + } + + // batched + generation options + { + let output = await captioner(urls, { + max_new_tokens: 20, + num_beams: 2, + num_return_sequences: 2, + top_k: 0, + do_sample: false + }) + // let expected = [ + // [ + // { "generated_text": "two men are kicking a soccer ball on a field" }, + // { "generated_text": "two men are kicking a soccer ball in a soccer game" } + // ], [ + // { "generated_text": "a plane on a tarmac with a group of buses" }, + // { "generated_text": "a plane on a tarmac with a group of people on the ground" } + // ] + // ]; + + expect(output).toHaveLength(2); + expect(output[0]).toHaveLength(2); + expect(output[0][0].generated_text.length).toBeGreaterThan(10); + expect(output[0][1].generated_text.length).toBeGreaterThan(10); + expect(output[1]).toHaveLength(2); + expect(output[1][0].generated_text.length).toBeGreaterThan(10); + expect(output[1][1].generated_text.length).toBeGreaterThan(10); + + } + await captioner.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Image classification', () => { + + // List all models which will be tested + const models = [ + 'google/vit-base-patch16-224', + ]; + + it(models[0], async () => { + let classifier = await pipeline('image-classification', m(models[0])); + + let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg'; + let urls = [ + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg', + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg' + ] + + // single + { + let outputs = await classifier(url); + + let expected = [ + { "label": "tiger, Panthera tigris", "score": 0.607988178730011 } + ]; + + compare(outputs, expected, 0.2); + + } + + // single + topk + { + let outputs = await classifier(url, { + topk: 2 + }); + + let expected = [ + { "label": "tiger, Panthera tigris", "score": 0.607988178730011 }, + { "label": "tiger cat", "score": 0.3877776563167572 } + ]; + + compare(outputs, expected, 0.2); + } + + + // batched + { + let outputs = await classifier(urls); + + let expected = [ + { "label": "palace", "score": 0.9986862540245056 }, + { "label": "teapot", "score": 0.987880527973175 } + ]; + + compare(outputs, expected); + } + + // batched + topk + { + let outputs = await classifier(urls, { + topk: 2 + }); + + let expected = [ + [ + { "label": "palace", "score": 0.9986862540245056 }, + { "label": "castle", "score": 0.00037879671435803175 } + ], + [ + { "label": "teapot", "score": 0.987880527973175 }, + { "label": "coffeepot", "score": 0.006591461598873138 } + ] + ]; + + compare(outputs, expected); + } + + await classifier.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Image segmentation', () => { + + // List all models which will be tested + const models = [ + 'facebook/detr-resnet-50-panoptic', + ]; + + it(models[0], async () => { + let segmenter = await pipeline('image-segmentation', m(models[0]), { + // Quantized version of model produces incorrect results + quantized: false, + }) + let img = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/coco_sample.png'; + + // single + { + let outputs = await segmenter(img); + + let expected = [ + { score: 0.9916538596153259, label: 'cat', mask: 58998 }, + { score: 0.9987397789955139, label: 'remote', mask: 4164 }, + { score: 0.9994599223136902, label: 'remote', mask: 2275 }, + { score: 0.9730215072631836, label: 'couch', mask: 176980 }, + { score: 0.9993911385536194, label: 'cat', mask: 52670 } + ]; + + let outputLabels = outputs.map(x => x.label); + let expectedLabels = expected.map(x => x.label); + + expect(outputLabels).toHaveLength(expectedLabels.length); + expect(outputLabels.sort()).toEqual(expectedLabels.sort()) + } + + await segmenter.dispose(); + + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Zero-shot image classification', () => { + + // List all models which will be tested + const models = [ + 'openai/clip-vit-base-patch16', + ]; + + it(models[0], async () => { + let classifier = await pipeline('zero-shot-image-classification', m(models[0])); + + let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg'; + let urls = [ + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg', + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg', + 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg', + ] + + let classes = ['football', 'airport', 'animals']; + + // single + { + let output = await classifier(url, classes); + + let expected = [ + { "score": 0.992206871509552, "label": "football" }, + { "score": 0.0013248942559584975, "label": "airport" }, + { "score": 0.006468251813203096, "label": "animals" } + ] + compare(output, expected, 0.1); + + } + + + // batched + { + let output = await classifier(urls, classes); + + let expected = [ + [ + { "score": 0.9919875860214233, "label": "football" }, + { "score": 0.0012227334082126617, "label": "airport" }, + { "score": 0.006789708975702524, "label": "animals" } + ], [ + { "score": 0.0003043194592464715, "label": "football" }, + { "score": 0.998708188533783, "label": "airport" }, + { "score": 0.0009874969255179167, "label": "animals" } + ], [ + { "score": 0.015163016505539417, "label": "football" }, + { "score": 0.016037866473197937, "label": "airport" }, + { "score": 0.9687991142272949, "label": "animals" } + ] + ]; + compare(output, expected, 0.1); + + } + await classifier.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); + + describe('Object detection', () => { + + // List all models which will be tested + const models = [ + 'facebook/detr-resnet-50', + ]; + + it(models[0], async () => { + let detector = await pipeline('object-detection', m(models[0])); + + // TODO add batched test cases when supported + let url = 'https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg'; + let urls = ['https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg'] + + // single + threshold + { + let output = await detector(url, { + threshold: 0.9, + }); + + // let expected = { + // "boxes": [ + // [352.8210112452507, 247.36732184886932, 390.5271676182747, 318.09066116809845], + // [111.15852802991867, 235.34255504608154, 224.96717244386673, 325.21119117736816], + // [13.524770736694336, 146.81672930717468, 207.97560095787048, 278.6452639102936], + // [187.396682202816, 227.97491312026978, 313.05202156305313, 300.26460886001587], + // [201.60082161426544, 230.86223602294922, 312.1393972635269, 306.5505266189575], + // [365.85242718458176, 95.3144109249115, 526.5485098958015, 313.17670941352844] + // ], + // "classes": [24, 24, 25, 24, 24, 25], + // "scores": [0.9989480376243591, 0.9990893006324768, 0.9690554738044739, 0.9274907112121582, 0.9714975953102112, 0.9989491105079651], + // "labels": ["zebra", "zebra", "giraffe", "zebra", "zebra", "giraffe"] + // }; + + let num_classes = output.boxes.length; + expect(num_classes).toBeGreaterThan(1); + expect(output.classes.length).toEqual(num_classes); + expect(output.scores.length).toEqual(num_classes); + expect(output.labels.length).toEqual(num_classes); + + } + + // single + threshold + percentage + { + let output = await detector(urls, { + threshold: 0.9, + percentage: true + }); + + // let expected = [{ + // "boxes": [ + // [0.7231650948524475, 0.32641804218292236, 0.981127917766571, 0.9918863773345947], + // [0.7529061436653137, 0.52558633685112, 0.8229959607124329, 0.6482008993625641], + // [0.5080368518829346, 0.5156279355287552, 0.5494132041931152, 0.5434067696332932], + // [0.33636586368083954, 0.5217841267585754, 0.3535611182451248, 0.6151944994926453], + // [0.42090220749378204, 0.4482414871454239, 0.5515891760587692, 0.5207531303167343], + // [0.1988394856452942, 0.41224047541618347, 0.45213085412979126, 0.5206181704998016], + // [0.5063001662492752, 0.5170856416225433, 0.5478668659925461, 0.54373899102211], + // [0.5734506398439407, 0.4508090913295746, 0.7049560993909836, 0.6252130568027496], + // ], + // "classes": [6, 1, 8, 1, 5, 5, 3, 6], + // "scores": [0.9970788359642029, 0.996989905834198, 0.9505048990249634, 0.9984546899795532, 0.9942372441291809, 0.9989550709724426, 0.938920259475708, 0.9992448091506958], + // "labels": ["bus", "person", "truck", "person", "airplane", "airplane", "car", "bus"] + // }]; + + expect(output).toHaveLength(urls.length); + + let num_classes = output[0].boxes.length; + expect(num_classes).toBeGreaterThan(1); + expect(output[0].classes.length).toEqual(num_classes); + expect(output[0].scores.length).toEqual(num_classes); + expect(output[0].labels.length).toEqual(num_classes); + } + + await detector.dispose(); + }, MAX_TEST_EXECUTION_TIME); + }); +}); diff --git a/tests/tokenizers.test.js b/tests/tokenizers.test.js new file mode 100644 index 000000000..cad244091 --- /dev/null +++ b/tests/tokenizers.test.js @@ -0,0 +1,38 @@ + + +import { AutoTokenizer } from '../src/transformers.js'; +import { getFile } from '../src/utils/hub.js'; +import { init, m } from './init.js'; + +// Initialise the testing environment +init(); + +// Load test data generated by the python tests +// TODO do this dynamically? +let testsData = await (await getFile('./tests/data/tokenizer_tests.json')).json() + +describe('Tokenizers', () => { + + for (let [tokenizerName, tests] of Object.entries(testsData)) { + + it(tokenizerName, async () => { + let tokenizer = await AutoTokenizer.from_pretrained(m(tokenizerName)); + + for (let test of tests) { + + // Test encoding + let encoded = tokenizer(test.input, { + return_tensor: false + }); + expect(encoded).toEqual(test.encoded); + + // Test decoding + let decoded_with_special = tokenizer.decode(encoded.input_ids, { skip_special_tokens: false }); + expect(decoded_with_special).toEqual(test.decoded_with_special); + + let decoded_without_special = tokenizer.decode(encoded.input_ids, { skip_special_tokens: true }); + expect(decoded_without_special).toEqual(test.decoded_without_special); + } + }); + } +}); diff --git a/webpack.config.js b/webpack.config.js index 2af075fbe..6adcfd9d9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,11 @@ -const webpack = require('webpack'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); +import CopyWebpackPlugin from 'copy-webpack-plugin'; +import TerserPlugin from 'terser-webpack-plugin'; +import { fileURLToPath } from 'url'; +import path from 'path'; -module.exports = { +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export default { mode: 'development', devtool: 'source-map', entry: { @@ -14,13 +17,11 @@ module.exports = { output: { filename: '[name].js', path: __dirname, + library: { + type: 'module', + }, }, plugins: [ - // Do not include node modules when bundling for the browser - new webpack.IgnorePlugin({ - resourceRegExp: /^onnxruntime-node$|^node:/ - }), - // Copy .wasm files to dist folder new CopyWebpackPlugin({ patterns: [ @@ -44,4 +45,7 @@ module.exports = { }, port: 8080 }, + experiments: { + outputModule: true, + }, };