unexpected keyword argument 'forced_bos_token_id' when using mbart-large-50-many-to-many-mmt
Author: IamAdiSri
Pull request: no

When I try to run the example on the model card, I get this error;

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-88d049aaf9c0> in <module>
      5 tokenizer.src_lang = "hi_IN"
      6 encoded_hi = tokenizer(article_hi, return_tensors="pt")
----> 7 generated_tokens = model.generate(
      8     **encoded_hi,
      9     forced_bos_token_id=tokenizer.lang_code_to_id["fr_XX"]

~/opt/Python-3.8.2/lib/python3.8/site-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     24         def decorate_context(*args, **kwargs):
     25             with self.__class__():
---> 26                 return func(*args, **kwargs)
     27         return cast(F, decorate_context)
     28 

~/opt/Python-3.8.2/lib/python3.8/site-packages/transformers/generation_utils.py in generate(self, input_ids, max_length, min_length, do_sample, early_stopping, num_beams, temperature, top_k, top_p, repetition_penalty, bad_words_ids, bos_token_id, pad_token_id, eos_token_id, length_penalty, no_repeat_ngram_size, num_return_sequences, decoder_start_token_id, use_cache, num_beam_groups, diversity_penalty, prefix_allowed_tokens_fn, output_attentions, output_hidden_states, output_scores, return_dict_in_generate, **model_kwargs)
    831         if self.config.is_encoder_decoder:
    832             # add encoder_outputs to model_kwargs
--> 833             model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(input_ids, model_kwargs)
    834 
    835             # set input_ids as decoder_input_ids

~/opt/Python-3.8.2/lib/python3.8/site-packages/transformers/generation_utils.py in _prepare_encoder_decoder_kwargs_for_generation(self, input_ids, model_kwargs)
    376             argument: value for argument, value in model_kwargs.items() if not argument.startswith("decoder_")
    377         }
--> 378         model_kwargs["encoder_outputs"]: ModelOutput = encoder(input_ids, return_dict=True, **encoder_kwargs)
    379         return model_kwargs
    380 

~/opt/Python-3.8.2/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
    725             result = self._slow_forward(*input, **kwargs)
    726         else:
--> 727             result = self.forward(*input, **kwargs)
    728         for hook in itertools.chain(
    729                 _global_forward_hooks.values(),

TypeError: forward() got an unexpected keyword argument 'forced_bos_token_id'
```

Looking at the code in the master repository, I can't see the generate function taking that argument anywhere at all so I'm unsure how to proceed with this.

_Originally posted by @IamAdiSri in https://github.com/huggingface/tokenizers/issues/633#issuecomment-781689632_

Comments:
hi @IamAdiSri 

What is your Transformers version ? mBART-50 currently only works on master.

@patil-suraj I'm on version 4.3.2, but I tried it with the modules in master branch.  I searched through the repository but as far as I can tell, none of the relevant mbart modules take `forced_bos_token_id` as a parameter in their generate function.

I'm looking the example on [this](https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt) page btw.

`forced_bos_token_id` is included on master, https://github.com/huggingface/transformers/blob/master/src/transformers/generation_utils.py#L549

you should install from source to use mBART-50

Oh okay, thank you.