Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ViT, BEiT, DeiT, DPT] Improve code #16799

Merged
merged 5 commits into from Apr 18, 2022
Merged

Conversation

NielsRogge
Copy link
Contributor

@NielsRogge NielsRogge commented Apr 15, 2022

What does this PR do?

This PR cleans up some code of ViT, BEiT, DeiT and DPT.

Most importantly, it corrects the tuple outputs, in case no pooler was added (as shown by #16760).

Next to that, it cleans up the tests, by

  • removing to_2tuple, and instead leveraging an expected_seq_len attribute of the ModelTester
  • removing chunk_length and is_encoder_decoder statements, which don't apply for these encoder-only models.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 15, 2022

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

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@NielsRogge NielsRogge changed the title [ViT, BEiT, DeiT] Improve code [ViT, BEiT, DeiT, DPT] Improve code Apr 15, 2022
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @NielsRogge!

@LysandreJik LysandreJik merged commit d3c9d0e into huggingface:main Apr 18, 2022
elusenji pushed a commit to elusenji/transformers that referenced this pull request Jun 12, 2022
* Improve code

* Fix bugs

* Fix another bug

* Clean up DTP as well

* Update DPT model outputs

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants