Skip to content

Commit

Permalink
Del cmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yhna940 committed Oct 12, 2024
1 parent 174425c commit 558e11e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/accelerate/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _T:
# Add a deprecation note to the docstring.
docstring = function.__doc__ or ""

# Add a note to the docstring.
deprecation_note = textwrap.dedent(
f"""\
.. deprecated:: {since}
Expand All @@ -66,18 +65,12 @@ def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _T:

# Split docstring at first occurrence of newline
summary_and_body = docstring.split("\n\n", 1)

if len(summary_and_body) > 1:
summary, body = summary_and_body

# Dedent the body. We cannot do this with the presence of the summary because
# the body contains leading whitespaces when the summary does not.
body = textwrap.dedent(body)

new_docstring_parts = [deprecation_note, "\n\n", summary, body]
else:
summary = summary_and_body[0]

new_docstring_parts = [deprecation_note, "\n\n", summary]

wrapper.__doc__ = "".join(new_docstring_parts)
Expand Down

0 comments on commit 558e11e

Please sign in to comment.