This repository was archived by the owner on Sep 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
[Finetune] Integrate Chat template #178
Open
minmingzhu
wants to merge
24
commits into
intel:main
Choose a base branch
from
minmingzhu:chat_template
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
carsonwang
suggested changes
Apr 9, 2024
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.
Thanks for the work! Summarized the changes to update as we discussed offline:
- Remove the added
is_base_modelparameter in the finetuning yaml file. - Allow user configuring
chat_templatein the yaml file. In most of the case, people don't configure it. Priority order: user configured chat_template > model's chat_template > our default template - Write the default template by following other models' (such as llama2 chat), that is, check roles in the message, etc.
- The original data format needs to convert to chat format first, before applying the chat template.
- Add unit tests to test the result after applying chat template, covering all use cases.
- Support chat format as finetuning dataset format. Please follow openAI's format. We can support this in a separate PR.
3e6ccac to
6a0bf63
Compare
harborn
reviewed
Apr 18, 2024
| |lora_config|task_type: CAUSAL_LM<br>r: 8<br>lora_alpha: 32<br>lora_dropout: 0.1|Will be passed to the LoraConfig `__init__()` method, then it'll be used as config to build Peft model object.| | ||
| |deltatuner_config|"algo": "lora"<br>"denas": True<br>"best_model_structure": "/path/to/best_structure_of_deltatuner_model"|Will be passed to the DeltaTunerArguments `__init__()` method, then it'll be used as config to build [Deltatuner model](https://github.com/intel/e2eAIOK/tree/main/e2eAIOK/deltatuner) object.| | ||
| |enable_gradient_checkpointing|False|enable gradient checkpointing to save GPU memory, but will cost more compute runtime| | ||
| |chat_template|None|User-defined chat template.| |
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.
Have you compared the impact of different templates on fine-tuning performance?
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.
not yet
42825d3 to
4fa89cc
Compare
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
2. modify chat template Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
2. add unit test Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
* update * fix blocking * update Signed-off-by: Wu, Xiaochang <[email protected]> * update Signed-off-by: Wu, Xiaochang <[email protected]> * fix setup and getting started Signed-off-by: Wu, Xiaochang <[email protected]> * update Signed-off-by: Wu, Xiaochang <[email protected]> * update Signed-off-by: Wu, Xiaochang <[email protected]> * nit Signed-off-by: Wu, Xiaochang <[email protected]> * Add dependencies for tests and update pyproject.toml Signed-off-by: Wu, Xiaochang <[email protected]> * Update dependencies and test workflow Signed-off-by: Wu, Xiaochang <[email protected]> * Update dependencies and fix torch_dist.py Signed-off-by: Wu, Xiaochang <[email protected]> * Update OpenAI SDK installation and start ray cluster Signed-off-by: Wu, Xiaochang <[email protected]> --------- Signed-off-by: Wu, Xiaochang <[email protected]>
* single test * single test * single test * single test * fix hang error
Signed-off-by: minmingzhu <[email protected]>
* use base model mpt-7b instead of mpt-7b-chat Signed-off-by: minmingzhu <[email protected]> * manual setting specify tokenizer Signed-off-by: minmingzhu <[email protected]> * update Signed-off-by: minmingzhu <[email protected]> * update doc/finetune_parameters.md Signed-off-by: minmingzhu <[email protected]> --------- Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Signed-off-by: minmingzhu <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.