Pretrained XLNetTokenizer not returning tokenizer
Author: gauravsharma-97
Pull request: no

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version: 4.4.1
- Platform: Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.10
- PyTorch version (GPU?): 1.8.0+cu101 (False)
- Tensorflow version (GPU?): 2.4.1 (False)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No


### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.-->

@patrickvonplaten 
@LysandreJik 

## Information

I am using XLNet Tokenizer. When trying to use `XLNetTokenizer.from_pretrained()`, `None` object is returned. 
I last worked with it in december and it was working fine till then.

## To reproduce

Steps to reproduce the behavior:

```
from transformers import XLNetTokenizer

tokenizer = XLNetTokenizer.from_pretrained("xlnet-base-cased")

print(tokenizer)
```

 Output is `None`

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

A tokenizer should be returned instead of `None`.
<!-- A clear and concise description of what you would expect to happen. -->


Comments:
Hello! This is weird, you should be gotten an error before even being able to instantiate the tokenizer with `from_pretrained`. Such an error:
```
ImportError: 
XLNetTokenizer requires the SentencePiece library but it was not found in your environment. Checkout the instructions on the
installation page of its repo: https://github.com/google/sentencepiece#installation and follow the ones
that match your environment.
```

Could you install SentencePiece `pip install sentencepiece` and let me know if it fixes your issue?

Hi! I had actually did the `pip install sentencepiece`. I was getting `None` after it.

I saw the source code and the embedding size used was `None` there. You can check it <a href="https://github.com/gauravsharma-97/transformers/blob/master/src/transformers/models/xlnet/tokenization_xlnet.py#L41-L44">here</a>. I think that is the issue and it should be some integer like BertTokenizer uses 512 as embedding size.

I may be wrong, but I think this can happen if you're in a colab environment and you install SentencePiece, but don't reload the kernel before re-running your cell. 

You say you're on Ubuntu, I managed to obtain a similar result by re-running the code you mentioned twice in the same Python runtime, by installing `sentencepiece` between the two code statements. Since sentencepiece is loaded on the fly, this can be the result.

I stand by what I say that this is due to `sentencepiece` not being installed. If it's correctly installed in your environment, running your statement results in:
```
PreTrainedTokenizer(name_or_path='xlnet-base-cased', vocab_size=32000, model_max_len=1000000000000000019884624838656, is_fast=False, padding_side='left', special_tokens={'bos_token': '
', 'eos_token': '
', 'unk_token': '<unk>', 'sep_token': '<sep>', 'pad_token': '<pad>', 'cls_token': '<cls>', 'mask_token': AddedToken("<mask>", rstrip=False, lstrip=True, single_word=False, normalized=True), 'additional_special_tokens': ['<eop>', '<eod>']})
``` 

You're mentioning the embedding size which is `None`, this is on purpose. The XLNet model uses relative positional embeddings, and has therefore no limitations on the size of the input (note the `model_max_len` in the above code statement); which isn't the case for BERT, that uses absolute positional embeddings which are limited to 512.

Yes you are correct. I was running this on colab and it might have required reloading the kernel. But funnily enough, its working today without reloading it.

Yesterday might have been an isolated incident, although I did try to get it to run for very long before posting the issue.

Anyway, thanks for the help @LysandreJik and for the explanation on embeddings.