Hugging Face Transformers adopts single model file policy instead of centralized DRY code
AI Impact Summary
Transformers adopts a single model file policy, keeping forward-pass logic for each model in its own file rather than centralizing identical components. This improves readability and ease of modification for readers targeting a specific model (BERT, T5, DeBERTa) but reduces cross-model reuse and forces duplication of mechanisms like attention. Maintainers must balance onboarding speed for new contributors against increased maintenance burden and risk of inconsistencies across models when evolving shared behaviors. The design supports community-driven contributions but requires rigorous model-specific tests and careful PR reviews to avoid drift between models.
Affected Systems
- Date
- Date not specified
- Change type
- capability
- Severity
- info