feat(dataset tools): support task replacement mappings in modify_tasks (#4244)

* Support task replacement mappings in modify_tasks

Part of #2326.

Signed-off-by: 陈伟 <woshei0a0a0a@qq.com>

* feat(task modification precedence): Improving task modification precedence so that all modes can be used in a single run. Adapting tests accordinginly.

* chore(fromat): formatting code

* docs(docstrings): updating docstrings

* docs(update): updating docs with the task modification features

---------

Signed-off-by: 陈伟 <woshei0a0a0a@qq.com>
Co-authored-by: vvezre <93599357+vvezre@users.noreply.github.com>
This commit is contained in:
Caroline Pascal
2026-07-31 13:25:53 +02:00
committed by GitHub
parent fc90a56c52
commit bff56dda2c
5 changed files with 180 additions and 22 deletions
@@ -105,6 +105,23 @@ class TestOperationTypeParsing:
resolved_name = OperationConfig.get_choice_name(type(cfg.operation))
assert resolved_name == type_name
def test_modify_tasks_replacements_args_parse(self):
cfg = parse_cfg(
[
"--repo_id",
"test/repo",
"--operation.type",
"modify_tasks",
"--operation.task_replacements",
'{"task_0": "pick cube", "task_1": "place cube"}',
]
)
assert isinstance(cfg.operation, ModifyTasksConfig)
assert cfg.operation.task_replacements == {
"task_0": "pick cube",
"task_1": "place cube",
}
class TestDepthEncoderParsing:
"""Test that the depth encoder is exposed and parsed for video operations."""