mirror of
https://github.com/karpathy/nanochat.git
synced 2026-01-20 10:23:42 +00:00
avoid keeping less data than the necessary examples for few-shot
This commit is contained in:
parent
50413d2d67
commit
673d75509d
|
|
@ -96,7 +96,8 @@ def evaluate_model(model, tokenizer, device, max_per_task=-1):
|
|||
shuffle_rng = random.Random(1337)
|
||||
shuffle_rng.shuffle(data)
|
||||
if max_per_task > 0:
|
||||
data = data[:max_per_task]
|
||||
data_cutoff = max(task_meta['num_fewshot']+1, max_per_task)
|
||||
data = data[:data_cutoff]
|
||||
|
||||
# run the evaluation for this task
|
||||
accuracy = evaluate_task(model, tokenizer, data, device, task_meta)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user