A library of pretrained machine-learning models for text, vision, audio, and multimodal tasks.
On this page
Overview
The root AGENTS.md and CLAUDE.md files link to .ai/AGENTS.md. This short guide covers contribution coordination and generated models, including how to edit and check both legacy copies and current modular sources.
The file describes two mechanisms for maintaining standalone model files. It permits existing copied blocks to be maintained through their source but directs new work toward modular files.
**Do not add new `# Copied from` statements**; write a modular file instead.
02 / Generated file guards
Inspect the full output of a shared source change
A named modular file also generates another model family. The guide requires regeneration and review of every changed output, so a fix cannot quietly leave dependent generated code stale.
**Other models inherit your modular file.** `modular_deepseek_vl.py` also generates `modeling_deepseek_vl_hybrid.py`.
03 / Architecture as narrative
Explain a value that looks like a mistake
AttributeError is intentional converter syntax for removing inherited members. The file explains that replacing it with an apparently sensible value can change model sharding behavior.
**`attr = AttributeError()` deletes an inherited attribute** — it is an instruction to the converter, not a bug or placeholder.
04 / Contribution etiquette
Check ownership and overlapping work before contributing
Before a PR, agents must coordinate on the issue and inspect open work. The guide supplies issue and PR queries and asks for an explanation when a different approach warrants another patch.
Check for overlapping work, and do not open a second PR for a fix already covered:
Ideas for your repo
01Explain the source of truth for generated model files.
02Review every generated output affected by a shared source edit.
03Document special sentinel values that resemble errors.
04Check issue ownership and existing patches before opening a PR.
Sponsored by
Give your agents the whole story.
These instructions explain how to work in Transformers. Modem shows your agents what customers said, who is affected, and what changed.