Skip to content

Adding lm-eval 0.3.0 as an install req in llama2 #2394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions examples/models/llama2/install_requirement_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

"""
This removes the imported [examples] module from pip installing lm_eval due to
colliding module name with ET package
"""

try:
# If the import fails, this means there's nothing to remove
import examples

try:
# If the import succeeds, this means it isn't using lm_eval's module
import examples.models
except:
print(
"Failed to import examples.models due to lm_eval conflict. Removing lm_eval examples module"
)
import shutil

examples_path = examples.__path__[0]
shutil.rmtree(examples_path)

except:
pass
11 changes: 11 additions & 0 deletions examples/models/llama2/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@
# Install sentencepiece for llama tokenizer
pip install snakeviz sentencepiece
pip install torchao-nightly

# Install datasets for HuggingFace dataloader
# v2.14.0 is intentional to force lm-eval v0.3.0 compatibility
pip install datasets==2.14.0

# Install lm-eval for Model Evaluation with lm-evalution-harness
# v0.3.0 is intentional
pip install lm-eval==0.3.

# Call the install helper for further setup
python examples/models/llama2/install_requirement_helper.py