# SEBIS{URGENT},ValueError: You have to specify either decoder\_inputs or decoder\_inputs\_embeds

**URL:** <https://discuss.huggingface.co/t/sebis-urgent-valueerror-you-have-to-specify-either-decoder-inputs-or-decoder-inputs-embeds/2988>\
**Category:** Models\
**Created:** [December 29, 2020, 4:27am UTC](https://discuss.huggingface.co/t/sebis-urgent-valueerror-you-have-to-specify-either-decoder-inputs-or-decoder-inputs-embeds/2988 "2020-12-29T04:27:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Rohit](https://discuss.huggingface.co/u/Rohit)\
**Post date:** [December 29, 2020, 4:27am UTC](https://discuss.huggingface.co/t/sebis-urgent-valueerror-you-have-to-specify-either-decoder-inputs-or-decoder-inputs-embeds/2988/1 "2020-12-29T04:27:40Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/f/fbbc24801c93298c07764e25b72afcea1540993d.png)

ValueError: You have to specify either decoder\_inputs or decoder\_inputs\_embeds

Could somebody please help.

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [December 29, 2020, 6:29am UTC](https://discuss.huggingface.co/t/sebis-urgent-valueerror-you-have-to-specify-either-decoder-inputs-or-decoder-inputs-embeds/2988/2 "2020-12-29T06:29:51Z")

</div>

Hi @Rohit

It’s not clear what exactly you want to do. Could you please provide more information?

From what I can see, it’s a T5 model. If you want to use it for Seq2Seq generation then you should use the `AutoModelForConditionalGeneration` or `T5ForConditionalGeneration` class and use the `generate` method.

And in general the `forward` of any seq2seq models expects `input_ids` (input for encoder) and `decoder_input_ids` (input for decoder). T5Model throws this error when the `decoder_input_ids` are not provided.

---

<div class="post-metadata">

**Author:** ![Rohit](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Rohit](https://discuss.huggingface.co/u/Rohit)\
**Post date:** [December 29, 2020, 11:38am UTC](https://discuss.huggingface.co/t/sebis-urgent-valueerror-you-have-to-specify-either-decoder-inputs-or-decoder-inputs-embeds/2988/3 "2020-12-29T11:38:53Z")

</div>

Thanks a lot…Actually I m new to this so i didnt knew how to use it…i wanted to use it as seq2seq I followed your refernce and it worked… 😀

---

<div class="post-metadata">

**Author:** ![wei](https://avatars.discourse-cdn.com/v4/letter/w/90ced4/32.png) [@wei](https://discuss.huggingface.co/u/wei)\
**Post date:** [January 1, 2021, 8:54am UTC](https://discuss.huggingface.co/t/sebis-urgent-valueerror-you-have-to-specify-either-decoder-inputs-or-decoder-inputs-embeds/2988/4 "2021-01-01T08:54:09Z")

</div>

Hi @Rohit,

You could also set the pipeline like:

 ![Screen Shot 2021-01-01 at 9.52.27 AM](https://us1.discourse-cdn.com/hellohellohello/original/2X/9/95dd3bcc881957bf42c62335404e8f67a254b30c.png)

and use pipeline([code]) to generate description for the input code.  
Here is one Colab example: [https://github.com/agemagician/CodeTrans/blob/main/prediction/multitask/fine-tuning/function%20documentation%20generation/java/base\_model.ipynb](https://github.com/agemagician/CodeTrans/blob/main/prediction/multitask/fine-tuning/function%20documentation%20generation/java/base_model.ipynb)
