mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-05 09:07:03 +00:00
Don't unload & merge the PEFT model
This can make things hard when using quantized layers (user expects quantized base layers with unquantized adapters for example, merging defaults to upcast the layers leading to higher memory).
This commit is contained in:
@@ -446,10 +446,6 @@ def record(cfg: RecordConfig) -> LeRobotDataset:
|
||||
policy = make_policy(cfg.policy, ds_meta=dataset.meta)
|
||||
policy = PeftModel.from_pretrained(policy, peft_path)
|
||||
|
||||
# it is not necessary to merge and unload but for methods that support merging,
|
||||
# it brings inference performance benefits.
|
||||
policy = policy.merge_and_unload()
|
||||
|
||||
else:
|
||||
policy = None if cfg.policy is None else make_policy(cfg.policy, ds_meta=dataset.meta)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user