From 7fd058fc71f7433bf55cd978feccc580fa26dab8 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 19 Aug 2024 15:52:13 -0700 Subject: [PATCH] Update tokenizer_utils.py --- unsloth/tokenizer_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py index 873544007d..a73887061f 100644 --- a/unsloth/tokenizer_utils.py +++ b/unsloth/tokenizer_utils.py @@ -1177,14 +1177,16 @@ def patch_sft_trainer_tokenizer(): # Add NEFTune since it doesn't seem to work?? We need to manually inject it check_text += \ "\n\n"\ + "print(1)\n"\ "if getattr(self.model.get_input_embeddings(), 'neftune_noise_alpha', None) is not None:\n"\ + " print(2)\n"\ " if hasattr(self, 'neftune_hook_handle'):\n"\ " self.neftune_hook_handle.remove()\n"\ " if hasattr(self, 'neftune_hook_handle'): del self.neftune_hook_handle\n"\ "\n"\ " self.neftune_hook_handle = self.model.get_input_embeddings().register_forward_hook(neftune_post_forward_hook)\n\n"\ "\n" - + check_text = check_text.split("\n") check_text = "\n".join(" "*where + x for x in check_text)