Skip to content
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

support no apllication of chat template for instructions #3

Draft
wants to merge 2 commits into
base: add_datasets_no_templates
Choose a base branch
from

Conversation

Ssukriti
Copy link

This change exposes a flag apply_chat_instruction_template to allow users to control if chat template is applied or not by default to prompt/completion data format supported by SFT Trainer.

if flag is set to False, the prompt and completion are just concatenated and masking is applied using length of prompt .

@@ -250,7 +251,7 @@ def make_inputs_require_grad(module, input, output):
if formatting_func is None and dataset_text_field is None:
# check if dataset has ChatML format or instruction format and is supported
# if not stays #None
formatting_func = get_formatting_func_from_dataset(train_dataset, tokenizer)
formatting_func = get_formatting_func_from_dataset(train_dataset, tokenizer, apply_chat_instruction_template)

requires_input_output_keys = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable name should probably be changed - it doesn't make sense if the keys are prompt / completion

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya I changed it below and left that one place, thanks for catching it

Signed-off-by: Sukriti-Sharma4 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants