Skip to content

support no apllication of chat template for instructions#3

Draft
Ssukriti wants to merge 2 commits intoadd_datasets_no_templatesfrom
prompt_completion_no_chat_template
Draft

support no apllication of chat template for instructions#3
Ssukriti wants to merge 2 commits intoadd_datasets_no_templatesfrom
prompt_completion_no_chat_template

Conversation

@Ssukriti
Copy link
Copy Markdown

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 .

Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
Comment thread trl/trainer/sft_trainer.py Outdated
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
Copy Markdown
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
Copy Markdown
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 <sukriti.sharma4@ibm.com>
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