Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
DN6 committed Mar 4, 2024
1 parent adc3e26 commit 61804a7
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/diffusers/utils/doc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,3 @@ def docstring_decorator(fn):
return fn

return docstring_decorator


def add_start_docstrings(*docstr):
def docstring_decorator(fn):
fn.__doc__ = "".join(docstr) + (fn.__doc__ if fn.__doc__ is not None else "")
return fn

return docstring_decorator


def add_start_docstrings_to_model_forward(*docstr):
def docstring_decorator(fn):
docstring = "".join(docstr) + (fn.__doc__ if fn.__doc__ is not None else "")
class_name = f"[`{fn.__qualname__.split('.')[0]}`]"
intro = f" The {class_name} forward method, overrides the `__call__` special method."
note = r"""
<Tip>
Although the recipe for forward pass needs to be defined within this function, one should call the
[`Module`] instance afterwards instead of this since the former takes care of running the pre and post
processing steps while the latter silently ignores them.
</Tip>
"""

fn.__doc__ = intro + note + docstring
return fn

return docstring_decorator


def add_end_docstrings(*docstr):
def docstring_decorator(fn):
fn.__doc__ = (fn.__doc__ if fn.__doc__ is not None else "") + "".join(docstr)
return fn

return docstring_decorator

0 comments on commit 61804a7

Please sign in to comment.