File size: 754 Bytes
655f931
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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')