Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-tool-model/blob/main/pilot/prepare.py # omega-tool-model First-party Omega tool-use model source, serving harnesses, and verification records Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-tool-model / pilot / prepare.py` 103 lines ยท 6493 bytes Raw Blame History 1 import os 2 """External curriculum/test instrument. Model operations use native Omega binaries.""" 3 from pathlib import Path 4 import hashlib, json, random, struct, subprocess, os 5 6 R=Path(__file__).parent 7 CPU=(Path(os.path.expanduser('~')) / '/handoffs/weight-tuning-`20261104`/build/ollm'.lstrip('/')) 8 OMC=(Path(os.path.expanduser('~')) / '/handoffs/omega-llm-`20261101`/omega-mv/seed/out/omc'.lstrip('/')) 9 DATA=(Path(os.path.expanduser('~')) / '/handoffs/omega-llm-`20261101`/v1-data'.lstrip('/')) 10 BASE=Path('/tmp/gk/r10/run/ck60000.bin') 11 def run(args, expected=0, **kw): 12 p=subprocess.run([str(x) for x in args],capture_output=True,timeout=120,**kw) 13 assert p.returncode==expected,(args,p.returncode,p.stderr[:300]) 14 return p 15 def sha(p): 16 with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest() 17 def header(p): 18 with p.open('rb') as f:return struct.unpack('<15Q',f.read(120)) 19 20 # Independent reset checks, including parameters, moments, metadata, rejected overwrite. 21 small=R/'build/small.ck'; out=R/'build/reset-small.ck' 22 run([CPU,'init',small,256,8,16,2,32,2,2,1,200,3000,1]) 23 (R/'build/small.bin').write_bytes(b'abc def ghi\0'*100) 24 run([CPU,'train',small,R/'build/small.bin',2,1]) 25 run([R/'build/reset',small,out,1000,300]) 26 hb,ho=header(small),header(out); n=hb[12]*8 27 bb,bo=small.read_bytes(),out.read_bytes() 28 assert bb[120:120+n]==bo[120:120+n] 29 assert not any(bo[120+n:]) and any(bb[120+n:]) 30 assert ho[:9]==hb[:9] and ho[9]==0 and ho[10]==1000 31 assert struct.unpack('