Can't get GPT2tokenizer to load correctly
Author: buttchurch
Pull request: no

## ❓ Questions & Help

Hi, I'm a fairly new coder and I'm hitting a roadblock that I just don't understand – maybe someone here can help me, but I figure it's worth asking the community.

I'm trying to run run_lm_finetuning.py, and the tokenizer doesn't seem to be loading correctly. I'm getting this error: `AttributeError: 'GPT2Tokenizer' object has no attribute 'max_len_single_sentence'`

I've looked at the code, and there clearly is a `max_len_single_sentence` attribute in the init, but I can't get to it. I've even tried simply loading a GPT2-tokenizer into a jupyter notebook and trying to get the value, and it has the same error.

I assume I've done something wrong, I just can't figure out what. In case it helps, I've put my entire traceback below.

Any ideas? Thanks!

```
python examples/run_lm_finetuning.py --train_data_file='HFlongs1000.txt' --output_dir='pytorch-transformers/HFOutput' --model_type='gpt2' --tokenizer_name='gpt2' --model_name_or_path='gpt2'
09/01/2019 06:44:36 - WARNING - __main__ -   Process rank: -1, device: cuda, n_gpu: 1, distributed training: False, 16-bits training: False
09/01/2019 06:44:36 - INFO - pytorch_transformers.modeling_utils -   loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json from cache at /home/jupyter/.cache/torch/pytorch_transformers/4be02c5697d91738003fb1685c9872f284166aa32e061576bbe6aaeb95649fcf.085d5f6a8e7812ea05ff0e6ed0645ab2e75d80387ad55c1ad9806ee70d272f80
09/01/2019 06:44:36 - INFO - pytorch_transformers.modeling_utils -   Model config {
  "attn_pdrop": 0.1,
  "embd_pdrop": 0.1,
  "finetuning_task": null,
  "initializer_range": 0.02,
  "layer_norm_epsilon": 1e-05,
  "n_ctx": 1024,
  "n_embd": 768,
  "n_head": 12,
  "n_layer": 12,
  "n_positions": 1024,
  "num_labels": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "resid_pdrop": 0.1,
  "summary_activation": null,
  "summary_first_dropout": 0.1,
  "summary_proj_to_labels": true,
  "summary_type": "cls_index",
  "summary_use_proj": true,
  "torchscript": false,
  "vocab_size": 50257
}

09/01/2019 06:44:36 - INFO - pytorch_transformers.tokenization_utils -   loading file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-vocab.json from cache at /home/jupyter/.cache/torch/pytorch_transformers/f2808208f9bec2320371a9f5f891c184ae0b674ef866b79c58177067d15732dd.1512018be4ba4e8726e41b9145129dc30651ea4fec86aa61f4b9f40bf94eac71
09/01/2019 06:44:36 - INFO - pytorch_transformers.tokenization_utils -   loading file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-merges.txt from cache at /home/jupyter/.cache/torch/pytorch_transformers/d629f792e430b3c76a1291bb2766b0a047e36fae0588f9dbc1ae51decdff691b.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda
Traceback (most recent call last):
  File "examples/run_lm_finetuning.py", line 497, in <module>
    main()
  File "examples/run_lm_finetuning.py", line 431, in main
    args.block_size = tokenizer.max_len_single_sentence  # Our input block size will be the max possible for the model
AttributeError: 'GPT2Tokenizer' object has no attribute 'max_len_single_sentence'```

Comments:
Hello! The `GPT2Tokenizer` attribute `max_len_single_sentence` is a very new attribute. If you have installed the library prior to [this commit](https://github.com/huggingface/pytorch-transformers/commit/3bcbebd440c220adbaab657f2d13dac7c89f6453#diff-b1c89c3ce1d15ed636ed89d250f8f26a), 9 days ago, then you indeed won't be able to access it.

You won't be able to access it either if you have installed it via pypi, as the last release was 1.1.0 and it was  before that commit. We'll be releasing v1.2.0 very soon, with this addition! Until then, you can [install it from source](https://github.com/huggingface/pytorch-transformers#from-source) if you want to latest additions.

Thanks very much! That all makes sense :)