Bug in consecutive creation of tokenizers with different parameters
Author: hawkeoni
Pull request: no

# 🐛 Bug
Creating a tokenizer with do_lower_case set to True overwrites it for the consecutive creation.
## Information

Model I am using: bert-base-cased

Language I am using the model on (English, Chinese ...):
English


## To reproduce
```python
from transformers import AutoTokenizer


text = "Hello there!"

tokenizer_first = AutoTokenizer.from_pretrained("bert-base-cased")
print(tokenizer_first.tokenize(text))

tokenizer_forced_lowercase = AutoTokenizer.from_pretrained("bert-base-cased", do_lower_case=True)

print(tokenizer_forced_lowercase.tokenize(text))

tokenizer_second = AutoTokenizer.from_pretrained("bert-base-cased")
print(tokenizer_second.tokenize(text))
```
The output on my machine ubuntu 18.04, transformers 2.3.0 installed just now from the repo:
```
['Hello', 'there', '!']
['hello', 'there', '!']
['hello', 'there', '!']
```


Steps to reproduce the behavior:
Execute code snippet from above.

## Expected behavior
Expected output:
```
['Hello', 'there', '!']
['hello', 'there', '!']
['Hello', 'there', '!']
```
## Environment

* OS: ubuntu 18.04
* Python version: Python 3.7.3
* PyTorch version:  1.2.0
* `transformers` version (or branch): 2.3.0 just installed from master



Comments:
Just to be clear: I understand that specifying `do_lower_case=True` for a cased model is wrong. The point is in overwriting or somewhat caching the parameter for future calls of the class constructor.

