Skip to content

Conversation

@eljandoubi
Copy link
Contributor

@eljandoubi eljandoubi commented Apr 2, 2025

What does this PR do?

  • Add classifier head to Donut
  • Add image classifier loss to LOSS_MAPPING
  • Update classifier loss for all swin models

Models:

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2025

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@github-actions github-actions bot marked this pull request as draft April 2, 2025 22:47
@eljandoubi eljandoubi marked this pull request as ready for review April 3, 2025 06:29
@github-actions github-actions bot requested review from ydshieh and zucchini-nlp April 3, 2025 06:29
_EXPECTED_OUTPUT_SHAPE = [1, 49, 768]

# Image classification docstring
_IMAGE_CLASS_CHECKPOINT = "eljandoubi/donut-base-encoder"
Copy link
Member

Choose a reason for hiding this comment

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

is this a checkpoint trained for classification or base model ckpt?

Copy link
Contributor Author

@eljandoubi eljandoubi Apr 3, 2025

Choose a reason for hiding this comment

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

Traind base model with randomly initialized head. It is meant for further fine tuning.

@eljandoubi eljandoubi changed the title Add image classifier donut Add image classifier donut & update loss calculation for all swins Apr 3, 2025
Copy link
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me! Requesting review from core maintainer

@eljandoubi
Copy link
Contributor Author

eljandoubi commented Apr 8, 2025

@zucchini-nlp @ArthurZucker @ydshieh any feedback?

@zucchini-nlp
Copy link
Member

sorry, let's merge it. Doesn't touch much core code, should be good to go

@zucchini-nlp zucchini-nlp merged commit 7ecc5b8 into huggingface:main Apr 10, 2025
18 checks passed
cyr0930 pushed a commit to cyr0930/transformers that referenced this pull request Apr 18, 2025
…uggingface#37224)

* add classifier head to donut

* add to transformers __init__

* add to auto model

* fix typo

* add loss for image classification

* add checkpoint

* remove no needed import

* reoder import

* format

* consistency

* add test of classifier

* add doc

* try ignore

* update loss for all swin models
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
…uggingface#37224)

* add classifier head to donut

* add to transformers __init__

* add to auto model

* fix typo

* add loss for image classification

* add checkpoint

* remove no needed import

* reoder import

* format

* consistency

* add test of classifier

* add doc

* try ignore

* update loss for all swin models
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.

2 participants