forked from tangger/lerobot
Fix config parsing
This commit is contained in:
@@ -26,7 +26,6 @@ from lerobot.common.utils.utils import has_method
|
|||||||
|
|
||||||
PATH_KEY = "path"
|
PATH_KEY = "path"
|
||||||
PLUGIN_DISCOVERY_SUFFIX = "discover_packages_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:
|
def get_cli_overrides(field_name: str, args: Sequence[str] | None = None) -> list[str] | None:
|
||||||
|
|||||||
@@ -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
|
# 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)
|
# something like --policy.path (in addition to --policy.type)
|
||||||
cli_overrides = policy_kwargs.pop("cli_overrides", [])
|
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)
|
||||||
|
|||||||
@@ -170,6 +170,5 @@ class TrainPipelineConfig(HubMixin):
|
|||||||
) from e
|
) from e
|
||||||
|
|
||||||
cli_args = kwargs.pop("cli_args", [])
|
cli_args = kwargs.pop("cli_args", [])
|
||||||
cfg = draccus.parse(cls, config_file, args=cli_args)
|
with draccus.config_type("json"):
|
||||||
|
return draccus.parse(cls, config_file, args=cli_args)
|
||||||
return cfg
|
|
||||||
|
|||||||
Reference in New Issue
Block a user