Fix config parsing

This commit is contained in:
Simon Alibert
2025-05-08 12:59:15 +02:00
parent a0e69dd708
commit 73ac4f38b2
3 changed files with 4 additions and 5 deletions

View File

@@ -26,7 +26,6 @@ from lerobot.common.utils.utils import has_method
PATH_KEY = "path"
PLUGIN_DISCOVERY_SUFFIX = "discover_packages_path"
draccus.set_config_type("json")
def get_cli_overrides(field_name: str, args: Sequence[str] | None = None) -> list[str] | None:

View File

@@ -173,4 +173,5 @@ class PreTrainedConfig(draccus.ChoiceRegistry, HubMixin, abc.ABC):
# HACK: this is very ugly, ideally we'd like to be able to do that natively with draccus
# something like --policy.path (in addition to --policy.type)
cli_overrides = policy_kwargs.pop("cli_overrides", [])
return draccus.parse(cls, config_file, args=cli_overrides)
with draccus.config_type("json"):
return draccus.parse(cls, config_file, args=cli_overrides)

View File

@@ -170,6 +170,5 @@ class TrainPipelineConfig(HubMixin):
) from e
cli_args = kwargs.pop("cli_args", [])
cfg = draccus.parse(cls, config_file, args=cli_args)
return cfg
with draccus.config_type("json"):
return draccus.parse(cls, config_file, args=cli_args)