Downloads · 30 days
37
1% of all-time downloads
HaomingSong/lerobot-pi0-bridge
lerobot-pi0-bridge is a machine learning model from HaomingSong. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for lerobot. The card lists the license as mit.
Downloads · 30 days
37
1% of all-time downloads
All-time downloads
7.4K
Public
Parameters
3.2B
6.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors6.5 GB · 99%
How the weights are stored.
BF163.2B · 100%
From the Hugging Face model README
download the model
huggingface-cli download --resume-download --local-dir-use-symlinks False ${model} --local-dir $(basename ${model})
install the lerobot package first
def auto_model_from_pretrained(path, **kwargs):
import sys
sys.path.append(path) # noqa
map_location = kwargs.pop("map_location", "cpu")
from modeling_pi0 import PI0Policy
return PI0Policy.from_pretrained(path, **kwargs).to(map_location)
policy = auto_model_from_pretrained(saved_model_path, map_location="cuda")
state = torch.rand(8)
image = np.array(Image.open("test/example.png"))
image = torch.from_numpy(image / 255).permute(2, 0, 1)
observation = {
"observation.state": state.unsqueeze(0).to("cuda"),
"observation.images.image_0": image.unsqueeze(0).to("cuda"),
"task": ["put the object in the box"],
}
action_chunk = policy.select_action(observation)[0].cpu().numpy()