mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-24 13:09:43 +00:00
Turn off compilation for pi0/pi05
This commit is contained in:
@@ -256,7 +256,9 @@ class RTCEvaluator:
|
|||||||
|
|
||||||
# Load policy from pretrained
|
# Load policy from pretrained
|
||||||
policy_class = get_policy_class(self.cfg.policy.type)
|
policy_class = get_policy_class(self.cfg.policy.type)
|
||||||
policy = policy_class.from_pretrained(self.cfg.policy.pretrained_path)
|
|
||||||
|
config = PreTrainedConfig.from_pretrained(self.cfg.policy.pretrained_path)
|
||||||
|
policy = policy_class.from_pretrained(self.cfg.policy.pretrained_path, config=config)
|
||||||
policy = policy.to(self.device)
|
policy = policy.to(self.device)
|
||||||
policy.eval()
|
policy.eval()
|
||||||
|
|
||||||
@@ -292,6 +294,11 @@ class RTCEvaluator:
|
|||||||
Returns:
|
Returns:
|
||||||
Policy with compiled predict_action_chunk method
|
Policy with compiled predict_action_chunk method
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# PI models handle their own compilation
|
||||||
|
if policy.type == "pi05" or policy.type == "pi0":
|
||||||
|
return policy
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Check if torch.compile is available (PyTorch 2.0+)
|
# Check if torch.compile is available (PyTorch 2.0+)
|
||||||
if not hasattr(torch, "compile"):
|
if not hasattr(torch, "compile"):
|
||||||
|
|||||||
Reference in New Issue
Block a user