Fix Bart type hints
# What does this PR do?

This PR adds type-hints to PLBart PyTorch.

A few queries:
1. What about the configuration files? Do they not need type-hinting?
2. I understand someone is working on the BART model: https://github.com/huggingface/transformers/pull/16270/files. There are some copies on there, can I wait for that PR to be merged and see if there are any fixes needed after doing `make fixup` from their PR?

@Rocketknight1
Hi @gchhablani that is correct. We have just merged the BART PR, which has overwritten parts of `modeling_plbart.py`. Please check if any further changes are needed to `modeling_plbart.py` - if they are, you can either submit a new PR for them, or rebase this PR onto the updated main/master branch.<|||||>But also, thanks for doing this - your PR looks very solid otherwise! <|||||>@Rocketknight1 I have tried to make things a bit more consistent with Bart.
For example:
1. One place was using `torch.FloatTensor` for `encoder_attention_mask`, which should be `torch.LongTensor`.
2. Another discrepancy was that `encoder_hidden_states` were `FloatTensor` in one place, while `Tensor` in another.
3. `input_ids` are actually optional because we can also pass `input_embeds` but it was not present.
4. `past_key_values` was `List[torch.Tensor]` in some places, while `Tuple[torch.Tensor]` in some. Not 100% sure which is correct. I used `List` for now.

PLBart has some additional changes, which may be included. Wdyt?<|||||>_The documentation is not available anymore as the PR was closed or merged._<|||||>Hi @gchhablani I think this PR is quite difficult to review right now because of all the changes! If possible, could you close this PR, make sure your local repo is updated to the latest changes, then make a new branch and make the plBART PR there? I think if you do that, and only add annotations to the methods that are missing them, then we shouldn't have the problem of multiple affected files.

Thanks, and I'm sorry for the confusion here!<|||||>Hi @Rocketknight1!

Sure!
What about the issues with BART?

I think the changes in BART and PLBart are the only ones that need reviewing. Wdyt?<|||||>I think it's fine to focus on plBART for this PR. The issues with BART aren't serious, and if we decide to be consistent with `Tuple` or `List` across the whole repo, we can do that with a simple find-replace. So in your plBART PR, don't worry about making changes that will also require changes to BART - just annotate missing types for methods that don't have any yet, and that's perfect!<|||||>@Rocketknight1 Can you please review it now?
Thanks!<|||||>Looks great to me, thanks for the PR!