Skip to content

Update model card for electra#37063

Merged
stevhliu merged 15 commits intohuggingface:mainfrom
Wu-n0:update-electra-model-card
Apr 3, 2025
Merged

Update model card for electra#37063
stevhliu merged 15 commits intohuggingface:mainfrom
Wu-n0:update-electra-model-card

Conversation

@Wu-n0
Copy link
Copy Markdown
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

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

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
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Copy link
Copy Markdown
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

Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
Comment thread docs/source/en/model_doc/electra.md Outdated
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
Copy link
Copy Markdown

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.

Comment thread docs/source/en/model_doc/electra.md
Copy link
Copy Markdown
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! 👍

Comment thread docs/source/en/model_doc/electra.md Outdated
@Wu-n0 Wu-n0 requested a review from abdulazeem-tk4vr April 3, 2025 04:39
@Wu-n0
Copy link
Copy Markdown
Contributor Author

Wu-n0 commented Apr 3, 2025

I've implemented all the requested changes.

Copy link
Copy Markdown
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>
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 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.

4 participants