Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/trainer/trainer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,15 @@ def test_trainer(self, mock_load):
),
]
self.config.check_and_update()
old_taskset_path = self.config.stages[1].buffer.explorer_input.taskset.path
self.config.stages[1].buffer.explorer_input.taskset.path = "/invalid/path"

mock_load.return_value = self.config
mock_load.return_value = deepcopy(self.config)

run(config_path="dummy.yaml")
with self.assertRaises(Exception):
run(config_path="dummy.yaml")

stage_configs = [cfg.check_and_update() for cfg in self.config]
stage_configs = [cfg.check_and_update() for cfg in deepcopy(self.config)]

# sft warmup stage
sft_config = stage_configs[0]
Expand All @@ -351,6 +354,10 @@ def test_trainer(self, mock_load):
self.assertEqual(parser.metric_min_step(response_metrics[0]), 1)
self.assertEqual(parser.metric_max_step(response_metrics[0]), 3)

self.config.stages[1].buffer.explorer_input.taskset.path = old_taskset_path
mock_load.return_value = deepcopy(self.config)
run(config_path="dummy.yaml")

# grpo stage
grpo_config = stage_configs[1]
parser = TensorBoardParser(os.path.join(grpo_config.monitor.cache_dir, "tensorboard"))
Expand Down
1 change: 1 addition & 0 deletions trinity/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def run(config_path: str, dlc: bool = False, plugin_dir: str = None):
f"> Skipping completed stage {i + 1}/{len(config.stages)}...\n"
"==========================================================="
)
stage_config.check_and_update()
else:
logger.info(
"===========================================================\n"
Expand Down