Skip to content

Commit caa1e4c

Browse files
Merge pull request #21 from cdoern/cpu
add cpu support for MMLU bench
2 parents 8494a51 + db228c2 commit caa1e4c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/instructlab/eval/mmlu.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Third Party
77
from lm_eval.evaluator import simple_evaluate # type: ignore
88
from lm_eval.tasks import TaskManager # type: ignore
9+
import torch
910

1011
# First Party
1112
from instructlab.eval.evaluator import Evaluator
@@ -58,6 +59,7 @@ def run(self) -> tuple:
5859
tasks=self.tasks,
5960
num_fewshot=self.few_shots,
6061
batch_size=self.batch_size,
62+
device=("cuda" if torch.cuda.is_available() else "cpu"),
6163
)
6264

6365
results = mmlu_output["results"]

0 commit comments

Comments
 (0)