# How to use optimum with encoder-decoder models

**URL:** <https://discuss.huggingface.co/t/how-to-use-optimum-with-encoder-decoder-models/22268>\
**Category:** 🤗Optimum\
**Created:** [August 29, 2022, 11:11am UTC](https://discuss.huggingface.co/t/how-to-use-optimum-with-encoder-decoder-models/22268 "2022-08-29T11:11:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon32220481](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@anon32220481](https://discuss.huggingface.co/u/anon32220481)\
**Post date:** [August 29, 2022, 11:11am UTC](https://discuss.huggingface.co/t/how-to-use-optimum-with-encoder-decoder-models/22268/1 "2022-08-29T11:11:48Z")

</div>

Optimum has recently added support for encoder-decoder type models. I have succesfully converted some of them (such as mt5) to ONNX using optimum. However, I have a encoder-decoder type model ([Encoder Decoder Models](https://huggingface.co/docs/transformers/model_doc/encoder-decoder)) built using 2x Roberta type models, that I want to convert to ONNX. Whenever I try to do so, I get an “unsupported” message, giving me a list of the supported models (using this tutorial [Convert Transformers to ONNX with Hugging Face Optimum](https://huggingface.co/blog/convert-transformers-to-onnx) which seems to be in line with the docs).

I wanted to make sure that, since encoder-decoder models are a bit of a special case (Roberta is actually supported, but the combination of two of them in the form of a encoder-decoder model does not seem to be) there is actually no way for me to optimize my model’s inference in production using Optimum to use a ONNX version of the same.

Thanks for your help,

Sergio

---

<div class="post-metadata">

**Author:** ![regisss](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/regisss/32/22467_2.png) [@regisss](https://discuss.huggingface.co/u/regisss)\
**Post date:** [October 16, 2022, 10:12am UTC](https://discuss.huggingface.co/t/how-to-use-optimum-with-encoder-decoder-models/22268/2 "2022-10-16T10:12:32Z")

</div>

Hi @anon32220481, is this related to this [issue](https://github.com/huggingface/optimum/issues/396) posted on Github?
