Skip to content

[Community contributions] Model cards #36979

Open
@stevhliu

Description

@stevhliu

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions