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

added doctring to SchedulerType class #32898

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

Arunprakash-A
Copy link
Contributor

What does this PR do?

It adds the docstring for the class SchedulerType . Currently, the AutoDoc only displays the __call__ signature of enum.EnumType base class which is not helpful. One needs to look for the names and the respective mapping in the source code of trainer.py. Therefore, added the docstring that lists out all the available names and the scheduler types they are mapped to.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Documentation: @stevhliu

@Arunprakash-A
Copy link
Contributor Author

@stevhliu i ran make style in the command line. It catched style errors in other documents, for example, "examples/research_projects/movement-pruning/Saving_PruneBERT.ipynb". I am not sure whether those should be fixed before making this pull request.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks!

I'm not sure why the check_repo_consistency test is failing since you didn't touch any of those files. cc @amyeroberts, do you know how we can fix this? I noticed the same error message in a separate PR here.

src/transformers/trainer_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@Arunprakash-A Arunprakash-A left a comment

Choose a reason for hiding this comment

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

Done

@amyeroberts
Copy link
Collaborator

@stevhliu @Arunprakash-A For the check_repo_consistency tests - the tests were failing because of packages on the test image. These should have been resolved now. Pushing an empty commit to trigger a new CI run should resolve.

For check_code_quality - there's a formatting issue and you should run make fixup and push the changes to resolve

@Arunprakash-A
Copy link
Contributor Author

@stevhliu @Arunprakash-A For the check_repo_consistency tests - the tests were failing because of packages on the test image. These should have been resolved now. Pushing an empty commit to trigger a new CI run should resolve.

For check_code_quality - there's a formatting issue and you should run make fixup and push the changes to resolve

I ran make fixup and got the following

Checking/fixing src/transformers/trainer_utils.py
All checks passed!
1 file reformatted

python utils/custom_init_isort.py
python utils/sort_auto_mappings.py
python utils/check_doc_toc.py --fix_and_overwrite
running deps_table_update
updating src/transformers/dependency_versions_table.py
python utils/check_copies.py
python utils/check_table.py
python utils/check_dummies.py
python utils/check_repo.py
<truncated>:

@amyeroberts
Copy link
Collaborator

@Arunprakash-A You have to commit and push the changes made when running make fixup

@Arunprakash-A
Copy link
Contributor Author

@Arunprakash-A You have to commit and push the changes made when running make fixup

Thanks @amyeroberts. Done!

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks again for improving the docstring here!

@stevhliu stevhliu merged commit e3a5f35 into huggingface:main Aug 23, 2024
8 checks passed
@Arunprakash-A Arunprakash-A deleted the add-doc-to-SchedulerType branch August 23, 2024 16:46
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Aug 30, 2024
* added doctring to SchedulerType class

* Remove trailing whitespace  src/transformers/trainer_utils.py

Co-authored-by: Steven Liu <[email protected]>

* fixup

---------

Co-authored-by: Steven Liu <[email protected]>
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Aug 30, 2024
* added doctring to SchedulerType class

* Remove trailing whitespace  src/transformers/trainer_utils.py

Co-authored-by: Steven Liu <[email protected]>

* fixup

---------

Co-authored-by: Steven Liu <[email protected]>
itazap pushed a commit to NielsRogge/transformers that referenced this pull request Sep 20, 2024
* added doctring to SchedulerType class

* Remove trailing whitespace  src/transformers/trainer_utils.py

Co-authored-by: Steven Liu <[email protected]>

* fixup

---------

Co-authored-by: Steven Liu <[email protected]>
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.

4 participants