Update the qlora_llama3_gpu.ipynb notebook#1160
Update the qlora_llama3_gpu.ipynb notebook#1160rajasekharporeddy wants to merge 1 commit intogoogle:mainfrom
qlora_llama3_gpu.ipynb notebook#1160Conversation
Summary of ChangesHello @rajasekharporeddy, 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 significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Code Review
This pull request updates the qlora_llama3_gpu.ipynb notebook to resolve module import errors by adding an installation cell at the beginning. While this is a good improvement, the changes introduce a critical issue by attempting to use the wandb library without installing it, which will cause a ModuleNotFoundError. Additionally, the wandb.init() call is misplaced. I have provided comments to address this and other minor improvements for clarity and consistency in the installation instructions.
| "import qwix\n", | ||
| "from tunix.models.automodel import AutoModel\n", | ||
| "from tunix.sft import peft_trainer, metrics_logger\n", | ||
| "import wandb\n", |
There was a problem hiding this comment.
This import wandb statement will cause a ModuleNotFoundError because the wandb package is not installed in the setup cell at the beginning of the notebook. This PR aims to fix such errors, but this change introduces a new one. Furthermore, the corresponding wandb.init() call later in the notebook is misplaced. Given these issues, it's best to remove the wandb integration from this PR. Please remove this import statement.
There was a problem hiding this comment.
Included the installation of wandb to avoid the ModuleNotFoundError.
| "#Initialize wandb\n", | ||
| "wandb.init()\n", | ||
| "\n", |
There was a problem hiding this comment.
This wandb.init() call is misplaced in the inference cell and is likely to cause issues. The PeftTrainer's MetricsLogger is designed to handle logging to backends like W&B automatically if the library is installed. An explicit, unconditional init() call here can conflict with the trainer's logging mechanism and will interrupt the notebook's execution by prompting the user for authentication. This should be removed along with the import wandb statement earlier.
There was a problem hiding this comment.
Without wandb.init(), the notebook is failing with the following error during the test inference.
Error: You must call wandb.init() before wandb.log()8a65103 to
9d9683b
Compare
examples/qlora_llama3_gpu.ipynb
Outdated
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, |
There was a problem hiding this comment.
There must be a id field in the metadata for the notebook to be rendered correctly.
There was a problem hiding this comment.
Thanks for the review. id field is included in the metadata.
9d9683b to
fdef654
Compare
This PR updates the
qlora_llama3_gpu.ipynbnotebook and fixes all the errors related toModuleNotFoundError.Working example: Colab gist
Checklist