code-Psi0-yth-v21 / scripts /data /fix_lerobot_parquet.py
Tinghong-Ye22's picture
Add files using upload-large-folder tool
c4f8e4a verified
Raw History Blame Contribute Delete
381 Bytes
import sys
from pathlib import Path
import pyarrow.parquet as pq
for path in Path(sys.argv[1]).rglob("*.parquet"):
table = pq.read_table(path)
meta = dict(table.schema.metadata or {})
meta.pop(b"huggingface", None)
tmp = path.with_suffix(".tmp")
pq.write_table(table.replace_schema_metadata(meta or None), tmp)
print("fixing ", path)
tmp.replace(path)