Skip to content

[Web] An error occurred during model execution: "TypeError: Cannot read properties of undefined (reading 'apply')". #15719

@xenova

Description

@xenova

Describe the issue

I am unable to use the latest build as the backend for Transformers.js due to the following error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'apply')
    at Ga (ort.js:22426:361)
    at ort-wasm-simd.wasm:0x8c2802
    at Pa.b.<computed> (ort.js:22436:150)
    at c._OrtRun (ort.js:22452:317)
    at Object.run (ort.js:21905:1)
    at run (ort.js:21229:1)
    at OnnxruntimeWebAssemblySessionHandler.run (ort.js:21395:1)
    at InferenceSession.run (ort.js:351:1)

Unfortunately, it's quite difficult to tell what's going wrong as the minification doesn't help debugging.

To reproduce

  1. Build from source, following instructions here. For convenience, here are my dist files: dist.zip
  2. Load model from here: https://huggingface.co/Xenova/transformers.js/tree/main/quantized/t5-small/seq2seq-lm-with-past
  3. Run with this input:
    let input = {
        attention_mask: new Tensor(
            'int64',
            new BigInt64Array([1n, 1n, 1n, 1n, 1n, 1n, 1n, 1n, 1n, 1n, 1n, 1n]),
            [1, 12]
        ),
        input_ids: new Tensor(
            'int64',
            new BigInt64Array([13959n, 1566n, 12n, 2379n, 10n, 8774n, 6n, 149n, 33n, 25n, 58n, 1n]),
            [1, 12]
        )
    }

Will throw the above error. It occurs for both WASM and WebGPU.

Urgency

Relatively urgent as - if this is a problem with the build itself - it will push back the webgpu release.

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

2efb75b

Execution Provider

WebGL, WASM, Other / Unknown

Metadata

Metadata

Assignees

No one assigned

    Labels

    model:transformerissues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc.platform:webissues related to ONNX Runtime web; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions