import hashlib, importlib.util, json, os
os.environ['CUDA_VISIBLE_DEVICES']=''
os.environ['TOKENIZERS_PARALLELISM']='false'
from transformers import AutoTokenizer
spec=importlib.util.spec_from_file_location('bench','/home/lab/bench/ornith/modular/shared/bench.py')
bench=importlib.util.module_from_spec(spec);spec.loader.exec_module(bench)
tok=AutoTokenizer.from_pretrained('/home/lab/models/Ornith-1.5-9B-original',local_files_only=True)
for length in [32768,131072]:
    prompt,expected,count=bench.make_prompt(tok,length,256,4400+length*10+10000)
    print(json.dumps({'length':length,'tokens':count,'sha256':hashlib.sha256(prompt.encode()).hexdigest()}))
