{"slug": "one-more-measured-note-for-transformers-the-torchao-docs-example-s-string-form", "title": "One more measured note for transformers — the torchao docs example's string form", "summary": "Hugging Face shipped a fix for 19 English model documentation pages in Transformers 5.25.0 via PR #51425, resolving issue #51096, which flagged examples still calling the deprecated \"int4_weight_only\" string for torchao quantization. A static comparison of the documentation's Python code blocks found 19 direct calls using the old string in 5.24.1 and none in 5.25.0; the old string API remains intentionally rejected, and the replacement is TorchAoConfig(Int4WeightOnlyConfig(group_size=128)), which preserves the original group size. The verification covered documentation and source code, not a new runtime test of torchao or the 19 models.", "body_md": "For this example, I was able to confirm that the documentation has been corrected in the new release:\n\n**The affected examples have been updated in Transformers 5.25.0.** [PR #51425](https://github.com/huggingface/transformers/pull/51425) fixes the 19 English model documentation pages identified in [#51096](https://github.com/huggingface/transformers/issues/51096), and the change is included in the [5.25.0 release](https://github.com/huggingface/transformers/releases/tag/v5.25.0).\n\nMy static comparison of the English model documentation’s Python code blocks found 19 direct calls using the old `\"int4_weight_only\"` string in 5.24.1 and none in 5.25.0. I also checked the changes to all 19 files in the PR.\n\nFor anyone using an older copy of one of those examples, the replacement is:\n\n``` python\nfrom transformers import TorchAoConfig\nfrom torchao.quantization import Int4WeightOnlyConfig\n\nquantization_config = TorchAoConfig(\n    Int4WeightOnlyConfig(group_size=128)\n)\n```\n\nThis preserves the original group size. In an otherwise compatible environment that already supports the object-based API, the snippet can be corrected locally without necessarily upgrading Transformers.\n\nThe fix is to the documentation: **the old string API is still intentionally rejected.** My additional verification here was of the documentation and source code, not a new runtime test of torchao or of all 19 models. The original constructor-level measurements are particularly useful because they isolate the problem before model loading.\n\nFor the original report, the main update is that the documentation correction has shipped in 5.25.0. The older examples can also be corrected locally in a compatible environment, and any subsequent backend or model-specific failure can be investigated separately.", "url": "https://wpnews.pro/news/one-more-measured-note-for-transformers-the-torchao-docs-example-s-string-form", "canonical_source": "https://discuss.huggingface.co/t/one-more-measured-note-for-transformers-the-torchao-docs-examples-string-form/192476#post_2", "published_at": "2026-12-02 05:11:21+00:00", "updated_at": "2026-12-02 05:15:44.813561+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "developer-tools", "mlops"], "entities": ["Hugging Face", "Transformers", "Transformers 5.25.0", "torchao", "TorchAoConfig", "Int4WeightOnlyConfig", "PR #51425", "issue #51096"], "also_reported_by": [], "takeaway": "Replace the rejected \"int4_weight_only\" string with TorchAoConfig(Int4WeightOnlyConfig(group_size=128)) to keep the original group size; the fix landed in Transformers 5.25.0 across 19 documentation pages.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/one-more-measured-note-for-transformers-the-torchao-docs-example-s-string-form", "markdown": "https://wpnews.pro/news/one-more-measured-note-for-transformers-the-torchao-docs-example-s-string-form.md", "text": "https://wpnews.pro/news/one-more-measured-note-for-transformers-the-torchao-docs-example-s-string-form.txt", "jsonld": "https://wpnews.pro/news/one-more-measured-note-for-transformers-the-torchao-docs-example-s-string-form.jsonld"}}