Here is the full output with logger.
```
I0129 23:25:47.064881 140331667420992 file_utils.py:38] PyTorch version 1.2.0 available.
I0129 23:25:48.127733 140331667420992 file_utils.py:54] TensorFlow version 2.0.0-rc1 available.
I0129 23:25:48.948472 140331667420992 configuration_utils.py:253] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-config.json from cache at /home/hawkeoni/.cache/torch/transformers/b945b69218e98b3e2c95acf911789741307dec43c698d35fad11c1ae28bda352.d7a3af18ce3a2ab7c0f48f04dc8daff45ed9a3ed333b9e9a79d012a0dedf87a6
I0129 23:25:48.949648 140331667420992 configuration_utils.py:289] Model config BertConfig {
  "attention_probs_dropout_prob": 0.1,
  "bos_token_id": 0,
  "do_sample": false,
  "eos_token_ids": 0,
  "finetuning_task": null,
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.1,
  "hidden_size": 768,
  "id2label": {
    "0": "LABEL_0",
    "1": "LABEL_1"
  },
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "is_decoder": false,
  "label2id": {
    "LABEL_0": 0,
    "LABEL_1": 1
  },
  "layer_norm_eps": 1e-12,
  "length_penalty": 1.0,
  "max_length": 20,
  "max_position_embeddings": 512,
  "model_type": "bert",
  "num_attention_heads": 12,
  "num_beams": 1,
  "num_hidden_layers": 12,
  "num_labels": 2,
  "num_return_sequences": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "output_past": true,
  "pad_token_id": 0,
  "pruned_heads": {},
  "repetition_penalty": 1.0,
  "temperature": 1.0,
  "top_k": 50,
  "top_p": 1.0,
  "torchscript": false,
  "type_vocab_size": 2,
  "use_bfloat16": false,
  "vocab_size": 28996
}

I0129 23:25:49.533885 140331667420992 tokenization_utils.py:418] loading file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-vocab.txt from cache at /home/hawkeoni/.cache/torch/transformers/5e8a2b4893d13790ed4150ca1906be5f7a03d6c4ddf62296c383f6db42814db2.e13dbb970cb325137104fb2e5f36fe865f27746c6b526f6352861b1980eb80b1
['Hello', 'there', '!']
I0129 23:25:50.130188 140331667420992 configuration_utils.py:253] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-config.json from cache at /home/hawkeoni/.cache/torch/transformers/b945b69218e98b3e2c95acf911789741307dec43c698d35fad11c1ae28bda352.d7a3af18ce3a2ab7c0f48f04dc8daff45ed9a3ed333b9e9a79d012a0dedf87a6
I0129 23:25:50.130913 140331667420992 configuration_utils.py:289] Model config BertConfig {
  "attention_probs_dropout_prob": 0.1,
  "bos_token_id": 0,
  "do_sample": false,
  "eos_token_ids": 0,
  "finetuning_task": null,
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.1,
  "hidden_size": 768,
  "id2label": {
    "0": "LABEL_0",
    "1": "LABEL_1"
  },
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "is_decoder": false,
  "label2id": {
    "LABEL_0": 0,
    "LABEL_1": 1
  },
  "layer_norm_eps": 1e-12,
  "length_penalty": 1.0,
  "max_length": 20,
  "max_position_embeddings": 512,
  "model_type": "bert",
  "num_attention_heads": 12,
  "num_beams": 1,
  "num_hidden_layers": 12,
  "num_labels": 2,
  "num_return_sequences": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "output_past": true,
  "pad_token_id": 0,
  "pruned_heads": {},
  "repetition_penalty": 1.0,
  "temperature": 1.0,
  "top_k": 50,
  "top_p": 1.0,
  "torchscript": false,
  "type_vocab_size": 2,
  "use_bfloat16": false,
  "vocab_size": 28996
}

I0129 23:25:50.711892 140331667420992 tokenization_utils.py:418] loading file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-vocab.txt from cache at /home/hawkeoni/.cache/torch/transformers/5e8a2b4893d13790ed4150ca1906be5f7a03d6c4ddf62296c383f6db42814db2.e13dbb970cb325137104fb2e5f36fe865f27746c6b526f6352861b1980eb80b1
['hello', 'there', '!']
I0129 23:25:51.325906 140331667420992 configuration_utils.py:253] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-config.json from cache at /home/hawkeoni/.cache/torch/transformers/b945b69218e98b3e2c95acf911789741307dec43c698d35fad11c1ae28bda352.d7a3af18ce3a2ab7c0f48f04dc8daff45ed9a3ed333b9e9a79d012a0dedf87a6
I0129 23:25:51.326717 140331667420992 configuration_utils.py:289] Model config BertConfig {
  "attention_probs_dropout_prob": 0.1,
  "bos_token_id": 0,
  "do_sample": false,
  "eos_token_ids": 0,
  "finetuning_task": null,
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.1,
  "hidden_size": 768,
  "id2label": {
    "0": "LABEL_0",
    "1": "LABEL_1"
  },
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "is_decoder": false,
  "label2id": {
    "LABEL_0": 0,
    "LABEL_1": 1
  },
  "layer_norm_eps": 1e-12,
  "length_penalty": 1.0,
  "max_length": 20,
  "max_position_embeddings": 512,
  "model_type": "bert",
  "num_attention_heads": 12,
  "num_beams": 1,
  "num_hidden_layers": 12,
  "num_labels": 2,
  "num_return_sequences": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "output_past": true,
  "pad_token_id": 0,
  "pruned_heads": {},
  "repetition_penalty": 1.0,
  "temperature": 1.0,
  "top_k": 50,
  "top_p": 1.0,
  "torchscript": false,
  "type_vocab_size": 2,
  "use_bfloat16": false,
  "vocab_size": 28996
}

I0129 23:25:51.991283 140331667420992 tokenization_utils.py:418] loading file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-vocab.txt from cache at /home/hawkeoni/.cache/torch/transformers/5e8a2b4893d13790ed4150ca1906be5f7a03d6c4ddf62296c383f6db42814db2.e13dbb970cb325137104fb2e5f36fe865f27746c6b526f6352861b1980eb80b1
['hello', 'there', '!']
```

Actually even this code has the same trouble, so the problem is probably not in the creation of a new object.
```python
from transformers import AutoTokenizer


text = "Hello there!"

tokenizer_first = AutoTokenizer.from_pretrained("bert-base-cased")
print(tokenizer_first.tokenize(text))

tokenizer_forced_lowercase = AutoTokenizer.from_pretrained("bert-base-cased", do_lower_case=True)
print(tokenizer_forced_lowercase.tokenize(text))
print(tokenizer_first.tokenize(text))
```
outputs:
```
['Hello', 'there', '!']
['hello', 'there', '!']
['hello', 'there', '!']
```



Indeed, I could reproduce and patch. I'm adding a unit test and will push the fix in a bit.

Should have been patched with 2173490!

Thanks, this seems to resolve the issue.