@@ -159,10 +159,8 @@ def train():
159159 training_args = HfTrainingArguments (** recipe .training .model_dump ())
160160 init_distributed_env (training_args )
161161
162- if not dry_run and not recipe .data .data_path and not recipe .data .offline_data_path :
163- raise ValueError (
164- "Either data.data_path or data.offline_data_path must be set in the config."
165- )
162+ if not dry_run and recipe .data .mode in ("online" , "streaming" ) and not recipe .data .data_path :
163+ raise ValueError (f"data.mode={ recipe .data .mode !r} requires data.data_path." )
166164 if training_args .cp_size > 1 :
167165 patch_ring_attention_for_ttt ()
168166 # Specific patch to accelerate 1.12.0. Removable after move to 1.13.0
@@ -181,7 +179,7 @@ def train():
181179
182180 checkpoint = training_args .resume_from_checkpoint or last_checkpoint
183181
184- use_offline_training = recipe .data .offline_data_path is not None
182+ use_offline_training = recipe .data .mode != "online"
185183
186184 if checkpoint :
187185 with patch_transformers5_params_loading ():
@@ -269,6 +267,7 @@ def train():
269267 train_len = training_args .training_seq_len ,
270268 answer_only_loss = training_args .answer_only_loss ,
271269 shift_labels = not is_dflash ,
270+ seed = training_args .seed ,
272271 )
273272
274273 callbacks = [EagleTrainingPlot (training_args .ar_validate_steps , training_args .estimate_ar )]
@@ -278,6 +277,13 @@ def train():
278277 and recipe .eagle .eagle_base_lora_warmup_steps > 0
279278 ):
280279 callbacks .append (LoRAWarmupCallback (recipe .eagle .eagle_base_lora_warmup_steps ))
280+ if recipe .data .mode == "streaming" :
281+ # Skip-on-resume happens inside the dataset (no re-fetch from server);
282+ # disable HF Trainer's own data skip so the offset isn't applied twice.
283+ from modelopt .torch .speculative .plugins .hf_streaming_dataset import StreamingResumeCallback
284+
285+ training_args .ignore_data_skip = True
286+ callbacks .append (StreamingResumeCallback ())
281287
282288 trainer = EagleTrainerWithAccLog (
283289 model = model ,
0 commit comments