import json
import sys
from utils import load_json
import rich

path = sys.argv[1]

data = load_json(path)

correct= 0
total= len(data)
wrong = []
for d in data:
    target_idx = str(d['answer_idx'])
    ans = d['rrs'][target_idx][-1]
    if ans==1:
        correct+=1
    else:
        wrong.append((d['inputs'],d['top10_per_layer'][-1][0], d['answer']))

print(f"{correct}/{total} = {(correct/float(total))*100}%")


#rich.print('______')
#for d in wrong:
#    rich.print(d)
#    rich.print("~~~~~~~~~~~")
