Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[docs] contributing#45465

Merged
stevhliu merged 4 commits into
huggingface:mainfrom
stevhliu:model-addition-overview
Jun 2, 2026
Merged

[docs] contributing#45465
stevhliu merged 4 commits into
huggingface:mainfrom
stevhliu:model-addition-overview

Conversation

@stevhliu

@stevhliu stevhliu commented Apr 15, 2026

Copy link
Copy Markdown
Member
  • refactors the "Contribute to Transformers" doc to be more lightweight and an easy entry point that links out to more dedicated guides
  • updates the docs/README.md

@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.

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Submitting part 1 of my review because gh doesnt let me add any more comments for whatever reason. Imo, we should have more eyes on this as the contributing docs are super important imo and I want pretty much the opinion of the whole core team on what their thoughts are

Comment thread docs/source/en/add_new_model.md
Comment thread docs/README.md
Comment thread docs/README.md Outdated
Comment thread docs/README.md Outdated
> [!NOTE]
> The `preview` command only works with existing doc files. When you add a completely new file, you need to update `_toctree.yml` & restart `preview` command (`ctrl-c` to stop it & call `doc-builder preview ...` again).
> [!WARNING]
> `preview` only picks up files that exist when it starts. After you add a brand-new page, update `_toctree.yml` and restart `preview`. `preview` does not work on Windows.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wait actually does not work on win? Shouldn't we mention this on top before watchdog?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

actually, the README is outdated and it should work on Windows thanks to huggingface/doc-builder#351

Comment thread docs/README.md Outdated
Follow the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) for writing docstrings.

#### Defining arguments in a method
### Defining arguments in a method

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I might be wrong but is this actually referencing docstrings within modeling_xxx.py/configuration_xxx.py? Or is this really relevant to the docs as well; just seeing that we removed the docs sections itself so this might also not make that much sense

In general, we now have auto docstring which makes things slightly different, e.g. Args: is not really used when auto docstring is involved etc. It might be smarter to reference something along how to write docs within the libraries code base itself which is heavily reliant on auto docs now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

you're right, it makes more sense to reference auto_docstring instead of manual instructions for how to write them

Comment thread CONTRIBUTING.md Outdated
# Contribute to 🤗 Transformers

## Code agent policy
# Contribute to Transformers

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can keep the 🤗 imo :D

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤗

@vasqu

vasqu commented May 6, 2026

Copy link
Copy Markdown
Collaborator

@stevhliu seems like gh is broken and doesnt let me comment anything anymore, can you ping me tomorrow or so again to try again Edit: known issues within GH so will definitely recheck tomorrow

In any case cc @huggingface/transformers-core-maintainers to take a look. Docs are not our fav cup of tea I know but I think the contributing docs deserve our time 🫡

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some additional comments since yesterday I couldnt comment anymore 😢

Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
1. [Add a model with modular Transformers](docs/source/en/modular_transformers.md) — implement the model using the modular file and generate standalone modeling files.
2. [Add vision processing components](docs/source/en/add_vision_processing_components.md) — add image processors and other vision-specific components if your model requires image inputs.
3. [Auto-generate docstrings](docs/source/en/auto_docstring.md) — use the `@auto_docstring` decorator to generate consistent docstrings without boilerplate.
4. [Convert checkpoints](docs/source/en/modular_transformers.md#checkpoint-conversion) — write a conversion script to translate upstream weights into a Transformers-compatible format and upload to the Hub.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Imo, re weights should be deprecated and only done in special cases --> dynamic weight converter is in general the better way if possible.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i'll remove this one to direct more focus on the dynamic weight converter

Comment thread CONTRIBUTING.md Outdated
Comment on lines +168 to +169
7. [Model structure rules](docs/source/en/modeling_rules.md) — check your files pass the static model structure rules enforced by `make typing`.
8. [Pull request checks](docs/source/en/pr_checks.md) — understand the Hugging Face CI checks and how to run them locally before opening a PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tightly bounded, maybe one suffices?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the model structure rules one is probably more relevant so i'll keep that one, and it'll also address arthur's comment below

Comment thread docs/source/en/add_new_model.md
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md
pytest -q docs/source/en/my_page.md
pytest -q docs/source/en/
```
There are four timelines for model additions depending on the model contributor and community demand for an architecture.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel like its missing the notes about "to add a model to the transformers familiy you need to make sure you isolate the difference between your model and the recent sota models. This is super helpful for our reviewers to understand what challenges this model brings, and what parts can be standardized.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added in the ## Adding a new model section above

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this is much nicer! I think we are good to go except @ArthurZucker maybe has something else

I think it's a good choice to properly reference the other guides nowadays to ubloat here

@stevhliu

stevhliu commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

merging for now and can update later if there's something else!

@stevhliu stevhliu added this pull request to the merge queue Jun 2, 2026
Merged via the queue into huggingface:main with commit a46a732 Jun 2, 2026
31 checks passed
@stevhliu stevhliu deleted the model-addition-overview branch June 2, 2026 17:43
khushali9 pushed a commit to khushali9/transformers that referenced this pull request Jun 8, 2026
* refactor

* writing docs

* model addition timeline

* feedbacks
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.

5 participants