Fix/patch tokenizer (#1171)
* fix: correct tokenizer handling in patch_sft_trainer_tokenizer * Revert "fix: correct tokenizer handling in patch_sft_trainer_tokenizer" This reverts commit 7a98e465cbd4f980c8b364b0396d44f2d052090f. * fix: correct condition for test_text assignment in patch_sft_trainer_tokenizer
This commit is contained in:
parent
e5e67f83b4
commit
f402d945ff
1 changed files with 1 additions and 1 deletions
|
|
@ -915,7 +915,7 @@ def patch_sft_trainer_tokenizer():
|
|||
check_text = \
|
||||
"\n"\
|
||||
"if 'tokenizer' not in locals(): tokenizer = processing_class\n"\
|
||||
"test_text = dataset[0][dataset_text_field] if (formatting_func is not None and dataset_text_field is None) else formatting_func(dataset[0])[0]\n"\
|
||||
"test_text = dataset[0][dataset_text_field] if (formatting_func is None and dataset_text_field is not None) else formatting_func(dataset[0])[0]\n"\
|
||||
"chat_template = getattr(tokenizer, 'chat_template', None)\n"\
|
||||
"chat_template = '' if chat_template is None else chat_template\n"\
|
||||
"has_bos_token_already = (test_text.startswith(tokenizer.bos_token) or tokenizer.bos_token in chat_template) "\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue