mirror of
https://github.com/karpathy/nanochat.git
synced 2026-04-01 13:15:21 +00:00
Merge 2ef50942ec into 4e1694cc95
This commit is contained in:
commit
d7a89791a4
|
|
@ -177,7 +177,7 @@ def evaluate_example(idx, model, tokenizer, data, device, task_meta):
|
|||
if num_fewshot > 0:
|
||||
rng = random.Random(1234 + idx)
|
||||
available_indices = [i for i in range(len(data)) if i != idx]
|
||||
fewshot_indices = rng.sample(available_indices, num_fewshot)
|
||||
fewshot_indices = rng.sample(available_indices, min(num_fewshot, len(available_indices)))
|
||||
fewshot_examples = [data[i] for i in fewshot_indices]
|
||||
|
||||
# Render prompts and batch sequences based on task type
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user