Skip to content

docs(utils): add missing docstrings to 5 public utility functions#2454

Open
RavSinghChandan wants to merge 1 commit into
huggingface:mainfrom
RavSinghChandan:docs/add-missing-docstrings-utils
Open

docs(utils): add missing docstrings to 5 public utility functions#2454
RavSinghChandan wants to merge 1 commit into
huggingface:mainfrom
RavSinghChandan:docs/add-missing-docstrings-utils

Conversation

@RavSinghChandan

@RavSinghChandan RavSinghChandan commented Jun 30, 2026

Copy link
Copy Markdown

What does this PR do?

Adds missing docstrings to five public utility functions across two files. Each docstring follows the HuggingFace documentation style.

optimum/utils/testing_utils.py — 4 functions:

Function Added
require_diffusers One-line decorator description (consistent with require_torch_gpu, require_ort_rocm, etc.)
require_timm One-line decorator description
require_sentence_transformers One-line decorator description
require_datasets One-line decorator description

These four decorators were the only ones in the file without any docstring, making the module inconsistent.

optimum/utils/save_utils.py — 1 function:

Function Added
maybe_load_preprocessors Full Args/Returns/Example docstring

maybe_save_preprocessors (in the same file) already had a full docstring; maybe_load_preprocessors — which it calls — did not.

Tests

No logic changed — documentation only.

black --check and ruff check both pass with no errors.

Add docstrings to require_diffusers, require_timm,
require_sentence_transformers, require_datasets (testing_utils.py)
and maybe_load_preprocessors (save_utils.py)
@RavSinghChandan
RavSinghChandan force-pushed the docs/add-missing-docstrings-utils branch from 5380553 to 7618137 Compare July 1, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant