make hellaswag optional eval yay

This commit is contained in:
Andrej Karpathy 2024-05-22 22:42:37 +00:00
parent 67239d9b8f
commit da59861d38
2 changed files with 14 additions and 7 deletions

View file

@ -101,16 +101,11 @@ def render_example(example):
def iterate_examples(split):
# there are 10,042 examples in total in val
n = 0
download(split)
with open(os.path.join(DATA_CACHE_DIR, f"hellaswag_{split}.jsonl"), "r") as f:
for line in f:
example = json.loads(line)
n += 1
yield example
# DEBUGGING, TODO REMOVE
if n >= 101:
break
@torch.no_grad()
def evaluate(model_type, device):