Open tomaarsen opened 1 week ago
Thanks for reporting @tomaarsen! This is something that we are doing for openvino models https://github.com/huggingface/optimum-intel/blob/f7b5b547c167cb6a9f20fa77d493ee2dde3c3034/optimum/intel/openvino/modeling.py#L395, but never added for onnx models, will take care of adding it!
System Info
Who can help?
@michaelbenayoun
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction (minimal, reproducible, runnable)
Expected behavior
I would expect for
optimum
to mirror thetransformers
behaviour wheretoken_type_ids
is set totorch.zeros(input_ids.shape, ...)
if it's not explicitly provided. See here for that implementation intransformers
: https://github.com/huggingface/transformers/blob/4de1bdbf637fe6411c104c62ab385f660bfb1064/src/transformers/models/bert/modeling_bert.py#L1070-L1076This is preventing the following:
See also https://github.com/UKPLab/sentence-transformers/issues/2983