-
Notifications
You must be signed in to change notification settings - Fork 574
Enhance rslora comment clarity across notebooks and scripts #144
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Sneakr, 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 enhancing the clarity and usability of the codebase by updating documentation comments. Specifically, it provides explicit instructions for setting 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 pull request enhances the clarity of the rslora configuration comment across a large number of Jupyter notebooks and Python scripts. The change adds a helpful tip about setting alpha when use_rslora is enabled and standardizes the term to 'rank-stabilized LoRA'. While the change is beneficial, the resulting comment makes many lines exceed the recommended length, impacting readability. I've added suggestions to shorten the comment for better adherence to style guidelines.
| " use_gradient_checkpointing = \"unsloth\", # True or \"unsloth\" for very long context\n", | ||
| " random_state = 3407,\n", | ||
| " use_rslora = False, # We support rank stabilized LoRA\n", | ||
| " use_rslora = False, # We support rank-stabilized LoRA (If True, set alpha ~ sqrt(r) for correct scaling)\n", |
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.
The code within this notebook cell string contains a very long line, which can harm readability when viewed as code. To improve this, I suggest shortening the comment. This suggestion applies to all other notebooks modified in this PR.
| " use_rslora = False, # We support rank-stabilized LoRA (If True, set alpha ~ sqrt(r) for correct scaling)\n", | |
| " use_rslora = False, # RsLoRA: For correct scaling, set alpha ~ sqrt(r) if True.\n", |
| use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context | ||
| random_state = 3407, | ||
| use_rslora = False, # We support rank stabilized LoRA | ||
| use_rslora = False, # We support rank-stabilized LoRA (If True, set alpha ~ sqrt(r) for correct scaling) |
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.
This line is quite long (over 110 characters), which exceeds the common recommendation of 88 characters per line from style guides like PEP 8 / black. Long lines can be harder to read. To improve readability, I suggest shortening the comment. This suggestion is applicable to all other Python scripts modified in this PR.
| use_rslora = False, # We support rank-stabilized LoRA (If True, set alpha ~ sqrt(r) for correct scaling) | |
| use_rslora = False, # RsLoRA: For correct scaling, set alpha ~ sqrt(r) if True. |
|
/gemini review |
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 pull request improves comment clarity for rslora and loftq_config parameters across a large number of notebooks and Python scripts. The new comment for rslora is a significant improvement, providing useful guidance on its usage. The changes are consistent and improve code readability and maintainability. However, a critical issue has been identified: the loftq_update_log.txt file, which appears to be a local script execution log, has been added. This file contains a local file path, posing a security concern, and should be removed. For better clarity, I also suggest updating the pull request title and description to reflect all the changes made, including the updates to loftq_config comments.
loftq_update_log.txt
Outdated
| Comment updated to: We support LoftQ | ||
| Run at: 2025-12-18T02:47:41 | ||
| Root: C:\Users\HZ\Documents\Dev\unsloth\notebooks |
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.
This log file appears to be a generated artifact from a local script and should not be committed to the repository.
It contains sensitive information, such as the local file path on your machine on line 3: C:\\Users\\HZ\\Documents\\Dev\\unsloth\\notebooks. Exposing such information is a security risk.
Please remove this file from the pull request. To prevent this from happening again, consider adding loftq_update_log.txt or a more general pattern like *.txt or *.log to your .gitignore file.
|
/gemini review |
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 pull request systematically improves the clarity of configuration options across a large number of notebooks and Python scripts. The primary change enhances the comment for the use_rslora parameter, providing crucial information about scaling alpha. Additionally, the changes include stylistic improvements such as standardizing comments for loftq_config and correcting spacing and alignment, which significantly boosts code readability and maintainability. The updates are consistent and well-executed. Great work!
Adds
(If True, set alpha ~ sqrt(r) for correct scaling)to rslora comments for clarify.