Add PVT(Pyramid Vision Transformer)
Author: Xrenya
Pull request: yes

# Add PVT(Pyramid Vision Transformer)


Partially fixes: [issue](https://github.com/huggingface/transformers/issues/17596)
Currently, the classification model is added, later it should be extended with Detection and Segmentation models. 

## 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?
- [ ] 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.
- [x] 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).
- [x] Did you write any new necessary tests?


## Who can review?

@amyeroberts

Comments:
Hi @Xrenya - thanks for opening this PR.

It seems there is an issue with your CircleCI permissions as the tests won’t run.
Could you try refreshing your permissions as shown [here](https://support.circleci.com/hc/en-us/articles/360048210711-How-to-Refresh-User-Permissions-)?

Excited to see this model implemented and to be added to the library! 

@amyeroberts 
Thank you, I have updated the permission, could you please rerun workflow to verify whether it is working?

@Xrenya I don't think I can re-run as it's triggered based on the permissions on your end. At least, when I go onto circleci any options to re-run are not available. 

Could you try pushing an empty commit using: `git commit -m "Trigger CI" --allow-empty` to see if the updates have worked? 

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

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

@amyeroberts Indeed, I had to trigger it, I think this part is ready, but it looks like circleci is stuck even after reopening the PR.

@Xrenya - yes, that's funny 🤔 . If I search on circleCI, I can't see any runs associated with this PR. I'll review and then we can address this again if it's still not running after any code updates. 



@amyeroberts I think I have updated everything

@Xrenya - thanks for the update! 

Two quick things before I do a full review: 
* I can see the models still have `PVT` as a prefix. We know use camel-case for our models, and so the prefix should be updated to `Pvt` everywhere e.g. `PvtImageProcessor`
* Unfortunately the commits still haven't triggered the test suite. Could you rebase on main and retry refreshing your CircleCI permissions again? If this still doesn't work, I'll do some more digging. 

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

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

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_22445). All of your documentation changes will be reflected on that endpoint.

@Xrenya - great to see Circle CI is now behaving itself :) Before I review again, could you make sure all of the tests are passing? Let me know if you have any questions about getting them to run and pass. 

@amyeroberts I have passed tests, except flax one, but the problem not with my model: 
`FAILED tests/models/big_bird/test_modeling_flax_big_bird.py::FlaxBigBirdModelTest::test_checkpoint_sharding_from_hub`
Should I fixed the issue?

@Xrenya No, that test must be flaky and isn't your responsibility to fix, we can ignore it for this PR 👍 

@Xrenya - I can still see some unresolved commented from my last review. Could you either make the suggested change or comment on the suggestion, explaining why you aren't.  Once these are all resolved I'll review again. 

@Xrenya There's still several comments which haven't been addressed e.g. [this one](https://github.com/huggingface/transformers/pull/22445/files#r1156236335) or [this one](https://github.com/huggingface/transformers/pull/22445/files/#r1157356696). For suggestions that have been applied, could you mark the comments as resolved? It will make it easier to track the changes in the PR. 

@amyeroberts put model checkpoint under the model's organisation and push changes

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.