Fix GPT2 crash on special quotes in Python 3
In Python 3 the line
https://github.com/huggingface/pytorch-pretrained-BERT/blob/b832d5bb8a6dfc5965015b828e577677eace601e/pytorch_pretrained_bert/tokenization_gpt2.py#L224
splits `token` into full characters, not UTF-8 bytes, so for example the right single quote ’ gives `ord('’') == 8217`. That causes a crash since it's a much larger key than any in `self.byte_encoder`. The official GPT2 repo uses `token.encode('utf-8')` but it doesn't work the same in Python 2. I've suggested a fix that uses `token.encode` only in Python 3.

Tested on Python 3.7 but not Python 2.

Thanks for this very useful repo!
Thanks, this is closed now with #564