huggingface/transformers
How to contribute
This section explains how the team works in this codebase: how PRs flow, what make fix-repo does, how tests are organized, and what conventions every contributor needs to know.
The repo also ships a long-form contributor guide at
CONTRIBUTING.md. Read it for issue triage, PR description templates, and the team's etiquette guidelines. This wiki section focuses on the engineering workflow.
Sub-pages
- Development workflow — branch, code, fix-repo, push, review.
- Testing — how tests are organized, how to run subsets, GPU markers, slow tests.
- Debugging — common errors, the debug utilities, attention visualizer.
- Patterns and conventions —
# Copied from, modular models, attention dispatch, naming. - Tooling — Makefile,
utils/check_*,tests_fetcher, CI matrices.
Code agent policy (read first)
CONTRIBUTING.md carries an explicit warning: the maintainers are currently overwhelmed by agent-generated PRs and discourage pure code-agent PRs. The repo also ships an AGENTS.md (and an aliased CLAUDE.md) describing the duplicate-work checks, coordination expectations, and accountability rules every AI-assisted contributor must follow before opening a PR. This wiki itself is read-only — it does not authorize bypassing those rules.
Definition of done
A PR is ready for review when:
make fix-repohas been run and the resulting diff is committed.make check-repois green locally.- The relevant tests pass. Use
python utils/tests_fetcher.pyto find which tests cover your changes. - The PR description links to a coordinated issue (when one exists) and explains what was tested.
Where the conventions are documented in-repo
| Topic | File |
|---|---|
| Contribution etiquette | CONTRIBUTING.md |
| Agent policy | AGENTS.md (= .ai/AGENTS.md), CLAUDE.md (alias) |
| Issue templates | ISSUES.md |
| Code of conduct | CODE_OF_CONDUCT.md |
| Migration guide | MIGRATION_GUIDE_V5.md |
| Auto-docstring rules | docs/source/en/auto_docstring.md |
| Modular models | docs/source/en/modular_transformers.md |
| Adding a new model | docs/source/en/add_new_model.md |
| Adding a new pipeline | docs/source/en/add_new_pipeline.md |
| PR checks reference | docs/source/en/pr_checks.md |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.