Skip to content

Commit a30f1a5

Browse files
Jack-Khuufacebook-github-bot
authored andcommitted
Adding lm-eval 0.3.0 as an install req in llama2 (#2394)
Summary: Adding install reqs for enabling model evaluation in llama2. The versions are intentional due to conflicts with ET install reqs pip install datasets==2.14.0 pip install lm-eval==0.3.0 Reviewed By: jerryzh168 Differential Revision: D54839623
1 parent 3507412 commit a30f1a5

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
"""
8+
This removes the imported [examples] module from pip installing lm_eval due to
9+
colliding module name with ET package
10+
"""
11+
12+
try:
13+
# If the import fails, this means there's nothing to remove
14+
import examples
15+
16+
try:
17+
# If the import succeeds, this means it isn't using lm_eval's module
18+
import examples.models
19+
except:
20+
print(
21+
"Failed to import examples.models due to lm_eval conflict. Removing lm_eval examples module"
22+
)
23+
import shutil
24+
25+
examples_path = examples.__path__[0]
26+
shutil.rmtree(examples_path)
27+
28+
except:
29+
pass

examples/models/llama2/install_requirements.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@
99
# Install sentencepiece for llama tokenizer
1010
pip install snakeviz sentencepiece
1111
pip install torchao-nightly
12+
13+
# Install datasets for HuggingFace dataloader
14+
# v2.14.0 is intentional to force lm-eval v0.3.0 compatibility
15+
pip install datasets==2.14.0
16+
17+
# Install lm-eval for Model Evaluation with lm-evalution-harness
18+
# v0.3.0 is intentional
19+
pip install lm-eval==0.3.
20+
21+
# Call the install helper for further setup
22+
python examples/models/llama2/install_requirement_helper.py

0 commit comments

Comments
 (0)