Override _pad in LEDTokenizer to deal with global_attention_mask
Author: ydshieh
Pull request: yes

# What does this PR do?

Fix #14648. This PR allows `LEDTokenizer._pad` to treat `global_attention_mask` if it is provided in `encoded_inputs`.

Without this,  `global_attention_mask` won't be padded, while other tensors will be padded (if users specify padding), and causes the following error (if `return_tensors` is specified)

```
ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length.
```

## More context


Basically, this PR copies the method `_pad` defined in `https://github.com/huggingface/transformers/blob/e3645fd2806b1e0b9daec89a72e316b71be8609c/src/transformers/tokenization_utils_base.py#L3159` to `tokenization_led.py` and tokenization_led_fast.py, and added the following block to deal with `global_attention_mask`:

https://github.com/huggingface/transformers/blob/df6b574ae2b12a71548cf06c7789b3f2fc60571d/src/transformers/models/led/tokenization_led.py#L113-L116

https://github.com/huggingface/transformers/blob/df6b574ae2b12a71548cf06c7789b3f2fc60571d/src/transformers/models/led/tokenization_led.py#L127-L130

## The effect

See [this comment](https://github.com/huggingface/transformers/pull/15940#issuecomment-1066113823) 

Comments:
_The documentation is not available anymore as the PR was closed or merged._

## Results before/after this PR

```python
import numpy as np
from transformers import LEDTokenizer, LEDTokenizerFast

tokenizer_slow = LEDTokenizer.from_pretrained("allenai/led-base-16384")
tokenizer_fast = LEDTokenizerFast.from_pretrained("allenai/led-base-16384")

text_1 = "I love dogs"
text_2 = "I love dogs and cats"
texts = [text_1, text_2]

model_inputs_slow = tokenizer_slow(texts, max_length=tokenizer_slow.model_max_length, padding=False, truncation=True)
model_inputs_fast = tokenizer_fast(texts, max_length=tokenizer_fast.model_max_length, padding=False, truncation=True)

model_inputs_slow["global_attention_mask"] = [np.zeros_like(input).tolist() for input in model_inputs_slow["input_ids"]]
model_inputs_fast["global_attention_mask"] = [np.zeros_like(input).tolist() for input in model_inputs_fast["input_ids"]]

# put global attention on 
 token
for input in model_inputs_slow["global_attention_mask"][:]:
    input[0] = 1
for input in model_inputs_fast["global_attention_mask"][:]:
    input[0] = 1

print("`model_inputs` without padding (slow tokenizer)")
print(model_inputs_slow)
print("`model_inputs` without padding (fast tokenizer)")
print(model_inputs_fast)

model_inputs_slow = tokenizer_slow.pad(
    model_inputs_slow,
    padding=True,
    max_length=tokenizer_slow.model_max_length,
)

model_inputs_fast = tokenizer_fast.pad(
    model_inputs_fast,
    padding=True,
    max_length=tokenizer_slow.model_max_length,
)

print("=" * 30)
print("`model_inputs` with padding (slow tokenizer)")
print(model_inputs_slow)
print("`model_inputs` with padding (fast tokenizer)")
print(model_inputs_fast)
```

## Outputs before this PR

(note that `global_attention_mask` is not padded)

```python

`model_inputs` without padding (slow tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]]}

`model_inputs` without padding (fast tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]]}

==============================

`model_inputs` with padding (slow tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2, 1, 1], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]]}

`model_inputs` with padding (fast tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2, 1, 1], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]]}

```

## Outputs with this PR

```python

`model_inputs` without padding (slow tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]]}

`model_inputs` without padding (fast tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]]}

==============================

`model_inputs` with padding (slow tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2, 1, 1], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0, -1, -1], [1, 0, 0, 0, 0, 0, 0]]}

`model_inputs` with padding (fast tokenizer)
{'input_ids': [[0, 100, 657, 3678, 2, 1, 1], [0, 100, 657, 3678, 8, 10017, 2]], 'attention_mask': [[1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1]], 'global_attention_mask': [[1, 0, 0, 0, 0, -1, -1], [1, 0, 0, 0, 0, 0, 0]]}

```


- Call `super()._pad` then dealing with `global_attention_mask` (cc @sgugger )
- Add a comment about using `-1` instead of `0`.

Would wait a bit for @sgugger to check the part regarding `calling the super method` before merge.