@@ -114,6 +114,10 @@ def get_dataset(
114114 )
115115
116116 template_config = load_data_template_from_file (tmvp_config .chat_template_path )
117+ if template_config is None :
118+ raise ValueError (
119+ f"Chat template is required for processing dataset but failed to load from { tmvp_config .chat_template_path } "
120+ )
117121
118122 loaded_dataset = (
119123 grain .MapDataset .source (data )
@@ -231,6 +235,10 @@ def prepare_openinstructmath2_dataset(
231235 split_name = trainer_config .train_split if trainer_config .train_split != "train" else "train_1M"
232236 splits = prepare_openinstructmath2_dataset (split = split_name )
233237 template_config = load_data_template_from_file (trainer_config .chat_template_path )
238+ if template_config is None :
239+ raise ValueError (
240+ f"Chat template is required for processing dataset but failed to load from { trainer_config .chat_template_path } "
241+ )
234242
235243 train_dataset = (
236244 grain .MapDataset .source (splits ["train" ])
@@ -401,7 +409,6 @@ def create_rl_components(
401409 rollout_vllm_model_version = trainer_config .tokenizer_path ,
402410 rollout_vllm_hbm_utilization = trainer_config .hbm_utilization_vllm ,
403411 rollout_vllm_tpu_backend_type = "jax" ,
404- rollout_vllm_swap_space_size_gb = trainer_config .swap_space_vllm_gb ,
405412 rollout_vllm_hf_config_path = trainer_config .vllm_hf_config_path ,
406413 rollout_vllm_additional_config = rollout_additional_config ,
407414 rollout_vllm_init_with_random_weights = True ,
@@ -495,6 +502,10 @@ def _reward_fn(**kwargs):
495502 )
496503 # Instantiate the custom MaxText chat parser
497504 template_config = load_data_template_from_file (trainer_config .chat_template_path )
505+ if template_config is None :
506+ raise ValueError (
507+ f"Chat template is required for AgenticGRPOLearner but failed to load from { trainer_config .chat_template_path } "
508+ )
498509 chat_parser = utils_rl .MaxTextChatParser (
499510 model_tokenizer = model_tokenizer , template_config = template_config , tmvp_config = trainer_config
500511 )
0 commit comments