Error while loading Pretrained Enocder and Decoder transformers 
Author: anandhperumal
Pull request: no
Labels: name: wontfix

## 🐛 Bug

<!-- Important information -->

Model I am using (Bert, XLNet....):

Language I am using the model on (English, Chinese....):

The problem arise when using:
* [ ] the official example scripts: (give details)
* [X ] my own modified scripts: (give details)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [ X] my own task or dataset: (give details)

## To Reproduce

Steps to reproduce the behavior:

1. Define a model and save it.
when you try to save the model initially you'll get the following error #2196 (create a folder manually encoder and decoder)
2. And try to load the model.
you'll get following error 

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/guest_1/anaconda3/envs/my_env/lib/python3.6/site-packages/transformers/modeling_encoder_decoder.py", line 146, in from_pretrained
    encoder_pretrained_model_name_or_path, *model_args, **kwargs_encoder
  File "/home/guest_1/anaconda3/envs/my_env/lib/python3.6/site-packages/transformers/modeling_auto.py", line 159, in from_pretrained
    "'xlm', 'roberta, 'ctrl'".format(pretrained_model_name_or_path))
ValueError: Unrecognized model identifier in /models/m2m/. Should contains one of 'bert', 'openai-gpt', 'gpt2', 'transfo-xl', 'xlnet', 'xlm', 'roberta, 'ctrl'

```
This is because [here](https://github.com/huggingface/transformers/blob/8efc6dd544bf1a30d99d4b5abfc5e214699eab2b/transformers/modeling_auto.py#L170) the model prefix is checked to load the pre-trained model. So rather than just saving the directory as encoder and decoder save it with model prefix.
 
You could do something like this 
```
        encoder_dir = self.encoder.base_model_prefix + "encoder"
        decoder_dir = self.encoder.base_model_prefix + "decoder"
        self.encoder.save_pretrained(os.path.join(save_directory, encoder_dir))
        self.decoder.save_pretrained(os.path.join(save_directory, decoder_dir))
```
 But another potential bug the above code will lead to is that almost all the transformers has the same prefix. You need to rename all the transformers with their respective transformers prefix.
<!-- If you have a code sample, error messages, stack traces, please provide it here as well. -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

* OS: ubuntu
* Python version: 3.6 
* PyTorch version: 1.3.1
* PyTorch Transformers version (or branch): 2.2.0
* Using GPU ? doesn't matter
* Distributed of parallel setup ? doesn't matter
* Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->


Comments:
How we can solve this problem you've highlighted? Do you want to open a separate PR? If you want, we can work together on this problem!

Sure. Drop me a mail at anandhperumal02@gmail.com

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.