Kavin60606 commited on
Commit
c6064aa
·
verified ·
1 Parent(s): ff36ee6

Upload transform_batch.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. transform_batch.py +5 -1
transform_batch.py CHANGED
@@ -138,7 +138,11 @@ def _materialize(cache: Path, subset: str, ep: int, out_root: Path) -> str:
138
  table = table.filter(pc.equal(table["episode_index"], ep)).select(KP_COLS)
139
  mat = out_root / "materialized" / subset / "data" / "chunk-000"
140
  mat.mkdir(parents=True, exist_ok=True)
141
- out = mat / f"file-{ep:06d}.parquet"
 
 
 
 
142
  pq.write_table(table, out)
143
  return str(out)
144
 
 
138
  table = table.filter(pc.equal(table["episode_index"], ep)).select(KP_COLS)
139
  mat = out_root / "materialized" / subset / "data" / "chunk-000"
140
  mat.mkdir(parents=True, exist_ok=True)
141
+ # Name by SUBSET + episode. The retarget output dir is clip_<this-file-stem>, and episode numbers
142
+ # repeat across categories (tools#157, dice_balls#157, …) — naming by episode alone made them
143
+ # collide and OVERWRITE, silently dropping ~79% of clips. Subset uses "_" (never "-"), so
144
+ # prep_lerobot's `clip.split("-")[1]` still recovers the episode from "<subset>__file-000157".
145
+ out = mat / f"{subset}__file-{ep:06d}.parquet"
146
  pq.write_table(table, out)
147
  return str(out)
148