Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @garyzhang99, 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 addresses an issue in the SFT (Supervised Fine-Tuning) example data by updating the format of the 'prompt' and 'response' fields. Previously, these fields were simple strings, but they have been changed to a more structured dictionary format. This change is crucial for ensuring the example data correctly represents conversational turns, making it suitable for training models that expect distinct roles (like 'user' and 'assistant') in their input.
Highlights
- Data Structure Update for SFT Examples: The 'prompt' and 'response' fields within the
sft.jsonlfile have been refactored. They are no longer simple string values but are now structured as dictionary objects. This change introduces explicit 'role' (e.g., 'user', 'assistant') and 'content' keys for each entry. - Alignment with Chat-based Formats: This modification ensures that the example data for Supervised Fine-Tuning (SFT) is compatible with models or systems expecting a chat-like message format, where prompts and responses are clearly delineated by roles.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request aims to fix the SFT example data by changing the format of the prompt and response fields. The change to a structured dictionary format is a good step. However, I've identified two issues with the implementation. First, the data file contains duplicated entries which should be removed for clarity and correctness of tests. Second, and more critically, the prompt and response fields should be a list of dictionaries, not a single dictionary, to be compatible with the existing SFTFormatter. I have provided specific suggestions to address these points.
There was a problem hiding this comment.
The prompt and response fields are formatted as dictionaries, but the SFTFormatter in trinity/data/core/formatter.py expects them to be lists of dictionaries. This is necessary for tokenizer.apply_chat_template and for concatenating prompt and response lists. Please wrap the dictionary for both prompt and response in a list ([]) on each line in this file.
{"prompt": [{"role": "user", "content": "Mr. Sam shared a certain amount of money between his two sons, Ken and Tony. If Ken got $1750, and Tony got twice as much as Ken, how much was the money shared?"}], "response": [{"role": "assistant", "content": "<think> \nKen got $1750. Tony got twice as much as Ken, so Tony got 2 x $1750 = $3500. The total amount shared between Ken and Tony is $1750 + $3500 = $5250.\n</think>\n<answer> $5250 </answer>"}]}
|
/unittest-module-trainer |
Summary
Tests
Github Test Reporter by CTRF 💚 |
|
Fixed in #226 |
Description
As the title says. The "prompt" part should be
dictorlist of dictChecklist
Please check the following items before code is ready to be reviewed.