#!/usr/bin/env python3 import json, shutil from pathlib import Path ROOT = Path('/home/user/bitnet-tinydialogues') TRAIN = Path('/tmp/bitnet-work/train') DATA = Path('/tmp/bitnet-work/data') best = TRAIN / 'best_model' for f in best.iterdir(): if f.name in {'README.md'}: continue shutil.copy2(f, ROOT / f.name) shutil.copy2(DATA / 'tokenizer.json', ROOT / 'tokenizer.json') (ROOT / 'training').mkdir(exist_ok=True) for f in ['history.json', 'best.json']: if (TRAIN / f).exists(): shutil.copy2(TRAIN / f, ROOT / 'training' / f) if (DATA / 'stats.json').exists(): shutil.copy2(DATA / 'stats.json', ROOT / 'training' / 'data_stats.json') shutil.copy2(ROOT / 'space' / 'Dockerfile', ROOT / 'Dockerfile') print('assembled')