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

Update model card for electra #37063

Merged
merged 15 commits into from
Apr 3, 2025

Conversation

Wu-n0
Copy link
Contributor

@Wu-n0 Wu-n0 commented Mar 28, 2025

What does this PR do?

This PR updates the ELECTRA model card to follow the standardized format outlined in issue #36979. The updated model card includes:

  • A conversational description of how ELECTRA works and what makes it unique
  • Code examples for using ELECTRA with both Pipeline and AutoModel
  • A quantization example for the large model
  • Detailed usage notes with practical tips

Note: I did not include a transformers-cli example because ELECTRA is a discriminative model for classification tasks rather than text generation, making it less suitable for CLI interaction.

I also couldn't include an AttentionMaskVisualizer example because it's not currently supported with ELECTRA. When attempting to implement it locally, I encountered this error:
AttributeError: '_ModelWrapper' object has no attribute '_update_causal_mask'

Before submitting

  • This PR fixes a typo or improves the docs

Who can review?

@stevhliu

Sorry, something went wrong.

@github-actions github-actions bot marked this pull request as draft March 28, 2025 04:34
Copy link

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.

@Wu-n0 Wu-n0 marked this pull request as ready for review March 28, 2025 04:43
@github-actions github-actions bot requested a review from stevhliu March 28, 2025 04:43
@Wu-n0 Wu-n0 force-pushed the update-electra-model-card branch from 8d3caff to fec39c0 Compare March 28, 2025 22:56
Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Nice work, love the Notes section! 🚀 No worries about the AttentionMaskVisualizer which hasn't been implemented for ELECTRA yet.

I think you can include a transformers-cli example for text classification:

echo -e "This restaurant has amazing food." | transformers-cli run --task text-classification --model bhadresh-savani/electra-base-emotion --device 0

Wu-n0 and others added 8 commits March 30, 2025 04:20
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

One more comment + a few other unresolved comments. Otherwise, we should be ready to merge soon! 👍

@Wu-n0 Wu-n0 requested a review from abdulazeem-tk4vr April 3, 2025 04:39
@Wu-n0
Copy link
Contributor Author

Wu-n0 commented Apr 3, 2025

I've implemented all the requested changes.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks! I hope you don't mind I closed one of the <hfoption> blocks for you 😄

@stevhliu stevhliu merged commit 8dd0a2b into huggingface:main Apr 3, 2025
10 checks passed
@Wu-n0 Wu-n0 deleted the update-electra-model-card branch April 3, 2025 20:59
yuchenxie4645 pushed a commit to yuchenxie4645/transformers that referenced this pull request Apr 5, 2025
* Update ELECTRA model card with new format

* Update ELECTRA model card with new format

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/model_doc/electra.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* close hfoption block

---------

Co-authored-by: Wun0 <f20191221@hyderabad.bits-pilani.ac.in>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
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