TLDRocket
Sign in

Tools & Coding

975 summarised stories in Tools & Coding, each linking back to the original source. Browse all topics →

Tuesday, 5 April 2022

~Don't~ Repeat Yourself

Hugging Face 4 years ago 18

Hugging Face's Transformers library deliberately violates the DRY (Don't Repeat Yourself) programming principle by duplicating code across 50+ model files rather than centralizing shared components. The library enforces a "single model file policy" where all code needed to understand a model's forward pass exists in one file, with a "copying mechanism" using # Copied from comments to keep related models synchronized. This design prioritizes contributor accessibility and code readability for the open-source community over traditional maintainability, accepting that machine learning models rarely change after publication.

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.