From 8ea0ed73994b829671e704c962f6410312a356d6 Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Mon, 26 May 2025 10:34:16 +0200 Subject: [PATCH] fix(scripts): parser instead of draccus in record + add __get_path_fields__() to RecordConfig --- lerobot/record.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lerobot/record.py b/lerobot/record.py index 6ddeb23b7a..733955b1bc 100644 --- a/lerobot/record.py +++ b/lerobot/record.py @@ -38,7 +38,6 @@ from pathlib import Path from pprint import pformat -import draccus import numpy as np import rerun as rr @@ -151,6 +150,11 @@ def __post_init__(self): self.policy = PreTrainedConfig.from_pretrained(policy_path, cli_overrides=cli_overrides) self.policy.pretrained_path = policy_path + @classmethod + def __get_path_fields__(cls) -> list[str]: + """This enables the parser to load config from the policy using `--policy.path=local/dir`""" + return ["policy"] + @safe_stop_image_writer def record_loop( @@ -220,7 +224,7 @@ def record_loop( break -@draccus.wrap() +@parser.wrap() def record(cfg: RecordConfig) -> LeRobotDataset: init_logging() logging.info(pformat(asdict(cfg)))