Squad2 processor error
Author: flozi00
Pull request: no

# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...):

Language I am using the model on (English, Chinese ...):

The problem arises when using:
* [x] the official example scripts: (give details below)
question answering
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [x] an official GLUE/SQUaD task: (give the name)
squadv2
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

1. install the branch by @patrickvonplaten which adds the reformer for QA in #5433 
2. run the examples script with squadv2 option enabled and squadv2 dataset, downloaded from official website

<!-- 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.-->

<pre><code>
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/a-ware/anaconda3/envs/transformers/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/a-ware/anaconda3/envs/transformers/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/a-ware/anaconda3/envs/transformers/lib/python3.8/site-packages/transformers/data/processors/squad.py", line 199, in squad_convert_example_to_features
    cls_index = span["input_ids"].index(tokenizer.cls_token_id)
ValueError: None is not in list
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run_squad.py", line 821, in <module>
    main()
  File "run_squad.py", line 763, in main
    train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False, output_examples=False)
  File "run_squad.py", line 449, in load_and_cache_examples
    features, dataset = squad_convert_examples_to_features(
  File "/home/a-ware/anaconda3/envs/transformers/lib/python3.8/site-packages/transformers/data/processors/squad.py", line 330, in squad_convert_examples_to_features
    features = list(
  File "/home/a-ware/.local/lib/python3.8/site-packages/tqdm/std.py", line 1129, in __iter__
    for obj in iterable:
  File "/home/a-ware/anaconda3/envs/transformers/lib/python3.8/multiprocessing/pool.py", line 420, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/home/a-ware/anaconda3/envs/transformers/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
ValueError: None is not in list
</code></pre>



## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->

## 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:
- Platform: linux
- Python version: 3.8
- PyTorch version (GPU?): 1.4
- Tensorflow version (GPU?):
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: no


Comments:
You have to add a "[CLS]" token to Reformer tokenizer here to make the script work. The one tokenizer that is online for reformer: `tok = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")` does not have a CLS token. If you add a new token via:

`tok.add_special_tokens` 

then you will also have to add a new weight to the word embedding of the models. 
Alternatively, you could also just set the cls token to some other token that exists

```python
tok.cls_token = tok.eos_token
```

But overall - not sure at all whether fine-tuning the few pretrained reformer models that we have will work well for QA.

Thanks a lot, I forgot to check the tokens.
I will train an QA model for testing purposes only.
If it's working correctly within my application I will train an MLM model on pg-19 dataset

The cls_eos token does not exist too
Now the error message is "ValueError: 2 is not in list"
Do you know which token exists ?

not really sure what you mean by `cls_eos token`. 
If you use this  tokenizer: `tok = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")`, 
a simple hack to make the tokenizer work is for example to set its <PAD> token as its <CLS> token:
```python
tok = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
tok.cls_token = tok.pad_token

# => now use this tokenizer in your script.
```

Ups, sorry
I meant
<code>tok.cls_token = tok.eos_token</code>
was just in different things with my brain thinking and my hands typing 

Edit:
It`s working now, let`s see which results we get

Are you fine-tuning the reformer-crime-and-punish model? Would be very surprised if this gives good results :D But very keen for updates :-) 

At the moment I am playing with the hyperparameters.
Of course, I will share my results with you.
But before I need to get the trio of my dataset, the nlp library and the trainingsscript work :D

I'm trying fine-tuning Reformer on Squad2 dataset from pre-trained model "google/crime-and-punishment". 
Using tok.cls_token = tok.pad_token, I have the following error:  
![image](https://user-images.githubusercontent.com/75449189/196391419-7387c255-cc07-4f81-975d-da544fef95c4.png)
So I add tok.pad_token = tok.eos_token, but I have a new error: 2 is not in list.
can someone help me? Thank you


@FrancescoTroiano 
Hi, have you fixed the issue?
I have a same problem here 
I add 
```
tokenizer.cls_token = tokenizer.pad_token
```
but got ValueError: 50257 is not in list