-
Notifications
You must be signed in to change notification settings - Fork 261
Modernization of typehints in llmcompressor/core/lifecycle.py #1934
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
Modernization of typehints in llmcompressor/core/lifecycle.py #1934
Conversation
👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review. Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed. |
Summary of ChangesHello @siddhaka, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on modernizing the type hints within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This PR does a good job of modernizing the type hints in llmcompressor/core/lifecycle.py
by using the |
operator for optional types and built-in collection types like list
. The changes improve readability and align with modern Python conventions. I have one suggestion regarding a docstring that could be made more accurate.
Hi @siddhaka, thank you for your contribution, it seems like both #1933 and #1934 changed alot more files than scoped in the PR description, I'm guessing it's due to styling changes, However we would like to keep the PRs crisp, could you rebase the diff on latest main, and limit the changes to intended files, for example if you wanted to change llmcompressor/core/lifecycle please limit the changes to just that file. Kindly let us know if we can help in any way, the diff looks good otherwise |
0a08e48
to
b4fd1b5
Compare
I’ve now cleaned up both PRs to include only the intended updates. Please let me know if any further changes are required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thanks for the contribution
Thanks for the contribution! I have one small nit that I think this worth discussing From https://docs.python.org/3/library/typing.html#typing.Optional:
I understand that functionally, |
@kylesayrs would you be kind enough to update #1927 to make this more explicit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good nit found by @kylesayrs that we'd like to adopt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Either Optional
or X | None
is fine.
b4fd1b5
to
1f09f3b
Compare
…roject#1934) This PR refactors llmcompressor/core/lifecycle.py for improved readability, consistency, and adherence to modern Python style conventions. --------- Co-authored-by: Rahul Tuli <[email protected]> Signed-off-by: LeiZhang <[email protected]>
This PR refactors llmcompressor/core/lifecycle.py for improved readability, consistency, and adherence to modern Python style conventions.