# Using EncoderDecoderModel

**URL:** <https://discuss.huggingface.co/t/using-encoderdecodermodel/10242>\
**Category:** 🤗Transformers\
**Created:** [September 23, 2021, 10:50am UTC](https://discuss.huggingface.co/t/using-encoderdecodermodel/10242 "2021-09-23T10:50:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Felix92](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/felix92/32/2532_2.png) [@Felix92](https://discuss.huggingface.co/u/Felix92)\
**Post date:** [October 28, 2021, 2:42pm UTC](https://discuss.huggingface.co/t/using-encoderdecodermodel/10242/5 "2021-10-28T14:42:17Z")

</div>

@nielsr  
yes, I’ve just looked at your changes 🙂 However, I still have the same problems with model.generate () in relation to the validation step and the possibility of exporting the model to ONNX 🙂

> [@VisionEncoderDecoder/TrOCR](https://discuss.huggingface.co/t/visionencoderdecoder-trocr/10961):
>
> Hi, @nielsr I try currently to setup your VisionEncoderDecoderModel with a pretrained bert model as decoder but have some struggle with the model.generate (greedy search) part. I have setup all i have in a Colab Notebook (else it would be to much for posting directly) [Colab Notebook](https://colab.research.google.com/drive/1PZz8oGH3pZEjDpMJex2nZ5p8MiYXzYA8?usp=sharing) (Note: it is open if anyone is interested in collaborating) Questions: What are the difference between decoder\_input\_ids and labels ? (I think decoder\_input\_ids are for training the tokenized labels and labels…

PS: i have removed the decoder\_input\_ids after your push today 🙂 but this notebook is not up to date

---

_[View the full topic](https://discuss.huggingface.co/t/using-encoderdecodermodel/10242)._
