docs(utils): add missing docstrings to 5 public utility functions#2454
Open
RavSinghChandan wants to merge 1 commit into
Open
docs(utils): add missing docstrings to 5 public utility functions#2454RavSinghChandan wants to merge 1 commit into
RavSinghChandan wants to merge 1 commit into
Conversation
Add docstrings to require_diffusers, require_timm, require_sentence_transformers, require_datasets (testing_utils.py) and maybe_load_preprocessors (save_utils.py)
RavSinghChandan
force-pushed
the
docs/add-missing-docstrings-utils
branch
from
July 1, 2026 02:59
5380553 to
7618137
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:require_diffusersrequire_torch_gpu,require_ort_rocm, etc.)require_timmrequire_sentence_transformersrequire_datasetsThese four decorators were the only ones in the file without any docstring, making the module inconsistent.
optimum/utils/save_utils.py— 1 function:maybe_load_preprocessorsArgs/Returns/Exampledocstringmaybe_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 --checkandruff checkboth pass with no errors.