"""Offline native-token and prompt checks before freezing the pilot.""" import json from encoding_tax.common import ROOT,load_config,write_json,digest,now,READERS from encoding_tax.data import load_rows from encoding_tax.tokenization import tokenizer from encoding_tax.prompts import serialize,continue_answer from .design import HERE,cases,truth,body,case_id def main(): cfg=load_config(str(HERE/'config.json'));base=load_config() rows=load_rows({'datasets':{'synthetic':cfg['dataset']}},'synthetic','pilot') results={} for reader in READERS: p=base['models'][reader];tok=tokenizer(p['tokenizer_repo'],p['tokenizer_revision']) maxanswer=0;maxprompt=0 for m in cases(rows,reader): text,_=body(m,base);raw=serialize(p,text,'scratchpad');count=tok.count(raw) maxprompt=max(maxprompt,count) assert count+m['budget']+48+64