avoid keeping less data than the necessary examples for few-shot

This commit is contained in:
svlandeg 2026-01-16 12:27:50 +01:00
parent 50413d2d67
commit 673d75509d

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)