mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 17:56:07 +00:00
Correct way of identifying when to save config
This commit is contained in:
@@ -99,7 +99,7 @@ def save_checkpoint(
|
|||||||
pretrained_dir = checkpoint_dir / PRETRAINED_MODEL_DIR
|
pretrained_dir = checkpoint_dir / PRETRAINED_MODEL_DIR
|
||||||
policy.save_pretrained(pretrained_dir)
|
policy.save_pretrained(pretrained_dir)
|
||||||
cfg.save_pretrained(pretrained_dir)
|
cfg.save_pretrained(pretrained_dir)
|
||||||
if cfg.use_peft:
|
if cfg.peft is not None:
|
||||||
# When using PEFT, policy.save_pretrained will only write the adapter weights + config, not the
|
# When using PEFT, policy.save_pretrained will only write the adapter weights + config, not the
|
||||||
# policy config which we need for loading the model. In this case we'll write it ourselves.
|
# policy config which we need for loading the model. In this case we'll write it ourselves.
|
||||||
policy.config.save_pretrained(pretrained_dir)
|
policy.config.save_pretrained(pretrained_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user