index: pinned historical training datasets and protected source-file snapshots
Browse files- CHECKSUMS.sha256 +4 -0
- README.md +51 -0
- TRAINING_DATA_INDEX.json +0 -0
- fetch_training_data.py +53 -0
- restore_legacy_mix6.py +40 -0
CHECKSUMS.sha256
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1051987a2cdeeeb668c457cf4818d46a1c8e2f5df40cbdcf98da68377dedf246 README.md
|
| 2 |
+
2569cdcdb30128ffb7d1f178a2669580ead36e532f9f8c65a67f0f25c543caaf TRAINING_DATA_INDEX.json
|
| 3 |
+
67acb0f58a052ce7fd309e50cdaf473a9880bc31a8d1c7f68212d528088d275c fetch_training_data.py
|
| 4 |
+
4cd8ba59a93ab631419f29b61153ab8024cc7392f81fca1e0470c400144c8826 restore_legacy_mix6.py
|
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: training-data-location-index-only
|
| 4 |
+
license_link: https://huggingface.co/datasets/diffusion-gif/training-data-index/blob/main/README.md
|
| 5 |
+
---
|
| 6 |
+
# Previous training data: versioned location and checksum index
|
| 7 |
+
|
| 8 |
+
`TRAINING_DATA_INDEX.json` tells you which retained training inputs belong to
|
| 9 |
+
which model, their original/current snapshot roles, exact file SHA256/size,
|
| 10 |
+
and an immutable owner-authorized private backup revision. The same index is
|
| 11 |
+
attached at the roots of `diffusion-gif/any2ego` and `diffusion-gif/trick-prediction`.
|
| 12 |
+
No original restricted annotation bodies, credentials or original machine paths
|
| 13 |
+
are in this public index. This index is not a license grant for source data.
|
| 14 |
+
|
| 15 |
+
## Important distinctions
|
| 16 |
+
|
| 17 |
+
- Legacy mix6 SFT step900: train16,174 / heldout3,228; old multi-point protocol.
|
| 18 |
+
- Legacy mix6 GRPO step250: the corresponding original train/heldout Parquet,
|
| 19 |
+
8 embedded observation-frame data URIs per record and identical SID sets.
|
| 20 |
+
- All19,402 original mix6 NPZ observations and old JSON/Parquet are privately
|
| 21 |
+
preserved byte-for-byte, with independent tar-member checksum readback.
|
| 22 |
+
- The later joint dataset31,202/5,015 and public simulation subset17,421 records
|
| 23 |
+
must not be substituted as the original training data of those old weights.
|
| 24 |
+
- Any2Ego original JSON/CSV, full PhiSeg source manifests and the common32,558
|
| 25 |
+
export are separate snapshots. Captioner trainer args identify their source
|
| 26 |
+
JSON files; generator per-component launch-time subset hashes were not saved.
|
| 27 |
+
|
| 28 |
+
The index records **retained file snapshot hashes**, not nonexistent hashes
|
| 29 |
+
from the original training launch. The large Ego-Exo original RGB/GT-mask pool
|
| 30 |
+
is NOT remotely backed up here. Original-run data identity and permanent
|
| 31 |
+
third-party availability cannot be guaranteed merely by a JSON index.
|
| 32 |
+
|
| 33 |
+
## Fetch your original training files
|
| 34 |
+
|
| 35 |
+
Use an account authorized for the PRIVATE vault. Log in locally; do not put a
|
| 36 |
+
real token in scripts or chat. This keeps gated/restricted annotations private.
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
pip install huggingface_hub
|
| 40 |
+
hf auth login
|
| 41 |
+
python fetch_training_data.py --index TRAINING_DATA_INDEX.json --dataset legacy_mix6_sft --output data_download
|
| 42 |
+
# inspect the dry-run plan, then:
|
| 43 |
+
python fetch_training_data.py --index TRAINING_DATA_INDEX.json --dataset legacy_mix6_sft --output data_download --execute
|
| 44 |
+
python restore_legacy_mix6.py --snapshot-root data_download/snapshots/20261104 --output ready_mix6 --execute
|
| 45 |
+
# GRPO: choose --dataset legacy_mix6_grpo; --dataset all_private fetches the entire protected snapshot.
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
Downloads are pinned to immutable commits, verify exact hashes, and never
|
| 49 |
+
overwrite a different existing user file. The restore helper changes only
|
| 50 |
+
`npz`/`frames_root` in WORKING JSON copies; all frozen originals remain intact.
|
| 51 |
+
Keep a separate local/private copy for long-term availability.
|
TRAINING_DATA_INDEX.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fetch_training_data.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Fetch pinned training files from the JSON index; dry-run unless --execute."""
|
| 3 |
+
import argparse,hashlib,json,shutil
|
| 4 |
+
from pathlib import Path,PurePosixPath
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def safe(value):
|
| 8 |
+
p=PurePosixPath(value)
|
| 9 |
+
if p.is_absolute() or '..' in p.parts or not p.parts:raise ValueError('Unsafe relative data path')
|
| 10 |
+
return Path(*p.parts)
|
| 11 |
+
|
| 12 |
+
def sha(path):
|
| 13 |
+
h=hashlib.sha256()
|
| 14 |
+
with Path(path).open('rb') as f:
|
| 15 |
+
for b in iter(lambda:f.read(8*1024*1024),b''):h.update(b)
|
| 16 |
+
return h.hexdigest()
|
| 17 |
+
|
| 18 |
+
def main():
|
| 19 |
+
p=argparse.ArgumentParser(description=__doc__)
|
| 20 |
+
directory=Path(__file__).absolute().parent
|
| 21 |
+
default_index=directory/'TRAINING_DATA_INDEX.json'
|
| 22 |
+
if not default_index.exists():default_index=directory.parent/'TRAINING_DATA_INDEX.json'
|
| 23 |
+
p.add_argument('--index',type=Path,default=default_index)
|
| 24 |
+
p.add_argument('--dataset',default='legacy_mix6_sft')
|
| 25 |
+
p.add_argument('--output',type=Path,default=Path('training_data_download'))
|
| 26 |
+
p.add_argument('--execute',action='store_true');a=p.parse_args()
|
| 27 |
+
index=json.loads(a.index.read_text());datasets={d['dataset_id']:d for d in index['datasets']}
|
| 28 |
+
if a.dataset=='all_private':ids={r['artifact_id'] for r in index['private_artifacts']}
|
| 29 |
+
elif a.dataset in datasets:ids=set(datasets[a.dataset].get('artifact_ids',[]))
|
| 30 |
+
else:raise ValueError('Unknown dataset ID; inspect index.datasets')
|
| 31 |
+
rows=[r for r in index['private_artifacts'] if r['artifact_id'] in ids]
|
| 32 |
+
if not rows:raise ValueError('No private snapshot artifacts for this dataset; inspect public download location')
|
| 33 |
+
source=index['private_snapshot']
|
| 34 |
+
if not source['repo_id'].startswith('diffusion-gif/training-data-vault-') or source['repo_type']!='dataset' or not source['private']:raise ValueError('Unexpected private data provider')
|
| 35 |
+
print(json.dumps({'dataset':a.dataset,'files':len(rows),'bytes':sum(r['bytes'] for r in rows),'source_repo':source['repo_id'],'revision':source['revision'],'login_required':True,'execute':a.execute},indent=2))
|
| 36 |
+
if not a.execute:return
|
| 37 |
+
from huggingface_hub import get_token,hf_hub_download
|
| 38 |
+
token=get_token()
|
| 39 |
+
if not token:raise RuntimeError('Run hf auth login locally using an account authorized for the private vault. Never put tokens in this file or chat.')
|
| 40 |
+
a.output.mkdir(parents=True,exist_ok=True)
|
| 41 |
+
for r in rows:
|
| 42 |
+
target=a.output/safe(r['path'])
|
| 43 |
+
if target.exists():
|
| 44 |
+
if not target.is_file() or target.stat().st_size!=r['bytes'] or sha(target)!=r['sha256']:raise ValueError('Existing user file differs; will not overwrite')
|
| 45 |
+
continue
|
| 46 |
+
cached=Path(hf_hub_download(repo_id=source['repo_id'],repo_type='dataset',revision=source['revision'],filename=r['path'],token=token,endpoint='https://huggingface.co'))
|
| 47 |
+
if cached.stat().st_size!=r['bytes'] or sha(cached)!=r['sha256']:raise ValueError('Downloaded file SHA256 mismatch')
|
| 48 |
+
target.parent.mkdir(parents=True,exist_ok=True);temporary=target.with_name(target.name+'.copy-partial')
|
| 49 |
+
shutil.copyfile(cached,temporary)
|
| 50 |
+
if sha(temporary)!=r['sha256']:raise ValueError('Copied file SHA256 mismatch')
|
| 51 |
+
temporary.replace(target);print('VERIFIED',r['path'],flush=True)
|
| 52 |
+
print('Done: all selected frozen files downloaded and SHA256 verified. See restore_legacy_mix6.py for a relocatable SFT working copy.')
|
| 53 |
+
if __name__=='__main__':main()
|
restore_legacy_mix6.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Restore legacy SFT observations/JSON working copies; never alter frozen files."""
|
| 3 |
+
import argparse,hashlib,json,tarfile
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
def main():
|
| 7 |
+
p=argparse.ArgumentParser(description=__doc__);p.add_argument('--snapshot-root',required=True,type=Path);p.add_argument('--output',required=True,type=Path);p.add_argument('--execute',action='store_true');a=p.parse_args()
|
| 8 |
+
src=a.snapshot_root/'legacy_mix6';locations={}
|
| 9 |
+
for line in (src/'observations/locations.private.jsonl').open():
|
| 10 |
+
r=json.loads(line);key=(r['split'],r['sid'])
|
| 11 |
+
if key in locations:raise ValueError('Duplicate observation ID')
|
| 12 |
+
if Path(r['archive']).name!=r['archive'] or Path(r['member']).name!=r['member']:raise ValueError('Unsafe archive/member path')
|
| 13 |
+
locations[key]=r
|
| 14 |
+
if not a.execute:
|
| 15 |
+
print(json.dumps({'records':len(locations),'output':str(a.output),'source_snapshot_modified':False,'execute':False},indent=2));return
|
| 16 |
+
if a.output.exists() and any(a.output.iterdir()):raise ValueError('Output must be a new/empty directory; will not overwrite user files')
|
| 17 |
+
a.output.mkdir(parents=True,exist_ok=True);by_archive={}
|
| 18 |
+
for key,r in locations.items():by_archive.setdefault(r['archive'],{})[r['member']]=(key,r)
|
| 19 |
+
for name,entries in by_archive.items():
|
| 20 |
+
with tarfile.open(src/'observations'/name,'r:') as archive:
|
| 21 |
+
for member in archive:
|
| 22 |
+
entry=entries.pop(member.name,None)
|
| 23 |
+
if entry is None or not member.isfile():raise ValueError('Unexpected archive entry')
|
| 24 |
+
(split,sid),r=entry;data=archive.extractfile(member).read()
|
| 25 |
+
if len(data)!=r['bytes'] or hashlib.sha256(data).hexdigest()!=r['sha256']:raise ValueError('Original NPZ checksum differs')
|
| 26 |
+
filename=hashlib.sha256(sid.encode()).hexdigest()[:32]+'.npz'
|
| 27 |
+
target=a.output/'frames'/split/filename;target.parent.mkdir(parents=True,exist_ok=True)
|
| 28 |
+
if target.exists():raise ValueError('Duplicate target frame file')
|
| 29 |
+
target.write_bytes(data)
|
| 30 |
+
if entries:raise ValueError('Missing observation member')
|
| 31 |
+
for split in ('train','heldout'):
|
| 32 |
+
with (src/'sft'/(split+'.jsonl')).open() as inp,(a.output/(split+'.jsonl')).open('w') as out:
|
| 33 |
+
for line in inp:
|
| 34 |
+
r=json.loads(line)
|
| 35 |
+
if (split,r['sid']) not in locations:raise ValueError('Input record lacks backed-up observation')
|
| 36 |
+
r['frames_root']=str((a.output/'frames'/split).resolve())
|
| 37 |
+
r['npz']=hashlib.sha256(r['sid'].encode()).hexdigest()[:32]+'.npz'
|
| 38 |
+
out.write(json.dumps(r,ensure_ascii=False)+'\n')
|
| 39 |
+
print('Restored exact NPZ bytes and re-based SFT train/heldout JSONL. Only npz/frames_root fields in WORKING copies changed; frozen originals are intact.')
|
| 40 |
+
if __name__=='__main__':main()
|