File size: 692 Bytes
9113ab0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Dump per-item GSM8K correctness for the base and the static loop."""
import argparse, json, os, sys
HERE = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, HERE)
import tfl

ap = argparse.ArgumentParser()
ap.add_argument("--model", choices=["base", "static"], required=True)
ap.add_argument("--n", type=int, default=80)
ap.add_argument("--out", required=True)
args = ap.parse_args()

if args.model == "base":
    m, tok = tfl.load()
else:
    m, tok = tfl.build((8, 11), reps=2, alpha=0.5)
m.eval()
rows = tfl.gsm8k_rows(args.n)
per = tfl.run_gsm8k(m, tok, rows, dump=True)
print(args.model, sum(per), "/", len(per))
json.dump(per, open(args.out, "w"))