--- license: apache-2.0 task_categories: - robotics tags: - robotics - text-embeddings - t5 - wan2.2 size_categories: - 1M {len(ks)} files", flush=True) with ThreadPoolExecutor(4) as ex: list(ex.map(do, range(NSHARD))) ``` Expands to ~1 TB across 1,039,891 files. Point `text_embedding_cache_dir` at `out` afterwards. To pull only part of it, pass a subset of shard indices — each shard is self-describing. ## Random access without unpacking Resolve one prompt to its shard and read only that row; `get_slice` avoids loading the 2 GB shard: ```python import bisect, hashlib, json from huggingface_hub import hf_hub_download from safetensors import safe_open REPO, SHARD = "flex-pi/robotwin_3d_text_embeds_cache", 2000 TPL = "A video recorded from a robot's point of view executing the following instruction: {task}" keys = open(hf_hub_download(REPO, "manifest.txt", repo_type="dataset")).read().split() def get(task): h = hashlib.sha256(TPL.format(task=task).encode("utf-8")).hexdigest() i = bisect.bisect_left(keys, h) if i == len(keys) or keys[i] != h: raise KeyError(task) p = hf_hub_download(REPO, f"shards/shard_{i // SHARD:05d}.safetensors", repo_type="dataset") with safe_open(p, framework="pt") as f: r = i % SHARD return f.get_slice("contexts")[r], f.get_slice("masks")[r] ctx, mask = get("Lift the medium-sized green bottle ensuring it remains upright.") print(ctx.shape, ctx.dtype, int(mask.sum())) # torch.Size([128, 4096]) torch.bfloat16 49 ``` ## Provenance Repacked byte-exactly from the original per-prompt `.pt` cache; tensors are bit-identical, verified by round-trip comparison against the source files. Encoder UMT5-XXL, context length 128, bfloat16.