-
Notifications
You must be signed in to change notification settings - Fork 117
Add --is-preformatted flag to prepare_hidden_states.py #350
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
Added support for preformatted input data in prepare_hidden_states.py, matching the existing flag in train_eagle3.py. This allows users to skip chat template application when their data already has the template applied. Changes: - Added --is-preformatted argument to data group - Updated cache key to include is_preformatted for proper caching - Pass is_preformatted to build_eagle3_dataset()
…tes.py - Updated script docstring with usage example for --is-preformatted - Updated data_preparation.md to document --is-preformatted for offline training
Summary of ChangesHello @Ofir408, 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 enhances 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 introduces the --is-preformatted flag to prepare_hidden_states.py, achieving feature parity with train_eagle3.py and enabling the use of datasets with pre-applied chat templates. The changes are well-implemented, correctly adding the command-line argument, updating the dataset cache key to prevent collisions, and passing the flag to the data processing function. The documentation has also been updated accordingly. My review includes one suggestion to enhance the clarity of a usage example in the script's docstring.
Added back the --output-path argument to the first usage example in the docstring for clarity and consistency with the pre-formatted data example.
|
I’ve pulled the latest changes from master. Could you please review this PR? @shuaills @sleepcoo @FrankLeeeee ? |
Motivation
The
train_eagle3.pyscript supports the--is-preformattedflag, which allows users to provide input data that already has the chat template applied. However,prepare_hidden_states.pywas missing this flag, causing inconsistency between the two scripts.Users who prepare their data with chat templates pre-applied (e.g., for custom formatting or to avoid repeated template application) couldn't use
prepare_hidden_states.pywithout first converting their data back to raw conversation format.This PR adds the
--is-preformattedflag toprepare_hidden_states.pyfor feature parity withtrain_eagle3.py.Modifications
Added
--is-preformattedargument to the data argument group inparse_args():action="store_true"(defaults toFalse)train_eagle3.pyUpdated cache key to include
is_preformatted:is_preformattedvalues are cached separatelyPass
is_preformattedtobuild_eagle3_dataset():Related Issues
N/A
Accuracy Test
This PR does not affect model-side code or model architecture. It only adds an argument passthrough to existing functionality in
build_eagle3_dataset(), which already supportsis_preformatted.Benchmark & Profiling
This PR does not impact performance. It only adds argument parsing and passes an existing parameter.