diff --git a/src/lerobot/datasets/dataset_tools.py b/src/lerobot/datasets/dataset_tools.py index cc9fea20c..9b397f299 100644 --- a/src/lerobot/datasets/dataset_tools.py +++ b/src/lerobot/datasets/dataset_tools.py @@ -1444,7 +1444,7 @@ def modify_tasks( 2. Set specific tasks for specific episodes (using `episode_tasks`) 3. Replace existing task strings wherever they appear (using `task_replacements`) - You can combine all of them: `new_task` sets the default, while `episode_tasks` and + You can combine all of them: `new_task` sets the default, while `episode_tasks` and `task_replacements` override specific episodes, with `episode_tasks` taking precedence. The dataset is modified in-place, updating only the task-related files: diff --git a/tests/datasets/test_dataset_tools.py b/tests/datasets/test_dataset_tools.py index 72928b1f0..95c94f22c 100644 --- a/tests/datasets/test_dataset_tools.py +++ b/tests/datasets/test_dataset_tools.py @@ -1177,7 +1177,9 @@ def test_modify_tasks_default_task_and_replacements(sample_dataset): def test_modify_tasks_no_task_specified(sample_dataset): """Test error when no task is specified.""" - with pytest.raises(ValueError, match="Must specify at least one of new_task, episode_tasks, or task_replacements"): + with pytest.raises( + ValueError, match="Must specify at least one of new_task, episode_tasks, or task_replacements" + ): modify_tasks(sample_dataset)