Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 1f7748d

Browse files
committed
Ok can't remove import lm_eval. Move it inside eval condition
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 4778332 commit 1f7748d

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

install/install_requirements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ fi
103103

104104
(
105105
set -x
106-
$PIP_EXECUTABLE install evaluate=="0.4.3" lm-eval=="0.4.2" "numpy>=1.17,<2.0" psutil=="6.0.0"
106+
$PIP_EXECUTABLE install evaluate=="0.4.3" lm-eval=="0.4.2" psutil=="6.0.0"
107107
)

torchchat/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
)
3232
from torch.nn import functional as F
3333

34+
import lm_eval # noqa
3435
from torchtune.models.clip import clip_vision_encoder
3536
from torchtune.models.llama3_1._component_builders import llama3_1 as llama3_1_builder
3637
from torchtune.models.llama3_2_vision._component_builders import (

torchchat/usages/eval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import torch._dynamo.config
1111
import torch._inductor.config
1212

13-
import lm_eval # noqa
14-
1513
from torchchat.cli.builder import (
1614
_initialize_model,
1715
_initialize_tokenizer,
@@ -30,6 +28,8 @@
3028
torch._inductor.config.triton.cudagraphs = True
3129
torch._dynamo.config.cache_size_limit = 100000
3230

31+
import lm_eval
32+
3333
from lm_eval.evaluator import evaluate
3434
from lm_eval.models.huggingface import HFLM as eval_wrapper
3535
from lm_eval.tasks import get_task_dict

torchchat/utils/scripts/install_et.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ find_cmake_prefix_path
2020
clone_executorch
2121
install_executorch_libs $ENABLE_ET_PYBIND
2222
install_executorch_python_libs $ENABLE_ET_PYBIND
23+
# TODO: figure out the root cause of 'AttributeError: module 'evaluate'
24+
# has no attribute 'utils'' error from evaluate CI jobs and remove
25+
# `import lm_eval` from torchchat.py since it requires a specific version
26+
# of numpy.
27+
pip install numpy=='1.26.4'
2328
popd

0 commit comments

Comments
 (0)