Type hint complete Albert model file.
Author: karthikrangasai
Pull request: yes

# What does this PR do?
Type hint the Albert Model file for PyTorch Model.
<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Part of #16059 


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR 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.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->
@Rocketknight1 

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

Hi, I'm sorry for the delay with this one! We really appreciate it, and I'm trying to get a chance to look through it all ASAP!

Thanks a lot and I am glad that you liked the work.
More of these will be coming in a few days for other models, so it would be great if I know up to what level of detailing is needed for the Type Annotations.

@karthikrangasai I spoke to the team and the conclusion was that we should just use `Union[AlbertForPreTrainingOutput, Tuple]` - as well as being easier for you, when these type hints are copied into the documentation, it'll be a lot more readable that way.

That said, I respect the dedication and precision that went into making it, so I'm a little sad to see it go.

Hello @Rocketknight1 ,

Sure, no worries.
I can make the changes and update the Pull Request in a while.


Although I am not sure what the reason is for to have return type a Tuple, a suggestion is to maybe remove the return type as  "Tuple" and make it the respective output type for all models. This will have keyword based output values like 
```
output = AlbertModel(**inputs)

output.last_hidden_state
output.pooler_output
```
and this might become a more cleaner API.


Seeing some code quality issues, I'm guessing because we changed our versions for code formatting tools and might need to rebase. Let me check!

It seems like you'll need to pull commits from our repo to the main branch of your repo, then rebase your branch, then force push to update. After that, the files should be updated and the error should go away!

Hello @Rocketknight1, I have updated the PR with the main branch.
All tests are passing.

Great job. Thank you for this PR, it's much appreciated!