mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-22 12:09:42 +00:00
renaming
This commit is contained in:
@@ -144,7 +144,6 @@ python src/lerobot/scripts/eval.py \
|
|||||||
--eval.batch_size=1 \
|
--eval.batch_size=1 \
|
||||||
--eval.n_episodes=5 \
|
--eval.n_episodes=5 \
|
||||||
--policy.path=pepijn223/pi0_libero_fp32 \
|
--policy.path=pepijn223/pi0_libero_fp32 \
|
||||||
--env.multitask_eval=true \
|
|
||||||
--output_dir=./eval_logs/ \
|
--output_dir=./eval_logs/ \
|
||||||
--policy.compile_model=false \
|
--policy.compile_model=false \
|
||||||
--policy.gradient_checkpointing=false \
|
--policy.gradient_checkpointing=false \
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ from lerobot.optim.schedulers import CosineDecayWithWarmupSchedulerConfig
|
|||||||
|
|
||||||
@PreTrainedConfig.register_subclass("pi0")
|
@PreTrainedConfig.register_subclass("pi0")
|
||||||
@dataclass
|
@dataclass
|
||||||
class PI0OpenPIConfig(PreTrainedConfig):
|
class PI0Config(PreTrainedConfig):
|
||||||
# Model architecture
|
# Model architecture
|
||||||
paligemma_variant: str = "gemma_2b"
|
paligemma_variant: str = "gemma_2b"
|
||||||
action_expert_variant: str = "gemma_300m"
|
action_expert_variant: str = "gemma_300m"
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ class PI0Policy(PreTrainedPolicy):
|
|||||||
) -> T:
|
) -> T:
|
||||||
"""Override the from_pretrained method to handle key remapping and display important disclaimer."""
|
"""Override the from_pretrained method to handle key remapping and display important disclaimer."""
|
||||||
print(
|
print(
|
||||||
"⚠️ DISCLAIMER: The PI0OpenPI model is a direct PyTorch port of the OpenPI implementation. \n"
|
"⚠️ DISCLAIMER: The PI0 model is a direct PyTorch port of the OpenPI implementation. \n"
|
||||||
" This implementation follows the original OpenPI structure for compatibility. \n"
|
" This implementation follows the original OpenPI structure for compatibility. \n"
|
||||||
" Original implementation: https://github.com/Physical-Intelligence/openpi"
|
" Original implementation: https://github.com/Physical-Intelligence/openpi"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ from transformers.models.paligemma.modeling_paligemma import PaliGemmaForConditi
|
|||||||
from lerobot.configs.policies import PreTrainedConfig
|
from lerobot.configs.policies import PreTrainedConfig
|
||||||
from lerobot.constants import ACTION, OBS_STATE
|
from lerobot.constants import ACTION, OBS_STATE
|
||||||
from lerobot.policies.normalize import Normalize, Unnormalize
|
from lerobot.policies.normalize import Normalize, Unnormalize
|
||||||
from lerobot.policies.pi05.configuration_pi05openpi import PI05Config
|
from lerobot.policies.pi05.configuration_pi05 import PI05Config
|
||||||
from lerobot.policies.pretrained import PreTrainedPolicy, T
|
from lerobot.policies.pretrained import PreTrainedPolicy, T
|
||||||
|
|
||||||
|
|
||||||
@@ -874,7 +874,7 @@ class PI05Policy(PreTrainedPolicy):
|
|||||||
) -> T:
|
) -> T:
|
||||||
"""Override the from_pretrained method to handle key remapping and display important disclaimer."""
|
"""Override the from_pretrained method to handle key remapping and display important disclaimer."""
|
||||||
print(
|
print(
|
||||||
"⚠️ DISCLAIMER: The PI05OpenPI model is a direct PyTorch port of the OpenPI implementation. \n"
|
"⚠️ DISCLAIMER: The PI05 model is a direct PyTorch port of the OpenPI implementation. \n"
|
||||||
" This implementation follows the original OpenPI structure for compatibility. \n"
|
" This implementation follows the original OpenPI structure for compatibility. \n"
|
||||||
" Original implementation: https://github.com/Physical-Intelligence/openpi"
|
" Original implementation: https://github.com/Physical-Intelligence/openpi"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
"""Test script to verify PI0.5 (pi05) support in PI0OpenPI policy, only meant to be run locally!"""
|
"""Test script to verify PI0.5 (pi05) support in PI0 policy, only meant to be run locally!"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
"""Test script to verify PI0OpenPI policy integration with LeRobot, only meant to be run locally!"""
|
"""Test script to verify PI0 policy integration with LeRobot, only meant to be run locally!"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -14,14 +14,14 @@ pytestmark = pytest.mark.skipif(
|
|||||||
)
|
)
|
||||||
|
|
||||||
from lerobot.policies.factory import make_policy_config # noqa: E402
|
from lerobot.policies.factory import make_policy_config # noqa: E402
|
||||||
from lerobot.policies.pi0 import PI0OpenPIConfig, PI0OpenPIPolicy # noqa: E402
|
from lerobot.policies.pi0 import PI0Config, PI0Policy # noqa: E402
|
||||||
from tests.utils import require_cuda # noqa: E402
|
from tests.utils import require_cuda # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
@require_cuda
|
@require_cuda
|
||||||
def test_policy_instantiation():
|
def test_policy_instantiation():
|
||||||
# Create config
|
# Create config
|
||||||
config = PI0OpenPIConfig(max_action_dim=7, max_state_dim=14, dtype="float32")
|
config = PI0Config(max_action_dim=7, max_state_dim=14, dtype="float32")
|
||||||
|
|
||||||
# Set up input_features and output_features in the config
|
# Set up input_features and output_features in the config
|
||||||
from lerobot.configs.types import FeatureType, PolicyFeature
|
from lerobot.configs.types import FeatureType, PolicyFeature
|
||||||
@@ -61,7 +61,7 @@ def test_policy_instantiation():
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Instantiate policy
|
# Instantiate policy
|
||||||
policy = PI0OpenPIPolicy(config, dataset_stats)
|
policy = PI0Policy(config, dataset_stats)
|
||||||
|
|
||||||
# Test forward pass with dummy data
|
# Test forward pass with dummy data
|
||||||
batch_size = 1
|
batch_size = 1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
"""Test script to verify PI0OpenPI policy integration with LeRobot vs the original implementation, only meant to be run locally!"""
|
"""Test script to verify PI0 policy integration with LeRobot vs the original implementation, only meant to be run locally!"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# TODO(pepijn): Remove these tests before merging
|
# TODO(pepijn): Remove these tests before merging
|
||||||
|
|
||||||
"""Test script to load PI0OpenPI model from HuggingFace hub and run inference."""
|
"""Test script to load PI0 model from HuggingFace hub and run inference."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user