Conversation
Summary of ChangesHello, 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 primarily addresses issues related to the multi-modal server setup and introduces a comprehensive example for multi-modal LoRA training. It refines server configurations for specific models, enhances debugging capabilities in data loading, and improves the flexibility and robustness of model and input handling within the Twinkle framework. The changes aim to stabilize the server and provide clearer guidance for multi-modal fine-tuning workflows. 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. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request modifies the megatron server configuration to disable megatron and specify the model class. It also introduces a new example script for fine-tuning a language model using LoRA. Additionally, the pull request includes changes to the retry sampler to print the traceback on exceptions, adds transformers import and a check for model_cls type in multi_lora_transformers, adds mm_token_type_ids to InputProcessor, and converts lists to tensors in twinkle_handlers. The reviewer pointed out that the os module was not imported in multi_modal.py and suggested adding import os at the top of the file. The reviewer also suggested a more robust way to convert lists to tensors in twinkle_handlers.py by checking if the list contains numbers before attempting conversion.
| if isinstance(inputs[key], list): | ||
| inputs[key] = torch.tensor(inputs[key]) |
There was a problem hiding this comment.
This logic for converting lists to tensors is not robust. It assumes any value that is a list should be converted to a torch.tensor. This could fail if a field contains a list of non-numeric types, such as a list of strings. A safer approach is to check if the list contains numbers before attempting conversion.
| if isinstance(inputs[key], list): | |
| inputs[key] = torch.tensor(inputs[key]) | |
| if isinstance(inputs[key], list) and inputs[key] and isinstance(inputs[key][0], (int, float)): | |
| inputs[key] = torch.tensor(inputs[key]) |
PR type
PR information
Write the detail information belongs to this PR.
Experiment results
Paste your experiment result here(if needed).