mirror of
https://github.com/karpathy/nanochat.git
synced 2026-07-08 13:59:13 +00:00
Merge 05c8ab093b into 0aaca56805
This commit is contained in:
commit
e11bc43aea
|
|
@ -177,7 +177,7 @@ def evaluate_example(idx, model, tokenizer, data, device, task_meta):
|
||||||
if num_fewshot > 0:
|
if num_fewshot > 0:
|
||||||
rng = random.Random(1234 + idx)
|
rng = random.Random(1234 + idx)
|
||||||
available_indices = [i for i in range(len(data)) if i != 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]
|
fewshot_examples = [data[i] for i in fewshot_indices]
|
||||||
|
|
||||||
# Render prompts and batch sequences based on task type
|
# Render prompts and batch sequences based on task type
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user