fix override self.pretrained_path = None overwrite

This commit is contained in:
Pepijn
2025-09-13 14:50:43 +02:00
parent 6db39cad58
commit 7d9b469eee
3 changed files with 3 additions and 7 deletions

View File

@@ -72,9 +72,11 @@ class PreTrainedConfig(draccus.ChoiceRegistry, HubMixin, abc.ABC):
tags: list[str] | None = None
# Add tags to your policy on the hub.
license: str | None = None
# Either the repo ID of a model hosted on the Hub or a path to a directory containing weights
# saved using `Policy.save_pretrained`. If not provided, the policy is initialized from scratch.
pretrained_path: str | None = None
def __post_init__(self):
self.pretrained_path = None
if not self.device or not is_torch_device_available(self.device):
auto_device = auto_select_torch_device()
logging.warning(f"Device '{self.device}' is not available. Switching to '{auto_device}'.")

View File

@@ -66,9 +66,6 @@ class PI05OpenPIConfig(PreTrainedConfig):
compile_mode: str = "max-autotune" # Torch compile mode
device: str | None = None # Device to use for the model (None = auto-detect)
# Pretrained model loading
pretrained_path: str | None = "pepijn223/pi0_base_fp32" # Path or repo_id to load pretrained weights from
# Optimizer settings: see openpi `AdamW` and
optimizer_lr: float = 2.5e-5 # see openpi `CosineDecaySchedule: peak_lr`
optimizer_betas: tuple[float, float] = (0.9, 0.95)

View File

@@ -63,9 +63,6 @@ class PI0OpenPIConfig(PreTrainedConfig):
compile_mode: str = "max-autotune" # Torch compile mode
device: str | None = None # Device to use for the model (None = auto-detect)
# Pretrained model loading
pretrained_path: str | None = "pepijn223/pi0_base_fp32" # Path or repo_id to load pretrained weights from
# Optimizer settings: see openpi `AdamW` and
optimizer_lr: float = 2.5e-5 # see openpi `CosineDecaySchedule: peak_lr`
optimizer_betas: tuple[float, float] = (0.9, 0.95)