mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 11:09:59 +00:00
fix(train): restrict legacy RA-BC migration to JSON checkpoints only (#3490)
* fix(train): restrict legacy RA-BC migration to JSON checkpoints only
_migrate_legacy_rabc_fields was called for all config files, causing
json.load to raise DecodeError when a YAML/TOML config was passed to
lerobot-train for a new training run. Guard the block with an
.endswith(".json") check so migration only runs when resuming from
a JSON checkpoint.
This commit is contained in:
@@ -256,7 +256,9 @@ class TrainPipelineConfig(HubMixin):
|
|||||||
) from e
|
) from e
|
||||||
|
|
||||||
cli_args = kwargs.pop("cli_args", [])
|
cli_args = kwargs.pop("cli_args", [])
|
||||||
if config_file is not None:
|
# Legacy RA-BC migration only applies to framework-saved checkpoints (always JSON).
|
||||||
|
# Hand-written YAML/TOML configs are expected to use the current sample_weighting schema.
|
||||||
|
if config_file is not None and config_file.endswith(".json"):
|
||||||
with open(config_file) as f:
|
with open(config_file) as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
migrated_config = _migrate_legacy_rabc_fields(config)
|
migrated_config = _migrate_legacy_rabc_fields(config)
|
||||||
|
|||||||
Reference in New Issue
Block a user