Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tuning/sft_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,14 @@ def train(
),
)

if data_args.response_template:
data_args.response_template = data_args.response_template.replace(r"\n", "\n")
if data_args.instruction_template:
data_args.instruction_template = data_args.instruction_template.replace(r"\n", "\n")
if data_args.chat_template:
# TODO: passing "/n" through cli causes parsing issues,
# hence providing a temporary fix
data_args.chat_template = data_args.chat_template.replace(r"\n", "\n")

logger.info("adding chat_template to the tokenizer")
if tokenizer.chat_template:
logger.warning(
Expand Down
Loading