Enable ONNX export for `VisionDecoderEncoderModel`
# 🚀 Feature request

<!-- A clear and concise description of the feature proposal.
     Please provide a link to the paper and code in case they exist. -->

As discussed on the [forums](https://discuss.huggingface.co/t/can-i-export-a-visionencoderdecoder-checkpoint-to-onnx/12885), it would be nice if one could export `VisionDecoderEncoderModel` classes using the `transformers.onnx` package.

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request
     related to a problem? e.g., I'm always frustrated when [...]. If this is related
     to another GitHub issue, please link here too. -->

It is currently not possible to export `VisionDecoderEncoderModel` classes (or vision models more generally), unless the end user is willing to write their own `OnnxConfig`. It might make sense to first explore what is involved in exporting ViT before tackling this more complex example. 

Looking at this a bit more closely, I can see that `transformers.onnx` currently has a tight integration with tokenizers (e.g. to generate dummy inputs), so some refactoring will be necessary to support other modalities.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.<|||||>I believe progress on this ticket will be welcome by the communitiy.<|||||>Hey @albertoandreottiATgmail thanks for the interest! This is next up on my list now that we've just merged the ViT export in #15658 :)

<|||||>> Hey @albertoandreottiATgmail thanks for the interest! This is next up on my list now that we've just merged the ViT export in #15658 :)

Hi @lewtun is there any way (or script) to export trocr to onnx ?<|||||>Hi all, any updates on this? I've also tried to convert TrOCR to ONNX without success. Thanks in advance :) cc @lewtun <|||||>Re-opening this issue as it hasn't been resolved yet<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.<|||||>Adding another feature request for this: https://github.com/NielsRogge/Transformers-Tutorials/issues/183<|||||>> Adding another feature request for this: [NielsRogge/Transformers-Tutorials#183](https://github.com/NielsRogge/Transformers-Tutorials/issues/183)

Any updates on this one?

Thank you<|||||>Hi folks, @mht-sharma will be tackling this issue - stay tuned :)<|||||>@mht-sharma Any updates?

Thank you.<|||||>@BakingBrains you can see the PR from @mht-sharma linked above - we should be able to get this merged pretty soon!<|||||>@lewtun and @mht-sharma Thank you.