From 9ae11a087debfa347843bb7639e31e2967eee083 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Wed, 10 Sep 2025 21:51:40 +0200 Subject: [PATCH] all test pass! and fix tokenizer max length between 05 and 0 --- push_pi0_to_hub.py | 2 +- .../policies/pi0_openpi/configuration_pi0openpi.py | 8 ++++---- test_pi0_hub.py => test_pi0_pi05_hub.py | 0 3 files changed, 5 insertions(+), 5 deletions(-) rename test_pi0_hub.py => test_pi0_pi05_hub.py (100%) diff --git a/push_pi0_to_hub.py b/push_pi0_to_hub.py index bb1db156b..bc238f0a5 100644 --- a/push_pi0_to_hub.py +++ b/push_pi0_to_hub.py @@ -51,7 +51,7 @@ def create_and_push_model( compile_model=False, device=None, # Auto-detect # Tokenizer settings - tokenizer_max_length=200, # see openpi `__post_init__`, use pi0=200 and pi05=48 + tokenizer_max_length=48, # see openpi `__post_init__`, use pi0=48 and pi05=200 ) print(f" - Config type: {config.__class__.__name__}") diff --git a/src/lerobot/policies/pi0_openpi/configuration_pi0openpi.py b/src/lerobot/policies/pi0_openpi/configuration_pi0openpi.py index 70a9130df..34e279ef6 100644 --- a/src/lerobot/policies/pi0_openpi/configuration_pi0openpi.py +++ b/src/lerobot/policies/pi0_openpi/configuration_pi0openpi.py @@ -53,7 +53,7 @@ from lerobot.optim.schedulers import CosineDecayWithWarmupSchedulerConfig # Time Conditioning | Concatenates time with actions via | Uses time_mlp_* for AdaRMS conditioning # | action_time_mlp_* | # AdaRMS | Not used | Used in action expert -# Tokenizer Length | 200 tokens | 48 tokens +# Tokenizer Length | 48 tokens | 200 tokens # discrete_state_input | False | True # Parameter Count | Higher (includes state_proj) | Lower (no state embedding) @@ -117,7 +117,7 @@ class PI0OpenPIConfig(PreTrainedConfig): scheduler_decay_steps: int = 30_000 scheduler_decay_lr: float = 2.5e-6 - tokenizer_max_length: int = 200 # pi0=200 and pi05=48, see openpi `__post_init__` + tokenizer_max_length: int = 48 # pi0=48 and pi05=200, see openpi `__post_init__` def __post_init__(self): super().__post_init__() @@ -128,9 +128,9 @@ class PI0OpenPIConfig(PreTrainedConfig): # Set tokenizer max length based on pi05 mode, see openpi `Pi0Config, __post_init__` if self.pi05: - self.tokenizer_max_length = 48 - else: self.tokenizer_max_length = 200 + else: + self.tokenizer_max_length = 48 # Validate configuration if self.n_action_steps > self.action_horizon: diff --git a/test_pi0_hub.py b/test_pi0_pi05_hub.py similarity index 100% rename from test_pi0_hub.py rename to test_pi0_pi05_hub.py