Longformer Optimum ONNX bug: "ValueError: Model requires 3 inputs. Input Feed contains 2"
I’ve been following the optimum README example trying to get optimum to work with a LongFormer model.However, I hit this error message when loading the model into an NER pipeline:ValueError: Model requires 3 inputs. Input Feed contains 2Error fromhttps://github.com/microsoft/onnxruntime/blob/main/onnxruntime/python/onnxruntime_inference_collection.py#L196I believe there’s one required input (input_ids) and two optional ones (attention_maskandglobal_attention_mask).The tokenize outputsinput_idsandattention_mask, but notglobal_attention_mask.How do I get around this? Is there a way for ONNX to recognize optional inputs, or to remove this expected input?
2022-12-21T14:15:22Z
Hi@benhamner! Unfortunately LongFormer is currently not supported in theORTModelclass because of theglobal_attention_maskinput, hence the error you got with a NER pipeline.We are thinking about how to properly manage custom inputs. For LongFormer, you can follow the progresshere.