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

[Community contributions] Model cards #36979

Open
stevhliu opened this issue Mar 25, 2025 · 42 comments · Fixed by #37052, #37076, #37156, #37184 or #37261
Open

[Community contributions] Model cards #36979

stevhliu opened this issue Mar 25, 2025 · 42 comments · Fixed by #37052, #37076, #37156, #37184 or #37261

Comments

@stevhliu
Copy link
Member

stevhliu commented Mar 25, 2025

Hey friends! 👋

We are currently in the process of improving the Transformers model cards by making them more directly useful for everyone. The main goal is to:

  1. Standardize all model cards with a consistent format so users know what to expect when moving between different model cards or trying to learn how to use a new model.
  2. Include a brief description of the model (what makes it unique/different) written in a way that's accessible to everyone.
  3. Provide ready to use code examples featuring the Pipeline, AutoModel, and transformers-cli with available optimizations included. For large models, provide a quantization example so its easier for everyone to run the model.
  4. Include an attention mask visualizer for currently supported models to help users visualize what a model is seeing (refer to Add attention visualization tool  #36630) for more details.

Compare the before and after model cards below:

Image

With so many models in Transformers, we could really use some a hand with standardizing the existing model cards. If you're interested in making a contribution, pick a model from the list below and then you can get started!

Steps

Each model card should follow the format below. You can copy the text exactly as it is!

# add appropriate badges
<div style="float: right;">
    <div class="flex flex-wrap space-x-1">
           <img alt="" src="" >
    </div>
</div>

# Model name

[Model name](https://huggingface.co/papers/...) ...

A brief description of the model and what makes it unique/different. Try to write this like you're talking to a friend. 

You can find all the original [Model name] checkpoints under the [Model name](link) collection.

> [!TIP]
> Click on the [Model name] models in the right sidebar for more examples of how to apply [Model name] to different [insert task types here] tasks.

The example below demonstrates how to generate text based on an image with [`Pipeline`] or the [`AutoModel`] class.

<hfoptions id="usage">
<hfoption id="Pipeline>

insert pipeline code here

</hfoption>
<hfoption id="AutoModel">

add AutoModel code here

</hfoption>
<hfoption id="transformers-cli">

add transformers-cli usage here if applicable/supported, otherwise close the hfoption block

</hfoption>
</hfoptions

Quantization reduces the memory burden of large models by representing the weights in a lower precision. Refer to the [Quantization](../quantization/overview) overview for more available quantization backends.

The example below uses [insert quantization method here](link to quantization method) to only quantize the weights to __.

# add if this is supported for your model
Use the [AttentionMaskVisualizer](https://github.com/huggingface/transformers/blob/beb9b5b02246b9b7ee81ddf938f93f44cfeaad19/src/transformers/utils/attention_visualizer.py#L139) to better understand what tokens the model can and cannot attend to.

\```py
from transformers.utils.attention_visualizer import AttentionMaskVisualizer

visualizer = AttentionMaskVisualizer("google/gemma-3-4b-it")
visualizer("<img>What is shown in this image?")
\```

# upload image to https://huggingface.co/datasets/huggingface/documentation-images/tree/main/transformers/model_doc and ping me to merge
<div class="flex justify-center">
    <img src=""/>
</div>

## Notes

- Any other model-specific notes should go here.

   \```py
    <insert relevant code snippet here related to the note if its available>
   \ ```

For examples, take a look at #36469 or the BERT, Llama, Llama 2, Gemma 3, PaliGemma, ViT, and Whisper model cards on the main version of the docs.

Once you're done or if you have any questions, feel free to ping @stevhliu to review. Don't add fix to your PR to avoid closing this issue.

I'll also be right there working alongside you and opening PRs to convert the model cards so we can complete this faster together! 🤗

Models

@devesh-2002
Copy link
Contributor

Hi. I would like to work on model card for gemma 2.

@NahieliV
Copy link
Contributor

Hi. I would like to work on model card for mistral.

@NahieliV
Copy link
Contributor

Hi @stevhliu , this is my first contribution so I have a really basic question . Should I clone every repo under mistralai? I just cloned the repo mistralai/Ministral-8B-Instruct-2410, but there are many other repos under mistralai. It's ok if I need to, but I just want to be sure.

@capnmav77
Copy link

Hey , I would like to work on the model card for llama3 .

@stevhliu
Copy link
Member Author

Hey @NahieliV, welcome! You only need to modify the mistral.md file. This is just for the model cards in the Transformers docs rather than the Hub.

@arkhamHack
Copy link
Contributor

Hey @stevhliu I would like to work on the model card for qwen2_5_vl.

@hesamsheikh
Copy link

@stevhliu Is it not possible to automate with an LLM?

@AbhishekRP2002
Copy link
Contributor

hi @stevhliu i would be super grateful if you can let me work on the model card for code_llama

@bimal-gajera
Copy link
Contributor

Hey @stevhliu, I would like to work on the cohere model card.

@ash-01xor
Copy link
Contributor

Hey @stevhliu , i would like to contribute to gpt2 model card

@saumanraaj
Copy link

Hey @stevhliu , I would like to contribute to vitpose model card

@Wu-n0
Copy link
Contributor

Wu-n0 commented Mar 28, 2025

Hey @stevhliu, I would like to work on the electra model card

@shubham0204
Copy link
Contributor

shubham0204 commented Mar 28, 2025

@stevhliu I will update the model card for depth_anything.
PR: #37065

@darmasrmez
Copy link

Hey @stevhliu , I would like to contribute to mixtral model card

@ash-01xor
Copy link
Contributor

ash-01xor commented Mar 29, 2025

To the folks who have been raising PR so far , just have a doubt did you get to install flax , tf-keras , sentencepiece etc.
Before making the changes, I'm trying to set up the environment following the steps here: https://github.com/huggingface/transformers/tree/main/docs.
Currently, I'm trying to build the documentation, but I repeatedly encounter errors such as Unable to register cuDNN factory: and the library installation errors. So would like to know if I am missing any steps or if all these library installations are necessary for making the changes

EDIT : Got it up and running, had to install all the libraries to make it run successfully. Initially felt doubtful about the need to install all the libraries such as flax but yea seems like it has to be installed too.

@arpitsinghgautam
Copy link

Hey @stevhliu, I would like to work on the phi3 model card

@shubham0204
Copy link
Contributor

To the folks who have been raising PR so far , just have a doubt did you get to install flax , tf-keras , sentencepiece etc. Before making the changes, I'm trying to set up the environment following the steps here: https://github.com/huggingface/transformers/tree/main/docs. Currently, I'm trying to build the documentation, but I repeatedly encounter errors such as Unable to register cuDNN factory: and the library installation errors. So would like to know if I am missing any steps or if all these library installations are necessary for making the changes

As you just going to edit the docs, you need not have a complete development setup. Fork the transformers repo, checkout a new branch, and start updating the Markdown document of your choice in the docs/source/en/model_doc directory.

@wadkisson
Copy link

Hi @stevhliu, may I work on GPT-2?

@Reshan123
Copy link
Contributor

Hi @stevhliu I can work on MobileBERT

@olccihyeon
Copy link

Hi @stevhliu Can I work on blip_2?

@cassiasamp
Copy link

Hey, I would like to work on the model card for mistral3.

@stevhliu
Copy link
Member Author

stevhliu commented Apr 3, 2025

Hey @wadkisson, GPT-2 is already taken. Feel free to pick another model you're interested in! 🤗

stevhliu added a commit that referenced this issue Apr 3, 2025
* Update code_llama.md

aims to handle #36979 (comment)

sub part of #36979

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

Co-authored-by: Steven Liu <[email protected]>

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

Co-authored-by: Steven Liu <[email protected]>

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

Co-authored-by: Steven Liu <[email protected]>

* make changes as per code review

* chore: make the function smaller for attention mask visualizer

* chore[docs]: update code_llama.md with some more suggested changes

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

Co-authored-by: Steven Liu <[email protected]>

* chore[docs] : Update code_llama.md with indentation changes

---------

Co-authored-by: Steven Liu <[email protected]>
@stevhliu stevhliu reopened this Apr 3, 2025
@ricalanis
Copy link
Contributor

I will now take fastspeech2_conformer if that is alright. @stevhliu

@Sudhesh-Rajan27
Copy link

Hi @stevhliu, I’d love to contribute to the Falcon model card—please let me know if I can take it up!

@Logeswaran7
Copy link
Contributor

Hi @stevhliu , I would like to work on the model card for Donut.

@stevhliu
Copy link
Member Author

stevhliu commented Apr 4, 2025

Hey @Sudhesh-Rajan27, Falcon has already been completed. Feel free to choose another model you're interested in! 🤗

@Sudhesh-Rajan27
Copy link

Hey @Sudhesh-Rajan27, Falcon has already been completed. Feel free to choose another model you're interested in! 🤗

ohh!!Then can I do efficientnet.

@stevhliu stevhliu reopened this Apr 4, 2025
@Vishesh-Mistry
Copy link

Hey @stevhliu,
I’d be happy to start working on the model cards for mbart and mbart50. Please let me know if you have any specific guidelines or areas you'd like me to focus on for these.

yuchenxie4645 pushed a commit to yuchenxie4645/transformers that referenced this issue Apr 5, 2025
* Update code_llama.md

aims to handle huggingface#36979 (comment)

sub part of huggingface#36979

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

Co-authored-by: Steven Liu <[email protected]>

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

Co-authored-by: Steven Liu <[email protected]>

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

Co-authored-by: Steven Liu <[email protected]>

* make changes as per code review

* chore: make the function smaller for attention mask visualizer

* chore[docs]: update code_llama.md with some more suggested changes

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

Co-authored-by: Steven Liu <[email protected]>

* chore[docs] : Update code_llama.md with indentation changes

---------

Co-authored-by: Steven Liu <[email protected]>
@BryanBradfo
Copy link

Hey @stevhliu! Really excited about this initiative to improve the model cards. I'd be happy to help out by tackling the Swin and SwinV2 model cards if they haven't been claimed yet. 😊

@Vishesh-Mistry
Copy link

Hey @stevhliu! Quick question — should the model cards for mbart and mbart50 be two separate cards, or should they be combined into a single one? Currently, both models use the same card, so I wanted to confirm before proceeding.

@stevhliu stevhliu reopened this Apr 7, 2025
@stevhliu
Copy link
Member Author

stevhliu commented Apr 7, 2025

Thanks @Vishesh-Mistry, you can combine mbart and mbart50 in one card like the original!

I'll be off this week, but I'll review your PRs once I return 🤗

@stevhliu stevhliu reopened this Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment