Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Error: input 'attention_mask' is missing in 'feeds'. #307

@kshuraj

Description

@kshuraj

I would like to know if the Tensor() in onnx.js would support mask token.
I am using the 'bert-base-cased' model to predict the masked text. https://huggingface.co/bert-base-cased

`const onnx = require('onnxjs-node');

async function main() {
const url = "model_output/bert-base-cased.onnx";

const session = new onnx.InferenceSession();
await session.loadModel(url);

// const inputs = [new onnx.Tensor(["I", "<MASK>","to","mars"], "string"), ]  **# I would require help here of how we can provide a input.** 
const inputs = [new onnx.Tensor([])

session.run(inputs)
        .then(
            (data) => {
                console.log("+++++++++++++++ SUCCESS +++++++++++++");
                console.log(data);
                console.log(data.values.next().value);
            }
        )
        .catch(
            (error) => {
                console.log("---------------- ERROR --------------");
                console.log(error);
            }
        );

}

main();
`
Any help would be greatly appreciated.
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions