#!/usr/bin/env python3 """tree_io.py — read a pretrained LIT tree snapshot with numpy. The C safetensors loader rejects checkpoints that contain duplicate keys, which an open-set tree produces. The snapshot arrays are standard safetensors tensors, so the render demos read them directly. """ import json import os import struct import sys import numpy as np ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.join(ROOT, "sandbox", "lerobot_host")) CKPT = os.path.join(ROOT, "sandbox", "lerobot_host", "community_open_pretrain.safetensors") REPO = "lerobot/community_dataset_v3" SUB = "00ri/so100_battery" LINK = (0.10, 0.12, 0.12, 0.08) _DT = {"U32": "