Doctest longformer
# What does this PR do?

adds LONGFORMER PT to doctests

@patrickvonplaten - `LongformerForMaskedLM` and `LongformerForQuestionAnswering` have `@replace_return_docstrings `instead of `@add_code_sample_docstrings`. Should I be replacing them with that instead so that I can test for `expected_output` & `expected_loss`?

_The documentation is not available anymore as the PR was closed or merged._<|||||>Hey @KMFODA, thanks for your PR! Could you rebase/merge on `main` so that the CI passes? Thank you!<|||||>apologies @LysandreJik, had merged with master not main. Fixed now :).<|||||>@KMFODA would it be ok if we go into the PR to finish it in case you don't have enough time? :-)<|||||>hey @patrickvonplaten, apologies for the delay. I've managed to work on the proposed changes. Let me know if anything else is missing?<|||||>Great! Looks good to me actually :-) @ydshieh could you take a look maybe?<|||||>@patrickvonplaten  could you also check if my comment about `randomly initialized` is valid, please? I haven't run the examples myself though. I can double check tomorrow.

**Update**: I ran it, and the 2 tests failed as I think. Depending on @KMFODA, maybe we can merge this  PR with only the PT file (and we work on TF part internally)? To address this situation, either a conversion of PT -> TF checkpoint, or using a tiny model checkpoint is required.<|||||>@KMFODA 

If you are willing to deal with the TensorFlow version , could you try to use the TF checkpoint [hf-internal-testing/tiny-random-longformer](hf-internal-testing/tiny-random-longformer) for `TFLongformerForSequenceClassification` and `TFLongformerForTokenClassification`.

Otherwise, it's totally OK that we revert the changes in `src/transformers/models/longformer/modeling_tf_longformer.py` + remove `src/transformers/models/longformer/modeling_tf_longformer.py` from `utils/documentation_tests.txt`, and we can merge this PR :-). Thank you!<|||||>hey @ydshieh thanks for the comments. Yes sure I just switched those 3 checkpoints now. I'm having issues with TF and my new M1 Mac so I can't test these now unfortunately. Thought I'd just commit these changes now in case you're in a rush but will try and test these changes soon as I get my TF library working.<|||||>Hi, @KMFODA , no rush on our side :-). But if you have trouble with TF on Mac, we can run it and update the expect values, just let us know. Thank you!<|||||>No problem at all. Thanks for all the helpful comments. Changes made :).<|||||>Thanks a mille for all your work here @KMFODA !