Missing the following inputs: token_type_ids.

#1
by do-me - opened

Apparently the token_type_ids are missing. The intfloat repo is also not working with transformers.js.

models.js:351 Uncaught (in promise) Error: An error occurred during model execution: "Missing the following inputs: token_type_ids.
    at validateInputs (models.js:351:15)
    at sessionRun (models.js:379:33)
    at Function.encoderForward [as _forward] (models.js:643:18)
    at Function.forward (models.js:929:27)
    at Function._call (models.js:918:27)
    at Function.closure [as model] (core.js:77:28)
    at Function._call (pipelines.js:119:34)
    at Function._call (pipelines.js:906:45)
    at closure (core.js:77:28)
    at embed (worker.js:44:22)

Hi there 👋 This is a known problem with the model, due to the fact that the model author decided to mix the type of tokenizer and the model. See here for a workaround: https://github.com/xenova/transformers.js/issues/324

Thanks a lot for linking the issue! Maybe it'd be worth mentioning it in the model card too?

To avoid issues like this in future, it is probably best to just account for this in the library. It should be as simple as adding a line like this to here, to add default input token ids if they are not present. Would you by any chance be interested in making a PR for this?

Sure, great idea. Will do so today!

Fixed it here, tested and works now.

The fix is merged in transformers.js, see https://github.com/xenova/transformers.js/pull/403#event-11004783800.
It should work flawlessly now.

do-me changed discussion status to closed

Sign up or log in to comment