@@ -334,7 +334,7 @@ def get_filtered_data_side_effect(dataset_name, model_tokenizer, template_config
334334 eval_split = "eval" ,
335335 hf_train_files = None ,
336336 hf_eval_files = None ,
337- chat_template_path = "maxtext/examples/chat_templates/gsm8k_rl.json" ,
337+ data_template_path = "maxtext/examples/chat_templates/gsm8k_rl.json" ,
338338 data_shuffle_seed = 42 ,
339339 max_prefill_predict_length = 10 ,
340340 batch_size = 2 ,
@@ -389,7 +389,7 @@ def test_prepare_datasets_with_split(self, mock_load):
389389 eval_dataset_name = "open-r1/OpenR1-Math-220k" ,
390390 train_split = "train" ,
391391 hf_train_files = "hf://open-r1/OpenR1-Math-220k/data/dummy.parquet" ,
392- chat_template_path = "maxtext/examples/chat_templates/gsm8k_rl.json" ,
392+ data_template_path = "maxtext/examples/chat_templates/gsm8k_rl.json" ,
393393 data_shuffle_seed = 42 ,
394394 num_batches = 1 ,
395395 batch_size = 5 ,
@@ -435,7 +435,7 @@ def test_prepare_datasets_without_split(self, mock_load):
435435 eval_split = "test" ,
436436 hf_train_files = "hf://openai/gsm8k/data/dummy.parquet" ,
437437 hf_eval_files = "hf://openai/gsm8k/data/dummy.parquet" ,
438- chat_template_path = "maxtext/examples/chat_templates/gsm8k_rl.json" ,
438+ data_template_path = "maxtext/examples/chat_templates/gsm8k_rl.json" ,
439439 data_shuffle_seed = 42 ,
440440 num_batches = 1 ,
441441 batch_size = 5 ,
@@ -482,7 +482,7 @@ def test_chat_template_populated_from_config_string(self):
482482 mock_tokenizer .chat_template = None
483483 trainer_config = SimpleNamespace (
484484 chat_template = "{{ messages[0].content }}" ,
485- tokenizer_chat_template_path = None ,
485+ chat_template_path = None ,
486486 tokenizer_path = "dummy-base-model" ,
487487 )
488488 train_rl .configure_tokenizer_chat_template (mock_tokenizer , trainer_config )
@@ -491,13 +491,13 @@ def test_chat_template_populated_from_config_string(self):
491491 @pytest .mark .cpu_only
492492 @mock .patch ("maxtext.input_pipeline.instruction_data_processing.load_chat_template_from_file" )
493493 def test_chat_template_populated_from_config_file (self , mock_load ):
494- """Test that chat_template is loaded from tokenizer_chat_template_path when tokenizer lacks one."""
494+ """Test that chat_template is loaded from chat_template_path when tokenizer lacks one."""
495495 mock_tokenizer = mock .MagicMock ()
496496 mock_tokenizer .chat_template = None
497497 mock_load .return_value = "{% for message in messages %}{{ message.content }}{% endfor %}"
498498 trainer_config = SimpleNamespace (
499499 chat_template = None ,
500- tokenizer_chat_template_path = "/path/to/jinja_template.json" ,
500+ chat_template_path = "/path/to/jinja_template.json" ,
501501 tokenizer_path = "dummy-base-model" ,
502502 )
503503 train_rl .configure_tokenizer_chat_template (mock_tokenizer , trainer_config )
@@ -513,7 +513,7 @@ def test_chat_template_raises_value_error_when_empty(self):
513513 mock_tokenizer .chat_template = None
514514 trainer_config = SimpleNamespace (
515515 chat_template = None ,
516- tokenizer_chat_template_path = None ,
516+ chat_template_path = None ,
517517 tokenizer_path = "dummy-base-model" ,
518518 )
519519 with self .assertRaisesRegex (ValueError , "Tokenizer 'dummy-base-model' has no chat_template" ):
@@ -526,7 +526,7 @@ def test_chat_template_unchanged_when_already_exists(self):
526526 mock_tokenizer .chat_template = "{{ existing_template }}"
527527 trainer_config = SimpleNamespace (
528528 chat_template = "{{ overridden_template }}" ,
529- tokenizer_chat_template_path = None ,
529+ chat_template_path = None ,
530530 tokenizer_path = "dummy-instruction-tuned-model" ,
531531 )
532532 train_rl .configure_tokenizer_chat_template (mock_tokenizer , trainer_config )
@@ -549,7 +549,7 @@ def apply_chat_template(self, conversation, tokenize=False):
549549 tokenizer = DummyTokenizer ()
550550 trainer_config = SimpleNamespace (
551551 chat_template = "{{ messages[0].content }}" ,
552- tokenizer_chat_template_path = None ,
552+ chat_template_path = None ,
553553 tokenizer_path = "dummy-base-model" ,
554554 )
555555 # Initially, apply_chat_template fails (simulating HF tokenizer crash when chat_template is None)
0 commit comments