Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More docstring nits #715

Merged
merged 2 commits into from
Sep 23, 2022
Merged

More docstring nits #715

merged 2 commits into from
Sep 23, 2022

Conversation

muellerzr
Copy link
Collaborator

Adds some more type hints and docs to functions I've noticed the one-off user has used before so it's documented (but also documents the best practice).

Also felt like having the type annotations on unwrap_model eases a bit more into what exactly it can unwrap, let me know if we should use the fully qualified types (I imagine so) and how that would be annotated to fit in the 150ish char limit we have (e.g. newline for each type?)

@muellerzr muellerzr added the documentation Improvements or additions to documentation label Sep 23, 2022
@muellerzr muellerzr requested a review from sgugger September 23, 2022 13:37
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 23, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the nits! I don't think we need to go further than torch.nn.Module for the types of models being unwrapped as all the wrappers are themselves modules.

src/accelerate/accelerator.py Outdated Show resolved Hide resolved
@muellerzr muellerzr merged commit 56ce94d into main Sep 23, 2022
@muellerzr muellerzr deleted the docstrings branch September 23, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants