From eb868e0336432272fdf1b7e6884fa43d5d512c8d Mon Sep 17 00:00:00 2001 From: Bowen Yang <47682510+ybwowen@users.noreply.github.com> Date: Tue, 7 Oct 2025 23:51:38 +0800 Subject: [PATCH] allow unstrictly loading model In the latest release of safetensors, strictly loading the model will also compare the dtype. By setting strict=False, we allow load weights of different precisions. --- src/openpi/models/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openpi/models/model.py b/src/openpi/models/model.py index 29618b4945..24d419eb82 100644 --- a/src/openpi/models/model.py +++ b/src/openpi/models/model.py @@ -243,7 +243,7 @@ def load(self, params: at.Params, *, remove_extra_params: bool = True) -> "BaseM def load_pytorch(self, train_config, weight_path: str): logger.info(f"train_config: {train_config}") model = pi0_pytorch.PI0Pytorch(config=train_config.model) - safetensors.torch.load_model(model, weight_path) + safetensors.torch.load_model(model, weight_path, strict=False) return model @abc.abstractmethod