Improve @auto_docstring doc and rename args_doc.py to auto_docstring.py (#39439)

* rename `args_doc.py` to `auto_docstring.py` and improve doc

* modifs after review
This commit is contained in:
Yoni Gozlan
2025-07-18 14:00:34 -04:00
committed by GitHub
parent de0dd3139d
commit 541bed22d6
4 changed files with 179 additions and 29 deletions

View File

@@ -49,7 +49,7 @@ from check_repo import ignore_undocumented
from git import Repo
from transformers.utils import direct_transformers_import
from transformers.utils.args_doc import (
from transformers.utils.auto_docstring import (
ImageProcessorArgs,
ModelArgs,
ModelOutputArgs,
@@ -1487,7 +1487,7 @@ def check_auto_docstrings(overwrite: bool = False, check_all: bool = False):
if docstring_args_ro_remove_warnings:
if not overwrite:
print(
"Some docstrings are redundant with the ones in `args_doc.py` and will be removed. Run `make fix-copies` or `python utils/check_docstrings.py --fix_and_overwrite` to remove the redundant docstrings."
"Some docstrings are redundant with the ones in `auto_docstring.py` and will be removed. Run `make fix-copies` or `python utils/check_docstrings.py --fix_and_overwrite` to remove the redundant docstrings."
)
print(f"🚨 Redundant docstring for the following arguments in {candidate_file}:")
for warning in docstring_args_ro_remove_warnings: