diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py index a9b635203e..57829e621d 100644 --- a/unsloth/tokenizer_utils.py +++ b/unsloth/tokenizer_utils.py @@ -1001,7 +1001,7 @@ def patch_sft_trainer_tokenizer(): # Also DPO weirdly tokenizes non numeric columns? Delete them! check_text += \ "\n"\ - "if hasattr(self.train_dataset, 'column_names'):\n" + "if hasattr(self.train_dataset, 'column_names'):\n"\ " column_names = set(self.train_dataset.column_names)\n"\ " check = ['chosen', 'rejected', 'prompt', 'chosen_input_ids', 'chosen_attention_mask',\n"\ " 'chosen_labels', 'rejected_input_ids', 'rejected_attention_mask', 'rejected_labels',\n"\ @@ -1015,8 +1015,6 @@ def patch_sft_trainer_tokenizer(): check_text = "\n".join(" "*where + x for x in check_text) function = function.replace(replacer, check_text + replacer) - print(function) - raise exec(function, globals()) exec(f"trl.trainer.{path_to_trainer}.{function_name} = {function_name}", globals())