From 7bf62533955721f63ecd7e509819a7e1e6923d57 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 11 Feb 2025 01:28:28 -0800 Subject: [PATCH] Update tokenizer_utils.py --- unsloth/tokenizer_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py index 3d8a517382..2062df4808 100644 --- a/unsloth/tokenizer_utils.py +++ b/unsloth/tokenizer_utils.py @@ -950,7 +950,8 @@ def patch_sft_trainer_tokenizer(): check_text = check_text.split("\n") check_text = "\n".join(" "*where + x for x in check_text) - + check_text = check_text.rstrip() + "\n" + if replacer is None: # .*? matches first match. .+? matches final match. replacer = re.findall(