This commit is contained in:
Sofie Van Landeghem 2026-01-29 11:44:15 +10:00 committed by GitHub
commit bdd78848dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)