Skip to content

Commit

Permalink
Fix sampler constructor in ConfigurableTask
Browse files Browse the repository at this point in the history
  • Loading branch information
pufanyi committed Mar 27, 2024
1 parent 5efc4cb commit 89e89e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lmms_eval/api/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def __init__(self, model_name) -> None: # TODO no super() call here
try:
random_seed = self.config.fewshot_config.get("random_seed", 1234)
sampler_constructor = samplers.get_sampler(self.config.fewshot_config.get("sampler", "default") if self.config.fewshot_config else "default")
self.sampler = sampler_constructor(list(self.fewshot_docs()), self, rnd=random.Random(random_seed))
self.sampler = sampler_constructor(self.fewshot_docs(), self, rnd=random.Random(random_seed))
except Exception as e:
eval_logger.error(f"Error in fewshot_config: {e}")

Expand Down Expand Up @@ -762,7 +762,7 @@ def fewshot_docs(self):
dataset_path=fewshot_dataset_config["dataset_path"],
dataset_name=fewshot_dataset_config.get("dataset_name", None),
split=fewshot_dataset_config["split"],
fewshot_dataset_config=fewshot_dataset_config.get("dataset_kwargs", {}),
dataset_kwargs=fewshot_dataset_config.get("dataset_kwargs", {}),
)
else:
if (self.config.num_fewshot is not None) and (self.config.num_fewshot > 0):
Expand Down

0 comments on commit 89e89e0

Please sign in to comment.