model.generate() using a user specified keyword argument
I made a simple Sea2Seq model based on BartForConditionalGeneration.

My model just takes a additional keyward argument in its forward() method.

![image](https://user-images.githubusercontent.com/63226383/154217584-101cc596-bb96-4a52-b02c-8ad216af694a.png)

Everything is just same as the original forward() method(which is from BartForConditionalGeneration) but "responder_emb" is added.

I'm trying to generate a sequence using model.generate()

like this.

![image](https://user-images.githubusercontent.com/63226383/154215933-d6de7a3b-1d39-4084-b701-e99235c8714b.png)

![image](https://user-images.githubusercontent.com/63226383/154216463-7f8010f3-6766-4201-b26c-e982ef2cd218.png)

but I run into this error (TypeError: forward() got an unexpected keyword argument).

I need to pass "responder_emb" to the model's forward() method but generate() method can't deal with the argument.

How can I solve this error?



cc @patrickvonplaten<|||||>Hey @JH-lee95,

Please note that this question is not related to the original Transformers code and not a bug so in the future it would be amazing if you could use the forum for such questions instead: https://discuss.huggingface.co/ . 

To answer your question, to make your use case work, you'll have to adapt the following function: https://github.com/huggingface/transformers/blob/86119c115496ca773b82f8a1c8cbf2d4e44149fa/src/transformers/models/bart/modeling_bart.py#L1369 in BartForConditionalGeneration as well as making sure that your param is passed correctly through generate to the model.<|||||>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.