File size: 1,108 Bytes
8efdc48
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Creates two *untrained* independent checkpoints. This is infrastructure, not intelligence."""
import argparse
from pathlib import Path
import torch
from .config import AresConfig
from .model import AresTransformer
from .tokenizer import ByteBPETokenizer
def main():
 p=argparse.ArgumentParser();p.add_argument('--tokenizer',required=True);p.add_argument('--out',default='models');p.add_argument('--dim',type=int,default=256);p.add_argument('--layers',type=int,default=6);p.add_argument('--context',type=int,default=1024);a=p.parse_args()
 t=ByteBPETokenizer.load(a.tokenizer);c=AresConfig(vocab_size=t.vocab_size,dim=a.dim,n_layers=a.layers,n_heads=8,n_kv_heads=2,max_seq_len=a.context);Path(a.out).mkdir(parents=True,exist_ok=True)
 for role in ('ares','xiphos'):
  torch.manual_seed(2026 if role=='ares' else 4141);m=AresTransformer(c);torch.save({'model':m.state_dict(),'config':c.to_dict(),'role':role,'training_complete':False},Path(a.out)/f'{role}-untrained.pt')
 print('Created separate untrained Ares and Xiphos checkpoints. Do not use these for answers or plans.')
if __name__=='__main__':main()