t5 mlm train example, label generation
Author: GabPrato
Pull request: no

### System Info

- `transformers` version: 4.26.1
- Platform: Linux-5.13.0-37-generic-x86_64-with-glibc2.31
- Python version: 3.9.12
- Huggingface_hub version: 0.12.1

### Who can help?

@sanchit-gandhi @sgugger @stevhliu @MKhalusova 

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

In the [T5 doc](https://huggingface.co/docs/transformers/v4.27.1/en/model_doc/t5#training), there is the following example describing the input_ids and labels format to train a T5 model:
```python
from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids
labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="pt").input_ids

# the forward function automatically creates the correct decoder_input_ids
loss = model(input_ids=input_ids, labels=labels).loss
loss.item()
```
And right after this piece of code, the following:
> If you’re interested in pre-training T5 on a new corpus, check out the [run_t5_mlm_flax.py](https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling) script in the Examples directory.

So I looked at the example code on line [330](https://github.com/huggingface/transformers/blob/60d51ef5123d949fd8c59cd4d3254e711541d278/examples/flax/language-modeling/run_t5_mlm_flax.py#L330) of that file, but the behavior is different than what is written in the doc. Indeed, the `batch["labels"]` has a different format. If for example the input string is `"Hello world."`, `batch["input_ids"]` is set to `"Hello world<extra_id_0>"` and `batch["labels"]` is set to `"<extra_id_-2><extra_id_-3><extra_id_-6>"`. According to the doc, shouldn't `batch["labels"]` be `"<extra_id_0> . <extra_id_1>"`?

To reproduce, you can simply reuse the following 3 functions: `random_spans_noise_mask`, `create_sentinel_ids` and `filter_input_ids` that are right below the `__call__` function on line 330:
```python
import numpy as np
from transformers import T5Tokenizer
tokenizer = T5Tokenizer.from_pretrained('t5-small')

tokenized_sample = tokenizer("Hello world.", add_special_tokens=False, return_tensors='pt').input_ids # we don't want 

mask = random_spans_noise_mask(tokenized_sample.shape[1])
input_ids_sentinel = create_sentinel_ids(mask[None, :].astype(np.int8))
labels_sentinel = create_sentinel_ids(~mask[None, :].astype(np.int8))
input_ids = filter_input_ids(tokenized_sample, input_ids_sentinel)
labels = filter_input_ids(tokenized_sample, labels_sentinel)
print(tokenizer.batch_decode(input_ids, skip_special_tokens=False)[0])
print(tokenizer.batch_decode(labels, skip_special_tokens=False)[0])
```
This of code of course follows the same structure as the example on line 330.

### Expected behavior

Just wondering if the described behavior in the `run_t5_mlm_flax.py` script is intended or not, since the doc describes a different behavior. It is confusing as the doc refers to this example, but the behaviors are different. Thanks.

Comments:
Issue was on my side, `~mask[None, :].astype(np.int8)` should be `(~mask[None, :]).astype(np.int8)`.

But the resulting labels are still missing the extra id at the end, `batch["labels"]` will be equal to `"<extra_id_0> ."` instead of `"<extra_id_0> . <extra_id_1>"` and there are also no checks for if the number of sentinel tokens used is greater than the number of available sentinel tokens. Default is max 100 sentinel tokens if using pretrained T5 models.