This commit is contained in:
Sofie Van Landeghem 2026-03-28 03:39:31 +00:00 committed by GitHub
commit d6fd29d866
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,7 +154,8 @@ def evaluate_core(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]
accuracy = evaluate_task(model, tokenizer, data, device, task_meta)
results[label] = accuracy